123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- using Aitex.Core.RT.DataCenter;
- using Aitex.Core.RT.Device;
- using Aitex.Core.RT.Log;
- using MECF.Framework.Common.Utilities;
- using CyberX8_RT.Devices.AXIS;
- using CyberX8_RT.Devices.AXIS.CANOpen;
- using CyberX8_RT.Devices.YASKAWA;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using MECF.Framework.Common.SubstrateTrackings;
- namespace CyberX8_RT.Devices.PUF
- {
- public class PufFlipAxisInterLock : IAxisInterLock
- {
- #region 内部变量
- private JetAxisBase _axis;
- #endregion
- #region 属性
- /// <summary>
- /// 模块名称
- /// </summary>
- public string Module { get { return _axis.Module; } }
- /// <summary>
- /// 子模块名称
- /// </summary>
- public string Name { get { return _axis.Name; } }
- #endregion
- /// <summary>
- /// 构造函数
- /// </summary>
- /// <param name="Module"></param>
- /// <param name="name"></param>
- public PufFlipAxisInterLock(JetAxisBase axis)
- {
- _axis=axis;
- }
- /// <summary>
- /// Positon前校验inter lock
- /// </summary>
- /// <param name="station"></param>
- /// <returns></returns>
- public bool CheckGotoPosition(string station)
- {
- if (!_axis.IsHomed)
- {
- LOG.WriteLog(eEvent.ERROR_PUF_NOT_HOME, $"{Module}.{Name}", "axis is not homed, Cannot execute GotoSavedPosition");
- return false;
- }
- if (!AxisManager.Instance.CheckModuleAxisSwitchOn(Module,Name))
- {
- return false;
- }
- PufVacuum _pufVacuum = DEVICE.GetDevice<PufVacuum>($"{Module}.Vacuum");
- bool chuckAWaferPresent = _pufVacuum.ChuckAWaferPresent;
- bool chuckBWaferPresent = _pufVacuum.ChuckBWaferPresent;
- JetAxisBase rotationAxis = DEVICE.GetDevice<JetAxisBase>($"{Module}.Rotation");
- if(rotationAxis.Status==CyberX8_Core.RState.Running)
- {
- LOG.WriteLog(eEvent.ERROR_PUF_OTHERAXIS_RUNNING, $"{Module}.{Name}", "rotation status is running, Cannot execute GotoSavedPosition");
- return false;
- }
- double rotationPosition = rotationAxis.MotionData.MotorPosition;
- if (!rotationAxis.CheckPositionIsInStation(rotationPosition, "Flip"))
- {
- LOG.WriteLog(eEvent.ERROR_PUF_OTHER_AXIS_STATION, $"{Module}.{Name}", $"rotation station {rotationPosition} not in Flip Station,Cannot execute GotoSavedPosition");
- return false;
- }
- //A面存在Wafer同时A面Vacuum is released
- if (WaferManager.Instance.CheckHasWafer(Module,0)&&_pufVacuum.IsChuckAReleased)
- {
- LOG.WriteLog(eEvent.ERROR_PUF_HAS_WAFER, $"{Module}.{Name}", "Side A Has Wafer,Vacuum is Off");
- return false;
- }
- //B面存在Wafer同时B面Vacuum is released
- if (WaferManager.Instance.CheckHasWafer(Module, 1) && _pufVacuum.ISChuckBReleased)
- {
- LOG.WriteLog(eEvent.ERROR_PUF_HAS_WAFER, $"{Module}.{Name}", "Side B Has Wafer,Vacuum is Off");
- return false;
- }
- if (_pufVacuum.Chuck)
- {
- LOG.WriteLog(eEvent.ERROR_PUF_CHUCK_ON, $"{Module}.{Name}", "Chuck is on");
- return false;
- }
- if (_pufVacuum.SideAChuckOut)
- {
- LOG.WriteLog(eEvent.ERROR_PUF_SIDEA_CHUCK_OUT_ON, $"{Module}.{Name}", "SideA Chuck out is on");
- return false;
- }
- if (_pufVacuum.SideBChuckOut)
- {
- LOG.WriteLog(eEvent.ERROR_PUF_SIDEA_CHUCK_OUT_ON, $"{Module}.{Name}", "SideB Chuck out is on");
- return false;
- }
- if (!_pufVacuum.SideAChuckIn)
- {
- LOG.WriteLog(eEvent.ERROR_PUF_SIDEA_CHUCK_IN_OFF, $"{Module}.{Name}", "SideA Chuck in is off");
- return false;
- }
- if (!_pufVacuum.SideBChuckIn)
- {
- LOG.WriteLog(eEvent.ERROR_PUF_SIDEA_CHUCK_IN_OFF, $"{Module}.{Name}", "SideB Chuck in is off");
- return false;
- }
- return true;
- }
- }
- }
|