示例#1
0
        public void Refresh3()
        {
            // given
            Chart chart1 = TestObjects.GetChart(null);

            // when
            ChartAssist.Refresh(null, Color.Indigo, chart1, 0, 0);
        }
示例#2
0
        public void Refresh2()
        {
            // given
            Series series1 = TestObjects.GetSeries();
            Chart  chart1  = TestObjects.GetChart(series1);

            // when
            ChartAssist.Refresh(series1, Color.Indigo, chart1, -1, 0);
        }
示例#3
0
        public void Refresh5()
        {
            // given
            IList <double> set = new List <double>()
            {
                -7.92E28, double.NaN, 7.92E28
            };
            Series series2 = TestObjects.GetSeries(set);
            Chart  chart2  = TestObjects.GetChart(series2);

            // when
            ChartAssist.Refresh(series2, Color.Indigo, chart2);
        }
示例#4
0
        public void Refresh4()
        {
            // given
            IList <double> set = new List <double>()
            {
                double.MinValue, double.NaN, double.MaxValue
            };
            Series series1 = TestObjects.GetSeries(set);
            Chart  chart1  = TestObjects.GetChart(series1);

            // when
            ChartAssist.Refresh(series1, Color.Indigo, chart1);
        }
示例#5
0
文件: MainWindow.cs 项目: vego1mar/PI
        private void OnShowDataSetClick(object sender, EventArgs e)
        {
            DataSetCurveType curveType = (DataSetCurveType)UiControls.TryGetSelectedIndex(uiPnlMod_CrvT_ComBx);
            int    curveIndex          = UiControls.TryGetValue <int>(uiPnlMod_CrvIdx_Num);
            string signature           = MethodBase.GetCurrentMethod().Name + '(' + curveType + ',' + curveIndex + ')';

            switch (curveType)
            {
            case DataSetCurveType.Ideal:
            case DataSetCurveType.Modified:
            case DataSetCurveType.Average:
                break;

            default:
                log.Info(signature);
                AppMessages.MainWindow.AsteriskOfCurveTypeNotSelected();
                return;
            }

            Series curveSeries = SpecifyCurveSeries(curveType, curveIndex);

            if (curveSeries == null || curveSeries.Points.Count == 0)
            {
                log.Info(MethodBase.GetCurrentMethod().Name + '(' + nameof(curveSeries) + ')');
                AppMessages.MainWindow.ExclamationOfSeriesSelection();
                return;
            }

            using (var dialog = new GridPreviewer(SeriesAssist.GetCopy(curveSeries))) {
                dialog.Height = Settings.Dimensions.GridPreviewer.Height;
                dialog.Width  = Settings.Dimensions.GridPreviewer.Width;
                UiControls.TryShowDialog(dialog, this);

                try {
                    if (dialog.DialogResult == DialogResult.OK)
                    {
                        DataChart.AlterCurve(dialog.Curve, curveType, curveIndex);
                        ChartAssist.Refresh(dialog.Curve, Color.Indigo, uiCharts_Crv);
                    }
                }
                catch (InvalidOperationException ex) {
                    log.Error(signature, ex);
                    AppMessages.MainWindow.ErrorOfChartRefreshing();
                }
                catch (Exception ex) {
                    log.Fatal(signature, ex);
                }
            }

            log.Info(signature);
        }
示例#6
0
        private void UpdateUiByRefreshingChart()
        {
            try {
                ChartAssist.Refresh(Curve, Color.Black, uiChart_Prv);
            }
            catch (InvalidOperationException ex) {
                log.Error(MethodBase.GetCurrentMethod().Name + '(' + PanelStateInformation.ChartNotRepainted + ')', ex);
                UpdateUiByPanelStateInfo(PanelStateInformation.ChartNotRepainted);
                AppMessages.GridPreviewer.ErrorOfChartRefreshing();
            }
            catch (Exception ex) {
                log.Error(MethodBase.GetCurrentMethod().Name + '(' + PanelStateInformation.ChartRefreshingError + ')', ex);
                UpdateUiByPanelStateInfo(PanelStateInformation.ChartRefreshingError);
            }

            UpdateUiByPanelStateInfo(PanelStateInformation.ChartRefreshed);
            log.Info(MethodBase.GetCurrentMethod().Name + '(' + PanelStateInformation.ChartRefreshed + ')');
        }
示例#7
0
        private void UpdateUiByRefreshingChart()
        {
            string signature = string.Empty;

            try {
                signature = MethodBase.GetCurrentMethod().Name + '(' + (DataSetCurveType)UiControls.TryGetSelectedIndex(uiRChartDown_CrvT_ComBx) + ')';
                ChartAssist.Refresh(GetUiSpecifiedSeries(), GetChartSeriesColor(), uiRChart_Chart);
            }
            catch (InvalidOperationException ex) {
                log.Fatal(signature, ex);
                AppMessages.StatisticalAnalysis.ExclamationOfPointsNotValidToChart();
            }
            catch (OverflowException ex) {
                log.Fatal(signature, ex);
                AppMessages.StatisticalAnalysis.ExclamationOfValueOutOfRange();
            }
            catch (Exception ex) {
                log.Fatal(signature, ex);
                AppMessages.StatisticalAnalysis.ErrorOfUnrecognized();
            }
        }
示例#8
0
文件: MainWindow.cs 项目: vego1mar/PI
        private void UpdateUiByShowingCurveOnChart(DataSetCurveType curveType, int indexOfModifiedCurve = 1)
        {
            const int CHART_AREA_INDEX = 0;
            const int SERIES_INDEX     = 0;

            try {
                Series selectedSeries = null;

                switch (curveType)
                {
                case DataSetCurveType.Ideal:
                    CurvesSettings.Set(uiCharts_Crv, Settings.Series.Ideal, SERIES_INDEX);
                    selectedSeries = DataChart.IdealCurve;
                    break;

                case DataSetCurveType.Modified:
                    CurvesSettings.Set(uiCharts_Crv, Settings.Series.Modified, SERIES_INDEX);
                    selectedSeries = DataChart.ModifiedCurves[indexOfModifiedCurve - 1];
                    break;

                case DataSetCurveType.Average:
                    CurvesSettings.Set(uiCharts_Crv, Settings.Series.Average, SERIES_INDEX);
                    selectedSeries = DataChart.AverageCurve;
                    break;
                }

                ChartAssist.Refresh(selectedSeries, uiCharts_Crv.Series[0].Color, uiCharts_Crv, CHART_AREA_INDEX, SERIES_INDEX);
            }
            catch (InvalidOperationException ex) {
                log.Error(ex.Message, ex);
                AppMessages.MainWindow.ErrorOfChartRefreshing();
            }
            catch (ArgumentOutOfRangeException ex) {
                log.Error(ex.Message, ex);
                AppMessages.MainWindow.ExclamationOfSeriesSelection();
            }
            catch (Exception ex) {
                log.Fatal(ex.Message, ex);
            }
        }