From 39eb2cfd57d07c011e32cd93df329d74190d113e Mon Sep 17 00:00:00 2001 From: Milan Hanajik Date: Tue, 28 Apr 2015 15:27:47 +0200 Subject: [PATCH] Entry form related improvements / bugfixes (Fixed start collection method related). --- TODO.txt | 6 +-- .../BenchControl/Sequences/MainSeq.cs | 28 +++-------- .../BenchControl/Sequences/SequenceBase.cs | 4 -- .../TestMethods/Adjustment/AdjustmentSeq.cs | 6 +-- .../CombinedMeters/CombinedMetersSeq.cs | 8 +--- .../CombinedWithDetectionSeq.cs | 48 +++++++++---------- .../FixedStartMassCollectionSeq.cs | 8 +--- .../TestMethods/FlyingStart/FlyingStartSeq.cs | 8 +--- .../FlyingStartCollectionMethodSeq.cs | 6 +-- .../TestMethods/LeakTest/LeakTestSeq.cs | 8 +--- .../TestMethods/PMaxTest/PMaxTestSeq.cs | 8 +--- .../ReferenceFlowmeterCalibrationSeq.cs | 8 +--- 12 files changed, 46 insertions(+), 100 deletions(-) diff --git a/TODO.txt b/TODO.txt index e2126c858..75589e530 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,6 +1,6 @@ -- historia ordrov (cez settingy) - -- dokoncenie process obrazovky +- dokoncenie process obrazovky + rozsirenie pre 12 a 24 meracov +- stranka pre analyzy +------------ - brat desatinnu bodku aj ciarku - dat zapamatanie polohy RV do Parametrov - moznost prepinania klapky to Transition sekvencii (aby sa dala kontrolovat tesnost ventilov) diff --git a/TestBenchFramework/BenchControl/Sequences/MainSeq.cs b/TestBenchFramework/BenchControl/Sequences/MainSeq.cs index 71e139b64..fabb76238 100644 --- a/TestBenchFramework/BenchControl/Sequences/MainSeq.cs +++ b/TestBenchFramework/BenchControl/Sequences/MainSeq.cs @@ -163,7 +163,6 @@ namespace TBF.BenchControl.Sequences /// Make sure the CycleBeginForm is closed (aftrer an abnormal procedure/test end, etc.) CloseBeginForm(); - cycleBeginFormOpened = false; selection = MakeSelection(MKSelContext.ProcedureNotSelected); @@ -178,7 +177,6 @@ namespace TBF.BenchControl.Sequences /// Display 'Cycle Begin Form' if (OpenCycleBeginForm()) goto stop; - cycleBeginFormOpened = true; /// Find purge suquences Entities.TransitionSequence purgeBegin = null; @@ -231,6 +229,7 @@ namespace TBF.BenchControl.Sequences } select_cycle_or_test: + //---------------------------------------------------------- selection = MakeSelection(MKSelContext.InsideProcedure); /// @@ -240,7 +239,9 @@ namespace TBF.BenchControl.Sequences cycle_or_test_selected: - Bridge.Bench2UI(ButtonsEtc.StopBtnEn); /// Hide buttons + if (WaitBeginFormClosed()) goto stop; /// Make sure the entry form is closed + + Bridge.Bench2UI(ButtonsEtc.StopBtnEn); /// Hide buttons if (selection == Selection.Cycle) { @@ -284,14 +285,7 @@ namespace TBF.BenchControl.Sequences { StateMachine.LoadTestParams(test); - //-------------------------------------------------------------- - e = testMethodSequence.Execute(test); - - if (cycleBeginFormOpened) - { - cycleBeginFormOpened = false; - if (WaitBeginFormClosed()) goto stop; - } + e = testMethodSequence.Execute(test); if (e.Contains(Event.ConfigurationError)) goto select_cycle_or_test; if (e.Contains(Event.Error)) goto error; @@ -333,15 +327,8 @@ namespace TBF.BenchControl.Sequences if (testMethodSequence != null && testMethodSequence.CanTest(StateMachine.Procedure.MetersKind)) { StateMachine.LoadTestParams(test); - - //-------------------------------------------------------------- - e = testMethodSequence.Execute(test); - - if (cycleBeginFormOpened) - { - cycleBeginFormOpened = false; - if (WaitBeginFormClosed()) goto stop; - } + + e = testMethodSequence.Execute(test); if (e.Contains(Event.Error)) goto error; if (e.Contains(Event.OpArgumentError)) goto config_error; @@ -378,7 +365,6 @@ namespace TBF.BenchControl.Sequences { CloseBeginForm(); } - cycleBeginFormOpened = false; Bridge.OnActivity(this, "Enter protocol data"); diff --git a/TestBenchFramework/BenchControl/Sequences/SequenceBase.cs b/TestBenchFramework/BenchControl/Sequences/SequenceBase.cs index ff452016f..4c73630a4 100644 --- a/TestBenchFramework/BenchControl/Sequences/SequenceBase.cs +++ b/TestBenchFramework/BenchControl/Sequences/SequenceBase.cs @@ -103,8 +103,6 @@ namespace TBF.BenchControl.Sequences protected static float TimeEstimateBeginRpts; /// Time estimate at the beginning of all repetitions of the current tests protected static float TimeEstimateOneTest; /// Time estimate of the current test (one repetition) - protected static bool cycleBeginFormOpened; - static SequenceBase() { results = new List(); @@ -116,8 +114,6 @@ namespace TBF.BenchControl.Sequences WMVolumes[i] = new FloatBox() { Name = string.Format("Volume{0}", i), Format = "F2" }; WMErrors[i] = new FloatBox() { Name = string.Format("Error{0}", i), Format = "F2" }; } - - cycleBeginFormOpened = false; } ///------------------------------------------------------------ diff --git a/TestBenchFramework/BenchControl/TestMethods/Adjustment/AdjustmentSeq.cs b/TestBenchFramework/BenchControl/TestMethods/Adjustment/AdjustmentSeq.cs index 957d307b9..94e3ed9a6 100644 --- a/TestBenchFramework/BenchControl/TestMethods/Adjustment/AdjustmentSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/Adjustment/AdjustmentSeq.cs @@ -240,11 +240,7 @@ namespace TBF.BenchControl.TestMethods.Adjustment //------------------------------------------------ /// Make sure the CycleBeginForm is closed so that water meter data (s/n) can be copied into results - if (cycleBeginFormOpened) - { - cycleBeginFormOpened = false; - if (WaitBeginFormClosed()) goto stopTest; - } + if (WaitBeginFormClosed()) goto stopTest; /// /// Populate TestResult data entity with data diff --git a/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/CombinedMetersSeq.cs b/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/CombinedMetersSeq.cs index 5aae795aa..a4ea5a277 100644 --- a/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/CombinedMetersSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/CombinedMetersSeq.cs @@ -337,12 +337,8 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters Bridge.OnActivity(this, Strings.Test_completed); //------------------------------------------------ - /// Make sure the CycleBeginForm is closed so that water meter data (s/n) can be copied into results - if (cycleBeginFormOpened) - { - cycleBeginFormOpened = false; - if (WaitBeginFormClosed()) goto stopTest; - } + /// Make sure the CycleBeginForm is closed so that water meter data (s/n) can be copied into results + if (WaitBeginFormClosed()) goto stopTest; /// Optionally supress pulses from the large water meter if (testParams.SupressTrills) diff --git a/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs b/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs index c1dba1289..5f52bc6f9 100644 --- a/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs @@ -38,14 +38,14 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state //-------------------------------- - State.Create("CombinedWithDetection : stop diverter gate etc") + State.Create("CombinedWithDetection : stopTest diverter gate etc") .AddOperation(checkUiOp) .AddOperation(cBrd.StopPreviousOp()) .EnterState(); do { e = StateMachine.WaitRunDevsRunOps(); - if (e.Contains(Event.UiCmdStop)) goto stop; + if (e.Contains(Event.UiCmdStop)) goto stopTest; } while (!e.Contains(Event.PreviousStopped)); @@ -72,7 +72,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection switch (Transition(transitionStart, TransitionContext.TestStart)) { case Event.Error: goto error; - case Event.UiCmdStop: goto stop; + case Event.UiCmdStop: goto stopTest; } //==================================== @@ -93,7 +93,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection { e = StateMachine.WaitRunDevsRunOps(); if (e.Contains(Event.Error)) goto error; - if (e.Contains(Event.UiCmdStop)) goto stop; + if (e.Contains(Event.UiCmdStop)) goto stopTest; } while (!e.Contains(Event.BalanceDone)); @@ -108,7 +108,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection switch (EmptyTheTank(outPath.EmptyTankValve, outPath.Balance)) { case Event.Error: goto error; - case Event.UiCmdStop: goto stop; + case Event.UiCmdStop: goto stopTest; } switching_flow_detection: @@ -141,7 +141,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime); Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress)); - if (e.Contains(Event.UiCmdStop)) goto stop; + if (e.Contains(Event.UiCmdStop)) goto stopTest; } while (!e.Contains(Event.ValvesSet)); @@ -159,7 +159,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime); Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress)); - if (e.Contains(Event.UiCmdStop)) goto stop; + if (e.Contains(Event.UiCmdStop)) goto stopTest; if (e.Contains(Event.RegulValveTimeOut)) { Bridge.OnError(this, Strings.Timeout); @@ -172,7 +172,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection switch (ReadRegistersTempPressAmbient(measureOperations, false)) { case Event.Error: goto error; - case Event.UiCmdStop: goto stop; + case Event.UiCmdStop: goto stopTest; } //==================================== @@ -215,7 +215,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime); Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress)); - if (e.Contains(Event.UiCmdStop)) goto stop; + if (e.Contains(Event.UiCmdStop)) goto stopTest; } while (!e.Contains(Event.PositionReached)); @@ -232,7 +232,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection switch (ReadRegistersTempPressAmbient(measureOperations, false)) { case Event.Error: goto error; - case Event.UiCmdStop: goto stop; + case Event.UiCmdStop: goto stopTest; } int time = StateMachine.Time; @@ -350,7 +350,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime); Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress)); - if (e.Contains(Event.UiCmdStop)) goto stop; + if (e.Contains(Event.UiCmdStop)) goto stopTest; if (e.Contains(Event.RegulValveTimeOut)) { Bridge.OnError(this, Strings.Timeout); @@ -376,7 +376,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime); Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress)); - if (e.Contains(Event.UiCmdStop)) goto stop; + if (e.Contains(Event.UiCmdStop)) goto stopTest; //if (e.Contains(Event.FlowTimeOut)) goto do_detection; } while (!e.Contains(Event.FlowReached)); @@ -396,7 +396,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection { e = StateMachine.WaitRunDevsRunOps(); if (e.Contains(Event.Error)) goto error; - if (e.Contains(Event.UiCmdStop)) goto stop; + if (e.Contains(Event.UiCmdStop)) goto stopTest; } while (!e.Contains(Event.BalanceDone)); @@ -416,7 +416,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection { e = StateMachine.WaitRunDevsRunOps(); if (e.Contains(Event.Error)) goto error; - if (e.Contains(Event.UiCmdStop)) goto stop; + if (e.Contains(Event.UiCmdStop)) goto stopTest; } while (!e.Contains(Event.MeasurementStarted)); @@ -437,7 +437,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection switch (ReadRegistersTempPressAmbient(measureOperations, true)) { case Event.Error: goto error; - case Event.UiCmdStop: goto stop; + case Event.UiCmdStop: goto stopTest; case Event.MeasurementCompleted: goto measurement_completed; } @@ -503,7 +503,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection { e = StateMachine.WaitRunDevsRunOps(); if (e.Contains(Event.Error)) goto error; - if (e.Contains(Event.UiCmdStop)) goto stop; + if (e.Contains(Event.UiCmdStop)) goto stopTest; } while (!e.Contains(Event.BalanceDone)); /// @@ -522,7 +522,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection do { e = StateMachine.WaitRunDevsRunOps(); - if (e.Contains(Event.UiCmdStop)) goto stop; + if (e.Contains(Event.UiCmdStop)) goto stopTest; } while (!e.Contains(Event.ValvesSet)); @@ -535,17 +535,13 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection do { e = StateMachine.WaitRunDevsRunOps(); - if (e.Contains(Event.UiCmdStop)) goto stop; + if (e.Contains(Event.UiCmdStop)) goto stopTest; } while (!e.Contains(Event.PreviousStopped)); - /// Make sure the CycleBeginForm is closed so that water meter data (s/n) can be copied into results - if (cycleBeginFormOpened) - { - cycleBeginFormOpened = false; - if (WaitBeginFormClosed()) goto stop; - } + /// Make sure the CycleBeginForm is closed so that water meter data (s/n) can be copied into results + if (WaitBeginFormClosed()) goto stopTest; /// Optionally supress pulses from the large water meter if (testParams.SupressTrills) @@ -671,7 +667,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection switch (Transition(transitionStop, TransitionContext.TestEnd)) { case Event.Error: goto error; - case Event.UiCmdStop: goto stop; + case Event.UiCmdStop: goto stopTest; } /// Create the return value - a list with one event Event.Done - and return @@ -680,7 +676,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection return retval1; //==================================== - stop: + stopTest: State.Create("CombinedWithDetection : User selected STOP -> Closing the valves") .AddOperation(checkUiOp) diff --git a/TestBenchFramework/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs b/TestBenchFramework/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs index 433064353..3cf2937d1 100644 --- a/TestBenchFramework/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs @@ -473,12 +473,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection Bridge.OnActivity(this, Strings.Test_completed); //------------------------------------------------ - /// Make sure the CycleBeginForm is closed so that water meter data (s/n) can be copied into results - if (cycleBeginFormOpened) - { - cycleBeginFormOpened = false; - if (WaitBeginFormClosed()) goto stopTest; - } + /// Make sure the CycleBeginForm is closed so that water meter data (s/n) can be copied into results + if (WaitBeginFormClosed()) goto stopTest; /// /// Populate TestResult data entity with data diff --git a/TestBenchFramework/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs b/TestBenchFramework/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs index aaca59616..29ff7386b 100644 --- a/TestBenchFramework/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs @@ -208,12 +208,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStart Bridge.OnActivity(this, Strings.Test_completed); //------------------------------------------------ - /// Make sure the CycleBeginForm is closed so that water meter data (s/n) can be copied into results - if (cycleBeginFormOpened) - { - cycleBeginFormOpened = false; - if (WaitBeginFormClosed()) goto stopTest; - } + /// Make sure the CycleBeginForm is closed so that water meter data (s/n) can be copied into results + if (WaitBeginFormClosed()) goto stopTest; /// /// Populate TestResult data entity with data diff --git a/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/FlyingStartCollectionMethodSeq.cs b/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/FlyingStartCollectionMethodSeq.cs index 062c63610..61baaa68f 100644 --- a/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/FlyingStartCollectionMethodSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/FlyingStartCollectionMethodSeq.cs @@ -370,11 +370,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod //------------------------------------------------ /// Make sure the CycleBeginForm is closed so that water meter data (s/n) can be copied into results - if (cycleBeginFormOpened) - { - cycleBeginFormOpened = false; - if (WaitBeginFormClosed()) goto stopTest; - } + if (WaitBeginFormClosed()) goto stopTest; /// /// Populate TestResult data entity with data diff --git a/TestBenchFramework/BenchControl/TestMethods/LeakTest/LeakTestSeq.cs b/TestBenchFramework/BenchControl/TestMethods/LeakTest/LeakTestSeq.cs index 5d2affe24..b4027b497 100644 --- a/TestBenchFramework/BenchControl/TestMethods/LeakTest/LeakTestSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/LeakTest/LeakTestSeq.cs @@ -252,12 +252,8 @@ namespace TBF.BenchControl.TestMethods.LeakTest Bridge.OnActivity(this, Strings.Test_completed); //------------------------------------------------ - /// Make sure the CycleBeginForm is closed so that water meter data (s/n) can be copied into results - if (cycleBeginFormOpened) - { - cycleBeginFormOpened = false; - if (WaitBeginFormClosed()) goto stopTest; - } + /// Make sure the CycleBeginForm is closed so that water meter data (s/n) can be copied into results + if (WaitBeginFormClosed()) goto stopTest; /// /// Populate TestResult data entity with data diff --git a/TestBenchFramework/BenchControl/TestMethods/PMaxTest/PMaxTestSeq.cs b/TestBenchFramework/BenchControl/TestMethods/PMaxTest/PMaxTestSeq.cs index 727997741..5d9b5dd6e 100644 --- a/TestBenchFramework/BenchControl/TestMethods/PMaxTest/PMaxTestSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/PMaxTest/PMaxTestSeq.cs @@ -171,12 +171,8 @@ namespace TBF.BenchControl.TestMethods.PMaxTest Bridge.OnActivity(this, Strings.Test_completed); //------------------------------------------------ - /// Make sure the CycleBeginForm is closed so that water meter data (s/n) can be copied into results - if (cycleBeginFormOpened) - { - cycleBeginFormOpened = false; - if (WaitBeginFormClosed()) goto stopTest; - } + /// Make sure the CycleBeginForm is closed so that water meter data (s/n) can be copied into results + if (WaitBeginFormClosed()) goto stopTest; /// /// Populate TestResult data entity with data diff --git a/TestBenchFramework/BenchControl/TestMethods/ReferenceFlowmeterCalibration/ReferenceFlowmeterCalibrationSeq.cs b/TestBenchFramework/BenchControl/TestMethods/ReferenceFlowmeterCalibration/ReferenceFlowmeterCalibrationSeq.cs index 9989e4a46..daa310285 100644 --- a/TestBenchFramework/BenchControl/TestMethods/ReferenceFlowmeterCalibration/ReferenceFlowmeterCalibrationSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/ReferenceFlowmeterCalibration/ReferenceFlowmeterCalibrationSeq.cs @@ -325,12 +325,8 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration Bridge.OnActivity(this, Strings.Test_completed); //------------------------------------------------ - /// Make sure the CycleBeginForm is closed so that water meter data (s/n) can be copied into results - if (cycleBeginFormOpened) - { - cycleBeginFormOpened = false; - if (WaitBeginFormClosed()) goto stopTest; - } + /// Make sure the CycleBeginForm is closed so that water meter data (s/n) can be copied into results + if (WaitBeginFormClosed()) goto stopTest; /// /// Populate TestResult data entity with data