UnDockTask.cs 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. using Aitex.Core.RT.Device;
  2. using Aitex.Core.Util;
  3. using Aitex.Sorter.RT.EFEMs.Servers;
  4. using MECF.Framework.Common.Equipment;
  5. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts;
  6. namespace Aitex.Sorter.RT.EFEMs.Tasks
  7. {
  8. public class UnDockTask : CheckImp, ITask
  9. {
  10. public UnDockTask()
  11. {
  12. }
  13. public bool Execute(out string result, params string[] args)
  14. {
  15. string device = Args2Unit(args.Length > 0 ?args[0]:string.Empty);
  16. LoadPortServerModule entity = (LoadPortServerModule)GetEntity(device);
  17. if (entity == null)
  18. {
  19. result = PARAM_NG;
  20. return false;
  21. }
  22. if (!Check<NoReadyPolicy>(device, out result))
  23. {
  24. return false;
  25. }
  26. if (!Check<NoInitCompletedPolicy>(device, out result))
  27. {
  28. return false;
  29. }
  30. if (!Check<NoOriginCompletedPolicy>(device, out result))
  31. {
  32. return false;
  33. }
  34. if (!Check<AirPolicy>(device, out result))
  35. {
  36. return false;
  37. }
  38. if (!Check<EMSPolicy>(device, out result))
  39. {
  40. return false;
  41. }
  42. if (!Check<ErrorPolicy>(device, out result))
  43. {
  44. return false;
  45. }
  46. //if (!Check<BusyPolicy>(device, out result))
  47. //{
  48. // return false;
  49. //}
  50. if (!Check<HoldPolicy>(device, out result))
  51. {
  52. return false;
  53. }
  54. if (!Check<RemovePolicy>(device, out result))
  55. {
  56. return false;
  57. }
  58. if (!Check<MaintenancePolicy>(device, out result))
  59. {
  60. return false;
  61. }
  62. if (!Check<LinkPolicy>(device, out result))
  63. {
  64. return false;
  65. }
  66. if (!Check<ArmExtendPolicy>(device, out result))
  67. {
  68. return false;
  69. }
  70. if (!Check<PowerDownPolicy>(device, out result))
  71. {
  72. return false;
  73. }
  74. if (!Check<VacPolicy>(device, out result))
  75. {
  76. return false;
  77. }
  78. if (!Check<NoPodPolicy>(device, out result))
  79. {
  80. return false;
  81. }
  82. if (!entity.Undock(out result))
  83. {
  84. return false;
  85. }
  86. return true;
  87. }
  88. public bool? Monitor(out string result, params string[] args)
  89. {
  90. result = string.Empty;
  91. string device = Args2Unit(args.Length > 0 ?args[0]:string.Empty);
  92. LoadPort _device = DEVICE.GetDevice<LoadPort>(device);
  93. if (_device.Error)
  94. {
  95. flag1 = ErrorCheckList1.VAC | ErrorCheckList1.AIR | ErrorCheckList1.STALL
  96. | ErrorCheckList1.LIMIT | ErrorCheckList1.SENSOR | ErrorCheckList1.POSITION | ErrorCheckList1.EMS
  97. | ErrorCheckList1.COMM | ErrorCheckList1.COMM2 | ErrorCheckList1.VACON | ErrorCheckList1.VACOFF
  98. | ErrorCheckList1.CLAMPON | ErrorCheckList1.CLAMPOF;
  99. flag2 = ErrorCheckList2.RRTWAF | ErrorCheckList2.CRSWAF | ErrorCheckList2.THICKWAF | ErrorCheckList2.THINWAF
  100. | ErrorCheckList2.DBLWAF | ErrorCheckList2.BAOWAF | ErrorCheckList2.COMMAND | ErrorCheckList2.PODNG
  101. | ErrorCheckList2.PODMISMATCH | ErrorCheckList2.VAC_S | ErrorCheckList2.CLAMP_S | ErrorCheckList2.SAFTY
  102. | ErrorCheckList2.LOCKNG | ErrorCheckList2.UNLOCKNG | ErrorCheckList2.L_KEY_LK | ErrorCheckList2.L_KEY_UL;
  103. flag3 = ErrorCheckList3.MAP_S | ErrorCheckList3.MAP_S1 | ErrorCheckList3.MAP_S2 | ErrorCheckList3.WAFLOST
  104. | ErrorCheckList3.ALIGNNG
  105. | ErrorCheckList3.DRIVER | ErrorCheckList3.DRPOWERDOWN | ErrorCheckList3.HARDWARE
  106. | ErrorCheckList3.INTERNAL | ErrorCheckList3.E84_TIMEOUTx | ErrorCheckList3.E84_CS_VALID | ErrorCheckList3.READFAIL;
  107. return CheckError(device, out result);
  108. }
  109. //if (!_device.IsBusy)
  110. //{
  111. // Singleton<EfemEntity>.Instance.SendSigStatEvent(ModuleHelper.Converter(device));
  112. // return true;
  113. //}
  114. return null;
  115. }
  116. }
  117. }