コード例 #1
0
 public Subcalibration(BiomassResponseData sensorRD, string symbol, string unit)
 {
     this.ResponsePoint = sensorRD;
     this.Symbol = symbol;
     this.Unit = unit;
     CaptureCommand = new RelayCommand(delegate
     {
         OnRequestCaptureEvent(this, new EventArgs());
     }, () => State != SubcalibrationState.Running);
     AbortCommand = new RelayCommand(delegate
     {
         SensorDataSet.Clear();
         if (!finishTask.IsCompleted)
             finishTask.Start();
     }, () => State == SubcalibrationState.Running);
 }
コード例 #2
0
 private void UpdateNumberOfSubcalibrations()
 {
     if (Subcalibrations.Count > TotalCalibrationPoints) // case 1: zu viele -> range löschen
     {
         //remove extra subcalibrations
         for (int i = TotalCalibrationPoints; i < Subcalibrations.Count; i++)
             Subcalibrations.RemoveAt(i);
     }
     else if (TotalCalibrationPoints > Subcalibrations.Count) // case 2: zu wenige -> hinzufügen
     {
         for (int i = Subcalibrations.Count; i < TotalCalibrationPoints; i++)
         {
             BiomassResponseData brd = new BiomassResponseData() { OD = 0.1 * Math.Pow(2, i), CalibrationDuration = 20 };
             Subcalibration sub = new Subcalibration(brd, CalibrationProfiles.Symbols[CalibrationTarget], CalibrationProfiles.Units[CalibrationTarget]) { Target = CalibrationTarget };
             sub.RequestCapture += sub_RequestCapture;
             sub.CaptureEnded += sub_CaptureEnded;
             Subcalibrations.Add(sub);
         }
     }
 }