UnlockTask.cs 4.6 KB

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