123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174 |
- 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<string> OcrReaderJob1;
- public List<string> 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 = "";
- }
- }
- }
|