LightTask.cs 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. using System;
  2. using Aitex.Core.RT.Device;
  3. using Aitex.Sorter.Common;
  4. using Aitex.Sorter.RT.EFEMs.Servers;
  5. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts;
  6. namespace Aitex.Sorter.RT.EFEMs.Tasks
  7. {
  8. public class SetLightTask : CheckImp, ITask
  9. {
  10. public SetLightTask()
  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. IServerModule entity = GetEntity(device);
  17. if (entity == null || !(entity is LoadPortServerModule))
  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<NoPodPolicy>(device, out result))
  75. {
  76. return false;
  77. }
  78. //LoadPort _device = DEVICE.GetDevice<LoadPort>(device);
  79. //_device.Clamp(out result);
  80. return true;
  81. }
  82. public bool? Monitor(out string result, params string[] args)
  83. {
  84. result = string.Empty;
  85. string device = Args2Unit(args.Length > 0 ?args[0]:string.Empty);
  86. LoadPort _device = DEVICE.GetDevice<LoadPort>(device);
  87. if (_device.Error)
  88. {
  89. flag1 = ErrorCheckList1.VAC | ErrorCheckList1.AIR | ErrorCheckList1.STALL
  90. | ErrorCheckList1.LIMIT | ErrorCheckList1.SENSOR | ErrorCheckList1.POSITION | ErrorCheckList1.EMS
  91. | ErrorCheckList1.COMM | ErrorCheckList1.COMM2 | ErrorCheckList1.VACON | ErrorCheckList1.VACOFF
  92. | ErrorCheckList1.CLAMPON | ErrorCheckList1.CLAMPOF;
  93. flag2 = ErrorCheckList2.RRTWAF | ErrorCheckList2.CRSWAF | ErrorCheckList2.THICKWAF | ErrorCheckList2.THINWAF
  94. | ErrorCheckList2.DBLWAF | ErrorCheckList2.BAOWAF | ErrorCheckList2.COMMAND | ErrorCheckList2.PODNG
  95. | ErrorCheckList2.PODMISMATCH | ErrorCheckList2.VAC_S | ErrorCheckList2.CLAMP_S | ErrorCheckList2.SAFTY
  96. | ErrorCheckList2.LOCKNG | ErrorCheckList2.UNLOCKNG | ErrorCheckList2.L_KEY_LK | ErrorCheckList2.L_KEY_UL;
  97. flag3 = ErrorCheckList3.MAP_S | ErrorCheckList3.MAP_S1 | ErrorCheckList3.MAP_S2 | ErrorCheckList3.WAFLOST
  98. | ErrorCheckList3.ALIGNNG
  99. | ErrorCheckList3.DRIVER | ErrorCheckList3.DRPOWERDOWN | ErrorCheckList3.HARDWARE
  100. | ErrorCheckList3.INTERNAL | ErrorCheckList3.E84_TIMEOUTx | ErrorCheckList3.E84_CS_VALID | ErrorCheckList3.READFAIL;
  101. return CheckError(device, out result);
  102. }
  103. if (!_device.IsBusy && _device.ClampState == FoupClampState.Close)
  104. return true;
  105. return null;
  106. }
  107. }
  108. public class QueryLightTask : CheckImp, ITask
  109. {
  110. public QueryLightTask()
  111. {
  112. }
  113. public bool Execute(out string result, params string[] args)
  114. {
  115. string device = DeviceName.System;
  116. EfemEventType type;
  117. if (!Enum.TryParse(args[0], out type))
  118. {
  119. result = PARAM_NG;
  120. return false;
  121. }
  122. EfemEventValue value;
  123. if (!Enum.TryParse(args[1], out value))
  124. {
  125. result = PARAM_NG;
  126. return false;
  127. }
  128. if (!Check<NoReadyPolicy>(device, out result))
  129. {
  130. return false;
  131. }
  132. return true;
  133. }
  134. public bool? Monitor(out string result, params string[] args)
  135. {
  136. result = string.Empty;
  137. EfemEventType type;
  138. Enum.TryParse(args[0], out type);
  139. SystemServerModule entity = (SystemServerModule)GetEntity(DeviceName.System);
  140. if (entity.IsEventEnabled(type))
  141. result = string.Format("ON");
  142. else
  143. result = string.Format("OFF");
  144. return true;
  145. }
  146. }
  147. }