12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Windows;
- using Aitex.Core.Common;
- using Aitex.Core.Common.DeviceData;
- using Aitex.Core.Util;
- using Aitex.Sorter.Common;
- using Bolt.Toolkit.Wpf.Data;
- using Bolt.Toolkit.Wpf.Data.Enum;
- using Caliburn.Micro.Core;
- using MECF.Framework.Common.DataCenter;
- using MECF.Framework.Common.Equipment;
- using MECF.Framework.Common.OperationCenter;
- using VirgoCommon;
- using VirgoUI.Client.Models.Sys;
- namespace VirgoUI.Client.Models.Platform.EFEM
- {
- public class EFEMViewModel : UiViewModelBase
- {
- private int MenuPermission;
- #region Properties
- [Subscription("LP1.CassettePlaced")]
- public bool PlacedLP1 { get; set; }
- [Subscription("LP1.IsLoaded")]
- public bool IsLoadedLP1 { get; set; }
- [Subscription("LP1.IsClamped")]
- public bool IsClampedLP1 { get; set; }
- [Subscription("LP1.IsDocked")]
- public bool IsDockedLP1 { get; set; }
- [Subscription("LP2.CassettePlaced")]
- public bool PlacedLP2 { get; set; }
- [Subscription("LP1.Status")]
- public string LP1Status { get; set; }
- public string LP1StatusBackground
- {
- get { return GetUnitStatusBackground(LP1Status); }
- }
- [Subscription("LP1.CarrierId")]
- public string LP1CarrierId { get; set; }
- [Subscription("LP2.CarrierId")]
- public string LP2CarrierId { get; set; }
- [Subscription("LP1.IsMapped")]
- public bool IsLP1Mapped { get; set; }
- [Subscription("LP2.Status")]
- public string LP2Status { get; set; }
- public string LP2StatusBackground
- {
- get { return GetUnitStatusBackground(LP2Status); }
- }
- [Subscription("LP2.IsMapped")]
- public bool IsLP2Mapped { get; set; }
-
- public Visibility Foup1Visibility
- {
- get
- {
- if (IsLP1Installed)
- {
- return Visibility.Visible;
- }
- else
- return Visibility.Hidden;
- }
- }
- public Visibility Foup2Visibility
- {
- get
- {
- if (IsLP2Installed)
- {
- return Visibility.Visible;
- }
- else
- return Visibility.Hidden;
- }
- }
- [Subscription("LP2.IsLoaded")]
- public bool IsLoadedLP2 { get; set; }
- [Subscription("LP2.IsClamped")]
- public bool IsClampedLP2 { get; set; }
- [Subscription("LP2.IsDocked")]
- public bool IsDockedLP2 { get; set; }
- [Subscription("EfemRobot.RobotMoveAction")]
- public MECF.Framework.Common.CommonData.RobotMoveInfo EfemRobotMoveAction
- {
- get;
- set;
- }
- [Subscription("EFEM.FsmState")]
- public string EfemStatus { get; set; }
- public string EfemStatusBackground
- {
- get { return GetUnitStatusBackground(EfemStatus); }
- }
- [Subscription("PMA.IsAutoMode")]
- public bool PMAIsAutoMode { get; set; }
- [Subscription("PMB.IsAutoMode")]
- public bool PMBIsAutoMode { get; set; }
- [Subscription("PMA.IsOnline")]
- public bool PMAIsOnline { get; set; }
- [Subscription("PMB.IsOnline")]
- public bool PMBIsOnline { get; set; }
- public string PMAState
- {
- get
- {
- return "PMA/" + (PMAIsAutoMode ? "Auto/" : "Manual/") + (PMAIsOnline ? "Online" : "Offline");
- }
- }
- public string PMBState
- {
- get
- {
- return "PMB/" + (PMBIsAutoMode ? "Auto/" : "Manual/") + (PMBIsOnline ? "Online" : "Offline");
- }
- }
- private string _SelectedModule;
- public string SelectedModule
- {
- get
- {
- return _SelectedModule;
- }
- set
- {
- _SelectedModule = value;
- Slots = GetSlotsByModule(_SelectedModule);
- SelectedSlot = 1;
- NotifyOfPropertyChange("SelectedModule");
- }
- }
- private string _PickSelectedModule;
- public string PickSelectedModule
- {
- get
- {
- return _PickSelectedModule;
- }
- set
- {
- _PickSelectedModule = value;
- PickSlots = GetSlotsByModule(_PickSelectedModule);
- PickSelectedSlot = 1;
- NotifyOfPropertyChange("PickSelectedModule");
- }
- }
- private string _PlaceSelectedModule;
- public string PlaceSelectedModule
- {
- get
- {
- return _PlaceSelectedModule;
- }
- set
- {
- _PlaceSelectedModule = value;
- PlaceSlots = GetSlotsByModule(_PlaceSelectedModule);
- PlaceSelectedSlot = 1;
- NotifyOfPropertyChange("PlaceSelectedModule");
- }
- }
- private string _ExtendSelectedModule;
- public string ExtendSelectedModule
- {
- get
- {
- return _ExtendSelectedModule;
- }
- set
- {
- _ExtendSelectedModule = value;
- ExtendSlots = GetExtendPos();
- NotifyOfPropertyChange("ExtendSelectedModule");
- }
- }
- private List<string> GetExtendPos()
- {
- //return new List<string> { "G1", "GB", "G4", "P1", "PB", "P4" };
- return new List<string> { "GoIntoGet", "GoBackGet", "GoIntoPut", "GoBackPut" };
- }
- private static Dictionary<string, string> ExtendParam = new Dictionary<string, string>()
- {
- {"GoIntoGet","GB" },
- {"GoBackGet","G4" },
- {"GoIntoPut","PB" },
- {"GoBackPut","P4" }
- };
- private string _RetractSelectedModule;
- public string RetractSelectedModule
- {
- get
- {
- return _RetractSelectedModule;
- }
- set
- {
- _RetractSelectedModule = value;
- RetractSlots = GetExtendPos();
- NotifyOfPropertyChange("RetractSelectedModule");
- }
- }
- private string _MapSelectedModule;
- public string MapSelectedModule
- {
- get
- {
- return _MapSelectedModule;
- }
- set
- {
- _MapSelectedModule = value;
- //MapSlots = GetSlotsByModule(_MapSelectedModule);
- MapSelectedSlot = 1;
- NotifyOfPropertyChange("MapSelectedModule");
- }
- }
- private string _SelectedHomeModule;
- public string SelectedHomeModule
- {
- get
- {
- return _SelectedHomeModule;
- }
- set
- {
- _SelectedHomeModule = value;
- NotifyOfPropertyChange("SelectedHomeModule");
- }
- }
- private List<string> _HomeModules;
- public List<string> HomeModules
- {
- get { return _HomeModules; }
- set { _HomeModules = value; NotifyOfPropertyChange("HomeModules"); }
- }
- private string _SelectedSpeed;
- public string SelectedSpeed
- {
- get
- {
- return _SelectedSpeed;
- }
- set
- {
- _SelectedSpeed = value;
- NotifyOfPropertyChange("SelectedSpeed");
- }
- }
- private List<string> _RobotSpeeds;
- public List<string> RobotSpeeds
- {
- get { return _RobotSpeeds; }
- set { _RobotSpeeds = value; NotifyOfPropertyChange("RobotSpeeds"); }
- }
- [Subscription("EFEM.CassetteDoor")]
- public LidState CassetteDoorStatus
- {
- get;
- set;
- }
- public bool IsLP1PresentFeedback
- {
- get { return LP1CassetteState == LoadportCassetteState.Normal; }
- }
- public bool IsLP2PresentFeedback
- {
- get { return LP2CassetteState == LoadportCassetteState.Normal; }
- }
- [Subscription("LP1.CassetteState")]
- public LoadportCassetteState LP1CassetteState { get; set; }
- [Subscription("LP2.CassetteState")]
- public LoadportCassetteState LP2CassetteState { get; set; }
- public bool Foup1Present
- {
- get { return LP1CassetteState == LoadportCassetteState.Normal; }
- }
- public bool Foup2Present
- {
- get { return LP2CassetteState == LoadportCassetteState.Normal; }
- }
- //public RobotMoveInfo EfemRobotMoveInfo
- //{
- // get
- // {
- // RobotMoveInfo _moveInfo = new RobotMoveInfo() { BladeTarget = "System" };
- // if (!string.IsNullOrEmpty(EfemRobotMoveAction))
- // {
- // var action = EfemRobotMoveAction.Split('.');
- // _moveInfo.BladeTarget = action[0];
- // _moveInfo.Action = (RobotAction)Enum.Parse(typeof(RobotAction), action[1]);
- // }
- // return _moveInfo;
- // }
- //}
- private List<string> _blades = new List<string>() { "Blade1", "Blade2" };
- public List<string> Blades
- {
- get { return _blades; }
- set { _blades = value; NotifyOfPropertyChange("Blades"); }
- }
- private int _SelectedSlot;
- public int SelectedSlot
- {
- get { return _SelectedSlot; }
- set { _SelectedSlot = value; NotifyOfPropertyChange("SelectedSlot"); }
- }
- private int _PickSelectedSlot;
- public int PickSelectedSlot
- {
- get { return _PickSelectedSlot; }
- set { _PickSelectedSlot = value; NotifyOfPropertyChange("PickSelectedSlot"); }
- }
- private string _pickSelectedBlade;
- public string PickSelectedBlade
- {
- get { return _pickSelectedBlade; }
- set { _pickSelectedBlade = value; NotifyOfPropertyChange("PickSelectedBlade"); }
- }
- private int _PlaceSelectedSlot;
- public int PlaceSelectedSlot
- {
- get { return _PlaceSelectedSlot; }
- set { _PlaceSelectedSlot = value; NotifyOfPropertyChange("PlaceSelectedSlot"); }
- }
- private string _placeSelectedBlade;
- public string PlaceSelectedBlade
- {
- get { return _placeSelectedBlade; }
- set { _placeSelectedBlade = value; NotifyOfPropertyChange("PlaceSelectedBlade"); }
- }
- private string _ExtendSelectedSlot;
- public string ExtendSelectedSlot
- {
- get { return _ExtendSelectedSlot; }
- set { _ExtendSelectedSlot = value; NotifyOfPropertyChange("ExtendSelectedSlot"); }
- }
- private string _extendSelectedBlade;
- public string ExtendSelectedBlade
- {
- get { return _extendSelectedBlade; }
- set { _extendSelectedBlade = value; NotifyOfPropertyChange("ExtendSelectedBlade"); }
- }
- private string _gripSelectedBlade;
- public string GripSelectedBlade
- {
- get { return _gripSelectedBlade; }
- set { _gripSelectedBlade = value; NotifyOfPropertyChange("GripSelectedBlade"); }
- }
- private string _ungripSelectedBlade;
- public string UngripSelectedBlade
- {
- get { return _ungripSelectedBlade; }
- set { _ungripSelectedBlade = value; NotifyOfPropertyChange("UngripSelectedBlade"); }
- }
- private string _flipSelectedBlade;
- public string FlipSelectedBlade
- {
- get { return _flipSelectedBlade; }
- set { _flipSelectedBlade = value; NotifyOfPropertyChange("FlipSelectedBlade"); }
- }
- private int _RetractSelectedSlot;
- public int RetractSelectedSlot
- {
- get { return _RetractSelectedSlot; }
- set { _RetractSelectedSlot = value; NotifyOfPropertyChange("RetractSelectedSlot"); }
- }
- private int _MapSelectedSlot;
- public int MapSelectedSlot
- {
- get { return _MapSelectedSlot; }
- set { _MapSelectedSlot = value; NotifyOfPropertyChange("MapSelectedSlot"); }
- }
- private List<string> _pickModules;
- public List<string> PickPlaceModules
- {
- get { return _pickModules; }
- set { _pickModules = value; NotifyOfPropertyChange("PickPlaceModules"); }
- }
- private List<string> _mapModules;
- public List<string> MapModules
- {
- get { return _mapModules; }
- set { _mapModules = value; NotifyOfPropertyChange("MapModules"); }
- }
- private List<string> _extendModules;
- public List<string> ExtendRetractModules
- {
- get { return _extendModules; }
- set { _extendModules = value; NotifyOfPropertyChange("ExtendRetractModules"); }
- }
- private List<int> _slots;
- public List<int> Slots
- {
- get { return _slots; }
- set { _slots = value; NotifyOfPropertyChange("Slots"); }
- }
- private List<int> _Pickslots;
- public List<int> PickSlots
- {
- get { return _Pickslots; }
- set { _Pickslots = value; NotifyOfPropertyChange("PickSlots"); }
- }
- private List<int> _Placeslots;
- public List<int> PlaceSlots
- {
- get { return _Placeslots; }
- set { _Placeslots = value; NotifyOfPropertyChange("PlaceSlots"); }
- }
- private List<string> _Extendslots;
- public List<string> ExtendSlots
- {
- get { return _Extendslots; }
- set { _Extendslots = value; NotifyOfPropertyChange("ExtendSlots"); }
- }
- private List<string> _Retractslots;
- public List<string> RetractSlots
- {
- get { return _Retractslots; }
- set { _Retractslots = value; NotifyOfPropertyChange("RetractSlots"); }
- }
- [Subscription("LP1.WaferSize")]
- public string LP1WaferSize { get; set; }
- public string WaferSizeLP1
- {
- get { return LP1CassetteState == LoadportCassetteState.Normal ? GetWaferSize(LP1WaferSize) : "--"; }
- }
- [Subscription("LP2.WaferSize")]
- public string LP2WaferSize { get; set; }
- public string WaferSizeLP2
- {
- get { return LP2CassetteState == LoadportCassetteState.Normal ? GetWaferSize(LP2WaferSize) : "--"; }
- }
- [Subscription("Aligner1.WaferSize")]
- public string Aligner1WaferSize { get; set; }
- public string WaferSizeAligner1
- {
- get { return GetWaferSize(Aligner1WaferSize); }
- }
- [Subscription("Aligner2.WaferSize")]
- public string Aligner2WaferSize { get; set; }
- public string WaferSizeAligner2
- {
- get { return GetWaferSize(Aligner2WaferSize); }
- }
- [Subscription("Cooling1.WaferSize")]
- public string Cooling1WaferSize { get; set; }
- public string WaferSizeCooling1
- {
- get { return GetWaferSize(Cooling1WaferSize); }
- }
- [Subscription("Cooling2.WaferSize")]
- public string Cooling2WaferSize { get; set; }
- public string WaferSizeCooling2
- {
- get { return GetWaferSize(Cooling2WaferSize); }
- }
- [Subscription("EfemRobot.WaferSize")]
- public string EfemRobotWaferSize { get; set; }
- public string WaferSizeEfemRobot
- {
- get { return GetWaferSize(EfemRobotWaferSize); }
- }
- [Subscription("PMA.WaferSize")]
- public string PMAWaferSize { get; set; }
- public string WaferSizePMA
- {
- get { return GetWaferSize(PMAWaferSize); }
- }
- [Subscription("PMB.WaferSize")]
- public string PMBWaferSize { get; set; }
- public string WaferSizePMB
- {
- get { return GetWaferSize(PMBWaferSize); }
- }
- [Subscription("EFEM.SmallWafer")]
- public int SmallWafer { get; set; }
- [Subscription("EFEM.MidWafer")]
- public int MidWafer { get; set; }
- [Subscription("EFEM.BigWafer")]
- public int BigWafer { get; set; }
- private List<string> _flipFace = new List<string>() { "FaceUp", "FaceDown" };
- public List<string> FlipFace
- {
- get { return _flipFace; }
- set { _flipFace = value; NotifyOfPropertyChange("FlipFace"); }
- }
- #region
- public bool WaferSizePMA_3
- {
- set { }
- get { return PMAWaferSize == "WS3"; }
- }
- public bool WaferSizePMA_4
- {
- set { }
- get { return PMAWaferSize == "WS4"; }
- }
- public bool WaferSizePMA_6
- {
- set { }
- get { return PMAWaferSize == "WS6"; }
- }
- public bool WaferSizePMB_3
- {
- set { }
- get { return PMBWaferSize == "WS3"; }
- }
- public bool WaferSizePMB_4
- {
- set { }
- get { return PMBWaferSize == "WS4"; }
- }
- public bool WaferSizePMB_6
- {
- set { }
- get { return PMBWaferSize == "WS6"; }
- }
- public bool WaferSizeCooling2_3
- {
- set { }
- get { return Cooling2WaferSize == "WS3"; }
- }
- public bool WaferSizeCooling2_4
- {
- set { }
- get { return Cooling2WaferSize == "WS4"; }
- }
- public bool WaferSizeCooling2_6
- {
- set { }
- get { return Cooling2WaferSize == "WS6"; }
- }
- public bool WaferSizeCooling1_3
- {
- set { }
- get { return Cooling1WaferSize == "WS3"; }
- }
- public bool WaferSizeCooling1_4
- {
- set { }
- get { return Cooling1WaferSize == "WS4"; }
- }
- public bool WaferSizeCooling1_6
- {
- set { }
- get { return Cooling1WaferSize == "WS6"; }
- }
- public bool WaferSizeAligner2_3
- {
- set { }
- get { return Aligner2WaferSize == "WS3"; }
- }
- public bool WaferSizeAligner2_4
- {
- set { }
- get { return Aligner2WaferSize == "WS4"; }
- }
- public bool WaferSizeAligner2_6
- {
- set { }
- get { return Aligner2WaferSize == "WS6"; }
- }
- public bool WaferSizeAligner1_3
- {
- set { }
- get { return Aligner1WaferSize == "WS3"; }
- }
- public bool WaferSizeAligner1_4
- {
- set { }
- get { return Aligner1WaferSize == "WS4"; }
- }
- public bool WaferSizeAligner1_6
- {
- set { }
- get { return Aligner1WaferSize == "WS6"; }
- }
- public bool WaferSizeEfemRobot_3
- {
- set { }
- get { return EfemRobotWaferSize == "WS3"; }
- }
- public bool WaferSizeEfemRobot_4
- {
- set { }
- get { return EfemRobotWaferSize == "WS4"; }
- }
- public bool WaferSizeEfemRobot_6
- {
- set { }
- get { return EfemRobotWaferSize == "WS6"; }
- }
- #endregion
- public bool PMASlitValveIsOpen
- {
- get { return SlitDoorDataA != null && SlitDoorDataA.OpenFeedback && !SlitDoorDataA.CloseFeedback; }
- }
- [Subscription("PMA.SlitDoor.DeviceData")]
- public AITCylinderData SlitDoorDataA
- {
- get;
- set;
- }
- public bool PMBSlitValveIsOpen
- {
- get { return SlitDoorDataB != null && SlitDoorDataB.OpenFeedback && !SlitDoorDataB.CloseFeedback; }
- }
- [Subscription("PMB.SlitDoor.DeviceData")]
- public AITCylinderData SlitDoorDataB
- {
- get;
- set;
- }
- public Dictionary<string, string> _waferSizeMap = new Dictionary<string, string>()
- {
- {"WS3", "3'"},{"WS4", "4'"},{"WS6", "6'"}
- };
- private string GetWaferSize(string size)
- {
- if (size != null && _waferSizeMap.ContainsKey(size))
- switch (size)
- {
- case "WS3": return SmallWafer.ToString();
- case "WS4": return MidWafer.ToString();
- case "WS6": return BigWafer.ToString();
- default: return "";
- }
- //return _waferSizeMap[size];
- return BigWafer.ToString();
- }
- [Subscription("EfemRobot.GripStateBlade1")]
- public string GripStateBlade1 { get; set; }
- public string Blade1GripStateColor
- {
- get
- {
- switch (GripStateBlade1)
- {
- case "ON": return "Lime";
- case "OFF": return "Gray";
- default: return "Yellow";
- }
- }
- }
- [Subscription("EfemRobot.GripStateBlade2")]
- public string GripStateBlade2 { get; set; }
- public string Blade2GripStateColor
- {
- get
- {
- switch (GripStateBlade2)
- {
- case "ON": return "Lime";
- case "OFF": return "Gray";
- default: return "Yellow";
- }
- }
- }
- public Aitex.Core.Common.WaferSize SmallPinWaferSize { get; set; }
- public Aitex.Core.Common.WaferSize MediumPinWaferSize { get; set; }
- public Aitex.Core.Common.WaferSize BigPinWaferSize { get; set; }
- #endregion Properties
- public EFEMViewModel()
- {
- this.DisplayName = "EFEM";
- _pickModules = new List<string>() { "LP1", "LP2", "Aligner1", "Aligner2", "Cooling1", "Cooling2", "Buffer" };
- _mapModules = new List<string>() { "LP1", "LP2", "Buffer" };
- _extendModules = new List<string>() { "PMA", "PMB" };
- var installModules = (string)QueryDataClient.Instance.Service.GetConfig($"System.InstalledModules");
- if(!string.IsNullOrWhiteSpace(installModules))
- {
- var delMods = _pickModules.Where(p=> !installModules.Contains(p)).ToList();
- if(delMods != null && delMods.Count() > 0)
- {
- delMods.ForEach(p => {
- if (_pickModules.Contains(p)) _pickModules.Remove(p);
- if (_mapModules.Contains(p)) _mapModules.Remove(p);
- if (_extendModules.Contains(p)) _extendModules.Remove(p);
- });
- }
- }
- var lowerBladeEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"EFEM.EfemRobot.LowerBladeEnable");
- var upperBladeEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"EFEM.EfemRobot.UpperBladeEnable");
- if (!lowerBladeEnable) _blades.Remove("Blade1");
- if (!upperBladeEnable) _blades.Remove("Blade2");
- _RobotSpeeds = new List<string>() { "Full", "High", "Medium", "Low", "Home", "Jog" };
- _HomeModules = new List<string>() { "EFEM", "AllAxes", "EE1", "EE2", "Theta", "X", "Z" };
- PickSelectedModule = _pickModules[0];
- PlaceSelectedModule = _pickModules[0];
- ExtendSelectedModule = _extendModules[0];
- RetractSelectedModule = _extendModules[0];
- MapSelectedModule = _mapModules[0];
- SelectedSpeed = "Medium";
- SelectedHomeModule = "EFEM";
- PickSelectedBlade = PlaceSelectedBlade = ExtendSelectedBlade = GripSelectedBlade = UngripSelectedBlade = _blades[0];
- }
- protected override void OnActivate()
- {
- SmallPinWaferSize = MapWaferSize((int)QueryDataClient.Instance.Service.GetConfig($"System.SmallWafer"));
- MediumPinWaferSize = MapWaferSize((int)QueryDataClient.Instance.Service.GetConfig($"System.MidWafer"));
- BigPinWaferSize = MapWaferSize((int)QueryDataClient.Instance.Service.GetConfig($"System.BigWafer"));
- NotifyOfPropertyChange(nameof(SmallPinWaferSize));
- NotifyOfPropertyChange(nameof(MediumPinWaferSize));
- NotifyOfPropertyChange(nameof(BigPinWaferSize));
- base.OnActivate();
- }
- private Aitex.Core.Common.WaferSize MapWaferSize(int value)
- {
- switch (value)
- {
- case 3: return Aitex.Core.Common.WaferSize.WS3;
- case 4: return Aitex.Core.Common.WaferSize.WS4;
- case 6: return Aitex.Core.Common.WaferSize.WS6;
- case 8: return Aitex.Core.Common.WaferSize.WS8;
- }
- return Aitex.Core.Common.WaferSize.WS0;
- }
- private List<int> GetSlotsByModule(string module)
- {
- List<int> slots = new List<int>();
- int num = 0;
- switch (module)
- {
- case "LP1":
- case "LP2":
- num = (int)QueryDataClient.Instance.Service.GetConfig($"EFEM.LoadPort.SlotNumber");
- break;
- case "Buffer":
- num = (int)QueryDataClient.Instance.Service.GetConfig($"EFEM.Buffer.SlotNumber");
- break;
- case "Aligner1":
- case "Aligner2":
- case "Cooling1":
- case "Cooling2":
- case "PMA":
- case "PMB":
- num = 1;
- break;
- }
- int j = 0;
- while (j < num)
- {
- slots.Add(j + 1);
- j++;
- }
- return slots;
- }
- protected override void OnInitialize()
- {
- MenuPermission = ClientApp.Instance.GetPermission("EFEM");
- base.OnInitialize();
- base.InitModules();
- }
- #region Operation
- public void SetWaferSize(string module, string size)
- {
- if (MenuPermission != 3) return;
- InvokeClient.Instance.Service.DoOperation("System.SetWaferSize", module, size);
- }
- public void HomeAligner(string module)
- {
- if (MenuPermission != 3) return;
- InvokeClient.Instance.Service.DoOperation($"{module}.{EfemOperation.Home}");
- }
- public void AlignAligner(string module)
- {
- if (MenuPermission != 3) return;
- string size = Aligner1WaferSize;
- if (module == ModuleName.Aligner2.ToString())
- size = Aligner2WaferSize;
- if (module == ModuleName.Cooling1.ToString())
- size = Cooling1WaferSize;
- if (module == ModuleName.Cooling2.ToString())
- size = Cooling2WaferSize;
- InvokeClient.Instance.Service.DoOperation($"{module}.{EfemOperation.Align}", module, size);
- }
- public void LiftAligner(string module)
- {
- if (MenuPermission != 3) return;
- InvokeClient.Instance.Service.DoOperation($"{module}.{EfemOperation.Lift}");
- }
- public void HomeEfem(string mod)
- {
- if (MenuPermission != 3) return;
- InvokeClient.Instance.Service.DoOperation($"{mod}.{EfemOperation.Home}");
- }
- public void ResetEfem()
- {
- if (MenuPermission != 3) return;
- InvokeClient.Instance.Service.DoOperation($"{ModuleName.EFEM}.Reset");
- }
- public void ClearError()
- {
- if (MenuPermission != 3) return;
- InvokeClient.Instance.Service.DoOperation($"{ModuleName.EFEM}.{EfemOperation.ClearError}");
- }
- public void HomeRobot()
- {
- if (MenuPermission != 3) return;
- InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Home}");
- }
- public void AbortRobot()
- {
- if (MenuPermission != 3) return;
- InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Abort}");
- }
- public void RobotPick()
- {
- if (MenuPermission != 3) return;
- string ws = PickSelectedModule == ModuleName.LP1.ToString() ? LP1WaferSize :
- PickSelectedModule == ModuleName.LP2.ToString() ? LP2WaferSize :
- PickSelectedModule == ModuleName.Aligner1.ToString() ? Aligner1WaferSize :
- PickSelectedModule == ModuleName.Aligner2.ToString() ? Aligner2WaferSize :
- PickSelectedModule == ModuleName.Cooling2.ToString() ? Cooling2WaferSize :
- PickSelectedModule == ModuleName.Cooling1.ToString() ? Cooling1WaferSize : throw new ArgumentOutOfRangeException();
- InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Pick}",
- PickSelectedModule, PickSelectedSlot - 1, ws, PickSelectedBlade);
- }
- public void RobotPlace()
- {
- if (MenuPermission != 3) return;
- string ws = PlaceSelectedModule == ModuleName.LP1.ToString() ? LP1WaferSize :
- PlaceSelectedModule == ModuleName.LP2.ToString() ? LP2WaferSize :
- PlaceSelectedModule == ModuleName.Aligner1.ToString() ? Aligner1WaferSize :
- PlaceSelectedModule == ModuleName.Aligner2.ToString() ? Aligner2WaferSize :
- PlaceSelectedModule == ModuleName.Cooling1.ToString() ? Cooling1WaferSize :
- PlaceSelectedModule == ModuleName.Cooling2.ToString() ? Cooling2WaferSize : throw new ArgumentOutOfRangeException();
- InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Place}",
- PlaceSelectedModule, PlaceSelectedSlot - 1, ws, PlaceSelectedBlade);
- }
- public void RobotExtend()
- {
- if (MenuPermission != 3) return;
- InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Extend}", ExtendSelectedModule, ExtendParam[ExtendSelectedSlot], ExtendSelectedBlade);
- }
- public void RobotRetract()
- {
- if (MenuPermission != 3) return;
- InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Retract}", RetractSelectedModule, RetractSlots[RetractSelectedSlot]);
- }
- public void RobotMap()
- {
- if (MenuPermission != 3) return;
- InvokeClient.Instance.Service.DoOperation($"{MapSelectedModule}.{EfemOperation.Map}");
- }
- public void RobotGrip()
- {
- if (MenuPermission != 3) return;
- InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Grip}", "ON", GripSelectedBlade);
- }
- public void RobotUngrip()
- {
- if (MenuPermission != 3) return;
- InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Grip}", "OFF", UngripSelectedBlade);
- }
- public void RobotFlip()
- {
- if (MenuPermission != 3) return;
- InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Flip}", FlipSelectedBlade);
- }
- public void RobotEmsStop()
- {
- if (MenuPermission != 3) return;
- InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.EmsStop}");
- }
- public void SetRobotSpeed()
- {
- if (MenuPermission != 3) return;
- InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.SetRobotSpeed}", SelectedSpeed);
- }
- #endregion Operation
- #region LP
- public void Home(string module)
- {
- InvokeClient.Instance.Service.DoOperation($"{module}.Home");
- }
- public void Abort(string module)
- {
- InvokeClient.Instance.Service.DoOperation($"{module}.Abort");
- }
- public void Reset(string module)
- {
- InvokeClient.Instance.Service.DoOperation($"{module}.Reset");
- }
- public void ReadCarrierID(string moduleID)
- {
- //LoadPortProvider.Instance.ReadCarrierID(moduleID);
- InvokeClient.Instance.Service.DoOperation($"{moduleID}.ReadCarrierId");
- }
- public void Load(string moduleID)
- {
- //LoadPortProvider.Instance.LoadLP(moduleID);
- InvokeClient.Instance.Service.DoOperation($"{moduleID}.Load");
- }
- public void Unload(string moduleID)
- {
- //LoadPortProvider.Instance.UnloadLP(moduleID);
- InvokeClient.Instance.Service.DoOperation($"{moduleID}.Unload");
- }
- public void Clamp(string moduleID)
- {
- InvokeClient.Instance.Service.DoOperation($"{moduleID}.Clamp");
- ///LoadPortProvider.Instance.Clamp(moduleID);
- }
- public void Unclamp(string moduleID)
- {
- //LoadPortProvider.Instance.Unclamp(moduleID);
- InvokeClient.Instance.Service.DoOperation($"{moduleID}.Unclamp");
- }
- public void Dock(string moduleID)
- {
- //LoadPortProvider.Instance.Dock(moduleID);
- InvokeClient.Instance.Service.DoOperation($"{moduleID}.Dock");
- }
- public void Undock(string moduleID)
- {
- //LoadPortProvider.Instance.Undock(moduleID);
- InvokeClient.Instance.Service.DoOperation($"{moduleID}.Undock");
- }
- public void OpenDoor(string moduleID)
- {
- //LoadPortProvider.Instance.OpenDoor(moduleID);
- InvokeClient.Instance.Service.DoOperation($"{moduleID}.OpenDoor");
- }
- public void CloseDoor(string moduleID)
- {
- //LoadPortProvider.Instance.CloseDoor(moduleID);
- InvokeClient.Instance.Service.DoOperation($"{moduleID}.CloseDoor");
- }
- public void Map(string moduleID)
- {
- //LoadPortProvider.Instance.Map(moduleID);
- InvokeClient.Instance.Service.DoOperation($"{ModuleName.EFEM}.Map", moduleID);
- }
- #endregion
- }
- }
|