|
@@ -5,10 +5,14 @@ using Aitex.Core.RT.Log;
|
|
|
using Aitex.Core.RT.OperationCenter;
|
|
|
using Aitex.Core.Util;
|
|
|
using Aitex.Core.Utilities;
|
|
|
+using MECF.Framework.Common.Alarm;
|
|
|
+using MECF.Framework.Common.CommonData;
|
|
|
using MECF.Framework.Common.Equipment;
|
|
|
using MECF.Framework.Common.Persistent.Temperature;
|
|
|
using MECF.Framework.Common.Persistent.VpwCell;
|
|
|
using MECF.Framework.Common.Persistent.VpwMain;
|
|
|
+using MECF.Framework.Common.RecipeCenter;
|
|
|
+using MECF.Framework.Common.Routine;
|
|
|
using MECF.Framework.Common.SubstrateTrackings;
|
|
|
using MECF.Framework.Common.ToolLayout;
|
|
|
using PunkHPX8_Core;
|
|
@@ -55,6 +59,18 @@ namespace PunkHPX8_RT.Modules.VpwMain
|
|
|
/// Home Routine
|
|
|
/// </summary>
|
|
|
private VPWHomeRoutine _homeRoutine;
|
|
|
+ /// <summary>
|
|
|
+ /// Prepare
|
|
|
+ /// </summary>
|
|
|
+ private VpwPrepareRoutine _prepareRoutine;
|
|
|
+ /// <summary>
|
|
|
+ /// recipe routine
|
|
|
+ /// </summary>
|
|
|
+ private VpwRecipeRoutine _recipeRoutine;
|
|
|
+ /// <summary>
|
|
|
+ /// 手动recipe routine
|
|
|
+ /// </summary>
|
|
|
+ private VpwManualRecipeRoutine _manualRecipeRoutine;
|
|
|
#endregion
|
|
|
|
|
|
#region 属性
|
|
@@ -176,6 +192,20 @@ namespace PunkHPX8_RT.Modules.VpwMain
|
|
|
Transition(VPWCellState.Idle, VpwCellMsg.EnterIdle, NullFunc, VPWCellState.Idle);
|
|
|
//Enter Init
|
|
|
Transition(VPWCellState.Idle, VpwCellMsg.Init, NullFunc, VPWCellState.Init);
|
|
|
+ //Manual Recipe
|
|
|
+ Transition(VPWCellState.Idle, VpwCellMsg.ManualRecipe, ManualRunRecipe, VPWCellState.ManualReciping);
|
|
|
+ Transition(VPWCellState.ManualReciping, FSM_MSG.TIMER, ManualRunRecipeMonitor, VPWCellState.Idle);
|
|
|
+ //Prepare
|
|
|
+ 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.RunReciping, FSM_MSG.TIMER, RunRecipeMonitor, VPWCellState.Idle);
|
|
|
+
|
|
|
+ //Retry
|
|
|
+ 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);
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 初始化数据
|
|
@@ -205,13 +235,17 @@ namespace PunkHPX8_RT.Modules.VpwMain
|
|
|
private void InitializeRoutine()
|
|
|
{
|
|
|
_homeRoutine = new VPWHomeRoutine(Module.ToString());
|
|
|
+ _prepareRoutine=new VpwPrepareRoutine(Module.ToString());
|
|
|
+ _recipeRoutine=new VpwRecipeRoutine(Module.ToString());
|
|
|
+ _manualRecipeRoutine=new VpwManualRecipeRoutine(Module.ToString());
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 初始化操作
|
|
|
/// </summary>
|
|
|
private void InitializeOperation()
|
|
|
{
|
|
|
- OP.Subscribe($"{Module}.InitializeAll", (cmd, args) => { return CheckToPostMessage<VPWCellState, VpwCellMsg>(eEvent.ERR_VPWMAIN, Module.ToString(), (int)VpwCellMsg.Initialize); });
|
|
|
+ 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); });
|
|
|
}
|
|
|
|
|
|
#region InitializeAll
|
|
@@ -256,6 +290,141 @@ namespace PunkHPX8_RT.Modules.VpwMain
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
+ #region Prepare
|
|
|
+ /// <summary>
|
|
|
+ /// Prepare
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="param"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ private bool Prepare(object[] param)
|
|
|
+ {
|
|
|
+ VpwRecipe recipe = param[0] as VpwRecipe;
|
|
|
+ return _prepareRoutine.Start(recipe) == RState.Running;
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// Prepare 监控
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="param"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ private bool PrepareMonitor(object[] param)
|
|
|
+ {
|
|
|
+ RState ret = _prepareRoutine.Monitor();
|
|
|
+ if (ret == RState.Failed || ret == RState.Timeout)
|
|
|
+ {
|
|
|
+ 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);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ return ret == RState.End;
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// Retry Prepare
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="param"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ private bool RetryPrepare(object[] param)
|
|
|
+ {
|
|
|
+ int stepIndex = (int)param[0];
|
|
|
+ bool result = _prepareRoutine.Retry(stepIndex) == RState.Running;
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region Run Recipe
|
|
|
+ /// <summary>
|
|
|
+ /// run recipe
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="param"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ private bool RunRecipe(object[] param)
|
|
|
+ {
|
|
|
+ VpwRecipe recipe = param[0] as VpwRecipe;
|
|
|
+ return _recipeRoutine.Start(recipe) == RState.Running;
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// Prepare 监控
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="param"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ private bool RunRecipeMonitor(object[] param)
|
|
|
+ {
|
|
|
+ RState ret = _recipeRoutine.Monitor();
|
|
|
+ if (ret == RState.Failed || ret == RState.Timeout)
|
|
|
+ {
|
|
|
+ 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);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ return ret == RState.End;
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// Retry RunRecipe
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="param"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ private bool RetryRunRecipe(object[] param)
|
|
|
+ {
|
|
|
+ int stepIndex = (int)param[0];
|
|
|
+ bool result = _recipeRoutine.Retry(stepIndex) == RState.Running;
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region Manual Run Recipe
|
|
|
+ /// <summary>
|
|
|
+ /// run recipe
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="param"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ private bool ManualRunRecipe(object[] param)
|
|
|
+ {
|
|
|
+ VpwRecipe recipe = param[0] as VpwRecipe;
|
|
|
+ return _manualRecipeRoutine.Start(recipe) == RState.Running;
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// Prepare 监控
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="param"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ private bool ManualRunRecipeMonitor(object[] param)
|
|
|
+ {
|
|
|
+ RState ret = _manualRecipeRoutine.Monitor();
|
|
|
+ if (ret == RState.Failed || ret == RState.Timeout)
|
|
|
+ {
|
|
|
+ PostMsg(VpwCellMsg.Error);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ return ret == RState.End;
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region VpwCell Retry
|
|
|
+ /// <summary>
|
|
|
+ /// VpwCell
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="param"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ private bool VpwCellRetry(object[] param)
|
|
|
+ {
|
|
|
+ AlarmList alarmList = AlarmListManager.Instance.GetAlarmListByModule(Module.ToString());
|
|
|
+ if (alarmList != null)
|
|
|
+ {
|
|
|
+ CheckToPostMessage<VPWCellState, VpwCellMsg>(eEvent.WARN_VPW, Module.ToString(), alarmList.ModuleCmd,
|
|
|
+ alarmList.ModuleStep);
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
public bool Check(int msg, out string reason, params object[] args)
|
|
|
{
|
|
|
reason = "";
|