1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354 |
- 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;
- using MECF.Framework.Common.DataCenter;
- using MECF.Framework.Common.OperationCenter;
- using MECF.Framework.Common.RecipeCenter;
- using OpenSEMI.ClientBase;
- using System;
- using System.Collections.Generic;
- using System.Collections.ObjectModel;
- using System.Windows;
- using VirgoCommon;
- using VirgoUI.Client.Dialog;
- using VirgoUI.Client.Models.Operate.WaferAssociation;
- using VirgoUI.Client.Models.Platform.LoadPort;
- using VirgoUI.Client.Models.Recipe;
- using VirgoUI.Client.Models.Sys;
- namespace VirgoUI.Client.Models.Operate
- {
- public enum EfemType
- {
- FutureEfem = 1,
- JetEfem = 2,
- }
- public class OverViewModel : UiViewModelBase
- {
- #region Property
- //private int MenuPermission;
- #region PM
- public string PMABackground
- {
- get
- {
- if (!PMAIsOnline)
- return "Red";
- if (PMAServiceStatus == PMState.Error.ToString())
- return "Red";
- if (PMAServiceStatus == PMState.Idle.ToString()
- || PMAServiceStatus == PMState.Init.ToString())
- {
- return "Transparent";
- }
- return "Green";
- }
- }
- public string PMBBackground
- {
- get
- {
- if (!PMBIsOnline)
- return "Red";
- if (PMBServiceStatus == PMState.Error.ToString())
- return "Red";
- if (PMBServiceStatus == PMState.Idle.ToString()
- || PMBServiceStatus == PMState.Init.ToString())
- {
- return "Transparent";
- }
- return "Green";
- }
- }
- #endregion
- #region EFEM
- private WaferAssociationInfo _lp1WaferAssociation;
- public WaferAssociationInfo LP1WaferAssociation
- {
- get { return _lp1WaferAssociation; }
- set { _lp1WaferAssociation = value; }
- }
- private WaferAssociationInfo _lp2WaferAssociation;
- public WaferAssociationInfo LP2WaferAssociation
- {
- get { return _lp2WaferAssociation; }
- set { _lp2WaferAssociation = value; }
- }
- public string LP1ProcStatus
- {
- get
- {
- if (LP1WaferAssociation.JobStatus == "")
- {
- return "Idle";
- }
- return LP1WaferAssociation.JobStatus;
- }
- }
- public string LP2ProcStatus
- {
- get
- {
- if (LP2WaferAssociation.JobStatus == "")
- {
- return "Idle";
- }
- return LP2WaferAssociation.JobStatus;
- }
- }
- private string[] _LP1StatusColor = new string[2];
- public string[] LP1StatusColor
- {
- get
- {
- switch (LP1ProcStatus)
- {
- case "Idle":
- _LP1StatusColor[0] = "Gold";
- _LP1StatusColor[1] = "Black";
- break;
- case "WaitingForStart":
- _LP1StatusColor[0] = "Blue";
- _LP1StatusColor[1] = "White";
- break;
- case "Executing":
- _LP1StatusColor[0] = "Cyan";
- _LP1StatusColor[1] = "Black";
- break;
- case "Paused":
- _LP1StatusColor[0] = "Blue";
- _LP1StatusColor[1] = "White";
- break;
- default:
- _LP1StatusColor[0] = "Gold";
- _LP1StatusColor[1] = "Black";
- break;
- }
- return _LP1StatusColor;
- }
- }
- private string[] _LP2StatusColor = new string[2];
- public string[] LP2StatusColor
- {
- get
- {
- switch (LP2ProcStatus)
- {
- case "Idle":
- _LP2StatusColor[0] = "Gold";
- _LP2StatusColor[1] = "Black";
- break;
- case "WaitingForStart":
- _LP2StatusColor[0] = "Blue";
- _LP2StatusColor[1] = "White";
- break;
- case "Executing":
- _LP2StatusColor[0] = "Cyan";
- _LP2StatusColor[1] = "Black";
- break;
- case "Paused":
- _LP2StatusColor[0] = "Blue";
- _LP2StatusColor[1] = "White";
- break;
- default:
- _LP2StatusColor[0] = "Gold";
- _LP2StatusColor[1] = "Black";
- break;
- }
- return _LP2StatusColor;
- }
- }
- [Subscription("LP1.CassetteState")]
- public LoadportCassetteState LP1CassetteState { get; set; }
- [Subscription("LP1.FoupDoorState")]
- public FoupDoorState LP1DoorState { get; set; }
- [Subscription("LP2.CassetteState")]
- public LoadportCassetteState LP2CassetteState { get; set; }
- [Subscription("LP2.FoupDoorState")]
- public FoupDoorState LP2DoorState { get; set; }
- [Subscription("LP1.IsLoaded")]
- public bool IsLoadedLP1 { get; set; }
- [Subscription("LP2.IsLoaded")]
- public bool IsLoadedLP2 { get; set; }
- private R_TRIG _lp1JobFinished = new R_TRIG();
- private R_TRIG _lp2JobFinished = new R_TRIG();
- [Subscription("EfemRobot.RobotMoveAction")]
- public string EfemRobotMoveAction
- {
- get;
- set;
- }
- public bool Foup1Present
- {
- get { return LP1CassetteState == LoadportCassetteState.Normal; }
- }
- public bool Foup1Idle
- {
- get { return LP1CassetteState == LoadportCassetteState.Normal && !Foup1Busy && !Foup1Complete; }
- }
- public bool Foup1Complete
- {
- get { return LP1JobDone && Foup1Present; }
- }
- public bool Foup1Busy
- {
- get { return LP1JobStatus == "WaitingForStart" || LP1JobStatus == "Executing" || LP1JobStatus == "Paused" ; }
- }
- public bool Foup1Error
- {
- get { return LP1WaferProtrude==1; }
- }
- public bool Foup2Present
- {
- get { return LP2CassetteState == LoadportCassetteState.Normal; }
- }
- public bool Foup2Idle
- {
- get { return LP2CassetteState == LoadportCassetteState.Normal && !Foup2Busy && !Foup2Complete; }
- }
- public bool Foup2Complete
- {
- get { return LP2JobDone && Foup2Present; }
- }
- public bool Foup2Busy
- {
- get { return LP2JobStatus == "WaitingForStart" || LP2JobStatus == "Executing" || LP2JobStatus == "Paused"; }
- }
- public bool Foup2Error
- {
- get { return LP2WaferProtrude == 1; }
- }
- 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;
- }
- }
- [Subscription("LP1.JobDone")]
- public bool LP1JobDone { get; set; }
-
- [Subscription("LP1.IsWaferProtrude")]
- public int LP1WaferProtrude { get; set; }
- [Subscription("LP2.JobDone")]
- public bool LP2JobDone { get; set; }
- [Subscription("LP2.IsWaferProtrude")]
- public int LP2WaferProtrude { get; set; }
- [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("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");
- }
- }
- [Subscription("EFEM.SmallWafer")]
- public int SmallWafer { get; set; }
- [Subscription("EFEM.MidWafer")]
- public int MidWafer { get; set; }
- [Subscription("EFEM.BigWafer")]
- public int BigWafer { get; set; }
- //[Subscription("EFEM.CassetteDoor")]
- //public AITSensorData CassetteDoorStatus
- //{
- // get;
- // set;
- //}
- [Subscription("EFEM.CassetteDoor")]
- public LidState CassetteDoorStatus
- {
- get;
- set;
- }
- public Visibility CassetteDoorIsOpened
- {
- get
- {
- return CassetteDoorStatus == LidState.Open ? Visibility.Visible : Visibility.Hidden;
- }
- }
- public Visibility CassetteDoorVisibility
- {
- get
- {
- return _efemType == EfemType.FutureEfem ? Visibility.Visible : Visibility.Collapsed;
- }
- }
- public Visibility SmartTagVisibility
- {
- get
- {
- return _efemType == EfemType.FutureEfem ? Visibility.Collapsed : Visibility.Visible;
- }
- }
- public Dictionary<string, string> _waferSizeMap = new Dictionary<string, string>()
- {
- {"WS3", "3'"},{"WS4", "4'"},{"WS6", "6'"}
- };
- private string GetWaferSize(string size)
- {
- if (_efemType == EfemType.JetEfem)
- return "";
- 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 "";
- }
- public DoorState Chamber1DoorState
- {
- get { return DoorState.Unknown; }
- }
- public DoorState Chamber2DoorState
- {
- get { return DoorState.Unknown; }
- }
- public bool EnableAuto
- {
- get { return !IsAutoMode; }
- }
- public bool EnableManual
- {
- get { return IsAutoMode; }
- }
- public bool IsRtInitialized
- {
- get { return false; }
- }
- public bool EnableMapLP1
- {
- get
- {
- return Foup1Present && CassetteDoorStatus == LidState.Close;
- }
- }
- public bool EnableMapLP2
- {
- get
- {
- return Foup2Present && CassetteDoorStatus == LidState.Close;
- }
- }
- public bool EnableJobLP1
- {
- get { return IsAutoMode; }
- }
- public bool EnableJobLP2
- {
- get { return IsAutoMode; }
- }
- private EfemType _efemType = EfemType.FutureEfem;
- private bool _enableThickness = true;
- public Visibility LoadUnloadVisibility
- {
- get { return _efemType == EfemType.JetEfem ? Visibility.Visible : Visibility.Collapsed; }
- }
- public Visibility MapVisibility
- {
- get { return _efemType == EfemType.FutureEfem ? Visibility.Visible : Visibility.Collapsed; }
- }
- public bool EnableLoadLP1
- {
- get
- {
- return Foup1Present && string.IsNullOrEmpty(LP1JobStatus) && !IsLoadedLP1;
- }
- }
- public bool EnableLoadLP2
- {
- get
- {
- return Foup2Present && string.IsNullOrEmpty(LP2JobStatus) && !IsLoadedLP2;
- }
- }
- public bool EnableUnloadLP1
- {
- get
- {
- return Foup1Present && (string.IsNullOrEmpty(LP1JobStatus) || LP1JobStatus == "Completed") && IsLoadedLP1;
- }
- }
- public bool EnableUnloadLP2
- {
- get
- {
- return Foup2Present && (string.IsNullOrEmpty(LP2JobStatus) || LP2JobStatus == "Completed") && IsLoadedLP2;
- }
- }
- public Visibility WaferSizeVisibility
- {
- get { return _efemType == EfemType.FutureEfem ? Visibility.Visible : Visibility.Collapsed; }
- }
- public Visibility ThicknessVisibility
- {
- get { return (_efemType == EfemType.JetEfem && _enableThickness) ? Visibility.Visible : Visibility.Collapsed; }
- }
- [Subscription("LP1.WaferThicknessType")]
- public string ThicknessLP1 { get; set; }
- public string WaferThicknessLP1
- {
- get
- {
- if (ThicknessLP1 == "Thin")
- return "薄片";
- if (ThicknessLP1 == "Thick")
- return "厚片";
- return "--";
- }
- }
- public bool EnableThinLP1
- {
- get
- {
- return ThicknessLP1 != "Thin" && Foup1Present;
- }
- }
- public bool EnableThickLP1
- {
- get
- {
- return ThicknessLP1 != "Thick" && Foup1Present;
- }
- }
- [Subscription("LP1.SmartTag")]
- public string _SmartTagLP1 { get; set; }
- public string SmartTagLP1
- {
- get
- {
- return FormattedSmartTag(_SmartTagLP1);
- }
- }
- private string FormattedSmartTag(string tag)
- {
- if (string.IsNullOrEmpty(tag))
- return "";
- //LOT :A135380.1QTY :25STG :PA_PHMODE:BCLN :2009-10-19QTY :
- var items = tag.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
- string result = "";
- foreach (var item in items)
- {
- result += item.Trim() + "\r\n";
- }
-
- return result;
- }
- [Subscription("LP2.SmartTag")]
- public string _SmartTagLP2 { get; set; }
- public string SmartTagLP2
- {
- get
- {
- return FormattedSmartTag(_SmartTagLP2);
- }
- }
- [Subscription("LP2.WaferThicknessType")]
- public string ThicknessLP2 { get; set; }
- public string WaferThicknessLP2
- {
- get
- {
- if (ThicknessLP2 == "Thin")
- return "薄片";
- if (ThicknessLP2 == "Thick")
- return "厚片";
- return "--";
- }
- }
- public bool EnableThinLP2
- {
- get
- {
- return ThicknessLP2 != "Thin" && Foup2Present;
- }
- }
- public bool EnableThickLP2
- {
- get
- {
- return ThicknessLP2 != "Thick" && Foup2Present;
- }
- }
- #region Mainframe
- public bool ButtonControl { get; set; }
- [Subscription("Aligner.Status")]
- public string AlignerStatus { get; set; }
- [Subscription("EFEM.Status")]
- public string EFEMStatus { get; set; }
- [Subscription("LP1.Status")]
- public string LP1Status { get; set; }
- [Subscription("LP2.Status")]
- public string LP2Status { get; set; }
- #endregion Mainframe
- #region PM
- public string PMALabel
- {
- get;
- set;
- }
- public string PMBLabel
- {
- get;
- set;
- }
- [Subscription("PMA.FsmState")]
- public string PMAServiceStatus { get; set; }
- [Subscription("PMA.RecipeName")]
- public string PMARecipeName { get; set; }
- [Subscription("PMA.RecipeProcessTime")]
- public string PMARemainTime { get; set; }
- [Subscription("PMA.StepNo")]
- public int PMAStepNo { get; set; }
- [Subscription("PMA.RecipeStepName")]
- public string PMAStepName { get; set; }
- [Subscription("PMA.ChamberPressure")]
- public double PMAChamberPressure { get; set; }
- [Subscription("PMA.HeaterChamber.Temperature")]
- public double PMATemperature { get; set; }
- [Subscription("PMA.Chiller.CoolantOutletTempFeedback")]
- public double PMAChillerTemperature { get; set; }
- public bool PMASlitValveIsOpen
- {
- get { return SlitDoorDataA != null && SlitDoorDataA.OpenFeedback && !SlitDoorDataA.CloseFeedback; }
- }
- [Subscription("PMA.SlitDoor.DeviceData")]
- public AITCylinderData SlitDoorDataA
- {
- get;
- set;
- }
- [Subscription("PMB.FsmState")]
- public string PMBServiceStatus { get; set; }
- [Subscription("PMB.RecipeName")]
- public string PMBRecipeName { get; set; }
- [Subscription("PMB.RecipeProcessTime")]
- public string PMBRemainTime { get; set; }
- [Subscription("PMB.StepNo")]
- public string PMBStepNo { get; set; }
- [Subscription("PMB.RecipeStepName")]
- public string PMBStepName { get; set; }
- [Subscription("PMB.ChamberPressure")]
- public double PMBChamberPressure { get; set; }
- [Subscription("PMB.HeaterChamber.Temperature")]
- public double PMBTemperature { get; set; }
- [Subscription("PMB.Chiller.CoolantOutletTempFeedback")]
- public double PMBChillerTemperature { get; set; }
- public bool PMBSlitValveIsOpen
- {
- get { return SlitDoorDataB != null && SlitDoorDataB.OpenFeedback && !SlitDoorDataB.CloseFeedback; }
- }
- [Subscription("PMB.SlitDoor.DeviceData")]
- public AITCylinderData SlitDoorDataB
- {
- get;
- set;
- }
- public bool IsPMAChillerVisibility
- {
- get
- {
- return (bool)QueryDataClient.Instance.Service.GetConfig($"PMA.Chiller.EnableChiller");
- }
- }
- public bool IsPMBChillerVisibility
- {
- get
- {
- return (bool)QueryDataClient.Instance.Service.GetConfig($"PMB.Chiller.EnableChiller");
- }
- }
- public bool IsPMAHeaterVisibility
- {
- get
- {
- return !IsPMAChillerVisibility;
- }
- }
- public bool IsPMBHeaterVisibility
- {
- get
- {
- return !IsPMBChillerVisibility;
- }
- }
- #endregion PM
- #region Scheduler
- [Subscription("System.IsAutoMode")]
- public bool IsAutoMode { get; set; }
- public bool _isCycleMode;
- public bool _isATMMode;
- public int _efemtype;
-
- public Visibility IsCycleInfoVisibility
- {
- get { return _isCycleMode ? Visibility.Visible : Visibility.Hidden; }
- }
- public Visibility JobControlVisibility
- {
- get { return (_efemtype==1) ? Visibility.Visible : Visibility.Hidden; }
- }
-
- public Visibility IsATMInfoVisibility
- {
- get { return _isATMMode ? Visibility.Visible : Visibility.Hidden; }
- }
- //[Subscription("Scheduler.CycledCount")]
- //public int CycledCount { get; set; }
- //[Subscription("Scheduler.CycledWafer")]
- //public int CycledWafer { get; set; }
- [Subscription("Scheduler.LP1CycledWafer")]
- public int LP1CycledWafer { get; set; }
- [Subscription("Scheduler.LP2CycledWafer")]
- public int LP2CycledWafer { get; set; }
- [Subscription("Scheduler.LP1CycledCount")]
- public int LP1CycledCount { get; set; }
- [Subscription("Scheduler.LP2CycledCount")]
- public int LP2CycledCount { get; set; }
- [Subscription("Scheduler.LP1CycleSetPoint")]
- public int LP1CycleSetPoint { get; set; }
- [Subscription("Scheduler.LP2CycleSetPoint")]
- public int LP2CycleSetPoint { get; set; }
- public string LP1CycleCountDisplay
- {
- get { return (LP1CycleSetPoint > 0 && (LP1CycledCount > LP1CycleSetPoint)) ? $"{LP1CycledCount + 1}/{LP1CycleSetPoint}" : $"{LP1CycledCount}/{LP1CycleSetPoint}"; }
- }
- public string LP2CycleCountDisplay
- {
- get { return (LP2CycleSetPoint > 0 && (LP2CycledCount > LP2CycleSetPoint)) ? $"{LP2CycledCount + 1}/{LP2CycleSetPoint}" : $"{LP2CycledCount}/{LP2CycleSetPoint}"; }
- }
- [Subscription("LP1.CurrentRecipeList")]
- public List<string> LP1CurrentRecipeList { get; set; }
- [Subscription("LP1.LocalJobName")]
- public string LP1JobName { get; set; }
- [Subscription("LP1.LocalJobStatus")]
- public string LP1JobStatus { get; set; }
- [Subscription("LP1.JobLotName")]
- public string LP1JobLotName { get; set; }
- [Subscription("LP2.CurrentRecipeList")]
- public List<string> LP2CurrentRecipeList { get; set; }
- [Subscription("LP2.LocalJobName")]
- public string LP2JobName { get; set; }
- [Subscription("LP2.LocalJobStatus")]
- public string LP2JobStatus { get; set; }
- [Subscription("LP2.JobLotName")]
- public string LP2JobLotName { get; set; }
- public bool IsPauseAllEnable => LP1JobStatus == "Executing" || LP2JobStatus == "Executing";
- #endregion Scheduler
- #endregion EFEM
- #endregion Property
- public OverViewModel()
- {
- this.DisplayName = "OverView";
- }
- protected override void OnInitialize()
- {
- base.OnInitialize();
- base.InitModules();
- LP1WaferAssociation = new WaferAssociationInfo();
- LP1WaferAssociation.ModuleData = ModuleManager.ModuleInfos["LP1"];
- LP2WaferAssociation = new WaferAssociationInfo();
- LP2WaferAssociation.ModuleData = ModuleManager.ModuleInfos["LP2"];
- }
- protected override void OnActivate()
- {
- base.OnActivate();
- _isCycleMode = (bool)QueryDataClient.Instance.Service.GetConfig("System.IsCycleMode");
- _isATMMode = (bool)QueryDataClient.Instance.Service.GetConfig("System.IsATMMode");
- _efemtype = (int)QueryDataClient.Instance.Service.GetConfig("EFEM.EfemType");
- PMALabel = (string)QueryDataClient.Instance.Service.GetConfig("PMA.ChamberLabel");
- PMBLabel = (string)QueryDataClient.Instance.Service.GetConfig("PMB.ChamberLabel");
- _efemType = (int)QueryDataClient.Instance.Service.GetConfig("EFEM.EfemType") == 1 ? EfemType.FutureEfem : EfemType.JetEfem;
- _enableThickness = (bool)QueryDataClient.Instance.Service.GetConfig("System.WaferThickness.EnableThickness");
- }
- public void Start()
- {
- //if (MenuPermission != 3) return;
- InvokeClient.Instance.Service.DoOperation("System.StartAutoRun");
- }
- public void Stop()
- {
- //InvokeClient.Instance.Service.DoOperation("System.StartAutoRun");
- }
- protected override void InvokeAfterUpdateProperty(Dictionary<string, object> data)
- {
- ContextMenuManager.Instance.IsAutoMode = this.IsAutoMode;
- ModuleTemperature["PMA"] = (float)PMATemperature;
- ModuleTemperature["PMB"] = (float)PMBTemperature;
- LP1WaferAssociation.JobID = LP1JobName;
- LP1WaferAssociation.JobStatus = LP1JobStatus;
- LP2WaferAssociation.JobID = LP2JobName;
- LP2WaferAssociation.JobStatus = LP2JobStatus;
- LP1WaferAssociation.JobID = LP1JobName;
- LP1WaferAssociation.JobStatus = LP1JobStatus;
- if (!string.IsNullOrEmpty(LP1JobName))
- LP1WaferAssociation.LotId = LP1JobLotName;
- LP2WaferAssociation.JobID = LP2JobName;
- LP2WaferAssociation.JobStatus = LP2JobStatus;
- if (!string.IsNullOrEmpty(LP2JobName))
- LP2WaferAssociation.LotId = LP2JobLotName;
- _lp1JobFinished.CLK = string.IsNullOrEmpty(LP1JobName);
- if (_lp1JobFinished.Q)
- {
- var wafers = LP1WaferAssociation.ModuleData.WaferManager.Wafers;
- for (int i = 0; i < wafers.Count; i++)
- {
- wafers[i].SequenceName = "";
- }
- LP1WaferAssociation.LotId = "";
- LP1WaferAssociation.SequenceName = "";
- }
- _lp2JobFinished.CLK = string.IsNullOrEmpty(LP2JobName);
- if (_lp2JobFinished.Q)
- {
- var wafers = LP2WaferAssociation.ModuleData.WaferManager.Wafers;
- for (int i = 0; i < wafers.Count; i++)
- {
- wafers[i].SequenceName = "";
- }
- LP2WaferAssociation.LotId = "";
- LP2WaferAssociation.SequenceName = "";
- }
- if (!string.IsNullOrEmpty(LP1JobStatus) && LP1JobStatus == "Executing")
- {
- var wafers = LP1WaferAssociation.ModuleData.WaferManager.Wafers;
- for (int i = 0; i < wafers.Count; i++)
- {
- wafers[i].SequenceName = LP1CurrentRecipeList[wafers[i].SlotID];
- }
- }
- if (!string.IsNullOrEmpty(LP2JobStatus) && LP2JobStatus == "Executing")
- {
- var wafers = LP2WaferAssociation.ModuleData.WaferManager.Wafers;
- for (int i = 0; i < wafers.Count; i++)
- {
- wafers[i].SequenceName = LP2CurrentRecipeList[wafers[i].SlotID];
- }
- }
- if (LP1CassetteState != LoadportCassetteState.Normal)
- {
- foreach (var wafer in LP1WaferAssociation.ModuleData.WaferManager.Wafers)
- {
- wafer.SequenceName = "";
- }
- }
- if (LP2CassetteState != LoadportCassetteState.Normal)
- {
- foreach (var wafer in LP2WaferAssociation.ModuleData.WaferManager.Wafers)
- {
- wafer.SequenceName = "";
- }
- }
- FOUPA.IsJobDone = LP1JobDone;
- FOUPB.IsJobDone = LP2JobDone;
- }
- #region LP Operation
- public void SetThick(string moduleID)
- {
- //if (MenuPermission != 3) return;
- LoadPortProvider.Instance.SetThick(moduleID);
- }
- public void SetThin(string moduleID)
- {
- //if (MenuPermission != 3) return;
- LoadPortProvider.Instance.SetThin(moduleID);
- }
- public void MapLP(string moduleID)
- {
- //if (MenuPermission != 3) return;
- LoadPortProvider.Instance.MapLP(moduleID);
- }
- public void LoadLP(string moduleID)
- {
- //if (MenuPermission != 3) return;
- if (_enableThickness)
- {
- WindowManager wm = new WindowManager();
- ThicknessDialogViewModel dialog = new ThicknessDialogViewModel();
- bool? bret = wm.ShowDialogWithNoStyle(dialog);
- if ((bool)bret)
- {
- string thickness = dialog.DialogResult;
- if (thickness == "Thick")
- SetThick(moduleID);
- if (thickness == "Thin")
- SetThin(moduleID);
- }
- else
- {
- return;
- }
- }
- LoadPortProvider.Instance.LoadLP(moduleID);
- }
- public void UnloadLP(string moduleID)
- {
- //if (MenuPermission != 3) return;
- LoadPortProvider.Instance.UnloadLP(moduleID);
- }
- public void HomeAll()
- {
- //if (MenuPermission != 3) return;
- InvokeClient.Instance.Service.DoOperation("System.HomeAll");
- }
- public void ReturnAllWafer()
- {
- //if (MenuPermission != 3) return;
- WindowManager wm = new WindowManager();
- bool needCooling = false;
- int coolingTime = 0;
- WaferTransferDialogViewModel _transferVM = new WaferTransferDialogViewModel("Would the wafer need cooling?", false, true, "");
- bool? bret = wm.ShowDialogWithNoStyle(_transferVM);
- if ((bool)bret)
- {
- //get and use transfer conditions
- WaferTransferCondition conditions = _transferVM.DialogResult;
- needCooling = conditions.IsPassCooling;
- coolingTime = conditions.CoolingTime;
- }
- InvokeClient.Instance.Service.DoOperation("System.ReturnAllWafer", needCooling, coolingTime);
- }
- public void PauseAllJob()
- {
- if (!string.IsNullOrEmpty(LP1WaferAssociation.JobID))
- WaferAssociationProvider.Instance.Pause(LP1WaferAssociation.JobID);
- if (!string.IsNullOrEmpty(LP2WaferAssociation.JobID))
- WaferAssociationProvider.Instance.Pause(LP2WaferAssociation.JobID);
- }
- public void Abort()
- {
- //if (MenuPermission != 3) return;
- InvokeClient.Instance.Service.DoOperation("System.Abort");
- }
- public void Auto()
- {
- //if (MenuPermission != 3) return;
- InvokeClient.Instance.Service.DoOperation("System.SetAutoMode");
- }
- public void Manual()
- {
- //if (MenuPermission != 3) return;
- InvokeClient.Instance.Service.DoOperation("System.SetManualMode");
- }
- #endregion LP Operation
- #region Sequence operation
- public void SelectSequence(WaferAssociationInfo info)
- {
- //if (MenuPermission != 3) return;
- SequenceDialogViewModel dialog = new SequenceDialogViewModel();
- dialog.DisplayName = "Select Sequence";
- dialog.Files = new ObservableCollection<FileNode>(RecipeSequenceTreeBuilder.GetFiles(
- RecipeClient.Instance.Service.GetSequenceNameList()
- ));
- WindowManager wm = new WindowManager();
- bool? bret = wm.ShowDialog(dialog);
- if ((bool)bret)
- {
- info.SequenceName = dialog.DialogResult;
- }
- }
- public void SetSlot(WaferAssociationInfo info)
- {
- if (InputSlotCheck(info.SlotFrom, info.SlotTo))
- AssociateSequence(info, true);
- }
- public void SkipSlot(WaferAssociationInfo info)
- {
- if (InputSlotCheck(info.SlotFrom, info.SlotTo))
- AssociateSequence(info, false);
- }
- public void SetAll(WaferAssociationInfo info)
- {
- //if (MenuPermission != 3) return;
- info.SlotFrom = 1;
- info.SlotTo = 25;
- AssociateSequence(info, true);
- }
- public void DeselectAll(WaferAssociationInfo info)
- {
- //if (MenuPermission != 3) return;
- info.SlotFrom = 1;
- info.SlotTo = 25;
- AssociateSequence(info, false);
- }
- public void SetSequence(WaferAssociationInfo info, int slotIndex, string seqName)
- {
- bool flag = string.IsNullOrEmpty(seqName);
- AssociateSequence(info, flag, slotIndex - 1);
- }
- private bool InputSlotCheck(int from, int to)
- {
- if (from > to)
- {
- DialogBox.ShowInfo("This index of from slot should be large than the index of to slot.");
- return false;
- }
- if (from < 1 || to > 25)
- {
- DialogBox.ShowInfo("This input value for from should be between 1 and 25.");
- return false;
- }
- return true;
- }
- private void AssociateSequence(WaferAssociationInfo info, bool flag, int slot = -1)
- {
- List<WaferInfo> wafers = info.ModuleData.WaferManager.Wafers;
- if (slot >= 0) //by wafer
- {
- int index = wafers.Count - slot - 1;
- if (index < wafers.Count)
- {
- if (flag && HasWaferOnSlot(wafers, index))
- wafers[index].SequenceName = info.SequenceName;
- else
- wafers[index].SequenceName = string.Empty;
- }
- }
- else //by from-to
- {
- for (int i = info.SlotFrom - 1; i < info.SlotTo; i++)
- {
- int index = wafers.Count - i - 1;
- if (index < wafers.Count)
- {
- if (flag && HasWaferOnSlot(wafers, index))
- wafers[index].SequenceName = info.SequenceName;
- else
- wafers[index].SequenceName = string.Empty;
- }
- }
- }
- }
- private bool HasWaferOnSlot(List<WaferInfo> wafers, int index)
- {
- if (wafers[index].WaferStatus == 0)
- return false;
- return true;
- }
- public int LP1WaferCount
- {
- get
- {
- int iWaferCount = 0;
- foreach (var Wafers in ModuleManager.ModuleInfos["LP1"].WaferManager.Wafers)
- {
- if (Wafers.WaferStatus != 0)
- {
- iWaferCount++;
- }
- }
- return iWaferCount;
- }
- }
- public string LP1WaferCountInfo
- {
- get
- {
- return $"Wafer数量:{LP1WaferCount}";
- }
- }
- public int LP2WaferCount
- {
- get
- {
- int iWaferCount = 0;
- foreach (var Wafers in ModuleManager.ModuleInfos["LP2"].WaferManager.Wafers)
- {
- if (Wafers.WaferStatus != 0)
- {
- iWaferCount++;
- }
- }
- return iWaferCount;
- }
- }
- public string LP2WaferCountInfo
- {
- get
- {
- return $"Wafer数量:{LP2WaferCount}";
- }
- }
- #endregion Sequence operation
- #region Job operation
- private bool JobCheck(string jobID)
- {
- if (jobID.Length == 0)
- {
- DialogBox.ShowWarning("Please create job first.");
- return false;
- }
- else
- return true;
- }
- public void CreateJob(WaferAssociationInfo info)
- {
- //if (MenuPermission != 3) return;
- List<string> slotSequence = new List<string>();
- info.ModuleData.WaferManager.Wafers.ForEach(key => { slotSequence.Insert(0, key.SequenceName); });
- string jobId = info.LotId.Trim();
- if (string.IsNullOrEmpty(jobId))
- jobId = "CJ_Local_" + info.ModuleData.ModuleID;
- info.LotId = jobId;
- info.LotIdSaved = true;
- WaferAssociationProvider.Instance.CreateJob(jobId, info.ModuleData.ModuleID, slotSequence, true);
- }
- public void AbortJob(string jobID)
- {
- //if (MenuPermission != 3) return;
- if (JobCheck(jobID))
- WaferAssociationProvider.Instance.AbortJob(jobID);
- }
- public void Start(string jobID)
- {
- //if (MenuPermission != 3) return;
- if (JobCheck(jobID))
- WaferAssociationProvider.Instance.Start(jobID);
- }
- public void Pause(string jobID)
- {
- //if (MenuPermission != 3) return;
- if (JobCheck(jobID))
- WaferAssociationProvider.Instance.Pause(jobID);
- }
- public void Resume(string jobID)
- {
- //if (MenuPermission != 3) return;
- if (JobCheck(jobID))
- WaferAssociationProvider.Instance.Resume(jobID);
- }
- public void Stop(string jobID)
- {
- //if (MenuPermission != 3) return;
- if (JobCheck(jobID))
- WaferAssociationProvider.Instance.Stop(jobID);
- }
- #endregion Job operation
- }
- }
|