ReadIDTask.cs 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. using Aitex.Core.RT.Device;
  2. using Aitex.Core.Util;
  3. using EFEM.RT.Devices;
  4. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.CarrierIdReaders;
  5. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.CarrierIdReaders.OmronRFID;
  6. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts.LoadPortBase;
  7. namespace EFEM.RT.Tasks
  8. {
  9. public class ReadIDTask : CheckImp, ITask
  10. {
  11. public ReadIDTask()
  12. {
  13. }
  14. public bool Execute(out string result, params string[] args)
  15. {
  16. string device = Args2Unit(args[0]);
  17. IServerModule entity = GetEntity(device);
  18. if (entity == null || entity is LoadPortServerModule)
  19. {
  20. result = string.Format("PRAM_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<AirPolicy>(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 (!Check<NoPodPolicy>(device, out result))
  76. {
  77. return false;
  78. }
  79. //CarrierIdReader _device = Singleton<DeviceManager>.Instance.GetRfidReader(device);
  80. //if (_device == null)
  81. //{
  82. // result = PARAM_NG;
  83. // return false;
  84. //}
  85. //_device.Read(out result);
  86. LoadPortServerModule lpEntity = (LoadPortServerModule)GetEntity(device);
  87. if (lpEntity == null)
  88. {
  89. result = PARAM_NG;
  90. return false;
  91. }
  92. //if (!lpEntity.QueryWaferMap(out result))
  93. if (!lpEntity.Read(out result))
  94. {
  95. return false;
  96. }
  97. return true;
  98. }
  99. public bool? Monitor(out string result, params string[] args)
  100. {
  101. result = string.Empty;
  102. string device = Args2Unit(args.Length > 0 ?args[0]:string.Empty);
  103. //OmronRfidReader _device = Singleton<DeviceManager>.Instance.GetRfidReader(device);
  104. LoadPortBaseDevice _device = DEVICE.GetDevice<LoadPortBaseDevice>(device);
  105. if (_device.IsError)
  106. {
  107. flag1 = ErrorCheckList1.VAC | ErrorCheckList1.AIR | ErrorCheckList1.STALL
  108. | ErrorCheckList1.LIMIT | ErrorCheckList1.SENSOR | ErrorCheckList1.POSITION | ErrorCheckList1.EMS
  109. | ErrorCheckList1.COMM | ErrorCheckList1.COMM2 | ErrorCheckList1.VACON | ErrorCheckList1.VACOFF
  110. | ErrorCheckList1.CLAMPON | ErrorCheckList1.CLAMPOF;
  111. flag2 = ErrorCheckList2.RRTWAF | ErrorCheckList2.CRSWAF | ErrorCheckList2.THICKWAF | ErrorCheckList2.THINWAF
  112. | ErrorCheckList2.DBLWAF | ErrorCheckList2.BAOWAF | ErrorCheckList2.COMMAND | ErrorCheckList2.PODNG
  113. | ErrorCheckList2.PODMISMATCH | ErrorCheckList2.VAC_S | ErrorCheckList2.CLAMP_S | ErrorCheckList2.SAFTY
  114. | ErrorCheckList2.LOCKNG | ErrorCheckList2.UNLOCKNG | ErrorCheckList2.L_KEY_LK | ErrorCheckList2.L_KEY_UL;
  115. flag3 = ErrorCheckList3.MAP_S | ErrorCheckList3.MAP_S1 | ErrorCheckList3.MAP_S2 | ErrorCheckList3.WAFLOST
  116. | ErrorCheckList3.ALIGNNG
  117. | ErrorCheckList3.DRIVER | ErrorCheckList3.DRPOWERDOWN | ErrorCheckList3.HARDWARE
  118. | ErrorCheckList3.INTERNAL | ErrorCheckList3.E84_TIMEOUTx | ErrorCheckList3.E84_CS_VALID | ErrorCheckList3.READFAIL;
  119. return CheckError(device, out result);
  120. }
  121. if (!_device.IsBusy)
  122. {
  123. result = $"{_device.CarrierId}";
  124. return true;
  125. }
  126. return null;
  127. }
  128. }
  129. }