diff --git a/Results/Entities/MeterTestRslt.cs b/Results/Entities/MeterTestRslt.cs index 4904edb99..42e462415 100644 --- a/Results/Entities/MeterTestRslt.cs +++ b/Results/Entities/MeterTestRslt.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2013-2020 Sensus Slovensko a.s. +/// Copyright (c) 2013-2021 Sensus Slovensko a.s. /// using System; using System.Collections.Generic; @@ -30,8 +30,10 @@ namespace Results.Entities public virtual double KorrErrQ { get; set; } /// [%] not mapped to results DB, saved to Oracle DB public virtual bool TestDone { get; set; } /// true = test was completed public virtual bool Passed { get; set; } /// true = test passed, water meter is OK +#if IPERL + public virtual string ExtraDataPath { get; set; } /// Relative path to a file with opto-data/raw-data +#endif #if ORACLE_DB - public virtual string ExtraDataPath { get; set; } /// Relative path to a file with opto-data/raw-data public virtual double LastError { get; set; } /// [%] Previous test error at this Q in case Pruefindex > 1 #endif @@ -141,8 +143,10 @@ namespace Results.Entities KorrErrQ = oriMTR.KorrErrQ; TestDone = oriMTR.TestDone; Passed = oriMTR.Passed; -#if ORACLE_DB +#if IPERL ExtraDataPath = oriMTR.ExtraDataPath; +#endif +#if ORACLE_DB LastError = oriMTR.LastError; #endif } @@ -169,8 +173,10 @@ namespace Results.Entities KorrErrQ = src.KorrErrQ; TestDone = src.TestDone; Passed = src.Passed; -#if ORACLE_DB +#if IPERL ExtraDataPath = src.ExtraDataPath; +#endif +#if ORACLE_DB LastError = src.LastError; #endif } @@ -201,8 +207,10 @@ namespace Results.Entities writer.Write(KorrErrQ); writer.Write(TestDone); writer.Write(Passed); -#if ORACLE_DB +#if IPERL writer.Write((ExtraDataPath != null) ? ExtraDataPath : string.Empty); +#endif +#if ORACLE_DB writer.Write(LastError); #endif writer.Write((TestRslt != null && TestRslt.Name() != null) ? TestRslt.Name() : string.Empty); @@ -230,8 +238,10 @@ namespace Results.Entities KorrErrQ = reader.ReadDouble(); TestDone = reader.ReadBoolean(); Passed = reader.ReadBoolean(); -#if ORACLE_DB +#if IPERL ExtraDataPath = reader.ReadString(); +#endif +#if ORACLE_DB LastError = reader.ReadDouble(); #endif TestRslt = null; diff --git a/Results/Mappings/MeterTestRsltMap.cs b/Results/Mappings/MeterTestRsltMap.cs index e1720dad7..987123217 100644 --- a/Results/Mappings/MeterTestRsltMap.cs +++ b/Results/Mappings/MeterTestRsltMap.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2015-2018 Sensus Slovensko a.s. +/// Copyright (c) 2015-2021 Sensus Slovensko a.s. /// using FluentNHibernate.Mapping; using Results.Entities; @@ -26,8 +26,10 @@ namespace Results.Mappings Map(x => x.Error); Map(x => x.TestDone); Map(x => x.Passed); -#if ORACLE_DB +#if IPERL Map(x => x.ExtraDataPath); +#endif +#if ORACLE_DB Map(x => x.LastError); #endif References(x => x.WaterMeter); diff --git a/TBF/BenchControl/Events.cs b/TBF/BenchControl/Events.cs index a3d74dde3..90bf36ba3 100644 --- a/TBF/BenchControl/Events.cs +++ b/TBF/BenchControl/Events.cs @@ -176,6 +176,7 @@ namespace TBF.BenchControl OpArgumentError, ConfigurationError, RecoverableError, /// Something like flow setting or mass measurement timeout + ErrorFlagsStop, /// ErrorFlags error that is configured to stop the cycle Yes, No, Next, /// To move to the next state when debugging diff --git a/TBF/BenchControl/GenericDevices/IErrorFlags.cs b/TBF/BenchControl/GenericDevices/IErrorFlags.cs index 7c06dc180..c4409918f 100644 --- a/TBF/BenchControl/GenericDevices/IErrorFlags.cs +++ b/TBF/BenchControl/GenericDevices/IErrorFlags.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2017 Sensus Metering Systems +/// Copyright (c) 2021 Sensus Metering Systems /// using System; using System.Collections.Generic; @@ -20,7 +20,7 @@ namespace TBF.BenchControl.GenericDevices /// Diverter or valve switch time in s on test end /// Similar to error flags, contains only warnings /// Error flags - long GetErrorFlags(TestRslt testRslt, bool diverter, bool startStopValve, float switchTimeStart, float switchTimeEnd, out long infoFlags); + long GetErrorFlags(TestRslt testRslt, bool diverter, bool startStopValve, float switchTimeStart, float switchTimeEnd, out long infoFlags, out bool stopCycle); /// /// Get water meter error flags (evaluated from all meter test results) diff --git a/TBF/BenchControl/Sequences/MainSeq.cs b/TBF/BenchControl/Sequences/MainSeq.cs index 4566404b9..d9de9b1b9 100644 --- a/TBF/BenchControl/Sequences/MainSeq.cs +++ b/TBF/BenchControl/Sequences/MainSeq.cs @@ -900,7 +900,7 @@ namespace TBF.BenchControl.Sequences if (testMethod.DoTransitions() && !e.Contains(Event.RecoverableError)) { - if (currentTestFinished && !isLastRepetition) + if (currentTestFinished && !isLastRepetition && !e.Contains(Event.ErrorFlagsStop)) { /// Make a transition between two test repetitions rsltTransBetween = Transition(transitionBetween, TransitionContext.BetweenTests); /// Transition or SetRoute - start of test @@ -931,7 +931,7 @@ namespace TBF.BenchControl.Sequences { goto config_error; } - else if (rsltTransBefore == Event.UiCmdStop || e.Contains(Event.UiCmdStop) || e.Contains(Event.RecoverableError)) + else if (rsltTransBefore == Event.UiCmdStop || e.Contains(Event.UiCmdStop) || e.Contains(Event.RecoverableError) || e.Contains(Event.ErrorFlagsStop)) { goto stop_within_cycle; } diff --git a/TBF/BenchControl/TestMethods/Adjustment/AdjustmentSeq.cs b/TBF/BenchControl/TestMethods/Adjustment/AdjustmentSeq.cs index a07c052f3..1edbd4b3e 100644 --- a/TBF/BenchControl/TestMethods/Adjustment/AdjustmentSeq.cs +++ b/TBF/BenchControl/TestMethods/Adjustment/AdjustmentSeq.cs @@ -61,6 +61,7 @@ namespace TBF.BenchControl.TestMethods.Adjustment public IList Execute(Test test, int repetitionNr, bool isLastRepetition, DebugMode mode) { float simulatedError = 4.5f; /// % + bool stopCycle = false; int rangeIx = 0; /// Default range, used for non-Elde flowmeters if (outPath.FlowMeter is Elde.FlowMeter.FlowMeter) @@ -395,7 +396,7 @@ namespace TBF.BenchControl.TestMethods.Adjustment /// Results.Entities.TestRslt tstRslt = BatchRslts.GetTestRslt(testName, test.Part); - if (tstRslt != null) + if (tstRslt != null) { Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters); UpdateTempPressDensAmb(tstRslt); @@ -431,7 +432,7 @@ namespace TBF.BenchControl.TestMethods.Adjustment tstRslt.DiverterStart = 0; tstRslt.DiverterEnd = 0; long infoFlags = 0; - tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, false, false, 0, 0, out infoFlags) : 0; + tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, false, false, 0, 0, out infoFlags, out stopCycle) : 0; tstRslt.InfoFlags = infoFlags; for (int i = 0; i < BatchRslts.WMPositionsCount; i++) @@ -504,6 +505,8 @@ namespace TBF.BenchControl.TestMethods.Adjustment /// Append the results to the CSV-file allResults.Info(TestResult2CsvLine(testName, test.Part)); + if (stopCycle) retVal = Event.ErrorFlagsStop; + stopTest: /// Close the modeless form @@ -517,7 +520,8 @@ namespace TBF.BenchControl.TestMethods.Adjustment /// Quit this sequence /// if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError - || retVal == Event.Error || retVal == Event.ConfigurationError) + || retVal == Event.RecoverableError || retVal == Event.ErrorFlagsStop + || retVal == Event.Error || retVal == Event.ConfigurationError) { State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name)) .AddOperation(checkUiOp) diff --git a/TBF/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs b/TBF/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs index fe641924a..47d57d481 100644 --- a/TBF/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs +++ b/TBF/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs @@ -663,7 +663,8 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection /// Results.Entities.TestRslt tstRslt = BatchRslts.GetTestRslt(testName, test.Part); - if (tstRslt != null) + bool stopCycle = false; + if (tstRslt != null) { Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters); UpdateTempPressDensAmb(tstRslt); @@ -708,7 +709,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection tstRslt.DiverterStart = switchTimeStart; tstRslt.DiverterEnd = switchTimeEnd; long infoFlags = 0; - tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, true, false, switchTimeStart, switchTimeEnd, out infoFlags) : 0; + tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, true, false, switchTimeStart, switchTimeEnd, out infoFlags, out stopCycle) : 0; tstRslt.InfoFlags = infoFlags; for (int i = 0; i < BatchRslts.WMPositionsCount; i++) @@ -808,7 +809,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection /// Quit this sequence /// ///----------------------/// - if (isLastRepetition) + if (isLastRepetition || stopCycle) { /// Stop the pump State.Create(string.Format("{0}({1}) : Test(s) completed -> Stopping the pump", test.Method, test.Name)) @@ -823,7 +824,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection while (!e.Contains(Event.ValvesSet) || ((inPath.Pump is GenericDevices.IPumpFM) && !e.Contains(Event.TurnPumpOnOffDone))); } - return new List { Event.Done }; + return stopCycle ? new List { Event.ErrorFlagsStop } : new List { Event.Done }; //==================================== stopTest: diff --git a/TBF/BenchControl/TestMethods/DiverterTest/DiverterTestSeq.cs b/TBF/BenchControl/TestMethods/DiverterTest/DiverterTestSeq.cs index 4c4d16de0..69bceeeb2 100644 --- a/TBF/BenchControl/TestMethods/DiverterTest/DiverterTestSeq.cs +++ b/TBF/BenchControl/TestMethods/DiverterTest/DiverterTestSeq.cs @@ -679,7 +679,8 @@ namespace TBF.BenchControl.TestMethods.DiverterTest /// Results.Entities.TestRslt tstRslt = BatchRslts.GetTestRslt(testName, test.Part); - if (tstRslt != null) + bool stopCycle = false; + if (tstRslt != null) { Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters); UpdateTempPressDensAmb(tstRslt); @@ -731,7 +732,7 @@ namespace TBF.BenchControl.TestMethods.DiverterTest (tstRslt.DiverterStart * 1000).ToString("F0"), tstRslt.DivStart10, tstRslt.DivStart50, tstRslt.DivStart90, (tstRslt.DiverterEnd * 1000).ToString("F0"), tstRslt.DivEnd90, tstRslt.DivEnd50, tstRslt.DivEnd10); long infoFlags = 0; - tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, true, false, tstRslt.DiverterStart, tstRslt.DiverterEnd, out infoFlags) : 0; + tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, true, false, tstRslt.DiverterStart, tstRslt.DiverterEnd, out infoFlags, out stopCycle) : 0; tstRslt.InfoFlags = infoFlags; /// @@ -774,8 +775,9 @@ namespace TBF.BenchControl.TestMethods.DiverterTest } #if IPERL meterRslt.WaterMeter.CalibFactor = iPerl.CalibFactor; + meterRslt.ExtraDataPath = iPerl.ExtraDataPath; #endif - iPerl.LastTestResult2 = iPerl.LastTestResult; /// Save shift previous test result + iPerl.LastTestResult2 = iPerl.LastTestResult; /// Save shift previous test result iPerl.LastTestResult = meterRslt; /// Save this test result } } @@ -869,6 +871,8 @@ namespace TBF.BenchControl.TestMethods.DiverterTest /// Append the results to the CSV-file allResults.Info(TestResult2CsvLine(testName, test.Part)); + if (stopCycle) retVal = Event.ErrorFlagsStop; + stopTest: StopRecordingStatistics(); /// Make sure graph files are closed @@ -877,7 +881,8 @@ namespace TBF.BenchControl.TestMethods.DiverterTest /// Quit this sequence /// if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError - || retVal == Event.Error || retVal == Event.ConfigurationError) + || retVal == Event.RecoverableError || retVal == Event.ErrorFlagsStop + || retVal == Event.Error || retVal == Event.ConfigurationError) { State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name)) .AddOperation(checkUiOp) diff --git a/TBF/BenchControl/TestMethods/Endurance/EnduranceSeq.cs b/TBF/BenchControl/TestMethods/Endurance/EnduranceSeq.cs index 8fb4c779b..d0047a4cd 100644 --- a/TBF/BenchControl/TestMethods/Endurance/EnduranceSeq.cs +++ b/TBF/BenchControl/TestMethods/Endurance/EnduranceSeq.cs @@ -351,6 +351,7 @@ namespace TBF.BenchControl.TestMethods.Endurance /// Results.Entities.TestRslt tstRslt = BatchRslts.GetTestRslt(testName, test.Part); + bool stopCycle = false; if (tstRslt != null) { Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters); @@ -386,7 +387,7 @@ namespace TBF.BenchControl.TestMethods.Endurance tstRslt.DiverterStart = 0; tstRslt.DiverterEnd = 0; long infoFlags = 0; - tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, false, false, 0, 0, out infoFlags) : 0; + tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, false, false, 0, 0, out infoFlags, out stopCycle) : 0; tstRslt.InfoFlags = infoFlags; /// @@ -445,7 +446,9 @@ namespace TBF.BenchControl.TestMethods.Endurance { meterRslt.WaterMeter.ResultCode |= iPerl.ResultCode; } - +#if IPERL + meterRslt.ExtraDataPath = iPerl.ExtraDataPath; +#endif iPerl.LastTestResult2 = iPerl.LastTestResult; /// Save shift previous test result iPerl.LastTestResult = meterRslt; /// Save this test result } @@ -644,7 +647,8 @@ namespace TBF.BenchControl.TestMethods.Endurance /// Quit this sequence /// if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError - || retVal == Event.Error || retVal == Event.ConfigurationError) + || retVal == Event.RecoverableError || retVal == Event.ErrorFlagsStop + || retVal == Event.Error || retVal == Event.ConfigurationError) { State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name)) .AddOperation(checkUiOp) diff --git a/TBF/BenchControl/TestMethods/FixedStart/FixedStartSeq.cs b/TBF/BenchControl/TestMethods/FixedStart/FixedStartSeq.cs index 3286eafaa..92ab8ace1 100644 --- a/TBF/BenchControl/TestMethods/FixedStart/FixedStartSeq.cs +++ b/TBF/BenchControl/TestMethods/FixedStart/FixedStartSeq.cs @@ -785,6 +785,7 @@ namespace TBF.BenchControl.TestMethods.FixedStart /// Results.Entities.TestRslt tstRslt = BatchRslts.GetTestRslt(testName, test.Part); + bool stopCycle = false; if (tstRslt != null) { Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters); @@ -822,7 +823,7 @@ namespace TBF.BenchControl.TestMethods.FixedStart tstRslt.DiverterStart = switchTimeStart; tstRslt.DiverterEnd = switchTimeEnd; long infoFlags = 0; - tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, false, true, switchTimeStart, switchTimeEnd, out infoFlags) : 0; + tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, false, true, switchTimeStart, switchTimeEnd, out infoFlags, out stopCycle) : 0; tstRslt.InfoFlags = infoFlags; if (compound) @@ -1014,6 +1015,7 @@ namespace TBF.BenchControl.TestMethods.FixedStart /// Append the results to the CSV-file allResults.Info(TestResult2CsvLine(testName, test.Part)); + if (stopCycle) retVal = Event.ErrorFlagsStop; stopTest: @@ -1023,7 +1025,8 @@ namespace TBF.BenchControl.TestMethods.FixedStart /// Quit this sequence /// if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError - || retVal == Event.Error || retVal == Event.ConfigurationError) + || retVal == Event.RecoverableError || retVal == Event.ErrorFlagsStop + || retVal == Event.Error || retVal == Event.ConfigurationError) { State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name)) .AddOperation(checkUiOp) diff --git a/TBF/BenchControl/TestMethods/FixedStartAdvanced/FixedStartAdvancedSeq.cs b/TBF/BenchControl/TestMethods/FixedStartAdvanced/FixedStartAdvancedSeq.cs index 16ccd7a6c..0a145b528 100644 --- a/TBF/BenchControl/TestMethods/FixedStartAdvanced/FixedStartAdvancedSeq.cs +++ b/TBF/BenchControl/TestMethods/FixedStartAdvanced/FixedStartAdvancedSeq.cs @@ -566,7 +566,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced /// Results.Entities.TestRslt tstRslt = BatchRslts.GetTestRslt(testName, test.Part); - if (tstRslt != null) + bool stopCycle = false; + if (tstRslt != null) { Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters); UpdateTempPressDensAmb(tstRslt); @@ -603,7 +604,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced tstRslt.DiverterStart = switchTimeStart; tstRslt.DiverterEnd = switchTimeEnd; long infoFlags = 0; - tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, false, true, switchTimeStart, switchTimeEnd, out infoFlags) : 0; + tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, false, true, switchTimeStart, switchTimeEnd, out infoFlags, out stopCycle) : 0; tstRslt.InfoFlags = infoFlags; for (int i = 0; i < BatchRslts.WMPositionsCount; i++) @@ -669,6 +670,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced /// Append the results to the CSV-file allResults.Info(TestResult2CsvLine(testName, test.Part)); + if (stopCycle) retVal = Event.ErrorFlagsStop; stopTest: @@ -678,7 +680,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced /// Quit this sequence /// if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError - || retVal == Event.Error || retVal == Event.ConfigurationError) + || retVal == Event.RecoverableError || retVal == Event.ErrorFlagsStop + || retVal == Event.Error || retVal == Event.ConfigurationError) { State.Create("FixedStartAdvanced : Stopping diverter, gate, etc.") .AddOperation(checkUiOp) diff --git a/TBF/BenchControl/TestMethods/FixedStartDeferredEval/FixedStartDeferredEvalSeq.cs b/TBF/BenchControl/TestMethods/FixedStartDeferredEval/FixedStartDeferredEvalSeq.cs index 3767d6c78..c1d39be30 100644 --- a/TBF/BenchControl/TestMethods/FixedStartDeferredEval/FixedStartDeferredEvalSeq.cs +++ b/TBF/BenchControl/TestMethods/FixedStartDeferredEval/FixedStartDeferredEvalSeq.cs @@ -782,6 +782,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEval /// Results.Entities.TestRslt tstRslt = BatchRslts.GetTestRslt(testName, test.Part); + bool stopCycle = false; if (tstRslt != null) { Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters); @@ -819,7 +820,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEval tstRslt.DiverterStart = switchTimeStart; tstRslt.DiverterEnd = switchTimeEnd; long infoFlags = 0; - tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, false, true, switchTimeStart, switchTimeEnd, out infoFlags) : 0; + tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, false, true, switchTimeStart, switchTimeEnd, out infoFlags, out stopCycle) : 0; tstRslt.InfoFlags = infoFlags; tstRslt.Components = Results.Entities.Components @@ -838,6 +839,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEval Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.TransitionAfter)); + if (stopCycle) retVal = Event.ErrorFlagsStop; stopTest: @@ -847,7 +849,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEval /// Quit this sequence /// if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError - || retVal == Event.Error || retVal == Event.ConfigurationError) + || retVal == Event.RecoverableError || retVal == Event.ErrorFlagsStop + || retVal == Event.Error || retVal == Event.ConfigurationError) { State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name)) .AddOperation(checkUiOp) diff --git a/TBF/BenchControl/TestMethods/FixedStartMassCollDeferredEval/FixedStartMassCollDeferredEvalSeq.cs b/TBF/BenchControl/TestMethods/FixedStartMassCollDeferredEval/FixedStartMassCollDeferredEvalSeq.cs index b4291615c..dda706bce 100644 --- a/TBF/BenchControl/TestMethods/FixedStartMassCollDeferredEval/FixedStartMassCollDeferredEvalSeq.cs +++ b/TBF/BenchControl/TestMethods/FixedStartMassCollDeferredEval/FixedStartMassCollDeferredEvalSeq.cs @@ -927,6 +927,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollDeferredEval /// Results.Entities.TestRslt tstRslt = BatchRslts.GetTestRslt(testName, test.Part); + bool stopCycle = false; if (tstRslt != null) { Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters); @@ -965,7 +966,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollDeferredEval tstRslt.DiverterStart = switchTimeStart; tstRslt.DiverterEnd = switchTimeEnd; long infoFlags = 0; - tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, false, true, switchTimeStart, switchTimeEnd, out infoFlags) : 0; + tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, false, true, switchTimeStart, switchTimeEnd, out infoFlags, out stopCycle) : 0; tstRslt.InfoFlags = infoFlags; tstRslt.Components = Results.Entities.Components @@ -984,6 +985,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollDeferredEval Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.TransitionAfter)); + if (stopCycle) retVal = Event.ErrorFlagsStop; stopTest: @@ -993,7 +995,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollDeferredEval /// Quit this sequence /// if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError - || retVal == Event.Error || retVal == Event.ConfigurationError) + || retVal == Event.RecoverableError || retVal == Event.ErrorFlagsStop + || retVal == Event.Error || retVal == Event.ConfigurationError) { State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name)) .AddOperation(checkUiOp) diff --git a/TBF/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs b/TBF/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs index 180cf54de..429a3867d 100644 --- a/TBF/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs +++ b/TBF/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs @@ -959,6 +959,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection /// Results.Entities.TestRslt tstRslt = BatchRslts.GetTestRslt(testName, test.Part); + bool stopCycle = false; if (tstRslt != null) { Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters); @@ -997,7 +998,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection tstRslt.DiverterStart = switchTimeStart; tstRslt.DiverterEnd = switchTimeEnd; long infoFlags = 0; - tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, false, true, switchTimeStart, switchTimeEnd, out infoFlags) : 0; + tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, false, true, switchTimeStart, switchTimeEnd, out infoFlags, out stopCycle) : 0; tstRslt.InfoFlags = infoFlags; if (compound) @@ -1189,6 +1190,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection /// Append the results to the CSV-file allResults.Info(TestResult2CsvLine(testName, test.Part)); + if (stopCycle) retVal = Event.ErrorFlagsStop; stopTest: @@ -1198,7 +1200,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection /// Quit this sequence /// if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError - || retVal == Event.Error || retVal == Event.ConfigurationError) + || retVal == Event.RecoverableError || retVal == Event.ErrorFlagsStop + || retVal == Event.Error || retVal == Event.ConfigurationError) { State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name)) .AddOperation(checkUiOp) diff --git a/TBF/BenchControl/TestMethods/FixedStartTankCollection/FixedStartTankCollectionSeq.cs b/TBF/BenchControl/TestMethods/FixedStartTankCollection/FixedStartTankCollectionSeq.cs index 7d4b89a71..ac5edfbff 100644 --- a/TBF/BenchControl/TestMethods/FixedStartTankCollection/FixedStartTankCollectionSeq.cs +++ b/TBF/BenchControl/TestMethods/FixedStartTankCollection/FixedStartTankCollectionSeq.cs @@ -704,6 +704,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartTankCollection /// Results.Entities.TestRslt tstRslt = BatchRslts.GetTestRslt(testName, test.Part); + bool stopCycle = false; if (tstRslt != null) { Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters); @@ -741,7 +742,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartTankCollection tstRslt.DiverterStart = switchTimeStart; tstRslt.DiverterEnd = switchTimeEnd; long infoFlags = 0; - tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, false, true, switchTimeStart, switchTimeEnd, out infoFlags) : 0; + tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, false, true, switchTimeStart, switchTimeEnd, out infoFlags, out stopCycle) : 0; tstRslt.InfoFlags = infoFlags; if (compoundTestParams != null) @@ -863,6 +864,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartTankCollection /// Append the results to the CSV-file allResults.Info(TestResult2CsvLine(testName, test.Part)); + if (stopCycle) retVal = Event.ErrorFlagsStop; stopTest: @@ -872,7 +874,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartTankCollection /// Quit this sequence /// if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError - || retVal == Event.Error || retVal == Event.ConfigurationError) + || retVal == Event.RecoverableError || retVal == Event.ErrorFlagsStop + || retVal == Event.Error || retVal == Event.ConfigurationError) { State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name)) .AddOperation(checkUiOp) diff --git a/TBF/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs b/TBF/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs index 8b7393a91..4c3f8fd9f 100644 --- a/TBF/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs +++ b/TBF/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs @@ -461,7 +461,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStart /// Results.Entities.TestRslt tstRslt = BatchRslts.GetTestRslt(testName, test.Part); - if (tstRslt != null) + bool stopCycle = false; + if (tstRslt != null) { Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters); UpdateTempPressDensAmb(tstRslt); @@ -497,7 +498,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStart tstRslt.DiverterStart = 0; tstRslt.DiverterEnd = 0; long infoFlags = 0; - tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, false, false, 0, 0, out infoFlags) : 0; + tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, false, false, 0, 0, out infoFlags, out stopCycle) : 0; tstRslt.InfoFlags = infoFlags; if (compoundTestParams != null) @@ -618,8 +619,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStart } #if IPERL meterRslt.WaterMeter.CalibFactor = iPerl.CalibFactor; -#endif meterRslt.ExtraDataPath = iPerl.ExtraDataPath; +#endif iPerl.LastTestResult2 = iPerl.LastTestResult; /// Save shift previous test result iPerl.LastTestResult = meterRslt; /// Save this test result } @@ -715,6 +716,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStart /// Append the results to the CSV-file allResults.Info(TestResult2CsvLine(testName, test.Part)); + if (stopCycle) retVal = Event.ErrorFlagsStop; stopTest: @@ -735,8 +737,9 @@ namespace TBF.BenchControl.TestMethods.FlyingStart /// /// Quit this sequence /// - if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError - || retVal == Event.Error || retVal == Event.ConfigurationError) + if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError + || retVal == Event.RecoverableError || retVal == Event.ErrorFlagsStop + || retVal == Event.Error || retVal == Event.ConfigurationError) { State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name)) .AddOperation(checkUiOp) diff --git a/TBF/BenchControl/TestMethods/FlyingStartFirstRepetWithMassColl/FlyingStartFirstRepetWithMassCollSeq.cs b/TBF/BenchControl/TestMethods/FlyingStartFirstRepetWithMassColl/FlyingStartFirstRepetWithMassCollSeq.cs index 3aede974f..b32076e8d 100644 --- a/TBF/BenchControl/TestMethods/FlyingStartFirstRepetWithMassColl/FlyingStartFirstRepetWithMassCollSeq.cs +++ b/TBF/BenchControl/TestMethods/FlyingStartFirstRepetWithMassColl/FlyingStartFirstRepetWithMassCollSeq.cs @@ -734,7 +734,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl /// Results.Entities.TestRslt tstRslt = BatchRslts.GetTestRslt(testName, test.Part); - if (tstRslt != null) + bool stopCycle = false; + if (tstRslt != null) { Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters); UpdateTempPressDensAmb(tstRslt); @@ -783,7 +784,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl (tstRslt.DiverterStart * 1000).ToString("F0"), tstRslt.DivStart10, tstRslt.DivStart50, tstRslt.DivStart90, (tstRslt.DiverterEnd * 1000).ToString("F0"), tstRslt.DivEnd90, tstRslt.DivEnd50, tstRslt.DivEnd10); long infoFlags = 0; - tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, true, false, tstRslt.DiverterStart, tstRslt.DiverterEnd, out infoFlags) : 0; + tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, true, false, tstRslt.DiverterStart, tstRslt.DiverterEnd, out infoFlags, out stopCycle) : 0; tstRslt.InfoFlags = infoFlags; } else @@ -814,7 +815,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl tstRslt.DivEnd10 = 0; long infoFlags = 0; - tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, false, false, 0, 0, out infoFlags) : 0; + tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, false, false, 0, 0, out infoFlags, out stopCycle) : 0; tstRslt.InfoFlags = infoFlags; } @@ -996,8 +997,9 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl } #if IPERL meterRslt.WaterMeter.CalibFactor = iPerl.CalibFactor; + meterRslt.ExtraDataPath = iPerl.ExtraDataPath; #endif - iPerl.LastTestResult2 = iPerl.LastTestResult; /// Save shift previous test result + iPerl.LastTestResult2 = iPerl.LastTestResult; /// Save shift previous test result iPerl.LastTestResult = meterRslt; /// Save this test result } } @@ -1070,6 +1072,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl /// Append the results to the CSV-file allResults.Info(TestResult2CsvLine(testName, test.Part)); + if (stopCycle) retVal = Event.ErrorFlagsStop; stopTest: @@ -1079,7 +1082,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl /// Quit this sequence /// if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError - || retVal == Event.Error || retVal == Event.ConfigurationError) + || retVal == Event.RecoverableError || retVal == Event.ErrorFlagsStop + || retVal == Event.Error || retVal == Event.ConfigurationError) { State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name)) .AddOperation(checkUiOp) diff --git a/TBF/BenchControl/TestMethods/FlyingStartMassCollComparative/FlyingStartMassCollComparativeSeq.cs b/TBF/BenchControl/TestMethods/FlyingStartMassCollComparative/FlyingStartMassCollComparativeSeq.cs index cc7429e8f..77579c847 100644 --- a/TBF/BenchControl/TestMethods/FlyingStartMassCollComparative/FlyingStartMassCollComparativeSeq.cs +++ b/TBF/BenchControl/TestMethods/FlyingStartMassCollComparative/FlyingStartMassCollComparativeSeq.cs @@ -851,7 +851,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollComparative /// Results.Entities.TestRslt tstRslt = BatchRslts.GetTestRslt(testName, test.Part); - if (tstRslt != null) + bool stopCycle = false; + if (tstRslt != null) { Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters); UpdateTempPressDensAmb(tstRslt); @@ -904,7 +905,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollComparative (tstRslt.DiverterStart * 1000).ToString("F0"), tstRslt.DivStart10, tstRslt.DivStart50, tstRslt.DivStart90, (tstRslt.DiverterEnd * 1000).ToString("F0"), tstRslt.DivEnd90, tstRslt.DivEnd50, tstRslt.DivEnd10); long infoFlags = 0; - tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, true, false, tstRslt.DiverterStart, tstRslt.DiverterEnd, out infoFlags) : 0; + tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, true, false, tstRslt.DiverterStart, tstRslt.DiverterEnd, out infoFlags, out stopCycle) : 0; tstRslt.InfoFlags = infoFlags; if (compoundTestParams != null) @@ -1079,8 +1080,9 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollComparative } #if IPERL meterRslt.WaterMeter.CalibFactor = iPerl.CalibFactor; + meterRslt.ExtraDataPath = iPerl.ExtraDataPath; #endif - iPerl.LastTestResult2 = iPerl.LastTestResult; /// Save shift previous test result + iPerl.LastTestResult2 = iPerl.LastTestResult; /// Save shift previous test result iPerl.LastTestResult = meterRslt; /// Save this test result } } @@ -1174,6 +1176,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollComparative /// Append the results to the CSV-file allResults.Info(TestResult2CsvLine(testName, test.Part)); + if (stopCycle) retVal = Event.ErrorFlagsStop; + stopTest: StopRecordingStatistics(); /// Make sure graph files are closed @@ -1182,7 +1186,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollComparative /// Quit this sequence /// if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError - || retVal == Event.Error || retVal == Event.ConfigurationError) + || retVal == Event.RecoverableError || retVal == Event.ErrorFlagsStop + || retVal == Event.Error || retVal == Event.ConfigurationError) { State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name)) .AddOperation(checkUiOp) diff --git a/TBF/BenchControl/TestMethods/FlyingStartMassCollProlonged/FlyingStartMassCollProlongedSeq.cs b/TBF/BenchControl/TestMethods/FlyingStartMassCollProlonged/FlyingStartMassCollProlongedSeq.cs index db4ffb59b..5c27d8e0b 100644 --- a/TBF/BenchControl/TestMethods/FlyingStartMassCollProlonged/FlyingStartMassCollProlongedSeq.cs +++ b/TBF/BenchControl/TestMethods/FlyingStartMassCollProlonged/FlyingStartMassCollProlongedSeq.cs @@ -794,7 +794,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged /// Results.Entities.TestRslt tstRslt = BatchRslts.GetTestRslt(testName, test.Part); - if (tstRslt != null) + bool stopCycle = false; + if (tstRslt != null) { Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters); UpdateTempPressDensAmb(tstRslt); @@ -851,7 +852,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged (tstRslt.DiverterStart * 1000).ToString("F0"), tstRslt.DivStart10, tstRslt.DivStart50, tstRslt.DivStart90, (tstRslt.DiverterEnd * 1000).ToString("F0"), tstRslt.DivEnd90, tstRslt.DivEnd50, tstRslt.DivEnd10); long infoFlags = 0; - tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, true, false, tstRslt.DiverterStart, tstRslt.DiverterEnd, out infoFlags) : 0; + tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, true, false, tstRslt.DiverterStart, tstRslt.DiverterEnd, out infoFlags, out stopCycle) : 0; tstRslt.InfoFlags = infoFlags; if (compoundTestParams != null) @@ -1027,8 +1028,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged } #if IPERL meterRslt.WaterMeter.CalibFactor = iPerl.CalibFactor; -#endif meterRslt.ExtraDataPath = iPerl.ExtraDataPath; +#endif iPerl.LastTestResult2 = iPerl.LastTestResult; /// Save shift previous test result iPerl.LastTestResult = meterRslt; /// Save this test result } @@ -1129,6 +1130,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged /// Append the results to the CSV-file allResults.Info(TestResult2CsvLine(testName, test.Part)); + if (stopCycle) retVal = Event.ErrorFlagsStop; + stopTest: StopRecordingStatistics(); @@ -1136,7 +1139,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged /// /// Quit this sequence /// - if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError + if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError + || retVal == Event.RecoverableError || retVal == Event.ErrorFlagsStop || retVal == Event.Error || retVal == Event.ConfigurationError) { State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name)) diff --git a/TBF/BenchControl/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs b/TBF/BenchControl/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs index ce3d44edb..6793a73ba 100644 --- a/TBF/BenchControl/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs +++ b/TBF/BenchControl/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs @@ -724,7 +724,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection /// Results.Entities.TestRslt tstRslt = BatchRslts.GetTestRslt(testName, test.Part); - if (tstRslt != null) + bool stopCycle = false; + if (tstRslt != null) { Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters); UpdateTempPressDensAmb(tstRslt); @@ -777,7 +778,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection (tstRslt.DiverterStart * 1000).ToString("F0"), tstRslt.DivStart10, tstRslt.DivStart50, tstRslt.DivStart90, (tstRslt.DiverterEnd * 1000).ToString("F0"), tstRslt.DivEnd90, tstRslt.DivEnd50, tstRslt.DivEnd10); long infoFlags = 0; - tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, true, false, tstRslt.DiverterStart, tstRslt.DiverterEnd, out infoFlags) : 0; + tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, true, false, tstRslt.DiverterStart, tstRslt.DiverterEnd, out infoFlags, out stopCycle) : 0; tstRslt.InfoFlags = infoFlags; if (compoundTestParams != null) @@ -952,10 +953,10 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection meterRslt.WaterMeter.ResultCode |= iPerl.ResultCode; } #if IPERL - meterRslt.WaterMeter.CalibFactor = iPerl.CalibFactor; -#endif + meterRslt.WaterMeter.CalibFactor = iPerl.CalibFactor; meterRslt.ExtraDataPath = iPerl.ExtraDataPath; - iPerl.LastTestResult2 = iPerl.LastTestResult; /// Save shift previous test result +#endif + iPerl.LastTestResult2 = iPerl.LastTestResult; /// Save shift previous test result iPerl.LastTestResult = meterRslt; /// Save this test result } @@ -1076,6 +1077,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection /// Append the results to the CSV-file allResults.Info(TestResult2CsvLine(testName, test.Part)); + if (stopCycle) retVal = Event.ErrorFlagsStop; + stopTest: StopRecordingStatistics(); /// Make sure graph files are closed @@ -1083,8 +1086,9 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection /// /// Quit this sequence /// - if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError - || retVal == Event.Error || retVal == Event.ConfigurationError) + if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError + || retVal == Event.RecoverableError || retVal == Event.ErrorFlagsStop + || retVal == Event.Error || retVal == Event.ConfigurationError) { State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name)) .AddOperation(checkUiOp) diff --git a/TBF/BenchControl/TestMethods/FlyingStartTankCollection/FlyingStartTankCollectionSeq.cs b/TBF/BenchControl/TestMethods/FlyingStartTankCollection/FlyingStartTankCollectionSeq.cs index b6a0ff948..f17fd7b3d 100644 --- a/TBF/BenchControl/TestMethods/FlyingStartTankCollection/FlyingStartTankCollectionSeq.cs +++ b/TBF/BenchControl/TestMethods/FlyingStartTankCollection/FlyingStartTankCollectionSeq.cs @@ -484,7 +484,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection /// Results.Entities.TestRslt tstRslt = BatchRslts.GetTestRslt(testName, test.Part); - if (tstRslt != null) + bool stopCycle = false; + if (tstRslt != null) { Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters); UpdateTempPressDensAmb(tstRslt); @@ -536,7 +537,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection (tstRslt.DiverterStart * 1000).ToString("F0"), tstRslt.DivStart10, tstRslt.DivStart50, tstRslt.DivStart90, (tstRslt.DiverterEnd * 1000).ToString("F0"), tstRslt.DivEnd90, tstRslt.DivEnd50, tstRslt.DivEnd10); long infoFlags = 0; - tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, true, false, tstRslt.DiverterStart, tstRslt.DiverterEnd, out infoFlags) : 0; + tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, true, false, tstRslt.DiverterStart, tstRslt.DiverterEnd, out infoFlags, out stopCycle) : 0; tstRslt.InfoFlags = infoFlags; if (compoundTestParams != null) @@ -639,9 +640,10 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection meterRslt.WaterMeter.ResultCode |= iPerl.ResultCode; } #if IPERL - meterRslt.WaterMeter.CalibFactor = iPerl.CalibFactor; + meterRslt.WaterMeter.CalibFactor = iPerl.CalibFactor; + meterRslt.ExtraDataPath = iPerl.ExtraDataPath; #endif - iPerl.LastTestResult2 = iPerl.LastTestResult; /// Save shift previous test result + iPerl.LastTestResult2 = iPerl.LastTestResult; /// Save shift previous test result iPerl.LastTestResult = meterRslt; /// Save this test result } } @@ -735,6 +737,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection /// Append the results to the CSV-file allResults.Info(TestResult2CsvLine(testName, test.Part)); + if (stopCycle) retVal = Event.ErrorFlagsStop; + stopTest: StopRecordingStatistics(); /// Make sure graph files are closed @@ -743,7 +747,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection /// Quit this sequence /// if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError - || retVal == Event.Error || retVal == Event.ConfigurationError) + || retVal == Event.RecoverableError || retVal == Event.ErrorFlagsStop + || retVal == Event.Error || retVal == Event.ConfigurationError) { State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name)) .AddOperation(checkUiOp) diff --git a/TBF/BenchControl/TestMethods/LeakTest/LeakTestSeq.cs b/TBF/BenchControl/TestMethods/LeakTest/LeakTestSeq.cs index 894cdb862..fb9071561 100644 --- a/TBF/BenchControl/TestMethods/LeakTest/LeakTestSeq.cs +++ b/TBF/BenchControl/TestMethods/LeakTest/LeakTestSeq.cs @@ -462,7 +462,6 @@ namespace TBF.BenchControl.TestMethods.LeakTest /// Append the results to the CSV-file allResults.Info(TestResult2CsvLine(testName, test.Part)); - stopTest: StopRecordingStatistics(); @@ -473,7 +472,8 @@ namespace TBF.BenchControl.TestMethods.LeakTest /// Quit this sequence /// if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError - || retVal == Event.Error || retVal == Event.ConfigurationError) + || retVal == Event.RecoverableError || retVal == Event.ErrorFlagsStop + || retVal == Event.Error || retVal == Event.ConfigurationError) { State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name)) .AddOperation(checkUiOp) diff --git a/TBF/BenchControl/TestMethods/ManualEntry/ManualEntrySeq.cs b/TBF/BenchControl/TestMethods/ManualEntry/ManualEntrySeq.cs index 8c05dcce4..4c19b93c1 100644 --- a/TBF/BenchControl/TestMethods/ManualEntry/ManualEntrySeq.cs +++ b/TBF/BenchControl/TestMethods/ManualEntry/ManualEntrySeq.cs @@ -51,6 +51,7 @@ namespace TBF.BenchControl.TestMethods.ManualEntry /// Results.Entities.TestRslt tstRslt = BatchRslts.GetTestRslt(testName, test.Part); + bool stopCycle = false; if (tstRslt != null) { Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters); @@ -85,7 +86,7 @@ namespace TBF.BenchControl.TestMethods.ManualEntry tstRslt.DiverterStart = 0; tstRslt.DiverterEnd = 0; long infoFlags = 0; - tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, false, false, 0, 0, out infoFlags) : 0; + tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, false, false, 0, 0, out infoFlags, out stopCycle) : 0; tstRslt.InfoFlags = infoFlags; for (int i = 0; i < BatchRslts.WMPositionsCount; i++) diff --git a/TBF/BenchControl/TestMethods/PMaxTest/PMaxTestSeq.cs b/TBF/BenchControl/TestMethods/PMaxTest/PMaxTestSeq.cs index 1bb391f34..12b4b0e0c 100644 --- a/TBF/BenchControl/TestMethods/PMaxTest/PMaxTestSeq.cs +++ b/TBF/BenchControl/TestMethods/PMaxTest/PMaxTestSeq.cs @@ -283,7 +283,6 @@ namespace TBF.BenchControl.TestMethods.PMaxTest /// Append the results to the CSV-file allResults.Info(TestResult2CsvLine(testName, test.Part)); - stopTest: StopRecordingStatistics(); @@ -294,7 +293,8 @@ namespace TBF.BenchControl.TestMethods.PMaxTest /// Quit this sequence /// if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError - || retVal == Event.Error || retVal == Event.ConfigurationError) + || retVal == Event.RecoverableError || retVal == Event.ErrorFlagsStop + || retVal == Event.Error || retVal == Event.ConfigurationError) { State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name)) .AddOperation(checkUiOp) diff --git a/TBF/BenchControl/TestMethods/PulsesTest/PulsesTestSeq.cs b/TBF/BenchControl/TestMethods/PulsesTest/PulsesTestSeq.cs index ea8e0a146..621ff561c 100644 --- a/TBF/BenchControl/TestMethods/PulsesTest/PulsesTestSeq.cs +++ b/TBF/BenchControl/TestMethods/PulsesTest/PulsesTestSeq.cs @@ -57,6 +57,7 @@ namespace TBF.BenchControl.TestMethods.PulsesTest public IList Execute(Test test, int repetitionNr, bool isLastRepetition, TestParams testParams, DebugMode mode) { float simulatedError = 4.5f; /// % + bool stopCycle = false; int rangeIx = 0; /// Default range, used for non-Elde flowmeters if (outPath.FlowMeter is Elde.FlowMeter.FlowMeter) @@ -390,7 +391,7 @@ namespace TBF.BenchControl.TestMethods.PulsesTest /// Results.Entities.TestRslt tstRslt = BatchRslts.GetTestRslt(testName, test.Part); - if (tstRslt != null) + if (tstRslt != null) { Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters); UpdateTempPressDensAmb(tstRslt); @@ -425,7 +426,7 @@ namespace TBF.BenchControl.TestMethods.PulsesTest tstRslt.DiverterStart = 0; tstRslt.DiverterEnd = 0; long infoFlags = 0; - tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, false, false, 0, 0, out infoFlags) : 0; + tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, false, false, 0, 0, out infoFlags, out stopCycle) : 0; tstRslt.InfoFlags = infoFlags; for (int i = 0; i < BatchRslts.WMPositionsCount; i++) @@ -499,6 +500,8 @@ namespace TBF.BenchControl.TestMethods.PulsesTest /// Append the results to the CSV-file allResults.Info(TestResult2CsvLine(testName, test.Part)); + if (stopCycle) retVal = Event.ErrorFlagsStop; + stopTest: /// Close the modeless form @@ -512,7 +515,8 @@ namespace TBF.BenchControl.TestMethods.PulsesTest /// Quit this sequence /// if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError - || retVal == Event.Error || retVal == Event.ConfigurationError) + || retVal == Event.RecoverableError || retVal == Event.ErrorFlagsStop + || retVal == Event.Error || retVal == Event.ConfigurationError) { State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name)) .AddOperation(checkUiOp) diff --git a/TBF/BenchControl/TestMethods/PulsesTestManual/PulsesTestManualSeq.cs b/TBF/BenchControl/TestMethods/PulsesTestManual/PulsesTestManualSeq.cs index 324d39db5..61d1c6c04 100644 --- a/TBF/BenchControl/TestMethods/PulsesTestManual/PulsesTestManualSeq.cs +++ b/TBF/BenchControl/TestMethods/PulsesTestManual/PulsesTestManualSeq.cs @@ -57,6 +57,7 @@ namespace TBF.BenchControl.TestMethods.PulsesTestManual public IList Execute(Test test, int repetitionNr, bool isLastRepetition, DebugMode mode) { float simulatedError = 4.5f; /// % + bool stopCycle = false; int rangeIx = 0; /// Default range, used for non-Elde flowmeters if (outPath.FlowMeter is Elde.FlowMeter.FlowMeter) @@ -392,7 +393,7 @@ namespace TBF.BenchControl.TestMethods.PulsesTestManual /// Results.Entities.TestRslt tstRslt = BatchRslts.GetTestRslt(testName, test.Part); - if (tstRslt != null) + if (tstRslt != null) { Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters); UpdateTempPressDensAmb(tstRslt); @@ -427,7 +428,7 @@ namespace TBF.BenchControl.TestMethods.PulsesTestManual tstRslt.DiverterStart = 0; tstRslt.DiverterEnd = 0; long infoFlags = 0; - tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, false, false, 0, 0, out infoFlags) : 0; + tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, false, false, 0, 0, out infoFlags, out stopCycle) : 0; tstRslt.InfoFlags = infoFlags; for (int i = 0; i < BatchRslts.WMPositionsCount; i++) @@ -497,13 +498,16 @@ namespace TBF.BenchControl.TestMethods.PulsesTestManual /// Append the results to the CSV-file allResults.Info(TestResult2CsvLine(testName, test.Part)); + if (stopCycle) retVal = Event.ErrorFlagsStop; + stopTest: /// /// Quit this sequence /// if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError - || retVal == Event.Error || retVal == Event.ConfigurationError) + || retVal == Event.RecoverableError || retVal == Event.ErrorFlagsStop + || retVal == Event.Error || retVal == Event.ConfigurationError) { State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name)) .AddOperation(checkUiOp) diff --git a/TBF/BenchControl/TestMethods/RoiDetection/RoiDetectionSeq.cs b/TBF/BenchControl/TestMethods/RoiDetection/RoiDetectionSeq.cs index 50b7953b3..d356cd363 100644 --- a/TBF/BenchControl/TestMethods/RoiDetection/RoiDetectionSeq.cs +++ b/TBF/BenchControl/TestMethods/RoiDetection/RoiDetectionSeq.cs @@ -259,7 +259,8 @@ namespace TBF.BenchControl.TestMethods.RoiDetection /// Quit this sequence /// if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError - || retVal == Event.Error || retVal == Event.ConfigurationError) + || retVal == Event.RecoverableError || retVal == Event.ErrorFlagsStop + || retVal == Event.Error || retVal == Event.ConfigurationError) { State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name)) .AddOperation(checkUiOp) diff --git a/TBF/BenchControl/TestMethods/SensitivityTest/SensitivityTestSeq.cs b/TBF/BenchControl/TestMethods/SensitivityTest/SensitivityTestSeq.cs index 97e836011..4e7ed2f7d 100644 --- a/TBF/BenchControl/TestMethods/SensitivityTest/SensitivityTestSeq.cs +++ b/TBF/BenchControl/TestMethods/SensitivityTest/SensitivityTestSeq.cs @@ -459,7 +459,8 @@ namespace TBF.BenchControl.TestMethods.SensitivityTest /// Results.Entities.TestRslt tstRslt = BatchRslts.GetTestRslt(testName, test.Part); - if (tstRslt != null) + bool stopCycle = false; + if (tstRslt != null) { Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters); UpdateTempPressDensAmb(tstRslt); @@ -493,7 +494,7 @@ namespace TBF.BenchControl.TestMethods.SensitivityTest tstRslt.DiverterStart = switchTimeStart; tstRslt.DiverterEnd = switchTimeEnd; long infoFlags = 0; - tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, true, false, switchTimeStart, switchTimeEnd, out infoFlags) : 0; + tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, true, false, switchTimeStart, switchTimeEnd, out infoFlags, out stopCycle) : 0; tstRslt.InfoFlags = infoFlags; for (int i = 0; i < BatchRslts.WMPositionsCount; i++) @@ -549,11 +550,13 @@ namespace TBF.BenchControl.TestMethods.SensitivityTest /// Append the results to the CSV-file allResults.Info(TestResult2CsvLine(testName, test.Part)); + if (stopCycle) retVal = Event.ErrorFlagsStop; + ///----------------------/// /// Quit this sequence /// ///----------------------/// - if (isLastRepetition) + if (isLastRepetition || stopCycle) { /// Stop the pump State.Create(string.Format("{0}({1}) : Test(s) completed -> Stopping the pump", test.Method, test.Name)) @@ -568,7 +571,7 @@ namespace TBF.BenchControl.TestMethods.SensitivityTest while (!e.Contains(Event.ValvesSet) || ((inPath.Pump is GenericDevices.IPumpFM) && !e.Contains(Event.TurnPumpOnOffDone))); } - return new List { Event.Done }; + return stopCycle ? new List { Event.ErrorFlagsStop } : new List { Event.Done }; stopTest: @@ -577,23 +580,24 @@ namespace TBF.BenchControl.TestMethods.SensitivityTest /// /// Quit this sequence /// - if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError - || retVal == Event.Error || retVal == Event.ConfigurationError) + if (isLastRepetition || retVal == Event.UiCmdStop + || retVal == Event.OpArgumentError + || retVal == Event.RecoverableError + || retVal == Event.ErrorFlagsStop + || 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 - { + do { e = StateMachine.WaitRunDevsRunOps(); if (TestAndLogUiCmdStop(test, e)) break; } while (!e.Contains(Event.PreviousStopped)); } - stopTestWOStoppingDivGateEtc: - return new List { retVal }; } } diff --git a/TBF/BenchControl/TestMethods/iPerlCommunication/iPerlHead/IperlHead.cs b/TBF/BenchControl/TestMethods/iPerlCommunication/iPerlHead/IperlHead.cs index 20df6a0b6..ac0a65bf2 100644 --- a/TBF/BenchControl/TestMethods/iPerlCommunication/iPerlHead/IperlHead.cs +++ b/TBF/BenchControl/TestMethods/iPerlCommunication/iPerlHead/IperlHead.cs @@ -72,7 +72,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead } public bool Disabled; - public bool CommFailed; + public bool CommFailed; public int ResultCode; @@ -377,8 +377,8 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead if (DebugLevel == DebugMode.Normal) { /// Prepare serial port - optoSerialPort = new SerialPort(string.Format("COM{0}", iperlHeadCfg.OptoComPortNr), - 9600, Parity.None, 8, StopBits.One); + string portName = string.Format("COM{0}", iperlHeadCfg.OptoComPortNr); + optoSerialPort = new SerialPort(portName, 9600, Parity.None, 8, StopBits.One); optoSerialPort.Handshake = Handshake.None; optoSerialPort.Open(); log.FatalFormat("{0} initialized: {1}", Name, this); diff --git a/TBF/BenchControl/Various/ErrorFlags/Errors.cs b/TBF/BenchControl/Various/ErrorFlags/Errors.cs index e1e628580..b0f2716d4 100644 --- a/TBF/BenchControl/Various/ErrorFlags/Errors.cs +++ b/TBF/BenchControl/Various/ErrorFlags/Errors.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2017-2020 Sensus Slovensko a.s. +/// Copyright (c) 2017-2021 Sensus Slovensko a.s. /// using System; using System.Collections.Generic; @@ -26,7 +26,7 @@ namespace TBF.BenchControl.Various.ErrorFlags /// Diverter or valve switch time in s on test start /// Diverter or valve switch time in s on test end /// Error flags - public long GetErrorFlags(TestRslt testRslt, bool diverter, bool startStopValve, float switchTimeStart, float switchTimeEnd, out long infoFlags) + public long GetErrorFlags(TestRslt testRslt, bool diverter, bool startStopValve, float switchTimeStart, float switchTimeEnd, out long infoFlags, out bool stopCycle) { /// Any E# is 'true' on error, 'false' when OK @@ -137,6 +137,25 @@ namespace TBF.BenchControl.Various.ErrorFlags if (E21 && (errorsCfg.TestParams.E21 == info)) _infoFlags |= (long)ErrorFlagMask.E21; if (E36 && (errorsCfg.TestParams.E36 == info)) _infoFlags |= (long)ErrorFlagMask.E36; + stopCycle = false; + if (E1 && (errorsCfg.TestParams.E1 == stop)) stopCycle = true; + if (E2 && (errorsCfg.TestParams.E2 == stop)) stopCycle = true; + if (E3 && (errorsCfg.TestParams.E3 == stop)) stopCycle = true; + if (E4 && (errorsCfg.TestParams.E4 == stop)) stopCycle = true; + if (E5 && (errorsCfg.TestParams.E5 == stop)) stopCycle = true; + if (E6 && (errorsCfg.TestParams.E6 == stop)) stopCycle = true; + if (E7 && (errorsCfg.TestParams.E7 == stop)) stopCycle = true; + if (E8 && (errorsCfg.TestParams.E8 == stop)) stopCycle = true; + if (E9 && (errorsCfg.TestParams.E9 == stop)) stopCycle = true; + if (E10 && (errorsCfg.TestParams.E10 == stop)) stopCycle = true; + if (E11 && (errorsCfg.TestParams.E11 == stop)) stopCycle = true; + if (E12 && (errorsCfg.TestParams.E12 == stop)) stopCycle = true; + if (E13 && (errorsCfg.TestParams.E13 == stop)) stopCycle = true; + if (E14 && (errorsCfg.TestParams.E14 == stop)) stopCycle = true; + /// E15, E16, E17, E18, E19, E20 skipped + if (E21 && (errorsCfg.TestParams.E21 == stop)) stopCycle = true; + if (E36 && (errorsCfg.TestParams.E36 == stop)) stopCycle = true; + infoFlags = _infoFlags; return errorFlags; } diff --git a/TBF/Properties/AssemblyInfo.cs b/TBF/Properties/AssemblyInfo.cs index 0705ebf7d..63de663f1 100644 --- a/TBF/Properties/AssemblyInfo.cs +++ b/TBF/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("2.26.1679.0")] -[assembly: AssemblyFileVersion("2.26.1679.0")] +[assembly: AssemblyVersion("2.26.1681.0")] +[assembly: AssemblyFileVersion("2.26.1681.0")]