using Aitex.Core.RT.Log; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Xml.Linq; namespace Aitex.Sorter.RT.Module.Recipe { public class ReadWaferIDRecipe { public bool IsPreAlign; public double PreAlignAngle; public bool IsReadLaserMarker1; public bool IsVerifyLaserMarker1; public bool IsVerifyChecksumLaserMarker1; public int LaserMarkerWaferReaderIndex1; public bool IsReadLaserMarker2; public bool IsVerifyLaserMarker2; public bool IsVerifyChecksumLaserMarker2; public int LaserMarkerWaferReaderIndex2; public List OcrReaderJob1; public List OcrReaderJob2; public bool IsPostAlign; public double PostAlignAngle; public bool IsTurnOver; public bool IsTurnOverBeforeAlign; public bool IsVerifyLaserMarkLength; public int LaserMarkLength; public bool IsVerifyLaserMarkSlotForNCD; public int SlotStartPositionForNCD; public bool IsVerifyWithHostDefine; public string RecipeName { get; set; } public ReadWaferIDRecipe(string content, string recipename) { try { RecipeName = recipename; var doc = XDocument.Parse(content); var node = doc.Root.Element("AitexSorterHostUsageRecipe"); if (node == null) { LOG.Write(string.Format("recipe not valid")); return; } string value = node.Attribute("PreAlignAngle").Value; double doubleValue; double.TryParse(value, out doubleValue); PreAlignAngle = doubleValue; value = node.Attribute("IsReadLaserMarker1").Value; bool boolValue; bool.TryParse(value, out boolValue); IsReadLaserMarker1 = boolValue; if (node.Attribute("IsAlign") != null) { value = node.Attribute("IsAlign").Value; bool.TryParse(value, out boolValue); IsPreAlign = boolValue; } value = node.Attribute("IsVerifyLaserMarker1").Value; bool.TryParse(value, out boolValue); IsVerifyLaserMarker1 = boolValue; value = node.Attribute("IsVerifyChecksumLaserMarker1").Value; bool.TryParse(value, out boolValue); IsVerifyChecksumLaserMarker1 = boolValue; value = node.Attribute("LaserMarkerWaferReaderIndex1").Value; int intValue; int.TryParse(value, out intValue); LaserMarkerWaferReaderIndex1 = intValue; value = node.Attribute("IsReadLaserMarker2").Value; bool.TryParse(value, out boolValue); IsReadLaserMarker2 = boolValue; value = node.Attribute("IsVerifyLaserMarker2").Value; bool.TryParse(value, out boolValue); IsVerifyLaserMarker2 = boolValue; value = node.Attribute("IsVerifyChecksumLaserMarker2").Value; bool.TryParse(value, out boolValue); IsVerifyChecksumLaserMarker2 = boolValue; value = node.Attribute("LaserMarkerWaferReaderIndex2").Value; int.TryParse(value, out intValue); LaserMarkerWaferReaderIndex2 = intValue; value = node.Attribute("IsPostAlign").Value; bool.TryParse(value, out boolValue); IsPostAlign = boolValue; value = node.Attribute("IsTurnOver").Value; bool.TryParse(value, out boolValue); IsTurnOver = boolValue; PostAlignAngle = PreAlignAngle; if (node.Attribute("PostAlignAngle") != null) { value = node.Attribute("PostAlignAngle").Value; double.TryParse(value, out doubleValue); PostAlignAngle = doubleValue; } if (node.Attribute("IsTurnOverBeforeAlign") != null) { value = node.Attribute("IsTurnOverBeforeAlign").Value; bool.TryParse(value, out boolValue); IsTurnOverBeforeAlign = boolValue; } if (node.Attribute("IsVerifyLaserMarkLength") != null) { value = node.Attribute("IsVerifyLaserMarkLength").Value; bool.TryParse(value, out boolValue); IsVerifyLaserMarkLength = boolValue; } if (node.Attribute("IntVerifyLaserMarkerLength") != null) { value = node.Attribute("IntVerifyLaserMarkerLength").Value; int.TryParse(value, out intValue); LaserMarkLength = intValue; } if (node.Attribute("IsVerifySlotPositionInLaserMarker") != null) { value = node.Attribute("IsVerifySlotPositionInLaserMarker").Value; bool.TryParse(value, out boolValue); IsVerifyLaserMarkSlotForNCD = boolValue; } if (node.Attribute("IntVerifySlotPositionInLaserMark") != null) { value = node.Attribute("IntVerifySlotPositionInLaserMark").Value; int.TryParse(value, out intValue); SlotStartPositionForNCD = intValue; } if (node.Attribute("IsVerifyWithHostDefine") != null) { value = node.Attribute("IsVerifyWithHostDefine").Value; bool.TryParse(value, out boolValue); IsVerifyWithHostDefine = boolValue; } value = node.Attribute("OcrReaderJob1").Value; var arr = value.Split(new char[] { ';' }, System.StringSplitOptions.RemoveEmptyEntries); OcrReaderJob1 = arr.ToList(); value = node.Attribute("OcrReaderJob2").Value; arr = value.Split(new char[] { ';' }, System.StringSplitOptions.RemoveEmptyEntries); OcrReaderJob2 = arr.ToList(); } catch (Exception ex) { LOG.Write(ex); } } public ReadWaferIDRecipe() { RecipeName = ""; } } }