AbortTask.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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.Robot;
  7. namespace Aitex.Sorter.RT.EFEMs.Tasks
  8. {
  9. public class AbortTask : CheckImp, ITask
  10. {
  11. public AbortTask()
  12. {
  13. }
  14. public bool Execute(out string result, params string[] args)
  15. {
  16. string device = DeviceName.Robot;
  17. if (args.Length > 0)
  18. {
  19. result = PARAM_NG;
  20. return false;
  21. }
  22. if (!Check<NoReadyPolicy>(device, out result))
  23. {
  24. return false;
  25. }
  26. if (!Check<VacPolicy>(device, out result))
  27. {
  28. return false;
  29. }
  30. if (!Check<EMSPolicy>(device, out result))
  31. {
  32. return false;
  33. }
  34. if (!Check<CMPLPolicy>(device, out result))
  35. {
  36. return false;
  37. }
  38. if (!Check<ErrorPolicy>(device, out result))
  39. {
  40. return false;
  41. }
  42. if (!Check<NoHoldPolicy>(device, out result))
  43. {
  44. return false;
  45. }
  46. if (!Check<MaintenancePolicy>(device, out result))
  47. {
  48. return false;
  49. }
  50. if (!Check<PowerDownPolicy>(device, out result))
  51. {
  52. return false;
  53. }
  54. Singleton<EfemEntity>.Instance.SetSystemUnHold();
  55. if (Singleton<EfemEntity>.Instance.EfemDevice.Home(ModuleName.Robot))
  56. {
  57. result = "BUSY";
  58. return false;
  59. }
  60. return true;
  61. }
  62. public bool? Monitor(out string result, params string[] args)
  63. {
  64. result = string.Empty;
  65. if (Singleton<EfemEntity>.Instance.EfemDevice.CheckIsError(ModuleName.Robot))
  66. {
  67. return false;
  68. }
  69. if (Singleton<EfemEntity>.Instance.EfemDevice.CheckIsIdle(ModuleName.Robot))
  70. {
  71. return true;
  72. }
  73. return null;
  74. }
  75. }
  76. }