コード例 #1
0
 private void sirfawareToolStripPlotBtn_Click(object sender, EventArgs e)
 {
     if (this._MPMPlotWin == null)
     {
         this._MPMPlotWin = new frmMPMStatsPlots();
         this._MPMPlotWin.MdiParent = base.MdiParent;
         this._MPMPlotWin.UpdateStatusToParentWin += new frmMPMStatsPlots.UpdateParentEventHandler(this.updatePlotStatus);
         this._MPMPlotWin.UpdateStatsData += new frmMPMStatsPlots.UpdateParentEventHandler(this.RefreshMPMPlot);
     }
     this.sirfawareToolStripPlotBtn.Enabled = false;
     this.sirfawareToolStripAddPlotBtn.Enabled = true;
     if (this.sirfawareToolStripPlotTitleTxtBox.Text == string.Empty)
     {
         this.sirfawareToolStripPlotTitleTxtBox.Text = this.sirfawareToolStripDataSetBtn.Text + " vs TOW";
     }
     this.getPlotData(this.sirfawareToolStripDataSetBtn.SelectedIndex, this.sirfawareToolStripPlotTitleTxtBox.Text, this._currentCurveColor);
     this._curvePlotIndicesList.Add(this.sirfawareToolStripDataSetBtn.SelectedIndex);
     this._curvePlotTitlesList.Add(this.sirfawareToolStripPlotTitleTxtBox.Text);
     this._curvePlotColorsList.Add(this._currentCurveColor);
     this._MPMPlotWin.Text = string.Format("{0}: SiRFaware Plots", this.comm.PortName);
     this._MPMPlotWin.Show();
 }
コード例 #2
0
 private void updatePlotStatus()
 {
     this.sirfawareToolStripPlotBtn.Enabled = true;
     this.sirfawareToolStripAddPlotBtn.Enabled = false;
     this._MPMPlotWin = null;
     this._curvePlotIndicesList.Clear();
     this._curvePlotTitlesList.Clear();
     this._curvePlotColorsList.Clear();
 }
コード例 #3
0
ファイル: Report.cs プロジェクト: facchinm/SiRFLive
 public void Summary_MPM(string directoryPath)
 {
     StreamReader reader = null;
     StreamWriter writer = null;
     PortManager manager = new PortManager();
     List<string> list = null;
     List<double> list2 = new List<double>();
     List<double> list3 = new List<double>();
     List<double> list4 = new List<double>();
     List<double> list5 = new List<double>();
     List<double> list6 = new List<double>();
     List<double> list7 = new List<double>();
     try
     {
         FileInfo[] files = new DirectoryInfo(directoryPath).GetFiles("*.gps");
         int[] numArray = new int[8];
         string[] strArray = new string[] { "Not Use", "SV Data", "Eph Collection", "Almanac Collection", "GPS Update", "Recovery Mode", "Not Use", "Full Pwr SV Data Update" };
         if (files.Length != 0)
         {
             new ArrayList();
             foreach (FileInfo info2 in files)
             {
                 reader = info2.OpenText();
                 writer = new StreamWriter(info2.FullName.Replace(".gps", "_mpmPar.csv"));
                 List<SiRFawareStatsParams> list8 = new List<SiRFawareStatsParams>();
                 list = new List<string>();
                 string name = info2.Name;
                 Hashtable siRFAwareScanResHash = null;
                 string csvString = reader.ReadLine();
                 string str3 = "Not Detect";
                 bool flag = false;
                 bool flag2 = false;
                 for (int i = 0; i < numArray.Length; i++)
                 {
                     numArray[i] = 0;
                 }
                 while (csvString != null)
                 {
                     if (csvString.StartsWith("77,1"))
                     {
                         siRFAwareScanResHash = manager.comm.getMPMStatsDataForGUIFromCSV(0x4d, 1, "OSP", csvString);
                         flag2 = true;
                         list.Add(csvString);
                     }
                     else if (csvString.StartsWith("77,2"))
                     {
                         siRFAwareScanResHash = manager.comm.getMPMStatsDataForGUIFromCSV(0x4d, 2, "OSP", csvString);
                         flag2 = true;
                         list.Add(csvString);
                     }
                     else if (csvString.StartsWith("77,3"))
                     {
                         siRFAwareScanResHash = manager.comm.getMPMStatsDataForGUIFromCSV(0x4d, 3, "OSP", csvString);
                         flag2 = true;
                         list.Add(csvString);
                     }
                     else if (csvString.StartsWith("77,4"))
                     {
                         siRFAwareScanResHash = manager.comm.getMPMStatsDataForGUIFromCSV(0x4d, 4, "OSP", csvString);
                         flag2 = true;
                         list.Add(csvString);
                     }
                     else if (csvString.StartsWith("77,5"))
                     {
                         siRFAwareScanResHash = manager.comm.getMPMStatsDataForGUIFromCSV(0x4d, 5, "OSP", csvString);
                         flag2 = true;
                         list.Add(csvString);
                     }
                     else if (csvString.StartsWith("77,7"))
                     {
                         siRFAwareScanResHash = manager.comm.getMPMStatsDataForGUIFromCSV(0x4d, 7, "OSP", csvString);
                         flag2 = true;
                         list.Add(csvString);
                     }
                     else if (!flag && csvString.Contains("SW Version"))
                     {
                         string pattern = @"SW Version*:\s*(?<swVer>.*)";
                         Regex regex = new Regex(pattern, RegexOptions.Compiled);
                         if (regex.IsMatch(csvString))
                         {
                             str3 = regex.Match(csvString).Result("${swVer}");
                             flag = true;
                             list.Add(csvString);
                         }
                     }
                     if (flag2)
                     {
                         SiRFawareStatsParams item = manager.comm.RxCtrl.DecodeMPMStats(siRFAwareScanResHash);
                         if (item != null)
                         {
                             list8.Add(item);
                         }
                     }
                     csvString = reader.ReadLine();
                 }
                 list2.Clear();
                 list3.Clear();
                 list4.Clear();
                 list5.Clear();
                 list6.Clear();
                 list7.Clear();
                 foreach (SiRFawareStatsParams params2 in list8)
                 {
                     if (params2.isValid_TimeSpentInFullPowerSec)
                     {
                         list2.Add((double) params2.TOW);
                         list3.Add((double) params2.TimeSpentInFullPowerSec);
                     }
                     if (params2.isValid_TotalSVMeasureWithBE)
                     {
                         list4.Add((double) params2.TOW);
                         list5.Add((double) params2.TotalSVMeasureWithBE);
                     }
                     if (params2.isValid_TotalSVMeasureWithEE)
                     {
                         list6.Add((double) params2.TOW);
                         list7.Add((double) params2.TotalSVMeasureWithEE);
                     }
                     if ((params2.UpdateType >= 0) && (params2.UpdateType < numArray.Length))
                     {
                         numArray[params2.UpdateType]++;
                     }
                 }
                 frmMPMStatsPlots plots = new frmMPMStatsPlots();
                 string label = "On Time(s)";
                 Color blue = Color.Blue;
                 plots.SetPlotData(list2.ToArray(), list3.ToArray(), "SiRFaware Plot(s)", label, blue);
                 plots.Show();
                 label = "Total SVs With BE";
                 blue = Color.Green;
                 plots.SetPlotData(list4.ToArray(), list5.ToArray(), "SiRFaware Plot(s)", label, blue);
                 plots.AddCurveToPlot();
                 label = "Total SVs With EE";
                 blue = Color.Purple;
                 plots.SetPlotData(list6.ToArray(), list7.ToArray(), "SiRFaware Plot(s)", label, blue);
                 plots.AddCurveToPlot();
                 plots.Width = 0x3e8;
                 plots.SavePlots(info2.FullName.Replace(".gps", ".jpeg"));
                 plots.Close();
                 writer.WriteLine("Data File Path = {0}", name);
                 writer.WriteLine("SW Version = {0}", str3);
                 for (int j = 1; j < numArray.Length; j++)
                 {
                     if (j != 6)
                     {
                         writer.WriteLine("{0} = {1}", strArray[j], numArray[j]);
                     }
                 }
                 writer.WriteLine("End Summary");
                 foreach (string str6 in list)
                 {
                     writer.WriteLine(str6);
                 }
                 reader.Close();
                 writer.Close();
                 if (list != null)
                 {
                     list.Clear();
                     list = null;
                 }
             }
             this.mpmReportGen(directoryPath);
         }
     }
     catch
     {
         list2.Clear();
         list3.Clear();
         list4.Clear();
         list5.Clear();
         list6.Clear();
         list7.Clear();
         if (reader != null)
         {
             reader.Close();
             reader = null;
         }
         if (writer != null)
         {
             writer.Close();
             writer = null;
         }
         if (manager != null)
         {
             manager = null;
         }
         if (list != null)
         {
             list.Clear();
             list = null;
         }
     }
 }