|
|
@@ -1,42 +1,38 @@
|
|
|
-using Aitex.Core.RT.Device;
|
|
|
-using Aitex.Core.RT.Log;
|
|
|
-using Aitex.Core.RT.Routine;
|
|
|
-using Aitex.Core.RT.SCCore;
|
|
|
-using Aitex.Core.Util;
|
|
|
-using MECF.Framework.Common.Equipment;
|
|
|
-using MECF.Framework.Common.Persistent.Reservoirs;
|
|
|
-using MECF.Framework.Common.RecipeCenter;
|
|
|
-using MECF.Framework.Common.Routine;
|
|
|
-using MECF.Framework.Common.SubstrateTrackings;
|
|
|
-using MECF.Framework.Common.ToolLayout;
|
|
|
-using PunkHPX8_Core;
|
|
|
-using PunkHPX8_RT.Devices.AXIS;
|
|
|
-using PunkHPX8_RT.Devices.PlatingCell;
|
|
|
-using PunkHPX8_RT.Devices.Reservoir;
|
|
|
-using System;
|
|
|
-using System.Collections.Generic;
|
|
|
-using System.Diagnostics.Eventing.Reader;
|
|
|
-using System.Linq;
|
|
|
-using System.Text;
|
|
|
-using System.Threading.Tasks;
|
|
|
-using System.Windows.Media.Imaging;
|
|
|
-
|
|
|
-namespace PunkHPX8_RT.Modules.PlatingCell
|
|
|
-{
|
|
|
- public class PlatingCellVerticalPositionRoutine : RoutineBase, IRoutine
|
|
|
- {
|
|
|
- private enum PositionStep
|
|
|
- {
|
|
|
- WaitMatcher,
|
|
|
- GotoPosition,
|
|
|
- GoToPositionCheck,
|
|
|
- End
|
|
|
- }
|
|
|
-
|
|
|
- #region 内部变量
|
|
|
- /// <summary>
|
|
|
- /// vertical axis
|
|
|
- /// </summary>
|
|
|
+using Aitex.Core.Common;
|
|
|
+using Aitex.Core.RT.Device;
|
|
|
+using Aitex.Core.RT.Log;
|
|
|
+using Aitex.Core.RT.Routine;
|
|
|
+using Aitex.Core.RT.SCCore;
|
|
|
+using Aitex.Core.Util;
|
|
|
+using MECF.Framework.Common.Equipment;
|
|
|
+using MECF.Framework.Common.Routine;
|
|
|
+using MECF.Framework.Common.SubstrateTrackings;
|
|
|
+using PunkHPX8_Core;
|
|
|
+using PunkHPX8_RT.Devices.AXIS;
|
|
|
+using System;
|
|
|
+using System.Collections.Generic;
|
|
|
+using System.Diagnostics.Eventing.Reader;
|
|
|
+using System.Linq;
|
|
|
+using System.Text;
|
|
|
+using System.Threading.Tasks;
|
|
|
+using System.Windows.Media.Imaging;
|
|
|
+
|
|
|
+namespace PunkHPX8_RT.Modules.PlatingCell
|
|
|
+{
|
|
|
+ public class PlatingCellVerticalPositionRoutine : RoutineBase, IRoutine
|
|
|
+ {
|
|
|
+ private enum PositionStep
|
|
|
+ {
|
|
|
+ WaitMatcher,
|
|
|
+ GotoPosition,
|
|
|
+ GoToPositionCheck,
|
|
|
+ End
|
|
|
+ }
|
|
|
+
|
|
|
+ #region 内部变量
|
|
|
+ /// <summary>
|
|
|
+ /// vertical axis
|
|
|
+ /// </summary>
|
|
|
private JetAxisBase _verticalAxis;
|
|
|
/// <summary>
|
|
|
/// matcher集合
|
|
|
@@ -49,42 +45,44 @@ namespace PunkHPX8_RT.Modules.PlatingCell
|
|
|
/// <summary>
|
|
|
/// 位置
|
|
|
/// </summary>
|
|
|
- private double _position;
|
|
|
-
|
|
|
- private string state;
|
|
|
- #endregion
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 构造函数
|
|
|
- /// </summary>
|
|
|
- /// <param name="module"></param>
|
|
|
- public PlatingCellVerticalPositionRoutine(string module) : base(module)
|
|
|
- {
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 中止
|
|
|
- /// </summary>
|
|
|
- public void Abort()
|
|
|
- {
|
|
|
- Runner.Stop("Manual Abort");
|
|
|
- }
|
|
|
- /// <summary>
|
|
|
- /// 监控
|
|
|
- /// </summary>
|
|
|
- /// <returns></returns>
|
|
|
- public RState Monitor()
|
|
|
- {
|
|
|
- Runner.Wait(PositionStep.WaitMatcher,CheckMatcher,_delay_2s)
|
|
|
- .Run(PositionStep.GotoPosition, VerticalGotoPosition, 100)
|
|
|
- .WaitWithStopCondition(PositionStep.GoToPositionCheck, CheckVerticalPositionStatus, CheckVerticalPositionRunStop)
|
|
|
- .End(PositionStep.End, NullFun, _delay_1ms);
|
|
|
- return Runner.Status;
|
|
|
- }
|
|
|
+ private string _station;
|
|
|
+ /// <summary>
|
|
|
+ /// 偏移量
|
|
|
+ /// </summary>
|
|
|
+ private double _offset;
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 构造函数
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="module"></param>
|
|
|
+ public PlatingCellVerticalPositionRoutine(string module) : base(module)
|
|
|
+ {
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 中止
|
|
|
+ /// </summary>
|
|
|
+ public void Abort()
|
|
|
+ {
|
|
|
+ Runner.Stop("Manual Abort");
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 监控
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public RState Monitor()
|
|
|
+ {
|
|
|
+ Runner.Wait(PositionStep.WaitMatcher,CheckMatcher,_delay_2s)
|
|
|
+ .Run(PositionStep.GotoPosition, VerticalGotoPosition, 100)
|
|
|
+ .WaitWithStopCondition(PositionStep.GoToPositionCheck, CheckVerticalPositionStatus, CheckVerticalPositionRunStop)
|
|
|
+ .End(PositionStep.End, NullFun, _delay_1ms);
|
|
|
+ return Runner.Status;
|
|
|
+ }
|
|
|
/// <summary>
|
|
|
/// 检验匹配
|
|
|
/// </summary>
|
|
|
- /// <returns></returns>
|
|
|
+ /// <returns></returns>
|
|
|
private bool CheckMatcher()
|
|
|
{
|
|
|
if (_cellEntities.Count<=1)
|
|
|
@@ -99,69 +97,85 @@ namespace PunkHPX8_RT.Modules.PlatingCell
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- string firstCurrentStep = _cellEntities[0].CurrentStepState;
|
|
|
- foreach (var item in _cellEntities)
|
|
|
+ WaferInfo firstWafer = WaferManager.Instance.GetWafer(_cellEntities[0].Module, 0);
|
|
|
+ WaferInfo secondWafer = WaferManager.Instance.GetWafer(_cellEntities[1].Module, 0);
|
|
|
+ if (firstWafer == null || secondWafer == null || firstWafer.IsEmpty || secondWafer.IsEmpty)
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ bool hasDoubleProductionWafer = firstWafer.WaferType == secondWafer.WaferType;
|
|
|
+ if (hasDoubleProductionWafer)
|
|
|
{
|
|
|
- if (item.CurrentStepState != firstCurrentStep)
|
|
|
+ string firstCurrentStep = _cellEntities[0].CurrentStepState;
|
|
|
+ foreach (var item in _cellEntities)
|
|
|
{
|
|
|
- return false;
|
|
|
+ if (item.CurrentStepState != firstCurrentStep)
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
return true;
|
|
|
- }
|
|
|
- /// <summary>
|
|
|
- /// vertical 运动到位置
|
|
|
- /// </summary>
|
|
|
- /// <returns></returns>
|
|
|
- private bool VerticalGotoPosition()
|
|
|
- {
|
|
|
- if(_verticalAxis != 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.ProfilePositionOperation(_position);
|
|
|
-
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, "vertical axis is null");
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
- /// <summary>
|
|
|
- /// 检验Vertical移动状态
|
|
|
- /// </summary>
|
|
|
- /// <returns></returns>
|
|
|
- private bool CheckVerticalPositionStatus()
|
|
|
- {
|
|
|
- return _verticalAxis.Status == RState.End;
|
|
|
- }
|
|
|
- /// <summary>
|
|
|
- /// 检验Vertical是否还在运动
|
|
|
- /// </summary>
|
|
|
- /// <returns></returns>
|
|
|
- private bool CheckVerticalPositionRunStop()
|
|
|
- {
|
|
|
- return _verticalAxis.Status == RState.Failed;
|
|
|
- }
|
|
|
- /// <summary>
|
|
|
- /// 启动
|
|
|
- /// </summary>
|
|
|
- /// <param name="objs"></param>
|
|
|
- /// <returns></returns>
|
|
|
- public RState Start(params object[] objs)
|
|
|
- {
|
|
|
- _position=(double)objs[0];
|
|
|
- _matcher = ModuleMatcherManager.Instance.GetMatcherListByVertical(Module); //获取电机所在的platingcell 列表
|
|
|
- _cellEntities.Clear();
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// vertical 运动到位置
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ private bool VerticalGotoPosition()
|
|
|
+ {
|
|
|
+ if(_verticalAxis != 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(_station,_offset);
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, "vertical axis is null");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 检验Vertical移动状态
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ private bool CheckVerticalPositionStatus()
|
|
|
+ {
|
|
|
+ return _verticalAxis.Status == RState.End;
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 检验Vertical是否还在运动
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ private bool CheckVerticalPositionRunStop()
|
|
|
+ {
|
|
|
+ return _verticalAxis.Status == RState.Failed;
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 启动
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="objs"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public RState Start(params object[] objs)
|
|
|
+ {
|
|
|
+ _station=objs[0].ToString();
|
|
|
+ _offset = (double)objs[1];
|
|
|
+ _matcher = ModuleMatcherManager.Instance.GetMatcherListByVertical(Module); //获取电机所在的platingcell 列表
|
|
|
+ _cellEntities.Clear();
|
|
|
foreach (string str in _matcher)
|
|
|
{
|
|
|
if(!Enum.TryParse(str, out ModuleName moduleName))
|
|
|
@@ -184,10 +198,10 @@ namespace PunkHPX8_RT.Modules.PlatingCell
|
|
|
if (cellEntity.IsAuto)
|
|
|
{
|
|
|
_cellEntities.Add(cellEntity);
|
|
|
- }
|
|
|
- }
|
|
|
- _verticalAxis = DEVICE.GetDevice<JetAxisBase>($"{Module}.Vertical");
|
|
|
- return Runner.Start(Module, "Start PlatingCell Vertical Initialize");
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
+ }
|
|
|
+ }
|
|
|
+ _verticalAxis = DEVICE.GetDevice<JetAxisBase>($"{Module}.Vertical");
|
|
|
+ return Runner.Start(Module, "Start PlatingCell Vertical Initialize");
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|