AirPolicy.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using Aitex.Core.RT.Device;
  2. using Aitex.Core.RT.Device.Unit;
  3. using athosRT.Devices.EFEM.Task;
  4. using athosRT.tool;
  5. using MECF.Framework.Common.Equipment;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. namespace athosRT.Devices.EFEM.ABS
  12. {
  13. class AirPolicy : CheckImp, IPolicy
  14. {
  15. public new bool Check(string device, out string reason)
  16. {
  17. reason = string.Empty;
  18. if (device == "SignalTower")
  19. {
  20. return true;
  21. }
  22. ModuleName result;
  23. if (!Enum.TryParse(device, out result))
  24. {
  25. reason = "PARAM_NG";
  26. return false;
  27. }
  28. if (ModuleHelper.IsLoadPort(result))
  29. {
  30. IoSensor device1 = DEVICE.GetDevice<IoSensor>("SensorAirPressureErrorForLoadport");
  31. //如果是LP LP的AIR压力信号满足 或者没有这个信号(不需要)
  32. if (device1 == null || device1.Value)
  33. return true;
  34. else
  35. {
  36. reason = $"AIR/{result}";
  37. return false;
  38. }
  39. }
  40. if (result == ModuleName.Robot || result ==ModuleName.System)
  41. {
  42. //如果是Robot Robot的AIR压力信号满足 或者没有这个信号(不需要)
  43. IoSensor device2 = DEVICE.GetDevice<IoSensor>("SensorAirPressureErrorForRobot");
  44. if (device2 == null || device2.Value)
  45. return true;
  46. else
  47. {
  48. reason = $"AIR/{result}";
  49. return false;
  50. }
  51. }
  52. reason = "";
  53. return true;
  54. }
  55. }
  56. }