using Aitex.Core.RT.Device; using Aitex.Sorter.Common; using Efem; using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts; using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts.LoadPortBase; namespace EFEM.RT.Tasks { public class SetModeTask : CheckImp, ITask { public SetModeTask() { } public bool Execute(out string result, params string[] args) { string device = Args2Unit(args.Length > 0 ?args[0]:string.Empty); IServerModule entity = GetEntity(device); if (entity == null || !(entity is LoadPortServerModule)) { result = PARAM_NG; return false; } if (!Check(device, out result)) { return false; } if (!Check(device, out result)) { return false; } if (!Check(device, out result)) { return false; } if (!Check(device, out result)) { return false; } if (!Check(device, out result)) { return false; } if (!Check(device, out result)) { return false; } if (!Check(device, out result)) { return false; } if (!Check(device, out result)) { return false; } if (!Check(device, out result)) { return false; } if (!Check(device, out result)) { return false; } if (!Check(device, out result)) { return false; } if (!Check(device, out result)) { return false; } //TODO //LoadPort _device = DEVICE.GetDevice(device); //_device.Clamp(out result); return true; } public bool? Monitor(out string result, params string[] args) { result = string.Empty; string device = Args2Unit(args.Length > 0 ?args[0]:string.Empty); LoadPortBaseDevice _device = DEVICE.GetDevice(device); if (_device.IsError) { return false; } if (!_device.IsBusy && _device.ClampState == FoupClampState.Close) return true; return null; } } public class QueryModeTask : CheckImp, ITask { public QueryModeTask() { } public bool Execute(out string result, params string[] args) { string device = DeviceName.System; //EfemEventType type; //if (!Enum.TryParse(args[0], out type)) //{ // result = PARAM_NG; // return false; //} //EfemEventValue value; //if (!Enum.TryParse(args[1], out value)) //{ // result = PARAM_NG; // return false; //} if (!Check(device, out result)) { return false; } return true; } public bool? Monitor(out string result, params string[] args) { result = string.Empty; result = "AUTO"; return true; } } }