From e128784bb8307a8f6b23958d8d478aab4e6c7a3b Mon Sep 17 00:00:00 2001 From: Milan Hanajik Date: Wed, 13 Aug 2014 16:20:00 +0200 Subject: [PATCH] Sequences cleaned-up --- Doc/FlyingStartMassCollectionTest.uxf | 525 ++++++++++++++++++ Doc/MainSeq.uxf | 261 +++++++++ .../BenchControl/Sequences/MainSeq.cs | 4 +- .../FlyingStartCollectionMethodSeq.cs | 236 ++++---- TestBenchFramework/SampleConfig/SQLite.db | Bin 27648 -> 48128 bytes 5 files changed, 890 insertions(+), 136 deletions(-) create mode 100644 Doc/FlyingStartMassCollectionTest.uxf create mode 100644 Doc/MainSeq.uxf diff --git a/Doc/FlyingStartMassCollectionTest.uxf b/Doc/FlyingStartMassCollectionTest.uxf new file mode 100644 index 000000000..ab365fdad --- /dev/null +++ b/Doc/FlyingStartMassCollectionTest.uxf @@ -0,0 +1,525 @@ + + + 8 + + com.umlet.element.Relation + + 400 + 0 + 40 + 64 + + lt=<- + 24;48;24;24 + + + com.umlet.element.custom.InitialState + + 416 + 8 + 16 + 16 + + i + + + + com.umlet.element.custom.State + + 328 + 48 + 192 + 32 + + 'Test Start' transition sequence + + + + com.umlet.element.Relation + + 400 + 56 + 40 + 56 + + lt=<- + 24;40;24;24 + + + com.umlet.element.custom.RegionEndState + + 416 + 96 + 16 + 16 + + + + + + com.umlet.element.Relation + + 400 + 88 + 40 + 56 + + lt=<- + 24;40;24;24 + + + com.umlet.element.custom.State + + 344 + 128 + 160 + 32 + + Initialize (single) test results + + + + com.umlet.element.Relation + + 400 + 136 + 40 + 56 + + lt=<- + 24;40;24;24 + + + com.umlet.element.custom.Decision + + 408 + 176 + 32 + 32 + + + + + + com.umlet.element.Relation + + 400 + 184 + 40 + 56 + + lt=<- + 24;40;24;24 + + + com.umlet.element.custom.Decision + + 408 + 224 + 32 + 32 + + + + + + com.umlet.element.custom.RegionEndState + + 416 + 272 + 16 + 16 + + + + + + com.umlet.element.Relation + + 400 + 232 + 40 + 56 + + lt=<- + 24;40;24;24 + + + com.umlet.element.Relation + + 400 + 264 + 40 + 56 + + lt=<- + 24;40;24;24 + + + com.umlet.element.custom.State + + 344 + 304 + 160 + 32 + + Make the water tank empty + + + + com.umlet.element.Relation + + 400 + 312 + 40 + 56 + + lt=<- + 24;40;24;24 + + + com.umlet.element.custom.RegionEndState + + 416 + 352 + 16 + 16 + + + + + + com.umlet.element.Relation + + 400 + 344 + 40 + 56 + + lt=<- + 24;40;24;24 + + + com.umlet.element.Relation + + 272 + 168 + 160 + 128 + + lt=<- +m2=[Emptying always] + 144;112;24;112;24;24;136;24 + + + com.umlet.element.Relation + + 408 + 216 + 176 + 160 + + lt=<- +m2=[Enough room in tank] + 24;144;160;144;160;24;32;24 + + + com.umlet.element.custom.State + + 344 + 384 + 160 + 32 + + Set the required water flow + + + + com.umlet.element.Relation + + 400 + 392 + 40 + 56 + + lt=<- + 24;40;24;24 + + + com.umlet.element.custom.State + + 328 + 432 + 192 + 32 + + Measure the 'start' mass of water + + + + com.umlet.element.Relation + + 400 + 440 + 40 + 56 + + lt=<- + 24;40;24;24 + + + com.umlet.element.custom.State + + 344 + 480 + 160 + 32 + + Start the test (diverter, etc.) + + + + com.umlet.element.Relation + + 400 + 488 + 40 + 56 + + lt=<- + 24;40;24;24 + + + com.umlet.element.custom.RegionEndState + + 416 + 528 + 16 + 16 + + + + + + com.umlet.element.custom.State + + 344 + 560 + 160 + 32 + + Read intermediate results + + + + com.umlet.element.Relation + + 400 + 520 + 40 + 56 + + lt=<- + 24;40;24;24 + + + com.umlet.element.Relation + + 400 + 568 + 40 + 56 + + lt=<- + 24;40;24;24 + + + com.umlet.element.custom.Decision + + 408 + 608 + 32 + 32 + + + + + + com.umlet.element.Relation + + 272 + 512 + 160 + 128 + + lt=<- +m2=[Test in progress] + 144;24;24;24;24;112;136;112 + + + com.umlet.element.Relation + + 400 + 616 + 40 + 64 + + lt=<- + 24;48;24;24 + + + com.umlet.element.custom.Text + + 424 + 640 + 104 + 24 + + [Test completed] + + + + com.umlet.element.custom.State + + 328 + 664 + 192 + 32 + + Measure the 'end' mass of water + + + + com.umlet.element.custom.State + + 328 + 712 + 192 + 32 + + Calculate and save this test results + + + + com.umlet.element.Relation + + 400 + 672 + 40 + 56 + + lt=<- + 24;40;24;24 + + + com.umlet.element.Relation + + 400 + 720 + 40 + 56 + + lt=<- + 24;40;24;24 + + + com.umlet.element.custom.Decision + + 408 + 760 + 32 + 32 + + + + + + com.umlet.element.Relation + + 400 + 768 + 40 + 64 + + lt=<- + 24;48;24;24 + + + com.umlet.element.Relation + + 408 + 80 + 216 + 712 + + lt=<- +m2=[More repetitions to be done] + 24;24;200;24;200;696;32;696 + + + com.umlet.element.custom.Text + + 264 + 792 + 160 + 24 + + [All test repetitions completed] + + + + com.umlet.element.custom.State + + 328 + 816 + 192 + 32 + + Stop any running tests, etc. (?) + + + + com.umlet.element.custom.State + + 328 + 864 + 192 + 32 + + 'Test End' transition sequence + + + + com.umlet.element.Relation + + 400 + 824 + 40 + 56 + + lt=<- + 24;40;24;24 + + + com.umlet.element.Relation + + 400 + 872 + 40 + 64 + + lt=<- + 24;48;24;24 + + + com.umlet.element.custom.FinalState + + 416 + 920 + 16 + 16 + + + + + diff --git a/Doc/MainSeq.uxf b/Doc/MainSeq.uxf new file mode 100644 index 000000000..5738f7ba4 --- /dev/null +++ b/Doc/MainSeq.uxf @@ -0,0 +1,261 @@ + + + 10 + + com.umlet.element.custom.State + + 400 + 120 + 120 + 40 + + Load the default +procedure + + + + + com.umlet.element.Relation + + 430 + 40 + 50 + 100 + + lt=<- + 30;80;30;30 + + + com.umlet.element.custom.InitialState + + 450 + 60 + 20 + 20 + + i + + + + com.umlet.element.custom.State + + 400 + 190 + 120 + 40 + + Reset valves, +pumps, etc. + + + + + com.umlet.element.Relation + + 430 + 130 + 50 + 80 + + lt=<- + 30;60;30;30 + + + com.umlet.element.custom.State + + 400 + 260 + 120 + 40 + + Detect cameras + + + + com.umlet.element.Relation + + 430 + 200 + 50 + 80 + + lt=<- + 30;60;30;30 + + + com.umlet.element.custom.State + + 370 + 550 + 180 + 110 + + complex +state +-- +some more... + + +-. + + + + com.umlet.element.custom.State + + 370 + 390 + 180 + 60 + + Display prompt, enable +'Cycle' and 'Test' buttons +and wait for a selection + + + + com.umlet.element.Relation + + 430 + 320 + 50 + 90 + + lt=<- + 30;70;30;30 + + + com.umlet.element.custom.RegionEndState + + 450 + 330 + 20 + 20 + + + + + + com.umlet.element.Relation + + 430 + 270 + 50 + 80 + + lt=<- + 30;60;30;30 + + + com.umlet.element.custom.Decision + + 440 + 480 + 40 + 40 + + + + + + com.umlet.element.Relation + + 430 + 420 + 50 + 80 + + lt=<- + 30;60;30;30 + + + com.umlet.element.Relation + + 430 + 490 + 50 + 80 + + lt=<- + 30;60;30;30 + + + com.umlet.element.custom.State + + 620 + 430 + 160 + 40 + + Disable 'Cycle' +and 'Test' buttons + + + + com.umlet.element.custom.State + + 620 + 360 + 160 + 40 + + Empty the tank + + + + com.umlet.element.Relation + + 450 + 440 + 270 + 80 + + lt=<- + 250;30;250;60;30;60 + + + com.umlet.element.Relation + + 670 + 370 + 50 + 80 + + lt=<- + 30;30;30;60 + + + com.umlet.element.Relation + + 440 + 310 + 280 + 70 + + lt=<- + 30;30;260;30;260;50 + + + com.umlet.element.custom.Text + + 490 + 480 + 180 + 20 + + 'Empty a tank' selected + + + + + com.umlet.element.custom.Text + + 290 + 520 + 160 + 20 + + 'Cycle' or 'Test' selected + + + + diff --git a/TestBenchFramework/BenchControl/Sequences/MainSeq.cs b/TestBenchFramework/BenchControl/Sequences/MainSeq.cs index 884e130c4..90902e5dc 100644 --- a/TestBenchFramework/BenchControl/Sequences/MainSeq.cs +++ b/TestBenchFramework/BenchControl/Sequences/MainSeq.cs @@ -82,8 +82,8 @@ namespace TBF.BenchControl.Sequences if (e.Contains(Event.CameraOpFailed)) goto error; /// TODO: resolve in some other way + //-------------------------------------------------------------------------------------------- select_procedure: - //---------------------------------------------------------- selection = MakeSelection(MKSelContext.ProcedureNotSelected); //-------------------------------- @@ -96,9 +96,9 @@ namespace TBF.BenchControl.Sequences Bridge.OnProcedureSelected(this, new ProcedureSelectedEventArgs(StateMachine.Procedure)); + /// Find purge suquences Entities.TransitionSequence purgeBegin = null; Entities.TransitionSequence purgeEnd = null; - /// foreach (var transition in StateMachine.TransitionSequences) { if (transition.Name == StateMachine.Procedure.TransitionStart) purgeBegin = transition; diff --git a/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/FlyingStartCollectionMethodSeq.cs b/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/FlyingStartCollectionMethodSeq.cs index c206b2683..71af0bd23 100644 --- a/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/FlyingStartCollectionMethodSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/FlyingStartCollectionMethodSeq.cs @@ -23,19 +23,6 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod IList e; /// Events from currently running operations - //-------------------------------- - State.Create("FlyingStartCollectionMethod : Stopping diverter, gate, etc.") - .AddOperation(checkUiOp) - .AddOperation(cBrd.StopPreviousOp()) - .EnterState(); - do - { - e = StateMachine.WaitRunDevsRunOps(); - if (e.Contains(Event.UiCmdStop)) goto stopTest; - } - while (!e.Contains(Event.PreviousStopped)); - - /// Notes: /// float timeHr = volumeLtr / (1000.0f * targetFlow); /// float timeSec = 3600.0f * timeHr; @@ -54,7 +41,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod switch (Transition(transitionStart, "FlyingStartCollectionMethod : " + Strings.Test_start_sequence_i_n)) { case Event.Error: goto error; - case Event.UiCmdStop: goto stopTest; + case Event.UiCmdStop: goto stopTestAndRunningWater; } } else @@ -68,7 +55,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod do { e = StateMachine.WaitRunDevsRunOps(); - if (e.Contains(Event.UiCmdStop)) goto stopTest; + if (e.Contains(Event.UiCmdStop)) goto stopTestAndRunningWater; } while (!e.Contains(Event.ValvesSet)); } @@ -80,9 +67,11 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod Entities.TestResult tstRslt = new Entities.TestResult(test, repetitionNr, Entities.MetersKind.Single); - if (!test.Emptying) /// Do not skip emptying if test.Emptying==true + if (!test.Emptying) /// If condition met skip measuring and force emptying { - //-------------------------------- + /// + /// Measure the weight and skip emptying if there is enough room in the tank + /// State.Create("FlyingStartCollectionMethod : Measuring the mass of water in the tank") .AddOperation(checkUiOp) .AddOperation(outPath.Balance.ReadMassOp(ref mass)) @@ -91,7 +80,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod { e = StateMachine.WaitRunDevsRunOps(); if (e.Contains(Event.Error)) goto error; - if (e.Contains(Event.UiCmdStop)) goto stopTest; + if (e.Contains(Event.UiCmdStop)) goto stopTestAndRunningWater; } while (!e.Contains(Event.BalanceDone)); @@ -102,11 +91,13 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod } } - // Empty the water tank + /// + /// Empty the water tank + /// switch (EmptyTheTank(outPath.EmptyTankValve, outPath.Balance)) { case Event.Error: goto error; - case Event.UiCmdStop: goto stopTest; + case Event.UiCmdStop: goto stopTestAndRunningWater; } set_flow: @@ -130,7 +121,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime); Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, cBrd, flowSetTime, progress)); - if (e.Contains(Event.UiCmdStop)) goto stopTest; + if (e.Contains(Event.UiCmdStop)) goto stopTestAndRunningWater; } while (!e.Contains(Event.ValvesSet)); @@ -147,7 +138,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime); Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, cBrd, flowSetTime, progress)); - if (e.Contains(Event.UiCmdStop)) goto stopTest; + if (e.Contains(Event.UiCmdStop)) goto stopTestAndRunningWater; if (e.Contains(Event.OpArgumentError)) if (e.Contains(Event.RegulValveTimeOut)) goto error; if (e.Contains(Event.Next)) goto flow_set; @@ -178,7 +169,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod { e = StateMachine.WaitRunDevsRunOps(); if (e.Contains(Event.Error)) goto error; - if (e.Contains(Event.UiCmdStop)) goto stopTest; + if (e.Contains(Event.UiCmdStop)) goto stopTestAndRunningWater; } while (!e.Contains(Event.BalanceDone)); @@ -198,7 +189,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod { e = StateMachine.WaitRunDevsRunOps(); if (e.Contains(Event.Error)) goto error; - if (e.Contains(Event.UiCmdStop)) goto stopTest; + if (e.Contains(Event.UiCmdStop)) goto stopTestAndRunningWater; } while (!e.Contains(Event.MeasurementStarted)); @@ -218,8 +209,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod switch (ReadRegistersTempPressAmbient(measureOperations, true)) { case Event.Error: goto error; - case Event.UiCmdStop: goto stopTest; - case Event.MeasurementCompleted: goto measurement_completed; + case Event.UiCmdStop: goto stopTestAndRunningWater; + case Event.MeasurementCompleted: goto test_completed; } if (firstTime) @@ -260,7 +251,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod } /// Measurement loop - end - measurement_completed: + test_completed: //------------------------------------------------ Bridge.OnActivity(this, Strings.Measuring_the_weight); @@ -274,86 +265,60 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod { e = StateMachine.WaitRunDevsRunOps(); if (e.Contains(Event.Error)) goto error; - if (e.Contains(Event.UiCmdStop)) goto stopTest; + if (e.Contains(Event.UiCmdStop)) goto stopTestAndRunningWater; } while (!e.Contains(Event.BalanceDone)); /// tstRslt.MassEndRaw = endMass.Val; tstRslt.TimeEnd = DateTime.Now; - //------------------------------------------------ - Bridge.OnActivity(this, Strings.Test_completed); - //------------------------------------------------ - cBrd.SetFMFreq(0, 0); /// Stop FM controlled pumps - State.Create("FlyingStartCollectionMethod : Stopping the pump") - .AddOperation(checkUiOp) - .AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOff() : null) - .AddOperation(cBrd.SetValvesOp(null, inPath.Pump)) - .AddOperation(cBrd.UpdateTankWeightOp()) - .EnterState(); - do - { - e = StateMachine.WaitRunDevsRunOps(); - if (e.Contains(Event.UiCmdStop)) goto stopTest; - } - while (!e.Contains(Event.ValvesSet)); - - - //-------------------------------- - State.Create("FlyingStartCollectionMethod : Stopping diverter, gate, etc.") - .AddOperation(checkUiOp) - .AddOperation(cBrd.StopPreviousOp()) - .EnterState(); - do - { - e = StateMachine.WaitRunDevsRunOps(); - if (e.Contains(Event.UiCmdStop)) goto stopTest; - } - while (!e.Contains(Event.PreviousStopped)); + //------------------------------------------------ + Bridge.OnActivity(this, Strings.Test_completed); + //------------------------------------------------ /// - /// Populate TestResult data entity with data + /// Populate TestResult data entity with data /// - tstRslt.TimeEnd = DateTime.Now; + tstRslt.TimeEnd = DateTime.Now; UpdateTestRsltWithAveragedData(tstRslt); - tstRslt.MassStart = Formulas.CorrectedValue(tstRslt.MassStartRaw, outPath.Balance.Corrections); - tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, outPath.Balance.Corrections); - tstRslt.MassDiff = tstRslt.MassEnd - tstRslt.MassStart; - tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempInAvrg); /// [kg/m3] - tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempOutAvrg); /// [kg/m3] - tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivAvrg); /// [kg/m3] - tstRslt.Time = cBrd.TTime; /// [s] measurement time - tstRslt.FlowMass = 3600.0f * tstRslt.MassDiff / tstRslt.Time; /// [kg/h] - tstRslt.FlowVolume = 3600.0f * ltrPerRefPulse * cBrd.EtPulses(0) / tstRslt.Time; /// [l/h] - tstRslt.VolumeCTV = 1.00103f * 1000.0f * tstRslt.MassDiff / tstRslt.DensityOut; /// [l] 1000.0f is because density is in [kg/m3] - tstRslt.VolumeMaster = ltrPerRefPulse * cBrd.EtPulses(0); /// [l] volume from the master flow meter - tstRslt.PulsesMaster = cBrd.EtPulses(0); /// Pulses of the master flow meter (test total) - tstRslt.ConstMaster = ltrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; - /// Corrected master pulses per liter - if (tstRslt.VolumeCTV <= float.Epsilon) - { - tstRslt.ErrorMaster = 0.1f; - } - else - { - tstRslt.ErrorMaster = 100 * (tstRslt.VolumeMaster - tstRslt.VolumeCTV) / tstRslt.VolumeCTV; - } - tstRslt.TimeDivStart0 = 0; - tstRslt.TimeDivStart1 = 0; - tstRslt.TimeDivStart2 = 0; - tstRslt.TimeDivStart3 = 0; - tstRslt.TimeDivStart4 = 0; - tstRslt.TimeDivStart5 = 0; - tstRslt.TimeDivEnd0 = 0; - tstRslt.TimeDivEnd1 = 0; - tstRslt.TimeDivEnd2 = 0; - tstRslt.TimeDivEnd3 = 0; - tstRslt.TimeDivEnd4 = 0; - tstRslt.TimeDivEnd5 = 0; - for (int i = 0; i < Program.WMsCount; i++) - { - if (sensPath.RegisterReaders[i] != null) - { + tstRslt.MassStart = Formulas.CorrectedValue(tstRslt.MassStartRaw, outPath.Balance.Corrections); + tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, outPath.Balance.Corrections); + tstRslt.MassDiff = tstRslt.MassEnd - tstRslt.MassStart; + tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempInAvrg); /// [kg/m3] + tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempOutAvrg); /// [kg/m3] + tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivAvrg); /// [kg/m3] + tstRslt.Time = cBrd.TTime; /// [s] measurement time + tstRslt.FlowMass = 3600.0f * tstRslt.MassDiff / tstRslt.Time; /// [kg/h] + tstRslt.FlowVolume = 3600.0f * ltrPerRefPulse * cBrd.EtPulses(0) / tstRslt.Time; /// [l/h] + tstRslt.VolumeCTV = 1.00103f * 1000.0f * tstRslt.MassDiff / tstRslt.DensityOut; /// [l] 1000.0f is because density is in [kg/m3] + tstRslt.VolumeMaster = ltrPerRefPulse * cBrd.EtPulses(0); /// [l] volume from the master flow meter + tstRslt.PulsesMaster = cBrd.EtPulses(0); /// Pulses of the master flow meter (test total) + tstRslt.ConstMaster = ltrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; + /// Corrected master pulses per liter + if (tstRslt.VolumeCTV <= float.Epsilon) + { + tstRslt.ErrorMaster = 0.1f; + } + else + { + tstRslt.ErrorMaster = 100 * (tstRslt.VolumeMaster - tstRslt.VolumeCTV) / tstRslt.VolumeCTV; + } + tstRslt.TimeDivStart0 = 0; + tstRslt.TimeDivStart1 = 0; + tstRslt.TimeDivStart2 = 0; + tstRslt.TimeDivStart3 = 0; + tstRslt.TimeDivStart4 = 0; + tstRslt.TimeDivStart5 = 0; + tstRslt.TimeDivEnd0 = 0; + tstRslt.TimeDivEnd1 = 0; + tstRslt.TimeDivEnd2 = 0; + tstRslt.TimeDivEnd3 = 0; + tstRslt.TimeDivEnd4 = 0; + tstRslt.TimeDivEnd5 = 0; + for (int i = 0; i < Program.WMsCount; i++) + { + if (sensPath.RegisterReaders[i] != null) + { tstRslt.Meters[i].SerialNr = "wm" + (i + 1).ToString(); tstRslt.Meters[i].VolumeStart = 0; /// liter tstRslt.Meters[i].VolumeEnd = 0; /// liter @@ -376,7 +341,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod tstRslt.Meters[i].Passed = (tstRslt.ErrLimLo <= tstRslt.Meters[i].VolumeErrorPct) && (tstRslt.Meters[i].VolumeErrorPct <= tstRslt.ErrLimHi); } } - /// Add data - end + /// Add data - end AddOrOverwriteResult(tstRslt); @@ -385,36 +350,40 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod /// Append the results to the CSV-file allResults.Info(TestResult2CsvLine(tstRslt, cBrd.EtPulses(0))); - FluentCommon.SaveToDb(StateMachine.WtSession, tstRslt); + FluentCommon.SaveToDb(StateMachine.WtSession, tstRslt); - if (++repetitionNr <= test.Repeats) - { - goto loop; - } - - ///----------------------/// - /// Quit this sequence /// - ///----------------------/// - /// Stop the pump - State.Create("FlyingStartCollectionMethod : Test(s) completed -> Stopping the pump") - .AddOperation(checkUiOp) - .AddOperation(cBrd.SetValvesOp(null, inPath.Pump)) - .AddOperation((inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOff() : null) - .EnterState(); - do { - e = StateMachine.WaitRunDevsRunOps(); - if (e.Contains(Event.Error)) goto error; + if (++repetitionNr <= test.Repeats) + { + goto loop; } - while (!e.Contains(Event.ValvesSet) || ((inPath.Pump is GenericDevices.IPumpFM) && !e.Contains(Event.TurnPumpOnOffDone))); - + + ///----------------------/// + /// Quit this sequence /// + ///----------------------/// + + //-------------------------------- + State.Create("FlyingStartCollectionMethod : Stopping diverter, gate, etc.") + .AddOperation(checkUiOp) + .AddOperation(cBrd.StopPreviousOp()) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.UiCmdStop)) goto stopTestAndRunningWater; + } + while (!e.Contains(Event.PreviousStopped)); + + + stopTestAndRunningWater: + ///-------------------------------- /// Transition or SetRoute - End if (transitionStop != null) { switch (Transition(transitionStop, "FlyingStartCollectionMethod : " + Strings.Test_stop_sequence_i_n)) { case Event.Error: goto error; - case Event.UiCmdStop: goto stopTest; + case Event.UiCmdStop: goto stopTestAndRunningWater; } } else @@ -423,35 +392,34 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod .AddOperation(checkUiOp) .AddOperation(cBrd.SetValvesOp(StateMachine.DefaultValvesOpen, StateMachine.DefaultValvesClose)) .EnterState(); - do { + do + { e = StateMachine.WaitRunDevsRunOps(); if (e.Contains(Event.Error)) goto error; } while (!e.Contains(Event.ValvesSet)); } - /// Create the return value - a list with one event Event.Done - and return - IList retval = new List(); - retval.Add(Event.Done); - return retval; - - //==================================== - stopTest: - State.Create("FlyingStartCollectionMethod : User selected STOP -> Closing the valves") + ///-------------------------------- + /// Stop the pump + cBrd.SetFMFreq(0, 0); /// Stop FM controlled pumps + State.Create("FlyingStartCollectionMethod : Test(s) completed -> Stopping the pump") .AddOperation(checkUiOp) - .AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOff() : null) - .AddOperation(cBrd.SetValvesOp(StateMachine.DefaultValvesOpen, StateMachine.DefaultValvesClose)) + .AddOperation((inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOff() : null) + .AddOperation(cBrd.SetValvesOp(null, inPath.Pump)) + .AddOperation(cBrd.UpdateTankWeightOp()) .EnterState(); do { e = StateMachine.WaitRunDevsRunOps(); if (e.Contains(Event.Error)) goto error; } - while (!e.Contains(Event.ValvesSet)); + while (!e.Contains(Event.ValvesSet) || ((inPath.Pump is GenericDevices.IPumpFM) && !e.Contains(Event.TurnPumpOnOffDone))); - IList retval2 = new List(); - retval2.Add(Event.UiCmdStop); - return retval2; + /// Create the return value - a list with one event Event.Done - and return + IList retval = new List(); + retval.Add(Event.Done); + return retval; //==================================== error: diff --git a/TestBenchFramework/SampleConfig/SQLite.db b/TestBenchFramework/SampleConfig/SQLite.db index e7adb8d1b73dd9a3b163904cfc62cdc27c2d2531..c1c9d34b0ac0a3a4ca89a1dafeeabbe724a03c12 100644 GIT binary patch literal 48128 zcmeHQYit`=cD^%1iKJ}WRv4La9K~Zgj;&Y{Im4%HnT|+Ni6Y6O9+91-yNeMylBOm( z%y8&Oi=rT9W6}O7(6lI;{k15HqK|B`&9*;U6fIg52wL>9i!Cc2n{c(!NBJJax{t(>5484tAWJw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