コード例 #1
0
 private void clearE2E4Data()
 {
     try
     {
         arrayChangeValueOfR.Clear();
         arrayChangeValueOfE.Clear();
         arrayElongationOfEndOfInterval.Clear();
         arrayROfEndOfInterval.Clear();
         pointsChangeOfR.Clear();
         pointsChangeOfE.Clear();
     }
     catch (Exception ex)
     {
         Logger.WriteNode(ex.Message.ToString() + "[E2E4CalculationAfterManualFitting.cs] {private void clearE2E4Data()}", System.DateTime.Now);
     }
 }
コード例 #2
0
        private void createChangeOfRGraphic_Fitting(MyPointCollection fittingChangeOfR)
        {
            try
            {
                deleteChangeOfRGraphic_Fitting();

                int maxPoints = 300000;
                pointsChangeOfRFitting = new MyPointCollection(maxPoints);
                pointsChangeOfRFitting.Clear();
                pointsChangeOfRFitting = fittingChangeOfR;

                var ds = new EnumerableDataSource <MyPoint>(pointsChangeOfRFitting);
                ds.SetXMapping(x => x.XAxisValue);
                ds.SetYMapping(y => y.YAxisValue);


                plotterChangeOfR.AddLineGraph(ds, Colors.Blue, 2, "Promena fitovanog R-a"); // to use this method you need "using Microsoft.Research.DynamicDataDisplay;"
                plotterChangeOfR.LegendVisible = false;


                if (OptionsInOnlineModeChangeOfRAndE.isManualCheckedChangeR == true)
                {
                    plotterChangeOfR.Viewport.AutoFitToView = true;
                    ViewportAxesRangeRestriction restr = new ViewportAxesRangeRestriction();
                    restr.YRange = new DisplayRange(-0.5, OptionsInOnlineModeChangeOfRAndE.yRangeChangeR);
                    restr.XRange = new DisplayRange(-0.5, OptionsInOnlineModeChangeOfRAndE.xRangeChangeR);

                    plotterChangeOfR.Viewport.Restrictions.Add(restr);
                }

                if (OptionsInOnlineModeChangeOfRAndE.isAutoCheckedChangeR == true)
                {
                    plotterChangeOfR.FitToView();
                    plotterChangeOfR.Viewport.Restrictions.Clear();
                }
            }
            catch (Exception ex)
            {
                Logger.WriteNode(ex.Message.ToString() + "[VelocityOfChangeParametersXY.xaml.cs] {private void createChangeOfRGraphic_Fitting(MyPointCollection fittingChangeOfR)}", System.DateTime.Now);
            }
        }
コード例 #3
0
        public void createChangeOfEGraphicFitting()
        {
            try
            {
                deleteChangeOfEGraphic();

                int maxPoints = 300000;
                pointsChangeOfE = new MyPointCollection(maxPoints);
                pointsChangeOfE.Clear();

                var ds = new EnumerableDataSource <MyPoint>(pointsChangeOfEFitting);
                ds.SetXMapping(x => x.XAxisValue);
                ds.SetYMapping(y => y.YAxisValue);


                plotterChangeOfE.AddLineGraph(ds, Colors.Blue, 2, "Promena e-a"); // to use this method you need "using Microsoft.Research.DynamicDataDisplay;"
                plotterChangeOfE.LegendVisible = false;

                //if (OptionsInOnlineModeChangeOfRAndE.isManualCheckedChangeElongation == true)
                //{
                plotterChangeOfE.Viewport.AutoFitToView = true;
                ViewportAxesRangeRestriction restr = new ViewportAxesRangeRestriction();
                restr.YRange = new DisplayRange(0.0, /*OptionsInOnlineModeChangeOfRAndE.yRangeChangeElongation*/ pointsChangeOfEFitting.Last().YAxisValue + 0.1 * pointsChangeOfEFitting.Last().YAxisValue);
                restr.XRange = new DisplayRange(0.0, /*OptionsInOnlineModeChangeOfRAndE.xRangeChangeElongation*/ pointsChangeOfEFitting.Last().XAxisValue + 0.1 * pointsChangeOfEFitting.Last().XAxisValue);

                plotterChangeOfE.Viewport.Restrictions.Add(restr);
                //}

                //if (OptionsInOnlineModeChangeOfRAndE.isAutoCheckedChangeElongation == true)
                //{
                //plotterChangeOfE.FitToView();
                //plotterChangeOfE.Viewport.Restrictions.Clear();
                //}
            }
            catch (Exception ex)
            {
                Logger.WriteNode(ex.Message.ToString() + "[VelocityOfChangeParametersXY.xaml.cs] {public void createChangeOfEGraphicFitting()}", System.DateTime.Now);
            }
        }
コード例 #4
0
        public void RecalculateChangeOfRFittingPoints(double rp02, double A)
        {
            try
            {
                pointsChangeOfRFitting.Clear();
                clearE2E4Data();


                string nameChangedParameters = OptionsInPlottingMode.filePath.Split('.').ElementAt(0);
                nameChangedParameters += ".e2e4";
                List <string> dataListChangedParameters = new List <string>();
                if (File.Exists(nameChangedParameters) == true)
                {
                    dataListChangedParameters = File.ReadAllLines(nameChangedParameters).ToList();
                }
                else
                {
                    MessageBox.Show("Ne postoji e2e4 fajl za učitani fajl !");
                }

                for (int i = 0; i < dataListChangedParameters.Count; i++)
                {
                    List <string> currentLine   = dataListChangedParameters[i].Split('*').ToList();
                    double        lastChangeOfR = 0;
                    bool          isN           = Double.TryParse(currentLine[0], out lastChangeOfR);
                    if (isN)
                    {
                        arrayChangeValueOfR.Add(lastChangeOfR);
                    }
                    double lastChangeOfRTau = 0;
                    isN = Double.TryParse(currentLine[1], out lastChangeOfRTau);



                    double lastChangeOfE = 0;
                    isN = Double.TryParse(currentLine[2], out lastChangeOfE);
                    if (isN)
                    {
                        arrayChangeValueOfE.Add(lastChangeOfE);
                    }
                    double lastChangeOfETau = 0;
                    isN = Double.TryParse(currentLine[3], out lastChangeOfETau);


                    double lastElongationOfEndOfInterval = 0;
                    isN = Double.TryParse(currentLine[4], out lastElongationOfEndOfInterval);
                    if (isN)
                    {
                        arrayElongationOfEndOfInterval.Add(lastElongationOfEndOfInterval);
                    }

                    double lastROfEndOfInterval = 0;
                    isN = Double.TryParse(currentLine[5], out lastROfEndOfInterval);
                    if (isN)
                    {
                        arrayROfEndOfInterval.Add(lastROfEndOfInterval);
                    }

                    MyPoint lastpointOfChangeR = new MyPoint(lastChangeOfR, lastChangeOfRTau);
                    pointsChangeOfR.Add(lastpointOfChangeR);
                    MyPoint lastpointOfChangeE = new MyPoint(lastChangeOfE, lastChangeOfETau);
                    pointsChangeOfE.Add(lastpointOfChangeE);
                }//end for loop



                int ii;
                //pointsChangeOfR.Count mora biti jednako arrayROfEndOfInterval.Count
                for (ii = 0; ii < pointsChangeOfR.Count; ii++)
                {
                    if (arrayROfEndOfInterval[ii] < rp02 / 2)
                    {
                    }
                    else
                    {
                        ii--;
                        break;
                    }
                }
                indexFromChangedParametersFittingRp02 = ii;


                int iiUntilA;
                //pointsChangeOfR.Count mora biti jednako arrayElongationOfEndOfInterval.Count
                for (iiUntilA = 0; iiUntilA < pointsChangeOfR.Count; iiUntilA++)
                {
                    if (arrayElongationOfEndOfInterval[iiUntilA] <= A)
                    {
                    }
                    else
                    {
                        iiUntilA--;
                        break;
                    }
                }
                indexFromChangedParametersFittingUntilA = iiUntilA;

                bool firstelement = true;

                for (int j = 0; j < pointsChangeOfR.Count; j++)
                {
                    if (j > indexFromChangedParametersFittingRp02 && j < indexFromChangedParametersFittingUntilA)
                    {
                        if (firstelement == false)
                        {
                            pointsChangeOfRFitting.Add(pointsChangeOfR[j]);
                        }
                        else
                        {
                            firstelement = false;
                        }
                    }
                }


                //for (int j = 0; j < pointsChangeOfE.Count; j++)
                //{
                //    if (j < indexFromChangedParametersFittingUntilA)
                //    {
                //        pointsChangeOfEFitting.Add(pointsChangeOfE[j]);
                //    }
                //}
            }
            catch (Exception ex)
            {
                //MessageBox.Show(ex.Message, "RecalculateChangeOfRFittingPoints");
                //Logger.WriteNode(ex.Message.ToString() + " {RecalculateChangeOfRFittingPoints}", System.DateTime.Now);
                Logger.WriteNode(ex.Message.ToString() + "[E2E4CalculationAfterManualFitting.cs] {public void RecalculateChangeOfRFittingPoints(double rp02, double A)}", System.DateTime.Now);
            }
        }