Events.EndSession added, after S640Communication at the end 'End session' is invoked automatically.
This commit is contained in:
@@ -18,7 +18,7 @@ namespace TBF.Rig.TestMethods.S640Communication
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(S640CommSeq));
|
||||
|
||||
|
||||
System.Windows.Forms.Form modelessDlg;
|
||||
S640CommForm modelessDlg;
|
||||
///
|
||||
delegate void S640CommFormDlgt(S640CommSeq myRef, S640Activity activity, I640Cfg config, ProcParams procParams, Test test);
|
||||
///
|
||||
@@ -64,6 +64,7 @@ namespace TBF.Rig.TestMethods.S640Communication
|
||||
|
||||
bool stopPressed = false; /// true when STOP button pressed
|
||||
bool completed = false;
|
||||
bool isSealedOK = false;
|
||||
|
||||
State.Create("iPerlCommunicationSeq : Wait until the entry form is closed")
|
||||
.AddOperation(checkUiOp)
|
||||
@@ -71,8 +72,8 @@ namespace TBF.Rig.TestMethods.S640Communication
|
||||
do {
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
stopPressed = TestAndLogUiCmdStop(test,e);
|
||||
completed = (modelessDlg is GenericDevices.IHasCompleted)
|
||||
&& (modelessDlg as GenericDevices.IHasCompleted).Completed;
|
||||
completed = modelessDlg.Completed;
|
||||
isSealedOK = modelessDlg.IsSealedOk;
|
||||
}
|
||||
while (!stopPressed && !completed);
|
||||
|
||||
@@ -89,7 +90,9 @@ namespace TBF.Rig.TestMethods.S640Communication
|
||||
/// Test 'Quit'
|
||||
modelessDlg = null; /// Modeless dialog is closed now
|
||||
|
||||
return new List<Event> { Event.Done };
|
||||
bool endSession = (activity == S640Activity.End) && (config is S640EndCfg) && (config as S640EndCfg).EndSessionWhenCompleted && isSealedOK;
|
||||
|
||||
return endSession ? new List<Event> { Event.EndSession } : new List<Event> { Event.Done };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user