123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- 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 LocalSorterRecipe
- {
- public bool IsPreAlign;
- public double PreAlignAngle;
- public bool IsReadLaserMarker1;
- public int LaserMarkerWaferReaderIndex1;
- public bool IsReadLaserMarker2;
- public int LaserMarkerWaferReaderIndex2;
- public List<string> OcrReaderJob1;
- public List<string> OcrReaderJob2;
- public bool IsPostAlign;
- public double PostAlignAngle;
- public bool IsTurnOver;
- public string RecipeName { get; set; }
- public LocalSorterRecipe(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;
- value = node.Attribute("IsPreAlign").Value;
- bool.TryParse(value, out boolValue);
- IsPreAlign = 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("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;
- //value = node.Attribute("PostAlignAngle").Value;
- //double.TryParse(value, out doubleValue);
- //PostAlignAngle = doubleValue;
- PostAlignAngle = PreAlignAngle;
- 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);
- }
- }
- }
- }
|