StartMeasurementOp, ver. 3.1.1628
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2013-2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -24,8 +24,7 @@ namespace TBF.Rig.TestMethods.FlyingStart
|
||||
/// <returns>true when capabilities of devices are OK</returns>
|
||||
public static bool CheckDeviceCaps(Config.Entities.Test test, OutputPath devices, out string message)
|
||||
{
|
||||
if (!(StateMachine.ControlBoard is ControlBoard.Legacy.CBoard) &&
|
||||
!(StateMachine.ControlBoard is ControlBoard.Uni.UniCB))
|
||||
if (!(StateMachine.ControlBoard is ControlBoard.Uni.UniCB))
|
||||
{
|
||||
/// Control board does not support this method
|
||||
message = string.Format("{0}: {1}", test.Name, Strings.Test_bench_does_not_suport_selected_test_method);
|
||||
@@ -70,7 +69,7 @@ namespace TBF.Rig.TestMethods.FlyingStart
|
||||
return Simulate(test, repetitionNr, isLastRepetition, compoundTestParams, heatMetersTestParams, debugLevel);
|
||||
}
|
||||
|
||||
ControlBoard.IControlBoard cBrd = StateMachine.ControlBoard;
|
||||
ControlBoard.Uni.UniCB cBrd = StateMachine.ControlBoard as ControlBoard.Uni.UniCB;
|
||||
|
||||
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
|
||||
if (outPath.FlowMeter is Uni.FlowMeter.FlowMeter)
|
||||
@@ -100,24 +99,21 @@ namespace TBF.Rig.TestMethods.FlyingStart
|
||||
processDataLoggingOp = new TBF.Rig.Operations.ProcessDataLoggingOp(processDataLogger, this, heatMetersTestParams != null);
|
||||
|
||||
|
||||
if (cBrd is ControlBoard.Legacy.CBoard)
|
||||
{
|
||||
int[] filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
int[] filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
|
||||
if (sensPath != null && sensPath.RegisterReaders != null)
|
||||
if (sensPath != null && sensPath.RegisterReaders != null)
|
||||
{
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
IRegReaderPulses eldeRR = rr as IRegReaderPulses;
|
||||
if ((eldeRR != null) && (eldeRR.Position >= 1) && (eldeRR.Position <= 8))
|
||||
{
|
||||
IRegReaderPulses eldeRR = rr as IRegReaderPulses;
|
||||
if ((eldeRR != null) && (eldeRR.Position >= 1) && (eldeRR.Position <= 8))
|
||||
{
|
||||
filters[eldeRR.Position - 1] = eldeRR.Filter;
|
||||
}
|
||||
filters[eldeRR.Position - 1] = eldeRR.Filter;
|
||||
}
|
||||
}
|
||||
|
||||
(cBrd as ControlBoard.Legacy.CBoard).SetFiltersPidShortPulses(filters, outPath.PidCoef, test.ShortPulses);
|
||||
}
|
||||
//cBrd.SetFiltersPidShortPulses(filters, outPath.PidCoef, test.ShortPulses);
|
||||
|
||||
|
||||
IList<IOperation> readTempPressOps = new List<IOperation>();
|
||||
if (benchPath.TempMtrUp != null) readTempPressOps.Add(benchPath.TempMtrUp.ReadTempOp(ref TempUp));
|
||||
@@ -754,17 +750,7 @@ namespace TBF.Rig.TestMethods.FlyingStart
|
||||
|
||||
StopRecordingStatistics();
|
||||
|
||||
State.Create(string.Format("{0}({1}) : Stopping flow regulation", test.Method, test.Name))
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(readTempPressOps)
|
||||
.AddOperation(cBrd.StopFlowRegulationOp())
|
||||
.EnterState();
|
||||
do {
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (e.Contains(Event.Error)) { retVal = Event.Error; break; }
|
||||
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; break; }
|
||||
}
|
||||
while (!e.Contains(Event.FlowRegulationStopped));
|
||||
cBrd.Stop(false);
|
||||
|
||||
///
|
||||
/// Quit this sequence
|
||||
@@ -772,15 +758,7 @@ namespace TBF.Rig.TestMethods.FlyingStart
|
||||
if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError
|
||||
|| retVal == Event.Error || retVal == Event.ConfigurationError)
|
||||
{
|
||||
State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name))
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(cBrd.StopPreviousOp())
|
||||
.EnterState();
|
||||
do {
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (TestAndLogUiCmdStop(test, e)) { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; }
|
||||
}
|
||||
while (!e.Contains(Event.PreviousStopped));
|
||||
cBrd.Stop(false);
|
||||
}
|
||||
|
||||
stopTestWOStoppingDivGateEtc:
|
||||
|
||||
Reference in New Issue
Block a user