AlignTask.cs 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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.Common.SubstrateTrackings;
  6. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robot;
  7. namespace Aitex.Sorter.RT.EFEMs.Tasks
  8. {
  9. public class AlignTask : CheckImp, ITask
  10. {
  11. public AlignTask()
  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. AlignerServerModule entity = (AlignerServerModule)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<VacPolicy>(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 (!Singleton<WaferManager>.Instance.CheckHasWafer(ModuleName.Aligner, 0))
  76. {
  77. result = "NONWAF";
  78. return false;
  79. }
  80. entity.Align(out result);
  81. return true;
  82. }
  83. public bool? Monitor(out string result, params string[] args)
  84. {
  85. result = string.Empty;
  86. string device = Args2Unit(args.Length > 0 ?args[0]:string.Empty);
  87. Aligner _aligner = DEVICE.GetDevice<Aligner>(device);
  88. if (_aligner.Error)
  89. {
  90. flag1 = ErrorCheckList1.VAC | ErrorCheckList1.STALL
  91. | ErrorCheckList1.LIMIT | ErrorCheckList1.POSITION | ErrorCheckList1.EMS
  92. | ErrorCheckList1.COMM | ErrorCheckList1.COMM2
  93. | ErrorCheckList1.CLAMPON | ErrorCheckList1.CLAMPOF;
  94. flag2 = ErrorCheckList2.COMMAND
  95. | ErrorCheckList2.CLAMP_S;
  96. flag3 = ErrorCheckList3.WAFLOST
  97. | ErrorCheckList3.ALIGNNG | ErrorCheckList3.HARDWARE
  98. | ErrorCheckList3.INTERNAL;
  99. return CheckError(device, out result);
  100. }
  101. if (!_aligner.Moving)
  102. {
  103. return true;
  104. }
  105. return null;
  106. }
  107. }
  108. public class SetAlignTask : CheckImp, ITask
  109. {
  110. public SetAlignTask()
  111. {
  112. HasInfoMessage = false;
  113. }
  114. public bool Execute(out string result, params string[] args)
  115. {
  116. string device = Args2Unit(args.Length > 0 ? args[0] : string.Empty);
  117. AlignerServerModule entity = (AlignerServerModule)GetEntity(device);
  118. if (entity == null )
  119. {
  120. result = PARAM_NG;
  121. return false;
  122. }
  123. if (args.Length < 2 || !entity.SetAlign(args[1], out result))
  124. {
  125. result = PARAM_NG;
  126. return false;
  127. }
  128. return true;
  129. }
  130. public bool? Monitor(out string result, params string[] args)
  131. {
  132. result = string.Empty;
  133. string device = Args2Unit(args.Length > 0 ? args[0] : string.Empty);
  134. return true;
  135. }
  136. }
  137. }