Uncertainty used when evaluating tests, in TestWizard, UI, etc., version 2.1.171.

This commit is contained in:
Milan Hanajik
2016-01-02 11:11:45 +01:00
parent 81fe244c23
commit 61bfa51fa7
22 changed files with 146 additions and 109 deletions
@@ -338,7 +338,8 @@ namespace TBF.BenchControl.TestMethods.Adjustment
{
tstRslt.Meters[i].VolumeErrorPct = -100;
}
tstRslt.Meters[i].Passed = (tstRslt.ErrLimLo <= tstRslt.Meters[i].VolumeErrorPct) && (tstRslt.Meters[i].VolumeErrorPct <= tstRslt.ErrLimHi);
tstRslt.Meters[i].Passed = (tstRslt.Meters[i].VolumeErrorPct >= tstRslt.ErrLimLo + tstRslt.Uncertainty)
&& (tstRslt.Meters[i].VolumeErrorPct <= tstRslt.ErrLimHi - tstRslt.Uncertainty);
tstRslt.Meters[i].Disabled = false;
}
@@ -140,7 +140,7 @@ namespace TBF.BenchControl.TestMethods.Adjustment
{
if (!disabled[i])
{
PaintOne(graphics, rects[i], tr.Meters[i].VolumeErrorPct, tr.ErrLimLo, tr.ErrLimHi);
PaintOne(graphics, rects[i], tr.Meters[i].VolumeErrorPct, tr.ErrLimLo + tr.Uncertainty, tr.ErrLimHi - tr.Uncertainty);
}
}
}
@@ -179,7 +179,7 @@ namespace TBF.BenchControl.TestMethods.Adjustment
{
if (!disabled[i])
{
PaintOne(graphics, rects[i], tr.Meters[i].VolumeErrorPct, tr.ErrLimLo, tr.ErrLimHi);
PaintOne(graphics, rects[i], tr.Meters[i].VolumeErrorPct, tr.ErrLimLo + tr.Uncertainty, tr.ErrLimHi - tr.Uncertainty);
}
}
}
@@ -183,7 +183,7 @@ namespace TBF.BenchControl.TestMethods.Adjustment
{
if (!disabled[i])
{
PaintOne(graphics, rects[i], tr.Meters[i].VolumeErrorPct, tr.ErrLimLo, tr.ErrLimHi);
PaintOne(graphics, rects[i], tr.Meters[i].VolumeErrorPct, tr.ErrLimLo + tr.Uncertainty, tr.ErrLimHi - tr.Uncertainty);
}
}
}
@@ -461,7 +461,8 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
tstRslt.CombinedMeters[iCmbnd].PulsesMaster = cBrd.EtPulses(0);
tstRslt.CombinedMeters[iCmbnd].Time = cBrd.TTime;
tstRslt.CombinedMeters[iCmbnd].VolumeErrorPct = Formulas.ErrorFromVolumes(tstRslt.CombinedMeters[iCmbnd].VolumeMeter, tstRslt.CombinedMeters[iCmbnd].VolumeRef);
tstRslt.CombinedMeters[iCmbnd].Passed = (tstRslt.ErrLimLo <= tstRslt.CombinedMeters[iCmbnd].VolumeErrorPct) && (tstRslt.CombinedMeters[iCmbnd].VolumeErrorPct <= tstRslt.ErrLimHi);
tstRslt.CombinedMeters[iCmbnd].Passed = (tstRslt.CombinedMeters[iCmbnd].VolumeErrorPct >= tstRslt.ErrLimLo + tstRslt.Uncertainty)
&& (tstRslt.CombinedMeters[iCmbnd].VolumeErrorPct <= tstRslt.ErrLimHi - tstRslt.Uncertainty);
}
/// Add data - end
@@ -639,7 +639,8 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
tstRslt.CombinedMeters[iCmbnd].PulsesMaster = cBrd.EtPulses(0);
tstRslt.CombinedMeters[iCmbnd].Time = cBrd.TTime;
tstRslt.CombinedMeters[iCmbnd].VolumeErrorPct = Formulas.ErrorFromVolumes(tstRslt.CombinedMeters[iCmbnd].VolumeMeter, tstRslt.CombinedMeters[iCmbnd].VolumeRef);
tstRslt.CombinedMeters[iCmbnd].Passed = (tstRslt.ErrLimLo <= tstRslt.CombinedMeters[iCmbnd].VolumeErrorPct) && (tstRslt.CombinedMeters[iCmbnd].VolumeErrorPct <= tstRslt.ErrLimHi);
tstRslt.CombinedMeters[iCmbnd].Passed = (tstRslt.CombinedMeters[iCmbnd].VolumeErrorPct >= tstRslt.ErrLimLo + tstRslt.Uncertainty)
&& (tstRslt.CombinedMeters[iCmbnd].VolumeErrorPct <= tstRslt.ErrLimHi - tstRslt.Uncertainty);
}
/// Add data - end
@@ -471,7 +471,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
{
Bridge.OnActivity(this, "Enter the water meter data");
State.Create("FixedStartAdvanced : Enter end-state")
.AddOperation(dataEntryCmpnt.ShowTestEndFormOp(tstRslt.VolumeCTV, tstRslt.ErrLimLo, tstRslt.ErrLimHi))
.AddOperation(dataEntryCmpnt.ShowTestEndFormOp(tstRslt.VolumeCTV, tstRslt.ErrLimLo + tstRslt.Uncertainty,
tstRslt.ErrLimHi - tstRslt.Uncertainty))
.AddOperation(checkUiOp)
.EnterState();
do
@@ -563,7 +564,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
{
tstRslt.Meters[i].VolumeErrorPct = -100;
}
tstRslt.Meters[i].Passed = (tstRslt.ErrLimLo <= tstRslt.Meters[i].VolumeErrorPct) && (tstRslt.Meters[i].VolumeErrorPct <= tstRslt.ErrLimHi);
tstRslt.Meters[i].Passed = (tstRslt.Meters[i].VolumeErrorPct >= tstRslt.ErrLimLo + tstRslt.Uncertainty)
&& (tstRslt.Meters[i].VolumeErrorPct <= tstRslt.ErrLimHi - tstRslt.Uncertainty);
tstRslt.Meters[i].Disabled = false;
}
@@ -482,8 +482,9 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
{
Bridge.OnActivity(this, "Enter the water meter data");
State.Create("FixedStartCombinedMeters : Enter end-state")
.AddOperation(dataEntryCmpnt.ShowTestEndFormOp(tstRslt.VolumeCTV, tstRslt.ErrLimLo, tstRslt.ErrLimHi))
.AddOperation(checkUiOp)
.AddOperation(dataEntryCmpnt.ShowTestEndFormOp(tstRslt.VolumeCTV, tstRslt.ErrLimLo + tstRslt.Uncertainty,
tstRslt.ErrLimHi - tstRslt.Uncertainty))
.AddOperation(checkUiOp)
.EnterState();
do
{
@@ -581,7 +582,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
tstRslt.CombinedMeters[iCmbnd].Time = cBrd.TTime;
tstRslt.CombinedMeters[iCmbnd].VolumeErrorPct = Formulas.ErrorFromVolumes(tstRslt.CombinedMeters[iCmbnd].VolumeMeter, tstRslt.CombinedMeters[iCmbnd].VolumeRef);
tstRslt.CombinedMeters[iCmbnd].Passed = (tstRslt.ErrLimLo <= tstRslt.CombinedMeters[iCmbnd].VolumeErrorPct) && (tstRslt.CombinedMeters[iCmbnd].VolumeErrorPct <= tstRslt.ErrLimHi);
tstRslt.CombinedMeters[iCmbnd].Passed = (tstRslt.CombinedMeters[iCmbnd].VolumeErrorPct >= tstRslt.ErrLimLo + tstRslt.Uncertainty)
&& (tstRslt.CombinedMeters[iCmbnd].VolumeErrorPct <= tstRslt.ErrLimHi - tstRslt.Uncertainty);
}
/// Add data - end
@@ -471,8 +471,9 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
{
Bridge.OnActivity(this, "Enter the water meter data");
State.Create("FixedStartMassCollection : Enter end-state")
.AddOperation(dataEntryCmpnt.ShowTestEndFormOp(tstRslt.VolumeCTV, tstRslt.ErrLimLo, tstRslt.ErrLimHi))
.AddOperation(checkUiOp)
.AddOperation(dataEntryCmpnt.ShowTestEndFormOp(tstRslt.VolumeCTV, tstRslt.ErrLimLo + tstRslt.Uncertainty,
tstRslt.ErrLimHi - tstRslt.Uncertainty))
.AddOperation(checkUiOp)
.EnterState();
do
{
@@ -563,7 +564,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
{
tstRslt.Meters[i].VolumeErrorPct = -100;
}
tstRslt.Meters[i].Passed = (tstRslt.ErrLimLo <= tstRslt.Meters[i].VolumeErrorPct) && (tstRslt.Meters[i].VolumeErrorPct <= tstRslt.ErrLimHi);
tstRslt.Meters[i].Passed = (tstRslt.Meters[i].VolumeErrorPct >= tstRslt.ErrLimLo + tstRslt.Uncertainty)
&& (tstRslt.Meters[i].VolumeErrorPct <= tstRslt.ErrLimHi - tstRslt.Uncertainty);
tstRslt.Meters[i].Disabled = false;
}
@@ -311,7 +311,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
{
tstRslt.Meters[i].VolumeErrorPct = -100;
}
tstRslt.Meters[i].Passed = (tstRslt.ErrLimLo <= tstRslt.Meters[i].VolumeErrorPct) && (tstRslt.Meters[i].VolumeErrorPct <= tstRslt.ErrLimHi);
tstRslt.Meters[i].Passed = (tstRslt.Meters[i].VolumeErrorPct >= tstRslt.ErrLimLo + tstRslt.Uncertainty)
&& (tstRslt.Meters[i].VolumeErrorPct <= tstRslt.ErrLimHi - tstRslt.Uncertainty);
}
else
{
@@ -508,7 +508,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
{
tstRslt.Meters[i].VolumeErrorPct = -100;
}
tstRslt.Meters[i].Passed = (tstRslt.ErrLimLo <= tstRslt.Meters[i].VolumeErrorPct) && (tstRslt.Meters[i].VolumeErrorPct <= tstRslt.ErrLimHi);
tstRslt.Meters[i].Passed = (tstRslt.Meters[i].VolumeErrorPct >= tstRslt.ErrLimLo + tstRslt.Uncertainty)
&& (tstRslt.Meters[i].VolumeErrorPct <= tstRslt.ErrLimHi - tstRslt.Uncertainty);
}
else
{
@@ -218,60 +218,60 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
if (StateMachine.Procedure.MetersKind == Config.Entities.MetersKind.Single)
{
for (int i = 0; i < Config.Data.WMsCount; i++)
{
if (sensPath.RegisterReaders[i] != null)
for (int i = 0; i < Config.Data.WMsCount; i++)
{
tstRslt.Meters[i].SerialNr = (WaterMeters.Count > i) ? WaterMeters[i].SerialNr : string.Empty;
tstRslt.Meters[i].VolumeStart = 0;
tstRslt.Meters[i].VolumeEnd = 0;
tstRslt.Meters[i].VolumeMeter = 0;
tstRslt.Meters[i].VolumeRef = 0;
tstRslt.Meters[i].PulsesMeter = 0;
tstRslt.Meters[i].PulsesMaster = 0;
tstRslt.Meters[i].Time = testParams.DurationPMax;
tstRslt.Meters[i].VolumeErrorPct = 0;
tstRslt.Meters[i].Passed = true;
}
}
}
else
{
for (int iCmbnd = 0; iCmbnd < Config.Data.CompoundWMsCount; iCmbnd++)
{
tstRslt.CombinedMeters[iCmbnd].VolumeRef = 0;
for (int i = 2 * iCmbnd; i < 2 * iCmbnd + 2; i++)
{
if (sensPath.RegisterReaders[i] == null || sensPath.RegisterReaders[i].PulsesPerLtr <= float.Epsilon)
{
tstRslt.Meters[i].PulsesPerLiter = 1.0f;
}
else
{
tstRslt.Meters[i].PulsesPerLiter = sensPath.RegisterReaders[i].PulsesPerLtr;
}
tstRslt.Meters[i].SerialNr = (WaterMeters.Count > i) ? WaterMeters[i].SerialNr : string.Empty;
tstRslt.Meters[i].VolumeStart = 0;
tstRslt.Meters[i].VolumeEnd = 0;
tstRslt.Meters[i].VolumeRef = 0;
tstRslt.Meters[i].VolumeMeter = 0;
tstRslt.Meters[i].Time = test.TstTime;
tstRslt.Meters[i].TimeStart = 0;
tstRslt.Meters[i].TimeEnd = testParams.DurationPMax;
tstRslt.Meters[i].PulsesMeter = 0;
tstRslt.Meters[i].PulsesMaster = 0;
tstRslt.Meters[i].VolumeErrorPct = 0;
tstRslt.Meters[i].Passed = true;
if (sensPath.RegisterReaders[i] != null)
{
tstRslt.Meters[i].SerialNr = (WaterMeters.Count > i) ? WaterMeters[i].SerialNr : string.Empty;
tstRslt.Meters[i].VolumeStart = 0;
tstRslt.Meters[i].VolumeEnd = 0;
tstRslt.Meters[i].VolumeMeter = 0;
tstRslt.Meters[i].VolumeRef = 0;
tstRslt.Meters[i].PulsesMeter = 0;
tstRslt.Meters[i].PulsesMaster = 0;
tstRslt.Meters[i].Time = testParams.DurationPMax;
tstRslt.Meters[i].VolumeErrorPct = 0;
tstRslt.Meters[i].Passed = true;
}
}
}
else
{
for (int iCmbnd = 0; iCmbnd < Config.Data.CompoundWMsCount; iCmbnd++)
{
tstRslt.CombinedMeters[iCmbnd].VolumeRef = 0;
tstRslt.CombinedMeters[iCmbnd].VolumeMeter = 0;
tstRslt.CombinedMeters[iCmbnd].PulsesMaster = 0;
tstRslt.CombinedMeters[iCmbnd].Time = testParams.DurationPMax;
tstRslt.CombinedMeters[iCmbnd].VolumeErrorPct = 0;
tstRslt.CombinedMeters[iCmbnd].Passed = true;
}
for (int i = 2 * iCmbnd; i < 2 * iCmbnd + 2; i++)
{
if (sensPath.RegisterReaders[i] == null || sensPath.RegisterReaders[i].PulsesPerLtr <= float.Epsilon)
{
tstRslt.Meters[i].PulsesPerLiter = 1.0f;
}
else
{
tstRslt.Meters[i].PulsesPerLiter = sensPath.RegisterReaders[i].PulsesPerLtr;
}
tstRslt.Meters[i].SerialNr = (WaterMeters.Count > i) ? WaterMeters[i].SerialNr : string.Empty;
tstRslt.Meters[i].VolumeStart = 0;
tstRslt.Meters[i].VolumeEnd = 0;
tstRslt.Meters[i].VolumeRef = 0;
tstRslt.Meters[i].VolumeMeter = 0;
tstRslt.Meters[i].Time = test.TstTime;
tstRslt.Meters[i].TimeStart = 0;
tstRslt.Meters[i].TimeEnd = testParams.DurationPMax;
tstRslt.Meters[i].PulsesMeter = 0;
tstRslt.Meters[i].PulsesMaster = 0;
tstRslt.Meters[i].VolumeErrorPct = 0;
tstRslt.Meters[i].Passed = true;
}
tstRslt.CombinedMeters[iCmbnd].VolumeMeter = 0;
tstRslt.CombinedMeters[iCmbnd].PulsesMaster = 0;
tstRslt.CombinedMeters[iCmbnd].Time = testParams.DurationPMax;
tstRslt.CombinedMeters[iCmbnd].VolumeErrorPct = 0;
tstRslt.CombinedMeters[iCmbnd].Passed = true;
}
}
/// Add data - end
@@ -398,7 +398,8 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
// {
// tstRslt.Meters[i].VolumeErrorPct = -100;
// }
// tstRslt.Meters[i].Passed = (tstRslt.ErrLimLo <= tstRslt.Meters[i].VolumeErrorPct) && (tstRslt.Meters[i].VolumeErrorPct <= tstRslt.ErrLimHi);
// tstRslt.Meters[i].Passed = (tstRslt.Meters[i].VolumeErrorPct >= tstRslt.ErrLimLo + tstRslt.Uncertainty)
// && (tstRslt.Meters[i].VolumeErrorPct <= tstRslt.ErrLimHi - tstRslt.Uncertainty);
// }
//}
/// Add data - end
@@ -251,8 +251,8 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
if (iPerl == null ||
Math.Abs(oriTestRslt.Meters[i].VolumeErrorPct) <= 0.5f ||
oriTestRslt.Meters[i].VolumeErrorPct < oriTestRslt.ErrLimLo ||
oriTestRslt.Meters[i].VolumeErrorPct > oriTestRslt.ErrLimHi)
oriTestRslt.Meters[i].VolumeErrorPct < oriTestRslt.ErrLimLo + oriTestRslt.Uncertainty ||
oriTestRslt.Meters[i].VolumeErrorPct > oriTestRslt.ErrLimHi - oriTestRslt.Uncertainty)
{
/// Normal meter or iPerl without correction
tstRslt.Meters[i].VolumeStart = oriTestRslt.Meters[i].VolumeStart;