123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- using Aitex.Core.RT.Device;
- using Aitex.Core.RT.Log;
- using Aitex.Core.Util;
- using CyberX8_RT.Devices.AXIS;
- using CyberX8_RT.Modules.Transporter;
- using CyberX8_RT.Modules;
- using MECF.Framework.Common.Equipment;
- namespace CyberX8_RT.Devices.TransPorter
- {
- public class ProcessTransporterElevatorAxisInterLock : IAxisInterLock
- {
- #region 内部变量
- private JetAxisBase _axis;
- #endregion
- #region 属性
-
-
-
- public string Module { get { return _axis.Module; } }
-
-
-
- public string Name { get { return _axis.Name; } }
- #endregion
-
-
-
-
-
- public ProcessTransporterElevatorAxisInterLock(JetAxisBase axis)
- {
- _axis = axis;
- }
-
-
-
-
-
- public bool CheckGotoPosition(string station)
- {
- if (!AxisManager.Instance.CheckModuleAxisSwitchOn(Module, Name))
- {
- return false;
- }
-
- if (ModuleHelper.IsInstalled(ModuleName.Transporter1))
- {
- TransporterEntity processTransporterEntity = Singleton<RouteManager>.Instance.GetModule<TransporterEntity>(ModuleName.Transporter1.ToString());
- if (processTransporterEntity == null)
- {
- LOG.WriteLog(eEvent.ERR_TRANSPORTER, Module, $"{ModuleName.Transporter1.ToString()} entity is null");
- return false;
- }
- if (!processTransporterEntity.IsHomed)
- {
- LOG.WriteLog(eEvent.ERR_TRANSPORTER, Module, $"{ModuleName.Transporter1.ToString()} is not home, Cannot execute GotoSavedPosition");
- return false;
- }
- }
-
- if (ModuleHelper.IsInstalled(ModuleName.Transporter2))
- {
- TransporterEntity loaderTransporterEntity = Singleton<RouteManager>.Instance.GetModule<TransporterEntity>(ModuleName.Transporter2.ToString());
- if (loaderTransporterEntity == null)
- {
- LOG.WriteLog(eEvent.ERR_TRANSPORTER, Module, $"{ModuleName.Transporter2.ToString()} entity is null");
- return false;
- }
- if (!loaderTransporterEntity.IsHomed)
- {
- LOG.WriteLog(eEvent.ERR_TRANSPORTER, Module, $"{ModuleName.Transporter2.ToString()} is not home, Cannot execute GotoSavedPosition");
- return false;
- }
- }
-
- JetAxisBase gantryAxis = DEVICE.GetDevice<JetAxisBase>($"{Module}.Gantry");
- if (gantryAxis == null)
- {
- LOG.WriteLog(eEvent.ERR_TRANSPORTER, Module, $"{Module} Gantry Axis is null");
- return false;
- }
- if (gantryAxis.Status == CyberX8_Core.RState.Running)
- {
- LOG.WriteLog(eEvent.ERR_TRANSPORTER, Module, $"{Module} Gantry Axis is Run");
- return false;
- }
-
-
-
-
-
-
-
- return true;
- }
- }
- }
|