using Aitex.Core.RT.Device; using Aitex.Core.Util; using Aitex.Sorter.Common; using Efem; using MECF.Framework.Common.Equipment; using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts; using System.Threading; using Efem.Protocol; using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robot; using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts.LoadPortBase; using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.RobotBase; using Aitex.Core.RT.SCCore; namespace EFEM.RT.Tasks { public class OpenTask : CheckImp, ITask { public OpenTask() { } public bool Execute(out string result, params string[] args) { string device = Args2Unit(args.Length > 0 ? args[0] : string.Empty); SystemServerModule entity = (SystemServerModule)GetEntity(DeviceName.System); if (entity == null) { 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; } var LPRobotActionIntervene = SC.GetValue("System.LPRobotActionIntervene"); if (LPRobotActionIntervene) { if (!Check(device, out result)) { return false; } } if (DeviceDefineManager.Instance.GetValue("WAFSHEnable") == false && LPRobotActionIntervene && !Check(DeviceName.Robot, 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 (DeviceDefineManager.Instance.GetValue("WAFSHEnable") == false && !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 (DeviceDefineManager.Instance.GetValue("WAFSHEnable")==false) //{ // result = "This device doesn't support mapping."; // return false; //} if (!DEVICE.GetDevice(device).IsMapWaferByLoadPort && DeviceDefineManager.Instance.GetValue("WAFSHEnable") == false) { if (!entity.MapWafer(device, out result)) { return false; } } else { LoadPortServerModule lpEntity = (LoadPortServerModule)GetEntity(device); if (lpEntity == null) { result = PARAM_NG; return false; } //if (!lpEntity.QueryWaferMap(out result)) if (!lpEntity.Open(out result)) { return false; } } 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 _loadport = DEVICE.GetDevice(device); RobotBaseDevice _robot = DEVICE.GetDevice(DeviceName.Robot); if (_loadport.CurrentState == LoadPortStateEnum.Error && _loadport.MapError) { result = "Slot Map Error"; Singleton.Instance.SendMapEvent(_loadport); return false; } if (_loadport.IsError || _robot.IsError) { flag1 = ErrorCheckList1.VAC | ErrorCheckList1.AIR | ErrorCheckList1.STALL | ErrorCheckList1.LIMIT | ErrorCheckList1.SENSOR | ErrorCheckList1.POSITION | ErrorCheckList1.EMS | ErrorCheckList1.COMM | ErrorCheckList1.COMM2 | ErrorCheckList1.VACON | ErrorCheckList1.VACOFF | ErrorCheckList1.CLAMPON | ErrorCheckList1.CLAMPOF; flag2 = ErrorCheckList2.RRTWAF | ErrorCheckList2.CRSWAF | ErrorCheckList2.THICKWAF | ErrorCheckList2.THINWAF | ErrorCheckList2.DBLWAF | ErrorCheckList2.BAOWAF | ErrorCheckList2.COMMAND | ErrorCheckList2.PODNG | ErrorCheckList2.PODMISMATCH | ErrorCheckList2.VAC_S | ErrorCheckList2.CLAMP_S | ErrorCheckList2.SAFTY | ErrorCheckList2.LOCKNG | ErrorCheckList2.UNLOCKNG | ErrorCheckList2.L_KEY_LK | ErrorCheckList2.L_KEY_UL; flag3 = ErrorCheckList3.MAP_S | ErrorCheckList3.MAP_S1 | ErrorCheckList3.MAP_S2 | ErrorCheckList3.WAFLOST | ErrorCheckList3.ALIGNNG | ErrorCheckList3.DRIVER | ErrorCheckList3.DRPOWERDOWN | ErrorCheckList3.HARDWARE | ErrorCheckList3.INTERNAL | ErrorCheckList3.E84_TIMEOUTx | ErrorCheckList3.E84_CS_VALID | ErrorCheckList3.READFAIL; return CheckError(device, out result); } SystemServerModule entity = (SystemServerModule)GetEntity(DeviceName.System); if (_loadport.IsReady() && _loadport.IsMapped&& !entity.Busy && _loadport.DockState== FoupDockState.Docked) { Singleton.Instance.SendMapEvent(_loadport); //if (_loadport.MapError) // _loadport.OnError("MappingError"); return true; } return null; } public bool Ack(EfemCommandType type, EfemCommand cmd, params string[] args) { return cmd == EfemCommand.WAFSH; } } }