public GasSensorInformationWindow(string title, bool canEditID, GasSensorInformation context)
 {
     InitializeComponent();
         this.Title = title;
         if (!canEditID)
             sensorIDbox.IsEnabled = false;
         saveButton.IsEnabled = canEditID;
         this.DataContext = context;
         if ((from rd in context.ResponseCurve where double.IsNaN(rd.Percent) select rd).Count() == 0)
         {
             plotter.AddLineChart(context.DataSource).WithDescription("Response Curve").WithStroke(new SolidColorBrush(DesignColors.Blue)).WithStrokeThickness(2);
         }
         context.LoadResponseCurve();
 }
Пример #2
0
 private async void PrepareResults()
 {
     GasSensorInformation si = new GasSensorInformation();
     foreach (Subcalibration sub in Subcalibrations)
         if (!double.IsNaN(sub.ResponsePoint.Analog))
             si.ResponseCurve.Add(sub.ResponsePoint);
     GasSensorInformationWindow gsiw = new GasSensorInformationWindow("Save Sensor Calibration", true, si);
     gsiw.Show();
     await gsiw.WaitTask;
     if (gsiw.Confirmed)
     {
         System.Windows.Forms.FolderBrowserDialog fbd = new System.Windows.Forms.FolderBrowserDialog();
         fbd.ShowDialog();
         if (Directory.Exists(fbd.SelectedPath))
         {
             si.SaveTo(fbd.SelectedPath);
         }
     }
 }