Calculated error limits for heat meter flow measurement testing, ver. 2.17.705

This commit is contained in:
Milan Hanajik
2017-10-18 10:52:15 +02:00
parent 21a329b1d3
commit 3822c6f5ab
15 changed files with 492 additions and 252 deletions
+51 -2
View File
@@ -25,8 +25,8 @@ namespace Config.Entities
public virtual float Volume { get; set; } /// Test volume (target) in [l] public virtual float Volume { get; set; } /// Test volume (target) in [l]
public virtual float TstTime { get; set; } /// Test time (estimate) in [s] public virtual float TstTime { get; set; } /// Test time (estimate) in [s]
public virtual string Method { get; set; } public virtual string Method { get; set; }
public virtual float ErrLimLo { get; set; } /// in [%] (usually < 0) public virtual float ErrLimLo { get; set; } /// in [%] (usually < 0) or 1=class1, 2=class2, 3=class3
public virtual float ErrLimHi { get; set; } /// in [%] (usually > 0) public virtual float ErrLimHi { get; set; } /// in [%] (usually > 0) or -Qn in m3/h
public virtual float Uncertainty { get; set; } /// int [%] makes error limits tighter: 0 <= Uncertainty <= abs(ErrLimXx) public virtual float Uncertainty { get; set; } /// int [%] makes error limits tighter: 0 <= Uncertainty <= abs(ErrLimXx)
public virtual int Repeats { get; set; } public virtual int Repeats { get; set; }
public virtual bool DoDraining { get; set; } public virtual bool DoDraining { get; set; }
@@ -301,6 +301,55 @@ namespace Config.Entities
return diff.ToString(); return diff.ToString();
} }
public virtual float GetErrLimLo(float flow)
{
if (ErrLimLo <= ErrLimHi)
{
return ErrLimLo; /// Error limit of a water meter
}
else
{
/// Metrological class and nominal flow of a heat meter
int metrClass = (int)Math.Round(ErrLimLo);
float Qp = Math.Abs(ErrLimHi);
float Q = Math.Max(flow, 0.00001f); /// to avoid division by zero
/// Calculate the error limit of a heat meter
switch (metrClass)
{
default:
case 1: return -Math.Min(3.5f, 1.0f + 0.01f * Qp / Q);
case 2: return -Math.Min(5.0f, 2.0f + 0.02f * Qp / Q);
case 3: return -Math.Min(5.0f, 3.0f + 0.05f * Qp / Q);
}
}
}
public virtual float GetErrLimHi(float flow)
{
if (ErrLimLo <= ErrLimHi)
{
return ErrLimHi; /// Error limit of a water meter
}
else
{
/// Metrological class and nominal flow of a heat meter
int metrClass = (int)Math.Round(ErrLimLo);
float Qp = Math.Abs(ErrLimHi);
float Q = Math.Max(flow, 0.00001f); /// to avoid division by zero
/// Calculate the error limit of a heat meter
switch (metrClass)
{
default:
case 1: return +Math.Min(3.5f, 1.0f + 0.01f * Qp / Q);
case 2: return +Math.Min(5.0f, 2.0f + 0.02f * Qp / Q);
case 3: return +Math.Min(5.0f, 3.0f + 0.05f * Qp / Q);
}
}
}
public override string ToString() public override string ToString()
{ {
string partStr = (Part > 0) ? string.Format(", part {0}", Part) : string.Empty; string partStr = (Part > 0) ? string.Format(", part {0}", Part) : string.Empty;
+2 -2
View File
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.17.700.0")] [assembly: AssemblyVersion("2.17.705.0")]
[assembly: AssemblyFileVersion("2.17.700.0")] [assembly: AssemblyFileVersion("2.17.705.0")]
+49 -2
View File
@@ -118,8 +118,55 @@ namespace Results.Entities
public virtual double TargetVolume() { return TestData.TargetVolume; } public virtual double TargetVolume() { return TestData.TargetVolume; }
public virtual double TargetTime() { return TestData.TargetTime; } public virtual double TargetTime() { return TestData.TargetTime; }
public virtual string Method() { return TestData.Method; } public virtual string Method() { return TestData.Method; }
public virtual double ErrLimLo() { return TestData.ErrLimLo; }
public virtual double ErrLimHi() { return TestData.ErrLimHi; } public virtual double ErrLimLo()
{
if (TestData.ErrLimLo <= TestData.ErrLimHi)
{
return TestData.ErrLimLo; /// Error limit of a water meter
}
else
{
/// Metrological class and nominal flow of a heat meter
int metrClass = (int)Math.Round(TestData.ErrLimLo);
double Qp = Math.Abs(TestData.ErrLimHi);
double Q = Math.Max(FlowMean, 0.00001); /// to avoid division by zero
/// Calculate the error limit of a heat meter
switch (metrClass)
{
default:
case 1: return -Math.Min(3.5, 1.0 + 0.01 * Qp / Q);
case 2: return -Math.Min(5.0, 2.0 + 0.02 * Qp / Q);
case 3: return -Math.Min(5.0, 3.0 + 0.05 * Qp / Q);
}
}
}
public virtual double ErrLimHi()
{
if (TestData.ErrLimLo <= TestData.ErrLimHi)
{
return TestData.ErrLimHi; /// Error limit of a water meter
}
else
{
/// Metrological class and nominal flow of a heat meter
int metrClass = (int)Math.Round(TestData.ErrLimLo);
double Qp = Math.Abs(TestData.ErrLimHi);
double Q = Math.Max(FlowMean, 0.00001); /// to avoid division by zero
/// Calculate the error limit of a heat meter
switch (metrClass)
{
default:
case 1: return +Math.Min(3.5, 1.0 + 0.01 * Qp / Q);
case 2: return +Math.Min(5.0, 2.0 + 0.02 * Qp / Q);
case 3: return +Math.Min(5.0, 3.0 + 0.05 * Qp / Q);
}
}
}
public virtual double Uncertainty() { return TestData.Uncertainty; } public virtual double Uncertainty() { return TestData.Uncertainty; }
public virtual float TempLimLo() { return TestData.TempLimLo; } public virtual float TempLimLo() { return TestData.TempLimLo; }
public virtual float TempLimHi() { return TestData.TempLimHi; } public virtual float TempLimHi() { return TestData.TempLimHi; }
+2 -2
View File
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.17.700.0")] [assembly: AssemblyVersion("2.17.705.0")]
[assembly: AssemblyFileVersion("2.17.700.0")] [assembly: AssemblyFileVersion("2.17.705.0")]
@@ -404,8 +404,8 @@ namespace TBF.BenchControl.TestMethods.Adjustment
meterRslt.VolumeRef = meterRslt.PulsesMaster * tstRslt.ConstMaster; /// liter meterRslt.VolumeRef = meterRslt.PulsesMaster * tstRslt.ConstMaster; /// liter
meterRslt.TestTime = tstRslt.TestTime; meterRslt.TestTime = tstRslt.TestTime;
meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter, meterRslt.VolumeRef); meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter, meterRslt.VolumeRef);
meterRslt.Passed = (meterRslt.Error >= test.ErrLimLo + test.Uncertainty) meterRslt.Passed = (meterRslt.Error >= test.GetErrLimLo(tstRslt.FlowMean) + test.Uncertainty)
&& (meterRslt.Error <= test.ErrLimHi - test.Uncertainty); && (meterRslt.Error <= test.GetErrLimHi(tstRslt.FlowMean) - test.Uncertainty);
meterRslt.TestDone = true; meterRslt.TestDone = true;
tstRslt.TestDone = true; tstRslt.TestDone = true;
} }
@@ -689,8 +689,8 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
compoundMeterRslt.PulsesMaster = tstRslt.PulsesMaster; compoundMeterRslt.PulsesMaster = tstRslt.PulsesMaster;
compoundMeterRslt.TestTime = tstRslt.TestTime; compoundMeterRslt.TestTime = tstRslt.TestTime;
compoundMeterRslt.Error = Formulas.ErrorFromVolumes(compoundMeterRslt.VolumeMeter, compoundMeterRslt.VolumeRef); compoundMeterRslt.Error = Formulas.ErrorFromVolumes(compoundMeterRslt.VolumeMeter, compoundMeterRslt.VolumeRef);
compoundMeterRslt.Passed = (compoundMeterRslt.Error >= test.ErrLimLo + test.Uncertainty) compoundMeterRslt.Passed = (compoundMeterRslt.Error >= test.GetErrLimLo(tstRslt.FlowMean) + test.Uncertainty)
&& (compoundMeterRslt.Error <= test.ErrLimHi - test.Uncertainty) && (compoundMeterRslt.Error <= test.GetErrLimHi(tstRslt.FlowMean) - test.Uncertainty)
&& (tstRslt.ErrorFlags == 0 || tstRslt.ErrorFlagsMode() != Config.Entities.ErrorFlagsMode.On); && (tstRslt.ErrorFlags == 0 || tstRslt.ErrorFlagsMode() != Config.Entities.ErrorFlagsMode.On);
mainMeterRslt.Passed = auxMeterRslt.Passed = compoundMeterRslt.Passed; mainMeterRslt.Passed = auxMeterRslt.Passed = compoundMeterRslt.Passed;
mainMeterRslt.TestDone = auxMeterRslt.TestDone = compoundMeterRslt.TestDone = true; mainMeterRslt.TestDone = auxMeterRslt.TestDone = compoundMeterRslt.TestDone = true;
@@ -408,8 +408,8 @@ namespace TBF.BenchControl.TestMethods.Endurance
} }
meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter, meterRslt.VolumeRef); meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter, meterRslt.VolumeRef);
meterRslt.Passed = (meterRslt.Error >= test.ErrLimLo + test.Uncertainty) meterRslt.Passed = (meterRslt.Error >= test.GetErrLimLo(tstRslt.FlowMean) + test.Uncertainty)
&& (meterRslt.Error <= test.ErrLimHi - test.Uncertainty) && (meterRslt.Error <= test.GetErrLimHi(tstRslt.FlowMean) - test.Uncertainty)
&& (tstRslt.ErrorFlags == 0 || tstRslt.ErrorFlagsMode() != Config.Entities.ErrorFlagsMode.On); && (tstRslt.ErrorFlags == 0 || tstRslt.ErrorFlagsMode() != Config.Entities.ErrorFlagsMode.On);
meterRslt.TestDone = true; meterRslt.TestDone = true;
tstRslt.TestDone = true; tstRslt.TestDone = true;
@@ -556,8 +556,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
meterRslt.PulsesMaster = tstRslt.PulsesMaster; meterRslt.PulsesMaster = tstRslt.PulsesMaster;
meterRslt.TestTime = tstRslt.TestTime; meterRslt.TestTime = tstRslt.TestTime;
meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter, meterRslt.VolumeRef); meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter, meterRslt.VolumeRef);
meterRslt.Passed = (meterRslt.Error >= test.ErrLimLo + test.Uncertainty) meterRslt.Passed = (meterRslt.Error >= test.GetErrLimLo(tstRslt.FlowMean) + test.Uncertainty)
&& (meterRslt.Error <= test.ErrLimHi - test.Uncertainty) && (meterRslt.Error <= test.GetErrLimHi(tstRslt.FlowMean) - test.Uncertainty)
&& (tstRslt.ErrorFlags == 0 || tstRslt.ErrorFlagsMode() != Config.Entities.ErrorFlagsMode.On); && (tstRslt.ErrorFlags == 0 || tstRslt.ErrorFlagsMode() != Config.Entities.ErrorFlagsMode.On);
meterRslt.TestDone = true; meterRslt.TestDone = true;
tstRslt.TestDone = true; tstRslt.TestDone = true;
@@ -992,8 +992,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
compoundMeterRslt.PulsesMaster = tstRslt.PulsesMaster; compoundMeterRslt.PulsesMaster = tstRslt.PulsesMaster;
compoundMeterRslt.TestTime = tstRslt.TestTime; compoundMeterRslt.TestTime = tstRslt.TestTime;
compoundMeterRslt.Error = Formulas.ErrorFromVolumes(compoundMeterRslt.VolumeMeter, compoundMeterRslt.VolumeRef); compoundMeterRslt.Error = Formulas.ErrorFromVolumes(compoundMeterRslt.VolumeMeter, compoundMeterRslt.VolumeRef);
compoundMeterRslt.Passed = (compoundMeterRslt.Error >= test.ErrLimLo + test.Uncertainty) compoundMeterRslt.Passed = (compoundMeterRslt.Error >= test.GetErrLimLo(tstRslt.FlowMean) + test.Uncertainty)
&& (compoundMeterRslt.Error <= test.ErrLimHi - test.Uncertainty) && (compoundMeterRslt.Error <= test.GetErrLimHi(tstRslt.FlowMean) - test.Uncertainty)
&& (tstRslt.ErrorFlags == 0 || tstRslt.ErrorFlagsMode() != Config.Entities.ErrorFlagsMode.On); && (tstRslt.ErrorFlags == 0 || tstRslt.ErrorFlagsMode() != Config.Entities.ErrorFlagsMode.On);
mainMeterRslt.Passed = auxMeterRslt.Passed = compoundMeterRslt.Passed; mainMeterRslt.Passed = auxMeterRslt.Passed = compoundMeterRslt.Passed;
mainMeterRslt.TestDone = auxMeterRslt.TestDone = compoundMeterRslt.TestDone = true; mainMeterRslt.TestDone = auxMeterRslt.TestDone = compoundMeterRslt.TestDone = true;
@@ -1045,8 +1045,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
volumeRslt.Error = Formulas.ErrorFromVolumes(volumeRslt.VolumeMeter, volumeRslt.VolumeRef); volumeRslt.Error = Formulas.ErrorFromVolumes(volumeRslt.VolumeMeter, volumeRslt.VolumeRef);
volumeRslt.Passed = !heatMetersTestParams.EvaluateVolume || volumeRslt.Passed = !heatMetersTestParams.EvaluateVolume ||
((volumeRslt.Error >= test.ErrLimLo + test.Uncertainty) && ((volumeRslt.Error >= test.GetErrLimLo(tstRslt.FlowMean) + test.Uncertainty) &&
(volumeRslt.Error <= test.ErrLimHi - test.Uncertainty) && (volumeRslt.Error <= test.GetErrLimHi(tstRslt.FlowMean) - test.Uncertainty) &&
(tstRslt.ErrorFlags == 0 || tstRslt.ErrorFlagsMode() != Config.Entities.ErrorFlagsMode.On)); (tstRslt.ErrorFlags == 0 || tstRslt.ErrorFlagsMode() != Config.Entities.ErrorFlagsMode.On));
volumeRslt.TestDone = true; volumeRslt.TestDone = true;
tstRslt.TestDone = true; tstRslt.TestDone = true;
@@ -1094,8 +1094,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
meterRslt.PulsesMaster = tstRslt.PulsesMaster; meterRslt.PulsesMaster = tstRslt.PulsesMaster;
meterRslt.TestTime = tstRslt.TestTime; meterRslt.TestTime = tstRslt.TestTime;
meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter, meterRslt.VolumeRef); meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter, meterRslt.VolumeRef);
meterRslt.Passed = (meterRslt.Error >= test.ErrLimLo + test.Uncertainty) meterRslt.Passed = (meterRslt.Error >= test.GetErrLimLo(tstRslt.FlowMean) + test.Uncertainty)
&& (meterRslt.Error <= test.ErrLimHi - test.Uncertainty) && (meterRslt.Error <= test.GetErrLimHi(tstRslt.FlowMean) - test.Uncertainty)
&& (tstRslt.ErrorFlags == 0 || tstRslt.ErrorFlagsMode() != Config.Entities.ErrorFlagsMode.On); && (tstRslt.ErrorFlags == 0 || tstRslt.ErrorFlagsMode() != Config.Entities.ErrorFlagsMode.On);
meterRslt.TestDone = true; meterRslt.TestDone = true;
tstRslt.TestDone = true; tstRslt.TestDone = true;
@@ -585,8 +585,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
volumeRslt.Error = Formulas.ErrorFromVolumes(volumeRslt.VolumeMeter, volumeRslt.VolumeRef); volumeRslt.Error = Formulas.ErrorFromVolumes(volumeRslt.VolumeMeter, volumeRslt.VolumeRef);
volumeRslt.Passed = !heatMetersTestParams.EvaluateVolume || volumeRslt.Passed = !heatMetersTestParams.EvaluateVolume ||
((volumeRslt.Error >= test.ErrLimLo + test.Uncertainty) && ((volumeRslt.Error >= test.GetErrLimLo(tstRslt.FlowMean) + test.Uncertainty) &&
(volumeRslt.Error <= test.ErrLimHi - test.Uncertainty) && (volumeRslt.Error <= test.GetErrLimHi(tstRslt.FlowMean) - test.Uncertainty) &&
(tstRslt.ErrorFlags == 0 || tstRslt.ErrorFlagsMode() != Config.Entities.ErrorFlagsMode.On)); (tstRslt.ErrorFlags == 0 || tstRslt.ErrorFlagsMode() != Config.Entities.ErrorFlagsMode.On));
volumeRslt.TestDone = true; volumeRslt.TestDone = true;
tstRslt.TestDone = true; tstRslt.TestDone = true;
@@ -679,8 +679,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
} }
meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter, meterRslt.VolumeRef); meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter, meterRslt.VolumeRef);
meterRslt.Passed = (meterRslt.Error >= test.ErrLimLo + test.Uncertainty) meterRslt.Passed = (meterRslt.Error >= test.GetErrLimLo(tstRslt.FlowMean) + test.Uncertainty)
&& (meterRslt.Error <= test.ErrLimHi - test.Uncertainty) && (meterRslt.Error <= test.GetErrLimHi(tstRslt.FlowMean) - test.Uncertainty)
&& (tstRslt.ErrorFlags == 0 || tstRslt.ErrorFlagsMode() != Config.Entities.ErrorFlagsMode.On); && (tstRslt.ErrorFlags == 0 || tstRslt.ErrorFlagsMode() != Config.Entities.ErrorFlagsMode.On);
meterRslt.TestDone = true; meterRslt.TestDone = true;
tstRslt.TestDone = true; tstRslt.TestDone = true;
@@ -861,8 +861,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
compoundMeterRslt.PulsesMaster = tstRslt.PulsesMaster; compoundMeterRslt.PulsesMaster = tstRslt.PulsesMaster;
compoundMeterRslt.TestTime = tstRslt.TestTime; compoundMeterRslt.TestTime = tstRslt.TestTime;
compoundMeterRslt.Error = Formulas.ErrorFromVolumes(compoundMeterRslt.VolumeMeter, compoundMeterRslt.VolumeRef); compoundMeterRslt.Error = Formulas.ErrorFromVolumes(compoundMeterRslt.VolumeMeter, compoundMeterRslt.VolumeRef);
compoundMeterRslt.Passed = (compoundMeterRslt.Error >= test.ErrLimLo + test.Uncertainty) compoundMeterRslt.Passed = (compoundMeterRslt.Error >= test.GetErrLimLo(tstRslt.FlowMean) + test.Uncertainty)
&& (compoundMeterRslt.Error <= test.ErrLimHi - test.Uncertainty) && (compoundMeterRslt.Error <= test.GetErrLimHi(tstRslt.FlowMean) - test.Uncertainty)
&& (tstRslt.ErrorFlags == 0 || tstRslt.ErrorFlagsMode() != Config.Entities.ErrorFlagsMode.On); && (tstRslt.ErrorFlags == 0 || tstRslt.ErrorFlagsMode() != Config.Entities.ErrorFlagsMode.On);
mainMeterRslt.Passed = auxMeterRslt.Passed = compoundMeterRslt.Passed; mainMeterRslt.Passed = auxMeterRslt.Passed = compoundMeterRslt.Passed;
mainMeterRslt.TestDone = auxMeterRslt.TestDone = compoundMeterRslt.TestDone = true; mainMeterRslt.TestDone = auxMeterRslt.TestDone = compoundMeterRslt.TestDone = true;
@@ -914,8 +914,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
volumeRslt.Error = Formulas.ErrorFromVolumes(volumeRslt.VolumeMeter, volumeRslt.VolumeRef); volumeRslt.Error = Formulas.ErrorFromVolumes(volumeRslt.VolumeMeter, volumeRslt.VolumeRef);
volumeRslt.Passed = !heatMetersTestParams.EvaluateVolume || volumeRslt.Passed = !heatMetersTestParams.EvaluateVolume ||
((volumeRslt.Error >= test.ErrLimLo + test.Uncertainty) && ((volumeRslt.Error >= test.GetErrLimLo(tstRslt.FlowMean) + test.Uncertainty) &&
(volumeRslt.Error <= test.ErrLimHi - test.Uncertainty) && (volumeRslt.Error <= test.GetErrLimHi(tstRslt.FlowMean) - test.Uncertainty) &&
(tstRslt.ErrorFlags == 0 || tstRslt.ErrorFlagsMode() != Config.Entities.ErrorFlagsMode.On)); (tstRslt.ErrorFlags == 0 || tstRslt.ErrorFlagsMode() != Config.Entities.ErrorFlagsMode.On));
volumeRslt.TestDone = true; volumeRslt.TestDone = true;
tstRslt.TestDone = true; tstRslt.TestDone = true;
@@ -1009,8 +1009,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
} }
meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter, meterRslt.VolumeRef); meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter, meterRslt.VolumeRef);
meterRslt.Passed = (meterRslt.Error >= test.ErrLimLo + test.Uncertainty) meterRslt.Passed = (meterRslt.Error >= test.GetErrLimLo(tstRslt.FlowMean) + test.Uncertainty)
&& (meterRslt.Error <= test.ErrLimHi - test.Uncertainty) && (meterRslt.Error <= test.GetErrLimHi(tstRslt.FlowMean) - test.Uncertainty)
&& (tstRslt.ErrorFlags == 0 || tstRslt.ErrorFlagsMode() != Config.Entities.ErrorFlagsMode.On); && (tstRslt.ErrorFlags == 0 || tstRslt.ErrorFlagsMode() != Config.Entities.ErrorFlagsMode.On);
meterRslt.TestDone = true; meterRslt.TestDone = true;
tstRslt.TestDone = true; tstRslt.TestDone = true;
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("2.17.704.1")] [assembly: AssemblyVersion("2.17.705.1")]
[assembly: AssemblyFileVersion("2.17.704.1")] [assembly: AssemblyFileVersion("2.17.705.1")]
@@ -15,7 +15,7 @@ namespace TBF.TestWizard
{ {
Qfrom_Qto, Qfrom_Qto,
Q_dQ, Q_dQ,
Q_dPct Q_dPct,
} }
Test test; Test test;
@@ -26,7 +26,7 @@ namespace TBF.TestWizard
{ {
InitializeComponent(); InitializeComponent();
qSpec = QSpec.Qfrom_Qto; qSpec = 0;
Text = Strings.Flow_selection; Text = Strings.Flow_selection;
qFromLabel.Text = Strings.Q_from_m3h; qFromLabel.Text = Strings.Q_from_m3h;
@@ -55,11 +55,6 @@ namespace TBF.TestWizard
foreach (var path in sensorPaths) sensorsComboBox.Items.Add(path.Name); foreach (var path in sensorPaths) sensorsComboBox.Items.Add(path.Name);
RefreshWizardPage();
}
void RefreshWizardPage()
{
qFromTextBox.Text = test.Qfrom.ToString(); qFromTextBox.Text = test.Qfrom.ToString();
qToTextBox.Text = test.Qto.ToString(); qToTextBox.Text = test.Qto.ToString();
nextButton.Enabled = IsFormValid(); nextButton.Enabled = IsFormValid();
+281 -185
View File
@@ -31,191 +31,280 @@ namespace TBF.TestWizard
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.horizSplitContainer = new System.Windows.Forms.SplitContainer(); this.horizSplitContainer = new System.Windows.Forms.SplitContainer();
this.errLoPctTextBox = new System.Windows.Forms.TextBox(); this.tabControl1 = new System.Windows.Forms.TabControl();
this.errHiPctTextBox = new System.Windows.Forms.TextBox(); this.tabPage1 = new System.Windows.Forms.TabPage();
this.durationTextBox = new System.Windows.Forms.TextBox(); this.errLoPctLabel = new System.Windows.Forms.Label();
this.volumeTextBox = new System.Windows.Forms.TextBox(); this.errHiPctLabel = new System.Windows.Forms.Label();
this.errHiPctLabel = new System.Windows.Forms.Label(); this.errHiPctTextBox = new System.Windows.Forms.TextBox();
this.errLoPctLabel = new System.Windows.Forms.Label(); this.errLoPctTextBox = new System.Windows.Forms.TextBox();
this.durationLabel = new System.Windows.Forms.Label(); this.tabPage2 = new System.Windows.Forms.TabPage();
this.volumeLabel = new System.Windows.Forms.Label(); this.classComboBox = new System.Windows.Forms.ComboBox();
this.cancelButton = new System.Windows.Forms.Button(); this.classLabel = new System.Windows.Forms.Label();
this.nextButton = new System.Windows.Forms.Button(); this.qpLabel = new System.Windows.Forms.Label();
this.backButton = new System.Windows.Forms.Button(); this.qpTextBox = new System.Windows.Forms.TextBox();
this.uncertaintyTextBox = new System.Windows.Forms.TextBox(); this.uncertaintyTextBox = new System.Windows.Forms.TextBox();
this.uncertaintyLabel = new System.Windows.Forms.Label(); this.durationTextBox = new System.Windows.Forms.TextBox();
((System.ComponentModel.ISupportInitialize)(this.horizSplitContainer)).BeginInit(); this.volumeTextBox = new System.Windows.Forms.TextBox();
this.horizSplitContainer.Panel1.SuspendLayout(); this.uncertaintyLabel = new System.Windows.Forms.Label();
this.horizSplitContainer.Panel2.SuspendLayout(); this.durationLabel = new System.Windows.Forms.Label();
this.horizSplitContainer.SuspendLayout(); this.volumeLabel = new System.Windows.Forms.Label();
this.SuspendLayout(); this.cancelButton = new System.Windows.Forms.Button();
// this.nextButton = new System.Windows.Forms.Button();
// horizSplitContainer this.backButton = new System.Windows.Forms.Button();
// ((System.ComponentModel.ISupportInitialize)(this.horizSplitContainer)).BeginInit();
this.horizSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill; this.horizSplitContainer.Panel1.SuspendLayout();
this.horizSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; this.horizSplitContainer.Panel2.SuspendLayout();
this.horizSplitContainer.Location = new System.Drawing.Point(0, 0); this.horizSplitContainer.SuspendLayout();
this.horizSplitContainer.Name = "horizSplitContainer"; this.tabControl1.SuspendLayout();
this.horizSplitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal; this.tabPage1.SuspendLayout();
// this.tabPage2.SuspendLayout();
// horizSplitContainer.Panel1 this.SuspendLayout();
// //
this.horizSplitContainer.Panel1.Controls.Add(this.uncertaintyTextBox); // horizSplitContainer
this.horizSplitContainer.Panel1.Controls.Add(this.uncertaintyLabel); //
this.horizSplitContainer.Panel1.Controls.Add(this.errLoPctTextBox); this.horizSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
this.horizSplitContainer.Panel1.Controls.Add(this.errHiPctTextBox); this.horizSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
this.horizSplitContainer.Panel1.Controls.Add(this.durationTextBox); this.horizSplitContainer.Location = new System.Drawing.Point(0, 0);
this.horizSplitContainer.Panel1.Controls.Add(this.volumeTextBox); this.horizSplitContainer.Name = "horizSplitContainer";
this.horizSplitContainer.Panel1.Controls.Add(this.errHiPctLabel); this.horizSplitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal;
this.horizSplitContainer.Panel1.Controls.Add(this.errLoPctLabel); //
this.horizSplitContainer.Panel1.Controls.Add(this.durationLabel); // horizSplitContainer.Panel1
this.horizSplitContainer.Panel1.Controls.Add(this.volumeLabel); //
// this.horizSplitContainer.Panel1.Controls.Add(this.tabControl1);
// horizSplitContainer.Panel2 this.horizSplitContainer.Panel1.Controls.Add(this.uncertaintyTextBox);
// this.horizSplitContainer.Panel1.Controls.Add(this.durationTextBox);
this.horizSplitContainer.Panel2.Controls.Add(this.cancelButton); this.horizSplitContainer.Panel1.Controls.Add(this.volumeTextBox);
this.horizSplitContainer.Panel2.Controls.Add(this.nextButton); this.horizSplitContainer.Panel1.Controls.Add(this.uncertaintyLabel);
this.horizSplitContainer.Panel2.Controls.Add(this.backButton); this.horizSplitContainer.Panel1.Controls.Add(this.durationLabel);
this.horizSplitContainer.Size = new System.Drawing.Size(284, 262); this.horizSplitContainer.Panel1.Controls.Add(this.volumeLabel);
this.horizSplitContainer.SplitterDistance = 182; //
this.horizSplitContainer.TabIndex = 1; // horizSplitContainer.Panel2
// //
// errLoPctTextBox this.horizSplitContainer.Panel2.Controls.Add(this.cancelButton);
// this.horizSplitContainer.Panel2.Controls.Add(this.nextButton);
this.errLoPctTextBox.Location = new System.Drawing.Point(150, 76); this.horizSplitContainer.Panel2.Controls.Add(this.backButton);
this.errLoPctTextBox.Name = "errLoPctTextBox"; this.horizSplitContainer.Size = new System.Drawing.Size(284, 262);
this.errLoPctTextBox.Size = new System.Drawing.Size(86, 20); this.horizSplitContainer.SplitterDistance = 182;
this.errLoPctTextBox.TabIndex = 7; this.horizSplitContainer.TabIndex = 1;
this.errLoPctTextBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged); //
// // tabControl1
// errHiPctTextBox //
// this.tabControl1.Controls.Add(this.tabPage1);
this.errHiPctTextBox.Location = new System.Drawing.Point(150, 102); this.tabControl1.Controls.Add(this.tabPage2);
this.errHiPctTextBox.Name = "errHiPctTextBox"; this.tabControl1.Location = new System.Drawing.Point(0, 0);
this.errHiPctTextBox.Size = new System.Drawing.Size(86, 20); this.tabControl1.Name = "tabControl1";
this.errHiPctTextBox.TabIndex = 6; this.tabControl1.SelectedIndex = 0;
this.errHiPctTextBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged); this.tabControl1.Size = new System.Drawing.Size(284, 93);
// this.tabControl1.TabIndex = 0;
// durationTextBox this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged);
// //
this.durationTextBox.Location = new System.Drawing.Point(150, 50); // tabPage1
this.durationTextBox.Name = "durationTextBox"; //
this.durationTextBox.Size = new System.Drawing.Size(86, 20); this.tabPage1.BackColor = System.Drawing.SystemColors.Control;
this.durationTextBox.TabIndex = 5; this.tabPage1.Controls.Add(this.errLoPctLabel);
this.durationTextBox.TextChanged += new System.EventHandler(this.durationTextBox_TextChanged); this.tabPage1.Controls.Add(this.errHiPctLabel);
// this.tabPage1.Controls.Add(this.errHiPctTextBox);
// volumeTextBox this.tabPage1.Controls.Add(this.errLoPctTextBox);
// this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.volumeTextBox.Location = new System.Drawing.Point(150, 24); this.tabPage1.Name = "tabPage1";
this.volumeTextBox.Name = "volumeTextBox"; this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.volumeTextBox.Size = new System.Drawing.Size(86, 20); this.tabPage1.Size = new System.Drawing.Size(276, 67);
this.volumeTextBox.TabIndex = 4; this.tabPage1.TabIndex = 0;
this.volumeTextBox.TextChanged += new System.EventHandler(this.volumeTextBox_TextChanged); //
// // errLoPctLabel
// errHiPctLabel //
// this.errLoPctLabel.AutoSize = true;
this.errHiPctLabel.AutoSize = true; this.errLoPctLabel.Location = new System.Drawing.Point(31, 16);
this.errHiPctLabel.Location = new System.Drawing.Point(35, 105); this.errLoPctLabel.Name = "errLoPctLabel";
this.errHiPctLabel.Name = "errHiPctLabel"; this.errLoPctLabel.Size = new System.Drawing.Size(85, 13);
this.errHiPctLabel.Size = new System.Drawing.Size(89, 13); this.errLoPctLabel.TabIndex = 0;
this.errHiPctLabel.TabIndex = 3; this.errLoPctLabel.Text = "Error low limit [%]";
this.errHiPctLabel.Text = "Error high limit [%]"; //
// // errHiPctLabel
// errLoPctLabel //
// this.errHiPctLabel.AutoSize = true;
this.errLoPctLabel.AutoSize = true; this.errHiPctLabel.Location = new System.Drawing.Point(31, 41);
this.errLoPctLabel.Location = new System.Drawing.Point(35, 79); this.errHiPctLabel.Name = "errHiPctLabel";
this.errLoPctLabel.Name = "errLoPctLabel"; this.errHiPctLabel.Size = new System.Drawing.Size(89, 13);
this.errLoPctLabel.Size = new System.Drawing.Size(85, 13); this.errHiPctLabel.TabIndex = 2;
this.errLoPctLabel.TabIndex = 2; this.errHiPctLabel.Text = "Error high limit [%]";
this.errLoPctLabel.Text = "Error low limit [%]"; //
// // errHiPctTextBox
// durationLabel //
// this.errHiPctTextBox.Location = new System.Drawing.Point(146, 38);
this.durationLabel.AutoSize = true; this.errHiPctTextBox.Name = "errHiPctTextBox";
this.durationLabel.Location = new System.Drawing.Point(35, 53); this.errHiPctTextBox.Size = new System.Drawing.Size(86, 20);
this.durationLabel.Name = "durationLabel"; this.errHiPctTextBox.TabIndex = 3;
this.durationLabel.Size = new System.Drawing.Size(83, 13); this.errHiPctTextBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged);
this.durationLabel.TabIndex = 1; //
this.durationLabel.Text = "Test duration [s]"; // errLoPctTextBox
// //
// volumeLabel this.errLoPctTextBox.Location = new System.Drawing.Point(146, 13);
// this.errLoPctTextBox.Name = "errLoPctTextBox";
this.volumeLabel.AutoSize = true; this.errLoPctTextBox.Size = new System.Drawing.Size(86, 20);
this.volumeLabel.Location = new System.Drawing.Point(35, 27); this.errLoPctTextBox.TabIndex = 1;
this.volumeLabel.Name = "volumeLabel"; this.errLoPctTextBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged);
this.volumeLabel.Size = new System.Drawing.Size(53, 13); //
this.volumeLabel.TabIndex = 0; // tabPage2
this.volumeLabel.Text = "Volume [l]"; //
// this.tabPage2.BackColor = System.Drawing.SystemColors.Control;
// cancelButton this.tabPage2.Controls.Add(this.classComboBox);
// this.tabPage2.Controls.Add(this.classLabel);
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.tabPage2.Controls.Add(this.qpLabel);
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.tabPage2.Controls.Add(this.qpTextBox);
this.cancelButton.Location = new System.Drawing.Point(186, 17); this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.cancelButton.Name = "cancelButton"; this.tabPage2.Name = "tabPage2";
this.cancelButton.Size = new System.Drawing.Size(75, 42); this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.cancelButton.TabIndex = 27; this.tabPage2.Size = new System.Drawing.Size(276, 67);
this.cancelButton.Text = "&Cancel"; this.tabPage2.TabIndex = 1;
this.cancelButton.UseVisualStyleBackColor = true; //
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); // classComboBox
// //
// nextButton this.classComboBox.FormattingEnabled = true;
// this.classComboBox.Items.AddRange(new object[] {
this.nextButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); "1",
this.nextButton.Location = new System.Drawing.Point(105, 17); "2",
this.nextButton.Name = "nextButton"; "3"});
this.nextButton.Size = new System.Drawing.Size(75, 42); this.classComboBox.Location = new System.Drawing.Point(146, 13);
this.nextButton.TabIndex = 26; this.classComboBox.Name = "classComboBox";
this.nextButton.Text = "&Next >"; this.classComboBox.Size = new System.Drawing.Size(86, 21);
this.nextButton.UseVisualStyleBackColor = true; this.classComboBox.TabIndex = 1;
this.nextButton.Click += new System.EventHandler(this.nextButton_Click); this.classComboBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged);
// //
// backButton // classLabel
// //
this.backButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.classLabel.AutoSize = true;
this.backButton.DialogResult = System.Windows.Forms.DialogResult.Retry; this.classLabel.Location = new System.Drawing.Point(31, 17);
this.backButton.Location = new System.Drawing.Point(24, 17); this.classLabel.Name = "classLabel";
this.backButton.Name = "backButton"; this.classLabel.Size = new System.Drawing.Size(32, 13);
this.backButton.Size = new System.Drawing.Size(75, 42); this.classLabel.TabIndex = 0;
this.backButton.TabIndex = 25; this.classLabel.Text = "Class";
this.backButton.Text = "< &Back"; //
this.backButton.UseVisualStyleBackColor = true; // qpLabel
this.backButton.Click += new System.EventHandler(this.backButton_Click); //
// this.qpLabel.AutoSize = true;
// uncertaintyTextBox this.qpLabel.Location = new System.Drawing.Point(31, 42);
// this.qpLabel.Name = "qpLabel";
this.uncertaintyTextBox.Location = new System.Drawing.Point(150, 128); this.qpLabel.Size = new System.Drawing.Size(55, 13);
this.uncertaintyTextBox.Name = "uncertaintyTextBox"; this.qpLabel.TabIndex = 2;
this.uncertaintyTextBox.Size = new System.Drawing.Size(86, 20); this.qpLabel.Text = "Qp [m3/h]";
this.uncertaintyTextBox.TabIndex = 9; //
// // qpTextBox
// uncertaintyLabel //
// this.qpTextBox.Location = new System.Drawing.Point(146, 39);
this.uncertaintyLabel.AutoSize = true; this.qpTextBox.Name = "qpTextBox";
this.uncertaintyLabel.Location = new System.Drawing.Point(35, 131); this.qpTextBox.Size = new System.Drawing.Size(86, 20);
this.uncertaintyLabel.Name = "uncertaintyLabel"; this.qpTextBox.TabIndex = 3;
this.uncertaintyLabel.Size = new System.Drawing.Size(78, 13); this.qpTextBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged);
this.uncertaintyLabel.TabIndex = 8; //
this.uncertaintyLabel.Text = "Uncertainty [%]"; // uncertaintyTextBox
// //
// VolumeAndErrorSelection this.uncertaintyTextBox.Location = new System.Drawing.Point(150, 100);
// this.uncertaintyTextBox.Name = "uncertaintyTextBox";
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.uncertaintyTextBox.Size = new System.Drawing.Size(86, 20);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.uncertaintyTextBox.TabIndex = 2;
this.ClientSize = new System.Drawing.Size(284, 262); this.uncertaintyTextBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged);
this.Controls.Add(this.horizSplitContainer); //
this.Name = "VolumeAndErrorSelection"; // durationTextBox
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; //
this.Text = "VolumeAndErrorSelection"; this.durationTextBox.Location = new System.Drawing.Point(150, 149);
this.Load += new System.EventHandler(this.VolumeAndErrorSelection_Load); this.durationTextBox.Name = "durationTextBox";
this.horizSplitContainer.Panel1.ResumeLayout(false); this.durationTextBox.Size = new System.Drawing.Size(86, 20);
this.horizSplitContainer.Panel1.PerformLayout(); this.durationTextBox.TabIndex = 6;
this.horizSplitContainer.Panel2.ResumeLayout(false); this.durationTextBox.TextChanged += new System.EventHandler(this.durationTextBox_TextChanged);
((System.ComponentModel.ISupportInitialize)(this.horizSplitContainer)).EndInit(); //
this.horizSplitContainer.ResumeLayout(false); // volumeTextBox
this.ResumeLayout(false); //
this.volumeTextBox.Location = new System.Drawing.Point(150, 124);
this.volumeTextBox.Name = "volumeTextBox";
this.volumeTextBox.Size = new System.Drawing.Size(86, 20);
this.volumeTextBox.TabIndex = 4;
this.volumeTextBox.TextChanged += new System.EventHandler(this.volumeTextBox_TextChanged);
//
// uncertaintyLabel
//
this.uncertaintyLabel.AutoSize = true;
this.uncertaintyLabel.Location = new System.Drawing.Point(35, 103);
this.uncertaintyLabel.Name = "uncertaintyLabel";
this.uncertaintyLabel.Size = new System.Drawing.Size(78, 13);
this.uncertaintyLabel.TabIndex = 1;
this.uncertaintyLabel.Text = "Uncertainty [%]";
//
// durationLabel
//
this.durationLabel.AutoSize = true;
this.durationLabel.Location = new System.Drawing.Point(35, 152);
this.durationLabel.Name = "durationLabel";
this.durationLabel.Size = new System.Drawing.Size(83, 13);
this.durationLabel.TabIndex = 5;
this.durationLabel.Text = "Test duration [s]";
//
// volumeLabel
//
this.volumeLabel.AutoSize = true;
this.volumeLabel.Location = new System.Drawing.Point(35, 127);
this.volumeLabel.Name = "volumeLabel";
this.volumeLabel.Size = new System.Drawing.Size(53, 13);
this.volumeLabel.TabIndex = 3;
this.volumeLabel.Text = "Volume [l]";
//
// cancelButton
//
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.Location = new System.Drawing.Point(186, 17);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(75, 42);
this.cancelButton.TabIndex = 2;
this.cancelButton.Text = "&Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// nextButton
//
this.nextButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.nextButton.Location = new System.Drawing.Point(105, 17);
this.nextButton.Name = "nextButton";
this.nextButton.Size = new System.Drawing.Size(75, 42);
this.nextButton.TabIndex = 1;
this.nextButton.Text = "&Next >";
this.nextButton.UseVisualStyleBackColor = true;
this.nextButton.Click += new System.EventHandler(this.nextButton_Click);
//
// backButton
//
this.backButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.backButton.DialogResult = System.Windows.Forms.DialogResult.Retry;
this.backButton.Location = new System.Drawing.Point(24, 17);
this.backButton.Name = "backButton";
this.backButton.Size = new System.Drawing.Size(75, 42);
this.backButton.TabIndex = 0;
this.backButton.Text = "< &Back";
this.backButton.UseVisualStyleBackColor = true;
this.backButton.Click += new System.EventHandler(this.backButton_Click);
//
// VolumeAndErrorSelection
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(284, 262);
this.Controls.Add(this.horizSplitContainer);
this.Name = "VolumeAndErrorSelection";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "VolumeAndErrorSelection";
this.Load += new System.EventHandler(this.VolumeAndErrorSelection_Load);
this.horizSplitContainer.Panel1.ResumeLayout(false);
this.horizSplitContainer.Panel1.PerformLayout();
this.horizSplitContainer.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.horizSplitContainer)).EndInit();
this.horizSplitContainer.ResumeLayout(false);
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage1.PerformLayout();
this.tabPage2.ResumeLayout(false);
this.tabPage2.PerformLayout();
this.ResumeLayout(false);
} }
@@ -235,5 +324,12 @@ namespace TBF.TestWizard
private System.Windows.Forms.Label volumeLabel; private System.Windows.Forms.Label volumeLabel;
private System.Windows.Forms.TextBox uncertaintyTextBox; private System.Windows.Forms.TextBox uncertaintyTextBox;
private System.Windows.Forms.Label uncertaintyLabel; private System.Windows.Forms.Label uncertaintyLabel;
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.Label classLabel;
private System.Windows.Forms.Label qpLabel;
private System.Windows.Forms.TextBox qpTextBox;
private System.Windows.Forms.ComboBox classComboBox;
} }
} }
@@ -1,5 +1,5 @@
/// ///
/// Copyright (c) 2013-2016 Sensus Metering Systems /// Copyright (c) 2013-2017 Sensus Metering Systems
/// ///
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
@@ -10,28 +10,41 @@ namespace TBF.TestWizard
{ {
public partial class VolumeAndErrorSelection : Form public partial class VolumeAndErrorSelection : Form
{ {
Test test; enum TabId
{
WaterMeterTab,
HeatMeterTab,
}
Test test;
TabId tabId;
public VolumeAndErrorSelection() public VolumeAndErrorSelection()
{ {
InitializeComponent(); InitializeComponent();
}
tabId = 0;
Text = Strings.Volume_and_error_selection;
volumeLabel.Text = Strings.Volume + " [l]";
durationLabel.Text = Strings.Duration_s;
errLoPctLabel.Text = Strings.Err_limit_neg_pct_chdr;
errHiPctLabel.Text = Strings.Err_limit_pos_pct_chdr;
uncertaintyLabel.Text = Strings.Uncertainty_pct_chdr;
backButton.Text = Strings.BackBtnText;
nextButton.Text = Strings.FinishBtnText;
cancelButton.Text = Strings.CancelBtnText;
tabPage1.Text = Strings.Water_Meter;
tabPage2.Text = Strings.Heat_meter;
classLabel.Text = Strings.Metrological_class;
qpLabel.Text = "Qp [m3/h]";
}
public VolumeAndErrorSelection(bool first, bool last, Test test) public VolumeAndErrorSelection(bool first, bool last, Test test)
: this() : this()
{ {
this.test = test; this.test = test;
Text = Strings.Volume_and_error_selection;
volumeLabel.Text = Strings.Volume + " [l]";
durationLabel.Text = Strings.Duration_s;
errLoPctLabel.Text = Strings.Err_limit_neg_pct_chdr;
errHiPctLabel.Text = Strings.Err_limit_pos_pct_chdr;
uncertaintyLabel.Text = Strings.Uncertainty_pct_chdr;
backButton.Text = Strings.BackBtnText;
nextButton.Text = Strings.FinishBtnText;
cancelButton.Text = Strings.CancelBtnText;
if (first) backButton.Visible = false; if (first) backButton.Visible = false;
if (last) nextButton.Text = Strings.FinishBtnText; if (last) nextButton.Text = Strings.FinishBtnText;
} }
@@ -40,37 +53,60 @@ namespace TBF.TestWizard
{ {
if (test == null) return; if (test == null) return;
RefreshWizardPage();
}
void RefreshWizardPage()
{
volumeTextBox.Text = test.Volume.ToString(); volumeTextBox.Text = test.Volume.ToString();
durationTextBox.Text = test.TstTime.ToString(); durationTextBox.Text = test.TstTime.ToString();
errLoPctTextBox.Text = test.ErrLimLo.ToString(); errLoPctTextBox.Text = test.ErrLimLo.ToString();
errHiPctTextBox.Text = test.ErrLimHi.ToString(); errHiPctTextBox.Text = test.ErrLimHi.ToString();
uncertaintyTextBox.Text = test.Uncertainty.ToString(); uncertaintyTextBox.Text = test.Uncertainty.ToString();
classComboBox.Text = "1";
nextButton.Enabled = IsFormValid(); nextButton.Enabled = IsFormValid();
} }
bool IsFormValid() bool IsFormValid()
{ {
int idummy;
float dummy; float dummy;
return Utils.TryParseUFloat(volumeTextBox.Text, out dummy) &&
Utils.TryParseUFloat(durationTextBox.Text, out dummy) && bool tabsValid;
Utils.TryParseSFloat(errLoPctTextBox.Text, out dummy) && switch (tabId)
Utils.TryParseSFloat(errHiPctTextBox.Text, out dummy) && {
Utils.TryParseUFloat(uncertaintyTextBox.Text, out dummy); default:
case TabId.WaterMeterTab:
tabsValid = Utils.TryParseSFloat(errLoPctTextBox.Text, out dummy)
&& Utils.TryParseSFloat(errHiPctTextBox.Text, out dummy);
break;
case TabId.HeatMeterTab:
tabsValid = int.TryParse(classComboBox.Text, out idummy)
&& idummy >= 1 && idummy <= 3
&& Utils.TryParseUFloat(qpTextBox.Text, out dummy);
break;
}
/// Return complete result
return tabsValid && Utils.TryParseUFloat(volumeTextBox.Text, out dummy)
&& Utils.TryParseUFloat(durationTextBox.Text, out dummy)
&& Utils.TryParseUFloat(uncertaintyTextBox.Text, out dummy);
} }
void UpdateTest() void UpdateTest()
{ {
test.Volume = Utils.ParseUFloat(volumeTextBox.Text); test.Volume = Utils.ParseUFloat(volumeTextBox.Text);
test.TstTime = Utils.ParseUFloat(durationTextBox.Text); test.TstTime = Utils.ParseUFloat(durationTextBox.Text);
test.ErrLimLo = Utils.ParseSFloat(errLoPctTextBox.Text); test.Uncertainty = Utils.ParseUFloat(uncertaintyTextBox.Text);
test.ErrLimHi = Utils.ParseSFloat(errHiPctTextBox.Text);
test.Uncertainty = Utils.ParseUFloat(uncertaintyTextBox.Text); switch (tabId)
{
default:
case TabId.WaterMeterTab:
test.ErrLimLo = Utils.ParseSFloat(errLoPctTextBox.Text);
test.ErrLimHi = Utils.ParseSFloat(errHiPctTextBox.Text);
break;
case TabId.HeatMeterTab:
test.ErrLimLo = (float)int.Parse(classComboBox.Text);
test.ErrLimHi = -Utils.ParseUFloat(qpTextBox.Text);
break;
}
} }
private void backButton_Click(object sender, EventArgs e) private void backButton_Click(object sender, EventArgs e)
@@ -130,5 +166,22 @@ namespace TBF.TestWizard
} }
anyTextBox_TextChanged(sender, e); anyTextBox_TextChanged(sender, e);
} }
private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
{
switch ((TabId)tabControl1.SelectedIndex)
{
default:
case TabId.WaterMeterTab:
tabId = TabId.WaterMeterTab;
break;
case TabId.HeatMeterTab:
tabId = TabId.HeatMeterTab;
break;
}
nextButton.Enabled = IsFormValid();
}
} }
} }