|
@@ -4,6 +4,7 @@ using Aitex.Core.RT.Fsm;
|
|
|
using Aitex.Core.RT.Log;
|
|
|
using Aitex.Core.RT.OperationCenter;
|
|
|
using Aitex.Core.RT.RecipeCenter;
|
|
|
+using Aitex.Core.RT.Routine;
|
|
|
using Aitex.Core.Util;
|
|
|
using Aitex.Core.Utilities;
|
|
|
using CyberX12_RT.Modules.VpwCell;
|
|
@@ -226,36 +227,36 @@ namespace PunkHPX8_RT.Modules.VpwMain
|
|
|
{
|
|
|
fsm = new StateMachine<VpwCellEntity>(Module.ToString(), (int)VPWCellState.Init, 100);
|
|
|
fsm.EnableRepeatedMsg(true);
|
|
|
- AnyStateTransition(VpwCellMsg.Error, NullFunc, VPWCellState.Error);
|
|
|
+ AnyStateTransition(VPWCellMsg.Error, NullFunc, VPWCellState.Error);
|
|
|
//Initialized
|
|
|
- Transition(VPWCellState.Error, VpwCellMsg.Initialize, InitializeAll, VPWCellState.Initializing);
|
|
|
- Transition(VPWCellState.Init, VpwCellMsg.Initialize, InitializeAll, VPWCellState.Initializing);
|
|
|
- Transition(VPWCellState.Idle, VpwCellMsg.Initialize, InitializeAll, VPWCellState.Initializing);
|
|
|
+ Transition(VPWCellState.Error, VPWCellMsg.Initialize, InitializeAll, VPWCellState.Initializing);
|
|
|
+ Transition(VPWCellState.Init, VPWCellMsg.Initialize, InitializeAll, VPWCellState.Initializing);
|
|
|
+ Transition(VPWCellState.Idle, VPWCellMsg.Initialize, InitializeAll, VPWCellState.Initializing);
|
|
|
Transition(VPWCellState.Initializing, FSM_MSG.TIMER, InitializeAllMonitor, VPWCellState.Idle);
|
|
|
- Transition(VPWCellState.Error, VpwCellMsg.EnterIdle, NullFunc, VPWCellState.Idle);
|
|
|
- Transition(VPWCellState.Init, VpwCellMsg.EnterIdle, NullFunc, VPWCellState.Idle);
|
|
|
- Transition(VPWCellState.Idle, VpwCellMsg.EnterIdle, NullFunc, VPWCellState.Idle);
|
|
|
+ Transition(VPWCellState.Error, VPWCellMsg.EnterIdle, NullFunc, VPWCellState.Idle);
|
|
|
+ Transition(VPWCellState.Init, VPWCellMsg.EnterIdle, NullFunc, VPWCellState.Idle);
|
|
|
+ Transition(VPWCellState.Idle, VPWCellMsg.EnterIdle, NullFunc, VPWCellState.Idle);
|
|
|
//Enter Init
|
|
|
- Transition(VPWCellState.Idle, VpwCellMsg.Init, NullFunc, VPWCellState.Init);
|
|
|
+ Transition(VPWCellState.Idle, VPWCellMsg.Init, NullFunc, VPWCellState.Init);
|
|
|
//Cycle Manual Process
|
|
|
- Transition(VPWCellState.Idle, VpwCellMsg.CycleProcessRecipe, CycleManualProcess, VPWCellState.CycleManualProcessing);
|
|
|
+ Transition(VPWCellState.Idle, VPWCellMsg.CycleProcessRecipe, CycleManualProcess, VPWCellState.CycleManualProcessing);
|
|
|
Transition(VPWCellState.CycleManualProcessing, FSM_MSG.TIMER, CycleManualMonitor, VPWCellState.Idle);
|
|
|
//Prepare
|
|
|
- Transition(VPWCellState.Idle, VpwCellMsg.Prepare, Prepare, VPWCellState.Preparing);
|
|
|
+ Transition(VPWCellState.Idle, VPWCellMsg.Prepare, Prepare, VPWCellState.Preparing);
|
|
|
Transition(VPWCellState.Preparing, FSM_MSG.TIMER, PrepareMonitor, VPWCellState.WaitForRunRecipe);
|
|
|
- Transition(VPWCellState.WaitForRunRecipe, VpwCellMsg.RunRecipe, RunRecipe, VPWCellState.RunReciping);
|
|
|
+ Transition(VPWCellState.WaitForRunRecipe, VPWCellMsg.RunRecipe, RunRecipe, VPWCellState.RunReciping);
|
|
|
Transition(VPWCellState.RunReciping, FSM_MSG.TIMER, RunRecipeMonitor, VPWCellState.Idle);
|
|
|
|
|
|
//Retry
|
|
|
- Transition(VPWCellState.Error, VpwCellMsg.Retry, NullFunc, VPWCellState.Retrying);
|
|
|
+ Transition(VPWCellState.Error, VPWCellMsg.Retry, NullFunc, VPWCellState.Retrying);
|
|
|
Transition(VPWCellState.Retrying, FSM_MSG.TIMER, VpwCellRetry, VPWCellState.Retrying);
|
|
|
- Transition(VPWCellState.Retrying, VpwCellMsg.Prepare, RetryPrepare, VPWCellState.Preparing);
|
|
|
- Transition(VPWCellState.Retrying, VpwCellMsg.RunRecipe, RetryRunRecipe, VPWCellState.RunReciping);
|
|
|
+ Transition(VPWCellState.Retrying, VPWCellMsg.Prepare, RetryPrepare, VPWCellState.Preparing);
|
|
|
+ Transition(VPWCellState.Retrying, VPWCellMsg.RunRecipe, RetryRunRecipe, VPWCellState.RunReciping);
|
|
|
|
|
|
|
|
|
EnumLoop<VPWCellState>.ForEach((item) => { fsm.MapState((int)item, item.ToString()); });
|
|
|
|
|
|
- EnumLoop<VpwCellMsg>.ForEach((item) => { fsm.MapMessage((int)item, item.ToString()); });
|
|
|
+ EnumLoop<VPWCellMsg>.ForEach((item) => { fsm.MapMessage((int)item, item.ToString()); });
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 初始化数据
|
|
@@ -295,8 +296,8 @@ namespace PunkHPX8_RT.Modules.VpwMain
|
|
|
/// </summary>
|
|
|
private void InitializeOperation()
|
|
|
{
|
|
|
- OP.Subscribe($"{Module}.InitializeAll", (cmd, args) => { return CheckToPostMessage<VPWCellState, VpwCellMsg>(eEvent.ERR_VPW, Module.ToString(), (int)VpwCellMsg.Initialize); });
|
|
|
- OP.Subscribe($"{Module}.Prepare", (cmd, args) => { return CheckToPostMessage<VPWCellState, VpwCellMsg>(eEvent.ERR_VPW, Module.ToString(), (int)VpwCellMsg.Prepare); });
|
|
|
+ OP.Subscribe($"{Module}.InitializeAll", (cmd, args) => { return CheckToPostMessage<VPWCellState, VPWCellMsg>(eEvent.ERR_VPW, Module.ToString(), (int)VPWCellMsg.Initialize); });
|
|
|
+ OP.Subscribe($"{Module}.Prepare", (cmd, args) => { return CheckToPostMessage<VPWCellState, VPWCellMsg>(eEvent.ERR_VPW, Module.ToString(), (int)VPWCellMsg.Prepare); });
|
|
|
OP.Subscribe($"{Module}.CycleManualProcessRecipe", (cmd, args) =>
|
|
|
{
|
|
|
VpwRecipe recipe = RecipeFileManager.Instance.LoadGenericityRecipe<VpwRecipe>(args[0].ToString());
|
|
@@ -311,7 +312,7 @@ namespace PunkHPX8_RT.Modules.VpwMain
|
|
|
{
|
|
|
objects[i] = args[i];
|
|
|
}
|
|
|
- return CheckToPostMessage<VPWCellState, VpwCellMsg>(eEvent.ERR_PREWET, Module.ToString(), (int)VpwCellMsg.CycleProcessRecipe, objects);
|
|
|
+ return CheckToPostMessage<VPWCellState, VPWCellMsg>(eEvent.ERR_PREWET, Module.ToString(), (int)VPWCellMsg.CycleProcessRecipe, objects);
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -338,7 +339,7 @@ namespace PunkHPX8_RT.Modules.VpwMain
|
|
|
}
|
|
|
}
|
|
|
VpwMainEntity vpwMainEntity = Singleton<RouteManager>.Instance.GetModule<VpwMainEntity>(ModuleName.VPWMain1.ToString());
|
|
|
- if (vpwMainEntity.IsBusy)
|
|
|
+ if (vpwMainEntity!=null&&vpwMainEntity.IsBusy)
|
|
|
{
|
|
|
LOG.WriteLog(eEvent.ERR_VPW, Module.ToString(), $"VPWMain is busy,cannot initialize");
|
|
|
return false;
|
|
@@ -355,7 +356,7 @@ namespace PunkHPX8_RT.Modules.VpwMain
|
|
|
RState ret = _homeRoutine.Monitor();
|
|
|
if (ret == RState.Failed || ret == RState.Timeout)
|
|
|
{
|
|
|
- PostMsg(VpwCellMsg.Error);
|
|
|
+ PostMsg(VPWCellMsg.Error);
|
|
|
return false;
|
|
|
}
|
|
|
|
|
@@ -384,10 +385,10 @@ namespace PunkHPX8_RT.Modules.VpwMain
|
|
|
RState ret = _prepareRoutine.Monitor();
|
|
|
if (ret == RState.Failed || ret == RState.Timeout)
|
|
|
{
|
|
|
- AlarmList alarmList = new AlarmList(Module.ToString(), ((VPWCellState)fsm.State).ToString(), (int)VpwCellMsg.Prepare,
|
|
|
+ AlarmList alarmList = new AlarmList(Module.ToString(), ((VPWCellState)fsm.State).ToString(), (int)VPWCellMsg.Prepare,
|
|
|
_prepareRoutine.ErrorMsg, _prepareRoutine.ErrorStep, (int)AlarmType.Error);
|
|
|
AlarmListManager.Instance.AddAlarm(alarmList);
|
|
|
- PostMsg(VpwCellMsg.Error);
|
|
|
+ PostMsg(VPWCellMsg.Error);
|
|
|
return false;
|
|
|
}
|
|
|
|
|
@@ -428,10 +429,10 @@ namespace PunkHPX8_RT.Modules.VpwMain
|
|
|
RState ret = _recipeRoutine.Monitor();
|
|
|
if (ret == RState.Failed || ret == RState.Timeout)
|
|
|
{
|
|
|
- AlarmList alarmList = new AlarmList(Module.ToString(), ((VPWCellState)fsm.State).ToString(), (int)VpwCellMsg.RunRecipe,
|
|
|
+ AlarmList alarmList = new AlarmList(Module.ToString(), ((VPWCellState)fsm.State).ToString(), (int)VPWCellMsg.RunRecipe,
|
|
|
_recipeRoutine.ErrorMsg, _recipeRoutine.ErrorStep, (int)AlarmType.Error);
|
|
|
AlarmListManager.Instance.AddAlarm(alarmList);
|
|
|
- PostMsg(VpwCellMsg.Error);
|
|
|
+ PostMsg(VPWCellMsg.Error);
|
|
|
return false;
|
|
|
}
|
|
|
|
|
@@ -483,7 +484,7 @@ namespace PunkHPX8_RT.Modules.VpwMain
|
|
|
_currentStateMachine = _cycleManualProcessRoutine.CurrentStateMachine;
|
|
|
if (state == RState.Failed || state == RState.Timeout)
|
|
|
{
|
|
|
- PostMsg(VpwCellMsg.Error);
|
|
|
+ PostMsg(VPWCellMsg.Error);
|
|
|
_currentStateMachine = "Error";
|
|
|
_currentStatus = "Error";
|
|
|
|
|
@@ -523,7 +524,7 @@ namespace PunkHPX8_RT.Modules.VpwMain
|
|
|
AlarmList alarmList = AlarmListManager.Instance.GetAlarmListByModule(Module.ToString());
|
|
|
if (alarmList != null)
|
|
|
{
|
|
|
- CheckToPostMessage<VPWCellState, VpwCellMsg>(eEvent.WARN_VPW, Module.ToString(), alarmList.ModuleCmd,
|
|
|
+ CheckToPostMessage<VPWCellState, VPWCellMsg>(eEvent.WARN_VPW, Module.ToString(), alarmList.ModuleCmd,
|
|
|
alarmList.ModuleStep);
|
|
|
}
|
|
|
return false;
|