Beispiel #1
0
        private void CalculateStandardDeviations()
        {
            int            meanTypes = new MeanTypesStrings().Count();
            double         stdDeviation;
            IList <double> averagesValues;
            IList <double> idealValues;

            for (int i = 0; i < Data.Count; i++)
            {
                for (int j = 0; j < Noises.Count; j++)
                {
                    Data[i][j].GenerateIdealCurve(Settings.Pcd.Scaffold, Settings.Pcd.Parameters, Settings.Ui.StartX, Settings.Ui.EndX, Settings.Ui.PointsNo);
                    Data[i][j].PropagateIdealCurve(Settings.Ui.CurvesNo);
                    Data[i][j].MakeNoiseOfGaussian(Settings.Ui.CurvesNo, Noises[j]);
                    MakeMalformation((Phenomenon)i, Data[i][j], Settings.Ui.CurvesNo / 2);

                    for (int k = 0; k < meanTypes; k++)
                    {
                        Data[i][j].TryMakeAverageCurve((MeanType)k, Settings.Ui.CurvesNo);
                        SeriesAssist.CopyPoints(Data[i][j].AverageCurve, Averages[i][j][k]);
                        averagesValues         = SeriesAssist.GetValues(Averages[i][j][k]);
                        idealValues            = SeriesAssist.GetValues(Data[i][j].IdealCurve);
                        stdDeviation           = Mathematics.GetRelativeStandardDeviation(averagesValues, idealValues);
                        StdDeviations[i][j][k] = stdDeviation;
                    }
                }
            }
        }
Beispiel #2
0
        private void OnResetClick(object sender, EventArgs e)
        {
            Series copy = SeriesAssist.GetCopy(Curve);

            Curve.Points.Clear();
            SeriesAssist.CopyPoints(Curve, copy, Originals);
            GridAssist.PopulateColumn(uiGrid_db_grid, y.Name, SeriesAssist.GetValues(Curve), VALUES_DECIMAL_PLACES);
            UpdateUiByRefreshingChart();
            UpdateUiByPanelStateInfo(PanelStateInformation.ValuesRestored);
            log.Info(MethodBase.GetCurrentMethod().Name + "()");
        }
Beispiel #3
0
        private void OnPerformClick(object sender, EventArgs e)
        {
            Operation @operator = (Operation)UiControls.TryGetSelectedIndex(uiPnl_OperT_ComBx);
            double?   userValue = (@operator == Operation.Positive || @operator == Operation.Negative) ? default(double) : Strings.TryGetValue(uiPnl_Val2_TxtBx.Text);

            if (userValue == null || Curve == null)
            {
                log.Info(MethodBase.GetCurrentMethod().Name + '(' + userValue + ',' + Curve + ')');
                UpdateUiByPanelStateInfo(PanelStateInformation.InvalidUserValue);
                AppMessages.GridPreviewer.ExclamationOfImproperUserValue();
                return;
            }

            int       startIndex = UiControls.TryGetValue <int>(uiPnl_StartIdx_Num);
            int       endIndex   = UiControls.TryGetValue <int>(uiPnl_EndIdx_Num);
            Series    seriesCopy = SeriesAssist.GetCopy(Curve);
            Operation operation  = (Operation)uiPnl_OperT_ComBx.SelectedIndex;
            string    signature  = string.Empty;

            try {
                signature = MethodBase.GetCurrentMethod().Name + '(' + startIndex + ',' + endIndex + ',' + operation + ',' + userValue.Value + ')';
                SeriesAssist.Alter(operation, userValue.Value, seriesCopy, startIndex, endIndex);
            }
            catch (NotFiniteNumberException ex) {
                log.Error(signature, ex);
                UpdateUiByPanelStateInfo(PanelStateInformation.OperationRevoked);
                AppMessages.GridPreviewer.ErrorOfInvalidCurvePoints();
                return;
            }
            catch (Exception ex) {
                log.Fatal(signature, ex);
                UpdateUiByPanelStateInfo(PanelStateInformation.OperationRejected);
                AppMessages.GridPreviewer.ErrorOfPerformOperation();
                return;
            }

            Curve.Points.Clear();
            SeriesAssist.CopyPoints(seriesCopy, Curve);
            GridAssist.PopulateColumn(uiGrid_db_grid, y.Name, SeriesAssist.GetValues(Curve), VALUES_DECIMAL_PLACES);
            UpdateUiByRefreshingChart();
            UpdateUiByPanelStateInfo(PanelStateInformation.PerformedAndRefreshed);
            log.Info(signature);
        }