|
@@ -173,6 +173,7 @@ namespace JetMainframe.VCEs
|
|
|
});
|
|
|
|
|
|
OP.Subscribe($"{_modulename}.HOME", (cmd, args) => { PostMsg(VceMSG.Home); return true; });
|
|
|
+ OP.Subscribe($"{_modulename}.HOMEAxis", (cmd, args) => { PostMsg(VceMSG.HomeAxis,args); return true; });
|
|
|
OP.Subscribe($"{_modulename}.DoorOpen", (cmd, args) => { PostMsg(VceMSG.DoorOpen); return true; });
|
|
|
OP.Subscribe($"{_modulename}.DoorClose", (cmd, args) => { PostMsg(VceMSG.DoorClose); return true; });
|
|
|
OP.Subscribe($"{_modulename}.Map", (cmd, args) => { PostMsg(VceMSG.Map); return true; });
|
|
@@ -231,6 +232,17 @@ namespace JetMainframe.VCEs
|
|
|
Transition(VceSTATE.Homing, FSM_MSG.TIMER, fnHomeTimeout, VceSTATE.Idle);
|
|
|
Transition(VceSTATE.Homing, VceMSG.Abort, fnAbortHome, VceSTATE.Init);
|
|
|
|
|
|
+ //HOME Axis->homing
|
|
|
+ Transition(VceSTATE.Init, VceMSG.HomeAxis, fnStartHomeAxis, VceSTATE.HomingAxisInInit);
|
|
|
+ Transition(VceSTATE.Idle, VceMSG.HomeAxis, fnStartHomeAxis, VceSTATE.HomingAxisInIdle);
|
|
|
+ Transition(VceSTATE.Error, VceMSG.HomeAxis, fnStartHomeAxis, VceSTATE.HomingAxisInError);
|
|
|
+ Transition(VceSTATE.HomingAxisInInit, FSM_MSG.TIMER, fnHomingAxisTimeout, VceSTATE.Init);
|
|
|
+ Transition(VceSTATE.HomingAxisInIdle, FSM_MSG.TIMER, fnHomingAxisTimeout, VceSTATE.Idle);
|
|
|
+ Transition(VceSTATE.HomingAxisInError, FSM_MSG.TIMER, fnHomingAxisTimeout, VceSTATE.Error);
|
|
|
+ Transition(VceSTATE.HomingAxisInInit, VceMSG.Abort, fnAbortHomeAxis, VceSTATE.Init);
|
|
|
+ Transition(VceSTATE.HomingAxisInIdle, VceMSG.Abort, fnAbortHomeAxis, VceSTATE.Idle);
|
|
|
+ Transition(VceSTATE.HomingAxisInError, VceMSG.Abort, fnAbortHomeAxis, VceSTATE.Error);
|
|
|
+
|
|
|
//Open Door 开门
|
|
|
Transition(VceSTATE.Idle, VceMSG.DoorOpen, fnStartOpenDoor, VceSTATE.DoorOpenning);
|
|
|
Transition(VceSTATE.DoorOpenning, FSM_MSG.TIMER, fnOpenDoorTimeout, VceSTATE.Idle);
|
|
@@ -702,6 +714,30 @@ namespace JetMainframe.VCEs
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+ private bool fnStartHomeAxis(object[] param)
|
|
|
+ {
|
|
|
+ if (param.Length == 1)
|
|
|
+ return _vce.Home(param[0].ToString());
|
|
|
+ else
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool fnHomingAxisTimeout(object[] param)
|
|
|
+ {
|
|
|
+ if (_vce.Status == RState.Timeout || _vce.Status == RState.Failed)
|
|
|
+ {
|
|
|
+ PostMsg(VceMSG.Error);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return _vce.Status == RState.End;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ private bool fnAbortHomeAxis(object[] param)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
private bool fnStartHome(object[] param)
|
|
|
{
|
|
|
if (!DoorIsLocked())
|