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 System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using MECF.Framework.Common.Equipment; using Aitex.Core.Util; using CyberX8_RT.Modules; using Aitex.Core.RT.SCCore; namespace CyberX8_RT.Devices.Loader { public class LoaderTiltAxisInterLock : IAxisInterLock { #region 内部变量 private JetAxisBase _axis; #endregion #region 属性 /// /// 模块名称 /// public string Module { get { return _axis.Module; } } /// /// 子模块名称 /// public string Name { get { return _axis.Name; } } #endregion /// /// 构造函数 /// /// /// public LoaderTiltAxisInterLock(JetAxisBase axis) { _axis = axis; } /// /// GotoPosition条件检验 /// /// /// /// public bool CheckGotoPosition(string station) { if (!_axis.IsSwitchOn) { LOG.WriteLog(eEvent.ERR_LOADER, Module, $"{Name} is switch off, Cannot execute GotoSavedPosition"); return false; } if (!_axis.IsHomed) { LOG.WriteLog(eEvent.ERR_LOADER, Module, $"{Name} is not home, Cannot execute GotoSavedPosition"); return false; } if (_axis.Status==CyberX8_Core.RState.Running) { LOG.WriteLog(eEvent.ERR_LOADER, Module, $"{Name} status is running, Cannot execute GotoSavedPosition"); return false; } //判断puf的rotation是否在home/flip/robot位置上 if (ModuleHelper.IsInstalled(ModuleName.PUF1)) { JetAxisBase puf1RotationAxis = DEVICE.GetDevice($"{ModuleName.PUF1}.Rotation"); if (puf1RotationAxis != null) { if (puf1RotationAxis.IsRun) //puf rotation正在运动返回false { LOG.WriteLog(eEvent.ERR_LOADER, Module, $"{ModuleName.PUF1} is running, Cannot execute GotoSavedPosition"); return false; } double puf1RotationPosition = puf1RotationAxis.MotionData.MotorPosition; if (puf1RotationAxis.CheckPositionIsInStation(puf1RotationPosition, "Home") || puf1RotationAxis.CheckPositionIsInStation(puf1RotationPosition, "Flip") || puf1RotationAxis.CheckPositionIsInStation(puf1RotationPosition, "Robot")) { //校验通过,不执行操作 } else { LOG.WriteLog(eEvent.ERR_LOADER, Module, $"{ModuleName.PUF1} {puf1RotationPosition} is not in Home/flip/Robot station, Cannot execute GotoSavedPosition"); return false; } } //puf rotation为空返回false else { LOG.WriteLog(eEvent.ERR_LOADER, Module, $"{ModuleName.PUF1} is null, Cannot execute GotoSavedPosition"); return false; } } //判断shuttle是否在out位上 JetAxisBase shuttleAxis = null; double shuttleAxisPosition = 0; int wafersize = 0; if (Name == "TiltA") { shuttleAxis = DEVICE.GetDevice($"{Module}.ShuttleA"); wafersize = SC.GetValue("Loader1.SideAWaferSize"); } else { shuttleAxis = DEVICE.GetDevice($"{Module}.ShuttleB"); wafersize = SC.GetValue("Loader1.SideBWaferSize"); } if (shuttleAxis != null) { if (shuttleAxis.Status==CyberX8_Core.RState.Running) //shuttle正在运动返回false { LOG.WriteLog(eEvent.ERR_LOADER, Module, $"{Module}.{shuttleAxis.Name} status is running, Cannot execute GotoSavedPosition"); return false; } shuttleAxisPosition = shuttleAxis.MotionData.MotorPosition; if (!shuttleAxis.CheckPositionIsInStation(shuttleAxisPosition, $"OUT{wafersize}")) { LOG.WriteLog(eEvent.ERR_LOADER, Module, $"{Module}.{shuttleAxis.Name} is not in out station, Cannot execute GotoSavedPosition"); return false; } } else //shuttle为空返回false { LOG.WriteLog(eEvent.ERR_LOADER, Module, $"{Module}.{shuttleAxis.Name} is null, Cannot execute GotoSavedPosition"); return false; } return true; } } }