1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Security.AccessControl;
- 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 Visibility LowerArmVisibility
- {
- get
- {
- try
- {
- var armTypeConfig = QueryDataClient.Instance.Service.GetConfig("EFEM.EfemRobotArmType");
- if (armTypeConfig == null || !int.TryParse(armTypeConfig.ToString(), out int armType) || armType != 2)
- return Visibility.Visible;
- var lowerBladeConfig = QueryDataClient.Instance.Service.GetConfig("EFEM.EfemRobot.LowerBladeEnable");
- if (lowerBladeConfig != null && bool.TryParse(lowerBladeConfig.ToString(), out bool lowerEnabled))
- {
- return lowerEnabled ? Visibility.Visible : Visibility.Collapsed;
- }
- return Visibility.Collapsed;
- }
- catch
- {
- return Visibility.Visible;
- }
- }
- }
- public Visibility UpperArmVisibility
- {
- get
- {
- try
- {
- var armTypeConfig = QueryDataClient.Instance.Service.GetConfig("EFEM.EfemRobotArmType");
- if (armTypeConfig == null || !int.TryParse(armTypeConfig.ToString(), out int armType) || armType != 2)
- return Visibility.Visible;
- var upperBladeConfig = QueryDataClient.Instance.Service.GetConfig("EFEM.EfemRobot.UpperBladeEnable");
- if (upperBladeConfig != null && bool.TryParse(upperBladeConfig.ToString(), out bool upperEnabled))
- {
- return upperEnabled ? Visibility.Visible : Visibility.Collapsed;
- }
- return Visibility.Collapsed;
- }
- catch
- {
- return Visibility.Visible;
- }
- }
- }
- 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
- }
- }
|