Events.EndSession added, after S640Communication at the end 'End session' is invoked automatically.

This commit is contained in:
Milan Hanajik
2022-01-06 08:00:07 +01:00
parent 4d018a8ba8
commit af13e2f2b4
5 changed files with 54 additions and 7 deletions
@@ -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 };
}
}
}