using System; using System.Collections.Generic; using System.Linq; using System.Text; using Aitex.Core.Common; using Aitex.Core.RT.DataCenter; using Aitex.Core.RT.Device; using Aitex.Core.RT.Log; using Aitex.Sorter.Common; using MECF.Framework.Common.Equipment; using MECF.Framework.Common.SubstrateTrackings; using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts; namespace Aitex.Sorter.RT.Module.Recipe { /// /// Read wafer ID, 哪里来,哪里去;可选是否Align /// class RecipeParserReadWaferId : IRecipeParser { public SorterRecipeXml XmlRecipe { get; set; } public bool Init(SorterRecipeXml xmlRecipe, out string reason) { reason = string.Empty; if (xmlRecipe.RecipeType != SorterRecipeType.ReadWaferId) { LOG.Write("xml recipe type not valid, " + xmlRecipe.RecipeType); reason = "Recipe xml file not valid"; return false; } XmlRecipe = xmlRecipe; return true; } public List Parse(out string reason) { List result = new List(); reason = string.Empty; bool isLoad = false; for (int i = 0; i < XmlRecipe.Source.Count; i++) { LoadPort lp = DEVICE.GetDevice(XmlRecipe.Source[i].ToString()); if (lp.IsEnableTransferWafer(out reason)) isLoad = true; } if (!isLoad) { reason = "Source is not valid for transfer.."; return result; } for (int j = 0; j < XmlRecipe.Source.Count; j++) { string paramName = string.Empty; switch (XmlRecipe.Source[j]) { case ModuleName.LP1: paramName = ParamName.WaferInfoFoupA; break; case ModuleName.LP2: paramName = ParamName.WaferInfoFoupB; break; case ModuleName.LP3: paramName = ParamName.WaferInfoFoupC; break; case ModuleName.LP4: paramName = ParamName.WaferInfoFoupD; break; case ModuleName.LP5: paramName = ParamName.WaferInfoFoupE; break; case ModuleName.LP6: paramName = ParamName.WaferInfoFoupF; break; case ModuleName.LP7: paramName = ParamName.WaferInfoFoupG; break; case ModuleName.LP8: paramName = ParamName.WaferInfoFoupH; break; case ModuleName.LP9: paramName = ParamName.WaferInfoFoupI; break; case ModuleName.LP10: paramName = ParamName.WaferInfoFoupJ; break; default: reason = string.Format("recipe source {0} not valid", XmlRecipe.Source); return result; } WaferInfo[] foupInfos = WaferManager.Instance.GetWafers(XmlRecipe.Source[j]); //Array.Reverse(foupInfos); for (int i = 0; i < foupInfos.Length; i++) { if (foupInfos[i].IsEmpty) continue; result.Add(new TransferInfo() { Angle = XmlRecipe.AlignAngle, Option = (XmlRecipe.IsReadLaserMarker ? MoveOption.ReadID : MoveOption.None) | (XmlRecipe.IsReadT7Code ? MoveOption.ReadID2 : MoveOption.None) | (XmlRecipe.IsAlign ? MoveOption.Align : MoveOption.None) | (XmlRecipe.WaferReaderIndex == 1 ? MoveOption.Reader1 : MoveOption.None) | (XmlRecipe.WaferReaderIndex == 2 ? MoveOption.Reader2 : MoveOption.None) | (XmlRecipe.IsTurnOver ? MoveOption.Turnover : MoveOption.None), Source = XmlRecipe.Source[j], SourceSlot = i, Slot = i, Station = XmlRecipe.Source[j], WaferID = foupInfos[i].WaferID, }); } } //if (result.Count == 0) // reason = "Recipe has no vaild transfer task."; return result; } } }