From 7e8dfd472d546ea99fccef53e8800e238deab91c Mon Sep 17 00:00:00 2001 From: Milan Hanajik Date: Sun, 1 Feb 2015 17:42:14 +0100 Subject: [PATCH] Zapne pumpu pred vypustanim --- .../FlyingStartCollectionMethodSeq.cs | 83 ++++++++++--------- 1 file changed, 42 insertions(+), 41 deletions(-) diff --git a/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/FlyingStartCollectionMethodSeq.cs b/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/FlyingStartCollectionMethodSeq.cs index 463e708fe..860c9ce72 100644 --- a/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/FlyingStartCollectionMethodSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/FlyingStartCollectionMethodSeq.cs @@ -59,6 +59,48 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod 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("FlyingStartCollectionMethod : 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("FlyingStartCollectionMethod : 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,47 +136,6 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod 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("FlyingStartCollectionMethod : 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("FlyingStartCollectionMethod : 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("FlyingStartCollectionMethod : Setting the flow") .AddOperation(checkUiOp)