From 75766938be78f89cbb6ff28f23b76438e0e3b75e Mon Sep 17 00:00:00 2001 From: Milan Hanajik Date: Thu, 10 Nov 2022 13:05:24 +0100 Subject: [PATCH] FixedStartMassCollection : Diverter to tank after start valve is closed, 'Winiki lub E' support MeterTestRslt, ver. 2.30.1980 --- Results/Entities/MeterTestRslt.cs | 7 +++++ Results/WMeterRsltItemSpec.cs | 3 +- TBF/Properties/AssemblyInfo.cs | 4 +-- .../FixedStartMassCollectionSeq.cs | 31 +++++++++---------- 4 files changed, 26 insertions(+), 19 deletions(-) diff --git a/Results/Entities/MeterTestRslt.cs b/Results/Entities/MeterTestRslt.cs index be3ba58ec..4c49adcba 100644 --- a/Results/Entities/MeterTestRslt.cs +++ b/Results/Entities/MeterTestRslt.cs @@ -106,6 +106,13 @@ namespace Results.Entities public virtual bool IsDataStream() { return (RegReaderType == (int)RegisterReaderType.DataStream); } public virtual bool IsManual() { return (RegReaderType == (int)RegisterReaderType.Manual); } + public virtual string PassedOrErrorFlagsStr() + { + string eFlags = Utils.ErrorFlagsStr(ErrorIndicators); + var str = string.IsNullOrEmpty(eFlags) ? PassedColorStr(null) : eFlags; + return str; + } + public virtual string PassedColorStr(string yesNoFormatOrEmpty) { if (string.IsNullOrEmpty(yesNoFormatOrEmpty)) diff --git a/Results/WMeterRsltItemSpec.cs b/Results/WMeterRsltItemSpec.cs index 86792f140..29ce16d41 100644 --- a/Results/WMeterRsltItemSpec.cs +++ b/Results/WMeterRsltItemSpec.cs @@ -335,7 +335,8 @@ namespace Results AllItems.Add(new WMeterRsltItemSpec(ItemID.Scale, "Scale", Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null) ? FormatStr(f, w.GetTestRslt(t).Scale()) : string.Empty)); AllItems.Add(new WMeterRsltItemSpec(ItemID.Diverter, "Diverter", Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null) ? FormatStr(f, w.GetTestRslt(t).Diverter()) : string.Empty)); AllItems.Add(new WMeterRsltItemSpec(ItemID.RegValve, "Reg. valve", Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null) ? FormatStr(f, w.GetTestRslt(t).RegValve()) : string.Empty)); - AllItems.Add(new WMeterRsltItemSpec(ItemID.ResultOrErrorFlags, "Winiki lub E", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.PassedOrErrorFlagsStr()))); /// PL specific result + AllItems.Add(new WMeterRsltItemSpec(ItemID.ResultOrErrorFlags, "Winiki lub E", Quantity.String, ItemCategory.MeterResult,(w, t, u, f, p) => (w.GetMeterTestRslt(t) != null) ? FormatStr(f, w.GetMeterTestRslt(t).PassedOrErrorFlagsStr()) + : FormatStr(f, w.PassedOrErrorFlagsStr()))); /// PL specific result /// /// Water meter info diff --git a/TBF/Properties/AssemblyInfo.cs b/TBF/Properties/AssemblyInfo.cs index 0faf39ef9..98909b111 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.30.1978.0")] -[assembly: AssemblyFileVersion("2.30.1978.0")] +[assembly: AssemblyVersion("2.30.1980.0")] +[assembly: AssemblyFileVersion("2.30.1980.0")] diff --git a/TBF/Rig/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs b/TBF/Rig/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs index db6324e09..4f436c05d 100644 --- a/TBF/Rig/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs +++ b/TBF/Rig/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2013-2019 Sensus Slovensko a.s. +/// Copyright (c) 2013-2022 Sensus Slovensko a.s. /// using System; using System.Collections.Generic; @@ -427,20 +427,6 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollection temperature_set: - State.Create(string.Format("{0}({1}) : Starting the test", test.Method, test.Name)) - .AddOperation(checkUiOp) - .AddOperations(readTempPressOps) - .AddOperation(cBrd.StartMeasurementOp(outPath, (Elde.TestMethods.Diverter | Elde.TestMethods.FixedStart), - test.Qfrom, test.Qto, 2 * totalPulses, 10)) - .EnterState(); - do - { - e = StateMachine.WaitRunDevsRunOps(); - if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; } - if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; } - } - while (!e.Contains(Event.MeasurementStarted)); - //----------------------------------------------------------------- Bridge.OnActivity(this, Strings.Stopping_flow_for_the_fixed_start); //----------------------------------------------------------------- @@ -456,10 +442,23 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollection while (!e.Contains(Event.ValvesSet)); + State.Create(string.Format("{0}({1}) : Starting the test", test.Method, test.Name)) + .AddOperation(checkUiOp) + .AddOperations(readTempPressOps) + .AddOperation(cBrd.StartMeasurementOp(outPath, (Elde.TestMethods.Diverter | Elde.TestMethods.FixedStart), + test.Qfrom, test.Qto, 2 * totalPulses, 10)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; } + if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; } + } + while (!e.Contains(Event.MeasurementStarted)); + int time = StateMachine.Time; double currentFlow = RefFlow.Val; - //------------------------------------------------ Bridge.OnActivity(this, Strings.Measuring_the_weight); //------------------------------------------------