From d4cbec50ba7ecf6e29744950560693f3a4fc57d8 Mon Sep 17 00:00:00 2001 From: Milan Hanajik Date: Fri, 14 Oct 2016 16:54:19 +0200 Subject: [PATCH] Reference temperatures (Hi and Lo) added to results. --- Results/Entities/TestRslt.cs | 4 ++-- Results/ItemID.cs | 8 ++++++++ Results/ItemSpec.cs | 12 ++++++++++-- Results/WMeterRsltItemSpec.cs | 17 +++++++++++++---- 4 files changed, 33 insertions(+), 8 deletions(-) diff --git a/Results/Entities/TestRslt.cs b/Results/Entities/TestRslt.cs index f55273fea..8c7bcf185 100644 --- a/Results/Entities/TestRslt.cs +++ b/Results/Entities/TestRslt.cs @@ -84,12 +84,12 @@ namespace Results.Entities public virtual float FlowMin { get; set; } /// [m3/h] minimum flow public virtual float FlowMax { get; set; } /// [m3/h] maximum flow - public virtual float Custom1 { get; set; } /// [°C] T ref warm average + public virtual float Custom1 { get; set; } /// [°C] T ref warm mean public virtual float Custom2 { get; set; } /// [°C] T ref warm start public virtual float Custom3 { get; set; } /// [°C] T ref warm end public virtual float Custom4 { get; set; } /// [°C] T ref warm min public virtual float Custom5 { get; set; } /// [°C] T ref warm max - public virtual float Custom6 { get; set; } /// [°C] T ref cold average + public virtual float Custom6 { get; set; } /// [°C] T ref cold mean public virtual float Custom7 { get; set; } /// [°C] T ref cold start public virtual float Custom8 { get; set; } /// [°C] T ref cold end public virtual float Custom9 { get; set; } /// [°C] T ref cold min diff --git a/Results/ItemID.cs b/Results/ItemID.cs index c9857e916..1315f5fcf 100644 --- a/Results/ItemID.cs +++ b/Results/ItemID.cs @@ -80,6 +80,14 @@ namespace Results Lite_per_pulse_Read, /// 73 Result_code, /// 74 Remark, /// 75 + TempHiMean, /// 76 + TempHiStart, /// 77 + TempHiEnd, /// 78 + TempHiAve, /// 79 + TempLoMean, /// 80 + TempLoStart, /// 81 + TempLoEnd, /// 82 + TempLoAve, /// 83 Count, } diff --git a/Results/ItemSpec.cs b/Results/ItemSpec.cs index ccbba5569..4f73198b8 100644 --- a/Results/ItemSpec.cs +++ b/Results/ItemSpec.cs @@ -187,8 +187,16 @@ namespace Results AllItems.Add(new ItemSpec("Batch end time", Strings.End, x => x.Batch().EndTime.ToShortTimeString(), (x, y, z) => x.Batch().EndTime.ToShortTimeString(), (x, z) => x.Batch().EndTime.ToShortTimeString())); /// Heat meters results - AllItems.Add(new ItemSpec("Energy", Strings.Energy, null, null, (x,z) => z.VolumeMeter.ToString())); - AllItems.Add(new ItemSpec("Reference energy", Strings.Energy_ref, null, null, (x,z) => z.VolumeRef.ToString())); + AllItems.Add(new ItemSpec("Energy", Strings.Energy, null, null, (x, z) => z.VolumeMeter.ToString())); + AllItems.Add(new ItemSpec("Reference energy", Strings.Energy_ref, null, null, (x, z) => z.VolumeRef.ToString())); + AllItems.Add(new ItemSpec("Temp hi me", "T hi me", null, null, (x, z) => z.TestRslt.Custom1.ToString("F3"))); + AllItems.Add(new ItemSpec("Temp hi st", "T hi st", null, null, (x, z) => z.TestRslt.Custom2.ToString("F3"))); + AllItems.Add(new ItemSpec("Temp hi en", "T hi en", null, null, (x, z) => z.TestRslt.Custom3.ToString("F3"))); + AllItems.Add(new ItemSpec("Temp hi av", "T hi av", null, null, (x, z) => ((z.TestRslt.Custom2 + z.TestRslt.Custom3) / 2).ToString("F3"))); + AllItems.Add(new ItemSpec("Temp lo me", "T lo me", null, null, (x, z) => z.TestRslt.Custom6.ToString("F3"))); + AllItems.Add(new ItemSpec("Temp lo st", "T lo st", null, null, (x, z) => z.TestRslt.Custom7.ToString("F3"))); + AllItems.Add(new ItemSpec("Temp lo en", "T lo en", null, null, (x, z) => z.TestRslt.Custom8.ToString("F3"))); + AllItems.Add(new ItemSpec("Temp lo av", "T lo av", null, null, (x, z) => ((z.TestRslt.Custom7 + z.TestRslt.Custom8) / 2).ToString("F3"))); } public static ItemSpec GetItem(string name) diff --git a/Results/WMeterRsltItemSpec.cs b/Results/WMeterRsltItemSpec.cs index 021c7198b..ae5a80bb8 100644 --- a/Results/WMeterRsltItemSpec.cs +++ b/Results/WMeterRsltItemSpec.cs @@ -138,10 +138,6 @@ namespace Results /// Single and combined meter results AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume, Strings.Volume + "()", Quantity.Volume, (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, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeRef).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); -#if HEAT_METERS_SUPPORT - AllItems.Add(new WMeterRsltItemSpec(ItemID.Energy, Strings.Energy + "()", Quantity.Energy, (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))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_energy, Strings.Energy_ref + "()", Quantity.Energy, (w, t, u, f, p) => (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy).VolumeRef).ToString(string.IsNullOrEmpty(p) ? "F1" : p))); -#endif #if IPERLST || IPERLST_SPECIAL AllItems.Add(new WMeterRsltItemSpec(ItemID.Error, Strings.Error + "()", Quantity.Error, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "0" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).Error).ToString(string.IsNullOrEmpty(p) ? "F2" : p))); #else @@ -223,6 +219,19 @@ namespace Results /// Extra water meter data AllItems.Add(new WMeterRsltItemSpec(ItemID.Result_code, Strings.Result_code, Quantity.Number, (w, t, u, f, p) => string.IsNullOrEmpty(f) ? w.ResultCode.ToString() : string.Format(f, w.ResultCode))); AllItems.Add(new WMeterRsltItemSpec(ItemID.Remark, Strings.Remark, Quantity.String, (w, t, u, f, p) => w.Batch.Remark)); + +#if HEAT_METERS_SUPPORT + AllItems.Add(new WMeterRsltItemSpec(ItemID.Energy, Strings.Energy + "()", Quantity.Energy, (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))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_energy, Strings.Energy_ref + "()", Quantity.Energy, (w, t, u, f, p) => (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy).VolumeRef).ToString(string.IsNullOrEmpty(p) ? "F1" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.TempHiMean, "T hi me", Quantity.Temperature, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom1).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.TempHiStart, "T hi st", Quantity.Temperature, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom2).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.TempHiEnd, "T hi en", Quantity.Temperature, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom3).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.TempHiAve, "T hi av", Quantity.Temperature, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, (w.GetTestRslt(t).Custom2 + w.GetTestRslt(t).Custom3) / 2).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.TempLoMean, "T lo me", Quantity.Temperature, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom6).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.TempLoStart, "T lo st", Quantity.Temperature, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom7).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.TempLoEnd, "T lo en", Quantity.Temperature, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom8).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.TempLoAve, "T lo av", Quantity.Temperature, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, (w.GetTestRslt(t).Custom7 + w.GetTestRslt(t).Custom8) / 2).ToString(string.IsNullOrEmpty(p) ? "F3" : p))); +#endif } ///