Bug fixes in test method sequences : return missing in case of a configuration error.

This commit is contained in:
Milan Hanajik
2022-01-17 15:28:18 +01:00
parent 32762f0fdb
commit fe9cfa42ff
7 changed files with 27 additions and 32 deletions
@@ -81,7 +81,7 @@ namespace TBF.Rig.TestMethods.FixedStart
if (rangeIx == -1)
{
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
new List<Event> { Event.ConfigurationError };
return new List<Event> { Event.ConfigurationError };
}
}
@@ -68,7 +68,7 @@ namespace TBF.Rig.TestMethods.FixedStartAdvanced
if (scale == null)
{
Bridge.OnError(this, Strings.Missing_a_scale);
new List<Event> { Event.ConfigurationError };
return new List<Event> { Event.ConfigurationError };
}
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
@@ -88,7 +88,7 @@ namespace TBF.Rig.TestMethods.FixedStartAdvanced
if (rangeIx == -1)
{
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
new List<Event> { Event.ConfigurationError };
return new List<Event> { Event.ConfigurationError };
}
}
@@ -92,7 +92,7 @@ namespace TBF.Rig.TestMethods.FixedStartDeferredEval
if (rangeIx == -1)
{
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
new List<Event> { Event.ConfigurationError };
return new List<Event> { Event.ConfigurationError };
}
}
@@ -100,7 +100,7 @@ namespace TBF.Rig.TestMethods.FixedStartDeferredEval
if (!(dataEntryCmpnt is GenericDevices.IDataEntryForCamera))
{
Bridge.OnError(this, "Wrong DataEntry component");
new List<Event> { Event.ConfigurationError };
return new List<Event> { Event.ConfigurationError };
}
@@ -100,7 +100,7 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollAdvanced
if (rangeIx == -1)
{
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
new List<Event> { Event.ConfigurationError };
return new List<Event> { Event.ConfigurationError };
}
}
else if (outPath.FlowMeter is TBF.Rig.Dummy.FlowMeter.FlowMeter)
@@ -95,7 +95,7 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollDeferredEval
if (scale == null)
{
Bridge.OnError(this, Strings.Missing_a_scale);
new List<Event> { Event.ConfigurationError };
return new List<Event> { Event.ConfigurationError };
}
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
@@ -115,7 +115,7 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollDeferredEval
if (rangeIx == -1)
{
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
new List<Event> { Event.ConfigurationError };
return new List<Event> { Event.ConfigurationError };
}
}
@@ -123,7 +123,7 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollDeferredEval
if (!(dataEntryCmpnt is GenericDevices.IDataEntryForCamera))
{
Bridge.OnError(this, "Wrong DataEntry component");
new List<Event> { Event.ConfigurationError };
return new List<Event> { Event.ConfigurationError };
}
@@ -82,7 +82,7 @@ namespace TBF.Rig.TestMethods.FixedStartTankCollection
if ((outPath.Scale == null) || !(outPath.Scale is IVolumeMeter))
{
Bridge.OnError(this, Strings.Missing_a_tank_with_volume_measurement);
new List<Event> { Event.ConfigurationError };
return new List<Event> { Event.ConfigurationError };
}
IVolumeMeter tank = outPath.Scale as IVolumeMeter;
bool manualLevelMsrmnt = (singleTestParams != null) ? singleTestParams.ManualLevelMsrmnt : compoundTestParams.ManualLevelMsrmnt;
@@ -94,13 +94,14 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
if (eldeFM.RangeEnabled(r) && eldeFM.GetTempLo(r) <= test.TempLimLo && eldeFM.GetTempHi(r) >= test.TempLimHi)
{
rangeIx = r;
break;
}
}
if (rangeIx == -1)
{
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
new List<Event> { Event.ConfigurationError };
return new List<Event> { Event.ConfigurationError };
}
}
@@ -218,7 +219,6 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
while (!e.Contains(Event.ValvesSet));
//------------------------------------------------
Bridge.OnActivity(this, Strings.Starting_the_pump);
//------------------------------------------------
@@ -241,8 +241,7 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Progress.FlowSetting));
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
}
while (e.Contains(Event.ValvesBusy) /* || !e.Contains(Event.AllPositionsReached)*/);
@@ -277,7 +276,7 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
do {
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
}
while (!e.Contains(Event.ValvesSet));
}
@@ -351,7 +350,7 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Progress.FlowSetting));
if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; }
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
if (e.Contains(Event.RegulValveTimeOut))
{
Bridge.OnError(this, Strings.Flow_adjustment_failed);
@@ -365,10 +364,9 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
}
while (!e.Contains(Event.FlowReached));
///
/// Flow is withing required range at this point
///
///
/// Flow is withing required range at this point
///
int flowSetTime = StateMachine.Time - flowSetTime0;
if (heatMetersTestParams != null && heatMetersPath != null)
@@ -445,9 +443,9 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
while (true);
}
///
/// Temperature is withing required range at this point
///
///
/// Temperature is withing required range at this point
///
//-----------------------------------------------------------------
Bridge.OnActivity(this, Strings.Stopping_flow_for_the_fixed_start);
@@ -460,7 +458,6 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
IOperation testInProgress = cBrd.StandingStartStopTestOp(test, 2 * totalPulses, true);
IOperation controlFlowOp = cBrd.SetFlowOp(test.Qfrom, test.Qto, RefFlow, int.MaxValue);
@@ -535,13 +532,12 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
}
}
state2.EnterState();
do
{
do {
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Progress.Test));
if (e.Contains(Event.Error)) { retVal = Event.Error; break; }
if (e.Contains(Event.Error)) { retVal = Event.Error; break; }
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; break; }
}
while (e.Contains(Event.CameraBusy));
@@ -557,8 +553,7 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
.AddOperation(testInProgress)
.AddOperation((dataEntryCmpnt as GenericDevices.IHasWMStatesForm).ShowTestStartFormOp(sensPath.RegisterReaders))
.EnterState();
do
{
do {
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
}
@@ -676,8 +671,8 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
do {
e = StateMachine.WaitRunDevsRunOps();
if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; }
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
/// Show remaining time
if ((remainingTime = Math.Max(estimtdEndTime - StateMachine.Time, 0)) > 60)
@@ -970,7 +965,7 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
tstRslt.ConstMasterCorr = 1; /// Corrected master pulses per liter
tstRslt.ConstMaster = 1;
}
/// Calculated master pulses per liter
/// Calculated master pulses per lite
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.FlowMean = (float)RefFlowStat.Average;