LastError added to MeterTestRslt, result items, etc. when ORACLE_DB defined, etc. (CalibFactorLNA, OrigCalibFactorLNA)

This commit is contained in:
Milan Hanajik 2018-11-07 08:11:47 +01:00
parent cebdd71065
commit 1fd8881d53
8 changed files with 43 additions and 18 deletions

View File

@ -28,6 +28,9 @@ namespace Results.Entities
public virtual double KorrErrQ { get; set; } /// [%] not mapped to results DB, saved to Oracle DB
public virtual bool TestDone { get; set; } /// true = test was completed
public virtual bool Passed { get; set; } /// true = test passed, water meter is OK
#if ORACLE_DB
public virtual double LastError { get; set; } /// [%] Previous test error at this Q in case Pruefindex > 1
#endif
public virtual WaterMeter WaterMeter { get; set; } /// reference to the WaterMeter entity
public virtual TestRslt TestRslt { get; set; } /// reference to the TestRslt entity

View File

@ -60,7 +60,7 @@ namespace Results.Entities
public virtual int SerialNrEx { get; set; } /// Aux s/n for compound meters, Serial number for iPerl water meter
public virtual double OrigCalibFactor { get; set; } /// Original iPerl calibration factor used during the test
public virtual double CalibFactor { get; set; } /// iPerl calibration factor used during the test
public virtual double OrigCalibFactorLNA { get; set; } /// Original iPerl LNA calibration factor used during the test
public virtual double OrigCalibFactorLNA{ get; set; } /// Original iPerl LNA calibration factor used during the test
public virtual double CalibFactorLNA { get; set; } /// iPerl LNA calibration factor used during the test
public virtual double Q2ErrWOCorrection { get; set; }
public virtual bool Q2CorrectionDone { get; set; } /// true = iPerl Q2 correction was done

View File

@ -1,5 +1,5 @@
///
/// Copyright (c) 2016-2017 Sensus Metering Systems
/// Copyright (c) 2016-2018 Sensus Slovensko a.s.
///
using System;
@ -264,6 +264,11 @@ namespace Results
Max_test_index, /// 228 MaxPruefindex % 100
VolumeCTV, /// 229
/// iPerl
LastError, /// 230 For iPerl previous test result (test with Proefindex-1)
OrigCalibFactorLNA, /// 231
CalibFactorLNA, /// 232
Count,
}
}

View File

@ -25,8 +25,10 @@ namespace Results.Mappings
Map(x => x.Error);
Map(x => x.TestDone);
Map(x => x.Passed);
References(x => x.WaterMeter);
#if ORACLE_DB
Map(x => x.LastError);
#endif
References(x => x.WaterMeter);
References(x => x.TestRslt);
}
}

View File

@ -31,12 +31,8 @@ namespace Results.Mappings
Map(x => x.SerialNrEx);
Map(x => x.OrigCalibFactor);
Map(x => x.CalibFactor);
#endif
#if IPERL2
Map(x => x.OrigCalibFactorLNA);
Map(x => x.CalibFactorLNA);
#endif
#if IPERL
Map(x => x.Q2ErrWOCorrection);
Map(x => x.Q2CorrectionDone);
Map(x => x.Q2Correction);
@ -48,7 +44,11 @@ namespace Results.Mappings
Map(x => x.Hz2Correction);
Map(x => x.FWVersion);
#endif
References(x => x.WaterMeterData);
#if ORACLE_DB
Map(x => x.Pruefindex);
Map(x => x.HydrPruefung);
#endif
References(x => x.WaterMeterData);
References(x => x.Batch);
HasMany(x => x.MeterTestRslts)
.Cascade.All();

View File

@ -1059,6 +1059,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Relative error of a meter in previous test/in production.
/// </summary>
internal static string Tooltip_E_rel_last {
get {
return ResourceManager.GetString("Tooltip_E_rel_last", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Relative error of the master meter.
/// </summary>

View File

@ -735,4 +735,7 @@
<data name="Address" xml:space="preserve">
<value>Address</value>
</data>
<data name="Tooltip_E_rel_last" xml:space="preserve">
<value>Relative error of a meter in previous test/in production</value>
</data>
</root>

View File

@ -310,8 +310,9 @@ namespace Results
AllItems.Add(new WMeterRsltItemSpec(ItemID.Uncertainty, Strings.Uncertainty + "()", Quantity.Error, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V2", w.GetTestRslt(t).Uncertainty())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_error, string.Format("{0} rel.ref. ()", Strings.VName_Error), Strings.Tooltip_E_rel_ref, Quantity.Error, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V2", w.GetTestRslt(t).ErrorMaster)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_error_corr, string.Format("{0} ref.corr. ()", Strings.VName_Error), "Relative error of the reference flow meter after correction using correction curve", Quantity.Error, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V2", Config.Formulas.ErrorFromVolumes(w.GetTestRslt(t).ConstMasterCorr, w.GetTestRslt(t).ConstMaster))));
#if TURA_IPERL || TURA_SPECIAL
#if ORACLE_DB
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error, string.Format("{0} rel. ()", Strings.VName_Error), Strings.Tooltip_E_rel, Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "0" : FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t).Error)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.LastError, string.Format("{0} rel. last ()", Strings.VName_Error), Strings.Tooltip_E_rel_last, Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "0" : FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t).LastError)));
#else
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error, string.Format("{0} rel. ()", Strings.VName_Error), Strings.Tooltip_E_rel, Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t).Error)));
#endif
@ -410,14 +411,16 @@ namespace Results
#endif
#if IPERL
AllItems.Add(new WMeterRsltItemSpec(ItemID.OrigCalibFactor, "iPerl OrigCalibFactor", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.OrigCalibFactor)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.CalibFactor, "iPerl CalibFactor", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.CalibFactor)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2ErrWOCorrection, "iPerl Q2ErrWOCorrection",Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.Q2ErrWOCorrection)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrectionDone, "iPerl Q2CorrectionDone", Quantity.Boolean,ItemCategory.MeterResult, (w, t, u, f, p) => (w.Q2CorrectionDone ? Strings.Yes : Strings.No)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrRFlow, "iPerl Q2CorrRFlow", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.Q2CorrRL)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrLFlow, "iPerl Q2CorrLFlow", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.Q2CorrLR)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrFlowRight, "iPerl Q2CorrFlowRight", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.Q2CorrFlowRight)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.FW_Version, "iPerl FW version", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.FWVersion)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.OrigCalibFactor, "iPerl OrigCalibFactor", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.OrigCalibFactor)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.CalibFactor, "iPerl CalibFactor", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.CalibFactor)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.OrigCalibFactorLNA,"iPerl OrigCalibFactorLNA",Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.OrigCalibFactorLNA)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.CalibFactorLNA, "iPerl CalibFactorLNA", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.CalibFactorLNA)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2ErrWOCorrection, "iPerl Q2ErrWOCorrection", Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.Q2ErrWOCorrection)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrectionDone, "iPerl Q2CorrectionDone", Quantity.Boolean,ItemCategory.MeterResult, (w, t, u, f, p) => (w.Q2CorrectionDone ? Strings.Yes : Strings.No)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrRFlow, "iPerl Q2CorrRFlow", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.Q2CorrRL)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrLFlow, "iPerl Q2CorrLFlow", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.Q2CorrLR)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrFlowRight, "iPerl Q2CorrFlowRight", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.Q2CorrFlowRight)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.FW_Version, "iPerl FW version", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.FWVersion)));
#if ORACLE_DB
AllItems.Add(new WMeterRsltItemSpec(ItemID.Max_test_index, "iPerl test index", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, (w.Pruefindex % 100))));
#endif