| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298 |
- using Aitex.Core.Common.DeviceData;
- using Aitex.Core.Util;
- using Caliburn.Micro;
- using Caliburn.Micro.Core;
- using MECF.Framework.Common.DataCenter;
- using MECF.Framework.Common.Equipment;
- using MECF.Framework.Common.OperationCenter;
- using MECF.Framework.UI.Client.ClientBase;
- using MECF.Framework.UI.Client.CenterViews.Configs.SystemConfig;
- using System.Collections.Generic;
- using System.Collections.ObjectModel;
- using System.Linq;
- using System.Windows;
- using System.Windows.Media;
- using FurnaceUI.Client;
- using FurnaceUI.Models;
- using FurnaceUI.Views.Jobs;
- using FurnaceUI.Views.Recipes;
- using FurnaceUI.Views.Editors;
- using MECF.Framework.Common.SubstrateTrackings;
- using FurnaceUI.Views.Status;
- using OpenSEMI.ClientBase;
- using MECF.Framework.UI.Client.CenterViews.Editors.Recipe;
- namespace FurnaceUI.Views.Operations
- {
- public class MainStatusViewModel : FurnaceUIViewModelBase
- {
- #region Property
- [Subscription("LP1.CurrentLotId")]
- public string LP1CurrentLotId { get; set; }
- [Subscription("LP1.WaitLotId")]
- public List<string> LP1WaitLotId { get; set; }
- [Subscription("LP2.CurrentLotId")]
- public string LP2CurrentLotId { get; set; }
- [Subscription("LP2.WaitLotId")]
- public List<string> LP2WaitLotId { get; set; }
- [Subscription("TransferState", "LP1")]
- public string TransferStateLp1 { get; set; }
- [Subscription("TransferState", "LP2")]
- public string TransferStateLp2 { get; set; }
- [Subscription("CarrierIDStatus", "LP1")]
- public string CarrierStatusLP1 { get; set; }
- [Subscription("CarrierIDStatus", "LP2")]
- public string CarrierStatusLP2 { get; set; }
- [Subscription("ProcessFlow.Status")]
- public string ProcessFlowStatus { get; set; }
- double _eDUseWarningLimit;
- double _eDUseAlarmLimit;
- SolidColorBrush _greenBk = new SolidColorBrush(Colors.LawnGreen);
- SolidColorBrush _redBk = new SolidColorBrush(Colors.Red);
- SolidColorBrush _transparentBk = new SolidColorBrush(Colors.Transparent);
- SolidColorBrush _orangeBk = new SolidColorBrush(Colors.Orange);
- SolidColorBrush _blackBk = new SolidColorBrush(Colors.Black);
- public SolidColorBrush StandbyBk
- {
- get
- {
- if (!IsPM1Process && !IsPM1PostProcess)
- return _transparentBk;
- return ProcessFlowStatus == "Standby" ? _greenBk : _transparentBk;
- }
- }
- public SolidColorBrush ReadyBk
- {
- get
- {
- if (!IsPM1Process && !IsPM1PostProcess)
- return _transparentBk;
- return (ProcessFlowStatus == "Standby" || ProcessFlowStatus == "Ready") ? _greenBk : _transparentBk;
- }
- }
- public SolidColorBrush EndBk
- {
- get
- {
- if (!IsPM1Process && !IsPM1PostProcess)
- return _transparentBk;
- return ProcessFlowStatus == "End" ? _greenBk : _transparentBk;
- }
- }
- public SolidColorBrush RunBk
- {
- get
- {
- if (!IsPM1Process && !IsPM1PostProcess)
- return _transparentBk;
- return (ProcessFlowStatus == "End" || ProcessFlowStatus == "Run") ? _greenBk : _transparentBk;
- }
- }
- public SolidColorBrush AbortBk
- {
- get
- {
- if (!IsPM1Process && !IsPM1PostProcess)
- return _transparentBk;
- return ProcessFlowStatus == "Abort" ? _redBk : _transparentBk;
- }
- }
- #region Job Staus
- [Subscription("System.Batch")]
- public string Batch { get; set; }
- [Subscription("System.TransferJobStatus")]
- public string TransferJobStatus { get; set; }
- public SolidColorBrush TransferJobBk
- {
- get
- {
- return TransferJobStatus == "Idle" || string.IsNullOrEmpty(TransferJobStatus) ? _transparentBk : _greenBk;
- }
- }
- [Subscription("System.ProcessJobStatus")]
- public string ProcessJobStatus { get; set; }
- [Subscription("System.Pause")]
- public bool IsPause { get; set; }
- public string ProcessJobsStatus
- {
- get
- {
- return (string.IsNullOrEmpty(Batch) || ProcessJobStatus == "Idle") ? ProcessJobStatus : $"{Batch} : {ProcessJobStatus}";
- }
- }
- public SolidColorBrush ProcessJobBk
- {
- get
- {
- if (IsPause)
- {
- return _orangeBk;
- }
- else
- {
- return ProcessJobStatus == "Idle" || string.IsNullOrEmpty(ProcessJobsStatus) ? _transparentBk : _greenBk;
- }
- return _transparentBk;
- }
- }
- #endregion
- #region SMIF
- [Subscription("LP1.Status")]
- public string LP1Status { get; set; }
- public string Lp1StatusBackground
- {
- get { return ModuleStatusBackground.GetStatusBackground(LP1Status); }
- }
- [Subscription("Boat.Status")]
- public string BoatStatus { get; set; }
- public string BoatStatusBackground
- {
- get { return ModuleStatusBackground.GetStatusBackground(BoatStatus); }
- }
- [Subscription("LP2.Status")]
- public string LP2Status { get; set; }
- public string LP2StatusBackground
- {
- get { return ModuleStatusBackground.GetStatusBackground(LP2Status); }
- }
- #endregion
- #region Stocker
- private List<ModuleName> _stokcers;
- private List<string> _stokcerWaferType;
- private int _cassetteSlot = 0;
- private ObservableCollection<string> _stockerSlots;
- public ObservableCollection<string> StockerSlots
- {
- get { return _stockerSlots; }
- set
- {
- _stockerSlots = value;
- NotifyOfPropertyChange("StockerSlots");
- }
- }
- private SolidColorBrush _WhiteFill = new SolidColorBrush(Colors.White);
- private SolidColorBrush _productionFill = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#bedadb"));
- private SolidColorBrush _SD_ED_M_Fill = new SolidColorBrush((Color)ColorConverter.ConvertFromString("LightGray"));
- private SolidColorBrush _waringFill = new SolidColorBrush(Colors.Yellow);
- private SolidColorBrush _alarmFill = new SolidColorBrush(Colors.Red);
- private List<SolidColorBrush> _stockerBackground = new List<SolidColorBrush>();
- public List<SolidColorBrush> StockerBackground
- {
- get => _stockerBackground;
- set
- {
- _stockerBackground = value;
- NotifyOfPropertyChange(nameof(StockerBackground));
- }
- }
- [Subscription("Stocker1.CassettePresent")]
- public bool IsStocker1CassettePresent { get; set; }
- [Subscription("Stocker2.CassettePresent")]
- public bool IsStocker2CassettePresent { get; set; }
- [Subscription("Stocker3.CassettePresent")]
- public bool IsStocker3CassettePresent { get; set; }
- [Subscription("Stocker4.CassettePresent")]
- public bool IsStocker4CassettePresent { get; set; }
- [Subscription("Stocker5.CassettePresent")]
- public bool IsStocker5CassettePresent { get; set; }
- [Subscription("Stocker6.CassettePresent")]
- public bool IsStocker6CassettePresent { get; set; }
- [Subscription("Stocker7.CassettePresent")]
- public bool IsStocker7CassettePresent { get; set; }
- [Subscription("Stocker8.CassettePresent")]
- public bool IsStocker8CassettePresent { get; set; }
- [Subscription("Stocker9.CassettePresent")]
- public bool IsStocker9CassettePresent { get; set; }
- [Subscription("Stocker10.CassettePresent")]
- public bool IsStocker10CassettePresent { get; set; }
- [Subscription("Stocker11.CassettePresent")]
- public bool IsStocker11CassettePresent { get; set; }
- [Subscription("Stocker12.CassettePresent")]
- public bool IsStocker12CassettePresent { get; set; }
- [Subscription("Stocker13.CassettePresent")]
- public bool IsStocker13CassettePresent { get; set; }
- [Subscription("Stocker14.CassettePresent")]
- public bool IsStocker14CassettePresent { get; set; }
- [Subscription("Stocker15.CassettePresent")]
- public bool IsStocker15CassettePresent { get; set; }
- [Subscription("Stocker16.CassettePresent")]
- public bool IsStocker16CassettePresent { get; set; }
- [Subscription("Stocker17.CassettePresent")]
- public bool IsStocker17CassettePresent { get; set; }
- [Subscription("Stocker18.CassettePresent")]
- public bool IsStocker18CassettePresent { get; set; }
- [Subscription("Stocker1.Carrier")]
- public CarrierInfo Stocker1CarrierData { get; set; }
- [Subscription("Stocker2.Carrier")]
- public CarrierInfo Stocker2CarrierData { get; set; }
- [Subscription("Stocker3.Carrier")]
- public CarrierInfo Stocker3CarrierData { get; set; }
- [Subscription("Stocker4.Carrier")]
- public CarrierInfo Stocker4CarrierData { get; set; }
- [Subscription("Stocker5.Carrier")]
- public CarrierInfo Stocker5CarrierData { get; set; }
- [Subscription("Stocker6.Carrier")]
- public CarrierInfo Stocker6CarrierData { get; set; }
- [Subscription("Stocker7.Carrier")]
- public CarrierInfo Stocker7CarrierData { get; set; }
- [Subscription("Stocker8.Carrier")]
- public CarrierInfo Stocker8CarrierData { get; set; }
- [Subscription("Stocker9.Carrier")]
- public CarrierInfo Stocker9CarrierData { get; set; }
- [Subscription("Stocker10.Carrier")]
- public CarrierInfo Stocker10CarrierData { get; set; }
- [Subscription("Stocker11.Carrier")]
- public CarrierInfo Stocker11CarrierData { get; set; }
- [Subscription("Stocker12.Carrier")]
- public CarrierInfo Stocker12CarrierData { get; set; }
- [Subscription("Stocker13.Carrier")]
- public CarrierInfo Stocker13CarrierData { get; set; }
- [Subscription("Stocker14.Carrier")]
- public CarrierInfo Stocker14CarrierData { get; set; }
- [Subscription("Stocker15.Carrier")]
- public CarrierInfo Stocker15CarrierData { get; set; }
- [Subscription("Stocker16.Carrier")]
- public CarrierInfo Stocker16CarrierData { get; set; }
- [Subscription("Stocker17.Carrier")]
- public CarrierInfo Stocker17CarrierData { get; set; }
- [Subscription("Stocker18.Carrier")]
- public CarrierInfo Stocker18CarrierData { get; set; }
- public int Stocker1WaferCount { get; set; } = 0;
- public int Stocker2WaferCount { get; set; } = 0;
- public int Stocker3WaferCount { get; set; } = 0;
- public int Stocker4WaferCount { get; set; } = 0;
- public int Stocker5WaferCount { get; set; } = 0;
- public int Stocker6WaferCount { get; set; } = 0;
- public int Stocker7WaferCount { get; set; } = 0;
- public int Stocker8WaferCount { get; set; } = 0;
- public int Stocker9WaferCount { get; set; } = 0;
- public int Stocker10WaferCount { get; set; } = 0;
- public int Stocker11WaferCount { get; set; } = 0;
- public int Stocker12WaferCount { get; set; } = 0;
- public int Stocker13WaferCount { get; set; } = 0;
- public int Stocker14WaferCount { get; set; } = 0;
- public int Stocker15WaferCount { get; set; } = 0;
- public int Stocker16WaferCount { get; set; } = 0;
- public int Stocker17WaferCount { get; set; } = 0;
- public int Stocker18WaferCount { get; set; } = 0;
- #endregion
- #region Heater
- [Subscription("PM1.Heater1.DeviceData")]
- public AITHeaterData Heater1Data { get; set; }
- [Subscription("PM1.Heater2.DeviceData")]
- public AITHeaterData Heater2Data { get; set; }
- [Subscription("PM1.Heater3.DeviceData")]
- public AITHeaterData Heater3Data { get; set; }
- [Subscription("PM1.Heater4.DeviceData")]
- public AITHeaterData Heater4Data { get; set; }
- [Subscription("PM1.Heater5.DeviceData")]
- public AITHeaterData Heater5Data { get; set; }
- [Subscription("PM1.Heater6.DeviceData")]
- public AITHeaterData Heater6Data { get; set; }
- [Subscription("PM1.Heater7.DeviceData")]
- public AITHeaterData Heater7Data { get; set; }
- [Subscription("PM1.Heater8.DeviceData")]
- public AITHeaterData Heater8Data { get; set; }
- [Subscription("PM1.Heater9.DeviceData")]
- public AITHeaterData Heater9Data { get; set; }
- [Subscription("PM1.Heater10.DeviceData")]
- public AITHeaterData Heater10Data { get; set; }
- //public double TopHeaterSetPoint => Heater10Data.IsLspModeFeedBack ? Heater10Data.SetPoint : Heater9Data.SetPoint;
- //public double TopHeaterFeedback => Heater10Data.IsLspModeFeedBack ? Heater10Data.FeedBack : Heater9Data.FeedBack;
- //public double TopCenterHeaterSetPoint => Heater8Data.IsLspModeFeedBack ? Heater8Data.SetPoint : Heater7Data.SetPoint;
- //public double TopCenterHeaterFeedback => Heater8Data.IsLspModeFeedBack ? Heater8Data.FeedBack : Heater7Data.FeedBack;
- //public double CenterHeaterSetPoint => Heater6Data.IsLspModeFeedBack ? Heater6Data.SetPoint : Heater5Data.SetPoint;
- //public double CenterHeaterFeedback => Heater6Data.IsLspModeFeedBack ? Heater6Data.FeedBack : Heater5Data.FeedBack;
- //public double CenterBottomHeaterSetPoint => Heater4Data.IsLspModeFeedBack ? Heater4Data.SetPoint : Heater3Data.SetPoint;
- //public double CenterBottomHeaterFeedback => Heater4Data.IsLspModeFeedBack ? Heater4Data.FeedBack : Heater3Data.FeedBack;
- //public double BottomHeaterSetPoint => Heater2Data.IsLspModeFeedBack ? Heater2Data.SetPoint : Heater1Data.SetPoint;
- //public double BottomHeaterFeedback => Heater2Data.IsLspModeFeedBack ? Heater2Data.FeedBack : Heater1Data.FeedBack;
- #endregion
- #region Robot
- [Subscription("WaferRobot.Status")]
- public string WaferRobotStatus { get; set; }
- public string WaferRobotStatusBackground
- {
- get { return ModuleStatusBackground.GetStatusBackground(WaferRobotStatus); }
- }
- [Subscription("CarrierRobot.Status")]
- public string CarrierRobotStatus { get; set; }
- public string CarrierRobotStatusBackground
- {
- get { return ModuleStatusBackground.GetStatusBackground(CarrierRobotStatus); }
- }
- #endregion
- #region PM
- [Subscription("PM1.Status")]
- public string PM1Status { get; set; }
- [Subscription("PM1.RecipeStepName")]
- public string PM1RecipeStepName { get; set; }
- [Subscription("PM1.RecipeStepNumber")]
- public int PM1RecipeStepNumber { get; set; }
- [Subscription("PM1.RecipeStepElapseTime")]
- public int PM1RecipeStepElapseTime { get; set; }
- [Subscription("PM1.RecipeStepTime")]
- public int PM1RecipeStepTime { get; set; }
- [Subscription("PM1.RecipeTotalElapseTime")]
- public int PM1RecipeTotalElapseTime { get; set; }
- [Subscription("PM1.RecipeTotalTime")]
- public int PM1RecipeTotalTime { get; set; }
- [Subscription("PM1.RecipeHoldTime")]
- public int PM1RecipeHoldTime { get; set; }
- [Subscription("PM1.RecipeHold")]
- public bool PM1RecipeHold { get; set; }
- public bool IsPM1Idle
- {
- get { return PM1Status == "Idle"; }
- }
- public bool IsPM1Process
- {
- get { return PM1Status == "Process"; }
- }
- public bool IsPM1PostProcess
- {
- get { return PM1Status == "PostProcess"; }
- }
- public bool IsPM1PreProcess
- {
- get { return PM1Status == "PreProcess"; }
- }
- public string PM1StepNumber
- {
- get
- {
- if (!IsPM1Process && !IsPM1PostProcess)
- return "--";
- return $"{PM1RecipeStepNumber}";
- }
- }
- public string PM1StepName
- {
- get
- {
- if (!IsPM1Process && !IsPM1PostProcess)
- return "--";
- return $"{PM1RecipeStepName}";
- }
- }
- public string PM1StepTime
- {
- get
- {
- if (!IsPM1Process && !IsPM1PostProcess)
- return "--";
- return CalStepTime(PM1RecipeStepElapseTime, PM1RecipeStepTime);
- }
- }
- public string PM1RecipeTime
- {
- get
- {
- if (!IsPM1Process && !IsPM1PostProcess)
- return "--";
- return CalRecipeTime(PM1RecipeTotalElapseTime, PM1RecipeTotalTime);
- }
- }
- public string PM1HoldTime
- {
- get
- {
- if (!IsPM1Process && !IsPM1PostProcess)
- return "--";
- return CalHoldTime(PM1RecipeHoldTime);
- }
- }
- public string HoldName
- {
- get
- {
- if (PM1RecipeHold)
- return "Continue";
- return "Hold";
- }
- }
- public SolidColorBrush HoldForeground
- {
- get
- {
- if (PM1RecipeHold)
- return _blackBk;
- return _redBk;
- }
- }
- [Subscription("PM1.SelectedRecipeName")]
- public string PM1SelectedRecipeName
- {
- get;
- set;
- }
- [Subscription("PM1.MainRecipeName")]
- public string PM1MainRecipeName
- {
- get;
- set;
- }
- public string PM1SelectedRecipeNameDisplay
- {
- get
- {
- if (string.IsNullOrEmpty(PM1SelectedRecipeName))
- return string.Empty;
- if (!IsPM1Process && !IsPM1PostProcess)
- return string.Empty;
- //return PM1SelectedRecipeName.Substring("Furnace\\Process\\".Length);
- return PM1SelectedRecipeName;
- }
- }
- [Subscription("PM1.IsOnline")]
- public bool PM1IsOnline { get; set; }
- public bool PM1IsOffline
- {
- get { return !PM1IsOnline; }
- }
- public bool IsEnableEmergencyAbort
- {
- get
- {
- return PM1Status != "Init" && PM1Status != "Idle";
- }
- }
- private string CalStepTime(int elapseTime, int totalTime)
- {
- string stepTime = string.Empty;
- int remainingTime = totalTime - elapseTime;
- if (remainingTime < 0)
- remainingTime = 0;
- string strElapseTimeH = $"{(elapseTime / 3600).ToString().PadLeft(2, '0')}";
- string strElapseTimeM = $"{(elapseTime % 3600 / 60).ToString().PadLeft(2, '0')}";
- string strElapseTimeS = $"{(elapseTime % 60).ToString().PadLeft(2, '0')}";
- string strTotalTimeH = $"{(totalTime / 3600).ToString().PadLeft(2, '0')}";
- string strTotalTimeM = $"{(totalTime % 3600 / 60).ToString().PadLeft(2, '0')}";
- string strTotalTimeS = $"{(totalTime % 60).ToString().PadLeft(2, '0')}";
- stepTime = $"{strElapseTimeH}:{strElapseTimeM}:{strElapseTimeS}/{strTotalTimeH}:{strTotalTimeM}:{strTotalTimeS}";
- return stepTime;
- }
- private string CalRecipeTime(int elapseTime, int totalTime)
- {
- string recipeTime = string.Empty;
- int remainingTime = totalTime - elapseTime;
- if (remainingTime < 0)
- remainingTime = 0;
- string strElapseTimeH = $"{(elapseTime / 3600).ToString().PadLeft(2, '0')}";
- string strElapseTimeM = $"{(elapseTime % 3600 / 60).ToString().PadLeft(2, '0')}";
- string strElapseTimeS = $"{(elapseTime % 60).ToString().PadLeft(2, '0')}";
- string strRemainingTimeH = $"{(remainingTime / 3600).ToString().PadLeft(2, '0')}";
- string strRemainingTimeM = $"{(remainingTime % 3600 / 60).ToString().PadLeft(2, '0')}";
- string strRemainingTimeS = $"{(remainingTime % 60).ToString().PadLeft(2, '0')}";
- recipeTime = $"{strElapseTimeH}:{strElapseTimeM}:{strElapseTimeS}/{strRemainingTimeH}:{strRemainingTimeM}:{strRemainingTimeS}";
- return recipeTime;
- }
- private string CalHoldTime(int totalTime)
- {
- string holdTime = string.Empty;
- string strHoldTimeH = $"{(totalTime / 3600).ToString().PadLeft(2, '0')}";
- string strHoldTimeM = $"{(totalTime % 3600 / 60).ToString().PadLeft(2, '0')}";
- string strHoldTimeS = $"{(totalTime % 60).ToString().PadLeft(2, '0')}";
- holdTime = $"{strHoldTimeH}:{strHoldTimeM}:{strHoldTimeS}";
- return holdTime;
- }
- private string _recipeProgress;
- public string RecipeProgress
- {
- get => _recipeProgress;
- set
- {
- _recipeProgress = value;
- NotifyOfPropertyChange(nameof(RecipeProgress));
- }
- }
- private int _recipeProgressValue;
- public int RecipeProgressValue
- {
- get => _recipeProgressValue;
- set
- {
- _recipeProgressValue = value;
- NotifyOfPropertyChange(nameof(RecipeProgressValue));
- }
- }
- #endregion
- #region Scheduler
- public bool IsRtInitialized
- {
- get
- {
- return RtStatus != "Init" && RtStatus != "Initializing";
- }
- }
- public bool IsRtRunning
- {
- get
- {
- return RtStatus != "Init" && RtStatus != "Idle" && RtStatus != "AutoIdle";
- }
- }
- public bool IsRtError
- {
- get
- {
- return RtStatus == "Error";
- }
- }
- public bool IsAuto
- {
- get { return RtStatus == "Auto_Running" || RtStatus == "Auto_Idle"; }
- }
- [Subscription("Rt.Status")]
- public string RtStatus { get; set; }
- public bool _isCycleMode;
- public Visibility IsCycleInfoVisibility
- {
- get { return _isCycleMode ? Visibility.Visible : Visibility.Collapsed; }
- }
- [Subscription("Scheduler.CycledCount")]
- public int CycledCount { get; set; }
- [Subscription("Scheduler.CycledWafer")]
- public int CycledWafer { get; set; }
- [Subscription("Scheduler.CycledTotalWafer")]
- public int TotalCycledWafer { get; set; }
- [Subscription("Scheduler.CycleSetPoint")]
- public int CycleSetPoint { get; set; }
- public string CycleCountDisplay
- {
- get { return (CycleSetPoint > 0 && (CycledCount > CycleSetPoint)) ? $"{CycledCount + 1}/{CycleSetPoint}" : $"{CycledCount}/{CycleSetPoint}"; }
- }
- #endregion
- #region Button Logic
- #endregion
- #region shutter
- [Subscription("AutoShutter.OpenCloseStatus")]
- public string AutoShutterOpenCloseStatus { get; set; }
- [Subscription("AutoShutter.UpDownStatus")]
- public string AutoShutterUpDownStatus { get; set; }
- public string AutoShutterStatus => $"{AutoShutterOpenCloseStatus}/{AutoShutterUpDownStatus}";
- #endregion
- #endregion
- #region Gas
- [Subscription("PM1.MfcNX.DeviceData")]
- public AITMfcData MfcNXData { get; set; }
- [Subscription("PM1.MfcNY.DeviceData")]
- public AITMfcData MfcNYData { get; set; }
- [Subscription("PM1.MfcNN1.DeviceData")]
- public AITMfcData MfcNN1Data { get; set; }
- [Subscription("PM1.MfcN1.DeviceData")]
- public AITMfcData MfcN1Data { get; set; }
- [Subscription("PM1.MfcNN2.DeviceData")]
- public AITMfcData MfcNN2Data { get; set; }
- [Subscription("PM1.MfcN2.DeviceData")]
- public AITMfcData MfcN2Data { get; set; }
- [Subscription("PM1.MfcM1.DeviceData")]
- public AITMfcData MfcM1Data { get; set; }
- [Subscription("PM1.MfcD1.DeviceData")]
- public AITMfcData MfcD1Data { get; set; }
- [Subscription("PM1.MfcXY1.DeviceData")]
- public AITMfcData MfcXY1Data { get; set; }
- [Subscription("PM1.MfcNXF1.DeviceData")]
- public AITMfcData MfcNXF1Data { get; set; }
- [Subscription("PM1.MfcXF1.DeviceData")]
- public AITMfcData MfcXF1Data { get; set; }
- [Subscription("PM1.MfcNV1.DeviceData")]
- public AITMfcData MfcNV1Data { get; set; }
- [Subscription("PM1.MfcV1.DeviceData")]
- public AITMfcData MfcV1Data { get; set; }
- [Subscription("PM1.MfmD1.DeviceData")]
- public AITWaterFlowMeterData MfmD1FlowData { get; set; }
- public string UnitNX
- {
- get
- {
- return $"({SystemConfigProvider.Instance.GetValueByName("PM1.MFC.MFCNX.FlowUnit")})";
- }
- }
- public string UnitNY
- {
- get
- {
- return $"({SystemConfigProvider.Instance.GetValueByName("PM1.MFC.MFCNY.FlowUnit")})";
- }
- }
- public string UnitNN1
- {
- get
- {
- return $"({SystemConfigProvider.Instance.GetValueByName("PM1.MFC.MFCNN1.FlowUnit")})";
- }
- }
- public string UnitN1
- {
- get
- {
- return $"({SystemConfigProvider.Instance.GetValueByName("PM1.MFC.MFCN1.FlowUnit")})";
- }
- }
- public string UnitNN2
- {
- get
- {
- return $"({SystemConfigProvider.Instance.GetValueByName("PM1.MFC.MFCNN2.FlowUnit")})";
- }
- }
- public string UnitN2
- {
- get
- {
- return $"({SystemConfigProvider.Instance.GetValueByName("PM1.MFC.MFCN2.FlowUnit")})";
- }
- }
- public string UnitM1
- {
- get
- {
- return $"({SystemConfigProvider.Instance.GetValueByName("PM1.MFC.MFCM1.FlowUnit")})";
- }
- }
- public string UnitD1
- {
- get
- {
- return $"({SystemConfigProvider.Instance.GetValueByName("PM1.MFC.MFCD1.FlowUnit")})";
- }
- }
- public string UnitXY1
- {
- get
- {
- return $"({SystemConfigProvider.Instance.GetValueByName("PM1.MFC.MFCXY1.FlowUnit")})";
- }
- }
- public string UnitNXF1
- {
- get
- {
- return $"({SystemConfigProvider.Instance.GetValueByName("PM1.MFC.MFCNXF1.FlowUnit")})";
- }
- }
- public string UnitXF1
- {
- get
- {
- return $"({SystemConfigProvider.Instance.GetValueByName("PM1.MFC.MFCXF1.FlowUnit")})";
- }
- }
- public string UnitNV1
- {
- get
- {
- return $"({SystemConfigProvider.Instance.GetValueByName("PM1.MFC.MFCNV1.FlowUnit")})";
- }
- }
- public string UnitV1
- {
- get
- {
- return $"({SystemConfigProvider.Instance.GetValueByName("PM1.MFC.MFCV1.FlowUnit")})";
- }
- }
- public string UnitMFMD1
- {
- get
- {
- return $"({SystemConfigProvider.Instance.GetValueByName("PM1.MFM.MFMD1.FlowUnit")})";
- }
- }
- #endregion
- public Visibility IsStockerVisibility { get; set; }
- public Visibility IsLPVisibility { get; set; }
- public MainStatusViewModel()
- {
- this.DisplayName = "MainStatusViewModel";
- //ActiveUpdateData = true;
- _stokcers = new List<ModuleName>()
- {
- ModuleName.Stocker1,
- ModuleName.Stocker2,
- ModuleName.Stocker3,
- ModuleName.Stocker4,
- ModuleName.Stocker5,
- ModuleName.Stocker6,
- ModuleName.Stocker7,
- ModuleName.Stocker8,
- ModuleName.Stocker9,
- ModuleName.Stocker10,
- ModuleName.Stocker11,
- ModuleName.Stocker12,
- ModuleName.Stocker13,
- ModuleName.Stocker14,
- ModuleName.Stocker15,
- ModuleName.Stocker16,
- ModuleName.Stocker17,
- ModuleName.Stocker18,
- };
- StockerSlots = new ObservableCollection<string>()
- {
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- };
- _stokcerWaferType = Enumerable.Repeat("", 21).ToList();
- _eDUseWarningLimit = (int)QueryDataClient.Instance.Service.GetConfig("PM1.WaferCycleTime.EDCountWarning");
- _eDUseAlarmLimit = (int)QueryDataClient.Instance.Service.GetConfig("PM1.WaferCycleTime.EDCountAlarm");
- _stockerBackground = new List<SolidColorBrush>();
- for (int i = 0; i < 21; i++)
- {
- _stockerBackground.Add(_WhiteFill);
- }
- }
- protected override void OnInitialize()
- {
- base.OnInitialize();
- base.InitFOUP();
- base.InitLL();
- base.InitTM();
- base.InitEFEM();
- base.InitPM();
- base.InitBuffer();
- }
- protected override void OnActivate()
- {
- base.OnActivate();
- _isCycleMode = (bool)QueryDataClient.Instance.Service.GetConfig("System.IsCycleMode");
- _cassetteSlot = (int)QueryDataClient.Instance.Service.GetConfig("System.CassetteSlotCount");
- for (int i = 0; i < _stokcers.Count; i++)
- {
- _stokcerWaferType[i] = (string)QueryDataClient.Instance.Service.GetConfig($"System.Stocker.{_stokcers[i]}WaferType");
- }
- }
- protected override void OnViewLoaded(object view)
- {
- base.OnViewLoaded(view);
- MainStatusView mainStatusView = (MainStatusView)view;
- InitMfc(mainStatusView);
- }
- public GridLength MfcNXHeight { get; set; }
- public GridLength MfcNYHeight { get; set; }
- public GridLength MfcNN1Height { get; set; }
- public GridLength MfcN1Height { get; set; }
- public GridLength MfcNN2Height { get; set; }
- public GridLength MfcN2Height { get; set; }
- public GridLength MfcM1Height { get; set; }
- public GridLength MfcD1Height { get; set; }
- public GridLength MfcXY1Height { get; set; }
- public GridLength MfcNXF1Height { get; set; }
- public GridLength MfcXFHeight { get; set; }
- public GridLength MfcNV1Height { get; set; }
- public GridLength MfcV1Height { get; set; }
- public void InitMfc(MainStatusView view)
- {
- List<AITMfcData> mfcData = new List<AITMfcData>()
- {
- MfcNXData,
- MfcNYData,
- MfcNN1Data,
- MfcN1Data,
- MfcNN2Data,
- MfcN2Data,
- MfcM1Data,
- MfcD1Data,
- MfcXY1Data,
- MfcNXF1Data,
- MfcXF1Data,
- MfcNV1Data,
- MfcV1Data,
- };
- for (int i = 0; i < mfcData.Count; i++)
- {
- var IsMFCInstalled = (bool)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{mfcData[i].DeviceName}.IsMFCInstalled");
- switch (mfcData[i].DeviceName)
- {
- case "MfcNX":
- MfcNXHeight = IsMFCInstalled ? new GridLength(1, GridUnitType.Star) : new GridLength(0, GridUnitType.Pixel);
- break;
- case "MfcNY":
- MfcNYHeight = IsMFCInstalled ? new GridLength(1, GridUnitType.Star) : new GridLength(0, GridUnitType.Pixel);
- break;
- case "MfcNN1":
- MfcNN1Height = IsMFCInstalled ? new GridLength(1, GridUnitType.Star) : new GridLength(0, GridUnitType.Pixel);
- break;
- case "MfcN1":
- MfcN1Height = IsMFCInstalled ? new GridLength(1, GridUnitType.Star) : new GridLength(0, GridUnitType.Pixel);
- break;
- case "MfcNN2":
- MfcNN2Height = IsMFCInstalled ? new GridLength(1, GridUnitType.Star) : new GridLength(0, GridUnitType.Pixel);
- break;
- case "MfcN2":
- MfcN2Height = IsMFCInstalled ? new GridLength(1, GridUnitType.Star) : new GridLength(0, GridUnitType.Pixel);
- break;
- case "MfcM1":
- MfcM1Height = IsMFCInstalled ? new GridLength(1, GridUnitType.Star) : new GridLength(0, GridUnitType.Pixel);
- break;
- case "MfcD1":
- MfcD1Height = IsMFCInstalled ? new GridLength(1, GridUnitType.Star) : new GridLength(0, GridUnitType.Pixel);
- break;
- case "MfcXY1":
- MfcXY1Height = IsMFCInstalled ? new GridLength(1, GridUnitType.Star) : new GridLength(0, GridUnitType.Pixel);
- break;
- case "MfcNXF1":
- MfcNXF1Height = IsMFCInstalled ? new GridLength(1, GridUnitType.Star) : new GridLength(0, GridUnitType.Pixel);
- break;
- case "MfcXF1":
- MfcXFHeight = IsMFCInstalled ? new GridLength(1, GridUnitType.Star) : new GridLength(0, GridUnitType.Pixel);
- break;
- case "MfcNV1":
- MfcNV1Height = IsMFCInstalled ? new GridLength(1, GridUnitType.Star) : new GridLength(0, GridUnitType.Pixel);
- break;
- case "MfcV1":
- MfcV1Height = IsMFCInstalled ? new GridLength(1, GridUnitType.Star) : new GridLength(0, GridUnitType.Pixel);
- break;
- default:
- break;
- }
- }
- }
- public void Start()
- {
- InvokeClient.Instance.Service.DoOperation("System.StartAutoRun");
- }
- public void Stop()
- {
- //InvokeClient.Instance.Service.DoOperation("System.StartAutoRun");
- }
- public void SwitchPage(string page)
- {
- var windowManager = IoC.Get<IWindowManager>();
- switch (page)
- {
- case "Stocker":
- ClientApp.Instance.SwitchPage("status", "stocker", null);
- break;
- case "SelfCheck":
- ClientApp.Instance.SwitchPage("status", "selfCheck", null);
- break;
- case "Gas":
- {
- //ClientApp.Instance.SwitchPage("status", "gas", null);
- CGlobal.BoatWaferEditViewEnable = false;
- var wm = IoC.Get<IWindowManager>();
- GasDetailViewModel gasDetailViewModel = new GasDetailViewModel();
- (wm as WindowManager)?.ShowDialogWithTitle(gasDetailViewModel, null, "Gas Detail");
- }
- break;
- case "Temp":
- //TemperatureDetailViewModel temperatureDetailViewModel = new TemperatureDetailViewModel();
- //if((bool)(windowManager as WindowManager)?.ShowDialogWithTitle(temperatureDetailViewModel, null, "Temperature Detail"))
- //{
- ClientApp.Instance.SwitchPage("status", "temp", null);
- //}
- break;
- case "MainRecipe":
- if (!string.IsNullOrEmpty(PM1MainRecipeName))
- {
- CGlobal.RecipeProcessEditViewEnable = false;
- MECF.Framework.UI.Client.CenterViews.Editors.Recipe.CGlobal.RecipeProcessEditViewEnable = false;
- var wm = IoC.Get<IWindowManager>();
- var viewProcessRecipe = new RecipeProcessEditViewModel("Furnace\\Process", PM1MainRecipeName);
- viewProcessRecipe.RecipeType = "process";
- (wm as WindowManager)?.ShowDialogWithTitle(viewProcessRecipe, null, "View Process Recpie");
- }
- break;
- case "LayoutRecipe":
- {
- CGlobal.BoatWaferEditViewEnable = false;
- var wm = IoC.Get<IWindowManager>();
- var viewLayoutRecipe = new BoatWaferNoActionViewModel();
- (wm as WindowManager)?.ShowDialogWithTitle(viewLayoutRecipe, null, "View Boat Wafer");
- }
- break;
- case "Boat Elevator":
- {
- BoatElevatorParametersViewModel boatElevatorParametersViewModel = new BoatElevatorParametersViewModel();
- (windowManager as WindowManager)?.ShowDialogWithTitle(boatElevatorParametersViewModel, null, "Boat Elevator Parameter Settings");
- }
- break;
- case "CJStatus":
- {
- ControlJobStatusViewModel controlJobStatusViewModel = new ControlJobStatusViewModel();
- (windowManager as WindowManager)?.ShowDialogWithTitle(controlJobStatusViewModel, null, "CJ Status");
- }
- break;
- case "PJStatus":
- {
- ProcessJobWithDrawingViewModel processJobWithDrawingViewModel = new ProcessJobWithDrawingViewModel();
- (windowManager as WindowManager)?.ShowDialogWithTitle(processJobWithDrawingViewModel, null, "PJ Status");
- }
- break;
- case "LoadPortState":
- {
- LoadPortStateViewModel loadPortStateViewModel = new LoadPortStateViewModel();
- (windowManager as WindowManager)?.ShowDialogWithTitle(loadPortStateViewModel, null, "Load Port State");
- }
- break;
- case "CarrierState":
- {
- CarrierStateViewModel carrierStateViewModel = new CarrierStateViewModel();
- (windowManager as WindowManager)?.ShowDialogWithTitle(carrierStateViewModel, null, "Carrier State");
- }
- break;
- case "Equipment Status":
- {
- EquipmentStatusViewModel equipmentStatusViewModel = new EquipmentStatusViewModel();
- (windowManager as WindowManager)?.ShowDialogWithTitle(equipmentStatusViewModel, null, "Equipment Operation State");
- }
- break;
- case "Load Unload State":
- {
- LoadUnloadStateViewModel loadUnloadStateViewModel = new LoadUnloadStateViewModel();
- (windowManager as WindowManager)?.ShowDialogWithTitle(loadUnloadStateViewModel, null, "Load Unload State");
- }
- break;
- case "Boat Detail":
- {
- BoatWaferViewModel boatWaferViewModel = new BoatWaferViewModel();
- (windowManager as WindowManager)?.ShowDialogWithTitle(boatWaferViewModel, null, "Boat Detail");
- }
- break;
- }
- }
- string[] moduleNames = new string[] { "Stocker1", "Stocker2", "Stocker3", "Stocker4", "Stocker5", "Stocker6", "Stocker7", "Stocker8", "Stocker9",
- "Stocker10","Stocker11","Stocker12","Stocker13","Stocker14","Stocker15","Stocker16","Stocker17","Stocker18"};
- protected override void InvokeAfterUpdateProperty(Dictionary<string, object> data)
- {
- UpdateStockerSlots();
- UpdateRecipeProgress();
- var isLoadPortPosition = (string)QueryDataClient.Instance.Service.GetConfig("LoadPort.LoadPortPosition");
- if (isLoadPortPosition == "Upper")
- {
- IsStockerVisibility = Visibility.Hidden;
- IsLPVisibility = Visibility.Visible;
- }
- else
- {
- IsStockerVisibility = Visibility.Visible;
- IsLPVisibility = Visibility.Hidden;
- }
- foreach (var item in moduleNames)
- {
- if (ModuleManager.ModuleInfos.ContainsKey(item))
- {
- this.GetType().GetProperty($"{item}WaferCount").SetValue(this, ModuleManager.ModuleInfos[item].WaferManager.Wafers.Where(x => x.WaferStatus != 0).Count());
- }
- }
- }
- private void UpdateStockerSlots()
- {
- for (int i = 0; i < _stokcers.Count; i++)
- {
- bool bHaveAbort = false;
- var wafers = ModuleManager.ModuleInfos[_stokcers[i].ToString()].WaferManager.Wafers;
- int waferNumber = 0;
- string waferType = "";
- SolidColorBrush _tempFill = _SD_ED_M_Fill;
- if (wafers != null)
- {
- foreach (var wafer in wafers)
- {
- if (wafer.WaferStatus != 0)
- {
- waferNumber++;
- waferType = wafer.WaferType.ToString();
- if (wafer.WaferStatus == 5) // EnumWaferProcessStatus.Failed
- bHaveAbort = true;
- if (wafer.UseCount >= _eDUseWarningLimit)
- {
- _tempFill = _waringFill;
- }
- if (wafer.UseCount >= _eDUseAlarmLimit)
- {
- _tempFill = _alarmFill;
- }
- }
- }
- }
- StockerSlots[i] = $"{_stokcerWaferType[i]}-{waferNumber}/{_cassetteSlot}";
- if (_stokcerWaferType[i].Contains("P"))
- {
- if (waferNumber > 0)
- {
- if (bHaveAbort)
- StockerBackground[i] = _redBk;
- else
- StockerBackground[i] = _productionFill;
- }
- else
- {
- StockerBackground[i] = _WhiteFill;
- }
- }
- else
- {
- if (waferNumber > 0)
- {
- if (bHaveAbort)
- StockerBackground[i] = _redBk;
- else
- {
- StockerBackground[i] = _tempFill;
- }
- }
- else
- {
- StockerBackground[i] = _WhiteFill;
- }
- }
- }
- }
- private void UpdateRecipeProgress()
- {
- if (!IsPM1Process && !IsPM1PostProcess)
- {
- RecipeProgress = "";
- RecipeProgressValue = 0;
- return;
- }
- if (PM1RecipeTotalTime == 0)
- {
- RecipeProgress = "";
- RecipeProgressValue = 0;
- }
- else
- {
- float totalTime = PM1RecipeTotalTime;
- float elapseTime = PM1RecipeTotalElapseTime;
- RecipeProgress = $"{(int)(elapseTime / totalTime * 100)}%";
- RecipeProgressValue = (int)(elapseTime / totalTime * 100);
- }
- }
- public void PopupPage(string page)
- {
- //var windowManager = IoC.Get<IWindowManager>();
- var windowManager = new WindowManager();
- switch (page)
- {
- case "PortStatus":
- //LoadIOPortViewModel portStatusViewModel = new LoadIOPortViewModel();
- //(windowManager as WindowManager)?.ShowDialogWithTitle(portStatusViewModel, null, "Port Status");
- break;
- case "JobStatus":
- JOBStatusViewModel vm = new JOBStatusViewModel();
- //bool? ret = windowManager.ShowDialog(vm);
- (windowManager as WindowManager)?.ShowDialogWithTitle(vm, null, "Job Status View");
- break;
- default:
- break;
- }
- }
- public void StandbyFactor()
- {
- //if (!string.IsNullOrEmpty(PM1MainRecipeName))
- {
- var windowManager = IoC.Get<IWindowManager>();
- StandbyFactorViewModel standbyFactorViewModel = new StandbyFactorViewModel();
- standbyFactorViewModel.MainRecipeName = PM1MainRecipeName;
- (windowManager as WindowManager)?.ShowDialogWithTitle(standbyFactorViewModel, null, "Standby Factor View");
- }
- }
- public void Skip()
- {
- if (!DialogBox.Confirm("Ara you sure to skip current step?"))
- return;
- InvokeClient.Instance.Service.DoOperation($"PM1.RecipeSkipStep", "");
- }
- public void Jump()
- {
- if (!DialogBox.Confirm("Ara you sure to jump current step?"))
- return;
- var recipes = new RecipeDataBase();
- recipes.PrefixPath = "Furnace\\Process";
- recipes.Name = PM1MainRecipeName;
- RecipeProvider _recipeProvider = new RecipeProvider();
- recipes.Clear();
- var recipeContent = _recipeProvider.LoadRecipe(recipes.PrefixPath, recipes.Name);
- if (string.IsNullOrEmpty(recipeContent))
- {
- MessageBox.Show($"{recipes.PrefixPath}\\{recipes.Name} is empty, please confirm the file is valid.");
- return;
- }
- recipes.RecipeChamberType = "OriginChamber";
- recipes.InitData(recipes.PrefixPath, recipes.Name, recipeContent, "PM1");
- var windowManager = IoC.Get<IWindowManager>();
- RecipeLoopSetViewModel recipeLoopSetViewModel = new RecipeLoopSetViewModel();
- recipeLoopSetViewModel.StepNames = new ObservableCollection<string>(recipes.Steps.OrderBy(x => x.StepNo).Where(x => x.StepNo != PM1RecipeStepNumber).Select(x => x.Name).ToList());
- if ((bool)(windowManager as WindowManager)?.ShowDialogWithTitle(recipeLoopSetViewModel, null, "Jump"))
- {
- InvokeClient.Instance.Service.DoOperation($"PM1.RecipeJumpStep", recipeLoopSetViewModel.SelectedIndex);
- }
- }
- public void Hold()
- {
- if (HoldName == "Hold")
- {
- if (!DialogBox.Confirm("Ara you sure to hold current recipe?"))
- return;
- InvokeClient.Instance.Service.DoOperation($"PM1.RecipePause", "");
- }
- else
- {
- InvokeClient.Instance.Service.DoOperation($"PM1.RecipeContinue", "");
- }
- }
- public void EmergencyAbort()
- {
- if (!DialogBox.Confirm("Ara you sure to execute EmergencyAbort?"))
- return;
- InvokeClient.Instance.Service.DoOperation("PM1.Abort");
- }
- }
- }
|