E84Transfer.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. using Aitex.Core.RT.Device;
  2. using Aitex.Sorter.Common;
  3. using Efem;
  4. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts;
  5. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts.LoadPortBase;
  6. namespace EFEM.RT.Tasks
  7. {
  8. public class SetModeTask : CheckImp, ITask
  9. {
  10. public SetModeTask()
  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. if (!Check<NoReadyPolicy>(device, out result))
  23. {
  24. return false;
  25. }
  26. if (!Check<NoInitCompletedPolicy>(device, out result))
  27. {
  28. return false;
  29. }
  30. if (!Check<NoOriginCompletedPolicy>(device, out result))
  31. {
  32. return false;
  33. }
  34. if (!Check<ErrorPolicy>(device, out result))
  35. {
  36. return false;
  37. }
  38. if (!Check<BusyPolicy>(device, out result))
  39. {
  40. return false;
  41. }
  42. if (!Check<RemovePolicy>(device, out result))
  43. {
  44. return false;
  45. }
  46. if (!Check<MaintenancePolicy>(device, out result))
  47. {
  48. return false;
  49. }
  50. if (!Check<LinkPolicy>(device, out result))
  51. {
  52. return false;
  53. }
  54. if (!Check<ArmExtendPolicy>(device, out result))
  55. {
  56. return false;
  57. }
  58. if (!Check<NoPosPolicy>(device, out result))
  59. {
  60. return false;
  61. }
  62. if (!Check<NoPodPolicy>(device, out result))
  63. {
  64. return false;
  65. }
  66. if (!Check<NoFuncPolicy>(device, out result))
  67. {
  68. return false;
  69. }
  70. //TODO
  71. //LoadPort _device = DEVICE.GetDevice<LoadPort>(device);
  72. //_device.Clamp(out result);
  73. return true;
  74. }
  75. public bool? Monitor(out string result, params string[] args)
  76. {
  77. result = string.Empty;
  78. string device = Args2Unit(args.Length > 0 ?args[0]:string.Empty);
  79. LoadPortBaseDevice _device = DEVICE.GetDevice<LoadPortBaseDevice>(device);
  80. if (_device.IsError)
  81. {
  82. return false;
  83. }
  84. if (!_device.IsBusy && _device.ClampState == FoupClampState.Close)
  85. return true;
  86. return null;
  87. }
  88. }
  89. public class QueryModeTask : CheckImp, ITask
  90. {
  91. public QueryModeTask()
  92. {
  93. }
  94. public bool Execute(out string result, params string[] args)
  95. {
  96. string device = DeviceName.System;
  97. //EfemEventType type;
  98. //if (!Enum.TryParse(args[0], out type))
  99. //{
  100. // result = PARAM_NG;
  101. // return false;
  102. //}
  103. //EfemEventValue value;
  104. //if (!Enum.TryParse(args[1], out value))
  105. //{
  106. // result = PARAM_NG;
  107. // return false;
  108. //}
  109. if (!Check<NoReadyPolicy>(device, out result))
  110. {
  111. return false;
  112. }
  113. return true;
  114. }
  115. public bool? Monitor(out string result, params string[] args)
  116. {
  117. result = string.Empty;
  118. result = "AUTO";
  119. return true;
  120. }
  121. }
  122. }