123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- 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 属性
- /// <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 LoaderTiltAxisInterLock(JetAxisBase axis)
- {
- _axis = axis;
- }
- /// <summary>
- /// GotoPosition条件检验
- /// </summary>
- /// <param name="station"></param>
- /// <returns></returns>
- /// <exception cref="NotImplementedException"></exception>
- 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<JetAxisBase>($"{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<JetAxisBase>($"{Module}.ShuttleA");
- wafersize = SC.GetValue<int>("Loader1.SideAWaferSize");
- }
- else
- {
- shuttleAxis = DEVICE.GetDevice<JetAxisBase>($"{Module}.ShuttleB");
- wafersize = SC.GetValue<int>("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;
- }
-
- }
- }
|