RestrTask.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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.RT.EquipmentLibrary.HardwareUnits.Robot;
  6. namespace Aitex.Sorter.RT.EFEMs.Tasks
  7. {
  8. public class RestrTask : CheckImp, ITask
  9. {
  10. public RestrTask()
  11. {
  12. HasInfoMessage = false;
  13. }
  14. public bool Execute(out string result, params string[] args)
  15. {
  16. string device = DeviceName.Robot;
  17. if (!Check<NoReadyPolicy>(device, out result))
  18. {
  19. return false;
  20. }
  21. if (!Check<VacPolicy>(device, out result))
  22. {
  23. return false;
  24. }
  25. if (!Check<EMSPolicy>(device, out result))
  26. {
  27. return false;
  28. }
  29. if (!Check<ErrorPolicy>(device, out result))
  30. {
  31. return false;
  32. }
  33. if (!Check<NoHoldPolicy>(device, out result))
  34. {
  35. return false;
  36. }
  37. if (!Check<MaintenancePolicy>(device, out result))
  38. {
  39. return false;
  40. }
  41. if (!Check<PowerDownPolicy>(device, out result))
  42. {
  43. return false;
  44. }
  45. Singleton<EfemEntity>.Instance.SetSystemUnHold();
  46. Robot robot = DEVICE.GetDevice<Robot>(device);
  47. if (!robot.Resume( out result))
  48. {
  49. return false;
  50. }
  51. return true;
  52. }
  53. public bool? Monitor(out string result, params string[] args)
  54. {
  55. result = string.Empty;
  56. return true;
  57. }
  58. }
  59. }