12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370 |
- 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 MECF.Framework.Common.CommonData;
- 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; }
- }
- [Subscription("EfemRobot.RobotMoveInfo")]
- public RobotMoveInfo EfemRobotMoveInfo { get; set; }
- //{
- // 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.WaferSize1")]
- public string EfemRobotWaferSize1 { get; set; }
- public string WaferSizeEfemRobot1
- {
- get { return GetWaferSize(EfemRobotWaferSize1); }
- }
- [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 (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 _openCST = true;
- private bool _enableThickness = true;
- public Visibility LoadUnloadVisibility
- {
- get { return _efemType == EfemType.JetEfem&& !_openCST ? Visibility.Visible : Visibility.Collapsed; }
- }
- public Visibility MapVisibility
- {
- get
- {
- //return _efemType == EfemType.FutureEfem ? Visibility.Visible : Visibility.Collapsed;
- return Visibility.Visible;
- }
- }
- 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;
- _openCST = (bool)QueryDataClient.Instance.Service.GetConfig("EFEM.IsOpenCST");
- _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"] = (bool)QueryDataClient.Instance.Service.GetConfig("PMA.Chiller.EnableChiller") ? (float)PMAChillerTemperature:(float)PMATemperature;
- ModuleTemperature["PMB"] = (bool)QueryDataClient.Instance.Service.GetConfig("PMB.Chiller.EnableChiller") ? (float)PMBChillerTemperature : (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
- }
- }
|