CstidTask.cs 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. using Aitex.Core.Util;
  2. using Aitex.Sorter.RT.EFEMs.Servers;
  3. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.CarrierIdReaders;
  4. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.CarrierIdReaders.OmronRFID;
  5. namespace Aitex.Sorter.RT.EFEMs.Tasks
  6. {
  7. public class CstidTask : CheckImp, ITask
  8. {
  9. private string _param1;
  10. public CstidTask()
  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. _param1 = args[0];
  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<EMSPolicy>(device, out result))
  32. {
  33. return false;
  34. }
  35. if (!Check<ErrorPolicy>(device, out result))
  36. {
  37. return false;
  38. }
  39. if (!Check<BusyPolicy>(device, out result))
  40. {
  41. return false;
  42. }
  43. if (!Check<NoPodPolicy>(device, out result))
  44. {
  45. return false;
  46. }
  47. if (!Check<HoldPolicy>(device, out result))
  48. {
  49. return false;
  50. }
  51. if (!Check<RemovePolicy>(device, out result))
  52. {
  53. return false;
  54. }
  55. if (!Check<MaintenancePolicy>(device, out result))
  56. {
  57. return false;
  58. }
  59. if (!Check<LinkPolicy>(device, out result))
  60. {
  61. return false;
  62. }
  63. if (!Check<NoFuncPolicy>(device, out result))
  64. {
  65. return false;
  66. }
  67. CarrierIdReader _device = Singleton<EfemEntity>.Instance.EfemDevice.GetRfidReader(device);
  68. if (_device == null)
  69. {
  70. result = PARAM_NG;
  71. return false;
  72. }
  73. _device.Read(out result);
  74. return true;
  75. }
  76. public bool? Monitor(out string result, params string[] args)
  77. {
  78. result = string.Empty;
  79. string device = Args2Unit(args.Length > 0 ?args[0]:string.Empty);
  80. OmronRfidReader _device = Singleton<EfemEntity>.Instance.EfemDevice.GetRfidReader(device);
  81. if (_device.Error)
  82. {
  83. flag1 = ErrorCheckList1.VAC | ErrorCheckList1.AIR | ErrorCheckList1.STALL
  84. | ErrorCheckList1.LIMIT | ErrorCheckList1.SENSOR | ErrorCheckList1.POSITION | ErrorCheckList1.EMS
  85. | ErrorCheckList1.COMM | ErrorCheckList1.COMM2 | ErrorCheckList1.VACON | ErrorCheckList1.VACOFF
  86. | ErrorCheckList1.CLAMPON | ErrorCheckList1.CLAMPOF;
  87. flag2 = ErrorCheckList2.RRTWAF | ErrorCheckList2.CRSWAF | ErrorCheckList2.THICKWAF | ErrorCheckList2.THINWAF
  88. | ErrorCheckList2.DBLWAF | ErrorCheckList2.BAOWAF | ErrorCheckList2.COMMAND | ErrorCheckList2.PODNG
  89. | ErrorCheckList2.PODMISMATCH | ErrorCheckList2.VAC_S | ErrorCheckList2.CLAMP_S | ErrorCheckList2.SAFTY
  90. | ErrorCheckList2.LOCKNG | ErrorCheckList2.UNLOCKNG | ErrorCheckList2.L_KEY_LK | ErrorCheckList2.L_KEY_UL;
  91. flag3 = ErrorCheckList3.MAP_S | ErrorCheckList3.MAP_S1 | ErrorCheckList3.MAP_S2 | ErrorCheckList3.WAFLOST
  92. | ErrorCheckList3.ALIGNNG
  93. | ErrorCheckList3.DRIVER | ErrorCheckList3.DRPOWERDOWN | ErrorCheckList3.HARDWARE
  94. | ErrorCheckList3.INTERNAL | ErrorCheckList3.E84_TIMEOUTx | ErrorCheckList3.E84_CS_VALID | ErrorCheckList3.READFAIL;
  95. result = "ERR";
  96. return false;// CheckError(device, out result);
  97. }
  98. if (!_device.Busy)
  99. {
  100. result = $"{_device.FoupID}";
  101. return true;
  102. }
  103. return null;
  104. }
  105. }
  106. }