123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- using Aitex.Core.RT.Device;
- using Aitex.Core.RT.Log;
- using CyberX8_RT.Devices.AXIS;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace CyberX8_RT.Devices.SRD
- {
- public class SrdRotationAxisInterLock : 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 SrdRotationAxisInterLock(JetAxisBase axis)
- {
- _axis = axis;
- }
- public bool CheckGotoPosition(string station)
- {
- if (!_axis.IsHomed)
- {
- LOG.WriteLog(eEvent.ERR_PUF, Module, "axis is not home, Cannot execute GotoSavedPosition");
- return false;
- }
- if (!_axis.IsSwitchOn)
- {
- LOG.WriteLog(eEvent.ERR_PUF, Module, "axis is switch off, Cannot execute GotoSavedPosition");
- return false;
- }
- SrdCommonDevice common = DEVICE.GetDevice<SrdCommonDevice>($"{Module}.Common");
- if(!common.CommonData.DoorClosed)
- {
- LOG.WriteLog(eEvent.ERR_SRD, Module, "Door is not closed,Rotation can not position");
- return false;
- }
- //Check Flippers
- if (common.CommonData.FlippersIn150 || common.CommonData.FlippersIn200) //|| _srdCommon.CommonData.FlippersIn100
- {
- LOG.WriteLog(eEvent.ERR_SRD, Module,"FlippersIn is on");
- return false;
- }
- if (!common.CommonData.Flipper1Out150Status || !common.CommonData.Flipper2Out150Status || !common.CommonData.Flipper3Out150Status
- || !common.CommonData.Flipper1Out200Status || !common.CommonData.Flipper2Out200Status || !common.CommonData.Flipper3Out200Status)
- //|| !_srdCommon.CommonData.Flipper1Out100Status || !_srdCommon.CommonData.Flipper2Out100Status || !_srdCommon.CommonData.Flipper3Out100Status
- {
- LOG.WriteLog(eEvent.ERR_SRD, Module,"Flippers are at In position");
- return false;
- }
- return true;
- }
- }
- }
|