diff --git a/Results/Output/WMChart.cs b/Results/Output/WMChart.cs index ea9c03254..b43a96020 100644 --- a/Results/Output/WMChart.cs +++ b/Results/Output/WMChart.cs @@ -1,4 +1,7 @@ -using System; +/// +/// Copyright (c) 2019-2022 Sensus Metering Systems +/// +using System; using System.Collections.Generic; using System.Drawing; using System.Linq; @@ -18,29 +21,23 @@ namespace Results.Output public static Chart GetChart(WaterMeter wm, bool isPrinter, Config.Unit flowUnit) { - double maxFlow_m3h = 0; + double maxFlow = 0; IList unsortedPoints = new List(); foreach (var mtr in wm.RegularMeterTestRslts()) { - if (mtr.IsPilotRslt() && mtr.TestRslt.TestData.Evaluate && (mtr.TestRslt.TestTime > 0) && (mtr.TestRslt.PulsesMaster > 0)) + double flow = mtr.TestRslt.FlowVolume; + var td = mtr.TestRslt.TestData; + + if (mtr.IsPilotRslt() && flow > 0 && td.Evaluate && + (td.Publish == (sbyte)Publish.Always || (!isPrinter && td.Publish == (sbyte)Publish.OnScreen))) { - double flow_m3h = (mtr.TestTime != 0) - ? (3.6 * mtr.TestRslt.VolumeCTV / mtr.TestTime * mtr.PulsesMaster / mtr.TestRslt.PulsesMaster) - : (3.6 * mtr.TestRslt.VolumeCTV / mtr.TestRslt.TestTime); - - if (flow_m3h > maxFlow_m3h) maxFlow_m3h = flow_m3h; - - double flow = Config.Units.ConvertTo(flowUnit, flow_m3h); /// Convert to specified units - - if (flow > 0) - { - unsortedPoints.Add(new PointF((float)flow, (float)mtr.Error)); - } + if (flow > maxFlow) maxFlow = flow; + unsortedPoints.Add(new PointF((float)Config.Units.ConvertTo(flowUnit, flow), (float)mtr.Error)); } } IEnumerable sortedPoints = unsortedPoints.OrderBy(x => x.X); - bool isQ4 = (maxFlow_m3h > 1.1 * wm.WaterMeterData.Q3_Qn); + bool isQ4 = (maxFlow > 1.1 * wm.WaterMeterData.Q3_Qn); Chart chart = new Chart { diff --git a/TBF/Properties/AssemblyInfo.cs b/TBF/Properties/AssemblyInfo.cs index fc45c7f91..e9cd9d280 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.27.1844.0")] -[assembly: AssemblyFileVersion("2.27.1844.0")] +[assembly: AssemblyVersion("2.27.1851.0")] +[assembly: AssemblyFileVersion("2.27.1851.0")]