RemovePolicy.cs 985 B

1234567891011121314151617181920212223242526272829303132
  1. using athosRT.Devices.EFEM.Task;
  2. using MECF.Framework.Common.Equipment;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Text.RegularExpressions;
  8. using System.Threading.Tasks;
  9. namespace athosRT.Devices.EFEM.ABS
  10. {
  11. public class RemovePolicy : CheckImp, IPolicy
  12. {
  13. public bool Check(string device, out string reason)
  14. {
  15. reason = string.Empty;
  16. if (device == "SignalTower")
  17. return true;
  18. if (ModuleHelper.IsLoadPort((ModuleName)Enum.Parse(typeof(ModuleName), device)) && int.Parse(new Regex("[1-9]\\d*").Match(device).ToString()) > this.LoadPortQuantity)
  19. {
  20. reason = "REMOVE";
  21. return false;
  22. }
  23. IServerModule entity = this.GetEntity(device);
  24. if (entity != null && !entity.Disabled)
  25. return true;
  26. reason = "REMOVE";
  27. return false;
  28. }
  29. }
  30. }