|
|
@@ -91,6 +91,10 @@ namespace PunkHPX8_RT.Modules.PlatingCell
|
|
|
/// 工艺当前执行小步骤
|
|
|
/// </summary>
|
|
|
private string _currentStepState = "Init";
|
|
|
+ /// <summary>
|
|
|
+ /// 当前是否在跑dummy recipe
|
|
|
+ /// </summary>
|
|
|
+ private bool _isCurrentRunDummyRecipe;
|
|
|
#endregion
|
|
|
|
|
|
#region 属性
|
|
|
@@ -201,6 +205,16 @@ namespace PunkHPX8_RT.Modules.PlatingCell
|
|
|
/// 当前工步
|
|
|
/// </summary>
|
|
|
public string CurrentStepState { get { return _currentStepState; } }
|
|
|
+ /// <summary>
|
|
|
+ /// 是否正在跑dummy recipe
|
|
|
+ /// </summary>
|
|
|
+ public bool IsCurrentRunDummyRecipe
|
|
|
+ {
|
|
|
+ get
|
|
|
+ {
|
|
|
+ return _isCurrentRunDummyRecipe;
|
|
|
+ }
|
|
|
+ }
|
|
|
#endregion
|
|
|
|
|
|
/// <summary>
|
|
|
@@ -305,6 +319,7 @@ namespace PunkHPX8_RT.Modules.PlatingCell
|
|
|
}
|
|
|
return CheckToPostMessage<PlatingCellState, PlatingCellMsg>(eEvent.ERR_PREWET, Module.ToString(), (int)PlatingCellMsg.RunRecipe, objects);
|
|
|
});
|
|
|
+ OP.Subscribe($"{Module}.Abort", (cmd, args) => { return CheckToPostMessage<PlatingCellState, PlatingCellMsg>(eEvent.ERR_RESERVOIR, Module.ToString(), (int)PlatingCellMsg.Abort); });
|
|
|
}
|
|
|
|
|
|
/// 初始化状态机
|
|
|
@@ -319,6 +334,7 @@ namespace PunkHPX8_RT.Modules.PlatingCell
|
|
|
Transition(PlatingCellState.Error, PlatingCellMsg.Initialize, InitializeAll, PlatingCellState.Initializing);
|
|
|
Transition(PlatingCellState.Init, PlatingCellMsg.Initialize, InitializeAll, PlatingCellState.Initializing);
|
|
|
Transition(PlatingCellState.Idle, PlatingCellMsg.Initialize, InitializeAll, PlatingCellState.Initializing);
|
|
|
+ Transition(PlatingCellState.Abort, PlatingCellMsg.Initialize, InitializeAll, PlatingCellState.Initializing);
|
|
|
Transition(PlatingCellState.Initializing, FSM_MSG.TIMER, InitializeAllMonitor, PlatingCellState.Idle);
|
|
|
|
|
|
//CCR
|
|
|
@@ -329,6 +345,7 @@ namespace PunkHPX8_RT.Modules.PlatingCell
|
|
|
Transition(PlatingCellState.Idle, PlatingCellMsg.RunRecipe, CycleManualProcess, PlatingCellState.RunReciping);
|
|
|
Transition(PlatingCellState.RunReciping, FSM_MSG.TIMER, CycleManualMonitor, PlatingCellState.Idle);
|
|
|
Transition(PlatingCellState.RunReciping, PlatingCellMsg.Abort, RunRecipeAbort, PlatingCellState.Idle);
|
|
|
+ Transition(PlatingCellState.RunReciping, PlatingCellMsg.Abort, AbortRecipe, PlatingCellState.Abort);
|
|
|
//Unload
|
|
|
Transition(PlatingCellState.Idle, PlatingCellMsg.Unload, Unload, PlatingCellState.Unloading);
|
|
|
Transition(PlatingCellState.Unloading, FSM_MSG.TIMER, UnloadMonitor, PlatingCellState.Idle);
|
|
|
@@ -343,6 +360,25 @@ namespace PunkHPX8_RT.Modules.PlatingCell
|
|
|
EnumLoop<PlatingCellState>.ForEach((item) => { fsm.MapMessage((int)item, item.ToString()); });
|
|
|
}
|
|
|
/// <summary>
|
|
|
+ /// Abort Recipe
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="param"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public bool AbortRecipe(object[] param)
|
|
|
+ {
|
|
|
+ //后续还要增加lottrack相关
|
|
|
+ if (!_isCurrentRunDummyRecipe)
|
|
|
+ {
|
|
|
+ _runRecipeRoutine.Abort();
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ _dummyRinseRunRecipeRoutine.Abort();
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
/// 手动CCR
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
@@ -510,6 +546,7 @@ namespace PunkHPX8_RT.Modules.PlatingCell
|
|
|
bool _isDummyLoad = (bool)param[1];
|
|
|
if (!_isDummyLoad)
|
|
|
{
|
|
|
+ _isCurrentRunDummyRecipe = false;
|
|
|
bool result = _runRecipeRoutine.Start(param) == RState.Running;
|
|
|
_currentStepState = "";
|
|
|
DepRecipe recipe = param[0] as DepRecipe;
|
|
|
@@ -524,6 +561,7 @@ namespace PunkHPX8_RT.Modules.PlatingCell
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ _isCurrentRunDummyRecipe = true;
|
|
|
bool result = _dummyRinseRunRecipeRoutine.Start(param) == RState.Running;
|
|
|
_currentStepState = "";
|
|
|
DqdrRecipe recipe = param[0] as DqdrRecipe;
|
|
|
@@ -543,24 +581,49 @@ namespace PunkHPX8_RT.Modules.PlatingCell
|
|
|
/// <returns></returns>
|
|
|
private bool CycleManualMonitor(object[] param)
|
|
|
{
|
|
|
- RState state = _runRecipeRoutine.Monitor();
|
|
|
- _currentStepState = _runRecipeRoutine.CurrentStep;
|
|
|
- _achievedCycle = _runRecipeRoutine.GetCurrentCycle();
|
|
|
- //LOG.WriteLog(eEvent.INFO_PLATINGCELL, Module.ToString(), _currentStepState);
|
|
|
- if (state == RState.Failed || state == RState.Timeout)
|
|
|
+ if (!_isCurrentRunDummyRecipe)
|
|
|
{
|
|
|
- PostMsg(PlatingCellMsg.Error);
|
|
|
- _currentStepState = "";
|
|
|
- _currentRecipe = null;
|
|
|
- return false;
|
|
|
+ RState state = _runRecipeRoutine.Monitor();
|
|
|
+ _currentStepState = _runRecipeRoutine.CurrentStep;
|
|
|
+ _achievedCycle = _runRecipeRoutine.GetCurrentCycle();
|
|
|
+ //LOG.WriteLog(eEvent.INFO_PLATINGCELL, Module.ToString(), _currentStepState);
|
|
|
+ if (state == RState.Failed || state == RState.Timeout)
|
|
|
+ {
|
|
|
+ PostMsg(PlatingCellMsg.Error);
|
|
|
+ _currentStepState = "";
|
|
|
+ _currentRecipe = null;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ bool result = state == RState.End;
|
|
|
+ if (result)
|
|
|
+ {
|
|
|
+ _currentStepState = "";
|
|
|
+ _currentRecipe = null;
|
|
|
+ }
|
|
|
+ return result;
|
|
|
}
|
|
|
- bool result = state == RState.End;
|
|
|
- if (result)
|
|
|
+ else
|
|
|
{
|
|
|
- _currentStepState = "";
|
|
|
- _currentRecipe = null;
|
|
|
+ RState state = _dummyRinseRunRecipeRoutine.Monitor();
|
|
|
+ _currentStepState = _dummyRinseRunRecipeRoutine.CurrentStep;
|
|
|
+ _achievedCycle = _dummyRinseRunRecipeRoutine.GetCurrentCycle();
|
|
|
+ //LOG.WriteLog(eEvent.INFO_PLATINGCELL, Module.ToString(), _currentStepState);
|
|
|
+ if (state == RState.Failed || state == RState.Timeout)
|
|
|
+ {
|
|
|
+ PostMsg(PlatingCellMsg.Error);
|
|
|
+ _currentStepState = "";
|
|
|
+ _currentRecipe = null;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ bool result = state == RState.End;
|
|
|
+ if (result)
|
|
|
+ {
|
|
|
+ _currentStepState = "";
|
|
|
+ _currentRecipe = null;
|
|
|
+ }
|
|
|
+ return result;
|
|
|
}
|
|
|
- return result;
|
|
|
+
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 中止
|