E84Mode.cs 3.2 KB

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