LiftTask.cs 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using Aitex.Core.Common;
  7. using Aitex.Core.RT.Device;
  8. using Aitex.Core.RT.Device.Unit;
  9. using Aitex.Core.RT.Log;
  10. using Aitex.Sorter.Common;
  11. using MECF.Framework.Common.Equipment;
  12. using MECF.Framework.Common.SubstrateTrackings;
  13. namespace EFEM.RT.Tasks
  14. {
  15. public class LiftTask : CheckImp, ITask
  16. {
  17. public LiftTask()
  18. {
  19. }
  20. public bool Execute(out string result, params string[] args)
  21. {
  22. string device = Args2Unit(args.Length > 0 ? args[0] : string.Empty);
  23. BufferServerModule entity = (BufferServerModule)GetEntity(device);
  24. if (entity == null)
  25. {
  26. result = PARAM_NG;
  27. return false;
  28. }
  29. string upDown = args[1];
  30. if (upDown != "UP" && upDown != "DOWN")
  31. {
  32. LOG.Write("Lift command parameter 1 must be 'UP|DOWN'");
  33. result = PARAM_NG;
  34. return false;
  35. }
  36. if (!Check<NoReadyPolicy>(device, out result))
  37. {
  38. return false;
  39. }
  40. if (!Check<NoInitCompletedPolicy>(device, out result))
  41. {
  42. return false;
  43. }
  44. if (!Check<NoOriginCompletedPolicy>(device, out result))
  45. {
  46. return false;
  47. }
  48. if (!Check<VacPolicy>(device, out result))
  49. {
  50. return false;
  51. }
  52. if (!Check<EMSPolicy>(device, out result))
  53. {
  54. return false;
  55. }
  56. if (!Check<ErrorPolicy>(device, out result))
  57. {
  58. return false;
  59. }
  60. if (!Check<DisablePolicy>(device, out result))
  61. {
  62. // LOG.Write($"PickTask {device} Busy");
  63. return false;
  64. }
  65. if (!Check<BusyPolicy>(device, out result))
  66. {
  67. return false;
  68. }
  69. if (!Check<HoldPolicy>(device, out result))
  70. {
  71. return false;
  72. }
  73. if (!Check<RemovePolicy>(device, out result))
  74. {
  75. return false;
  76. }
  77. if (!Check<MaintenancePolicy>(device, out result))
  78. {
  79. return false;
  80. }
  81. if (!Check<LinkPolicy>(device, out result))
  82. {
  83. return false;
  84. }
  85. if (!Check<ArmExtendPolicy>(device, out result))
  86. {
  87. return false;
  88. }
  89. if (!Check<PowerDownPolicy>(device, out result))
  90. {
  91. return false;
  92. }
  93. var ws = WaferManager.Instance.GetWaferSize((ModuleName)Enum.Parse( typeof(ModuleName),device),0);
  94. if (upDown == "UP")
  95. {
  96. entity.LiftUp(ws,out result);
  97. }
  98. else
  99. {
  100. entity.LiftDown(ws, out result);
  101. }
  102. return true;
  103. }
  104. public bool? Monitor(out string result, params string[] args)
  105. {
  106. result = string.Empty;
  107. string device = Args2Unit(args.Length > 0 ? args[0] : string.Empty);
  108. IoCoolingBuffer buffer = DEVICE.GetDevice<IoCoolingBuffer>(device);
  109. if (buffer.Error)
  110. {
  111. flag1 = ErrorCheckList1.VAC | ErrorCheckList1.STALL
  112. | ErrorCheckList1.LIMIT | ErrorCheckList1.POSITION | ErrorCheckList1.EMS
  113. | ErrorCheckList1.COMM | ErrorCheckList1.COMM2
  114. | ErrorCheckList1.CLAMPON | ErrorCheckList1.CLAMPOF;
  115. flag2 = ErrorCheckList2.COMMAND
  116. | ErrorCheckList2.CLAMP_S;
  117. flag3 = ErrorCheckList3.WAFLOST
  118. | ErrorCheckList3.ALIGNNG | ErrorCheckList3.HARDWARE
  119. | ErrorCheckList3.INTERNAL;
  120. return CheckError(device, out result);
  121. }
  122. if (!buffer.Busy)
  123. {
  124. return true;
  125. }
  126. return null;
  127. }
  128. }
  129. }