// Диапазон принимается всегда в Па, в результатах давление будет в переданных единицах измерения public void RunProcess(double rangeMin_Pa, double rangeMax_Pa, PressureUnitsEnum pressureUnits, double classPrecision, bool absoluteType, CancellationToken cancellationToken, IProgress <int> progress) { this.absoluteType = absoluteType; this.rangeMin_Pa = rangeMin_Pa; this.rangeMax_Pa = rangeMax_Pa; this.pressureUnits = pressureUnits; this.classPrecision = classPrecision; measurmentTools.Init(); CreateProgram(cancellationToken, progress); UpdResultsEvent?.Invoke(this, new EventArgs()); foreach (var step in program) { step.Action?.Invoke(); } progress.Report(100); UpdResultsEvent?.Invoke(this, new EventArgs()); measurmentTools.Dispose(); }
private void AddMeasureTestPoint(double point, MeasureResults measureResults, CancellationToken cancellationToken, IProgress <int> progress) { ICheckPoint checkPoint = measurmentTools.GetCheckPoint(point, rangeMin_Pa, rangeMax_Pa, absoluteType, pressureUnits, classPrecision, marginCoefficient, cancellationToken); if (measureResults == null) { measureResults = new MeasureResults(); } measureResults.Add(checkPoint); UpdResultsEvent?.Invoke(this, new EventArgs()); progressValue += deltaProgress; progress.Report((int)progressValue); waitContinue?.Invoke(cancellationToken); }
private void AddRelayTestPoint(double point, CancellationToken cancellationToken, IProgress <int> progress) { var settings = new RelayTestPointSettings(point, rangeMin_Pa, rangeMax_Pa, classPrecision); RelayTestPointUpDown[] relaysTestPoint = relayTestTools.GetTestPoints(settings, absoluteType, pressureUnits, marginCoefficient, cancellationToken); if (RelayTestResults == null) { RelayTestResults = new RelayTestResults[relaysTestPoint.Length]; } for (int i = 0; i < relaysTestPoint.Length; i++) { if (RelayTestResults[i] == null) { RelayTestResults[i] = new RelayTestResults(); } RelayTestResults[i].Add(relaysTestPoint[i]); } UpdResultsEvent?.Invoke(this, new EventArgs()); progressValue += deltaProgress; progress.Report((int)progressValue); waitContinue?.Invoke(cancellationToken); }