Exemple #1
0
        private void setGraphFromSelectedFanData()
        {
            if (mSelectedFanData == null)
            {
                return;
            }

            var unit = mSelectedFanData.Unit;

            if (unit == FanValueUnit.Size_1)
            {
                mGraph.GraphPane.XAxis.Scale.MinorStep = 1;
                mGraph.GraphPane.YAxis.Scale.MinorStep = 1;
                mLineItem.Symbol.Size = 2.0f;
            }
            else if (unit == FanValueUnit.Size_5)
            {
                mGraph.GraphPane.XAxis.Scale.MinorStep = 5;
                mGraph.GraphPane.YAxis.Scale.MinorStep = 5;
                mLineItem.Symbol.Size = 10.0f;
            }
            else
            {
                mGraph.GraphPane.XAxis.Scale.MinorStep = 10;
                mGraph.GraphPane.YAxis.Scale.MinorStep = 10;
                mLineItem.Symbol.Size = 10.0f;
            }

            //mGraph.GraphPane.CurveList.Clear();
            mPointList.Clear();
            for (int i = 0; i < mSelectedFanData.getMaxFanValue(); i++)
            {
                mPointList.Add(mSelectedFanData.getDivideValue() * i, mSelectedFanData.ValueList[i]);
            }
            mGraph.Refresh();
        }
Exemple #2
0
        private void setGraphFromSelectedFanData()
        {
            if (mSelectedFanData == null)
            {
                return;
            }

            var unit = mSelectedFanData.Unit;

            if (unit == FanValueUnit.Size_1)
            {
                mGraph.GraphPane.XAxis.Scale.MinorStep = 1;
                mGraph.GraphPane.YAxis.Scale.MinorStep = 1;
                mLineItem.Symbol.Size = 2.0f;
            }
            else if (unit == FanValueUnit.Size_5)
            {
                mGraph.GraphPane.XAxis.Scale.MinorStep = 5;
                mGraph.GraphPane.YAxis.Scale.MinorStep = 5;
                mLineItem.Symbol.Size = 10.0f;
            }
            else
            {
                mGraph.GraphPane.XAxis.Scale.MinorStep = 10;
                mGraph.GraphPane.YAxis.Scale.MinorStep = 10;
                mLineItem.Symbol.Size = 10.0f;
            }

            if (mUnitComboBox.SelectedIndex == 0)
            {
                mAutoNumericUpDown.Increment = 1;
                mAutoNumericUpDown.Value     = mSelectedFanData.Auto;
            }
            else if (mUnitComboBox.SelectedIndex == 1)
            {
                mAutoNumericUpDown.Increment = 5;
                mAutoNumericUpDown.Value     = mSelectedFanData.Auto / 5 * 5;
            }
            else
            {
                mAutoNumericUpDown.Increment = 10;
                mAutoNumericUpDown.Value     = mSelectedFanData.Auto / 10 * 10;
            }

            //mGraph.GraphPane.CurveList.Clear();
            mPointList.Clear();
            for (int i = 0; i < mSelectedFanData.getMaxFanValue(); i++)
            {
                mPointList.Add(mSelectedFanData.getDivideValue() * i, mSelectedFanData.ValueList[i]);
            }

            int value = mSelectedFanData.Auto;

            mAutoPolyObj.Points = new[]
            {
                new ZedGraph.PointD(0, 0),
                new ZedGraph.PointD(value, 0),
                new ZedGraph.PointD(value, 100),
                new ZedGraph.PointD(0, 100),
                new ZedGraph.PointD(0, 0),
            };

            mGraph.Refresh();
        }