using athosRT.Devices.EFEM.Task; using MECF.Framework.Common.Equipment; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; namespace athosRT.Devices.EFEM.ABS { public class RemovePolicy : CheckImp, IPolicy { public bool Check(string device, out string reason) { reason = string.Empty; if (device == "SignalTower") return true; if (ModuleHelper.IsLoadPort((ModuleName)Enum.Parse(typeof(ModuleName), device)) && int.Parse(new Regex("[1-9]\\d*").Match(device).ToString()) > this.LoadPortQuantity) { reason = "REMOVE"; return false; } IServerModule entity = this.GetEntity(device); if (entity != null && !entity.Disabled) return true; reason = "REMOVE"; return false; } } }