コード例 #1
0
 public void FittingChangeOfEGraphicFromEnd(int index)
 {
     try
     {
         for (int i = 0; i < pointsChangeOfE.Count; i++)
         {
             if (i < index - 1)
             {
                 pointsChangeOfEFitting.Add(pointsChangeOfE[i]);
             }
         }
         deleteChangeOfEGraphic();
         plotterChangeOfE.LegendVisible = false;
     }
     catch (Exception ex)
     {
         Logger.WriteNode(ex.Message.ToString() + "[VelocityOfChangeParametersXY.xaml.cs] {public void FittingChangeOfEGraphicFromEnd(int index)}", System.DateTime.Now);
     }
 }
コード例 #2
0
        /// <summary>
        /// NAPOMENA: Fitovana promena elongacije se izracunava u konstruktoru !!!
        /// </summary>
        /// <param name="filepath"></param>
        /// <param name="rp02"></param>
        /// <param name="onlineMode"></param>
        public E2E4CalculationAfterManualFitting(string filepath, double rp02, OnlineMode onlineMode)
        {
            try
            {
                this.onlineMode = onlineMode;

                string nameChangedParameters = 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


                //get fitting points for change of R greater than rp02/2
                int ii;
                for (ii = 0; ii < pointsChangeOfR.Count; ii++)
                {
                    if (arrayROfEndOfInterval[ii] < rp02 / 2)
                    {
                    }
                    else
                    {
                        ii--;
                        break;
                    }
                }


                int iiUntilA;
                for (iiUntilA = 0; iiUntilA < pointsChangeOfR.Count; iiUntilA++)
                {
                    if (arrayElongationOfEndOfInterval[iiUntilA] <= onlineMode.Plotting.A)
                    {
                    }
                    else
                    {
                        iiUntilA--;
                        break;
                    }
                }


                for (int j = 0; j < pointsChangeOfR.Count; j++)
                {
                    if (j > ii && j < iiUntilA)
                    {
                        pointsChangeOfRFitting.Add(pointsChangeOfR[j]);
                    }
                }
                for (int j = 0; j < pointsChangeOfE.Count; j++)
                {
                    if (/*j > ii &&*/ j < iiUntilA)
                    {
                        pointsChangeOfEFitting.Add(pointsChangeOfE[j]);
                    }
                }

                indexFromChangedParametersFittingRp02   = ii;
                indexFromChangedParametersFittingUntilA = iiUntilA;
            }
            catch (Exception ex)
            {
                Logger.WriteNode(ex.Message.ToString() + "[E2E4CalculationAfterManualFitting.cs] {public E2E4CalculationAfterManualFitting(string filepath, double rp02, OnlineMode onlineMode)}", System.DateTime.Now);
            }
        }