SystemTask.cs 4.4 KB

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