VpwRotationAxisInterLock.cs 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. using Aitex.Core.RT.Device;
  2. using Aitex.Core.RT.Log;
  3. using MECF.Framework.Common.Equipment;
  4. using PunkHPX8_RT.Devices.AXIS;
  5. using PunkHPX8_RT.Devices.Facilities;
  6. using PunkHPX8_RT.Devices.VpwMain;
  7. using System;
  8. using System.Collections.Generic;
  9. using System.Linq;
  10. using System.Text;
  11. using System.Threading.Tasks;
  12. namespace PunkHPX8_RT.Devices.VpwCell
  13. {
  14. public class VpwRotationAxisInterLock : IAxisInterLock
  15. {
  16. #region 内部变量
  17. private JetAxisBase _axis;
  18. #endregion
  19. #region 属性
  20. /// <summary>
  21. /// 模块名称
  22. /// </summary>
  23. public string Module { get { return _axis.Module; } }
  24. /// <summary>
  25. /// 子模块名称
  26. /// </summary>
  27. public string Name { get { return _axis.Name; } }
  28. #endregion
  29. /// <summary>
  30. /// 构造函数
  31. /// </summary>
  32. /// <param name="Module"></param>
  33. /// <param name="name"></param>
  34. public VpwRotationAxisInterLock(JetAxisBase axis)
  35. {
  36. _axis = axis;
  37. }
  38. /// <summary>
  39. /// GotoPosition判定前置条件
  40. /// </summary>
  41. /// <param name="station"></param>
  42. /// <returns></returns>
  43. public bool CheckGotoPosition(string station)
  44. {
  45. if (!_axis.IsHomed)
  46. {
  47. LOG.WriteLog(eEvent.ERR_AXIS, $"{Module}.{Name}", "axis is not home, Cannot execute GotoSavedPosition");
  48. return false;
  49. }
  50. if (!_axis.IsSwitchOn)
  51. {
  52. LOG.WriteLog(eEvent.ERR_AXIS, $"{Module}.{Name}", "axis is switch off, Cannot execute GotoSavedPosition");
  53. return false;
  54. }
  55. VpwMainDevice vpwCellDevice = DEVICE.GetDevice<VpwMainDevice>(ModuleName.VPWMain1.ToString());
  56. if (vpwCellDevice != null)
  57. {
  58. if (vpwCellDevice.CommonData.ChamberOpened||!vpwCellDevice.CommonData.ChamberClosed)
  59. {
  60. LOG.WriteLog(eEvent.ERR_AXIS, $"{Module}.{Name}", "chamber is not closed, Cannot execute GotoSavedPosition");
  61. return false;
  62. }
  63. }
  64. return true;
  65. }
  66. }
  67. }