123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915 |
- 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;
- namespace Aitex.Sorter.Common
- {
- [DataContract]
- [Serializable]
- public class SorterRecipeXml : 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");
- }
- }
- [DataMember]
- public SorterRecipeType RecipeType
- {
- get { return _type; }
- set
- {
- _type = value;
- OnPropertyChanged("RecipeType");
- }
- }
- [DataMember]
- public ObservableCollection<ModuleName> Source
- {
- get { return _source; }
- set
- {
- _source = value;
- OnPropertyChanged("Source");
- OnPropertyChanged("SourceStation");
- }
- }
- public string StringListSource
- {
- get
- {
- if (RecipeType != SorterRecipeType.HostNToN && RecipeType != SorterRecipeType.TransferNToN)
- return string.Join(",", SourceStation);
- return string.Empty;
- }
- }
- public ObservableCollection<string> SourceStation
- {
- get { return new ObservableCollection<string>(_source.Select(x => x.ToString())); }
- set
- {
- _source = new ObservableCollection<ModuleName>(value.Select(x => (ModuleName)Enum.Parse(typeof(ModuleName), x)));
- OnPropertyChanged("Source");
- OnPropertyChanged("SourceStation");
- }
- }
- [DataMember]
- public ObservableCollection<ModuleName> Destination
- {
- get { return _destination; }
- set
- {
- _destination = value;
- OnPropertyChanged("Destination");
- OnPropertyChanged("DestinationStation");
- }
- }
- public string StringListDestination
- {
- get
- {
- if (RecipeType == SorterRecipeType.Transfer1To1 || RecipeType == SorterRecipeType.TransferNTo1)
- return string.Join(",", DestinationStation);
- return string.Empty;
- }
- }
- public ObservableCollection<string> DestinationStation
- {
- get { return new ObservableCollection<string>(_destination.Select(x => x.ToString())); }
- set
- {
- _destination = new ObservableCollection<ModuleName>(value.Select(x => (ModuleName)Enum.Parse(typeof(ModuleName), x)));
- OnPropertyChanged("Destination");
- OnPropertyChanged("DestinationStation");
- }
- }
- [DataMember]
- public bool IsReadLaserMarker
- {
- get { return _isReadLaserMarker; }
- set
- {
- _isReadLaserMarker = value;
- OnPropertyChanged("IsReadLaserMarker");
- }
- }
- [DataMember]
- public string LaserMark1Jobs
- {
- get { return _lasermark1jobs; }
- set
- {
- _lasermark1jobs = value;
- OnPropertyChanged("LaserMark1Jobs");
- }
- }
- [DataMember]
- public string ReadIDRecipe
- {
- get { return _readidrecipe; }
- set
- {
- _readidrecipe = value;
- OnPropertyChanged("ReadIDRecipe");
- }
- }
- [DataMember]
- public bool IsReadT7Code
- {
- get { return _isReadT7Code; }
- set
- {
- _isReadT7Code = value;
- OnPropertyChanged("IsReadT7Code");
- }
- }
- [DataMember]
- public string LaserMark2Jobs
- {
- get { return _lasermark2jobs; }
- set
- {
- _lasermark2jobs = value;
- OnPropertyChanged("LaserMark2Jobs");
- }
- }
- [DataMember]
- public bool IsTurnOver
- {
- get { return _isTurnOver; }
- set
- {
- _isTurnOver = value;
- OnPropertyChanged("IsTurnOver");
- }
- }
- [DataMember]
- public bool IsAlign
- {
- get { return _isAlign; }
- set
- {
- _isAlign = value;
- OnPropertyChanged("IsAlign");
- }
- }
- [DataMember]
- public bool IsPostAlign
- {
- get { return _isPostAlign; }
- set
- {
- _isPostAlign = value;
- OnPropertyChanged("IsPostAlign");
- }
- }
- private bool _isVerifyLaserMarker;
- [DataMember]
- public bool IsVerifyLaserMarker
- {
- get { return _isVerifyLaserMarker; }
- set
- {
- _isVerifyLaserMarker = value;
- OnPropertyChanged("IsVerifyLaserMarker");
- }
- }
- private bool _isVerifyT7Code;
- [DataMember]
- public bool IsVerifyT7Code
- {
- get { return _isVerifyT7Code; }
- set
- {
- _isVerifyT7Code = value;
- OnPropertyChanged("IsVerifyT7Code");
- }
- }
- private OrderByMode _orderBy;
- [DataMember]
- public OrderByMode OrderBy
- {
- get { return _orderBy; }
- set
- {
- _orderBy = value;
- OnPropertyChanged("OrderBy");
- }
- }
- [DataMember]
- public double AlignAngle
- {
- get { return _anlignAngle; }
- set
- {
- _anlignAngle = value;
- OnPropertyChanged("AlignAngle");
- }
- }
- [DataMember]
- public double PostAlignAngle
- {
- get { return _postAlignAngle; }
- set
- {
- _postAlignAngle = value;
- OnPropertyChanged("PostAlignAngle");
- }
- }
- [DataMember]
- public SorterRecipePlaceModeTransfer1To1 PlaceModeTransfer1To1
- {
- get { return _placeModeTransfer1To1; }
- set
- {
- _placeModeTransfer1To1 = value;
- OnPropertyChanged("PlaceModeTransfer1To1");
- OnPropertyChanged("PlaceMode");
- }
- }
- [DataMember]
- public SorterPickMode PickMode
- {
- get { return _pickMode; }
- set
- {
- _pickMode = value;
- OnPropertyChanged("PickMode");
- }
- }
- [DataMember]
- public SorterRecipePlaceModeOrder PlaceModeOrder
- {
- get { return _placeModeOrder; }
- set
- {
- _placeModeOrder = value;
- OnPropertyChanged("PlaceModeOrder");
- OnPropertyChanged("PlaceMode");
- }
- }
- [DataMember]
- public SorterRecipePlaceModePack PlaceModePack
- {
- get { return _placeModePack; }
- set
- {
- _placeModePack = value;
- OnPropertyChanged("PlaceModePack");
- OnPropertyChanged("PlaceMode");
- }
- }
- private int waferReaderIndex;
- [DataMember]
- public int WaferReaderIndex
- {
- get => waferReaderIndex;
- set
- {
- waferReaderIndex = value;
- OnPropertyChanged("WaferReaderIndex");
- }
- }
- private int waferReader2Index;
- [DataMember]
- public int WaferReader2Index
- {
- get => waferReader2Index;
- set
- {
- waferReader2Index = value;
- OnPropertyChanged("WaferReader2Index");
- }
- }
- [DataMember]
- public ObservableCollection<SorterRecipeTransferTableItem> TransferItems
- {
- get; set;
- }
- [DataMember]
- public ObservableCollection<SorterHostUsageRecipeTableItem> HostUsageItems
- {
- get; set;
- }
- [DataMember]
- public ObservableCollection<WaferInfo> TransferSourceLP1
- {
- get; set;
- }
- [DataMember]
- public ObservableCollection<WaferInfo> TransferSourceLP2
- {
- get; set;
- }
- [DataMember]
- public ObservableCollection<WaferInfo> TransferSourceLP3
- {
- get; set;
- }
- [DataMember]
- public ObservableCollection<WaferInfo> TransferDestinationLP1
- {
- get; set;
- }
- [DataMember]
- public ObservableCollection<WaferInfo> TransferDestinationLP2
- {
- get; set;
- }
- [DataMember]
- public ObservableCollection<WaferInfo> TransferDestinationLP3
- {
- get; set;
- }
- public string PlaceMode
- {
- get
- {
- var placeMode = "";
- switch (RecipeType)
- {
- case SorterRecipeType.Transfer1To1:
- case SorterRecipeType.TransferNTo1:
- placeMode = PlaceModeTransfer1To1.ToString();
- break;
- case SorterRecipeType.TransferNToN:
- case SorterRecipeType.HostNToN:
- break;
- case SorterRecipeType.Pack:
- placeMode = PlaceModePack.ToString();
- break;
- case SorterRecipeType.Order:
- placeMode = PlaceModeOrder.ToString();
- break;
- case SorterRecipeType.Align:
- break;
- case SorterRecipeType.ReadWaferId:
- break;
- default:
- break;
- }
- return placeMode;
- }
- }
- public SlotTransferInfo[] TransferSlotInfoA
- {
- get
- {
- return GetTransferSlotInfo(ModuleName.LP1);
- }
- }
- public SlotTransferInfo[] TransferSlotInfoB
- {
- get
- {
- return GetTransferSlotInfo(ModuleName.LP2);
- }
- }
- public SlotTransferInfo[] TransferSlotInfoC
- {
- get
- {
- return GetTransferSlotInfo(ModuleName.LP3);
- }
- }
- private SlotTransferInfo[] GetTransferSlotInfo(ModuleName station)
- {
- var result = new SlotTransferInfo[25];
- for (int i = 0; i < 25; i++)
- {
- var slotInfo = new SlotTransferInfo();
- slotInfo.Station = station;
- slotInfo.Slot = i;
- var srcItem = TransferItems.FirstOrDefault(x => x.SourceStation == slotInfo.Station && x.SourceSlot == slotInfo.Slot);
- if (srcItem != null)
- {
- slotInfo.DestinationStation = srcItem.DestinationStation;
- slotInfo.DestinationSlot = srcItem.DestinationSlot;
- }
- var dstItem = TransferItems.FirstOrDefault(x => x.DestinationStation == slotInfo.Station && x.DestinationSlot == slotInfo.Slot);
- if (dstItem != null)
- {
- slotInfo.SourceStation = dstItem.SourceStation;
- slotInfo.SourceSlot = dstItem.SourceSlot;
- }
- result[i] = slotInfo;
- }
- return result;
- }
- private static string _template = @"<?xml version='1.0'?><AitexSorterRecipe Type='' Source='' Destination='' PlaceMode='' IsReadLaserMarker='' IsReadT7Code='' OrderBy='' IsAlign='' AlignAngle='' IsVerifyLaserMarker='' IsVerifyT7Code='' IsTurnOver=''><TransferTable></TransferTable></AitexSorterRecipe>";
- private XDocument doc = new XDocument();
- private SorterRecipeType _type = SorterRecipeType.Transfer1To1;
- private ObservableCollection<ModuleName> _source = new ObservableCollection<ModuleName>();
- private ObservableCollection<ModuleName> _destination = new ObservableCollection<ModuleName>();
- private SorterRecipePlaceModeTransfer1To1 _placeModeTransfer1To1 = SorterRecipePlaceModeTransfer1To1.FromBottom;
- private SorterRecipePlaceModePack _placeModePack = SorterRecipePlaceModePack.FromBottomInsert;
- private SorterRecipePlaceModeOrder _placeModeOrder = SorterRecipePlaceModeOrder.Forward;
- private bool _isAlign = false;
- private double _anlignAngle = 0;
- private bool _isReadLaserMarker = false;
- private bool _isReadT7Code = false;
- private bool _isTurnOver = false;
- private SorterPickMode _pickMode = SorterPickMode.FromBottom;
- private bool _isPostAlign = false;
- private double _postAlignAngle = 0;
- private string _lasermark1jobs = "";
- private string _lasermark2jobs = "";
- private string _readidrecipe = "";
- public SorterRecipeXml(string name = "") : this(_template, name)
- {
- }
- public SorterRecipeXml(string content, string name = "")
- {
- TransferItems = new ObservableCollection<SorterRecipeTransferTableItem>();
- HostUsageItems = new ObservableCollection<SorterHostUsageRecipeTableItem>();
- Name = name;
- SetContent(content);
- }
- public SorterRecipeXml(string content, bool IsRemoteRecipe, string name = "")
- {
- TransferItems = new ObservableCollection<SorterRecipeTransferTableItem>();
- HostUsageItems = new ObservableCollection<SorterHostUsageRecipeTableItem>();
- Name = name;
- try
- {
- doc = XDocument.Parse(content);
- }
- catch (Exception e)
- {
- LOG.Write(e);
- }
- }
- public bool SetContent(string content)
- {
- try
- {
- doc = XDocument.Parse(content);
- ParseContent();
- }
- catch (Exception e)
- {
- LOG.Write(e);
- return false;
- }
- return true;
- }
- public string GetContent()
- {
- return doc.ToString();
- }
- public void SaveContent()
- {
- var lst = new List<XElement>();
- foreach (var item in TransferItems)
- {
- lst.Add(new XElement("TransferItem"
- , new XAttribute("SourceStation", item.SourceStation.ToString())
- , new XAttribute("SourceSlot", item.SourceSlot.ToString())
- , new XAttribute("DestinationStation", item.DestinationStation.ToString())
- , new XAttribute("DestinationSlot", item.DestinationSlot.ToString())
- , new XAttribute("IsReadLaserMarker", item.IsReadLaserMarker.ToString())
- , new XAttribute("IsReadT7Code", item.IsReadT7Code.ToString())
- , new XAttribute("IsAlign", item.IsAlign.ToString())
- , new XAttribute("AlignAngle", item.AlignAngle.ToString())
- , new XAttribute("IsVerifyLaserMarker", item.IsReadLaserMarker.ToString())
- , new XAttribute("IsVerifyT7Code", item.IsReadT7Code.ToString())
- , new XAttribute("OrderBy", item.OrderBy.ToString())
- , new XAttribute("IsTurnOver", item.IsTurnOver.ToString())
- ));
- }
- doc = new XDocument(new XElement("AitexSorterRecipe"
- , new XAttribute("Type", RecipeType.ToString())
- , new XAttribute("Source", StringListSource)
- , new XAttribute("Destination", StringListDestination)
- , new XAttribute("PlaceMode", PlaceMode)
- , new XAttribute("PickMode", PickMode) //new1
- , new XAttribute("IsReadLaserMarker", IsReadLaserMarker.ToString())
- , new XAttribute("IsReadT7Code", IsReadT7Code.ToString())
- , new XAttribute("IsVerifyLaserMarker", IsReadLaserMarker.ToString())
- , new XAttribute("IsVerifyT7Code", IsReadT7Code.ToString())
- , new XAttribute("OrderBy", OrderBy.ToString())
- , new XAttribute("IsAlign", IsAlign.ToString())
- , new XAttribute("AlignAngle", AlignAngle.ToString())
- , new XAttribute("IsTurnOver", IsTurnOver.ToString())
- , new XAttribute("IsPostAlign", IsPostAlign.ToString()) //new2
- , new XAttribute("PostAlignAngle", PostAlignAngle.ToString()) //new3
- , new XAttribute("WaferReaderIndex", WaferReaderIndex.ToString())
- , new XAttribute("WaferReader2Index", WaferReader2Index.ToString())
- , new XAttribute("LaserMark1Jobs", LaserMark1Jobs.ToString()) //new4
- , new XAttribute("LaserMark2Jobs", LaserMark2Jobs.ToString()) //new5
- , new XAttribute("ReadIDRecipe", ReadIDRecipe.ToString()) //new6
- , new XElement("TransferTable", lst)
- ));
- }
- public void SaveHostUsageContent()
- {
- }
- private ObservableCollection<ModuleName> ParseModule(string value)
- {
- ObservableCollection<ModuleName> result = new ObservableCollection<ModuleName>();
- if (!string.IsNullOrEmpty(value))
- {
- string[] modules = value.Split(',');
- ModuleName source;
- foreach (var module in modules)
- {
- if (Enum.TryParse(module, out source))
- result.Add(source);
- }
- }
- return result;
- }
- private void ParseContent()
- {
- try
- {
- var nodeRoot = doc.Root;
- if (nodeRoot == null)
- {
- LOG.Write(string.Format("recipe not valid"));
- return;
- }
- string value = nodeRoot.Attribute("Type").Value;
- SorterRecipeType type;
- Enum.TryParse(value, out type);
- RecipeType = type;
- value = nodeRoot.Attribute("Source").Value;
- Source = ParseModule(value);
- value = nodeRoot.Attribute("Destination").Value;
- Destination = ParseModule(value);
- value = nodeRoot.Attribute("PlaceMode").Value;
- SorterRecipePlaceModePack pack;
- Enum.TryParse(value, out pack);
- PlaceModePack = pack;
- SorterRecipePlaceModeOrder order;
- Enum.TryParse(value, out order);
- PlaceModeOrder = order;
- SorterRecipePlaceModeTransfer1To1 placeModeTransfer1To1;
- Enum.TryParse(value, out placeModeTransfer1To1);
- PlaceModeTransfer1To1 = placeModeTransfer1To1;
- SorterPickMode pickMode;
- Enum.TryParse(value, out pickMode);
- PickMode = pickMode;
- value = nodeRoot.Attribute("IsReadLaserMarker").Value;
- bool isReadLaserMarker;
- bool.TryParse(value, out isReadLaserMarker);
- IsReadLaserMarker = isReadLaserMarker;
- value = nodeRoot.Attribute("IsReadT7Code").Value;
- bool isReadT7Code;
- bool.TryParse(value, out isReadT7Code);
- IsReadT7Code = isReadT7Code;
- value = nodeRoot.Attribute("IsVerifyLaserMarker").Value;
- bool isVerifyLaserMarker;
- bool.TryParse(value, out isVerifyLaserMarker);
- IsVerifyLaserMarker = isVerifyLaserMarker;
- value = nodeRoot.Attribute("IsVerifyT7Code").Value;
- bool isVerifyT7Code;
- bool.TryParse(value, out isVerifyT7Code);
- IsVerifyT7Code = isVerifyT7Code;
- value = nodeRoot.Attribute("OrderBy").Value;
- OrderByMode orderBy;
- Enum.TryParse(value, out orderBy);
- OrderBy = orderBy;
- value = nodeRoot.Attribute("IsAlign").Value;
- bool isAlign;
- bool.TryParse(value, out isAlign);
- IsAlign = isAlign;
- value = nodeRoot.Attribute("AlignAngle").Value;
- double anlignAngle;
- double.TryParse(value, out anlignAngle);
- AlignAngle = anlignAngle;
- value = nodeRoot.Attribute("IsTurnOver").Value;
- bool isTurnOver;
- bool.TryParse(value, out isTurnOver);
- IsTurnOver = isTurnOver;
- if (nodeRoot.Attribute("IsPostAlign") != null)
- {
- value = nodeRoot.Attribute("IsPostAlign").Value;
- bool isPostAlign;
- bool.TryParse(value, out isPostAlign);
- IsPostAlign = isPostAlign;
- }
- if (nodeRoot.Attribute("PostAlignAngle") != null)
- {
- value = nodeRoot.Attribute("PostAlignAngle").Value;
- double postalignAngle;
- double.TryParse(value, out postalignAngle);
- PostAlignAngle = postalignAngle;
- }
- if (nodeRoot.Attribute("PickMode") != null)
- {
- value = nodeRoot.Attribute("PickMode").Value;
- SorterPickMode pickmode;
- Enum.TryParse(value, out pickmode);
- PickMode = pickmode;
- }
- if (nodeRoot.Attribute("LaserMark1Jobs") != null)
- {
- value = nodeRoot.Attribute("LaserMark1Jobs").Value;
- LaserMark1Jobs = value;
- }
- if (nodeRoot.Attribute("ReadIDRecipe") != null)
- {
- value = nodeRoot.Attribute("ReadIDRecipe").Value;
- ReadIDRecipe = value;
- }
- if (nodeRoot.Attribute("LaserMark2Jobs") != null)
- {
- value = nodeRoot.Attribute("LaserMark2Jobs").Value;
- LaserMark2Jobs = value;
- }
- WaferReaderIndex = GetValue<int>(nodeRoot, "WaferReaderIndex");
- if (nodeRoot.Attribute("WaferReader2Index") != null)
- WaferReader2Index = GetValue<int>(nodeRoot, "WaferReader2Index");
- var transferItems = nodeRoot.Element("TransferTable").Elements("TransferItem");
- if (transferItems.Any())
- {
- foreach (var item in transferItems)
- {
- ModuleName sourceChamberSet;
- Enum.TryParse(item.Attribute("SourceStation").Value, out sourceChamberSet);
- int sourceSlot;
- int.TryParse(item.Attribute("SourceSlot").Value, out sourceSlot);
- ModuleName destChamberSet;
- Enum.TryParse(item.Attribute("DestinationStation").Value, out destChamberSet);
- int destSlot;
- int.TryParse(item.Attribute("DestinationSlot").Value, out destSlot);
- bool readLaserMarker;
- bool.TryParse(item.Attribute("IsReadLaserMarker").Value, out readLaserMarker);
- bool readT7Code;
- bool.TryParse(item.Attribute("IsReadT7Code").Value, out readT7Code);
- bool verifyLaserMarker;
- bool.TryParse(item.Attribute("IsVerifyLaserMarker").Value, out verifyLaserMarker);
- bool verifyT7Code;
- bool.TryParse(item.Attribute("IsVerifyT7Code").Value, out verifyT7Code);
- bool align;
- bool.TryParse(item.Attribute("IsAlign").Value, out align);
- bool turnOver;
- bool.TryParse(item.Attribute("IsTurnOver").Value, out turnOver);
- OrderByMode oBy;
- Enum.TryParse(item.Attribute("OrderBy").Value, out oBy);
- double angle;
- double.TryParse(item.Attribute("AlignAngle").Value, out angle);
- TransferItems.Add(new SorterRecipeTransferTableItem
- {
- SourceStation = sourceChamberSet,
- SourceSlot = sourceSlot,
- DestinationStation = destChamberSet,
- DestinationSlot = destSlot,
- IsReadLaserMarker = readLaserMarker,
- IsReadT7Code = readT7Code,
- IsVerifyLaserMarker = verifyLaserMarker,
- IsVerifyT7Code = verifyT7Code,
- IsAlign = align,
- OrderBy = oBy,
- AlignAngle = angle,
- IsTurnOver = turnOver
- });
- }
- }
- }
- catch (Exception ex)
- {
- LOG.Write(ex);
- }
- }
- private void ParseHostUsageContent()
- {
- try
- {
- var nodeRoot = doc.Root;
- if (nodeRoot == null)
- {
- LOG.Write(string.Format("recipe not valid"));
- return;
- }
- string value = nodeRoot.Attribute("Type").Value;
- SorterRecipeType type;
- Enum.TryParse(value, out type);
- RecipeType = type;
- value = nodeRoot.Attribute("Source").Value;
- Source = ParseModule(value);
- value = nodeRoot.Attribute("Destination").Value;
- Destination = ParseModule(value);
- value = nodeRoot.Attribute("PlaceMode").Value;
- SorterRecipePlaceModePack pack;
- Enum.TryParse(value, out pack);
- PlaceModePack = pack;
- SorterRecipePlaceModeOrder order;
- Enum.TryParse(value, out order);
- PlaceModeOrder = order;
- SorterRecipePlaceModeTransfer1To1 placeModeTransfer1To1;
- Enum.TryParse(value, out placeModeTransfer1To1);
- PlaceModeTransfer1To1 = placeModeTransfer1To1;
- SorterPickMode pickMode;
- Enum.TryParse(value, out pickMode);
- PickMode = pickMode;
- value = nodeRoot.Attribute("IsReadLaserMarker").Value;
- bool isReadLaserMarker;
- bool.TryParse(value, out isReadLaserMarker);
- IsReadLaserMarker = isReadLaserMarker;
- value = nodeRoot.Attribute("IsReadT7Code").Value;
- bool isReadT7Code;
- bool.TryParse(value, out isReadT7Code);
- IsReadT7Code = isReadT7Code;
- value = nodeRoot.Attribute("IsVerifyLaserMarker").Value;
- bool isVerifyLaserMarker;
- bool.TryParse(value, out isVerifyLaserMarker);
- IsVerifyLaserMarker = isVerifyLaserMarker;
- value = nodeRoot.Attribute("IsVerifyT7Code").Value;
- bool isVerifyT7Code;
- bool.TryParse(value, out isVerifyT7Code);
- IsVerifyT7Code = isVerifyT7Code;
- value = nodeRoot.Attribute("OrderBy").Value;
- OrderByMode orderBy;
- Enum.TryParse(value, out orderBy);
- OrderBy = orderBy;
- value = nodeRoot.Attribute("IsAlign").Value;
- bool isAlign;
- bool.TryParse(value, out isAlign);
- IsAlign = isAlign;
- value = nodeRoot.Attribute("AlignAngle").Value;
- double anlignAngle;
- double.TryParse(value, out anlignAngle);
- AlignAngle = anlignAngle;
- WaferReaderIndex = GetValue<int>(nodeRoot, "WaferReaderIndex");
- var transferItems = nodeRoot.Element("TransferTable").Elements("TransferItem");
- if (transferItems.Any())
- {
- foreach (var item in transferItems)
- {
- ModuleName sourceChamberSet;
- Enum.TryParse(item.Attribute("SourceStation").Value, out sourceChamberSet);
- int sourceSlot;
- int.TryParse(item.Attribute("SourceSlot").Value, out sourceSlot);
- ModuleName destChamberSet;
- Enum.TryParse(item.Attribute("DestinationStation").Value, out destChamberSet);
- int destSlot;
- int.TryParse(item.Attribute("DestinationSlot").Value, out destSlot);
- bool readLaserMarker;
- bool.TryParse(item.Attribute("IsReadLaserMarker").Value, out readLaserMarker);
- bool readT7Code;
- bool.TryParse(item.Attribute("IsReadT7Code").Value, out readT7Code);
- bool verifyLaserMarker;
- bool.TryParse(item.Attribute("IsVerifyLaserMarker").Value, out verifyLaserMarker);
- bool verifyT7Code;
- bool.TryParse(item.Attribute("IsVerifyT7Code").Value, out verifyT7Code);
- bool align;
- bool.TryParse(item.Attribute("IsAlign").Value, out align);
- OrderByMode oBy;
- Enum.TryParse(item.Attribute("OrderBy").Value, out oBy);
- double angle;
- double.TryParse(item.Attribute("AlignAngle").Value, out angle);
- TransferItems.Add(new SorterRecipeTransferTableItem
- {
- SourceStation = sourceChamberSet,
- SourceSlot = sourceSlot,
- DestinationStation = destChamberSet,
- DestinationSlot = destSlot,
- IsReadLaserMarker = readLaserMarker,
- IsReadT7Code = readT7Code,
- IsVerifyLaserMarker = verifyLaserMarker,
- IsVerifyT7Code = verifyT7Code,
- IsAlign = align,
- OrderBy = oBy,
- AlignAngle = angle
- });
- }
- }
- }
- 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);
- }
- }
- }
|