InitBusyPolicy.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 InitBusyPolicy : 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 = this.GetEntity(device);
  18. if (entity is RobotServerModule)
  19. {
  20. if ((entity.Busy || entity.InUsed) && !entity.Error)
  21. {
  22. if (entity.Busy)
  23. LogObject.Warning("BusyPolicy " , device + " is Busy");
  24. if (entity.InUsed)
  25. LogObject.Warning("BusyPolicy " , device + " is InUsed");
  26. reason = "BUSY";
  27. return false;
  28. }
  29. }
  30. else if (entity.Busy || entity.InUsed)
  31. {
  32. if (entity.Busy)
  33. LogObject.Warning("BusyPolicy " , device + " is Busy");
  34. if (entity.InUsed)
  35. LogObject.Warning("BusyPolicy " , device + " is InUsed");
  36. reason = "BUSY";
  37. return false;
  38. }
  39. return true;
  40. }
  41. }
  42. }