From be0525a3195d53b3c1464e23a1c3ee02e58a0bcf Mon Sep 17 00:00:00 2001 From: Marek Frniak Date: Thu, 16 Jul 2026 13:29:42 +0200 Subject: [PATCH] Upgrade - improved StandingStart method by SLM requirements, added fixed delays for meters stabilization --- TBF/Properties/AssemblyInfo.cs | 4 +- .../StandingStart/StandingStartSeq.cs | 76 +++++++++++++++++-- 2 files changed, 71 insertions(+), 9 deletions(-) diff --git a/TBF/Properties/AssemblyInfo.cs b/TBF/Properties/AssemblyInfo.cs index 1b9e1281e..376347e7b 100644 --- a/TBF/Properties/AssemblyInfo.cs +++ b/TBF/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("3.9.3134.0")] -[assembly: AssemblyFileVersion("3.9.3134.0")] +[assembly: AssemblyVersion("3.9.3134.101")] +[assembly: AssemblyFileVersion("3.9.3134.101")] diff --git a/TBF/Rig/TestMethods/StandingStart/StandingStartSeq.cs b/TBF/Rig/TestMethods/StandingStart/StandingStartSeq.cs index 0ec158500..cd3b3cb5f 100644 --- a/TBF/Rig/TestMethods/StandingStart/StandingStartSeq.cs +++ b/TBF/Rig/TestMethods/StandingStart/StandingStartSeq.cs @@ -1,11 +1,12 @@ -/// +using Common; +using log4net; +/// /// Copyright (c) 2018-2022 Sensus Slovensko a.s. /// using System; using System.Collections.Generic; using System.IO; -using log4net; -using Common; +using System.Windows.Forms; using TBF.Boxes; using TBF.Resources; using TBF.Rig.GenericDevices; @@ -84,6 +85,8 @@ namespace TBF.Rig.TestMethods.StandingStart checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state processDataLoggingOp = new TBF.Rig.Operations.ProcessDataLoggingOp(processDataLogger, this, heatMetersTestParams != null); + int delay; + if (cBrd is ControlBoard.Uni.UniCB) { int[] filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }; @@ -421,10 +424,40 @@ namespace TBF.Rig.TestMethods.StandingStart LogProcessDataTestInfo(processDataLogger, test.Procedure.Name, test.Name); int startPulses = 0; - /// - /// Enter watermeter begin states here - /// - GenericDevices.IHasWMStatesForm dataEntryCmpnt = TbfComponents.FindComponent(StateMachine.Procedure.DataEntry) as GenericDevices.IHasWMStatesForm; + ///...MF + ///----------------- + delay = test.TimeFlow2Mass; + + if (delay > 0) + { + State.Create(string.Format("{0}({1}) : Delay for meters stabilization ", test.Method, test.Name, delay)) + .AddOperation(checkUiOp) + .AddOperations(readTempPressOps) + .AddOperation(testInProgress) + .AddOperation(new Operations.TimerOp(delay)) //...develop: step 5 + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; } + if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; } + + /// Show remaining time + if ((delay = Math.Max(delay, 0)) > 60) + Bridge.OnActivity(this, string.Format("{0} ... {1} {2} {3} {4}", "Delay", delay / 60, "min", delay % 60, Strings.sec)); + else + Bridge.OnActivity(this, string.Format("{0} ... {1} s", "Delay", delay)); + + if (delay > 0) + delay--; + } + while (!e.Contains(Event.TimerExpired)); + } + + /// + /// Enter watermeter begin states here + /// + GenericDevices.IHasWMStatesForm dataEntryCmpnt = TbfComponents.FindComponent(StateMachine.Procedure.DataEntry) as GenericDevices.IHasWMStatesForm; if (dataEntryCmpnt != null) { @@ -668,6 +701,35 @@ namespace TBF.Rig.TestMethods.StandingStart double volumeCTV = constMasterCorr * Convert.ToDouble(endPulses - startPulses); double refEnergy = Energy.Sum * volumeCTV / VolumeForEnergy.Sum; /// [J]=[J]*[l]/[l] + ///...MF + ///----------------- + delay = test.TimeFlow2Mass; + + if (delay > 0) + { + State.Create(string.Format("{0}({1}) : Delay for meters stabilization ", test.Method, test.Name, delay)) + .AddOperation(checkUiOp) + .AddOperations(readTempPressOps) + .AddOperation(testInProgress) + .AddOperation(new Operations.TimerOp(delay)) //...develop: step 5 + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; } + if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; } + + /// Show remaining time + if ((delay = Math.Max(delay, 0)) > 60) + Bridge.OnActivity(this, string.Format("{0} ... {1} {2} {3} {4}", "Delay", delay / 60, "min", delay % 60, Strings.sec)); + else + Bridge.OnActivity(this, string.Format("{0} ... {1} s", "Delay", delay)); + + if (delay > 0) + delay--; + } + while (!e.Contains(Event.TimerExpired)); + } /// /// Enter watermeter end states here