BusyPolicy.cs 847 B

123456789101112131415161718192021222324252627282930
  1. using athosRT.Devices.EFEM.Task;
  2. using athosRT.tool;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace athosRT.Devices.EFEM.ABS
  9. {
  10. public class BusyPolicy : CheckImp, IPolicy
  11. {
  12. public bool Check(string device, out string reason)
  13. {
  14. reason = string.Empty;
  15. if (device == "SignalTower")
  16. return true;
  17. IServerModule entity = GetEntity(device);
  18. if (!entity.Busy && !entity.InUsed)
  19. return true;
  20. if (entity.Busy)
  21. LogObject.Warning("BusyPolicy", device + " is Busy.");
  22. if (entity.InUsed)
  23. LogObject.Warning("BusyPolicy", device + " is InUsed.");
  24. reason = "BUSY";
  25. return false;
  26. }
  27. }
  28. }