DockTask.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. using Aitex.Core.RT.Device;
  2. using Aitex.Core.Util;
  3. using Aitex.Sorter.Common;
  4. using Aitex.Sorter.RT.EFEMs.Servers;
  5. using MECF.Framework.Common.Equipment;
  6. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts;
  7. namespace Aitex.Sorter.RT.EFEMs.Tasks
  8. {
  9. public class DockTask : CheckImp, ITask
  10. {
  11. public DockTask()
  12. {
  13. }
  14. public bool Execute(out string result, params string[] args)
  15. {
  16. string device = Args2Unit(args.Length > 0 ?args[0]:string.Empty);
  17. LoadPortServerModule entity = (LoadPortServerModule)GetEntity(device);
  18. if (entity == null )
  19. {
  20. result = PARAM_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. if (!entity.Dock(out result))
  80. {
  81. return false;
  82. }
  83. return true;
  84. }
  85. public bool? Monitor(out string result, params string[] args)
  86. {
  87. result = string.Empty;
  88. string device = Args2Unit(args.Length > 0 ?args[0]:string.Empty);
  89. LoadPort _device = DEVICE.GetDevice<LoadPort>(device);
  90. if (_device.Error)
  91. {
  92. flag1 = ErrorCheckList1.AIR
  93. | ErrorCheckList1.SENSOR
  94. | ErrorCheckList1.COMM | ErrorCheckList1.COMM2 ;
  95. flag2 = ErrorCheckList2.COMMAND | ErrorCheckList2.PODNG
  96. | ErrorCheckList2.PODMISMATCH| ErrorCheckList2.SAFTY
  97. | ErrorCheckList2.LOCKNG ;
  98. flag3 = ErrorCheckList3.DRIVER | ErrorCheckList3.DRPOWERDOWN | ErrorCheckList3.HARDWARE
  99. | ErrorCheckList3.INTERNAL;
  100. return CheckError(device, out result);
  101. }
  102. //if (!_device.IsBusy && _device.ClampState == FoupClampState.Close)
  103. //{
  104. // Singleton<EfemEntity>.Instance.SendSigStatEvent(ModuleHelper.Converter(device));
  105. // return true;
  106. //}
  107. return null;
  108. }
  109. }
  110. }