UserDefineTask.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. using Aitex.Core.RT.Device;
  2. using Aitex.Core.Util;
  3. using EFEM.RT.Devices;
  4. using MECF.Framework.Common.Equipment;
  5. namespace EFEM.RT.Tasks
  6. {
  7. public class UserDefineTask : CheckImp, ITask
  8. {
  9. public UserDefineTask()
  10. {
  11. HasInfoMessage = false;
  12. }
  13. public bool Execute(out string result, params string[] args)
  14. {
  15. result = string.Empty;
  16. if (args.Length < 2)
  17. {
  18. result = PARAM_NG;
  19. return false;
  20. }
  21. if(args[0].StartsWith("LL"))
  22. {
  23. if(!LoadLockDevice.IsIdle)
  24. {
  25. result = "BUSY";
  26. return false;
  27. }
  28. if(args[1] == "AtmDoor")
  29. {
  30. if(args[2] == "1")
  31. LoadLockDevice.OpenAtmDoor(out result);
  32. else
  33. LoadLockDevice.CloseAtmDoor(out result);
  34. }
  35. else if (args[1] == "VtmDoor")
  36. {
  37. if (args[2] == "1")
  38. LoadLockDevice.OpenVtmDoor(out result);
  39. else
  40. LoadLockDevice.CloseVtmDoor(out result);
  41. }
  42. }
  43. return true;
  44. }
  45. public bool? Monitor(out string result, params string[] args)
  46. {
  47. result = "";
  48. if (args[0].StartsWith("LL"))
  49. {
  50. if(LoadLockDevice.IsIdle)
  51. {
  52. if (DeviceDefineManager.Instance.GetValue<bool>("LLDoorControlByStation") ?? false)
  53. {
  54. Singleton<EfemEntity>.Instance.SendSigStatEvent(ModuleName.LL1);
  55. }
  56. return true;
  57. }
  58. }
  59. else
  60. {
  61. return true;
  62. }
  63. return null;
  64. }
  65. }
  66. }