From 93d7456ccd72e482300119184ca730f5433095cc Mon Sep 17 00:00:00 2001 From: Marek Frniak Date: Thu, 30 Jul 2026 16:13:31 +0200 Subject: [PATCH] : RefPulses carry-over by restoring testInProgress behavior in StandingStartMassCollection, increase revision to 3.9.3134.112 Cause: 1. Background: there was a suspicion that the Bukoven board left RefPulses active across operations; this was investigated and ruled out. The pulse counter is reset by testInProgress when an operation is reused. During the third DataEntry window testInProgress had been temporarily disabled (SLM vs Karlsruhe difference), which allowed RefPulses to appear to persist. 2. Increase revision to 3.9.3134.112 Solution: 1. Restore/ensure testInProgress behavior during the DataEntry sequence and explicitly reset the pulse counter when starting a new operation. 2. Increased revision to 3.9.3134.112 --- TBF/Properties/AssemblyInfo.cs | 4 +-- TBF/Rig/ControlBoard/Uni/GeneralData.cs | 7 ++++-- .../StandingStartMassCollectionSeq.cs | 25 +++++++++++-------- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/TBF/Properties/AssemblyInfo.cs b/TBF/Properties/AssemblyInfo.cs index 547dd9e9f..7fd036103 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.111")] -[assembly: AssemblyFileVersion("3.9.3134.111")] +[assembly: AssemblyVersion("3.9.3134.112")] +[assembly: AssemblyFileVersion("3.9.3134.112")] diff --git a/TBF/Rig/ControlBoard/Uni/GeneralData.cs b/TBF/Rig/ControlBoard/Uni/GeneralData.cs index 1e360cd27..9060c2da5 100644 --- a/TBF/Rig/ControlBoard/Uni/GeneralData.cs +++ b/TBF/Rig/ControlBoard/Uni/GeneralData.cs @@ -1,8 +1,9 @@ -/// +using log4net; +using SharedComponents; +/// /// Copyright (c) 2021 Sensus Slovensko a.s. /// using System; -using log4net; namespace TBF.Rig.ControlBoard.Uni { @@ -204,6 +205,8 @@ namespace TBF.Rig.ControlBoard.Uni EtPulses2 = Convert.ToInt32(GetUInt24(data, offs + (int)Poz.ETX2)); /// Byte 294,295,296 EtPulses3 = Convert.ToInt32(GetUInt24(data, offs + (int)Poz.ETX3)); /// Byte 297,298.299 !!!!!!!!!!!!!!! + //LiveLogCache.Instance.AddLog(string.Format("Et={0} State={1:X14} Route={2} Freq={3} EtPulses={4} TTime={5} WMPulses[3]={6} WMRefPulses[3]={7}, Time[3]={8}", + // State & 7, State, Utils.ToBin40(Vystupy >> 8), ReferenceFreq[0], EtPulses[0], Ttime, WMeterPuls[3], EtPulses[3], ImpulseTime[3])); log.InfoFormat("Et={0} State={1:X14} Route={2} Freq={3} EtPulses={4} TTime={5} WMPulses[3]={6} WMRefPulses[3]={7}, Time[3]={8}", State & 7, State, Utils.ToBin40(Vystupy >> 8), ReferenceFreq[0], EtPulses[0], Ttime, WMeterPuls[3], EtPulses[3], ImpulseTime[3]); } diff --git a/TBF/Rig/TestMethods/StandingStartMassCollection/StandingStartMassCollectionSeq.cs b/TBF/Rig/TestMethods/StandingStartMassCollection/StandingStartMassCollectionSeq.cs index 8921a93e6..cc65dea54 100644 --- a/TBF/Rig/TestMethods/StandingStartMassCollection/StandingStartMassCollectionSeq.cs +++ b/TBF/Rig/TestMethods/StandingStartMassCollection/StandingStartMassCollectionSeq.cs @@ -2,6 +2,8 @@ using Config.Entities; using log4net; using NHibernate.Action; +using SharedComponents; + /// /// Copyright (c) 2013-2021 Sensus Slovensko a.s. /// @@ -937,21 +939,21 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection /// if (dataEntryCmpnt != null) { - string fileName = string.Format("{0}-{1}-end.bmp", test.Name, repetitionNr); //string.Format("{0}-end.bmp", test.Name); + string fileName = string.Format("{0}-{1}-end.bmp", test.Name, repetitionNr); //string.Format("{0}-end.bmp", test.Name); IValve triggerValve = null; bool triggerSend = false; if (dataEntryCmpnt is GenericDevices.IDataEntryForCamera) - { - string[] endImages = new string[sensPath.RegisterReaders.Length]; + { + string[] endImages = new string[sensPath.RegisterReaders.Length]; State state2 = State.Create(string.Format("{0}({1}) : Grabbing images", test.Method, test.Name)) .AddOperation(checkUiOp); for (int i = 0; i < sensPath.RegisterReaders.Length; i++) - { - GenericDevices.IRegReaderStillCamera roi = sensPath.RegisterReaders[i] as GenericDevices.IRegReaderStillCamera; + { + GenericDevices.IRegReaderStillCamera roi = sensPath.RegisterReaders[i] as GenericDevices.IRegReaderStillCamera; if (roi != null) - { + { ///if exist valve trigger camera open triggerValve = roi.GetValve(); if (triggerValve != null && !triggerSend) @@ -965,6 +967,7 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection endImages[i] = Path.Combine(directory, fileName); state2.AddOperation(roi.GrabImageOp(endImages[i])); state2.AddOperation(testInProgress); + } else { @@ -1007,13 +1010,13 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection } else { - state.AddOperation(dataEntryCmpnt.ShowTestEndFormOp(sensPath.RegisterReaders, + state.AddOperation(dataEntryCmpnt.ShowTestEndFormOp(sensPath.RegisterReaders, volumeCTV, test.ErrLimLo + test.Uncertainty, test.ErrLimHi - test.Uncertainty)); //...develop: half of step 14 } state.AddOperation(checkUiOp) .AddOperations(readTempPressOps) - .AddOperation(testInProgress) + //.AddOperation(testInProgress) //.AddOperation(readEndMassOp) //...develop: half of step 14 + step 15 .EnterState(); do { @@ -1044,7 +1047,7 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection { for (int i = 0; i < waterMetersCount; i++) { - GenericDevices.IRegReader rr = sensPath.RegisterReaders[i]; + GenericDevices.IRegReader rr = sensPath.RegisterReaders[i]; if (rr is ICommonRegReader) (rr as ICommonRegReader).EndWMState = dataEntryCmpnt.WMEndState(i); @@ -1069,7 +1072,7 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection } if (dataEntryCmpnt is IDataEntryForCamera && (dataEntryCmpnt as IDataEntryForCamera).SaveImages) - { + { log.Debug("Save images EndWMState..."); /// SaveImages==true ... copy images to the directory that will be archived at the end of the cycle for (int i = 0; i < sensPath.RegisterReaders.Length; i++) @@ -1137,7 +1140,7 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection tstRslt.EndTime = TestEndTime; tstRslt.FlowSetTime = flowSetTime; tstRslt.TestTime = Math.Max(1.0, DateTimeBox.DurationSec(timeStampStart, timeStampEnd)); /// Min. 1s to prevent division by zero - tstRslt.PulsesMaster = Convert.ToDouble(cBrd.RefPulses); /// Pulses of the master flow meter (test total) + tstRslt.PulsesMaster = Convert.ToDouble(cBrd.RefPulses);/// Pulses of the master flow meter (test total) tstRslt.MassStartRaw = StartMass.Val; tstRslt.MassEndRaw = EndMass.Val; tstRslt.TimeBtwnMassMsrmnts = tMass2 - tMass1;