12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- using Aitex.Core.RT.Device;
- using Aitex.Core.RT.Routine;
- using MECF.Framework.Common.Equipment;
- using MECF.Framework.Common.Routine;
- using MECF.Framework.Common.Utilities;
- using CyberX8_Core;
- using CyberX8_RT.Devices.AXIS;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace CyberX8_RT.Modules.PUF
- {
- public class PufWaferPickSubRoutine : RoutineBase, IRoutine
- {
- private enum PufWaferPickSubStep
- {
- RotationFlip,
- RotationFlipWait,
- FlipSideA,
- FlipSideAWait,
- End
- }
- #region 内部变量
- private JetAxisBase _flipAxis;
- private JetAxisBase _rotationAxis;
- private string _side = "";
- #endregion
- public PufWaferPickSubRoutine(string module) : base(module)
- {
- _flipAxis = DEVICE.GetDevice<JetAxisBase>($"{module}.Flip");
- _rotationAxis = DEVICE.GetDevice<JetAxisBase>($"{module}.Rotation");
- }
- public void Abort()
- {
- Runner.Stop("Manual Abort");
- }
- public RState Monitor()
- {
- Runner.Run(PufWaferPickSubStep.RotationFlip,()=> { return _rotationAxis.PositionStation("Flip"); }, NullFun, 100)
- .WaitWithStopCondition(PufWaferPickSubStep.RotationFlipWait, CheckRotationPositionStatus, CheckRotationPositionRunStop)
- .Run(PufWaferPickSubStep.FlipSideA, () => { return _flipAxis.PositionStation(_side); }, NullFun, 100)
- .WaitWithStopCondition(PufWaferPickSubStep.FlipSideAWait, CheckFlipPositionStatus, CheckFlipPositionRunStop)
- .End(PufWaferPickSubStep.End,NullFun);
- return Runner.Status;
- }
- /// <summary>
- /// 检验Rotation移动状态
- /// </summary>
- /// <returns></returns>
- private bool CheckRotationPositionStatus()
- {
- return _rotationAxis.Status == RState.End;
- }
- /// <summary>
- /// 检验Rotation是否还在运动
- /// </summary>
- /// <returns></returns>
- private bool CheckRotationPositionRunStop()
- {
- return _rotationAxis.Status == RState.Failed;
- }
- /// <summary>
- /// 检验Flip移动状态
- /// </summary>
- /// <returns></returns>
- private bool CheckFlipPositionStatus()
- {
- return _flipAxis.Status == RState.End;
- }
- /// <summary>
- /// 检验Flip是否还在运动
- /// </summary>
- /// <returns></returns>
- private bool CheckFlipPositionRunStop()
- {
- return _flipAxis.Status == RState.Failed;
- }
- public RState Start(params object[] objs)
- {
- _side = objs[0].ToString();
- Runner.Start(Module, "WaferPickSubRoutine");
- return RState.Running;
- }
- }
- }
|