using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Aitex.Core.Common; using Aitex.Core.RT.Device; using Aitex.Core.RT.Device.Unit; using Aitex.Core.RT.Log; using Aitex.Sorter.Common; using MECF.Framework.Common.Equipment; using MECF.Framework.Common.SubstrateTrackings; namespace EFEM.RT.Tasks { public class LiftTask : CheckImp, ITask { public LiftTask() { } public bool Execute(out string result, params string[] args) { string device = Args2Unit(args.Length > 0 ? args[0] : string.Empty); BufferServerModule entity = (BufferServerModule)GetEntity(device); if (entity == null) { result = PARAM_NG; return false; } string upDown = args[1]; if (upDown != "UP" && upDown != "DOWN") { LOG.Write("Lift command parameter 1 must be 'UP|DOWN'"); 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)) { // LOG.Write($"PickTask {device} Busy"); 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 ws = WaferManager.Instance.GetWaferSize((ModuleName)Enum.Parse( typeof(ModuleName),device),0); if (upDown == "UP") { entity.LiftUp(ws,out result); } else { entity.LiftDown(ws, 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); IoCoolingBuffer buffer = DEVICE.GetDevice(device); if (buffer.Error) { flag1 = ErrorCheckList1.VAC | ErrorCheckList1.STALL | ErrorCheckList1.LIMIT | ErrorCheckList1.POSITION | ErrorCheckList1.EMS | ErrorCheckList1.COMM | ErrorCheckList1.COMM2 | ErrorCheckList1.CLAMPON | ErrorCheckList1.CLAMPOF; flag2 = ErrorCheckList2.COMMAND | ErrorCheckList2.CLAMP_S; flag3 = ErrorCheckList3.WAFLOST | ErrorCheckList3.ALIGNNG | ErrorCheckList3.HARDWARE | ErrorCheckList3.INTERNAL; return CheckError(device, out result); } if (!buffer.Busy) { return true; } return null; } } }