diff --git a/TBF/BenchControl/TestMethods/FixedStartDeferredEval/FixedStartDeferredEvalSeq.cs b/TBF/BenchControl/TestMethods/FixedStartDeferredEval/FixedStartDeferredEvalSeq.cs index a13585b8f..4e87514a8 100644 --- a/TBF/BenchControl/TestMethods/FixedStartDeferredEval/FixedStartDeferredEvalSeq.cs +++ b/TBF/BenchControl/TestMethods/FixedStartDeferredEval/FixedStartDeferredEvalSeq.cs @@ -386,18 +386,33 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEval while (!e.Contains(Event.ValvesSet)); - int time = StateMachine.Time; - double currentFlow = RefFlow.Val; + if (test.TimeFlow2Mass > 0) + { + State.Create(string.Format("{0}({1}) : Waiting before grabbing images", test.Method, test.Name)) + .AddOperation(checkUiOp) + .AddOperations(readTempPressOps) + .AddOperation(new Operations.TimerOp(test.TimeFlow2Mass)) + .EnterState(); + do { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; } + if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; } + } + while (!e.Contains(Event.TimerExpired)); + } TestStartTime = DateTime.Now; LogProcessDataTestInfo(processDataLogger, test.Procedure.Name, test.Name); + int startTime = StateMachine.Time; int startPulses = 0; - /// - /// Grab start images + /// Take start images /// + //----------------------------------------------------------------- + Bridge.OnActivity(this, Strings.Grabbing_images); + //----------------------------------------------------------------- string fileName = string.Format("{0}-start.bmp", test.Name); string[] startImages = new string[sensPath.RegisterReaders.Length]; /// @@ -632,8 +647,26 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEval EndTime = (double)StateMachine.Time; TestEndTime = DateTime.Now; - int endPulses = cBrd.EtPulses(0); + + if (test.TimeStop2Mass > 0) + { + State.Create(string.Format("{0}({1}) : Waiting before grabbing images", test.Method, test.Name)) + .AddOperation(checkUiOp) + .AddOperations(readTempPressOps) + .AddOperation(processDataLoggingOp) + .AddOperation(new Operations.TimerOp(test.TimeStop2Mass)) + .EnterState(); + do { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; } + if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; } + } + while (!e.Contains(Event.TimerExpired)); + } + + + int endPulses = cBrd.EtPulses(0); switchTimeEnd = 0.001f * cBrd.ValveOpenCloseTime; log.WarnFormat("Start valve switch time on test end = {0} ms", cBrd.ValveOpenCloseTime); @@ -659,6 +692,9 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEval /// /// Grab END images /// + //----------------------------------------------------------------- + Bridge.OnActivity(this, Strings.Grabbing_images); + //----------------------------------------------------------------- fileName = string.Format("{0}-end.bmp", test.Name); string[] endImages = new string[sensPath.RegisterReaders.Length]; /// diff --git a/TBF/BenchControl/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs b/TBF/BenchControl/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs index 79b7b472f..b30e792c2 100644 --- a/TBF/BenchControl/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs +++ b/TBF/BenchControl/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs @@ -650,20 +650,23 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection //------------------------------------------------ Bridge.OnActivity(this, Strings.Measuring_the_weight); //------------------------------------------------ - State.Create(string.Format("{0}({1}) : Waiting before the 2nd mass measurement", test.Method, test.Name)) - .AddOperation(checkUiOp) - .AddOperations(readTempPressOps) - .AddOperation(scale.ReadMassOp(ref Mass)) - .AddOperation(cBrd.ReadDiverterTransitionOp(outPath.Diverter, CountWhenSendingRdDivCmd, CountWhenReadingDiv, false, DiverterEnd, BatchRslts.Batch.BatchNr, test.Name, repetitionNr)) - .AddOperation(processDataLoggingOp) - .AddOperation(new Operations.TimerOp(test.TimeStop2Mass)) - .EnterState(); - do { - e = StateMachine.WaitRunDevsRunOps(); - if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; } - if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; } + if (test.TimeStop2Mass > 0) + { + State.Create(string.Format("{0}({1}) : Waiting before the 2nd mass measurement", test.Method, test.Name)) + .AddOperation(checkUiOp) + .AddOperations(readTempPressOps) + .AddOperation(scale.ReadMassOp(ref Mass)) + .AddOperation(cBrd.ReadDiverterTransitionOp(outPath.Diverter, CountWhenSendingRdDivCmd, CountWhenReadingDiv, false, DiverterEnd, BatchRslts.Batch.BatchNr, test.Name, repetitionNr)) + .AddOperation(processDataLoggingOp) + .AddOperation(new Operations.TimerOp(test.TimeStop2Mass)) + .EnterState(); + do { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; } + if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; } + } + while (!e.Contains(Event.TimerExpired) || !e.Contains(Event.BalanceDone)); } - while (!e.Contains(Event.TimerExpired) || !e.Contains(Event.BalanceDone)); if (heatMetersPath == null) LogProcessDataHeader(processDataLogger, "End mass"); diff --git a/TBF/Resources/Strings.Designer.cs b/TBF/Resources/Strings.Designer.cs index aa5d648c9..bf716c7e5 100644 --- a/TBF/Resources/Strings.Designer.cs +++ b/TBF/Resources/Strings.Designer.cs @@ -2013,6 +2013,15 @@ namespace TBF.Resources { } } + /// + /// Looks up a localized string similar to Grabbing images. + /// + internal static string Grabbing_images { + get { + return ResourceManager.GetString("Grabbing_images", resourceCulture); + } + } + /// /// Looks up a localized string similar to Graphs. /// diff --git a/TBF/Resources/Strings.resx b/TBF/Resources/Strings.resx index ef861b9f3..1d0f0ee99 100644 --- a/TBF/Resources/Strings.resx +++ b/TBF/Resources/Strings.resx @@ -2128,4 +2128,7 @@ calculated + + Grabbing images + \ No newline at end of file