1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- using Aitex.Core.RT.Device;
- using Aitex.Core.RT.Log;
- using CyberX8_RT.Devices.AXIS;
- using CyberX8_RT.Devices.AXIS.CANOpen;
- using CyberX8_RT.Devices.Facilities;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace CyberX8_RT.Devices.SRD
- {
- public class SrdArmAxisInterLock : 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 SrdArmAxisInterLock(JetAxisBase axis)
- {
- _axis = axis;
- }
- /// <summary>
- /// GotoPosition判定前置条件
- /// </summary>
- /// <param name="station"></param>
- /// <returns></returns>
- 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;
- }
-
- SystemFacilities systemFacilities = DEVICE.GetDevice<SystemFacilities>("System.Facilities");
- var result= systemFacilities.CheckCDAN2();
- if(!result.result)
- {
- LOG.WriteLog(eEvent.ERR_SRD, Module, $"{result.reason},Arm can not position");
- return false;
- }
- return true;
- }
- }
- }
|