|
|
@@ -2,6 +2,7 @@
|
|
|
using Aitex.Core.RT.Log;
|
|
|
using Aitex.Core.RT.Routine;
|
|
|
using Aitex.Core.RT.SCCore;
|
|
|
+using Aitex.Core.Util;
|
|
|
using MECF.Framework.Common.Persistent.Reservoirs;
|
|
|
using MECF.Framework.Common.RecipeCenter;
|
|
|
using MECF.Framework.Common.Routine;
|
|
|
@@ -59,11 +60,10 @@ namespace PunkHPX8_RT.Modules.PlatingCell
|
|
|
/// Reservoir Recipe
|
|
|
/// </summary>
|
|
|
private ResRecipe _resRecipe;
|
|
|
-
|
|
|
/// <summary>
|
|
|
- /// vertical axis
|
|
|
+ /// vetical entity
|
|
|
/// </summary>
|
|
|
- private JetAxisBase _verticalAxis;
|
|
|
+ private PlatingCellVerticalEntity _verticalEntity;
|
|
|
/// <summary>
|
|
|
/// Rotation axis
|
|
|
/// </summary>
|
|
|
@@ -109,9 +109,9 @@ namespace PunkHPX8_RT.Modules.PlatingCell
|
|
|
{
|
|
|
Runner.Run(InitializeStep.CheckPowerSupplierConnected, CheckPowerSupplierStatus, _delay_1ms)
|
|
|
.Run(InitializeStep.CheckClamShellClosed, () => _platingCellDevice.ClamShellClose(), CheckClamShellClosed, _delay_1ms)
|
|
|
- .Run(InitializeStep.VerticalGotoLoad, VerticalGotoLoad, NullFun, 100)
|
|
|
+ .Run(InitializeStep.VerticalGotoLoad, VerticalGotoLoad,100)
|
|
|
.WaitWithStopCondition(InitializeStep.VerticalGotoLoadCheck, CheckVerticalPositionStatus, CheckVerticalPositionRunStop)
|
|
|
- .Run(InitializeStep.RotationHome, RotationGotoHome, NullFun, 100)
|
|
|
+ .Run(InitializeStep.RotationHome, RotationGotoHome, 100)
|
|
|
.WaitWithStopCondition(InitializeStep.RotationHomeCheck, CheckRotationPositionStatus, CheckRotationPositionRunStop)
|
|
|
.Run(InitializeStep.AngleEntryTilt, () => _platingCellDevice.HeadtTiltAction(), CheckAngleTilt, _delay_1ms)
|
|
|
.Run(InitializeStep.AngleEntryVertical, () => _platingCellDevice.HeadtVerticalAction(), CheckAngleVertical, _delay_1ms)
|
|
|
@@ -191,20 +191,9 @@ namespace PunkHPX8_RT.Modules.PlatingCell
|
|
|
/// <returns></returns>
|
|
|
private bool VerticalGotoLoad()
|
|
|
{
|
|
|
- if(_verticalAxis != null )
|
|
|
+ if(_verticalEntity != null )
|
|
|
{
|
|
|
- if (!_verticalAxis.IsSwitchOn)
|
|
|
- {
|
|
|
- LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, "Vertical is not Power On");
|
|
|
- return false;
|
|
|
- }
|
|
|
- else if (!_verticalAxis.IsHomed)
|
|
|
- {
|
|
|
- LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, "Vertical is not Home,Home vertical first");
|
|
|
- return false;
|
|
|
- }
|
|
|
- return _verticalAxis.PositionStation("Load", true);
|
|
|
-
|
|
|
+ return _verticalEntity.CheckToPostMessage<PlatingCellVerticalState,PlatingCellVerticalEntity.VerticalMsg>(eEvent.INFO_PLATINGCELL, Module, (int)PlatingCellVerticalEntity.VerticalMsg.Initialize);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -213,7 +202,7 @@ namespace PunkHPX8_RT.Modules.PlatingCell
|
|
|
}
|
|
|
}
|
|
|
/// <summary>
|
|
|
- /// vertical 运动到Load位置
|
|
|
+ /// rotation home
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
private bool RotationGotoHome()
|
|
|
@@ -225,12 +214,7 @@ namespace PunkHPX8_RT.Modules.PlatingCell
|
|
|
LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, "Roation is not Power On");
|
|
|
return false;
|
|
|
}
|
|
|
- else if (!_rotationAxis.IsHomed)
|
|
|
- {
|
|
|
- LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, "Rotation is not Home,Home Rotation first");
|
|
|
- return false;
|
|
|
- }
|
|
|
- return _rotationAxis.PositionStation("Home", true);
|
|
|
+ return _rotationAxis.Home();
|
|
|
|
|
|
}
|
|
|
else
|
|
|
@@ -290,7 +274,7 @@ namespace PunkHPX8_RT.Modules.PlatingCell
|
|
|
/// <returns></returns>
|
|
|
private bool CheckVerticalPositionStatus()
|
|
|
{
|
|
|
- return _verticalAxis.Status == RState.End;
|
|
|
+ return _verticalEntity.IsIdle;
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 检验Vertical是否还在运动
|
|
|
@@ -298,10 +282,10 @@ namespace PunkHPX8_RT.Modules.PlatingCell
|
|
|
/// <returns></returns>
|
|
|
private bool CheckVerticalPositionRunStop()
|
|
|
{
|
|
|
- return _verticalAxis.Status == RState.Failed;
|
|
|
+ return _verticalEntity.IsError;
|
|
|
}
|
|
|
/// <summary>
|
|
|
- /// 检验Rotation移动状态
|
|
|
+ /// 检验Rotation home是否完成
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
private bool CheckRotationPositionStatus()
|
|
|
@@ -309,12 +293,12 @@ namespace PunkHPX8_RT.Modules.PlatingCell
|
|
|
return _rotationAxis.Status == RState.End;
|
|
|
}
|
|
|
/// <summary>
|
|
|
- /// 检验Rotaion是否还在运动
|
|
|
+ /// 检验Rotaion 是否home 失败
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
private bool CheckRotationPositionRunStop()
|
|
|
{
|
|
|
- return _rotationAxis.Status == RState.Failed;
|
|
|
+ return _rotationAxis.Status == RState.Failed || _rotationAxis.Status == RState.Timeout;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
@@ -340,14 +324,8 @@ namespace PunkHPX8_RT.Modules.PlatingCell
|
|
|
_rinseDripIdlePeriod = SC.GetValue<int>("PlatingCell.RinseDripIdlePeriod");
|
|
|
_cellFlowStartLowLimit = SC.GetValue<double>("PlatingCell.CellFlowStartLowLimit");
|
|
|
_anFlowStartLowLimit = SC.GetValue<double>("PlatingCell.ANFlowStartLowLimit");
|
|
|
- if("PlatingCell1".Equals(Module) || "PlatingCell2".Equals(Module))
|
|
|
- {
|
|
|
- _verticalAxis = DEVICE.GetDevice<JetAxisBase>("PlatingCell1_2.Vertical");
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- _verticalAxis = DEVICE.GetDevice<JetAxisBase>("PlatingCell3_4.Vertical");
|
|
|
- }
|
|
|
+ string verticalModule = ModuleMatcherManager.Instance.GetPlatingVerticalByCell(Module);
|
|
|
+ _verticalEntity=Singleton<RouteManager>.Instance.GetModule<PlatingCellVerticalEntity>(verticalModule);
|
|
|
_rotationAxis = DEVICE.GetDevice<JetAxisBase>($"{Module}.Rotation");
|
|
|
string reservoir = ReservoirItemManager.Instance.GetReservoirByPlatingCell(Module.ToString());
|
|
|
ReservoirDevice reservoirDevice = DEVICE.GetDevice<ReservoirDevice>(reservoir);
|