123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853 |
- using Aitex.Core.Common;
- using Aitex.Core.RT.Log;
- using System;
- using System.Collections.Generic;
- using System.Collections.ObjectModel;
- using System.ComponentModel;
- using System.Linq;
- using System.Runtime.Serialization;
- using System.Text;
- using System.Xml;
- using System.Xml.Linq;
- using MECF.Framework.Common.Equipment;
- using System.IO;
- namespace Aitex.Sorter.Common
- {
- [DataContract]
- [Serializable]
- public class SorterHostUsageRecipeXml : INotifyPropertyChanged
- {
- public event PropertyChangedEventHandler PropertyChanged;
- public void OnPropertyChanged(string propertyName)
- {
- if (PropertyChanged != null)
- {
- PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
- }
- }
- private string name;
- [DataMember]
- public string Name
- {
- get
- {
- return name;
- }
- set
- {
- name = value;
- OnPropertyChanged("Name");
- }
- }
- private bool _isReadLaserMarker1 = false;
- [DataMember]
- public bool IsReadLaserMarker1
- {
- get { return _isReadLaserMarker1; }
- set
- {
- _isReadLaserMarker1 = value;
- OnPropertyChanged("IsReadLaserMarker1");
- }
- }
-
- private bool _isVerifyLaserMarker1;
- [DataMember]
- public bool IsVerifyLaserMarker1
- {
- get { return _isVerifyLaserMarker1; }
- set
- {
- _isVerifyLaserMarker1 = value;
- OnPropertyChanged("IsVerifyLaserMarker1");
- }
- }
- private bool _isVerifyChecksumLaserMarker1;
- [DataMember]
- public bool IsVerifyChecksumLaserMarker1
- {
- get { return _isVerifyChecksumLaserMarker1; }
- set
- {
- _isVerifyChecksumLaserMarker1 = value;
- OnPropertyChanged("IsVerifyChecksumLaserMarker1");
- }
- }
- private bool _isReadLaserMarker2 = false;
- [DataMember]
- public bool IsReadLaserMarker2
- {
- get { return _isReadLaserMarker2; }
- set
- {
- _isReadLaserMarker2 = value;
- OnPropertyChanged("IsReadLaserMarker2");
- }
- }
- private bool _isVerifyLaserMarker2;
- [DataMember]
- public bool IsVerifyLaserMarker2
- {
- get { return _isVerifyLaserMarker2; }
- set
- {
- _isVerifyLaserMarker2 = value;
- OnPropertyChanged("IsVerifyLaserMarker2");
- }
- }
- private bool _isVerifyChecksumLaserMarker2;
- [DataMember]
- public bool IsVerifyChecksumLaserMarker2
- {
- get { return _isVerifyChecksumLaserMarker2; }
- set
- {
- _isVerifyChecksumLaserMarker2 = value;
- OnPropertyChanged("IsVerifyChecksumLaserMarker2");
- }
- }
- private bool _isVerifyLaserMarkLength;
- [DataMember]
- public bool IsVerifyLaserMarkLength
- {
- get { return _isVerifyLaserMarkLength; }
- set
- {
- _isVerifyLaserMarkLength = value;
- OnPropertyChanged("IsVerifyLaserMarkLength");
- }
- }
- private bool _isVerifySlotPositionInLaserMarker;
- [DataMember]
- public bool IsVerifySlotPositionInLaserMarker
- {
- get { return _isVerifySlotPositionInLaserMarker; }
- set
- {
- _isVerifySlotPositionInLaserMarker = value;
- OnPropertyChanged("IsVerifySlotPositionInLaserMark");
- }
- }
- private bool _isVerifyWithHostDefine;
- [DataMember]
- public bool IsVerifyWithHostDefine
- {
- get { return _isVerifyWithHostDefine; }
- set
- {
- _isVerifyWithHostDefine = value;
- OnPropertyChanged("IsVerifyWithHostDefine");
- }
- }
- private int _intVerifyLaserMarkLength;
- [DataMember]
- public int IntVerifyLaserMarkerLength
- {
- get { return _intVerifyLaserMarkLength; }
- set
- {
- _intVerifyLaserMarkLength = value;
- OnPropertyChanged("IntVerifyLaserMarkLength");
- }
- }
- private int _intVerifySlotPositionInLaserMark;
- [DataMember]
- public int IntVerifySlotPositionInLaserMark
- {
- get { return _intVerifySlotPositionInLaserMark; }
- set
- {
- _intVerifySlotPositionInLaserMark = value;
- OnPropertyChanged("IntVerifySlotPositionInLaserMark");
- }
- }
- private bool _isAlign;
- [DataMember]
- public bool IsAlign
- {
- get { return _isAlign; }
- set
- {
- _isAlign = value;
- OnPropertyChanged("IsAlign");
- }
- }
- private double _preAlignAngle = 0;
- [DataMember]
- public double PreAlignAngle
- {
- get { return _preAlignAngle; }
- set
- {
- _preAlignAngle = value;
- //OnPropertyChanged("PreAlignAngle");
- }
- }
- private double _postAlignAngle = 0;
- [DataMember]
- public double PostAlignAngle
- {
- get { return _postAlignAngle; }
- set
- {
- _postAlignAngle = value;
- OnPropertyChanged("PostAlignAngle");
- }
- }
- private double _bladeRegulatorRatio = 0;
- [DataMember]
- public double BladeRegulatorRatio
- {
- get { return _bladeRegulatorRatio; }
- set
- {
- _bladeRegulatorRatio = value;
- OnPropertyChanged("BladeRegulatorRatio");
- }
- }
- private bool _isPostAlign;
- [DataMember]
- public bool IsPostAlign
- {
- get { return _isPostAlign; }
- set
- {
- _isPostAlign = value;
- OnPropertyChanged("IsPostAlign");
- }
- }
-
- private bool _isTurnOver;
- [DataMember]
- public bool IsTurnOver
- {
- get { return _isTurnOver; }
- set
- {
- _isTurnOver= value;
- OnPropertyChanged("IsTurnOver");
- }
- }
- private bool _isTurnOverBeforeAlign;
- [DataMember]
- public bool IsTurnOverBeforeAlign
- {
- get { return _isTurnOverBeforeAlign; }
- set
- {
- _isTurnOverBeforeAlign = value;
- OnPropertyChanged("IsTurnOverBeforeAlign");
- }
- }
- private int _laserMarkerWaferReaderIndex1;
- [DataMember]
- public int LaserMarkerWaferReaderIndex1
- {
- get => _laserMarkerWaferReaderIndex1;
- set
- {
- _laserMarkerWaferReaderIndex1 = value;
- OnPropertyChanged("LaserMarkerWaferReaderIndex1");
- }
- }
- private int _laserMarkerWaferReaderIndex2;
- [DataMember]
- public int LaserMarkerWaferReaderIndex2
- {
- get => _laserMarkerWaferReaderIndex2;
- set
- {
- _laserMarkerWaferReaderIndex2 = value;
- OnPropertyChanged("LaserMarkerWaferReaderIndex2");
- }
- }
- private bool _isRobotFlippeBeforeAlign;
- [DataMember]
- public bool IsRobotFlippeBeforeAlign
- {
- get { return _isRobotFlippeBeforeAlign; }
- set
- {
- _isRobotFlippeBeforeAlign = value;
- OnPropertyChanged("IsRobotFlippeBeforeAlign");
- }
- }
- private bool _isRobotFlippeAfterAlign;
- [DataMember]
- public bool IsRobotFlippeAfterAlign
- {
- get { return _isRobotFlippeAfterAlign; }
- set
- {
- _isRobotFlippeAfterAlign = value;
- OnPropertyChanged("IsRobotFlippeAfterAlign");
- }
- }
- private bool _isViaBuffer1;
- [DataMember]
- public bool IsViaBuffer1
- {
- get { return _isViaBuffer1; }
- set
- {
- _isViaBuffer1 = value;
- OnPropertyChanged("IsViaBuffer1");
- }
- }
- private bool _isViaBuffer1BeforeAligner;
- [DataMember]
- public bool IsViaBuffer1BeforeAligner
- {
- get { return _isViaBuffer1BeforeAligner; }
- set
- {
- _isViaBuffer1BeforeAligner = value;
- OnPropertyChanged("IsViaBuffer1BeforeAligner");
- }
- }
- private bool _isAlignmentFlat;
- [DataMember]
- public bool IsAlignmentFlat
- {
- get { return _isAlignmentFlat; }
- set
- {
- _isAlignmentFlat = value;
- OnPropertyChanged("IsAlignmentFlat");
- }
- }
- private bool _isViaPM1;
- [DataMember]
- public bool IsViaPM1
- {
- get { return _isViaPM1; }
- set
- {
- _isViaPM1 = value;
- OnPropertyChanged("IsViaPM1");
- }
- }
- private double _pm1XCoordinate;
- [DataMember]
- public double PM1XCoordinate
- {
- get { return _pm1XCoordinate; }
- set
- {
- _pm1XCoordinate = value;
- OnPropertyChanged("PM1XCoordinate");
- }
- }
- private double _pm1ZCoordinate;
- [DataMember]
- public double PM1ZCoordinate
- {
- get { return _pm1ZCoordinate; }
- set
- {
- _pm1ZCoordinate = value;
- OnPropertyChanged("PM1ZCoordinate");
- }
- }
- private bool _isAutoInspect;
- [DataMember]
- public bool IsAutoInspect
- {
- get { return _isAutoInspect; }
- set
- {
- _isAutoInspect = value;
- OnPropertyChanged("IsAutoInspect");
- }
- }
- private bool _isMoveToBuffer1BeforeDest;
- [DataMember]
- public bool IsMoveToBuffer1BeforeDest
- {
- get { return _isMoveToBuffer1BeforeDest; }
- set
- {
- _isMoveToBuffer1BeforeDest = value;
- OnPropertyChanged("IsMoveToBuffer1BeforeDest");
- }
- }
- private bool _isRobotFlippeBeforeBuffer1;
- [DataMember]
- public bool IsRobotFlippeBeforeBuffer1
- {
- get { return _isRobotFlippeBeforeBuffer1; }
- set
- {
- _isRobotFlippeBeforeBuffer1 = value;
- OnPropertyChanged("IsRobotFlippeBeforeBuffer1");
- }
- }
- private bool _isRobotFlippeBeforePM1;
- [DataMember]
- public bool IsRobotFlippeBeforePM1
- {
- get { return _isRobotFlippeBeforePM1; }
- set
- {
- _isRobotFlippeBeforePM1 = value;
- OnPropertyChanged("IsRobotFlippeBeforePM1");
- }
- }
- private bool _isRobotFlippeBeforeDestination;
- [DataMember]
- public bool IsRobotFlippeBeforeDestination
- {
- get { return _isRobotFlippeBeforeDestination; }
- set
- {
- _isRobotFlippeBeforeDestination = value;
- OnPropertyChanged("IsRobotFlippeBeforeDestination");
- }
- }
- private ObservableCollection<KeyValuePair<string, string>> _ocrReaderJob1;
- [DataMember]
- public ObservableCollection<KeyValuePair<string, string>> OcrReaderJob1
- {
- get => _ocrReaderJob1;
- set
- {
- _ocrReaderJob1 = value;
- OnPropertyChanged("OcrReaderJob1");
- }
- }
- private ObservableCollection<KeyValuePair<string, string>> _ocrReaderJob2;
- [DataMember]
- public ObservableCollection<KeyValuePair<string, string>> OcrReaderJob2
- {
- get => _ocrReaderJob2;
- set
- {
- _ocrReaderJob2 = value;
- OnPropertyChanged("OcrReaderJob2");
- }
- }
- private string _alignmentRecipe;
- [DataMember]
- public string AlignmentRecipe
- {
- get { return _alignmentRecipe; }
- set
- {
- _alignmentRecipe = value;
- OnPropertyChanged("AlignmentRecipe");
- }
- }
- private bool _isOnlyAlignFirstAndLastWafer;
- [DataMember]
- public bool IsOnlyAlignFirstAndLastWafer
- {
- get { return _isOnlyAlignFirstAndLastWafer; }
- set
- {
- _isOnlyAlignFirstAndLastWafer = value;
- OnPropertyChanged("IsOnlyAlignFirstAndLastWafer");
- }
- }
- private bool _isAlignmentTypeLine;
- [DataMember]
- public bool IsAlignmentTypeLine
- {
- get { return _isAlignmentTypeLine; }
- set
- {
- _isAlignmentTypeLine = value;
- OnPropertyChanged("IsAlignmentTypeLine");
- }
- }
- public SorterHostUsageRecipeXml(string name = "")
- {
- Name = name;
- OcrReaderJob1 = new ObservableCollection<KeyValuePair<string, string>>();
- OcrReaderJob2 = new ObservableCollection<KeyValuePair<string, string>>();
- }
- public SorterHostUsageRecipeXml(string content, string name = "")
- {
- Name = name;
- SetContent(content);
- }
- public bool SetContent(string content)
- {
- try
- {
- var doc = XDocument.Parse(content);
- ParseContent(doc);
- }
- catch (Exception e)
- {
- LOG.Write(e);
- return false;
- }
- return true;
- }
- public string GetContent()
- {
- var doc = new XDocument();
- var root = new XElement("Recipe");
- var element = new XElement("AitexSorterHostUsageRecipe"
- , new XAttribute("IsAlign", IsAlign)
- , new XAttribute("PreAlignAngle", PreAlignAngle)
- , new XAttribute("IsReadLaserMarker1", IsReadLaserMarker1.ToString())
- , new XAttribute("IsVerifyLaserMarker1", IsVerifyLaserMarker1.ToString())
- , new XAttribute("IsVerifyChecksumLaserMarker1", IsVerifyChecksumLaserMarker1.ToString())
- , new XAttribute("LaserMarkerWaferReaderIndex1", LaserMarkerWaferReaderIndex1)
- , new XAttribute("IsReadLaserMarker2", IsReadLaserMarker2.ToString())
- , new XAttribute("IsVerifyLaserMarker2", IsVerifyLaserMarker2.ToString())
- , new XAttribute("IsVerifyChecksumLaserMarker2", IsVerifyChecksumLaserMarker2.ToString())
- , new XAttribute("LaserMarkerWaferReaderIndex2", LaserMarkerWaferReaderIndex2)
- , new XAttribute("IsPostAlign", IsPostAlign.ToString())
- , new XAttribute("PostAlignAngle", PostAlignAngle)
- , new XAttribute("OcrReaderJob1", OcrReaderJob1 != null ? string.Join(";", OcrReaderJob1.Select(x => x.Value)) : "")
- , new XAttribute("OcrReaderJob2", OcrReaderJob2 != null ? string.Join(";", OcrReaderJob2.Select(x => x.Value)) : "")
- , new XAttribute("IsTurnOver", IsTurnOver.ToString())
- , new XAttribute("IsTurnOverBeforeAlign", IsTurnOverBeforeAlign.ToString())
- , new XAttribute("IsVerifyLaserMarkLength", IsVerifyLaserMarkLength.ToString())
- , new XAttribute("IsVerifySlotPositionInLaserMarker", IsVerifySlotPositionInLaserMarker.ToString())
- , new XAttribute("IntVerifyLaserMarkerLength", IntVerifyLaserMarkerLength.ToString())
- , new XAttribute("IntVerifySlotPositionInLaserMark", IntVerifySlotPositionInLaserMark.ToString())
- , new XAttribute("IsVerifyWithHostDefine", IsVerifyWithHostDefine.ToString())
- , new XAttribute("BladeRegulatorRatio", BladeRegulatorRatio)
- , new XAttribute("IsRobotFlippeBeforeAlign", IsRobotFlippeBeforeAlign.ToString())
- , new XAttribute("IsRobotFlippeAfterAlign", IsRobotFlippeAfterAlign.ToString())
- , new XAttribute("IsViaBuffer1", IsViaBuffer1.ToString())
- , new XAttribute("IsViaBuffer1BeforeAligner", IsViaBuffer1BeforeAligner.ToString())
- , new XAttribute("IsAlignmentFlat", IsAlignmentFlat.ToString())
- , new XAttribute("IsViaPM1", IsViaPM1.ToString())
- , new XAttribute("PM1XCoordinate", PM1XCoordinate.ToString())
- , new XAttribute("PM1ZCoordinate", PM1ZCoordinate.ToString())
- , new XAttribute("IsAutoInspect", IsAutoInspect.ToString())
- , new XAttribute("IsMoveToBuffer1BeforeDest", IsMoveToBuffer1BeforeDest.ToString())
- , new XAttribute("IsRobotFlippeBeforeBuffer1", IsRobotFlippeBeforeBuffer1.ToString())
- , new XAttribute("IsRobotFlippeBeforePM1", IsRobotFlippeBeforePM1.ToString())
- , new XAttribute("IsRobotFlippeBeforeDestination", IsRobotFlippeBeforeDestination.ToString())
- , new XAttribute("AlignmentRecipe", AlignmentRecipe??"")
- , new XAttribute("IsOnlyAlignFirstAndLastWafer", IsOnlyAlignFirstAndLastWafer.ToString())
- , new XAttribute("IsAlignmentTypeLine", IsAlignmentTypeLine.ToString())
- );
- root.Add(element);
- doc.Add(root);
- return doc.ToString();
- }
- private void ParseContent(XDocument doc)
- {
- try
- {
- var node = doc.Root.Element("AitexSorterHostUsageRecipe");
- if (node == null)
- {
- LOG.Write(string.Format("recipe not valid"));
- return;
- }
- string value = node.Attribute("PreAlignAngle").Value;
- double preAngle;
- double.TryParse(value, out preAngle);
- PreAlignAngle = preAngle;
- value = node.Attribute("IsReadLaserMarker1").Value;
- bool isReadLaserMarker1;
- bool.TryParse(value, out isReadLaserMarker1);
- IsReadLaserMarker1 = isReadLaserMarker1;
- value = node.Attribute("IsVerifyLaserMarker1").Value;
- bool isVerifyLaserMarker1;
- bool.TryParse(value, out isVerifyLaserMarker1);
- IsVerifyLaserMarker1 = isVerifyLaserMarker1;
- value = node.Attribute("IsVerifyChecksumLaserMarker1").Value;
- bool isVerifyChecksumLaserMarker1;
- bool.TryParse(value, out isVerifyChecksumLaserMarker1);
- IsVerifyChecksumLaserMarker1 = isVerifyChecksumLaserMarker1;
- LaserMarkerWaferReaderIndex1 = GetValue<int>(node, "LaserMarkerWaferReaderIndex1");
- value = node.Attribute("IsReadLaserMarker2").Value;
- bool isReadLaserMarker2;
- bool.TryParse(value, out isReadLaserMarker2);
- IsReadLaserMarker2 = isReadLaserMarker2;
- value = node.Attribute("IsVerifyLaserMarker2").Value;
- bool isVerifyLaserMarker2;
- bool.TryParse(value, out isVerifyLaserMarker2);
- IsVerifyLaserMarker2 = isVerifyLaserMarker2;
- value = node.Attribute("IsVerifyChecksumLaserMarker2").Value;
- bool isVerifyChecksumLaserMarker2;
- bool.TryParse(value, out isVerifyChecksumLaserMarker2);
- IsVerifyChecksumLaserMarker2 = isVerifyChecksumLaserMarker2;
- LaserMarkerWaferReaderIndex2 = GetValue<int>(node, "LaserMarkerWaferReaderIndex2");
- value = node.Attribute("IsPostAlign").Value;
- bool ispostAlign;
- bool.TryParse(value, out ispostAlign);
- IsPostAlign = ispostAlign;
- if (node.Attribute("IsAlign") != null)
- {
- value = node.Attribute("IsAlign").Value;
- bool isAlign;
- bool.TryParse(value, out isAlign);
- IsAlign = isAlign;
- }
- value = node.Attribute("PostAlignAngle").Value;
- double postAngle;
- double.TryParse(value, out postAngle);
- PostAlignAngle = postAngle;
- value = node.Attribute("OcrReaderJob1").Value;
- var arr = value.Split(new char[] { ';' }, System.StringSplitOptions.RemoveEmptyEntries);
- OcrReaderJob1 = new ObservableCollection<KeyValuePair<string, string>>(arr.ToDictionary(k => Path.GetFileNameWithoutExtension(k), v => v));
- value = node.Attribute("OcrReaderJob2").Value;
- arr = value.Split(new char[] { ';' }, System.StringSplitOptions.RemoveEmptyEntries);
- OcrReaderJob2 = new ObservableCollection<KeyValuePair<string, string>>(arr.ToDictionary(k => Path.GetFileNameWithoutExtension(k), v => v));
-
- value = node.Attribute("IsTurnOver").Value;
- bool isTurnOver;
- bool.TryParse(value, out isTurnOver);
- IsTurnOver = isTurnOver;
- if (node.Attribute("IsTurnOverBeforeAlign") != null)
- {
- value = node.Attribute("IsTurnOverBeforeAlign").Value;
- bool isTurnOverBeforeAlign;
- bool.TryParse(value, out isTurnOverBeforeAlign);
- IsTurnOverBeforeAlign = isTurnOverBeforeAlign;
- }
- if (node.Attribute("IsVerifyLaserMarkLength") != null)
- {
- value = node.Attribute("IsVerifyLaserMarkLength").Value;
- bool isVerifyLaserMarkLength;
- bool.TryParse(value, out isVerifyLaserMarkLength);
- IsVerifyLaserMarkLength = isVerifyLaserMarkLength;
- }
- if (node.Attribute("IsVerifySlotPositionInLaserMarker") != null)
- {
- value = node.Attribute("IsVerifySlotPositionInLaserMarker").Value;
- bool isVerifySlotPositionInLaserMarker;
- bool.TryParse(value, out isVerifySlotPositionInLaserMarker);
- IsVerifySlotPositionInLaserMarker = isVerifySlotPositionInLaserMarker;
- }
- if (node.Attribute("IntVerifyLaserMarkerLength") != null)
- {
- value = node.Attribute("IntVerifyLaserMarkerLength").Value;
- int intVerifyLaserMarkerLength;
- int.TryParse(value, out intVerifyLaserMarkerLength);
- IntVerifyLaserMarkerLength = intVerifyLaserMarkerLength;
- }
- if (node.Attribute("IntVerifySlotPositionInLaserMark") != null)
- {
- value = node.Attribute("IntVerifySlotPositionInLaserMark").Value;
- int intVerifySlotPositionInLaserMark;
- int.TryParse(value, out intVerifySlotPositionInLaserMark);
- IntVerifySlotPositionInLaserMark = intVerifySlotPositionInLaserMark;
- }
- if (node.Attribute("IsVerifyWithHostDefine") != null)
- {
- value = node.Attribute("IsVerifyWithHostDefine").Value;
- bool isVerifyWithHostDefine;
- bool.TryParse(value, out isVerifyWithHostDefine);
- IsVerifyWithHostDefine = isVerifyWithHostDefine;
- }
- if (node.Attribute("BladeRegulatorRatio") != null)
- {
- value = node.Attribute("BladeRegulatorRatio").Value;
- double bladeRegulatorRatio;
- double.TryParse(value, out bladeRegulatorRatio);
- BladeRegulatorRatio = bladeRegulatorRatio;
- }
- if (node.Attribute("IsRobotFlippeBeforeAlign") != null)
- {
- value = node.Attribute("IsRobotFlippeBeforeAlign").Value;
- bool isRobotFlippeBeforeAlign;
- bool.TryParse(value, out isRobotFlippeBeforeAlign);
- IsRobotFlippeBeforeAlign = isRobotFlippeBeforeAlign;
- }
- if (node.Attribute("IsRobotFlippeAfterAlign") != null)
- {
- value = node.Attribute("IsRobotFlippeAfterAlign").Value;
- bool isRobotFlippeAfterAlign;
- bool.TryParse(value, out isRobotFlippeAfterAlign);
- IsRobotFlippeAfterAlign = isRobotFlippeAfterAlign;
- }
- if (node.Attribute("IsViaBuffer1") != null)
- {
- value = node.Attribute("IsViaBuffer1").Value;
- bool isViaBuffer1;
- bool.TryParse(value, out isViaBuffer1);
- IsViaBuffer1 = isViaBuffer1;
- }
- if(node.Attribute("IsViaBuffer1BeforeAligner") != null)
- {
- value = node.Attribute("IsViaBuffer1BeforeAligner").Value;
- bool isViaBuffer1BeforeAligner;
- bool.TryParse(value, out isViaBuffer1BeforeAligner);
- IsViaBuffer1BeforeAligner = isViaBuffer1BeforeAligner;
- }
- if (node.Attribute("IsAlignmentFlat") != null)
- {
- value = node.Attribute("IsAlignmentFlat").Value;
- bool isAlignmentFlat;
- bool.TryParse(value, out isAlignmentFlat);
- IsAlignmentFlat = isAlignmentFlat;
- }
- if (node.Attribute("IsViaPM1") != null)
- {
- value = node.Attribute("IsViaPM1").Value;
- bool isViaPM1;
- bool.TryParse(value, out isViaPM1);
- IsViaPM1 = isViaPM1;
- }
- if (node.Attribute("PM1XCoordinate") != null)
- {
- value = node.Attribute("PM1XCoordinate").Value;
- double pm1XCoordinate;
- double.TryParse(value, out pm1XCoordinate);
- PM1XCoordinate = pm1XCoordinate;
- }
- if (node.Attribute("PM1ZCoordinate") != null)
- {
- value = node.Attribute("PM1ZCoordinate").Value;
- double pm1ZCoordinate;
- double.TryParse(value, out pm1ZCoordinate);
- PM1ZCoordinate = pm1ZCoordinate;
- }
- if (node.Attribute("IsAutoInspect") != null)
- {
- value = node.Attribute("IsAutoInspect").Value;
- bool isAutoInspect;
- bool.TryParse(value, out isAutoInspect);
- IsAutoInspect = isAutoInspect;
- }
- if (node.Attribute("IsMoveToBuffer1BeforeDest") != null)
- {
- value = node.Attribute("IsMoveToBuffer1BeforeDest").Value;
- bool isMoveToBuffer1BeforeDest;
- bool.TryParse(value, out isMoveToBuffer1BeforeDest);
- IsMoveToBuffer1BeforeDest = isMoveToBuffer1BeforeDest;
- }
- if (node.Attribute("IsRobotFlippeBeforeBuffer1") != null)
- {
- value = node.Attribute("IsRobotFlippeBeforeBuffer1").Value;
- bool bvalue;
- bool.TryParse(value, out bvalue);
- IsRobotFlippeBeforeBuffer1 = bvalue;
- }
- if (node.Attribute("IsRobotFlippeBeforePM1") != null)
- {
- value = node.Attribute("IsRobotFlippeBeforePM1").Value;
- bool bvalue;
- bool.TryParse(value, out bvalue);
- IsRobotFlippeBeforePM1 = bvalue;
- }
- if (node.Attribute("IsRobotFlippeBeforeDestination") != null)
- {
- value = node.Attribute("IsRobotFlippeBeforeDestination").Value;
- bool bvalue;
- bool.TryParse(value, out bvalue);
- IsRobotFlippeBeforeDestination = bvalue;
- }
- if (node.Attribute("AlignmentRecipe") != null)
- {
- value = node.Attribute("AlignmentRecipe").Value;
- AlignmentRecipe = value;
- }
- if (node.Attribute("IsOnlyAlignFirstAndLastWafer") != null)
- {
- value = node.Attribute("IsOnlyAlignFirstAndLastWafer").Value;
- bool bvalue;
- bool.TryParse(value, out bvalue);
- IsOnlyAlignFirstAndLastWafer = bvalue;
- }
- if (node.Attribute("IsAlignmentTypeLine") != null)
- {
- value = node.Attribute("IsAlignmentTypeLine").Value;
- bool bvalue;
- bool.TryParse(value, out bvalue);
- IsAlignmentTypeLine = bvalue;
- }
- }
- catch (Exception ex)
- {
- LOG.Write(ex);
- }
- }
- private T GetValue<T>(XElement element, string Name)
- {
- var attr = element.Attribute(Name);
- if (attr != null)
- {
- return (T)Convert.ChangeType(attr.Value, typeof(T));
- }
- return default(T);
- }
- }
- }
|