|
|
@@ -31,6 +31,7 @@ namespace PunkHPX8_RT.Modules.PlatingCell
|
|
|
{
|
|
|
private enum RunRecipeStep
|
|
|
{
|
|
|
+ LoopStart,
|
|
|
InterRinse,
|
|
|
CheckInterRinse,
|
|
|
Entry,
|
|
|
@@ -43,6 +44,7 @@ namespace PunkHPX8_RT.Modules.PlatingCell
|
|
|
CheckRinse,
|
|
|
Dry,
|
|
|
CheckDry,
|
|
|
+ LoopEnd,
|
|
|
End
|
|
|
}
|
|
|
#region 常量
|
|
|
@@ -186,40 +188,60 @@ namespace PunkHPX8_RT.Modules.PlatingCell
|
|
|
/// <returns></returns>
|
|
|
public RState Monitor()
|
|
|
{
|
|
|
+
|
|
|
+ Runner.LoopStart(RunRecipeStep.LoopStart, "Loop Start Cycle Run Platingcell Recipe Routine", _cycle, NullFun, _delay_1ms)
|
|
|
//interval rinse
|
|
|
- Runner.RunIf(RunRecipeStep.InterRinse, _recipe.RinseBeforeEntryEnable, () => { return _interRinseRoutine.Start(_recipe, _targetPositionList[0]) == RState.Running; })
|
|
|
- .WaitWithStopConditionIf(RunRecipeStep.CheckInterRinse, _recipe.RinseBeforeEntryEnable, CheckInterRinseEndStatus,
|
|
|
+ .LoopRunIf(RunRecipeStep.InterRinse, _recipe.RinseBeforeEntryEnable, () => { return _interRinseRoutine.Start(_recipe, _targetPositionList[0]) == RState.Running; })
|
|
|
+ .LoopRunIfWithStopStatus(RunRecipeStep.CheckInterRinse, _recipe.RinseBeforeEntryEnable, CheckInterRinseEndStatus,
|
|
|
() => CommonFunction.CheckRoutineStopState(_interRinseRoutine))
|
|
|
//entry
|
|
|
- .Run(RunRecipeStep.Entry, () => { return _entryRoutine.Start(_recipe, _targetPositionList[0], _powerSupplierStepPeriodDatas,_platingStartTime) == RState.Running; })
|
|
|
- .WaitWithStopCondition(RunRecipeStep.CheckEntry, CheckInterRinseEndStatus,
|
|
|
+ .LoopRun(RunRecipeStep.Entry, () => { return _entryRoutine.Start(_recipe, _targetPositionList[0], _powerSupplierStepPeriodDatas,_platingStartTime) == RState.Running; })
|
|
|
+ .LoopRunWithStopStatus(RunRecipeStep.CheckEntry, CheckEntryEndStatus,
|
|
|
() => CommonFunction.CheckRoutineStopState(_entryRoutine))
|
|
|
|
|
|
//Deposition
|
|
|
- .Run(RunRecipeStep.Deposition, () => { return _depositionRoutine.Start(_recipe, _isZeroCurrent, _isRecipeContainsRevserseRotation,_powerSupplierStepPeriodDatas, _platingStartTime) == RState.Running; })
|
|
|
- .WaitWithStopCondition(RunRecipeStep.CheckDeposition, CheckInterRinseEndStatus,
|
|
|
+ .LoopRun(RunRecipeStep.Deposition, () => { return _depositionRoutine.Start(_recipe, _isZeroCurrent, _isRecipeContainsRevserseRotation,_powerSupplierStepPeriodDatas, _platingStartTime) == RState.Running; })
|
|
|
+ .LoopRunWithStopStatus(RunRecipeStep.CheckDeposition, CheckDepositionEndStatus,
|
|
|
() => CommonFunction.CheckRoutineStopState(_depositionRoutine))
|
|
|
|
|
|
- //Relaim
|
|
|
- .Run(RunRecipeStep.Reclaim, () => { return _reclaimRoutine.Start(_recipe, _isZeroCurrent) == RState.Running; })
|
|
|
- .WaitWithStopCondition(RunRecipeStep.CheckReclaim, CheckInterRinseEndStatus,
|
|
|
+ //Reclaim
|
|
|
+ .LoopRun(RunRecipeStep.Reclaim, () => { return _reclaimRoutine.Start(_recipe, _isZeroCurrent) == RState.Running; })
|
|
|
+ .LoopRunWithStopStatus(RunRecipeStep.CheckReclaim, CheckReclaimEndStatus,
|
|
|
() => CommonFunction.CheckRoutineStopState(_reclaimRoutine))
|
|
|
|
|
|
//Rinse
|
|
|
- .Run(RunRecipeStep.Rinse, () => { return _rinseRoutine.Start(_recipe) == RState.Running; })
|
|
|
- .WaitWithStopCondition(RunRecipeStep.CheckRinse, CheckInterRinseEndStatus,
|
|
|
+ .LoopRun(RunRecipeStep.Rinse, () => { return _rinseRoutine.Start(_recipe) == RState.Running; })
|
|
|
+ .LoopRunWithStopStatus(RunRecipeStep.CheckRinse, CheckRinseEndStatus,
|
|
|
() => CommonFunction.CheckRoutineStopState(_rinseRoutine))
|
|
|
|
|
|
//Dry
|
|
|
- .Run(RunRecipeStep.Dry, () => { return _dryRoutine.Start(_recipe) == RState.Running; })
|
|
|
- .WaitWithStopCondition(RunRecipeStep.CheckDry, CheckInterRinseEndStatus,
|
|
|
+ .LoopRun(RunRecipeStep.Dry, () => { return _dryRoutine.Start(_recipe) == RState.Running; })
|
|
|
+ .LoopRunWithStopStatus(RunRecipeStep.CheckDry, CheckDryEndStatus,
|
|
|
() => CommonFunction.CheckRoutineStopState(_dryRoutine))
|
|
|
-
|
|
|
+ .LoopEnd(RunRecipeStep.LoopEnd, UpdateCycleCount, _delay_1ms)
|
|
|
.End(RunRecipeStep.End, NullFun);
|
|
|
return Runner.Status;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+ /// 统计完成的Cycle次数
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ private bool UpdateCycleCount()
|
|
|
+ {
|
|
|
+ _currentCycle += 1;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 获取当前Cycle次数
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public int GetCurrentCycle()
|
|
|
+ {
|
|
|
+ return _currentCycle;
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 检查interval rinse是否完成
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
private bool CheckInterRinseEndStatus()
|
|
|
{
|
|
|
bool result = CommonFunction.CheckRoutineEndState(_interRinseRoutine);
|
|
|
@@ -227,6 +249,56 @@ namespace PunkHPX8_RT.Modules.PlatingCell
|
|
|
return result;
|
|
|
}
|
|
|
/// <summary>
|
|
|
+ /// 检查entry是否完成
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ private bool CheckEntryEndStatus()
|
|
|
+ {
|
|
|
+ bool result = CommonFunction.CheckRoutineEndState(_entryRoutine);
|
|
|
+ SubRoutineStep = _entryRoutine.CurrentStep;
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 检查Deposition是否完成
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ private bool CheckDepositionEndStatus()
|
|
|
+ {
|
|
|
+ bool result = CommonFunction.CheckRoutineEndState(_depositionRoutine);
|
|
|
+ SubRoutineStep = _depositionRoutine.CurrentStep;
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 检查Reclaim是否完成
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ private bool CheckReclaimEndStatus()
|
|
|
+ {
|
|
|
+ bool result = CommonFunction.CheckRoutineEndState(_reclaimRoutine);
|
|
|
+ SubRoutineStep = _reclaimRoutine.CurrentStep;
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 检查Rinse是否完成
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ private bool CheckRinseEndStatus()
|
|
|
+ {
|
|
|
+ bool result = CommonFunction.CheckRoutineEndState(_rinseRoutine);
|
|
|
+ SubRoutineStep = _rinseRoutine.CurrentStep;
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 检查Dry是否完成
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ private bool CheckDryEndStatus()
|
|
|
+ {
|
|
|
+ bool result = CommonFunction.CheckRoutineEndState(_dryRoutine);
|
|
|
+ SubRoutineStep = _dryRoutine.CurrentStep;
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
/// 启动
|
|
|
/// </summary>
|
|
|
/// <param name="objs"></param>
|
|
|
@@ -274,7 +346,7 @@ namespace PunkHPX8_RT.Modules.PlatingCell
|
|
|
_currentCycle = 0;
|
|
|
|
|
|
|
|
|
- return Runner.Start(Module, "Run Recipe");
|
|
|
+ return Runner.Start(Module, "PlatingCell Run Recipe");
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 初始化Power step步骤
|
|
|
@@ -319,11 +391,11 @@ namespace PunkHPX8_RT.Modules.PlatingCell
|
|
|
}
|
|
|
if(_maxCurrent > 0.6) //设置电源挡位,有超过0.6A的电流则用高档,否则用中挡
|
|
|
{
|
|
|
- return _device.PowerSupplier.SetPowerGrade("set power grade high", new object[] { 2 });
|
|
|
+ return _device.PowerSupplier.SetPowerGrade("set power grade high", new object[] { (byte)2 });
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- return _device.PowerSupplier.SetPowerGrade("set power grade high", new object[] { 1 });
|
|
|
+ return _device.PowerSupplier.SetPowerGrade("set power grade high", new object[] { (byte)1 });
|
|
|
}
|
|
|
}
|
|
|
/// <summary>
|
|
|
@@ -342,15 +414,7 @@ namespace PunkHPX8_RT.Modules.PlatingCell
|
|
|
continue;
|
|
|
}
|
|
|
}
|
|
|
- //不存在双向旋转直接给roation一个很大的值,电镀完成后再停止
|
|
|
- if (!_isRecipeContainsRevserseRotation)
|
|
|
- {
|
|
|
- _targetPositionList.Add(12 * 60 * 60 * 500 * 6); //以500rmp 运行12个小时的位置
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
+ _targetPositionList.Add(12 * 60 * 60 * 500 * 6); //以500rmp 运行12个小时的位置
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 检验前置条件
|