|
@@ -99,6 +99,22 @@ namespace Venus_RT.Modules
|
|
|
|
|
|
public bool IsATM { get { return _JetTM.IsModuleATM(Module); } }
|
|
|
|
|
|
+ public override int TimeToReady
|
|
|
+ {
|
|
|
+ get
|
|
|
+ {
|
|
|
+ switch ((STATE)fsm.State)
|
|
|
+ {
|
|
|
+ case STATE.Pumping:
|
|
|
+ case STATE.Venting:
|
|
|
+ return base.TimeToReady;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return int.MaxValue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private readonly JetTM _JetTM;
|
|
|
private readonly MFPumpRoutine _pumpingRoutine;
|
|
|
private readonly MFVentRoutine _ventingRoutine;
|
|
@@ -154,61 +170,61 @@ namespace Venus_RT.Modules
|
|
|
fsm = new StateMachine<LLEntity>(Module.ToString(), (int)STATE.Init, 50);
|
|
|
fsm.EnableRepeatedMsg(true);
|
|
|
|
|
|
- EnterExitTransition<STATE, FSM_MSG>(STATE.Ready_For_TM, fnEnterTMReady, FSM_MSG.NONE, fnExitTMReady);
|
|
|
- EnterExitTransition<STATE, FSM_MSG>(STATE.Ready_For_EFEM, fnEnterEFEMReady, FSM_MSG.NONE, fnExitEFEMReady);
|
|
|
+ EnterExitTransition<STATE, FSM_MSG>(STATE.Ready_For_TM, fnEnterTMReady, FSM_MSG.NONE, fnExitTMReady);
|
|
|
+ EnterExitTransition<STATE, FSM_MSG>(STATE.Ready_For_EFEM, fnEnterEFEMReady, FSM_MSG.NONE, fnExitEFEMReady);
|
|
|
|
|
|
//AnyStateTransition(FSM_MSG.TIMER, fnMonitor, FSM_STATE.SAME);
|
|
|
|
|
|
|
|
|
- AnyStateTransition(MSG.Error, fnError, STATE.Error);
|
|
|
- AnyStateTransition(MSG.Online, fnOnline, FSM_STATE.SAME);
|
|
|
- AnyStateTransition(MSG.Offline, fnOffline, FSM_STATE.SAME);
|
|
|
- AnyStateTransition(MSG.Home, fnHome, STATE.Initializing);
|
|
|
+ AnyStateTransition(MSG.Error, fnError, STATE.Error);
|
|
|
+ AnyStateTransition(MSG.Online, fnOnline, FSM_STATE.SAME);
|
|
|
+ AnyStateTransition(MSG.Offline, fnOffline, FSM_STATE.SAME);
|
|
|
+ AnyStateTransition(MSG.Home, fnHome, STATE.Initializing);
|
|
|
|
|
|
// Home
|
|
|
- Transition(STATE.Initializing, FSM_MSG.TIMER, fnHoming, STATE.Idle);
|
|
|
+ Transition(STATE.Initializing, FSM_MSG.TIMER, fnHoming, STATE.Idle);
|
|
|
|
|
|
- Transition(STATE.Idle, FSM_MSG.TIMER, fnMonitor, STATE.Idle);
|
|
|
- Transition(STATE.Init, FSM_MSG.TIMER, fnMonitor, STATE.Init);
|
|
|
+ Transition(STATE.Idle, FSM_MSG.TIMER, fnMonitor, STATE.Idle);
|
|
|
+ Transition(STATE.Init, FSM_MSG.TIMER, fnMonitor, STATE.Init);
|
|
|
|
|
|
//vent sequence
|
|
|
- Transition(STATE.Idle, MSG.Vent, FnStartVent, STATE.Venting);
|
|
|
- Transition(STATE.Venting, FSM_MSG.TIMER, FnVentTimeout, STATE.Idle);
|
|
|
- Transition(STATE.Venting, MSG.Abort, FnAbortVent, STATE.Idle);
|
|
|
+ Transition(STATE.Idle, MSG.Vent, FnStartVent, STATE.Venting);
|
|
|
+ Transition(STATE.Venting, FSM_MSG.TIMER, FnVentTimeout, STATE.Idle);
|
|
|
+ Transition(STATE.Venting, MSG.Abort, FnAbortVent, STATE.Idle);
|
|
|
|
|
|
//Pump sequence
|
|
|
- Transition(STATE.Idle, MSG.Pump, FnStartPump, STATE.Pumping);
|
|
|
- Transition(STATE.Pumping, FSM_MSG.TIMER, FnPumpTimeout, STATE.Idle);
|
|
|
- Transition(STATE.Pumping, MSG.Abort, FnAbortPump, STATE.Idle);
|
|
|
+ Transition(STATE.Idle, MSG.Pump, FnStartPump, STATE.Pumping);
|
|
|
+ Transition(STATE.Pumping, FSM_MSG.TIMER, FnPumpTimeout, STATE.Idle);
|
|
|
+ Transition(STATE.Pumping, MSG.Abort, FnAbortPump, STATE.Idle);
|
|
|
|
|
|
// Purge sequence
|
|
|
- Transition(STATE.Idle, MSG.Purge, FnStartPurge, STATE.Purging);
|
|
|
- Transition(STATE.Purging, FSM_MSG.TIMER, FnPurgeTimeout, STATE.Idle);
|
|
|
- Transition(STATE.Purging, MSG.Abort, FnAbortPurge, STATE.Idle);
|
|
|
+ Transition(STATE.Idle, MSG.Purge, FnStartPurge, STATE.Purging);
|
|
|
+ Transition(STATE.Purging, FSM_MSG.TIMER, FnPurgeTimeout, STATE.Idle);
|
|
|
+ Transition(STATE.Purging, MSG.Abort, FnAbortPurge, STATE.Idle);
|
|
|
|
|
|
// Leak check sequence
|
|
|
- Transition(STATE.Idle, MSG.LeakCheck, FnStartLeakCheck, STATE.LeakCheck);
|
|
|
- Transition(STATE.LeakCheck, FSM_MSG.TIMER, FnLeakCheckTimeout, STATE.Idle);
|
|
|
- Transition(STATE.LeakCheck, MSG.Abort, FnAbortLeakCheck, STATE.Idle);
|
|
|
+ Transition(STATE.Idle, MSG.LeakCheck, FnStartLeakCheck, STATE.LeakCheck);
|
|
|
+ Transition(STATE.LeakCheck, FSM_MSG.TIMER, FnLeakCheckTimeout, STATE.Idle);
|
|
|
+ Transition(STATE.LeakCheck, MSG.Abort, FnAbortLeakCheck, STATE.Idle);
|
|
|
|
|
|
// Prepare TM Transfer
|
|
|
- Transition(STATE.Idle, MSG.Prepare_TM, FnStartPrepareTM, STATE.Prepare_For_TM);
|
|
|
- Transition(STATE.Prepare_For_TM, FSM_MSG.TIMER, FnPreparaTMTimeout, STATE.Ready_For_TM);
|
|
|
- Transition(STATE.Prepare_For_TM, MSG.Prepare_TM, null, STATE.Prepare_For_TM);
|
|
|
- Transition(STATE.Prepare_For_TM, MSG.Abort, FnAbortPreparaTM, STATE.Idle);
|
|
|
- Transition(STATE.Ready_For_TM, MSG.TM_Exchange_Ready, null, STATE.Idle);
|
|
|
- Transition(STATE.Ready_For_TM, MSG.Prepare_TM, null, STATE.Ready_For_TM);
|
|
|
- Transition(STATE.Ready_For_TM, MSG.Abort, null, STATE.Idle);
|
|
|
- Transition(STATE.Ready_For_TM, MSG.AutoVent, FnTryAutoVent, STATE.Venting);
|
|
|
+ Transition(STATE.Idle, MSG.Prepare_TM, FnStartPrepareTM, STATE.Prepare_For_TM);
|
|
|
+ Transition(STATE.Prepare_For_TM, FSM_MSG.TIMER, FnPreparaTMTimeout, STATE.Ready_For_TM);
|
|
|
+ Transition(STATE.Prepare_For_TM, MSG.Prepare_TM, null, STATE.Prepare_For_TM);
|
|
|
+ Transition(STATE.Prepare_For_TM, MSG.Abort, FnAbortPreparaTM, STATE.Idle);
|
|
|
+ Transition(STATE.Ready_For_TM, MSG.TM_Exchange_Ready, null, STATE.Idle);
|
|
|
+ Transition(STATE.Ready_For_TM, MSG.Prepare_TM, null, STATE.Ready_For_TM);
|
|
|
+ Transition(STATE.Ready_For_TM, MSG.Abort, null, STATE.Idle);
|
|
|
+ Transition(STATE.Ready_For_TM, MSG.AutoVent, FnTryAutoVent, STATE.Venting);
|
|
|
|
|
|
// Prepare EFEM Transfer
|
|
|
- Transition(STATE.Idle, MSG.Prepare_EFEM, FnStartPrepareEFEM, STATE.Prepare_For_EFEM);
|
|
|
- Transition(STATE.Prepare_For_EFEM, FSM_MSG.TIMER, FnPrepareEFEMTimeout, STATE.Ready_For_EFEM);
|
|
|
- Transition(STATE.Prepare_For_EFEM, MSG.Abort, FnAbortPrepareEFEM, STATE.Idle);
|
|
|
- Transition(STATE.Ready_For_EFEM, MSG.EFEM_Exchange_Ready, null, STATE.Idle);
|
|
|
- Transition(STATE.Ready_For_EFEM, MSG.Prepare_EFEM, null, STATE.Ready_For_EFEM);
|
|
|
- Transition(STATE.Ready_For_EFEM, MSG.Abort, null, STATE.Idle);
|
|
|
- Transition(STATE.Ready_For_EFEM, MSG.AutoPump, FnTryAutoPump, STATE.Pumping);
|
|
|
+ Transition(STATE.Idle, MSG.Prepare_EFEM, FnStartPrepareEFEM, STATE.Prepare_For_EFEM);
|
|
|
+ Transition(STATE.Prepare_For_EFEM, FSM_MSG.TIMER, FnPrepareEFEMTimeout, STATE.Ready_For_EFEM);
|
|
|
+ Transition(STATE.Prepare_For_EFEM, MSG.Abort, FnAbortPrepareEFEM, STATE.Idle);
|
|
|
+ Transition(STATE.Ready_For_EFEM, MSG.EFEM_Exchange_Ready, null, STATE.Idle);
|
|
|
+ Transition(STATE.Ready_For_EFEM, MSG.Prepare_EFEM, null, STATE.Ready_For_EFEM);
|
|
|
+ Transition(STATE.Ready_For_EFEM, MSG.Abort, null, STATE.Idle);
|
|
|
+ Transition(STATE.Ready_For_EFEM, MSG.AutoPump, FnTryAutoPump, STATE.Pumping);
|
|
|
|
|
|
//AnyStateTransition(FSM_MSG.TIMER, LLControlPressureTimer_Elapsed, FSM_STATE.SAME);
|
|
|
|
|
@@ -360,6 +376,12 @@ namespace Venus_RT.Modules
|
|
|
|
|
|
private bool fnOnline(object[] param)
|
|
|
{
|
|
|
+ if (!IsInclude)
|
|
|
+ {
|
|
|
+ LOG.Write(eEvent.WARN_LL, Module, $"{Module} is excluded,can not be put online");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
IsOnline = true;
|
|
|
return true;
|
|
|
}
|
|
@@ -378,7 +400,6 @@ namespace Venus_RT.Modules
|
|
|
}
|
|
|
IsInclude = true;
|
|
|
LOG.Write(eEvent.INFO_LL, Module, $"{Module} Set Include Success");
|
|
|
-
|
|
|
return true;
|
|
|
}
|
|
|
private bool FnSetExclude()
|
|
@@ -390,7 +411,6 @@ namespace Venus_RT.Modules
|
|
|
}
|
|
|
IsInclude = false;
|
|
|
LOG.Write(eEvent.INFO_LL, Module, $"{Module} Set Exclude Success");
|
|
|
-
|
|
|
return true;
|
|
|
}
|
|
|
private bool fnAbort(object[] param)
|
|
@@ -434,7 +454,13 @@ namespace Venus_RT.Modules
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- return ret == RState.End;
|
|
|
+ if(ret == RState.End)
|
|
|
+ {
|
|
|
+ MarkStateTime();
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
}
|
|
|
|
|
|
private bool FnAbortVent(object[] param)
|
|
@@ -457,7 +483,13 @@ namespace Venus_RT.Modules
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- return ret == RState.End;
|
|
|
+ if (ret == RState.End)
|
|
|
+ {
|
|
|
+ MarkStateTime();
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
}
|
|
|
|
|
|
private bool FnAbortPump(object[] param)
|