コード例 #1
0
ファイル: XYGraph_Menu.cs プロジェクト: ping1994/yinghe
        //波形放大操作框 放大按钮
        private void buttonBigXYBig_Click(object sender, EventArgs e)
        {
            double _XB = 0;                  // X起点百分比
            double _XE = 0;                  // X终点百分比

            double _YB = 0;                  // Y起点百分比
            double _YE = 0;                  // Y终点百分比

            buttonBigXYBig.Enabled = false;  //禁用按钮
            buttonBigXYBig.Parent.Focus();   //取消焦点
            pictureBoxBigXY.Visible = false; //隐藏[波形放大框]
            panelBigXY.Visible      = false; //隐藏[波形放大操作框]
            _isBigModeXY            = true;  //标记,启用放大查看模式
            _isAutoModeXY           = false; //标记,取消自动调整大小模式

            坐标自动调整ToolStripMenuItem.Checked = false;

            _changeXYPointsToNum(Graph_View, pictureBoxBigXY.Location.X, pictureBoxBigXY.Location.X + pictureBoxBigXY.Width,
                                 pictureBoxBigXY.Location.Y, pictureBoxBigXY.Location.Y + pictureBoxBigXY.Height,
                                 ref _XB, ref _XE, ref _YB, ref _YE);

            if (_currentXRang == null)
            {
                xAxis_Looking.Range = new NationalInstruments.UI.Range(_XB, _XE);
                _currentXRang       = xAxis_Looking.Range;
            }
            else
            {
                if (_XB != _XE)
                {
                    _currentXRang = xAxis_Looking.Range = new NationalInstruments.UI.Range(_XB, _XE);
                }
            }

            //if (_currentYRang == null)
            //{
            //    yAxis_Looking.Range = new NationalInstruments.UI.Range(Math.Round(_YE * _defaultXRang.Maximum, MidpointRounding.AwayFromZero), Math.Round(_YB * _defaultXRang.Maximum, MidpointRounding.AwayFromZero));
            //    _currentYRang = yAxis_Looking.Range;
            //}
            //else
            //{
            //    _currentYRang = yAxis_Looking.Range = new NationalInstruments.UI.Range(Math.Round(_YE * _currentYRang.Maximum, MidpointRounding.AwayFromZero), Math.Round(_YB * _currentYRang.Maximum, MidpointRounding.AwayFromZero));
            //}

            panel_itemsIN.Refresh();                            //刷新按钮显示
            buttonBigXYBig.Enabled = true;                      //启用按钮
        }
コード例 #2
0
ファイル: XYGraph_Menu.cs プロジェクト: jyorin/yinghe
        //波形放大操作框 放大按钮
        private void buttonBigXYBig_Click(object sender, EventArgs e)
        {
            double _XB = 0; // X起点百分比
            double _XE = 0; // X终点百分比

            double _YB = 0; // Y起点百分比
            double _YE = 0; // Y终点百分比

            buttonBigXYBig.Enabled = false;                     //禁用按钮
            buttonBigXYBig.Parent.Focus();                      //取消焦点
            pictureBoxBigXY.Visible = false;                    //隐藏[波形放大框]
            panelBigXY.Visible = false;                         //隐藏[波形放大操作框]
            _isBigModeXY = true;                                //标记,启用放大查看模式
            _isAutoModeXY = false;                              //标记,取消自动调整大小模式

            坐标自动调整ToolStripMenuItem.Checked = false;

            _changeXYPointsToNum(Graph_View, pictureBoxBigXY.Location.X, pictureBoxBigXY.Location.X + pictureBoxBigXY.Width,
                pictureBoxBigXY.Location.Y, pictureBoxBigXY.Location.Y + pictureBoxBigXY.Height,
                ref _XB, ref _XE, ref _YB, ref _YE);

            if (_currentXRang == null)
            {
                xAxis_Looking.Range = new NationalInstruments.UI.Range(_XB,_XE);
                _currentXRang = xAxis_Looking.Range;
            }
            else
            {
                if (_XB != _XE)
                _currentXRang =  xAxis_Looking.Range = new NationalInstruments.UI.Range(_XB, _XE);
            }

            //if (_currentYRang == null)
            //{
            //    yAxis_Looking.Range = new NationalInstruments.UI.Range(Math.Round(_YE * _defaultXRang.Maximum, MidpointRounding.AwayFromZero), Math.Round(_YB * _defaultXRang.Maximum, MidpointRounding.AwayFromZero));
            //    _currentYRang = yAxis_Looking.Range;
            //}
            //else
            //{
            //    _currentYRang = yAxis_Looking.Range = new NationalInstruments.UI.Range(Math.Round(_YE * _currentYRang.Maximum, MidpointRounding.AwayFromZero), Math.Round(_YB * _currentYRang.Maximum, MidpointRounding.AwayFromZero));
            //}

            panel_itemsIN.Refresh();                             //刷新按钮显示
            buttonBigXYBig.Enabled = true;                      //启用按钮
        }