|
@@ -118,6 +118,9 @@ namespace Venus_RT.Modules
|
|
|
}
|
|
|
|
|
|
private TMCycle _TMCycle;
|
|
|
+ private AutoCycle _AutoCycle;
|
|
|
+
|
|
|
+ private bool _isWaitUnload;
|
|
|
|
|
|
public RouteManager()
|
|
|
{
|
|
@@ -341,11 +344,9 @@ namespace Venus_RT.Modules
|
|
|
EFEM?.Initialize();
|
|
|
|
|
|
_TMCycle = new TMCycle();
|
|
|
+ _AutoCycle = new AutoCycle();
|
|
|
|
|
|
BuildTransitionTable();
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
return true;
|
|
|
}
|
|
|
|
|
@@ -353,24 +354,55 @@ namespace Venus_RT.Modules
|
|
|
{
|
|
|
fsm = new StateMachine<RouteManager>(ModuleName.System.ToString(), (int)RtState.Init, 50);
|
|
|
//Init sequence
|
|
|
- Transition(RtState.Init, MSG.HOME, FsmStartHome, RtState.Initializing);
|
|
|
- Transition(RtState.Idle, MSG.HOME, FsmStartHome, RtState.Initializing);
|
|
|
- Transition(RtState.Error, MSG.HOME, FsmStartHome, RtState.Initializing);
|
|
|
+ Transition(RtState.Init, MSG.HOME, FsmStartHome, RtState.Initializing);
|
|
|
+ Transition(RtState.Idle, MSG.HOME, FsmStartHome, RtState.Initializing);
|
|
|
+ Transition(RtState.Error, MSG.HOME, FsmStartHome, RtState.Initializing);
|
|
|
|
|
|
//// EnterExitTransition<RtState, FSM_MSG>(RtState.Initializing, fStartInit, FSM_MSG.NONE, null);
|
|
|
///
|
|
|
- Transition(RtState.Idle, FSM_MSG.TIMER, FsmMonitor, RtState.Idle);
|
|
|
- Transition(RtState.Init, FSM_MSG.TIMER, FsmMonitor, RtState.Init);
|
|
|
+ Transition(RtState.Idle, FSM_MSG.TIMER, FsmMonitor, RtState.Idle);
|
|
|
+ Transition(RtState.Init, FSM_MSG.TIMER, FsmMonitor, RtState.Init);
|
|
|
|
|
|
- Transition(RtState.Initializing, FSM_MSG.TIMER, FsmMonitorHome, RtState.Idle);
|
|
|
- Transition(RtState.Initializing, MSG.ERROR, FsmError, RtState.Error);
|
|
|
- Transition(RtState.Initializing, MSG.ABORT, FsmAbort, RtState.Init);
|
|
|
+ Transition(RtState.Initializing, FSM_MSG.TIMER, FsmMonitorHome, RtState.Idle);
|
|
|
+ Transition(RtState.Initializing, MSG.ERROR, FsmError, RtState.Error);
|
|
|
+ Transition(RtState.Initializing, MSG.ABORT, FsmAbort, RtState.Init);
|
|
|
|
|
|
|
|
|
// TM Cycle
|
|
|
- Transition(RtState.Idle, MSG.TMCycle, FsmStartTMCycle, RtState.TMCycle);
|
|
|
- Transition(RtState.TMCycle, FSM_MSG.TIMER, FsmMonitorTMCycle, RtState.Idle);
|
|
|
- Transition(RtState.TMCycle, MSG.StopCycle, FsmStopTMCycle, RtState.Idle);
|
|
|
+ Transition(RtState.Idle, MSG.TMCycle, FsmStartTMCycle, RtState.TMCycle);
|
|
|
+ Transition(RtState.TMCycle, FSM_MSG.TIMER, FsmMonitorTMCycle, RtState.Idle);
|
|
|
+ Transition(RtState.TMCycle, MSG.StopCycle, FsmStopTMCycle, RtState.Idle);
|
|
|
+
|
|
|
+ //Auto/manual
|
|
|
+ Transition(RtState.Idle, MSG.SetAutoMode, FsmStartAutoTransfer, RtState.AutoIdle);
|
|
|
+
|
|
|
+ Transition(RtState.AutoRunning, FSM_MSG.TIMER, FsmAutoTransfer, RtState.Idle);
|
|
|
+ Transition(RtState.AutoRunning, MSG.ABORT, FsmAbortAutoTransfer, RtState.Idle);
|
|
|
+ //Transition(RtState.AutoRunning, MSG.SetManualMode, FsmStartSetManualMode, RtState.Idle);
|
|
|
+ Transition(RtState.AutoRunning, MSG.JobDone, FsmJobDone, RtState.AutoIdle);
|
|
|
+ //Transition(RtState.AutoRunning, MSG.CassetteLeave, fCassetteLeave, RtState.AutoRunning); //For unload light control off afer job done
|
|
|
+
|
|
|
+ Transition(RtState.AutoRunning, MSG.CreateJob, FsmCreateJob, RtState.AutoRunning);
|
|
|
+ Transition(RtState.AutoRunning, MSG.StartJob, FsmStartJob, RtState.AutoRunning);
|
|
|
+ Transition(RtState.AutoRunning, MSG.PauseJob, FsmPauseJob, RtState.AutoRunning);
|
|
|
+ Transition(RtState.AutoRunning, MSG.ResumeJob, FsmResumeJob, RtState.AutoRunning);
|
|
|
+ Transition(RtState.AutoRunning, MSG.StopJob, FsmStopJob, RtState.AutoRunning);
|
|
|
+ Transition(RtState.AutoRunning, MSG.AbortJob, FsmAbortJob, RtState.AutoRunning);
|
|
|
+
|
|
|
+ Transition(RtState.AutoRunning, MSG.Map, FsmMap, RtState.AutoRunning);
|
|
|
+
|
|
|
+ Transition(RtState.AutoRunning, MSG.ResetIdleCleanTime, FsmResetIdleCleanTime, RtState.AutoRunning);
|
|
|
+ Transition(RtState.AutoRunning, MSG.ResetIdlePurgeTime, FsmResetIdlePurgeTime, RtState.AutoRunning);
|
|
|
+
|
|
|
+ Transition(RtState.AutoIdle, FSM_MSG.TIMER, FsmMonitorAutoIdle, RtState.AutoIdle);
|
|
|
+ Transition(RtState.AutoIdle, MSG.SetManualMode, FsmStartSetManualMode, RtState.Idle);
|
|
|
+ Transition(RtState.AutoIdle, MSG.CreateJob, FsmCreateJob, RtState.AutoIdle);
|
|
|
+ Transition(RtState.AutoIdle, MSG.StartJob, FsmStartJob, RtState.AutoRunning);
|
|
|
+ Transition(RtState.AutoIdle, MSG.PauseJob, FsmPauseJob, RtState.AutoIdle);
|
|
|
+ Transition(RtState.AutoIdle, MSG.ResumeJob, FsmResumeJob, RtState.AutoIdle);
|
|
|
+ Transition(RtState.AutoIdle, MSG.StopJob, FsmStopJob, RtState.AutoIdle);
|
|
|
+ Transition(RtState.AutoIdle, MSG.AbortJob, FsmAbortJob, RtState.AutoIdle);
|
|
|
+ Transition(RtState.AutoIdle, MSG.Map, FsmMap, RtState.AutoIdle);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -452,6 +484,96 @@ namespace Venus_RT.Modules
|
|
|
_TMCycle.Abort();
|
|
|
return true;
|
|
|
}
|
|
|
+
|
|
|
+ private bool FsmStartAutoTransfer(object[] objs)
|
|
|
+ {
|
|
|
+ return _AutoCycle.Start(objs) == RState.Running;
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool FsmAutoTransfer(object[] objs)
|
|
|
+ {
|
|
|
+ RState ret = _AutoCycle.Monitor();
|
|
|
+
|
|
|
+ if (_AutoCycle.CheckJobJustDone(out string jobInfo))
|
|
|
+ {
|
|
|
+ EV.PostPopDialogMessage(EventLevel.InformationNoDelay, "Job complete", jobInfo);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (_AutoCycle.CheckAllJobDone())
|
|
|
+ {
|
|
|
+ if (!CheckToPostMessage((int)MSG.JobDone))
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ _isWaitUnload = (bool)DATA.Poll("LP1.NotifyJobDone") || (bool)DATA.Poll("LP2.NotifyJobDone");
|
|
|
+
|
|
|
+ return ret == RState.End;
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool FsmAbortAutoTransfer(object[] objs)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool FsmJobDone(object[] objs)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool FsmCreateJob(object[] objs)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool FsmStartJob(object[] objs)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool FsmPauseJob(object[] objs)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool FsmResumeJob(object[] objs)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool FsmStopJob(object[] objs)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool FsmAbortJob(object[] objs)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool FsmMap(object[] objs)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool FsmResetIdleCleanTime(object[] objs)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool FsmResetIdlePurgeTime(object[] objs)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool FsmMonitorAutoIdle(object[] objs)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool FsmStartSetManualMode(object[] objs)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
private void _debugRoutine()
|
|
|
{
|
|
|
int flag = 0;
|
|
@@ -464,8 +586,6 @@ namespace Venus_RT.Modules
|
|
|
{
|
|
|
PostMsg(MSG.TMCycle);
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|