diff --git a/TestBenchFramework/BenchControl/TestMethods/Adjustment/AdjustmentSeq.cs b/TestBenchFramework/BenchControl/TestMethods/Adjustment/AdjustmentSeq.cs index 24391910b..26332b706 100644 --- a/TestBenchFramework/BenchControl/TestMethods/Adjustment/AdjustmentSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/Adjustment/AdjustmentSeq.cs @@ -69,28 +69,46 @@ namespace TBF.BenchControl.TestMethods.Adjustment tstRslt.DoNotEvaluate = true; tstRslt.DoNotPublish = true; - //------------------------------------------------ - Bridge.OnActivity(this, Strings.Setting_the_flow); - //------------------------------------------------ int flowSetTime0 = StateMachine.Time; float estFlowSetTime = 10.0f; + //------------------------------------------------ + Bridge.OnActivity(this, Strings.Setting_the_flow); + //------------------------------------------------ if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOn(test.PumpPower); - State.Create("Adjustment : Starting the pump") - .AddOperation(checkUiOp) - .AddOperation(cBrd.SetValvesOp(inPath.Pump, null)) - .EnterState(); - do - { - e = StateMachine.WaitRunDevsRunOps(); - int flowSetTime = StateMachine.Time - flowSetTime0; + State.Create("Adjustment : Starting the pump") + .AddOperation(checkUiOp) + .AddOperation(new Operations.TimerOp(5)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + + int flowSetTime = StateMachine.Time - flowSetTime0; float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime); - Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress)); + Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress)); if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; } - } - while (!e.Contains(Event.ValvesSet)); + } + while (!e.Contains(Event.TimerExpired)); + + + State.Create("Adjustment : Starting the pump") + .AddOperation(checkUiOp) + .AddOperation(cBrd.SetValvesOp(inPath.Pump, null)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + + int flowSetTime = StateMachine.Time - flowSetTime0; + float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime); + Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress)); + + if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; } + } + while (!e.Contains(Event.ValvesSet)); //-------------------------------- State.Create("Adjustment : Setting the flow") diff --git a/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/CombinedMetersSeq.cs b/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/CombinedMetersSeq.cs index 59a5f2d05..f9bf3f102 100644 --- a/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/CombinedMetersSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/CombinedMetersSeq.cs @@ -64,6 +64,48 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters Entities.TestResult tstRslt = new Entities.TestResult(test, repetitionNr, Entities.MetersKind.Combined); + int flowSetTime0 = StateMachine.Time; + float estFlowSetTime = 10.0f; + + //------------------------------------------------ + Bridge.OnActivity(this, Strings.Setting_the_flow); + //------------------------------------------------ + if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOn(test.PumpPower); + + State.Create("CombinedMeters : Starting the pump") + .AddOperation(checkUiOp) + .AddOperation(new Operations.TimerOp(5)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + + int flowSetTime = StateMachine.Time - flowSetTime0; + float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime); + Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress)); + + if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; } + } + while (!e.Contains(Event.TimerExpired)); + + + State.Create("CombinedMeters : Starting the pump") + .AddOperation(checkUiOp) + .AddOperation(cBrd.SetValvesOp(inPath.Pump, null)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + + int flowSetTime = StateMachine.Time - flowSetTime0; + float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime); + Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress)); + + if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; } + } + while (!e.Contains(Event.ValvesSet)); + + if (!test.Emptying) /// If condition met => skip measuring and force emptying { /// @@ -99,29 +141,6 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters set_flow: - int flowSetTime0 = StateMachine.Time; - float estFlowSetTime = 10.0f; - - //------------------------------------------------ - Bridge.OnActivity(this, Strings.Setting_the_flow); - //------------------------------------------------ - if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOn(test.PumpPower); - State.Create("CombinedMeters : Starting the pump") - .AddOperation(checkUiOp) - .AddOperation(cBrd.SetValvesOp(inPath.Pump, null)) - .EnterState(); - do - { - e = StateMachine.WaitRunDevsRunOps(); - - int flowSetTime = StateMachine.Time - flowSetTime0; - float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime); - Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress)); - - if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; } - } - while (!e.Contains(Event.ValvesSet)); - //-------------------------------- State.Create("CombinedMeters : Setting the flow") .AddOperation(checkUiOp) diff --git a/TestBenchFramework/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs b/TestBenchFramework/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs index ba63b4db4..da4cfdbdb 100644 --- a/TestBenchFramework/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs @@ -62,6 +62,48 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection Entities.TestResult tstRslt = new Entities.TestResult(test, repetitionNr, Entities.MetersKind.Single); + int flowSetTime0 = StateMachine.Time; + float estFlowSetTime = 10.0f; + + //------------------------------------------------ + Bridge.OnActivity(this, Strings.Setting_the_flow); + //------------------------------------------------ + if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOn(test.PumpPower); + + State.Create("FixedStartMassCollection : Starting the pump") + .AddOperation(checkUiOp) + .AddOperation(new Operations.TimerOp(5)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + + int flowSetTime = StateMachine.Time - flowSetTime0; + float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime); + Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress)); + + if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; } + } + while (!e.Contains(Event.TimerExpired)); + + + State.Create("FixedStartMassCollection : Starting the pump") + .AddOperation(checkUiOp) + .AddOperation(cBrd.SetValvesOp(inPath.Pump, null)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + + int flowSetTime = StateMachine.Time - flowSetTime0; + float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime); + Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress)); + + if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; } + } + while (!e.Contains(Event.ValvesSet)); + + if (!test.Emptying) /// If condition met => skip measuring and force emptying { /// @@ -97,9 +139,6 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection set_flow: - int flowSetTime0 = StateMachine.Time; - float estFlowSetTime = 10.0f; - //------------------------------------------------ Bridge.OnActivity(this, Strings.Setting_the_flow); //------------------------------------------------ diff --git a/TestBenchFramework/BenchControl/TestMethods/ReferenceFlowmeterCalibration/ReferenceFlowmeterCalibrationSeq.cs b/TestBenchFramework/BenchControl/TestMethods/ReferenceFlowmeterCalibration/ReferenceFlowmeterCalibrationSeq.cs index 151543b07..c6f81d36c 100644 --- a/TestBenchFramework/BenchControl/TestMethods/ReferenceFlowmeterCalibration/ReferenceFlowmeterCalibrationSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/ReferenceFlowmeterCalibration/ReferenceFlowmeterCalibrationSeq.cs @@ -59,6 +59,48 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration Entities.TestResult tstRslt = new Entities.TestResult(test, repetitionNr, Entities.MetersKind.Single); + int flowSetTime0 = StateMachine.Time; + float estFlowSetTime = 10.0f; + + //------------------------------------------------ + Bridge.OnActivity(this, Strings.Setting_the_flow); + //------------------------------------------------ + if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOn(test.PumpPower); + + State.Create("ReferenceFlowmeterCalibration : Starting the pump") + .AddOperation(checkUiOp) + .AddOperation(new Operations.TimerOp(5)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + + int flowSetTime = StateMachine.Time - flowSetTime0; + float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime); + Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress)); + + if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; } + } + while (!e.Contains(Event.TimerExpired)); + + + State.Create("ReferenceFlowmeterCalibration : Starting the pump") + .AddOperation(checkUiOp) + .AddOperation(cBrd.SetValvesOp(inPath.Pump, null)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + + int flowSetTime = StateMachine.Time - flowSetTime0; + float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime); + Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress)); + + if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; } + } + while (!e.Contains(Event.ValvesSet)); + + if (!test.Emptying) /// If condition met => skip measuring and force emptying { /// @@ -94,29 +136,6 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration set_flow: - int flowSetTime0 = StateMachine.Time; - float estFlowSetTime = 10.0f; - - //------------------------------------------------ - Bridge.OnActivity(this, Strings.Setting_the_flow); - //------------------------------------------------ - if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOn(test.PumpPower); - State.Create("ReferenceFlowmeterCalibration : Starting the pump") - .AddOperation(checkUiOp) - .AddOperation(cBrd.SetValvesOp(inPath.Pump, null)) - .EnterState(); - do - { - e = StateMachine.WaitRunDevsRunOps(); - - int flowSetTime = StateMachine.Time - flowSetTime0; - float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime); - Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress)); - - if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; } - } - while (!e.Contains(Event.ValvesSet)); - //-------------------------------- State.Create("ReferenceFlowmeterCalibration : Setting the flow") .AddOperation(checkUiOp)