AlignTask.cs 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  1. using Aitex.Core.Common;
  2. using Aitex.Core.RT.Device;
  3. using Aitex.Core.Util;
  4. using Aitex.Sorter.Common;
  5. using MECF.Framework.Common.Equipment;
  6. using MECF.Framework.Common.SubstrateTrackings;
  7. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robot;
  8. using System;
  9. using Aitex.Core.RT.Device.Unit;
  10. namespace EFEM.RT.Tasks
  11. {
  12. //public class AlignTask : CheckImp, ITask
  13. //{
  14. // public AlignTask()
  15. // {
  16. // }
  17. // public bool Execute(out string result, params string[] args)
  18. // {
  19. // string device = Args2Unit(args.Length > 0 ?args[0]:string.Empty);
  20. // AlignerServerModule entity = (AlignerServerModule)GetEntity(device);
  21. // if (entity == null)
  22. // {
  23. // result = PARAM_NG;
  24. // return false;
  25. // }
  26. // if (!Check<NoReadyPolicy>(device, out result))
  27. // {
  28. // return false;
  29. // }
  30. // if (!Check<NoInitCompletedPolicy>(device, out result))
  31. // {
  32. // return false;
  33. // }
  34. // if (!Check<NoOriginCompletedPolicy>(device, out result))
  35. // {
  36. // return false;
  37. // }
  38. // if (!Check<VacPolicy>(device, out result))
  39. // {
  40. // return false;
  41. // }
  42. // if (!Check<EMSPolicy>(device, out result))
  43. // {
  44. // return false;
  45. // }
  46. // if (!Check<ErrorPolicy>(device, out result))
  47. // {
  48. // return false;
  49. // }
  50. // if (!Check<BusyPolicy>(device, out result))
  51. // {
  52. // return false;
  53. // }
  54. // if (!Check<HoldPolicy>(device, out result))
  55. // {
  56. // return false;
  57. // }
  58. // if (!Check<RemovePolicy>(device, out result))
  59. // {
  60. // return false;
  61. // }
  62. // if (!Check<MaintenancePolicy>(device, out result))
  63. // {
  64. // return false;
  65. // }
  66. // if (!Check<LinkPolicy>(device, out result))
  67. // {
  68. // return false;
  69. // }
  70. // if (!Check<ArmExtendPolicy>(device, out result))
  71. // {
  72. // return false;
  73. // }
  74. // if (!Check<PowerDownPolicy>(device, out result))
  75. // {
  76. // return false;
  77. // }
  78. // //if (!Singleton<WaferManager>.Instance.CheckHasWafer(ModuleName.Aligner, 0))
  79. // if (!Singleton<WaferManager>.Instance.CheckHasWafer(device, 0))
  80. // {
  81. // result = "NONWAF";
  82. // return false;
  83. // }
  84. // entity.Align(out result);
  85. // return true;
  86. // }
  87. // public bool? Monitor(out string result, params string[] args)
  88. // {
  89. // result = string.Empty;
  90. // string device = Args2Unit(args.Length > 0 ?args[0]:string.Empty);
  91. // Aligner _aligner = DEVICE.GetDevice<Aligner>(device);
  92. // if (_aligner.Error)
  93. // {
  94. // flag1 = ErrorCheckList1.VAC | ErrorCheckList1.STALL
  95. // | ErrorCheckList1.LIMIT | ErrorCheckList1.POSITION | ErrorCheckList1.EMS
  96. // | ErrorCheckList1.COMM | ErrorCheckList1.COMM2
  97. // | ErrorCheckList1.CLAMPON | ErrorCheckList1.CLAMPOF;
  98. // flag2 = ErrorCheckList2.COMMAND
  99. // | ErrorCheckList2.CLAMP_S;
  100. // flag3 = ErrorCheckList3.WAFLOST
  101. // | ErrorCheckList3.ALIGNNG | ErrorCheckList3.HARDWARE
  102. // | ErrorCheckList3.INTERNAL;
  103. // return CheckError(device, out result);
  104. // }
  105. // if (!_aligner.Moving)
  106. // {
  107. // return true;
  108. // }
  109. // return null;
  110. // }
  111. //}
  112. public class AlignTaskEx : CheckImp, ITask
  113. {
  114. public AlignTaskEx()
  115. {
  116. }
  117. public bool Execute(out string result, params string[] args)
  118. {
  119. result = string.Empty;
  120. string device = Args2Unit(args[0]) ;
  121. BufferServerModule entity = (BufferServerModule)GetEntity(device);
  122. if (entity == null)
  123. {
  124. result = PARAM_NG;
  125. return false;
  126. }
  127. if (MultiWaferSize)
  128. {
  129. //if (args.Length < 0)
  130. //{
  131. // result = PARAM_NG;
  132. // return false;
  133. //}
  134. //if (!CheckWaferSize(args[1], ModuleHelper.Converter(entity.Name), 0))
  135. //{
  136. // result = PARAM_NG;
  137. // return false;
  138. //}
  139. }
  140. if (!Check<NoReadyPolicy>(device, out result))
  141. {
  142. return false;
  143. }
  144. if (!Check<NoInitCompletedPolicy>(device, out result))
  145. {
  146. return false;
  147. }
  148. if (!Check<NoOriginCompletedPolicy>(device, out result))
  149. {
  150. return false;
  151. }
  152. if (!Check<VacPolicy>(device, out result))
  153. {
  154. return false;
  155. }
  156. if (!Check<EMSPolicy>(device, out result))
  157. {
  158. return false;
  159. }
  160. if (!Check<ErrorPolicy>(device, out result))
  161. {
  162. return false;
  163. }
  164. if (!Check<BusyPolicy>(device, out result))
  165. {
  166. return false;
  167. }
  168. if (!Check<HoldPolicy>(device, out result))
  169. {
  170. return false;
  171. }
  172. if (!Check<RemovePolicy>(device, out result))
  173. {
  174. return false;
  175. }
  176. if (!Check<MaintenancePolicy>(device, out result))
  177. {
  178. return false;
  179. }
  180. if (!Check<LinkPolicy>(device, out result))
  181. {
  182. return false;
  183. }
  184. if (!Check<ArmExtendPolicy>(device, out result))
  185. {
  186. return false;
  187. }
  188. if (!Check<PowerDownPolicy>(device, out result))
  189. {
  190. return false;
  191. }
  192. entity.Align(WaferSize.WS0, out result);
  193. return true;
  194. }
  195. public bool? Monitor(out string result, params string[] args)
  196. {
  197. result = string.Empty;
  198. string device = Args2Unit(args[0]);
  199. BufferServerModule entity = (BufferServerModule)GetEntity(device);
  200. if (entity == null)
  201. {
  202. result = PARAM_NG;
  203. return false;
  204. }
  205. if (entity.Error)
  206. {
  207. flag1 = ErrorCheckList1.VAC | ErrorCheckList1.STALL
  208. | ErrorCheckList1.LIMIT | ErrorCheckList1.POSITION | ErrorCheckList1.EMS
  209. | ErrorCheckList1.COMM | ErrorCheckList1.COMM2
  210. | ErrorCheckList1.CLAMPON | ErrorCheckList1.CLAMPOF;
  211. flag2 = ErrorCheckList2.COMMAND
  212. | ErrorCheckList2.CLAMP_S;
  213. flag3 = ErrorCheckList3.WAFLOST
  214. | ErrorCheckList3.ALIGNNG | ErrorCheckList3.HARDWARE
  215. | ErrorCheckList3.INTERNAL;
  216. return CheckError(device, out result);
  217. }
  218. if (!entity.Busy)
  219. {
  220. return true;
  221. }
  222. return null;
  223. }
  224. }
  225. public class AlignTaskEx2 : CheckImp, ITask
  226. {
  227. public AlignTaskEx2()
  228. {
  229. }
  230. public bool Execute(out string result, params string[] args)
  231. {
  232. string device = DeviceName.CoolingBuffer2;
  233. BufferServerModule entity = (BufferServerModule)GetEntity(device);
  234. if (entity == null)
  235. {
  236. result = PARAM_NG;
  237. return false;
  238. }
  239. if (MultiWaferSize)
  240. {
  241. //if (args.Length < 0)
  242. //{
  243. // result = PARAM_NG;
  244. // return false;
  245. //}
  246. //if (!CheckWaferSize(args[0], ModuleName.CoolingBuffer2, 0))
  247. //{
  248. // result = PARAM_NG;
  249. // return false;
  250. //}
  251. }
  252. if (!Check<NoReadyPolicy>(device, out result))
  253. {
  254. return false;
  255. }
  256. if (!Check<NoInitCompletedPolicy>(device, out result))
  257. {
  258. return false;
  259. }
  260. if (!Check<NoOriginCompletedPolicy>(device, out result))
  261. {
  262. return false;
  263. }
  264. if (!Check<VacPolicy>(device, out result))
  265. {
  266. return false;
  267. }
  268. if (!Check<EMSPolicy>(device, out result))
  269. {
  270. return false;
  271. }
  272. if (!Check<ErrorPolicy>(device, out result))
  273. {
  274. return false;
  275. }
  276. if (!Check<BusyPolicy>(device, out result))
  277. {
  278. return false;
  279. }
  280. if (!Check<HoldPolicy>(device, out result))
  281. {
  282. return false;
  283. }
  284. if (!Check<RemovePolicy>(device, out result))
  285. {
  286. return false;
  287. }
  288. if (!Check<MaintenancePolicy>(device, out result))
  289. {
  290. return false;
  291. }
  292. if (!Check<LinkPolicy>(device, out result))
  293. {
  294. return false;
  295. }
  296. if (!Check<ArmExtendPolicy>(device, out result))
  297. {
  298. return false;
  299. }
  300. if (!Check<PowerDownPolicy>(device, out result))
  301. {
  302. return false;
  303. }
  304. //if (!Singleton<WaferManager>.Instance.CheckHasWafer(device, 0))
  305. //{
  306. // result = "NONWAF";
  307. // return false;
  308. //}
  309. //WaferSize size = WaferManager.Instance.GetWaferSize(ModuleName.CoolingBuffer2, 0);
  310. entity.Align((WaferSize)Enum.Parse(typeof(WaferSize), args[0]), out result);
  311. return true;
  312. }
  313. public bool? Monitor(out string result, params string[] args)
  314. {
  315. result = string.Empty;
  316. string device = DeviceName.CoolingBuffer2;
  317. IoCoolingBuffer buffer = DEVICE.GetDevice<IoCoolingBuffer>(device);
  318. //Aligner _aligner = DEVICE.GetDevice<Aligner>(device);
  319. if (buffer.Error)
  320. {
  321. flag1 = ErrorCheckList1.VAC | ErrorCheckList1.STALL
  322. | ErrorCheckList1.LIMIT | ErrorCheckList1.POSITION | ErrorCheckList1.EMS
  323. | ErrorCheckList1.COMM | ErrorCheckList1.COMM2
  324. | ErrorCheckList1.CLAMPON | ErrorCheckList1.CLAMPOF;
  325. flag2 = ErrorCheckList2.COMMAND
  326. | ErrorCheckList2.CLAMP_S;
  327. flag3 = ErrorCheckList3.WAFLOST
  328. | ErrorCheckList3.ALIGNNG | ErrorCheckList3.HARDWARE
  329. | ErrorCheckList3.INTERNAL;
  330. return CheckError(device, out result);
  331. }
  332. if (!buffer.Moving)
  333. {
  334. return true;
  335. }
  336. return null;
  337. }
  338. }
  339. //public class SetAlignTask : CheckImp, ITask
  340. //{
  341. // public SetAlignTask()
  342. // {
  343. // HasInfoMessage = false;
  344. // }
  345. // public bool Execute(out string result, params string[] args)
  346. // {
  347. // string device = Args2Unit(args.Length > 0 ? args[0] : string.Empty);
  348. // AlignerServerModule entity = (AlignerServerModule)GetEntity(device);
  349. // if (entity == null || !AlignerInstalled)
  350. // {
  351. // result = PARAM_NG;
  352. // return false;
  353. // }
  354. // if (args.Length < 2 || !entity.SetAlign(args[1], out result))
  355. // {
  356. // result = PARAM_NG;
  357. // return false;
  358. // }
  359. // return true;
  360. // }
  361. // public bool? Monitor(out string result, params string[] args)
  362. // {
  363. // result = string.Empty;
  364. // string device = Args2Unit(args.Length > 0 ? args[0] : string.Empty);
  365. // return true;
  366. // }
  367. //}
  368. }