using System; using Aitex.Core.RT.Device; using Aitex.Core.Util; using EFEM.RT.Modules; using Aitex.Sorter.Common; using Efem.Protocol; using MECF.Framework.Common.Equipment; using MECF.Framework.Common.SubstrateTrackings; using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts; using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robot; using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts.LoadPortBase; using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.RobotBase; using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.BufferStations; namespace EFEM.RT.Tasks { public class WafshTask : CheckImp, ITask { public WafshTask() { } 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 (DeviceDefineManager.Instance.GetValue("WAFSHEnable") == false) { if (!Check(DeviceName.Robot, out result)) { return false; } } else { if (!Check(device, out result)) { return false; } } if (!Check(device, out result)) { return false; } if (DeviceDefineManager.Instance.GetValue("WAFSHEnable") == false && !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 (ModuleHelper.IsLoadPort(ModuleHelper.Converter(device))) { 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.DockState == FoupDockState.Docked) { if (!lpEntity.QueryWaferMap(out result)) { return false; } } else { if (!lpEntity.Open(out result)) { return false; } } } } else if (ModuleHelper.IsBuffer(ModuleHelper.Converter(device))) { if (!entity.MapWafer(device, 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); if (ModuleHelper.IsLoadPort(ModuleHelper.Converter(device))) { LoadPortBaseDevice _loadport = DEVICE.GetDevice(device); RobotBaseDevice _robot = DEVICE.GetDevice(DeviceName.Robot); 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 (_robot.IsReady() && _loadport.IsReady() && _loadport.IsMapped) { if (Singleton.Instance.CheckAcked((int)RouteManager.MSG.MapWafer) && Singleton.Instance.IsIdle) { Singleton.Instance.SendMapEvent(_loadport); return true; } } } else if (ModuleHelper.IsBuffer(ModuleHelper.Converter(device))) { BufferStation _buffer = DEVICE.GetDevice(device); RobotBaseDevice _robot = DEVICE.GetDevice(DeviceName.Robot); if (_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 (_robot.IsReady() && _buffer.IsMapped) { if (Singleton.Instance.CheckAcked((int)RouteManager.MSG.MapWafer) && Singleton.Instance.IsIdle) { Singleton.Instance.SendMapEvent(_buffer); return true; } } } return null; } public bool Ack(EfemCommandType type, EfemCommand cmd, params string[] args) { return cmd == EfemCommand.WAFSH; } } }