diff --git a/Results/Entities/MeterTestRslt.cs b/Results/Entities/MeterTestRslt.cs index e0a930d6c..15035bb1e 100644 --- a/Results/Entities/MeterTestRslt.cs +++ b/Results/Entities/MeterTestRslt.cs @@ -100,6 +100,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 f43c0e266..f7b841548 100644 --- a/Results/WMeterRsltItemSpec.cs +++ b/Results/WMeterRsltItemSpec.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2013-2018 Sensus Slovensko a.s. +/// Copyright (c) 2013-2022 Sensus Slovensko a.s. /// using System; using System.Collections.Generic; @@ -328,7 +328,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/Rig/IOperation.cs b/TBF/Rig/IOperation.cs index 6f9df4f15..08df049cd 100644 --- a/TBF/Rig/IOperation.cs +++ b/TBF/Rig/IOperation.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2013-2015 Sensus Metering Systems +/// Copyright (c) 2013-2015 Sensus Slovensko a.s. /// using System; diff --git a/TBF/Utils.cs b/TBF/Utils.cs index 41116f0e5..02d58aafb 100644 --- a/TBF/Utils.cs +++ b/TBF/Utils.cs @@ -213,16 +213,16 @@ namespace TBF /// - /// Get an array of Pump-With-FM power percentages from a TransitionStep entity + /// Get an array of Pump-With-FM power percentages from a string /// - /// TransitionStep entity + /// String from TransitionStep entity defining all FM pump powers /// float[] of FM-pump power percentages from 0 to 100.0f public static float[] GetPumpWithFMPcts(string pumpWithFMPcts) { int fmPumpCount = Rig.Sequences.SequenceBase.PumpsWithFM.Count; float[] result = new float[fmPumpCount]; - string[] fmPctsStr = (pumpWithFMPcts != null) ? pumpWithFMPcts.Split(new char[] { ';' }) : new string[0]; + string[] fmPctsStr = string.IsNullOrEmpty(pumpWithFMPcts) ? new string[0] : pumpWithFMPcts.Split(new char[] { ';' }); for (int i = 0; i < fmPumpCount; i++) { float fdummy;