From 784ebcb1d67cb1beec536d416c48109768c037f9 Mon Sep 17 00:00:00 2001 From: Milan Hanajik Date: Wed, 17 May 2017 12:49:23 +0200 Subject: [PATCH] Q_ref_mean and many other result items added, ver. 2.12.563 --- Results/Entities/Batch.cs | 6 +- Results/Entities/TestRslt.cs | 10 +-- Results/ItemID.cs | 17 +++- Results/Mappings/TestRsltMap.cs | 2 +- .../Printers/Munich/MunichPrintDocument.cs | 6 +- Results/Properties/AssemblyInfo.cs | 6 +- Results/Resources/Strings.Designer.cs | 72 +++++++++++++++++ Results/Resources/Strings.resx | 24 ++++++ Results/WMeterRsltItemSpec.cs | 77 +++++++++++-------- .../QueryResults/QueryResultsPrintDocument.cs | 6 +- .../Output/FileWriters/Enhanced/Writer.cs | 4 +- .../Basic/BasicPrintDocument.cs | 6 +- .../BenchControl/Sequences/ProcessData.cs | 19 ++++- .../BenchControl/Sequences/SequenceBase.cs | 6 +- .../TestMethods/Adjustment/AdjustmentSeq.cs | 8 +- .../CombinedWithDetectionSeq.cs | 8 +- .../TestMethods/Endurance/EnduranceSeq.cs | 16 ++-- .../FixedStartAdvancedSeq.cs | 8 +- .../FixedStartMassCollectionSeq.cs | 8 +- .../TestMethods/FlyingStart/FlyingStartSeq.cs | 8 +- .../FlyingStartMassCollectionSeq.cs | 8 +- .../TestMethods/LeakTest/LeakTestSeq.cs | 14 ++-- .../TestMethods/PMaxTest/PMaxTestSeq.cs | 6 +- .../ReferenceFlowmeterCalibrationSeq.cs | 8 +- .../iPerlCommunicationSeq.cs | 2 +- TestBenchFramework/Properties/AssemblyInfo.cs | 4 +- 26 files changed, 248 insertions(+), 111 deletions(-) diff --git a/Results/Entities/Batch.cs b/Results/Entities/Batch.cs index afbc8fafa..321474db1 100644 --- a/Results/Entities/Batch.cs +++ b/Results/Entities/Batch.cs @@ -40,7 +40,7 @@ namespace Results.Entities TestRslts = new List(); } - public virtual float AmbientTempAve() + public virtual float AmbTempMean() { if (TestRslts.Count == 0) return 0; float sum = 0; @@ -48,7 +48,7 @@ namespace Results.Entities return sum / TestRslts.Count; } - public virtual float AmbientPressAve() + public virtual float AmbPressMean() { if (TestRslts.Count == 0) return 0; float sum = 0; @@ -56,7 +56,7 @@ namespace Results.Entities return sum / TestRslts.Count; } - public virtual float AmbientHumiAve() + public virtual float AmbHumiMean() { if (TestRslts.Count == 0) return 0; float sum = 0; diff --git a/Results/Entities/TestRslt.cs b/Results/Entities/TestRslt.cs index ea2b003bb..0a2514a86 100644 --- a/Results/Entities/TestRslt.cs +++ b/Results/Entities/TestRslt.cs @@ -86,10 +86,10 @@ namespace Results.Entities public virtual float TempDivEnd { get; set; } /// [°C] public virtual float TempDivMin { get; set; } /// [°C] public virtual float TempDivMax { get; set; } /// [°C] - public virtual float FlowStart { get; set; } /// [m3/h] minimum flow - public virtual float FlowEnd { get; set; } /// [m3/h] maximum flow - public virtual float FlowMin { get; set; } /// [m3/h] minimum flow - public virtual float FlowMax { get; set; } /// [m3/h] maximum flow + public virtual float FlowStart { get; set; } /// [m3/h] flow at the start of test from the reference flowmeter + public virtual float FlowEnd { get; set; } /// [m3/h] flow at the end of test from the reference flowmeter + public virtual float FlowMean { get; set; } /// [m3/h] mean flow from the reference flowmeter + public virtual float FlowMax { get; set; } /// [m3/h] public virtual float Custom1 { get; set; } /// [°C] T ref hi mean public virtual float Custom2 { get; set; } /// [°C] T ref hi start @@ -204,7 +204,7 @@ namespace Results.Entities TempDivMax = src.TempDivMax; FlowStart = src.FlowStart; FlowEnd = src.FlowEnd; - FlowMin = src.FlowMin; + FlowMean = src.FlowMean; FlowMax = src.FlowMax; Custom1 = src.Custom1; Custom2 = src.Custom2; diff --git a/Results/ItemID.cs b/Results/ItemID.cs index d426d0192..cfd332ea3 100644 --- a/Results/ItemID.cs +++ b/Results/ItemID.cs @@ -112,6 +112,7 @@ namespace Results Q_rise, /// 102 Q_fall, /// 103 + /// iPerl OrigCalibFactor, /// 104 CalibFactor, /// 105 Q2ErrWOCorrection, /// 106 @@ -119,7 +120,21 @@ namespace Results Q2CorrRFlow, /// 108 Q2CorrLFlow, /// 109 Q2CorrFlowRight, /// 110 - + + Q_ref_mean, /// 111 + T_up_start, /// 112 + T_up_end, /// 113 + T_up_avg, /// 114 + T_down_start, /// 115 + T_down_end, /// 116 + T_down_avg, /// 117 + T_div_start, /// 118 + T_div_end, /// 119 + T_div_avg, /// 120 + P_up_avg, /// 121 + P_down_avg, /// 122 + P_delta_avg, /// 123 + Count, } } diff --git a/Results/Mappings/TestRsltMap.cs b/Results/Mappings/TestRsltMap.cs index c069031c6..ddfe62f32 100644 --- a/Results/Mappings/TestRsltMap.cs +++ b/Results/Mappings/TestRsltMap.cs @@ -86,7 +86,7 @@ namespace Results.Mappings Map(x => x.TempDivMax); Map(x => x.FlowStart); Map(x => x.FlowEnd); - Map(x => x.FlowMin); + Map(x => x.FlowMean).Column("FlowMin"); Map(x => x.FlowMax); Map(x => x.Custom1); diff --git a/Results/Output/Printers/Munich/MunichPrintDocument.cs b/Results/Output/Printers/Munich/MunichPrintDocument.cs index 25437c91f..132091a20 100644 --- a/Results/Output/Printers/Munich/MunichPrintDocument.cs +++ b/Results/Output/Printers/Munich/MunichPrintDocument.cs @@ -235,13 +235,13 @@ namespace Results.Output.Printers.Munich lineNr += (secondTableOffset * 2) / SpacingOne; PrintAt(e, Tab1, lineNr * SpacingOne, "Temperatur"); - PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbientTempAve().ToString("F1") + " \x00b0C"); + PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbTempMean().ToString("F1") + " \x00b0C"); lineNr++; PrintAt(e, Tab1, lineNr * SpacingOne, "Feuchtigkeit"); - PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbientHumiAve().ToString("F0") + " %"); + PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbHumiMean().ToString("F0") + " %"); lineNr++; PrintAt(e, Tab1, lineNr * SpacingOne, "Luftdruck"); - PrintAt(e, Tab2, lineNr * SpacingOne, Config.Units.ConvertTo(Config.Unit.mbar, wm.Batch.AmbientPressAve()).ToString("F0") + " mbar"); + PrintAt(e, Tab2, lineNr * SpacingOne, Config.Units.ConvertTo(Config.Unit.mbar, wm.Batch.AmbPressMean()).ToString("F0") + " mbar"); lineNr++; PrintAt(e, Tab3, lineNr * SpacingOne, wm.Batch.EndTime.Date.ToString("d")); diff --git a/Results/Properties/AssemblyInfo.cs b/Results/Properties/AssemblyInfo.cs index 818c93a7b..6154f0f34 100644 --- a/Results/Properties/AssemblyInfo.cs +++ b/Results/Properties/AssemblyInfo.cs @@ -10,7 +10,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Sensus")] [assembly: AssemblyProduct("Results")] -[assembly: AssemblyCopyright("Copyright © 2016")] +[assembly: AssemblyCopyright("Copyright © 2013 - 2017 Sensus Slovensko, a.s.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.12.561.0")] -[assembly: AssemblyFileVersion("2.12.561.0")] +[assembly: AssemblyVersion("2.12.562.0")] +[assembly: AssemblyFileVersion("2.12.562.0")] diff --git a/Results/Resources/Strings.Designer.cs b/Results/Resources/Strings.Designer.cs index 60bfd1fd5..ebfc05082 100644 --- a/Results/Resources/Strings.Designer.cs +++ b/Results/Resources/Strings.Designer.cs @@ -933,6 +933,78 @@ namespace Results.Resources { } } + /// + /// Looks up a localized string similar to Ro. + /// + internal static string VName_Dens { + get { + return ResourceManager.GetString("VName_Dens", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Q. + /// + internal static string VName_Flow { + get { + return ResourceManager.GetString("VName_Flow", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Hu.. + /// + internal static string VName_Humi { + get { + return ResourceManager.GetString("VName_Humi", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Mass. + /// + internal static string VName_Mass { + get { + return ResourceManager.GetString("VName_Mass", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Press.. + /// + internal static string VName_Press { + get { + return ResourceManager.GetString("VName_Press", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Temp.. + /// + internal static string VName_Temp { + get { + return ResourceManager.GetString("VName_Temp", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Tau. + /// + internal static string VName_TstTime { + get { + return ResourceManager.GetString("VName_TstTime", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Vol.. + /// + internal static string VName_Vol { + get { + return ResourceManager.GetString("VName_Vol", resourceCulture); + } + } + /// /// Looks up a localized string similar to Vol.ref.. /// diff --git a/Results/Resources/Strings.resx b/Results/Resources/Strings.resx index aaef02360..384262203 100644 --- a/Results/Resources/Strings.resx +++ b/Results/Resources/Strings.resx @@ -435,4 +435,28 @@ Water Meter + + Q + + + Press. + + + Temp. + + + Ro + + + Hu. + + + Mass + + + Tau + + + Vol. + \ No newline at end of file diff --git a/Results/WMeterRsltItemSpec.cs b/Results/WMeterRsltItemSpec.cs index bca22c2e1..c810b55d1 100644 --- a/Results/WMeterRsltItemSpec.cs +++ b/Results/WMeterRsltItemSpec.cs @@ -99,7 +99,7 @@ namespace Results } /// - /// Constructorwithot ToolTip text + /// Constructor withot ToolTip text /// public WMeterRsltItemSpec(ItemID itemId, string name, Quantity quantity, ItemCategory category, PrintDlgt printDlgt) { @@ -131,37 +131,37 @@ namespace Results AllItems.Add(new WMeterRsltItemSpec(ItemID.Density, Strings.Density + " *", Quantity.Density, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).DensityOut.ToString(string.IsNullOrEmpty(p) ? "F1" : p))); /// [kg/m3] /// Target values - AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_from, Strings.Q_from + "()", Quantity.Flow, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Qfrom().ToString(string.IsNullOrEmpty(p) ? "F3" : p))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_to, Strings.Q_to + "()", Quantity.Flow, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Qto().ToString(string.IsNullOrEmpty(p) ? "F3" : p))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_volume, Strings.Test_vol + "()", Quantity.Volume, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TargetVolume()).ToString(string.IsNullOrEmpty(p) ? "F1" : p))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_limit_Lo, Strings.ErrLimLo + "()", Quantity.Error, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).ErrLimLo()).ToString(string.IsNullOrEmpty(p) ? "F1" : p))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_limit_Hi, Strings.ErrLimHi + "()", Quantity.Error, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).ErrLimHi()).ToString(string.IsNullOrEmpty(p) ? "F1" : p))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.Uncertainty, Strings.Uncertainty + "()", Quantity.Error, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Uncertainty().ToString(string.IsNullOrEmpty(p) ? "F2" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_from, Strings.Q_from + "()", Quantity.Flow, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Qfrom().ToString(string.IsNullOrEmpty(p) ? "F3" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_to, Strings.Q_to + "()", Quantity.Flow, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Qto().ToString(string.IsNullOrEmpty(p) ? "F3" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_volume, Strings.Test_vol + "()", Quantity.Volume, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TargetVolume()).ToString(string.IsNullOrEmpty(p) ? "F1" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_limit_Lo, Strings.ErrLimLo + "()", Quantity.Error, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).ErrLimLo()).ToString(string.IsNullOrEmpty(p) ? "F1" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_limit_Hi, Strings.ErrLimHi + "()", Quantity.Error, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).ErrLimHi()).ToString(string.IsNullOrEmpty(p) ? "F1" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.Uncertainty, Strings.Uncertainty + "()", Quantity.Error, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Uncertainty().ToString(string.IsNullOrEmpty(p) ? "F2" : p))); /// Test results AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_start_time, Strings.T_start + "()", Quantity.DateTime, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : (string.IsNullOrEmpty(f) ? w.GetTestRslt(t).StartTime.ToString() : string.Format(f, w.GetTestRslt(t).StartTime)))); AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_end_time, Strings.T_end + "()", Quantity.DateTime, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : (string.IsNullOrEmpty(f) ? w.GetTestRslt(t).EndTime.ToString() : string.Format(f, w.GetTestRslt(t).EndTime)))); AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_time, Strings.T_s + "()", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).TestTime.ToString(string.IsNullOrEmpty(p) ? "F2" : p))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow, Strings.Flow + "()", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Utils.DoubleToStr(Config.Units.ConvertTo(u, w.GetTestRslt(t).FlowVolume), 4))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.T_up_mean, Strings.T_in + "()", Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempUpMean).ToString(string.IsNullOrEmpty(p) ? "F2" : p))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.T_down_mean, Strings.T_out + "()", Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempDownMean).ToString(string.IsNullOrEmpty(p) ? "F2" : p))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.T_div, Strings.T_div + "()", Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempDivMean).ToString(string.IsNullOrEmpty(p) ? "F2" : p))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.P_up, Strings.P_up + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressUpMean).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.P_up_start, Strings.P_up_start + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressUpStart).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.P_up_end, Strings.P_up_end + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressUpEnd).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.P_down, Strings.P_dn + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDownMean).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.P_down_start, Strings.P_dn_start + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDownStart).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.P_down_end, Strings.P_dn_end + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDownEnd).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_mean, Strings.P_delta + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDeltaMean).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_start, Strings.P_delta_start + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDeltaStart).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_end, Strings.P_delta_end + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDeltaEnd).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow, string.Format("{0} v r", Strings.VName_Flow), Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Utils.DoubleToStr(Config.Units.ConvertTo(u, w.GetTestRslt(t).FlowVolume), 4))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.T_up_mean, string.Format("{0} UP ME ()", Strings.VName_Temp), Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempUpMean).ToString(string.IsNullOrEmpty(p) ? "F2" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.T_down_mean, string.Format("{0} DW ME ()", Strings.VName_Temp), Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempDownMean).ToString(string.IsNullOrEmpty(p) ? "F2" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.T_div, string.Format("{0} DI ME ()", Strings.VName_Temp), Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempDivMean).ToString(string.IsNullOrEmpty(p) ? "F2" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.P_up, string.Format("{0} UP ME ()", Strings.VName_Press), Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressUpMean).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.P_up_start, string.Format("{0} UP ST ()", Strings.VName_Press), Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressUpStart).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.P_up_end, string.Format("{0} UP EN ()", Strings.VName_Press), Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressUpEnd).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.P_down, string.Format("{0} DW ME ()", Strings.VName_Press), Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDownMean).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.P_down_start, string.Format("{0} DW ST ()", Strings.VName_Press), Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDownStart).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.P_down_end, string.Format("{0} DW EN ()", Strings.VName_Press), Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDownEnd).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_mean, string.Format("{0} DE ME ()", Strings.VName_Press), Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDeltaMean).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_start, string.Format("{0} DE ST ()", Strings.VName_Press), Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDeltaStart).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_end, string.Format("{0} DE EN ()", Strings.VName_Press), Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDeltaEnd).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_error, Strings.ErrRef + "()", Quantity.Error, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).ErrorMaster).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.Ambient_temperature, Strings.T_amb + "()", Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? Config.Units.ConvertTo(u, w.Batch.AmbientTempAve()).ToString(string.IsNullOrEmpty(p) ? "F1" : p) : Config.Units.ConvertTo(u, w.GetTestRslt(t).AmbTempMean).ToString(string.IsNullOrEmpty(p) ? "F1" : p))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.Ambient_pressure, Strings.P_amb + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? Config.Units.ConvertTo(u, w.Batch.AmbientPressAve()).ToString(string.IsNullOrEmpty(p) ? "F0" : p) : Config.Units.ConvertTo(u, w.GetTestRslt(t).AmbPressMean).ToString(string.IsNullOrEmpty(p) ? "F0" : p))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.Ambient_humidity, Strings.H_amb + "()", Quantity.Humidity, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? Config.Units.ConvertTo(u, w.Batch.AmbientHumiAve()).ToString(string.IsNullOrEmpty(p) ? "F1" : p) : Config.Units.ConvertTo(u, w.GetTestRslt(t).AmbHumiMean).ToString(string.IsNullOrEmpty(p) ? "F1" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.Ambient_temperature, string.Format("{0} Amb M", Strings.VName_Temp), Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? Config.Units.ConvertTo(u, w.Batch.AmbTempMean()).ToString(string.IsNullOrEmpty(p) ? "F1" : p) : Config.Units.ConvertTo(u, w.GetTestRslt(t).AmbTempMean).ToString(string.IsNullOrEmpty(p) ? "F1" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.Ambient_pressure, string.Format("{0} Amb M", Strings.VName_Press), Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? Config.Units.ConvertTo(u, w.Batch.AmbPressMean()).ToString(string.IsNullOrEmpty(p) ? "F0" : p) : Config.Units.ConvertTo(u, w.GetTestRslt(t).AmbPressMean).ToString(string.IsNullOrEmpty(p) ? "F0" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.Ambient_humidity, string.Format("{0} Amb M", Strings.VName_Humi), Quantity.Humidity, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? Config.Units.ConvertTo(u, w.Batch.AmbHumiMean()).ToString(string.IsNullOrEmpty(p) ? "F1" : p) : Config.Units.ConvertTo(u, w.GetTestRslt(t).AmbHumiMean).ToString(string.IsNullOrEmpty(p) ? "F1" : p))); /// Single and combined meter results - AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume, Strings.Volume + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeMeter).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume, Strings.Volume + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeMeter).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_volume, Strings.VolRef + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeRef).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); #if TURA_IPERL || TURA_SPECIAL AllItems.Add(new WMeterRsltItemSpec(ItemID.Error, Strings.Error + "()", Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "0" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).Error).ToString(string.IsNullOrEmpty(p) ? "F2" : p))); @@ -248,14 +248,14 @@ namespace Results AllItems.Add(new WMeterRsltItemSpec(ItemID.Remark, Strings.Remark, Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => w.Batch.Remark)); AllItems.Add(new WMeterRsltItemSpec(ItemID.Meter_type, Strings.Meter_type, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => w.WaterMeterData.Compound ? Strings.Compound : (w.WaterMeterData.HeatMeter ? Strings.Heat_meter : Strings.Single))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume_main, Strings.Volume_main + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeMeter).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume_aux, Strings.Volume_aux + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeMeter).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume, Strings.Start_volume + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeStart).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume_main, Strings.Volume_main + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeMeter).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume_aux, Strings.Volume_aux + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeMeter).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume, Strings.Start_volume + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeStart).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume_main, Strings.Start_volume_main + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeStart).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume_aux, Strings.Start_volume_aux + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeStart).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume, Strings.End_volume + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeEnd).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume_main, Strings.End_volume_main + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeEnd).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume_aux, Strings.End_volume_aux + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeEnd).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume_aux, Strings.Start_volume_aux + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeStart).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume, Strings.End_volume + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeEnd).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume_main, Strings.End_volume_main + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeEnd).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume_aux, Strings.End_volume_aux + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeEnd).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); #if HEAT_METERS AllItems.Add(new WMeterRsltItemSpec(ItemID.Energy, Strings.Energy + "()", Quantity.Energy, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy).VolumeMeter).ToString(string.IsNullOrEmpty(p) ? "F1" : p))); @@ -279,7 +279,20 @@ namespace Results AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrLFlow, "iPerl Q2CorrLFlow", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => (w.Q2CorrLFlow.ToString()))); AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrFlowRight, "iPerl Q2CorrFlowRight", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.Q2CorrFlowRight.ToString()))); #endif - } + AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_mean, string.Format("{0} rim ()", Strings.VName_Flow), Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Utils.DoubleToStr(Config.Units.ConvertTo(u, w.GetTestRslt(t).FlowMean), 4))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.T_up_start, string.Format("{0} UP ST ()", Strings.VName_Temp), Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempUpStart).ToString(string.IsNullOrEmpty(p) ? "F1" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.T_up_end, string.Format("{0} UP EN ()", Strings.VName_Temp), Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempUpEnd).ToString(string.IsNullOrEmpty(p) ? "F1" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.T_up_avg, string.Format("{0} UP avg ()", Strings.VName_Temp), Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, (w.GetTestRslt(t).TempUpStart + w.GetTestRslt(t).TempUpEnd) / 2).ToString(string.IsNullOrEmpty(p) ? "F1" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.T_down_start, string.Format("{0} DW ST ()", Strings.VName_Temp), Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempDownStart).ToString(string.IsNullOrEmpty(p) ? "F1" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.T_down_end, string.Format("{0} DW EN ()", Strings.VName_Temp), Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempDownEnd).ToString(string.IsNullOrEmpty(p) ? "F1" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.T_down_avg, string.Format("{0} DW avg ()", Strings.VName_Temp), Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, (w.GetTestRslt(t).TempDownStart + w.GetTestRslt(t).TempDownEnd) / 2).ToString(string.IsNullOrEmpty(p) ? "F1" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.T_div_start, string.Format("{0} DI ST ()", Strings.VName_Temp), Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempDivStart).ToString(string.IsNullOrEmpty(p) ? "F1" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.T_div_end, string.Format("{0} DI EN ()", Strings.VName_Temp), Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempDivEnd).ToString(string.IsNullOrEmpty(p) ? "F1" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.T_div_avg, string.Format("{0} DI avg ()", Strings.VName_Temp), Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, (w.GetTestRslt(t).TempDivStart + w.GetTestRslt(t).TempDivEnd) / 2).ToString(string.IsNullOrEmpty(p) ? "F1" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.P_up_avg, string.Format("{0} UP avg ()", Strings.VName_Press), Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, (w.GetTestRslt(t).PressUpStart + w.GetTestRslt(t).PressUpEnd) / 2).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.P_down_avg, string.Format("{0} DW avg ()", Strings.VName_Press), Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, (w.GetTestRslt(t).PressDownStart + w.GetTestRslt(t).PressDownEnd) / 2).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_avg, string.Format("{0} dif avg ()", Strings.VName_Press), Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, (w.GetTestRslt(t).PressDeltaStart + w.GetTestRslt(t).PressDeltaEnd) / 2).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); + } /// /// Converts a list of 'Output item specifications' to a string array diff --git a/ResultsBrowser/Output/Printers/QueryResults/QueryResultsPrintDocument.cs b/ResultsBrowser/Output/Printers/QueryResults/QueryResultsPrintDocument.cs index 9abf1a810..8444b5aa0 100644 --- a/ResultsBrowser/Output/Printers/QueryResults/QueryResultsPrintDocument.cs +++ b/ResultsBrowser/Output/Printers/QueryResults/QueryResultsPrintDocument.cs @@ -232,13 +232,13 @@ namespace ResultsBrowser.Output.Printers.QueryResults lineNr += (secondTableOffset * 2) / SpacingOne; PrintAt(e, Tab1, lineNr * SpacingOne, "Temperatur"); - PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbientTempAve().ToString("F1") + " \x00b0C"); + PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbTempMean().ToString("F1") + " \x00b0C"); lineNr++; PrintAt(e, Tab1, lineNr * SpacingOne, "Feuchtigkeit"); - PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbientHumiAve().ToString("F0") + " %"); + PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbHumiMean().ToString("F0") + " %"); lineNr++; PrintAt(e, Tab1, lineNr * SpacingOne, "Luftdruck"); - PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbientPressAve().ToString("F0") + " mbar"); + PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbPressMean().ToString("F0") + " mbar"); lineNr++; PrintAt(e, Tab3, lineNr * SpacingOne, wm.Batch.EndTime.Date.ToString("d")); diff --git a/TestBenchFramework/BenchControl/Output/FileWriters/Enhanced/Writer.cs b/TestBenchFramework/BenchControl/Output/FileWriters/Enhanced/Writer.cs index b8d63c897..19d819461 100644 --- a/TestBenchFramework/BenchControl/Output/FileWriters/Enhanced/Writer.cs +++ b/TestBenchFramework/BenchControl/Output/FileWriters/Enhanced/Writer.cs @@ -271,12 +271,12 @@ namespace TBF.BenchControl.Output.FileWriters.Enhanced } } - WriteRslts2(batch, writer); + WriteRsltsEx(batch, writer); writer.Close(); } - void WriteRslts2(Results.Entities.Batch batch, StreamWriter wrtr) + void WriteRsltsEx(Results.Entities.Batch batch, StreamWriter wrtr) { ///---------- /// Header diff --git a/TestBenchFramework/BenchControl/ResultsPrinters/Basic/BasicPrintDocument.cs b/TestBenchFramework/BenchControl/ResultsPrinters/Basic/BasicPrintDocument.cs index 98dfa1acc..9c3414fac 100644 --- a/TestBenchFramework/BenchControl/ResultsPrinters/Basic/BasicPrintDocument.cs +++ b/TestBenchFramework/BenchControl/ResultsPrinters/Basic/BasicPrintDocument.cs @@ -181,9 +181,9 @@ namespace TBF.BenchControl.ResultsPrinters.Basic string.Format("{0:yyyy.MM.dd HH:mm}", batch.EndTime), batch.ProcedureName, Users.GlobalData.CurrentUser.UserName, - batch.AmbientTempAve().ToString("F1") + " °C", - Config.Units.ConvertTo(Config.Unit.mbar, batch.AmbientPressAve()).ToString("F0") + " mbar", - batch.AmbientHumiAve().ToString("F0") + " %", + batch.AmbTempMean().ToString("F1") + " °C", + Config.Units.ConvertTo(Config.Unit.mbar, batch.AmbPressMean()).ToString("F0") + " mbar", + batch.AmbHumiMean().ToString("F0") + " %", }; /// Determine max. left column width in characters diff --git a/TestBenchFramework/BenchControl/Sequences/ProcessData.cs b/TestBenchFramework/BenchControl/Sequences/ProcessData.cs index 4624f8d68..8f8e834f2 100644 --- a/TestBenchFramework/BenchControl/Sequences/ProcessData.cs +++ b/TestBenchFramework/BenchControl/Sequences/ProcessData.cs @@ -93,8 +93,13 @@ namespace TBF.BenchControl.Sequences public static Statistics VolumeForEnergy = new Statistics(); public static int lastEnergyUpdateTime; - protected static void ClearAllStatistics() + public static int machineTimeStart; + public static int lastMachineTime; + + protected static void ClearAllStatistics(int machineTime) { + lastMachineTime = machineTimeStart = machineTime; + AmbTempStat.Clear(); AmbPressStat.Clear(); AmbHumiStat.Clear(); @@ -113,8 +118,10 @@ namespace TBF.BenchControl.Sequences lastEnergyUpdateTime = 0; } - protected static void UpdateAllStatistics() + protected static void UpdateAllStatistics(int machineTime) { + int timeDelta = machineTime - lastMachineTime; + AmbTempStat.Update(AmbTemp); AmbPressStat.Update(AmbPress); AmbHumiStat.Update(AmbHumi); @@ -124,13 +131,19 @@ namespace TBF.BenchControl.Sequences PressUpStat.Update(PressUp); PressDownStat.Update(PressDown); PressDeltaStat.Update(PressDelta); - RefFlowStat.Update(RefFlow); + + if (machineTime - machineTimeStart <= 5) /// Wait until flow is steady + { + RefFlowStat.Update(RefFlow); + } if (BatchRslts.Batch.HeatMeter) { TempRefHiStat.Update((TempRefHi1.Val + TempRefHi2.Val) / 2); TempRefLoStat.Update((TempRefLo1.Val + TempRefLo2.Val) / 2); } + + lastMachineTime = machineTime; } } } diff --git a/TestBenchFramework/BenchControl/Sequences/SequenceBase.cs b/TestBenchFramework/BenchControl/Sequences/SequenceBase.cs index 40088fb39..2baced410 100644 --- a/TestBenchFramework/BenchControl/Sequences/SequenceBase.cs +++ b/TestBenchFramework/BenchControl/Sequences/SequenceBase.cs @@ -1116,7 +1116,7 @@ namespace TBF.BenchControl.Sequences tstRslt.TempDownMax = 20.0f; tstRslt.TempDivMax = 20.0f; - tstRslt.FlowMin = 0; /// TODO + tstRslt.FlowMean = 0; /// TODO tstRslt.FlowMax = 0; /// TODO for (int i = 0; i < BatchRslts.WMPositionsCount; i++) @@ -1220,7 +1220,7 @@ namespace TBF.BenchControl.Sequences tstRslt.TempDownMax = 20.0f; tstRslt.TempDivMax = 20.0f; - tstRslt.FlowMin = 0; /// TODO + tstRslt.FlowMean = 0; /// TODO tstRslt.FlowMax = 0; /// TODO @@ -1344,7 +1344,7 @@ namespace TBF.BenchControl.Sequences tstRslt.TempDownMax = 20.0f; tstRslt.TempDivMax = 20.0f; - tstRslt.FlowMin = 0; /// TODO + tstRslt.FlowMean = 0; /// TODO tstRslt.FlowMax = 0; /// TODO for (int i = 0; i < BatchRslts.WMPositionsCount; i++) diff --git a/TestBenchFramework/BenchControl/TestMethods/Adjustment/AdjustmentSeq.cs b/TestBenchFramework/BenchControl/TestMethods/Adjustment/AdjustmentSeq.cs index 6313fcaf1..c004d21f7 100644 --- a/TestBenchFramework/BenchControl/TestMethods/Adjustment/AdjustmentSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/Adjustment/AdjustmentSeq.cs @@ -249,7 +249,7 @@ namespace TBF.BenchControl.TestMethods.Adjustment queryEnd1 = cBrd.QueryMeasurementEndOp(); queryEnd2 = cBrd.QueryMeasurementEndOp(); - ClearAllStatistics(); + ClearAllStatistics(StateMachine.Time); /// Measurement loop - begin while (true) @@ -264,7 +264,7 @@ namespace TBF.BenchControl.TestMethods.Adjustment RefFreq.Val = cBrd.ReferenceFreq; RefFlow.Val = cBrd.ReferenceFlow; - UpdateAllStatistics(); + UpdateAllStatistics(StateMachine.Time); Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.Test)); Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Test)); @@ -306,8 +306,8 @@ namespace TBF.BenchControl.TestMethods.Adjustment tstRslt.VolumeCTV = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3] tstRslt.ErrorMaster = 0.0f; /// Cannot be determined without the collected water mass measurement - tstRslt.FlowMin = (float)((tstRslt.VolumeMaster != 0) ? (RefFlowStat.Min * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : RefFlowStat.Min); - tstRslt.FlowMax = (float)((tstRslt.VolumeMaster != 0) ? (RefFlowStat.Max * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : RefFlowStat.Max); + tstRslt.FlowMean = (float)RefFlowStat.Average; + tstRslt.FlowMax = (float)RefFlowStat.Max; for (int i = 0; i < BatchRslts.WMPositionsCount; i++) { diff --git a/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs b/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs index 10a9af31d..c3867c07d 100644 --- a/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs @@ -502,7 +502,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection queryEnd1 = cBrd.QueryMeasurementEndOp(); queryEnd2 = cBrd.QueryMeasurementEndOp(); - ClearAllStatistics(); + ClearAllStatistics(StateMachine.Time); int estimtdEndTime = StateMachine.Time + (int)test.TstTime; /// Measurement loop - begin @@ -526,7 +526,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection Bridge.OnActivity(this, string.Format("{0} ... {1} s", Strings.Test_in_progress, remainingTime)); } - UpdateAllStatistics(); + UpdateAllStatistics(StateMachine.Time); /// TODO: Reimplement //for (int i = 0; i < Config.Data.CompoundWMsCount; i++) @@ -622,8 +622,8 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection tstRslt.ConstMaster = LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV); - tstRslt.FlowMin = (float)((tstRslt.VolumeMaster != 0) ? (RefFlowStat.Min * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : RefFlowStat.Min); - tstRslt.FlowMax = (float)((tstRslt.VolumeMaster != 0) ? (RefFlowStat.Max * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : RefFlowStat.Max); + tstRslt.FlowMean = (float)RefFlowStat.Average; + tstRslt.FlowMax = (float)RefFlowStat.Max; for (int i = 0; i < BatchRslts.WMPositionsCount; i++) { diff --git a/TestBenchFramework/BenchControl/TestMethods/Endurance/EnduranceSeq.cs b/TestBenchFramework/BenchControl/TestMethods/Endurance/EnduranceSeq.cs index 44fb3437a..31a87ccf2 100644 --- a/TestBenchFramework/BenchControl/TestMethods/Endurance/EnduranceSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/Endurance/EnduranceSeq.cs @@ -228,7 +228,7 @@ namespace TBF.BenchControl.TestMethods.Endurance queryEnd1 = cBrd.QueryMeasurementEndOp(); int estimtdEndTime = StateMachine.Time + (int)test.TstTime; - ClearAllStatistics(); + ClearAllStatistics(StateMachine.Time); /// Measurement loop - begin State.Create(string.Format("{0}({1}) : Reading watermeters", test.Method, test.Name)) @@ -274,7 +274,7 @@ namespace TBF.BenchControl.TestMethods.Endurance RefFreq.Val = cBrd.ReferenceFreq; RefFlow.Val = cBrd.ReferenceFlow; - UpdateAllStatistics(); + UpdateAllStatistics(StateMachine.Time); Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.Test)); Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Test)); @@ -323,8 +323,8 @@ namespace TBF.BenchControl.TestMethods.Endurance tstRslt.VolumeCTV = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3] tstRslt.ErrorMaster = 0.0; /// Cannot be determined without a mass measurement - tstRslt.FlowMin = (float)((tstRslt.VolumeMaster != 0) ? (RefFlowStat.Min * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : RefFlowStat.Min); - tstRslt.FlowMax = (float)((tstRslt.VolumeMaster != 0) ? (RefFlowStat.Max * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : RefFlowStat.Max); + tstRslt.FlowMean = (float)RefFlowStat.Average; + tstRslt.FlowMax = (float)RefFlowStat.Max; /// /// Single meters @@ -416,7 +416,7 @@ namespace TBF.BenchControl.TestMethods.Endurance while (!e.Contains(Event.PreviousStopped)); int estimtdEndTime = StateMachine.Time + (int)test.TstTime; - ClearAllStatistics(); + ClearAllStatistics(StateMachine.Time); /// @@ -466,7 +466,7 @@ namespace TBF.BenchControl.TestMethods.Endurance RefFreq.Val = cBrd.ReferenceFreq; RefFlow.Val = cBrd.ReferenceFlow; - UpdateAllStatistics(); + UpdateAllStatistics(StateMachine.Time); } while (!e.Contains(Event.CommandCompleted)); @@ -512,7 +512,7 @@ namespace TBF.BenchControl.TestMethods.Endurance RefFreq.Val = cBrd.ReferenceFreq; RefFlow.Val = cBrd.ReferenceFlow; - UpdateAllStatistics(); + UpdateAllStatistics(StateMachine.Time); Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.Test)); Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Test)); @@ -548,7 +548,7 @@ namespace TBF.BenchControl.TestMethods.Endurance RefFreq.Val = cBrd.ReferenceFreq; RefFlow.Val = cBrd.ReferenceFlow; - UpdateAllStatistics(); + UpdateAllStatistics(StateMachine.Time); Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.Test)); Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Test)); diff --git a/TestBenchFramework/BenchControl/TestMethods/FixedStartAdvanced/FixedStartAdvancedSeq.cs b/TestBenchFramework/BenchControl/TestMethods/FixedStartAdvanced/FixedStartAdvancedSeq.cs index 55286afbe..e7bb906b6 100644 --- a/TestBenchFramework/BenchControl/TestMethods/FixedStartAdvanced/FixedStartAdvancedSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/FixedStartAdvanced/FixedStartAdvancedSeq.cs @@ -335,7 +335,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced queryEnd1 = cBrd.QueryMeasurementEndOp(); queryEnd2 = cBrd.QueryMeasurementEndOp(); - ClearAllStatistics(); + ClearAllStatistics(StateMachine.Time); int estimtdEndTime = StateMachine.Time + (int)test.TstTime; /// Measurement loop - begin @@ -368,7 +368,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced RefFreq.Val = cBrd.ReferenceFreq; RefFlow.Val = cBrd.ReferenceFlow; - UpdateAllStatistics(); + UpdateAllStatistics(StateMachine.Time); Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.Test)); Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Test)); @@ -522,8 +522,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced tstRslt.ConstMaster = LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV); - tstRslt.FlowMin = (float)((tstRslt.VolumeMaster != 0) ? (RefFlowStat.Min * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : RefFlowStat.Min); - tstRslt.FlowMax = (float)((tstRslt.VolumeMaster != 0) ? (RefFlowStat.Max * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : RefFlowStat.Max); + tstRslt.FlowMean = (float)RefFlowStat.Average; + tstRslt.FlowMax = (float)RefFlowStat.Max; for (int i = 0; i < BatchRslts.WMPositionsCount; i++) { diff --git a/TestBenchFramework/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs b/TestBenchFramework/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs index abe20ea60..a113abdb8 100644 --- a/TestBenchFramework/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs @@ -497,7 +497,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection queryEnd1 = cBrd.QueryMeasurementEndOp(); queryEnd2 = cBrd.QueryMeasurementEndOp(); - ClearAllStatistics(); + ClearAllStatistics(StateMachine.Time); int estimtdEndTime = StateMachine.Time + (int)test.TstTime; /// Measurement loop - begin @@ -531,7 +531,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection RefFreq.Val = cBrd.ReferenceFreq; RefFlow.Val = cBrd.ReferenceFlow; - UpdateAllStatistics(); + UpdateAllStatistics(StateMachine.Time); if (heatMetersTestParams != null) { @@ -774,8 +774,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection tstRslt.ConstMaster = LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV); - tstRslt.FlowMin = (float)((tstRslt.VolumeMaster != 0) ? (RefFlowStat.Min * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : RefFlowStat.Min); - tstRslt.FlowMax = (float)((tstRslt.VolumeMaster != 0) ? (RefFlowStat.Max * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : RefFlowStat.Max); + tstRslt.FlowMean = (float)RefFlowStat.Average; + tstRslt.FlowMax = (float)RefFlowStat.Max; if (compound) { diff --git a/TestBenchFramework/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs b/TestBenchFramework/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs index bf74d9869..b079c7d48 100644 --- a/TestBenchFramework/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs @@ -321,7 +321,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStart queryEnd1 = cBrd.QueryMeasurementEndOp(); int estimtdEndTime = StateMachine.Time + (int)test.TstTime; - ClearAllStatistics(); + ClearAllStatistics(StateMachine.Time); /// Measurement loop - begin State.Create("Read water meters") @@ -366,7 +366,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStart RefFreq.Val = cBrd.ReferenceFreq; RefFlow.Val = cBrd.ReferenceFlow; - UpdateAllStatistics(); + UpdateAllStatistics(StateMachine.Time); if (heatMetersTestParams != null) { @@ -433,8 +433,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStart tstRslt.VolumeCTV = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3] tstRslt.ErrorMaster = 0.0; /// Cannot be determined without a mass measurement - tstRslt.FlowMin = (float)((tstRslt.VolumeMaster != 0) ? (RefFlowStat.Min * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : RefFlowStat.Min); - tstRslt.FlowMax = (float)((tstRslt.VolumeMaster != 0) ? (RefFlowStat.Max * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : RefFlowStat.Max); + tstRslt.FlowMean = (float)RefFlowStat.Average; + tstRslt.FlowMax = (float)RefFlowStat.Max; if (compoundTestParams != null) { diff --git a/TestBenchFramework/BenchControl/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs b/TestBenchFramework/BenchControl/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs index 5e7b16f24..1b1d87a8e 100644 --- a/TestBenchFramework/BenchControl/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs @@ -539,7 +539,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection readRegistersOp = new Operations.ReadMoreRegistersOp(sensPath.RegisterReaders); int estimtdEndTime = StateMachine.Time + (int)test.TstTime; - ClearAllStatistics(); + ClearAllStatistics(StateMachine.Time); /// Measurement loop - begin State.Create(string.Format("{0}({1}) : Reading watermeters", test.Method, test.Name)) @@ -586,7 +586,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection RefFreq.Val = cBrd.ReferenceFreq; RefFlow.Val = cBrd.ReferenceFlow; - UpdateAllStatistics(); + UpdateAllStatistics(StateMachine.Time); if (heatMetersTestParams != null) { @@ -729,8 +729,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection tstRslt.ConstMaster = LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV); - tstRslt.FlowMin = (float)((tstRslt.VolumeMaster != 0) ? (RefFlowStat.Min * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : RefFlowStat.Min); - tstRslt.FlowMax = (float)((tstRslt.VolumeMaster != 0) ? (RefFlowStat.Max * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : RefFlowStat.Max); + tstRslt.FlowMean = (float)RefFlowStat.Average; + tstRslt.FlowMax = (float)RefFlowStat.Max; if (compoundTestParams != null) { diff --git a/TestBenchFramework/BenchControl/TestMethods/LeakTest/LeakTestSeq.cs b/TestBenchFramework/BenchControl/TestMethods/LeakTest/LeakTestSeq.cs index db1ecaa53..c17373873 100644 --- a/TestBenchFramework/BenchControl/TestMethods/LeakTest/LeakTestSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/LeakTest/LeakTestSeq.cs @@ -133,8 +133,8 @@ namespace TBF.BenchControl.TestMethods.LeakTest pressure_set: - ClearAllStatistics(); - UpdateAllStatistics(); + ClearAllStatistics(StateMachine.Time); + UpdateAllStatistics(StateMachine.Time); startTime = StateMachine.Time; int estimtdEndTime = startTime + testParams.DurationPMax; @@ -159,7 +159,7 @@ namespace TBF.BenchControl.TestMethods.LeakTest if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; } if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; } - UpdateAllStatistics(); + UpdateAllStatistics(StateMachine.Time); int remainingTime = Math.Max(estimtdEndTime - StateMachine.Time, 0); if (remainingTime > 60) @@ -194,7 +194,7 @@ namespace TBF.BenchControl.TestMethods.LeakTest if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; } if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; } - UpdateAllStatistics(); + UpdateAllStatistics(StateMachine.Time); } while (e.Contains(Event.ValvesBusy)); @@ -218,7 +218,7 @@ namespace TBF.BenchControl.TestMethods.LeakTest if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; } if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; } - UpdateAllStatistics(); + UpdateAllStatistics(StateMachine.Time); } while (e.Contains(Event.ValvesBusy)); @@ -228,7 +228,7 @@ namespace TBF.BenchControl.TestMethods.LeakTest TestStartTime = DateTime.Now; startTime = StateMachine.Time; estimtdEndTime = startTime + testParams.DurationLeak; - ClearAllStatistics(); + ClearAllStatistics(StateMachine.Time); //------------------------------------------------ Bridge.OnActivity(this, Strings.Test_in_progress); @@ -249,7 +249,7 @@ namespace TBF.BenchControl.TestMethods.LeakTest if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; } if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; } - UpdateAllStatistics(); + UpdateAllStatistics(StateMachine.Time); int remainingTime = Math.Max(estimtdEndTime - StateMachine.Time, 0); if (remainingTime > 60) diff --git a/TestBenchFramework/BenchControl/TestMethods/PMaxTest/PMaxTestSeq.cs b/TestBenchFramework/BenchControl/TestMethods/PMaxTest/PMaxTestSeq.cs index 89cf764b9..63b03ef93 100644 --- a/TestBenchFramework/BenchControl/TestMethods/PMaxTest/PMaxTestSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/PMaxTest/PMaxTestSeq.cs @@ -134,8 +134,8 @@ namespace TBF.BenchControl.TestMethods.PMaxTest pressure_set: - ClearAllStatistics(); - UpdateAllStatistics(); + ClearAllStatistics(StateMachine.Time); + UpdateAllStatistics(StateMachine.Time); startTime = StateMachine.Time; int endTime = startTime + testParams.DurationPMax; @@ -160,7 +160,7 @@ namespace TBF.BenchControl.TestMethods.PMaxTest if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; } if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; } - UpdateAllStatistics(); + UpdateAllStatistics(StateMachine.Time); int remainingTime = Math.Max(endTime - StateMachine.Time, 0); if (remainingTime > 60) diff --git a/TestBenchFramework/BenchControl/TestMethods/ReferenceFlowmeterCalibration/ReferenceFlowmeterCalibrationSeq.cs b/TestBenchFramework/BenchControl/TestMethods/ReferenceFlowmeterCalibration/ReferenceFlowmeterCalibrationSeq.cs index 6c67a5932..5b95710bc 100644 --- a/TestBenchFramework/BenchControl/TestMethods/ReferenceFlowmeterCalibration/ReferenceFlowmeterCalibrationSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/ReferenceFlowmeterCalibration/ReferenceFlowmeterCalibrationSeq.cs @@ -217,7 +217,7 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration queryEnd1 = cBrd.QueryMeasurementEndOp(); queryEnd2 = cBrd.QueryMeasurementEndOp(); - ClearAllStatistics(); + ClearAllStatistics(StateMachine.Time); /// Measurement loop - begin while (true) @@ -232,7 +232,7 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration RefFreq.Val = cBrd.ReferenceFreq; RefFlow.Val = cBrd.ReferenceFlow; - UpdateAllStatistics(); + UpdateAllStatistics(StateMachine.Time); Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.Test)); Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Test)); @@ -324,8 +324,8 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration tstRslt.ConstMaster = LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV); - tstRslt.FlowMin = (float)((tstRslt.VolumeMaster != 0) ? (RefFlowStat.Min * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : RefFlowStat.Min); - tstRslt.FlowMax = (float)((tstRslt.VolumeMaster != 0) ? (RefFlowStat.Max * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : RefFlowStat.Max); + tstRslt.FlowMean = (float)RefFlowStat.Average; + tstRslt.FlowMax = (float)RefFlowStat.Max; /// Update flowmeter constant with the measured one if (outPath.FlowMeter.Idx1 > 0 && outPath.FlowMeter.Idx1 <= ReferenceFlowmetersCount) diff --git a/TestBenchFramework/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationSeq.cs b/TestBenchFramework/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationSeq.cs index 00fc97cbf..73fad47c8 100644 --- a/TestBenchFramework/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationSeq.cs @@ -275,7 +275,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication tstRslt.VolumeMaster = oriTestRslt.VolumeMaster; tstRslt.ErrorMaster = oriTestRslt.ErrorMaster; - tstRslt.FlowMin = oriTestRslt.FlowMin; + tstRslt.FlowMean = oriTestRslt.FlowMean; tstRslt.FlowMax = oriTestRslt.FlowMax; tstRslt.Custom1 = oriTestRslt.Custom1; diff --git a/TestBenchFramework/Properties/AssemblyInfo.cs b/TestBenchFramework/Properties/AssemblyInfo.cs index 0be332d8f..3afde08f7 100644 --- a/TestBenchFramework/Properties/AssemblyInfo.cs +++ b/TestBenchFramework/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("2.12.556.1")] -[assembly: AssemblyFileVersion("2.12.556.1")] +[assembly: AssemblyVersion("2.12.563.1")] +[assembly: AssemblyFileVersion("2.12.563.1")]