'Winiki lub E' support MeterTestRslt

This commit is contained in:
Milan Hanajik 2022-11-11 14:14:44 +01:00
parent 9ca9d41ddc
commit 36ae8479ca
4 changed files with 14 additions and 6 deletions

View File

@ -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))

View File

@ -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

View File

@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2015 Sensus Slovensko a.s.
///
using System;

View File

@ -213,16 +213,16 @@ namespace TBF
/// <summary>
/// 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
/// </summary>
/// <param name="entity">TransitionStep entity</param>
/// <param name="pumpWithFMPcts">String from TransitionStep entity defining all FM pump powers</param>
/// <returns>float[] of FM-pump power percentages from 0 to 100.0f</returns>
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;