E84Mode.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. using Aitex.Core.RT.Device;
  2. using Aitex.Core.RT.Device.Unit;
  3. using Aitex.Core.Util;
  4. using Aitex.Sorter.Common;
  5. using Efem;
  6. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts;
  7. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts.LoadPortBase;
  8. namespace EFEM.RT.Tasks
  9. {
  10. public class SetTransferTask : CheckImp, ITask
  11. {
  12. public SetTransferTask()
  13. {
  14. }
  15. public bool Execute(out string result, params string[] args)
  16. {
  17. string device = Args2Unit(args.Length > 0 ?args[0]:string.Empty);
  18. IServerModule entity = GetEntity(device);
  19. if (entity == null || entity is LoadPortServerModule)
  20. {
  21. result = PARAM_NG;
  22. return false;
  23. }
  24. if (!Check<NoReadyPolicy>(device, out result))
  25. {
  26. return false;
  27. }
  28. if (!Check<BusyPolicy>(device, out result))
  29. {
  30. return false;
  31. }
  32. if (!Check<RemovePolicy>(device, out result))
  33. {
  34. return false;
  35. }
  36. if (!Check<MaintenancePolicy>(device, out result))
  37. {
  38. return false;
  39. }
  40. if (!Check<LinkPolicy>(device, out result))
  41. {
  42. return false;
  43. }
  44. if (!Check<NoFuncPolicy>(device, out result))
  45. {
  46. return false;
  47. }
  48. ///TODO
  49. //LoadPort _device = DEVICE.GetDevice<LoadPort>(device);
  50. //_device.Clamp(out result);
  51. var e84Lp = DEVICE.GetDevice<E84Passiver>(Singleton<EfemEntity>.Instance.GetE84LpName(device.ToString()));
  52. if(e84Lp == null)
  53. {
  54. return false;
  55. }
  56. if (bool.Parse(args[0]))
  57. return e84Lp.SetAMHS(out result);
  58. else
  59. return e84Lp.SetManual(out result);
  60. }
  61. public bool? Monitor(out string result, params string[] args)
  62. {
  63. result = string.Empty;
  64. string device = Args2Unit(args.Length > 0 ?args[0]:string.Empty);
  65. LoadPortBaseDevice _device = DEVICE.GetDevice<LoadPortBaseDevice>(device);
  66. if (_device.IsError)
  67. {
  68. flag3 = ErrorCheckList3.INTERNAL;
  69. return CheckError(device, out result);
  70. }
  71. if (!_device.IsBusy && _device.ClampState == FoupClampState.Close)
  72. return true;
  73. return null;
  74. }
  75. }
  76. public class QueryTransferTask : CheckImp, ITask
  77. {
  78. public QueryTransferTask()
  79. {
  80. }
  81. public bool Execute(out string result, params string[] args)
  82. {
  83. string device = DeviceName.System;
  84. //EfemEventType type;
  85. //if (!Enum.TryParse(args[0], out type))
  86. //{
  87. // result = PARAM_NG;
  88. // return false;
  89. //}
  90. //EfemEventValue value;
  91. //if (!Enum.TryParse(args[1], out value))
  92. //{
  93. // result = PARAM_NG;
  94. // return false;
  95. //}
  96. if (!Check<NoReadyPolicy>(device, out result))
  97. {
  98. return false;
  99. }
  100. return true;
  101. }
  102. public bool? Monitor(out string result, params string[] args)
  103. {
  104. result = string.Empty;
  105. result = "LOAD";
  106. //EfemEventType type;
  107. //Enum.TryParse(args[0], out type);
  108. //SystemEntity entity = (SystemEntity)GetEntity(DeviceName.System);
  109. //if (entity.QueryEvent(type))
  110. // result = string.Format("ON");
  111. //else
  112. // result = string.Format("OFF");
  113. return true;
  114. }
  115. }
  116. }