Default action and stopping the FM-controlled pump
moved to SequenceBase.Transition(sequence, context). Sequences cleaned-up.
This commit is contained in:
+8
-58
@@ -36,28 +36,11 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
||||
//====================================
|
||||
// Transition or SetRoute - Start
|
||||
//====================================
|
||||
if (transitionStart != null)
|
||||
switch (Transition(transitionStart, TransitionContext.TestStart))
|
||||
{
|
||||
switch (Transition(transitionStart, "FlyingStartCollectionMethod : " + Strings.Test_start_sequence_i_n))
|
||||
{
|
||||
case Event.Error: goto error;
|
||||
case Event.UiCmdStop: goto stopTestAndRunningWater;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//--------------------------------
|
||||
State.Create("FlyingStartCollectionMethod : Setting the route")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(cBrd.SetValvesOp(GenericDevices.ValveBase.Merge(inPath.ValvesOpen, benchPath.ValvesOpen, outPath.ValvesOpen),
|
||||
GenericDevices.ValveBase.Merge(inPath.ValvesClose, benchPath.ValvesClose, outPath.ValvesClose)))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (e.Contains(Event.UiCmdStop)) goto stopTestAndRunningWater;
|
||||
}
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
case Event.Error: goto error;
|
||||
case Event.UiCmdStop: goto stopTestAndRunningWater;
|
||||
default: break;
|
||||
}
|
||||
|
||||
//====================================
|
||||
@@ -374,47 +357,14 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
||||
}
|
||||
while (!e.Contains(Event.PreviousStopped));
|
||||
|
||||
|
||||
stopTestAndRunningWater:
|
||||
///--------------------------------
|
||||
/// Transition or SetRoute - End
|
||||
if (transitionStop != null)
|
||||
{
|
||||
switch (Transition(transitionStop, "FlyingStartCollectionMethod : " + Strings.Test_stop_sequence_i_n))
|
||||
{
|
||||
case Event.Error: goto error;
|
||||
case Event.UiCmdStop: goto stopTestAndRunningWater;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
State.Create("FlyingStartCollectionMethod : Test(s) completed -> Closing the valves")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(cBrd.SetValvesOp(StateMachine.DefaultValvesOpen, StateMachine.DefaultValvesClose))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (e.Contains(Event.Error)) goto error;
|
||||
}
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
}
|
||||
|
||||
///--------------------------------
|
||||
/// Stop the pump
|
||||
cBrd.SetFMFreq(0, 0); /// Stop FM controlled pumps
|
||||
State.Create("FlyingStartCollectionMethod : Test(s) completed -> Stopping the pump")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation((inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOff() : null)
|
||||
.AddOperation(cBrd.SetValvesOp(null, inPath.Pump))
|
||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||
.EnterState();
|
||||
do
|
||||
/// Transition sequence at the end of test
|
||||
switch (Transition(transitionStop, TransitionContext.TestEnd))
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (e.Contains(Event.Error)) goto error;
|
||||
case Event.Error: goto error;
|
||||
case Event.UiCmdStop: goto stopTestAndRunningWater;
|
||||
}
|
||||
while (!e.Contains(Event.ValvesSet) || ((inPath.Pump is GenericDevices.IPumpFM) && !e.Contains(Event.TurnPumpOnOffDone)));
|
||||
|
||||
/// Create the return value - a list with one event Event.Done - and return
|
||||
IList<Event> retval = new List<Event>();
|
||||
|
||||
Reference in New Issue
Block a user