diff --git a/Results/Entities/TestRslt.cs b/Results/Entities/TestRslt.cs index 577bcc254..2ff3194ac 100644 --- a/Results/Entities/TestRslt.cs +++ b/Results/Entities/TestRslt.cs @@ -371,6 +371,12 @@ namespace Results.Entities #endif } + /// Wrapper + public virtual string InfoFlagsStr() + { + return Utils.ErrorFlagsStr(InfoFlags); + } + public virtual bool IsPartCompatible(int waterMeterPartNr) { if ((this.Part == 0) || (waterMeterPartNr == 0)) return true; diff --git a/Results/Entities/WaterMeter.cs b/Results/Entities/WaterMeter.cs index 7c3654e3d..3c4b6137c 100644 --- a/Results/Entities/WaterMeter.cs +++ b/Results/Entities/WaterMeter.cs @@ -186,6 +186,30 @@ namespace Results.Entities #endif } + public virtual long InfoFlagsFromTests() + { + long infoFlags = 0; + foreach (var mtr in MeterTestRslts) + { + if (mtr.Evaluate() && mtr.TestDone) infoFlags |= mtr.TestRslt.InfoFlags; + } + return infoFlags; + } + + public virtual long InfoFlagsFromTestsAndWM() + { + return InfoFlagsFromTests() | InfoFlags; + } + + /// + /// Convert combined errorFlags of all tests to string + /// + /// ErrorFlags string + public virtual string InfoFlagsStr() + { + return Utils.ErrorFlagsStr(InfoFlagsFromTestsAndWM()); + } + public virtual string PassedOrErrorFlagsStr() { string eFlags = Utils.ErrorFlagsStr(ErrorFlagsFromTestsAndWM()); diff --git a/Results/ItemID.cs b/Results/ItemID.cs index ce1c4a30a..61e315f2b 100644 --- a/Results/ItemID.cs +++ b/Results/ItemID.cs @@ -327,6 +327,8 @@ namespace Results Conduct_min, /// 277 Conduct_max, /// 278 + InfoFlags, /// 279 + Count, } } diff --git a/Results/Resources/Strings.Designer.cs b/Results/Resources/Strings.Designer.cs index dedf3f1b9..e90261970 100644 --- a/Results/Resources/Strings.Designer.cs +++ b/Results/Resources/Strings.Designer.cs @@ -19,7 +19,7 @@ namespace Results.Resources { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Strings { @@ -510,6 +510,15 @@ namespace Results.Resources { } } + /// + /// Looks up a localized string similar to Info flags. + /// + internal static string Info_flags { + get { + return ResourceManager.GetString("Info_flags", resourceCulture); + } + } + /// /// Looks up a localized string similar to Invalid Q2 correction factors. /// diff --git a/Results/Resources/Strings.resx b/Results/Resources/Strings.resx index 445ad5ae5..47e9adeeb 100644 --- a/Results/Resources/Strings.resx +++ b/Results/Resources/Strings.resx @@ -828,4 +828,7 @@ Conduct. + + Info flags + \ No newline at end of file diff --git a/Results/WMeterRsltItemSpec.cs b/Results/WMeterRsltItemSpec.cs index 0bb8cb321..89d5a4bda 100644 --- a/Results/WMeterRsltItemSpec.cs +++ b/Results/WMeterRsltItemSpec.cs @@ -464,6 +464,7 @@ namespace Results AllItems.Add(new WMeterRsltItemSpec(ItemID.TestPassed, Strings.Test_passed + "()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => FormatBool(f, (w.GetMeterTestRslt(t) != null) && w.GetMeterTestRslt(t).Passed))); AllItems.Add(new WMeterRsltItemSpec(ItemID.ErrorFlags, Strings.Error_flags + "()", Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => FormatStr(f, (w.GetTestRslt(t) != null) ? w.GetTestRslt(t).ErrorFlagsStr() : w.ErrorFlagsStr()))); AllItems.Add(new WMeterRsltItemSpec(ItemID.ErrorFlagsEx, Strings.Error_flags + "Ex", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.ErrorFlagsStrEx()))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.InfoFlags, Strings.Info_flags + "()", Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => FormatStr(f, (w.GetTestRslt(t) != null) ? w.GetTestRslt(t).InfoFlagsStr() : w.InfoFlagsStr()))); AllItems.Add(new WMeterRsltItemSpec(ItemID.E1, "E1 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E1) != 0) ? Strings.Yes : Strings.No)); AllItems.Add(new WMeterRsltItemSpec(ItemID.E2, "E2 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E2) != 0) ? Strings.Yes : Strings.No)); AllItems.Add(new WMeterRsltItemSpec(ItemID.E3, "E3 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E3) != 0) ? Strings.Yes : Strings.No));