ErrorFlags component added, Results.Entities.TestRslt upgraded to DB v.2.16, ErrorFlags and ErrorFlagsMd added, used in test methods, ver. 2.16.642
This commit is contained in:
parent
70ccb8b4d8
commit
20d8fbc389
@ -379,4 +379,26 @@ namespace Config.Entities
|
||||
[Description("270 deg")] Deg270,
|
||||
Count
|
||||
}
|
||||
|
||||
public enum ErrorFlagsMode : sbyte
|
||||
{
|
||||
#if LANG_DE
|
||||
[Description("aus")] Off,
|
||||
[Description("info")] Info,
|
||||
[Description("ein")] On,
|
||||
#elif LANG_CS
|
||||
[Description("vypnuto")] off,
|
||||
[Description("info")] Info,
|
||||
[Description("zapnuto")] On,
|
||||
#elif LANG_PL
|
||||
[Description("nie")] Off,
|
||||
[Description("info")] Info,
|
||||
[Description("tak")] On,
|
||||
#else // LANG_EN
|
||||
[Description("off")] Off,
|
||||
[Description("info")] Info,
|
||||
[Description("on")] On,
|
||||
#endif
|
||||
Count
|
||||
}
|
||||
}
|
||||
|
||||
@ -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.15.619.0")]
|
||||
[assembly: AssemblyFileVersion("2.15.619.0")]
|
||||
[assembly: AssemblyVersion("2.16.642.0")]
|
||||
[assembly: AssemblyFileVersion("2.16.642.0")]
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2015-2016 Sensus Metering Systems
|
||||
/// Copyright (c) 2015-2017 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@ -38,6 +38,8 @@ namespace Results.Entities
|
||||
public virtual double VolumeCTV { get; set; } /// [l] Volume conventional true value
|
||||
public virtual double VolumeMaster { get; set; } /// [l] Volume from the master flow meter
|
||||
public virtual double ErrorMaster { get; set; } /// [%]
|
||||
public virtual int ErrorFlags { get; set; } /// bitfield : bit0=E1, bit1=E2, bit2=E3, etc.
|
||||
public virtual sbyte ErrorFlagsMd { get; set; } /// 0=off, 1=info, 2=on (evaluated in MeterTestRslt.Passed)
|
||||
|
||||
/// Main results of heat meters
|
||||
public virtual double RefEnergy { get; set; } /// [J] Joul
|
||||
@ -161,6 +163,8 @@ namespace Results.Entities
|
||||
VolumeCTV = src.VolumeCTV;
|
||||
VolumeMaster = src.VolumeMaster;
|
||||
ErrorMaster = src.ErrorMaster;
|
||||
ErrorFlags = src.ErrorFlags;
|
||||
ErrorFlagsMd = src.ErrorFlagsMd;
|
||||
RefEnergy = src.RefEnergy;
|
||||
AmbTempMean = src.AmbTempMean;
|
||||
AmbTempStart = src.AmbTempStart;
|
||||
@ -224,6 +228,12 @@ namespace Results.Entities
|
||||
Custom10 = src.Custom10;
|
||||
}
|
||||
|
||||
/// <summary> Wrapper </summary>
|
||||
public virtual Config.Entities.ErrorFlagsMode ErrorFlagsMode()
|
||||
{
|
||||
return (Config.Entities.ErrorFlagsMode)ErrorFlagsMd;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("batch={0}, procedure={1}, test={2}, {3} {4}", Batch.BatchNr, Batch.ProcedureName, Name(), StartTime.ToShortDateString(), StartTime.ToShortTimeString());
|
||||
|
||||
@ -149,6 +149,24 @@ namespace Results
|
||||
Buoyancy, /// 132
|
||||
Density_correction, /// 133
|
||||
|
||||
ErrorFlags, /// 134
|
||||
E1, /// 135
|
||||
E2, /// 136
|
||||
E3, /// 137
|
||||
E4, /// 138
|
||||
E5, /// 139
|
||||
E6, /// 140
|
||||
E7, /// 141
|
||||
E8, /// 142
|
||||
E9, /// 143
|
||||
E10, /// 144
|
||||
E11, /// 145
|
||||
E12, /// 146
|
||||
E13, /// 147
|
||||
E14, /// 148
|
||||
E15, /// 149
|
||||
E16, /// 150
|
||||
|
||||
Count,
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,6 +40,8 @@ namespace Results.Mappings
|
||||
Map(x => x.VolumeCTV);
|
||||
Map(x => x.VolumeMaster);
|
||||
Map(x => x.ErrorMaster);
|
||||
Map(x => x.ErrorFlags);
|
||||
Map(x => x.ErrorFlagsMd);
|
||||
#if HEAT_METERS
|
||||
Map(x => x.RefEnergy);
|
||||
#endif
|
||||
|
||||
@ -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.15.619.0")]
|
||||
[assembly: AssemblyFileVersion("2.15.619.0")]
|
||||
[assembly: AssemblyVersion("2.16.642.0")]
|
||||
[assembly: AssemblyFileVersion("2.16.642.0")]
|
||||
|
||||
9
Results/Resources/Strings.Designer.cs
generated
9
Results/Resources/Strings.Designer.cs
generated
@ -330,6 +330,15 @@ namespace Results.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Error flags.
|
||||
/// </summary>
|
||||
internal static string Error_flags {
|
||||
get {
|
||||
return ResourceManager.GetString("Error_flags", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to E rel. ref..
|
||||
/// </summary>
|
||||
|
||||
@ -627,4 +627,7 @@
|
||||
<data name="Density_correction" xml:space="preserve">
|
||||
<value>Density correction</value>
|
||||
</data>
|
||||
<data name="Error_flags" xml:space="preserve">
|
||||
<value>Error flags</value>
|
||||
</data>
|
||||
</root>
|
||||
@ -346,6 +346,23 @@ namespace Results
|
||||
#endif
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.TestDone, Strings.Test_done + "()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) != null && w.GetMeterTestRslt(t).TestDone) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.TestPassed, Strings.Test_passed + "()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) != null && w.GetMeterTestRslt(t).Passed) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.ErrorFlags, Strings.Error_flags + "()", Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null) ? w.GetTestRslt(t).ErrorFlags.ToString("X4") : string.Empty));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E1, "E1 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x0001) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E2, "E2 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x0002) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E3, "E3 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x0004) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E4, "E4 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x0008) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E5, "E5 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x0010) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E6, "E6 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x0020) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E7, "E7 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x0040) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E8, "E8 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x0080) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E9, "E9 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x0100) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E10, "E10 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x0200) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E11, "E11 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x0400) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E12, "E12 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x0800) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E13, "E13 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x1000) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E14, "E14 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x2000) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E15, "E15 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x4000) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E16, "E16 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x8000) != 0) ? Strings.Yes : Strings.No));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -187,5 +187,6 @@ namespace TBF.BenchControl
|
||||
OuterLoopStart,
|
||||
OuterLoopNext,
|
||||
OuterLoopEnd,
|
||||
ErrorConditionsDone,
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,14 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.GenericDevices
|
||||
{
|
||||
public interface IErrorFlags : IComponent
|
||||
{
|
||||
Config.Entities.ErrorFlagsMode Mode { get; }
|
||||
|
||||
int GetErrorFlags();
|
||||
}
|
||||
}
|
||||
@ -7,6 +7,7 @@ namespace TBF.BenchControl.Sequences
|
||||
public class ProcessData
|
||||
{
|
||||
public static IBenchInfo BenchInfo;
|
||||
public static IErrorFlags ErrorFlagsComp;
|
||||
|
||||
public static FloatBox AmbTemp = new FloatBox() { Name = "Ambient Temperature", Format = "F1" }; /// [Celsius]
|
||||
public static FloatBox AmbPress = new FloatBox() { Name = "Ambient Pressure", Format = "F0", Factor = 1000 }; /// [bar], printed by ToString() in [mbar]
|
||||
|
||||
@ -222,6 +222,7 @@ namespace TBF.BenchControl
|
||||
{
|
||||
if (cmpnt is Elde.ControlBoardDev) ControlBoard = cmpnt as Elde.ControlBoardDev;
|
||||
if (cmpnt is IBenchInfo) ProcessData.BenchInfo = cmpnt as IBenchInfo;
|
||||
if (cmpnt is IErrorFlags) ProcessData.ErrorFlagsComp = cmpnt as IErrorFlags;
|
||||
if (cmpnt is IFlowMeter) SequenceBase.FlowMeters.Add(cmpnt as IFlowMeter);
|
||||
if ((cmpnt is IRegulValve) && !(cmpnt is BenchControl.Elde.RegulValveTandem.RegulValveTandem))
|
||||
{
|
||||
|
||||
@ -122,6 +122,7 @@ namespace TBF.BenchControl
|
||||
Factories.Add(new Elde.TempMeterInternal.TempMeterFactory());
|
||||
Factories.Add(new Elde.Valve.ValveFactory());
|
||||
Factories.Add(new Elde.ValveEx.ValveFactory());
|
||||
Factories.Add(new Various.ErrorFlags.Factory());
|
||||
Factories.Add(new WaterMeters.Munich.WaterMeterFactory()); /// 'WaterMeters.Munich'
|
||||
Factories.Add(new WaterMeters.WaterMeter.WaterMeterFactory()); /// 'WaterMeter'
|
||||
}
|
||||
|
||||
@ -341,6 +341,8 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
||||
tstRslt.FlowMin = (float)RefFlowStat.Min;
|
||||
tstRslt.FlowMax = (float)RefFlowStat.Max;
|
||||
|
||||
if (ErrorFlagsComp != null) tstRslt.ErrorFlags = ErrorFlagsComp.GetErrorFlags();
|
||||
|
||||
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
|
||||
{
|
||||
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
|
||||
|
||||
@ -627,6 +627,8 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
tstRslt.FlowMin = (float)RefFlowStat.Min;
|
||||
tstRslt.FlowMax = (float)RefFlowStat.Max;
|
||||
|
||||
if (ErrorFlagsComp != null) tstRslt.ErrorFlags = ErrorFlagsComp.GetErrorFlags();
|
||||
|
||||
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
|
||||
{
|
||||
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
|
||||
@ -672,7 +674,8 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
compoundMeterRslt.TestTime = tstRslt.TestTime;
|
||||
compoundMeterRslt.Error = Formulas.ErrorFromVolumes(compoundMeterRslt.VolumeMeter, compoundMeterRslt.VolumeRef);
|
||||
compoundMeterRslt.Passed = (compoundMeterRslt.Error >= test.ErrLimLo + test.Uncertainty)
|
||||
&& (compoundMeterRslt.Error <= test.ErrLimHi - test.Uncertainty);
|
||||
&& (compoundMeterRslt.Error <= test.ErrLimHi - test.Uncertainty)
|
||||
&& (tstRslt.ErrorFlags == 0 || tstRslt.ErrorFlagsMode() != Config.Entities.ErrorFlagsMode.On);
|
||||
mainMeterRslt.Passed = auxMeterRslt.Passed = compoundMeterRslt.Passed;
|
||||
mainMeterRslt.TestDone = auxMeterRslt.TestDone = compoundMeterRslt.TestDone = true;
|
||||
tstRslt.TestDone = true;
|
||||
|
||||
@ -359,6 +359,8 @@ namespace TBF.BenchControl.TestMethods.Endurance
|
||||
tstRslt.FlowMin = (float)RefFlowStat.Min;
|
||||
tstRslt.FlowMax = (float)RefFlowStat.Max;
|
||||
|
||||
if (ErrorFlagsComp != null) tstRslt.ErrorFlags = ErrorFlagsComp.GetErrorFlags();
|
||||
|
||||
///
|
||||
/// Single meters
|
||||
///
|
||||
@ -398,8 +400,9 @@ namespace TBF.BenchControl.TestMethods.Endurance
|
||||
|
||||
meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter, meterRslt.VolumeRef);
|
||||
meterRslt.Passed = (meterRslt.Error >= test.ErrLimLo + test.Uncertainty)
|
||||
&& (meterRslt.Error <= test.ErrLimHi - test.Uncertainty);
|
||||
meterRslt.TestDone = true;
|
||||
&& (meterRslt.Error <= test.ErrLimHi - test.Uncertainty)
|
||||
&& (tstRslt.ErrorFlags == 0 || tstRslt.ErrorFlagsMode() != Config.Entities.ErrorFlagsMode.On);
|
||||
meterRslt.TestDone = true;
|
||||
tstRslt.TestDone = true;
|
||||
|
||||
if (iPerl != null)
|
||||
|
||||
@ -528,6 +528,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
||||
tstRslt.FlowMin = (float)RefFlowStat.Min;
|
||||
tstRslt.FlowMax = (float)RefFlowStat.Max;
|
||||
|
||||
if (ErrorFlagsComp != null) tstRslt.ErrorFlags = ErrorFlagsComp.GetErrorFlags();
|
||||
|
||||
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
|
||||
{
|
||||
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
|
||||
@ -547,7 +549,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
||||
meterRslt.TestTime = tstRslt.TestTime;
|
||||
meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter, meterRslt.VolumeRef);
|
||||
meterRslt.Passed = (meterRslt.Error >= test.ErrLimLo + test.Uncertainty)
|
||||
&& (meterRslt.Error <= test.ErrLimHi - test.Uncertainty);
|
||||
&& (meterRslt.Error <= test.ErrLimHi - test.Uncertainty)
|
||||
&& (tstRslt.ErrorFlags == 0 || tstRslt.ErrorFlagsMode() != Config.Entities.ErrorFlagsMode.On);
|
||||
meterRslt.TestDone = true;
|
||||
tstRslt.TestDone = true;
|
||||
}
|
||||
|
||||
@ -881,6 +881,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
||||
tstRslt.FlowMin = (float)RefFlowStat.Min;
|
||||
tstRslt.FlowMax = (float)RefFlowStat.Max;
|
||||
|
||||
if (ErrorFlagsComp != null) tstRslt.ErrorFlags = ErrorFlagsComp.GetErrorFlags();
|
||||
|
||||
if (compound)
|
||||
{
|
||||
///
|
||||
@ -922,8 +924,9 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
||||
compoundMeterRslt.TestTime = tstRslt.TestTime;
|
||||
compoundMeterRslt.Error = Formulas.ErrorFromVolumes(compoundMeterRslt.VolumeMeter, compoundMeterRslt.VolumeRef);
|
||||
compoundMeterRslt.Passed = (compoundMeterRslt.Error >= test.ErrLimLo + test.Uncertainty)
|
||||
&& (compoundMeterRslt.Error <= test.ErrLimHi - test.Uncertainty);
|
||||
mainMeterRslt.Passed = auxMeterRslt.Passed = compoundMeterRslt.Passed;
|
||||
&& (compoundMeterRslt.Error <= test.ErrLimHi - test.Uncertainty)
|
||||
&& (tstRslt.ErrorFlags == 0 || tstRslt.ErrorFlagsMode() != Config.Entities.ErrorFlagsMode.On);
|
||||
mainMeterRslt.Passed = auxMeterRslt.Passed = compoundMeterRslt.Passed;
|
||||
mainMeterRslt.TestDone = auxMeterRslt.TestDone = compoundMeterRslt.TestDone = true;
|
||||
tstRslt.TestDone = true;
|
||||
}
|
||||
@ -974,7 +977,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
||||
volumeRslt.Error = Formulas.ErrorFromVolumes(volumeRslt.VolumeMeter, volumeRslt.VolumeRef);
|
||||
volumeRslt.Passed = !heatMetersTestParams.EvaluateVolume ||
|
||||
((volumeRslt.Error >= test.ErrLimLo + test.Uncertainty) &&
|
||||
(volumeRslt.Error <= test.ErrLimHi - test.Uncertainty));
|
||||
(volumeRslt.Error <= test.ErrLimHi - test.Uncertainty) &&
|
||||
(tstRslt.ErrorFlags == 0 || tstRslt.ErrorFlagsMode() != Config.Entities.ErrorFlagsMode.On));
|
||||
volumeRslt.TestDone = true;
|
||||
tstRslt.TestDone = true;
|
||||
}
|
||||
@ -991,7 +995,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
||||
|
||||
energyRslt.Error = Formulas.ErrorFromVolumes(energyRslt.VolumeMeter, energyRslt.VolumeRef);
|
||||
energyRslt.Passed = (energyRslt.Error >= heatMetersTestParams.ErrorLimitLo)
|
||||
&& (energyRslt.Error <= heatMetersTestParams.ErrorLimitHi);
|
||||
&& (energyRslt.Error <= heatMetersTestParams.ErrorLimitHi)
|
||||
&& (tstRslt.ErrorFlags == 0 || tstRslt.ErrorFlagsMode() != Config.Entities.ErrorFlagsMode.On);
|
||||
energyRslt.TestDone = true;
|
||||
tstRslt.TestDone = true;
|
||||
}
|
||||
@ -1021,8 +1026,9 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
||||
meterRslt.TestTime = tstRslt.TestTime;
|
||||
meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter, meterRslt.VolumeRef);
|
||||
meterRslt.Passed = (meterRslt.Error >= test.ErrLimLo + test.Uncertainty)
|
||||
&& (meterRslt.Error <= test.ErrLimHi - test.Uncertainty);
|
||||
meterRslt.TestDone = true;
|
||||
&& (meterRslt.Error <= test.ErrLimHi - test.Uncertainty)
|
||||
&& (tstRslt.ErrorFlags == 0 || tstRslt.ErrorFlagsMode() != Config.Entities.ErrorFlagsMode.On);
|
||||
meterRslt.TestDone = true;
|
||||
tstRslt.TestDone = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -466,6 +466,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
|
||||
tstRslt.FlowMin = (float)RefFlowStat.Min;
|
||||
tstRslt.FlowMax = (float)RefFlowStat.Max;
|
||||
|
||||
if (ErrorFlagsComp != null) tstRslt.ErrorFlags = ErrorFlagsComp.GetErrorFlags();
|
||||
|
||||
if (compoundTestParams != null)
|
||||
{
|
||||
///
|
||||
@ -518,7 +520,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
|
||||
volumeRslt.Error = Formulas.ErrorFromVolumes(volumeRslt.VolumeMeter, volumeRslt.VolumeRef);
|
||||
volumeRslt.Passed = !heatMetersTestParams.EvaluateVolume ||
|
||||
((volumeRslt.Error >= test.ErrLimLo + test.Uncertainty) &&
|
||||
(volumeRslt.Error <= test.ErrLimHi - test.Uncertainty));
|
||||
(volumeRslt.Error <= test.ErrLimHi - test.Uncertainty) &&
|
||||
(tstRslt.ErrorFlags == 0 || tstRslt.ErrorFlagsMode() != Config.Entities.ErrorFlagsMode.On));
|
||||
volumeRslt.TestDone = true;
|
||||
tstRslt.TestDone = true;
|
||||
}
|
||||
@ -536,7 +539,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
|
||||
|
||||
energyRslt.Error = Formulas.ErrorFromVolumes(energyRslt.VolumeMeter, energyRslt.VolumeRef);
|
||||
energyRslt.Passed = (energyRslt.Error >= heatMetersTestParams.ErrorLimitLo)
|
||||
&& (energyRslt.Error <= heatMetersTestParams.ErrorLimitHi);
|
||||
&& (energyRslt.Error <= heatMetersTestParams.ErrorLimitHi)
|
||||
&& (tstRslt.ErrorFlags == 0 || tstRslt.ErrorFlagsMode() != Config.Entities.ErrorFlagsMode.On);
|
||||
energyRslt.TestDone = true;
|
||||
tstRslt.TestDone = true;
|
||||
}
|
||||
@ -605,7 +609,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
|
||||
|
||||
meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter, meterRslt.VolumeRef);
|
||||
meterRslt.Passed = (meterRslt.Error >= test.ErrLimLo + test.Uncertainty)
|
||||
&& (meterRslt.Error <= test.ErrLimHi - test.Uncertainty);
|
||||
&& (meterRslt.Error <= test.ErrLimHi - test.Uncertainty)
|
||||
&& (tstRslt.ErrorFlags == 0 || tstRslt.ErrorFlagsMode() != Config.Entities.ErrorFlagsMode.On);
|
||||
meterRslt.TestDone = true;
|
||||
tstRslt.TestDone = true;
|
||||
}
|
||||
|
||||
@ -786,6 +786,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
tstRslt.FlowMin = (float)RefFlowStat.Min;
|
||||
tstRslt.FlowMax = (float)RefFlowStat.Max;
|
||||
|
||||
if (ErrorFlagsComp != null) tstRslt.ErrorFlags = ErrorFlagsComp.GetErrorFlags();
|
||||
|
||||
if (compoundTestParams != null)
|
||||
{
|
||||
///
|
||||
@ -836,7 +838,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
compoundMeterRslt.TestTime = tstRslt.TestTime;
|
||||
compoundMeterRslt.Error = Formulas.ErrorFromVolumes(compoundMeterRslt.VolumeMeter, compoundMeterRslt.VolumeRef);
|
||||
compoundMeterRslt.Passed = (compoundMeterRslt.Error >= test.ErrLimLo + test.Uncertainty)
|
||||
&& (compoundMeterRslt.Error <= test.ErrLimHi - test.Uncertainty);
|
||||
&& (compoundMeterRslt.Error <= test.ErrLimHi - test.Uncertainty)
|
||||
&& (tstRslt.ErrorFlags == 0 || tstRslt.ErrorFlagsMode() != Config.Entities.ErrorFlagsMode.On);
|
||||
mainMeterRslt.Passed = auxMeterRslt.Passed = compoundMeterRslt.Passed;
|
||||
mainMeterRslt.TestDone = auxMeterRslt.TestDone = compoundMeterRslt.TestDone = true;
|
||||
tstRslt.TestDone = true;
|
||||
@ -888,7 +891,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
volumeRslt.Error = Formulas.ErrorFromVolumes(volumeRslt.VolumeMeter, volumeRslt.VolumeRef);
|
||||
volumeRslt.Passed = !heatMetersTestParams.EvaluateVolume ||
|
||||
((volumeRslt.Error >= test.ErrLimLo + test.Uncertainty) &&
|
||||
(volumeRslt.Error <= test.ErrLimHi - test.Uncertainty));
|
||||
(volumeRslt.Error <= test.ErrLimHi - test.Uncertainty) &&
|
||||
(tstRslt.ErrorFlags == 0 || tstRslt.ErrorFlagsMode() != Config.Entities.ErrorFlagsMode.On));
|
||||
volumeRslt.TestDone = true;
|
||||
tstRslt.TestDone = true;
|
||||
}
|
||||
@ -906,7 +910,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
|
||||
energyRslt.Error = Formulas.ErrorFromVolumes(energyRslt.VolumeMeter, energyRslt.VolumeRef);
|
||||
energyRslt.Passed = (energyRslt.Error >= heatMetersTestParams.ErrorLimitLo)
|
||||
&& (energyRslt.Error <= heatMetersTestParams.ErrorLimitHi);
|
||||
&& (energyRslt.Error <= heatMetersTestParams.ErrorLimitHi)
|
||||
&& (tstRslt.ErrorFlags == 0 || tstRslt.ErrorFlagsMode() != Config.Entities.ErrorFlagsMode.On);
|
||||
energyRslt.TestDone = true;
|
||||
tstRslt.TestDone = true;
|
||||
}
|
||||
@ -976,7 +981,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
|
||||
meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter, meterRslt.VolumeRef);
|
||||
meterRslt.Passed = (meterRslt.Error >= test.ErrLimLo + test.Uncertainty)
|
||||
&& (meterRslt.Error <= test.ErrLimHi - test.Uncertainty);
|
||||
&& (meterRslt.Error <= test.ErrLimHi - test.Uncertainty)
|
||||
&& (tstRslt.ErrorFlags == 0 || tstRslt.ErrorFlagsMode() != Config.Entities.ErrorFlagsMode.On);
|
||||
meterRslt.TestDone = true;
|
||||
tstRslt.TestDone = true;
|
||||
}
|
||||
|
||||
@ -329,6 +329,8 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
|
||||
tstRslt.FlowMin = (float)RefFlowStat.Min;
|
||||
tstRslt.FlowMax = (float)RefFlowStat.Max;
|
||||
|
||||
if (ErrorFlagsComp != null) tstRslt.ErrorFlags = ErrorFlagsComp.GetErrorFlags();
|
||||
|
||||
/// Update flowmeter constant with the measured one
|
||||
if (outPath.FlowMeter.Idx1 > 0 && outPath.FlowMeter.Idx1 <= ReferenceFlowmetersCount)
|
||||
{
|
||||
|
||||
82
TestBenchFramework/BenchControl/Various/ErrorFlags/Errors.cs
Normal file
82
TestBenchFramework/BenchControl/Various/ErrorFlags/Errors.cs
Normal file
@ -0,0 +1,82 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
|
||||
namespace TBF.BenchControl.Various.ErrorFlags
|
||||
{
|
||||
public class Errors : ComponentBase, GenericDevices.IErrorFlags
|
||||
{
|
||||
/// TODO: Implement support for sharing one camera by multiple ROI-s
|
||||
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(Errors));
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("{0}({1})", this.GetType().Namespace.Substring(17), Cfg.ToString(1));
|
||||
}
|
||||
|
||||
///
|
||||
/// Cfg
|
||||
///
|
||||
readonly ErrorsCfg errorsCfg;
|
||||
|
||||
public ErrorFlagsMode Mode { get { return errorsCfg.TestParams.Mode; } }
|
||||
|
||||
public int GetErrorFlags()
|
||||
{
|
||||
if (Mode != ErrorFlagsMode.Info && Mode != ErrorFlagsMode.On) return 0; /// return 0 when Mode == ErrorFlagsMode.Off
|
||||
|
||||
/// TODO : Return real error conditions
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public Errors()
|
||||
{
|
||||
}
|
||||
|
||||
public Errors(Generic.IComponentCfg cfg, IList<Generic.IComponent> components)
|
||||
: base(cfg)
|
||||
{
|
||||
errorsCfg = cfg as ErrorsCfg;
|
||||
|
||||
StartChangeHandler();
|
||||
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
#region Configuration Change Handling
|
||||
|
||||
public static void OnCfgChange(object sender, CfgChangeArgs args)
|
||||
{
|
||||
if (CfgChangeHandler == null) return;
|
||||
try { CfgChangeHandler(sender, args); }
|
||||
catch (Exception e) { log.Error("CfgChangeHandler(...) failed", e); }
|
||||
}
|
||||
|
||||
public static event EventHandler<CfgChangeArgs> CfgChangeHandler;
|
||||
|
||||
public override void StartChangeHandler()
|
||||
{
|
||||
CfgChangeHandler += delegate(object sender, CfgChangeArgs args)
|
||||
{
|
||||
ErrorsCfg tmpcfg = args.Cfg as ErrorsCfg;
|
||||
if (tmpcfg != null && tmpcfg.Name.Equals(Name))
|
||||
{
|
||||
if (args.Command == CfgChangeCmd.CfgChange)
|
||||
{
|
||||
//errorsCfg.BlackAndWhite = tmpcfg.BlackAndWhite;
|
||||
//errorsCfg.LowResolution = tmpcfg.LowResolution;
|
||||
//errorsCfg.ImageRotation = tmpcfg.ImageRotation;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endregion Configuration Change Handling
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,50 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
using System.Xml.Serialization;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.Various.ErrorFlags
|
||||
{
|
||||
public class ErrorsCfg : ComponentCfgBase, IComponentCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ErrorsCfg) })[0];
|
||||
protected override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new ErrorsCfgCtrl(); }
|
||||
|
||||
///
|
||||
/// Serialized parameters
|
||||
///
|
||||
|
||||
/// <summary> Test parameters </summary>
|
||||
[XmlIgnore]
|
||||
public TestParams TestParams;
|
||||
public override IParamsProvider GetTestParams() { return TestParams; }
|
||||
public override IParamsProvider CreateTestParams(Test test)
|
||||
{
|
||||
TestParams procParams = new TestParams(true);
|
||||
procParams.UpdateTestParams(Name, test);
|
||||
return procParams;
|
||||
}
|
||||
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
ErrorsCfg()
|
||||
{
|
||||
TestParams = new TestParams(true);
|
||||
}
|
||||
|
||||
public ErrorsCfg(string name, IComponentFactory factory)
|
||||
: this()
|
||||
{
|
||||
Name = name;
|
||||
Factory = factory;
|
||||
}
|
||||
|
||||
public string ToString(int i)
|
||||
{
|
||||
return string.Format("{0}", Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,105 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.BenchControl.Various.ErrorFlags
|
||||
{
|
||||
public partial class ErrorsCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(ErrorsCfgCtrl));
|
||||
|
||||
ComponentParametersDlg parent;
|
||||
|
||||
public bool ShowMore { get { return false; } }
|
||||
|
||||
ErrorsCfg config;
|
||||
public IComponentCfg Config
|
||||
{
|
||||
get { return config as IComponentCfg; }
|
||||
set
|
||||
{
|
||||
config = value as ErrorsCfg;
|
||||
Redraw();
|
||||
}
|
||||
}
|
||||
|
||||
public ErrorsCfgCtrl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void PumpCfgCtrl_Load(object sender, EventArgs e)
|
||||
{
|
||||
parent = ParentForm as ComponentParametersDlg;
|
||||
if (parent == null) return;
|
||||
|
||||
Redraw();
|
||||
}
|
||||
|
||||
public void Closing()
|
||||
{
|
||||
}
|
||||
|
||||
void Redraw()
|
||||
{
|
||||
if (config == null) return; /// Control was not loaded, settings were not changed
|
||||
|
||||
classNameLabel.Text = config.Factory.ClassName;
|
||||
nameTextBox.Text = config.Name;
|
||||
}
|
||||
|
||||
public void Unlock()
|
||||
{
|
||||
nameTextBox.Enabled = true;
|
||||
}
|
||||
|
||||
public CfgUpdateFlags VerifyCfg(ref string message)
|
||||
{
|
||||
CfgUpdateFlags flags = CfgUpdateFlags.None;
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
public CfgUpdateFlags UpdateCfg()
|
||||
{
|
||||
CfgUpdateFlags flags = CfgUpdateFlags.None;
|
||||
|
||||
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
|
||||
|
||||
if (config.Name != nameTextBox.Text)
|
||||
{
|
||||
config.Name = nameTextBox.Text;
|
||||
flags |= (CfgUpdateFlags.RestartRqrd | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
|
||||
if ((flags & CfgUpdateFlags.InvokeCfgChange) != 0)
|
||||
{
|
||||
Errors.OnCfgChange(this, new CfgChangeArgs(CfgChangeCmd.CfgChange, Config));
|
||||
}
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
#region Configuration Change Handling
|
||||
|
||||
public static void OnCmdResponse(object sender, CmdResponseArgs args)
|
||||
{
|
||||
if (CmdResponseHandler == null) return;
|
||||
try { CmdResponseHandler(sender, args); }
|
||||
catch (Exception e) { log.Error("CmdResponseHandler(...) failed", e); }
|
||||
}
|
||||
|
||||
public static event EventHandler<CmdResponseArgs> CmdResponseHandler;
|
||||
|
||||
public void StartResponseHandler() { }
|
||||
public void StopResponseHandler() { }
|
||||
|
||||
#endregion Configuration Change Handling
|
||||
}
|
||||
}
|
||||
109
TestBenchFramework/BenchControl/Various/ErrorFlags/ErrorsCfgCtrl.designer.cs
generated
Normal file
109
TestBenchFramework/BenchControl/Various/ErrorFlags/ErrorsCfgCtrl.designer.cs
generated
Normal file
@ -0,0 +1,109 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
namespace TBF.BenchControl.Various.ErrorFlags
|
||||
{
|
||||
partial class ErrorsCfgCtrl
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.nameTextBox = new System.Windows.Forms.TextBox();
|
||||
this.nameLabel = new System.Windows.Forms.Label();
|
||||
this.classNameLabel = new System.Windows.Forms.Label();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// nameTextBox
|
||||
//
|
||||
this.nameTextBox.Enabled = false;
|
||||
this.nameTextBox.Location = new System.Drawing.Point(115, 49);
|
||||
this.nameTextBox.Name = "nameTextBox";
|
||||
this.nameTextBox.Size = new System.Drawing.Size(174, 20);
|
||||
this.nameTextBox.TabIndex = 2;
|
||||
//
|
||||
// nameLabel
|
||||
//
|
||||
this.nameLabel.AutoSize = true;
|
||||
this.nameLabel.Location = new System.Drawing.Point(20, 52);
|
||||
this.nameLabel.Name = "nameLabel";
|
||||
this.nameLabel.Size = new System.Drawing.Size(35, 13);
|
||||
this.nameLabel.TabIndex = 1;
|
||||
this.nameLabel.Text = "Name";
|
||||
//
|
||||
// classNameLabel
|
||||
//
|
||||
this.classNameLabel.AutoSize = true;
|
||||
this.classNameLabel.Location = new System.Drawing.Point(112, 26);
|
||||
this.classNameLabel.Name = "classNameLabel";
|
||||
this.classNameLabel.Size = new System.Drawing.Size(114, 13);
|
||||
this.classNameLabel.TabIndex = 0;
|
||||
this.classNameLabel.Text = "ComponentClassName";
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(-211, -147);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(57, 13);
|
||||
this.label1.TabIndex = 5;
|
||||
this.label1.Text = "Arguments";
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
this.textBox1.Enabled = false;
|
||||
this.textBox1.Location = new System.Drawing.Point(-125, -150);
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.Size = new System.Drawing.Size(372, 20);
|
||||
this.textBox1.TabIndex = 6;
|
||||
//
|
||||
// ErrorsCfgCtrl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.textBox1);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.nameTextBox);
|
||||
this.Controls.Add(this.nameLabel);
|
||||
this.Controls.Add(this.classNameLabel);
|
||||
this.Name = "ErrorsCfgCtrl";
|
||||
this.Size = new System.Drawing.Size(500, 300);
|
||||
this.Load += new System.EventHandler(this.PumpCfgCtrl_Load);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TextBox nameTextBox;
|
||||
private System.Windows.Forms.Label nameLabel;
|
||||
private System.Windows.Forms.Label classNameLabel;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.TextBox textBox1;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@ -0,0 +1,26 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
using System.Collections.Generic;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.Various.ErrorFlags
|
||||
{
|
||||
public class Factory : IComponentFactory
|
||||
{
|
||||
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
|
||||
|
||||
public void ResetStaticProperties() { Errors.ResetStaticProperties(); }
|
||||
|
||||
public IComponent DummyComponent() { return new Errors(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Errors(cfg, components); }
|
||||
|
||||
public IComponentCfg DefaultConfig() { return new ErrorsCfg(this.GetType().Namespace.Substring(25), this); }
|
||||
|
||||
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
|
||||
{
|
||||
return ComponentCfgBase.CreateFromDbEntity(ErrorsCfg.Serializer, component, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
319
TestBenchFramework/BenchControl/Various/ErrorFlags/TestParams.cs
Normal file
319
TestBenchFramework/BenchControl/Various/ErrorFlags/TestParams.cs
Normal file
@ -0,0 +1,319 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
using System.IO;
|
||||
using System.Xml.Serialization;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.BenchControl.Various.ErrorFlags
|
||||
{
|
||||
public class TestParams : TestParamsBase, IParamsProvider, ITestParams
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestParams) })[0];
|
||||
protected override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public ErrorFlagsMode Mode; /// 0 = Off, 1 = Info (show only), 2 = On (show and evaluate)
|
||||
public bool E1;
|
||||
public bool E2;
|
||||
public bool E3;
|
||||
public bool E4;
|
||||
public bool E5;
|
||||
public bool E6;
|
||||
public bool E7;
|
||||
public bool E8;
|
||||
public bool E9;
|
||||
public bool E10;
|
||||
public bool E11;
|
||||
public bool E12;
|
||||
public bool E13;
|
||||
public bool E14;
|
||||
public bool E15;
|
||||
public bool E16;
|
||||
|
||||
public float Delta_Q_pct; /// [%] max deviation from the mean flow
|
||||
public float Delta_T; /// [°C] max. T_up or T_down deviation from the mean temperature
|
||||
public float Delta_Tup_Tdn; /// [°C] max. difference abs(T_up - T_down)
|
||||
public float TestTime_min; /// [s]
|
||||
public float TestTime_max; /// [s]
|
||||
|
||||
public float Coef_E9; /// Coefficient used in E9, default 0.025
|
||||
public float Coef_E10; /// Coefficient used in E10, default 0.04
|
||||
public float Coef_E11; /// Coefficient used in E11, default 0.1
|
||||
public float Coef_E12; /// Coefficient used in E12, default 1
|
||||
|
||||
public override void InitializeAll()
|
||||
{
|
||||
Mode = ErrorFlagsMode.On;
|
||||
E1 = true;
|
||||
E2 = true;
|
||||
E3 = true;
|
||||
E4 = true;
|
||||
E5 = true;
|
||||
E6 = true;
|
||||
E7 = true;
|
||||
E8 = true;
|
||||
E9 = true;
|
||||
E10 = true;
|
||||
E11 = true;
|
||||
E12 = true;
|
||||
E13 = true;
|
||||
E14 = true;
|
||||
E15 = true;
|
||||
E16 = true;
|
||||
|
||||
Delta_Q_pct = 2.5f; /// [%]
|
||||
Delta_T = 10.0f; /// [°C]
|
||||
Delta_Tup_Tdn = 10.0f; /// [°C]
|
||||
TestTime_min = 0; /// [s]
|
||||
TestTime_max = 99999; /// [s]
|
||||
///
|
||||
Coef_E9 = 0.025f;
|
||||
Coef_E10 = 0.04f;
|
||||
Coef_E11 = 0.1f;
|
||||
Coef_E12 = 1.0f;
|
||||
}
|
||||
|
||||
string[] paramNames = new string[]
|
||||
{
|
||||
Strings.Mode,
|
||||
"E1",
|
||||
"E2",
|
||||
"E3",
|
||||
"E4",
|
||||
"E5",
|
||||
"E6",
|
||||
"E7",
|
||||
"E8",
|
||||
"E9",
|
||||
"E10",
|
||||
"E11",
|
||||
"E12",
|
||||
"E13",
|
||||
"E14",
|
||||
"E15",
|
||||
"E16",
|
||||
|
||||
"Delta Q",
|
||||
"Delta T",
|
||||
"max. Abs(Tup - Tdn)",
|
||||
string.Format("min. {0}", Strings.Test_time_s_chdr),
|
||||
string.Format("max. {0}", Strings.Test_time_s_chdr),
|
||||
|
||||
"Coef.E9",
|
||||
"Coef.E10",
|
||||
"Coef.E11",
|
||||
"Coef.E12"
|
||||
};
|
||||
public override string ParamName(int i) { return paramNames[i]; }
|
||||
public override int ParamsCount() { return paramNames.Length; }
|
||||
|
||||
public override string ToString(int i)
|
||||
{
|
||||
switch (i)
|
||||
{
|
||||
case 0: return Mode.ToDescription();
|
||||
case 1: return (E1 ? Strings.yes : Strings.no);
|
||||
case 2: return (E2 ? Strings.yes : Strings.no);
|
||||
case 3: return (E3 ? Strings.yes : Strings.no);
|
||||
case 4: return (E4 ? Strings.yes : Strings.no);
|
||||
case 5: return (E5 ? Strings.yes : Strings.no);
|
||||
case 6: return (E6 ? Strings.yes : Strings.no);
|
||||
case 7: return (E7 ? Strings.yes : Strings.no);
|
||||
case 8: return (E8 ? Strings.yes : Strings.no);
|
||||
case 9: return (E9 ? Strings.yes : Strings.no);
|
||||
case 10: return (E10 ? Strings.yes : Strings.no);
|
||||
case 11: return (E11 ? Strings.yes : Strings.no);
|
||||
case 12: return (E12 ? Strings.yes : Strings.no);
|
||||
case 13: return (E13 ? Strings.yes : Strings.no);
|
||||
case 14: return (E14 ? Strings.yes : Strings.no);
|
||||
case 15: return (E15 ? Strings.yes : Strings.no);
|
||||
case 16: return (E16 ? Strings.yes : Strings.no);
|
||||
|
||||
case 17: return Delta_Q_pct.ToString();
|
||||
case 18: return Delta_T.ToString();
|
||||
case 19: return Delta_Tup_Tdn.ToString();
|
||||
case 20: return TestTime_min.ToString();
|
||||
case 21: return TestTime_max.ToString();
|
||||
case 22: return Coef_E9.ToString();
|
||||
case 23: return Coef_E10.ToString();
|
||||
case 24: return Coef_E11.ToString();
|
||||
case 25: return Coef_E12.ToString();
|
||||
|
||||
default: return string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
/// Retrieves parameters from UI controls
|
||||
public void UpdateParam(int i, string strValue)
|
||||
{
|
||||
switch (i)
|
||||
{
|
||||
case 0:
|
||||
for (ErrorFlagsMode m = 0; m < ErrorFlagsMode.Count; m++)
|
||||
{
|
||||
if (m.ToDescription() == strValue)
|
||||
{
|
||||
Mode = m;
|
||||
return;
|
||||
}
|
||||
}
|
||||
return;
|
||||
case 1: E1 = (strValue == Strings.yes); return;
|
||||
case 2: E2 = (strValue == Strings.yes); return;
|
||||
case 3: E3 = (strValue == Strings.yes); return;
|
||||
case 4: E4 = (strValue == Strings.yes); return;
|
||||
case 5: E5 = (strValue == Strings.yes); return;
|
||||
case 6: E6 = (strValue == Strings.yes); return;
|
||||
case 7: E7 = (strValue == Strings.yes); return;
|
||||
case 8: E8 = (strValue == Strings.yes); return;
|
||||
case 9: E9 = (strValue == Strings.yes); return;
|
||||
case 10: E10 = (strValue == Strings.yes); return;
|
||||
case 11: E11 = (strValue == Strings.yes); return;
|
||||
case 12: E12 = (strValue == Strings.yes); return;
|
||||
case 13: E13 = (strValue == Strings.yes); return;
|
||||
case 14: E14 = (strValue == Strings.yes); return;
|
||||
case 15: E15 = (strValue == Strings.yes); return;
|
||||
case 16: E16 = (strValue == Strings.yes); return;
|
||||
|
||||
case 17: Delta_Q_pct = Utils.ParseUFloat(strValue); return;
|
||||
case 18: Delta_T = Utils.ParseUFloat(strValue); return;
|
||||
case 19: Delta_Tup_Tdn = Utils.ParseUFloat(strValue); return;
|
||||
case 20: TestTime_min = Utils.ParseUFloat(strValue); return;
|
||||
case 21: TestTime_max = Utils.ParseUFloat(strValue); return;
|
||||
case 22: Coef_E9 = Utils.ParseUFloat(strValue); return;
|
||||
case 23: Coef_E10 = Utils.ParseUFloat(strValue); return;
|
||||
case 24: Coef_E11 = Utils.ParseUFloat(strValue); return;
|
||||
case 25: Coef_E12 = Utils.ParseUFloat(strValue); return;
|
||||
|
||||
default: return;
|
||||
}
|
||||
}
|
||||
|
||||
/// Verifies whether strings in UI controls represent valid parameters
|
||||
public bool ValidateParam(int i, string strValue, out string message)
|
||||
{
|
||||
message = string.Empty;
|
||||
|
||||
float fdummy;
|
||||
switch (i)
|
||||
{
|
||||
case 0:
|
||||
for (ErrorFlagsMode m = 0; m < ErrorFlagsMode.Count; m++)
|
||||
{
|
||||
if (m.ToDescription() == strValue) return true;
|
||||
}
|
||||
break;
|
||||
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
case 9:
|
||||
case 10:
|
||||
case 11:
|
||||
case 12:
|
||||
case 13:
|
||||
case 14:
|
||||
case 15:
|
||||
case 16:
|
||||
if (strValue == Strings.yes || strValue == Strings.no) return true;
|
||||
break;
|
||||
|
||||
case 17:
|
||||
case 18:
|
||||
case 19:
|
||||
case 20:
|
||||
case 21:
|
||||
case 22:
|
||||
case 23:
|
||||
case 24:
|
||||
case 25:
|
||||
if (Utils.TryParseUFloat(strValue, out fdummy)) return true;
|
||||
break;
|
||||
|
||||
default:
|
||||
message = "Invalid index";
|
||||
return false;
|
||||
}
|
||||
|
||||
message = ParamName(i) + " is invalid";
|
||||
return false;
|
||||
}
|
||||
|
||||
void CopyContentTo(TestParams prms)
|
||||
{
|
||||
prms.Mode = this.Mode;
|
||||
prms.E1 = this.E1;
|
||||
prms.E2 = this.E2;
|
||||
prms.E3 = this.E3;
|
||||
prms.E4 = this.E4;
|
||||
prms.E5 = this.E5;
|
||||
prms.E6 = this.E6;
|
||||
prms.E7 = this.E7;
|
||||
prms.E8 = this.E8;
|
||||
prms.E9 = this.E9;
|
||||
prms.E10 = this.E10;
|
||||
prms.E11 = this.E11;
|
||||
prms.E12 = this.E12;
|
||||
prms.E13 = this.E13;
|
||||
prms.E14 = this.E14;
|
||||
prms.E15 = this.E15;
|
||||
prms.E16 = this.E16;
|
||||
|
||||
prms.Delta_Q_pct = this.Delta_Q_pct;
|
||||
prms.Delta_T = this.Delta_T;
|
||||
prms.Delta_Tup_Tdn = this.Delta_Tup_Tdn;
|
||||
prms.TestTime_min = this.TestTime_min;
|
||||
prms.TestTime_max = this.TestTime_max;
|
||||
prms.Coef_E9 = this.Coef_E9;
|
||||
prms.Coef_E10 = this.Coef_E10;
|
||||
prms.Coef_E11 = this.Coef_E11;
|
||||
prms.Coef_E12 = this.Coef_E12;
|
||||
}
|
||||
|
||||
public IParamsProvider Clone()
|
||||
{
|
||||
TestParams pars = new TestParams();
|
||||
CopyContentTo(pars);
|
||||
return pars;
|
||||
}
|
||||
|
||||
public override void UpdateTestParams(ComponentTest dbEntity)
|
||||
{
|
||||
if (dbEntity == null) return;
|
||||
try
|
||||
{
|
||||
TestParams tmp = Serializer.Deserialize(new StringReader(dbEntity.Parameters)) as TestParams;
|
||||
|
||||
testParamsEntity = dbEntity;
|
||||
componentName = dbEntity.CmpntName;
|
||||
test = dbEntity.Test;
|
||||
|
||||
if (tmp != null) tmp.CopyContentTo(this);
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public TestParams() { }
|
||||
|
||||
public TestParams(bool initialize)
|
||||
{
|
||||
if (initialize) InitializeAll();
|
||||
}
|
||||
|
||||
public TestParams(ComponentProcedure procedureParamsEntity, string componentName, Test test)
|
||||
{
|
||||
this.testParamsEntity = testParamsEntity;
|
||||
this.componentName = componentName;
|
||||
this.test = test;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("2.15.642.1")]
|
||||
[assembly: AssemblyFileVersion("2.15.642.1")]
|
||||
[assembly: AssemblyVersion("2.16.642.1")]
|
||||
[assembly: AssemblyFileVersion("2.16.642.1")]
|
||||
|
||||
@ -501,6 +501,7 @@
|
||||
<Compile Include="BenchControl\Elde\ValveEx\ValveFactory.cs" />
|
||||
<Compile Include="BenchControl\GenericDevices\ICameraDisplay.cs" />
|
||||
<Compile Include="BenchControl\GenericDevices\IDataEntryForCamera.cs" />
|
||||
<Compile Include="BenchControl\GenericDevices\IErrorFlags.cs" />
|
||||
<Compile Include="BenchControl\GenericDevices\IRoiForFixedStart.cs" />
|
||||
<Compile Include="BenchControl\GenericDevices\IScaleCfg.cs" />
|
||||
<Compile Include="BenchControl\GenericDevices\ICalibInfoCfg.cs" />
|
||||
@ -954,6 +955,16 @@
|
||||
<Compile Include="BenchControl\TestMethods\OuterLoop\End\Factory.cs" />
|
||||
<Compile Include="BenchControl\TestMethods\OuterLoop\Start\Component.cs" />
|
||||
<Compile Include="BenchControl\TestMethods\OuterLoop\Start\Factory.cs" />
|
||||
<Compile Include="BenchControl\Various\ErrorFlags\Factory.cs" />
|
||||
<Compile Include="BenchControl\Various\ErrorFlags\TestParams.cs" />
|
||||
<Compile Include="BenchControl\Various\ErrorFlags\Errors.cs" />
|
||||
<Compile Include="BenchControl\Various\ErrorFlags\ErrorsCfg.cs" />
|
||||
<Compile Include="BenchControl\Various\ErrorFlags\ErrorsCfgCtrl.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="BenchControl\Various\ErrorFlags\ErrorsCfgCtrl.designer.cs">
|
||||
<DependentUpon>ErrorsCfgCtrl.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="BenchControl\WaterMeters\Munich\ProcParams.cs" />
|
||||
<Compile Include="BenchControl\WaterMeters\Munich\WaterMeter.cs" />
|
||||
<Compile Include="BenchControl\WaterMeters\Munich\WaterMeterCfg.cs" />
|
||||
@ -2197,6 +2208,9 @@
|
||||
<EmbeddedResource Include="BenchControl\TestMethods\PMaxTest\TestMethodCfgCtrl.resx">
|
||||
<DependentUpon>TestMethodCfgCtrl.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="BenchControl\Various\ErrorFlags\ErrorsCfgCtrl.resx">
|
||||
<DependentUpon>ErrorsCfgCtrl.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="BenchControl\WaterMeters\Munich\WaterMeterCfgCtrl.resx">
|
||||
<DependentUpon>WaterMeterCfgCtrl.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user