|
@@ -45,6 +45,7 @@ namespace CyberX8_RT.Modules
|
|
|
|
|
|
private bool _isVacuume = false;
|
|
|
private bool _isPause = false;
|
|
|
+ private bool _isResume = false;
|
|
|
|
|
|
public enum STATE
|
|
|
{
|
|
@@ -77,8 +78,6 @@ namespace CyberX8_RT.Modules
|
|
|
ErrorPlacing,
|
|
|
RobotCycleing,
|
|
|
ErrorInitingAL,
|
|
|
- Pause,
|
|
|
- Resumeing
|
|
|
}
|
|
|
|
|
|
public enum MSG
|
|
@@ -132,8 +131,6 @@ namespace CyberX8_RT.Modules
|
|
|
ReadTagData,
|
|
|
WriteTagData,
|
|
|
RobotCycle,
|
|
|
- Pause,
|
|
|
- Resume
|
|
|
|
|
|
|
|
|
}
|
|
@@ -426,12 +423,6 @@ namespace CyberX8_RT.Modules
|
|
|
AnyStateTransition(MSG.CloseBuzzer, fnCloseBuzzer, FSM_STATE.SAME);
|
|
|
AnyStateTransition(MSG.CloseBuzzer, fnCloseBuzzer, FSM_STATE.SAME);
|
|
|
|
|
|
- AnyStateTransition(MSG.Pause, EnterPause, STATE.Pause);
|
|
|
-
|
|
|
- //Resume
|
|
|
- Transition(STATE.Pause, MSG.Resume, EnterResume, STATE.Resumeing);
|
|
|
- Transition(STATE.Resumeing, FSM_MSG.TIMER, fnResumeTimeout, STATE.Init);
|
|
|
-
|
|
|
Transition(STATE.Unknown,MSG.CommReady, fnCommReady, STATE.Init);
|
|
|
//Error
|
|
|
Transition(STATE.Error, MSG.Recover, fnRecover, STATE.Idle);
|
|
@@ -725,6 +716,14 @@ namespace CyberX8_RT.Modules
|
|
|
_isPause = false;
|
|
|
}
|
|
|
}
|
|
|
+ if (_isResume)
|
|
|
+ {
|
|
|
+ bool result = SafeCloseActionTimeout();
|
|
|
+ if (result)
|
|
|
+ {
|
|
|
+ _isResume = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
// robot idle check
|
|
|
_robotIdleTrigger.CLK = _efem.Status != RState.Running;
|
|
|
if (_robotIdleTrigger.Q)
|
|
@@ -1214,6 +1213,17 @@ namespace CyberX8_RT.Modules
|
|
|
return ret == RState.End;
|
|
|
}
|
|
|
|
|
|
+ private bool SafeCloseActionTimeout()
|
|
|
+ {
|
|
|
+ RState ret = _efemSafeCloseRoutine.Monitor();
|
|
|
+ if (ret == RState.Failed || ret == RState.Timeout)
|
|
|
+ {
|
|
|
+ LOG.Write(eEvent.ERR_EFEM_COMMON_FAILED, ModuleName.EFEM, "SafeClose");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return ret == RState.End;
|
|
|
+ }
|
|
|
+
|
|
|
private bool fnMap(object[] param)
|
|
|
{
|
|
|
// module
|
|
@@ -1250,7 +1260,6 @@ namespace CyberX8_RT.Modules
|
|
|
|
|
|
private bool SafeOpenAction(object[] param)
|
|
|
{
|
|
|
- PostMsg(MSG.Pause);
|
|
|
bool result = _efemSafeOpenRoutine.Start() == RState.Running;
|
|
|
if (result)
|
|
|
{
|
|
@@ -1261,8 +1270,12 @@ namespace CyberX8_RT.Modules
|
|
|
|
|
|
private bool SafeCloseAction(object[] param)
|
|
|
{
|
|
|
- CheckToPostMessage<STATE, MSG>(eEvent.ERR_EFEM_COMMON_FAILED, "EFEM", (int)MSG.Resume);
|
|
|
- return _efemSafeCloseRoutine.Start() == RState.Running;
|
|
|
+ bool result = _efemSafeCloseRoutine.Start() == RState.Running;
|
|
|
+ if (result)
|
|
|
+ {
|
|
|
+ _isResume = true;
|
|
|
+ }
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
public bool DoorUnlock(object[] param)
|