using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Windows; using System.Windows.Input; using Aitex.Core.Common.DeviceData; using Aitex.Core.Util; using Aitex.Core.Utilities; using Aitex.Sorter.Common; using Caliburn.Micro; using MECF.Framework.Common.CommonData; using MECF.Framework.Common.DataCenter; using MECF.Framework.Common.OperationCenter; using MECF.Framework.Common.RecipeCenter; using MECF.Framework.UI.Client.CenterViews.Editors.Sequence; using MECF.Framework.UI.Client.CenterViews.Operations.WaferAssociation; using MECF.Framework.UI.Client.ClientBase; using OpenSEMI.ClientBase; using FurnaceGasPanelUI.Controls.Common; using FurnaceGasPanelUI.Models; namespace FurnaceGasPanelUI.Views { public class EmptyViewModel : ThermalGasPanelUIViewModelBase { #region Property [Subscription("System.IsManualMode")] public bool IsManualMode { get; set; } [Subscription("Robot1.State")] public string Robot1Status { get; set; } [Subscription("Robot1.RobotSpeed")] public int Robot1Speed { get; set; } [Subscription("Robot2.State")] public string Robot2Status { get; set; } [Subscription("Robot2.RobotSpeed")] public int Robot2Speed { get; set; } [Subscription("System.CurrentSelectSequence")] public string SelectedSequence { get; set; } [Subscription("System.TransferCount")] public int ProcessedWaferCount { get; set; } [Subscription("System.TranserThroughput")] public int Througput { get; set; } [Subscription("System.TransferTime")] public int ProcessTime { get; set; } [Subscription("System.TotalWaferCount")] public string TotalWaferCount { get; set; } #region EFEM [Subscription("Aligner.State")] public string AlignerStatus { get; set; } [Subscription("Aligner.WaferSize")] public string AlignerWaferSize { get; set; } [Subscription("WIDReader1.CurrentLaserMark")] public string WIDReader1LaserMark { get; set; } [Subscription("WIDReader1.WIDReaderState")] public string WIDReader1Status { get; set; } [Subscription("Buffer1.Status")] public string Buffer1Status { get; set; } [Subscription("Buffer1.WaferSize")] public string Buffer1WaferSize { get; set; } [Subscription("Buffer2.Status")] public string Buffer2Status { get; set; } [Subscription("Buffer2.WaferSize")] public string Buffer2WaferSize { get; set; } [Subscription("LP1.WaferSize")] public string LP1WaferSize { get; set; } public string WaferSizeLP1 { get { return IsLP1Placed ? GetWaferSize(LP1WaferSize) : "--"; } } [Subscription("LP2.WaferSize")] public string LP2WaferSize { get; set; } public string WaferSizeLP2 { get { return IsLP2Placed ? GetWaferSize(LP2WaferSize) : "--"; } } [Subscription("LP3.WaferSize")] public string LP3WaferSize { get; set; } public string WaferSizeLP3 { get { return IsLP3Placed ? GetWaferSize(LP3WaferSize) : "--"; } } [Subscription("LP4.WaferSize")] public string LP4WaferSize { get; set; } public string WaferSizeLP4 { get { return IsLP4Placed ? GetWaferSize(LP4WaferSize) : "--"; } } [Subscription("LP1.InfoPadCarrierTypeInformation")] public string LP1CarrierInfo { get; set; } [Subscription("LP2.InfoPadCarrierTypeInformation")] public string LP2CarrierInfo { get; set; } private WaferAssociationInfo _lp1WaferAssociation; public WaferAssociationInfo LP1WaferAssociation { get { return _lp1WaferAssociation; } set { _lp1WaferAssociation = value; } } private WaferAssociationInfo _lp2WaferAssociation; public WaferAssociationInfo LP2WaferAssociation { get { return _lp2WaferAssociation; } set { _lp2WaferAssociation = value; } } private WaferAssociationInfo _lp3WaferAssociation; public WaferAssociationInfo LP3WaferAssociation { get { return _lp3WaferAssociation; } set { _lp3WaferAssociation = value; } } private WaferAssociationInfo _lp4WaferAssociation; public WaferAssociationInfo LP4WaferAssociation { get { return _lp4WaferAssociation; } set { _lp4WaferAssociation = value; } } [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("LP3.CassetteState")] public LoadportCassetteState LP3CassetteState { get; set; } [Subscription("LP3.FoupDoorState")] public FoupDoorState LP3DoorState { get; set; } [Subscription("LP4.CassetteState")] public LoadportCassetteState LP4CassetteState { get; set; } [Subscription("LP4.FoupDoorState")] public FoupDoorState LP4DoorState { get; set; } [Subscription("Robot1.RobotMoveInfo")] public RobotMoveInfo EfemRobot1MoveInfo { get; set; } [Subscription("Robot2.RobotMoveInfo")] public RobotMoveInfo EfemRobot2MoveInfo { get; set; } [Subscription("LP1.CarrierId")] public string LP1CarrierId { get; set; } [Subscription("LP2.CarrierId")] public string LP2CarrierId { get; set; } [Subscription("LP3.CarrierId")] public string LP3CarrierId { get; set; } [Subscription("LP1.IsPlaced")] public bool IsLP1Placed { get; set; } public Visibility Foup1Visibility => IsLP1Placed ? Visibility.Visible : Visibility.Hidden; [Subscription("LP1.IsMapped")] public bool IsLP1Mapped { get; set; } public bool IsLP1MapEnable { get { return IsLP1Placed; } } [Subscription("LP1.IsDocked")] public bool IsLP1Docked{get;set;} [Subscription("LP2.IsMapped")] public bool IsLP2Mapped { get; set; } public bool IsLP2MapEnable { get { return IsLP2Placed; } } [Subscription("LP2.IsDocked")] public bool IsLP2Docked { get; set; } [Subscription("LP3.IsMapped")] public bool IsLP3Mapped { get; set; } public bool IsLP3MapEnable { get { return IsLP3Placed; } } [Subscription("LP3.IsDocked")] public bool IsLP3Docked { get; set; } [Subscription("LP4.IsMapped")] public bool IsLP4Mapped { get; set; } public bool IsLP4MapEnable { get { return IsLP4Placed; } } [Subscription("LP4.IsDocked")] public bool IsLP4Docked { get; set; } [Subscription("LP2.IsPlaced")] public bool IsLP2Placed { get; set; } public Visibility Foup2Visibility => IsLP2Placed ? Visibility.Visible : Visibility.Hidden; [Subscription("LP3.IsPlaced")] public bool IsLP3Placed { get; set; } public Visibility Foup3Visibility { get { return IsLP3Placed ? Visibility.Visible : Visibility.Hidden; } } [Subscription("LP4.IsPlaced")] public bool IsLP4Placed { get; set; } public Visibility Foup4Visibility { get { return IsLP4Placed ? Visibility.Visible : Visibility.Hidden; } } public Dictionary StationPosition { get { return new Dictionary() { { "System", new StationPosition() { StartPosition = new RobotPosition() { X=0, Root = 0, Arm = 0, Hand = 0 } ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }} } ,{ "Robot", new StationPosition() { StartPosition = new RobotPosition() { X=0, Root = 0, Arm = 0, Hand = 0 } ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }} } ,{ "LP1", new StationPosition() { StartPosition = new RobotPosition() { X=-330, Root = 180, Arm = 0, Hand = 0 } ,EndPosition = new RobotPosition() { Root = 180, Arm = 0, Hand = 0 }} } ,{ "LP2", new StationPosition() { StartPosition = new RobotPosition() { X=-270, Root = 180, Arm = 0, Hand = 0 } ,EndPosition = new RobotPosition() { Root = 180, Arm = 0, Hand = 0 }} } ,{ "LP3", new StationPosition() { StartPosition = new RobotPosition() { X=-180, Root = 180, Arm = 0, Hand = 0 } ,EndPosition = new RobotPosition() { Root = 180, Arm = 0, Hand = 0 }} } ,{ "LP4", new StationPosition() { StartPosition = new RobotPosition() { X=-310, Root = 0, Arm = 0, Hand = 0 } ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }} } ,{ "LP5", new StationPosition() { StartPosition = new RobotPosition() { X=-240, Root = 0, Arm = 0, Hand = 0 } ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }} } ,{ "LP6", new StationPosition() { StartPosition = new RobotPosition() { X=-170,Root = 0, Arm = 0, Hand = 0 } ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 } } } ,{ "LP7", new StationPosition() { StartPosition = new RobotPosition() { X=-80, Root = 0, Arm = 0, Hand = 0 } ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }} } }; } } public Dictionary StationPosition2 { get { return new Dictionary() { { "System", new StationPosition() { StartPosition = new RobotPosition() { X=0, Root = 0, Arm = 0, Hand = 0 } ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }} } ,{ "Robot", new StationPosition() { StartPosition = new RobotPosition() { X=0, Root = 0, Arm = 0, Hand = 0 } ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }} } ,{ "Station1", new StationPosition() { StartPosition = new RobotPosition() { X=-110, Root = 180, Arm = 0, Hand = 0 } ,EndPosition = new RobotPosition() { Root = 180, Arm = 0, Hand = 0 }} } ,{ "Station2", new StationPosition() { StartPosition = new RobotPosition() { X=-40, Root = 180, Arm = 0, Hand = 0 } ,EndPosition = new RobotPosition() { Root = 180, Arm = 0, Hand = 0 }} } ,{ "Station3", new StationPosition() { StartPosition = new RobotPosition() { X=-80, Root = 0, Arm = 0, Hand = 0 } ,EndPosition = new RobotPosition() { Root = 180, Arm = 0, Hand = 0 }} } }; } } public Dictionary StationPosition3 { get { return new Dictionary() { { "System", new StationPosition() { StartPosition = new RobotPosition() { X=0, Root = 0, Arm = 0, Hand = 0 } ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }} } ,{ "Robot", new StationPosition() { StartPosition = new RobotPosition() { X=0, Root = 0, Arm = 0, Hand = 0 } ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }} } ,{ "Station1", new StationPosition() { StartPosition = new RobotPosition() { X=-50, Root = 0, Arm = 0, Hand = 0 } ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }} } ,{ "Station2", new StationPosition() { StartPosition = new RobotPosition() { X=-100, Root = 0, Arm = 0, Hand = 0 } ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }} } ,{ "Station3", new StationPosition() { StartPosition = new RobotPosition() { X=-260, Root = 0, Arm = 0, Hand = 0 } ,EndPosition = new RobotPosition() { Root = 0, Arm = 0, Hand = 0 }} } }; } } #endregion #region Mainframe [Subscription("PM1.ChamberDoor.OpenFeedback")] public bool PM1SlitValveOpenFeedback { get; set; } [Subscription("PM1.ChamberDoor.CloseFeedback")] public bool PM1SlitValveCloseFeedback { get; set; } public bool IsPM1SlitValveOpen { get { if (PM1SlitValveOpenFeedback && !PM1SlitValveCloseFeedback) return true; else if (!PM1SlitValveOpenFeedback && PM1SlitValveCloseFeedback) return false; else return false; } } [Subscription("PM2.ChamberDoor.OpenFeedback")] public bool PM2SlitValveOpenFeedback { get; set; } [Subscription("PM2.ChamberDoor.CloseFeedback")] public bool PM2SlitValveCloseFeedback { get; set; } public bool IsPM2SlitValveOpen { get { if (PM2SlitValveOpenFeedback && !PM2SlitValveCloseFeedback) return true; else if (!PM2SlitValveOpenFeedback && PM2SlitValveCloseFeedback) return false; else return false; } } public FoupDoorState PM1DoorState { get { return FoupDoorState.Open; } } public FoupDoorState PM2DoorState { get { if (PM2SlitValveOpenFeedback && !PM2SlitValveCloseFeedback) return FoupDoorState.Open; if (!PM2SlitValveOpenFeedback && PM2SlitValveCloseFeedback) return FoupDoorState.Close; return FoupDoorState.Unknown; } } [Subscription("EFEM.Status")] public string EFEMStatus { get; set; } [Subscription("LP1.Status")] public string LP1Status { get; set; } [Subscription("LP2.Status")] public string LP2Status { get; set; } [Subscription("LP3.Status")] public string LP3Status { get; set; } [Subscription("LP4.Status")] public string LP4Status { get; set; } #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; } 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 $"{PM1RecipeStepElapseTime}/{PM1RecipeStepTime}"; } } public string PM1RecipeTime { get { if (!IsPM1Process && !IsPM1PostProcess) return "--"; return $"{PM1RecipeTotalElapseTime}/{PM1RecipeTotalTime}"; } } [Subscription("PM1.SelectedRecipeName")] public string PM1SelectedRecipeName { get; set; } public string PM1SelectedRecipeNameDisplay { get { if (string.IsNullOrEmpty(PM1SelectedRecipeName)) return string.Empty; return PM1SelectedRecipeName.Substring("Furnace\\Process\\".Length); } } [Subscription("PM1.ChamberPressure.DeviceData")] public AITPressureMeterData PM1ChamberPressure { get; set; } [Subscription("PM1.ChamberMonitorPressure.DeviceData")] public AITPressureMeterData PM1ChamberMonitorPressure { get; set; } [Subscription("PM1.VacuumSensorValve.DeviceData")] public AITValveData PM1VacuumSensorValve { get; set; } public string PM1ChamberRealPressure { get { float value = 1.0f; //float value = (float)PM1ChamberMonitorPressure.FeedBack; //if (value < 3.0 && PM1VacuumSensorValve.IsOpen) // value = (float)PM1ChamberPressure.FeedBack; return $"{value:F3}"; } } [Subscription("PM1.ChamberHeater.DeviceData")] public AITHeaterData PM1ChamberHeaterData { get; set; } [Subscription("PM1.IsOnline")] public bool PM1IsOnline { get; set; } public bool PM1IsOffline { get { return !PM1IsOnline; } } [Subscription("PM2.IsOnline")] public bool PM2IsOnline { get; set; } public bool PM2IsOffline { get { return !PM2IsOnline; } } [Subscription("PM2.Status")] public string PM2Status { get; set; } [Subscription("PM2.RecipeStepName")] public string PM2RecipeStepName { get; set; } [Subscription("PM2.RecipeStepNumber")] public int PM2RecipeStepNumber { get; set; } [Subscription("PM2.RecipeStepElapseTime")] public int PM2RecipeStepElapseTime { get; set; } [Subscription("PM2.RecipeStepTime")] public int PM2RecipeStepTime { get; set; } [Subscription("PM2.RecipeTotalElapseTime")] public int PM2RecipeTotalElapseTime { get; set; } [Subscription("PM2.RecipeTotalTime")] public int PM2RecipeTotalTime { get; set; } public bool IsPM2Idle { get { return PM2Status == "Idle"; } } public bool IsPM2Process { get { return PM2Status == "Process"; } } public bool IsPM2PostProcess { get { return PM2Status == "PostProcess"; } } public bool IsPM2PreProcess { get { return PM2Status == "PreProcess"; } } public string PM2StepNumber { get { if (!IsPM2Process && !IsPM2PostProcess) return "--"; return $"{PM2RecipeStepNumber}"; } } public string PM2StepName { get { if (!IsPM2Process && !IsPM2PostProcess) return "--"; return $"{PM2RecipeStepName}"; } } public string PM2StepTime { get { if (!IsPM2Process && !IsPM2PostProcess) return "--"; return $"{PM2RecipeStepElapseTime}/{PM2RecipeStepTime}"; } } public string PM2RecipeTime { get { if (!IsPM2Process && !IsPM2PostProcess) return "--"; return $"{PM2RecipeTotalElapseTime}/{PM2RecipeTotalTime}"; } } [Subscription("PM2.SelectedRecipeName")] public string PM2SelectedRecipeName { get; set; } public string PM2SelectedRecipeNameDisplay { get { if (string.IsNullOrEmpty(PM2SelectedRecipeName)) return string.Empty; return PM2SelectedRecipeName.Substring("Furnace\\Process\\".Length); } } [Subscription("PM2.ChamberPressure.DeviceData")] public AITPressureMeterData PM2ChamberPressure { get; set; } [Subscription("PM2.ChamberMonitorPressure.DeviceData")] public AITPressureMeterData PM2ChamberMonitorPressure { get; set; } [Subscription("PM2.VacuumSensorValve.DeviceData")] public AITValveData PM2VacuumSensorValve { get; set; } public string PM2ChamberRealPressure { get { float value = 1.0f; //float value = (float)PM2ChamberMonitorPressure.FeedBack; //if (value < 3.0 && PM2VacuumSensorValve.IsOpen) // value = (float)PM2ChamberPressure.FeedBack; return $"{value:F3}"; } } [Subscription("PM2.ChamberHeater.DeviceData")] public AITHeaterData PM2ChamberHeaterData { get; set; } #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.CycledTime")] public int TotalCycledTime { get; set; } public string TotalCycledProduction { get => CycledWafer + "/" + TotalCycledTime; } [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}"; } } [Subscription("PlatformCycle.CycledCount")] public int PlatformCycledCount { get; set; } [Subscription("PlatformCycle.CycledWafer")] public int PlatformCycledWafer { get; set; } [Subscription("PlatformCycle.CycleSetPoint")] public int PlatformCycleSetPoint { get; set; } public string PlatformCycleCountDisplay { get { return (PlatformCycleSetPoint > 0 && (PlatformCycledCount > PlatformCycleSetPoint)) ? $"{PlatformCycledCount + 1}/{PlatformCycleSetPoint}" : $"{PlatformCycledCount}/{PlatformCycleSetPoint}"; } } [Subscription("LP1.Thickness")] public string LP1Thickness { get; set; } [Subscription("LP2.Thickness")] public string LP2Thickness { get; set; } [Subscription("LP3.Thickness")] public string LP3Thickness { get; set; } [Subscription("LP4.Thickness")] public string LP4Thickness { get; set; } [Subscription("LP1.LocalJobName")] public string LP1JobName { get; set; } [Subscription("LP1.LocalJobStatus")] public string LP1JobStatus { get; set; } [Subscription("LP2.LocalJobName")] public string LP2JobName { get; set; } [Subscription("LP2.LocalJobStatus")] public string LP2JobStatus { get; set; } [Subscription("LP3.LocalJobName")] public string LP3JobName { get; set; } [Subscription("LP3.LocalJobStatus")] public string LP3JobStatus { get; set; } [Subscription("LP4.LocalJobName")] public string LP4JobName { get; set; } [Subscription("LP4.LocalJobStatus")] public string LP4JobStatus { get; set; } //Queued,Selected,WaitingForStart,Executing,Paused,Completed, public bool IsLP1JobExecuting { get { return LP1JobStatus == "Executing"; } } public bool IsLP1JobPaused { get { return LP1JobStatus == "Paused"; } } public bool IsLP1JobExist { get { return !string.IsNullOrEmpty(LP1JobStatus); } } public bool IsLP2JobExecuting { get { return LP2JobStatus == "Executing"; } } public bool IsLP2JobPaused { get { return LP2JobStatus == "Paused"; } } public bool IsLP2JobExist { get { return !string.IsNullOrEmpty(LP2JobStatus); } } public bool IsLP3JobExecuting { get { return LP3JobStatus == "Executing"; } } public bool IsLP3JobPaused { get { return LP3JobStatus == "Paused"; } } public bool IsLP3JobExist { get { return !string.IsNullOrEmpty(LP3JobStatus); } } public bool IsLP4JobExecuting { get { return LP4JobStatus == "Executing"; } } public bool IsLP4JobPaused { get { return LP4JobStatus == "Paused"; } } public bool IsLP4JobExist { get { return !string.IsNullOrEmpty(LP4JobStatus); } } #endregion #region Button Logic [Subscription("LP1.IsAutoDetectCarrierType")] public bool LP1IsAutoDetectCarrierType { get; set; } [Subscription("LP2.IsAutoDetectCarrierType")] public bool LP2IsAutoDetectCarrierType { get; set; } [Subscription("LP1.ValidCarrierTypeList")] public Tuple[] LP1ValidCarrierTypeList { get; set; } [Subscription("LP2.ValidCarrierTypeList")] public Tuple[] LP2ValidCarrierTypeList { get; set; } public bool IsShowLP1CarrierType { get { return !LP1IsAutoDetectCarrierType; } } public bool IsShowLP2CarrierType { get { return !LP2IsAutoDetectCarrierType; } } public bool IsEnableJobLP1 { get { return IsAuto && LP1CassetteState == LoadportCassetteState.Normal; } } public bool IsEnableReadIdLP1 { get { return LP1CassetteState == LoadportCassetteState.Normal && !IsLP1JobExecuting && !IsLP1JobPaused; } } public bool IsEnableLoadLP1 { get { return LP1CassetteState == LoadportCassetteState.Normal && !IsLP1JobExecuting && !IsLP1JobPaused; } } public bool IsEnableUnloadLP1 { get { return LP1CassetteState == LoadportCassetteState.Normal && !IsLP1JobExecuting && !IsLP1JobPaused; } } public bool IsEnableJobLP2 { get { return IsAuto && LP2CassetteState == LoadportCassetteState.Normal; } } public bool IsEnableReadIdLP2 { get { return LP2CassetteState == LoadportCassetteState.Normal && !IsLP2JobExecuting && !IsLP2JobPaused; } } public bool IsEnableLoadLP2 { get { return LP2CassetteState == LoadportCassetteState.Normal && !IsLP2JobExecuting && !IsLP2JobPaused; } } public bool IsEnableUnloadLP2 { get { return LP2CassetteState == LoadportCassetteState.Normal && !IsLP2JobExecuting && !IsLP2JobPaused; } } public bool IsEnableJobLP3 { get { return IsAuto && LP3CassetteState == LoadportCassetteState.Normal; } } public bool IsEnableReadIdLP3 { get { return LP3CassetteState == LoadportCassetteState.Normal && !IsLP3JobExecuting && !IsLP3JobPaused; } } public bool IsEnableLoadLP3 { get { return LP3CassetteState == LoadportCassetteState.Normal && !IsLP3JobExecuting && !IsLP3JobPaused; } } public bool IsEnableUnloadLP3 { get { return LP3CassetteState == LoadportCassetteState.Normal && !IsLP3JobExecuting && !IsLP3JobPaused; } } public bool IsEnableJobLP4 { get { return IsAuto && LP4CassetteState == LoadportCassetteState.Normal; } } public bool IsEnableReadIdLP4 { get { return LP4CassetteState == LoadportCassetteState.Normal && !IsLP4JobExecuting && !IsLP4JobPaused; } } public bool IsEnableLoadLP4 { get { return LP4CassetteState == LoadportCassetteState.Normal && !IsLP4JobExecuting && !IsLP4JobPaused; } } public bool IsEnableUnloadLP4 { get { return LP4CassetteState == LoadportCassetteState.Normal && !IsLP4JobExecuting && !IsLP4JobPaused; } } public bool IsEnableAbort { get { if (IsAuto) return IsLP1JobExist || IsLP2JobExist || IsLP3JobExist; return IsRtRunning && !IsRtError; } } public bool IsEnableAuto { get { return !IsAuto && IsRtInitialized && !IsRtError; } } public bool IsEnableManual { get { return IsAuto && IsRtInitialized && !IsLP1JobExist && !IsLP2JobExist && !IsLP3JobExist && !IsRtError; } } public bool IsEnableInitialize { get { return !IsAuto && !IsRtRunning && !IsRtError; } } public bool IsEnableReturnWafer { get { return !IsAuto && !IsRtRunning && IsRtInitialized && !IsRtError; } } public Visibility ThicknessVisibility { get; set; } #endregion #endregion public EmptyViewModel() { this.DisplayName = "EmptyViewModel"; //ActiveUpdateData = true; } //[IgnorePropertyChange] //public string LP1CarrierIDSetPoint { get; set; } [IgnorePropertyChange] public string LP2CarrierIDSetPoint { get; set; } protected override void OnInitialize() { base.OnInitialize(); base.InitFOUP(); base.InitLL(); base.InitTM(); base.InitEFEM(); base.InitPM(); base.InitBuffer(); } private void LP2SetCarrierID(string obj) { InvokeClient.Instance.Service.DoOperation($"LP2.ManualSetCarrierID", new object[] { obj }); } public ICommand LP1SetCarrierIDCommand { get; set; } public ICommand LP2SetCarrierIDCommand { get; set; } public ICommand SetTransCarrierTypeCommand { get; set; } protected override void OnActivate() { base.OnActivate(); _isCycleMode = (bool)QueryDataClient.Instance.Service.GetConfig("System.IsCycleMode"); } public void Start() { InvokeClient.Instance.Service.DoOperation("System.StartAutoRun"); } public void Stop() { //InvokeClient.Instance.Service.DoOperation("System.StartAutoRun"); } public void ReturnAllWafer() { InvokeClient.Instance.Service.DoOperation("System.ReturnAllWafer"); } public void PlatformCycle() { InvokeClient.Instance.Service.DoOperation("System.PlatformCycle"); } public void StopPlatformCycle() { InvokeClient.Instance.Service.DoOperation("System.StopPlatformCycle"); } public void QuickStartProcess() { InvokeClient.Instance.Service.DoOperation("System.QuickStartProcss", null); } public void PP_Select() { SequenceDialogViewModel dialog = new SequenceDialogViewModel(); dialog.DisplayName = "Select Sequence"; dialog.Files = new ObservableCollection(RecipeSequenceTreeBuilder.GetFiles("", RecipeClient.Instance.Service.GetSequenceNameList() )); WindowManager wm = new WindowManager(); bool? bret = wm.ShowDialog(dialog); if ((bool)bret) { InvokeClient.Instance.Service.DoOperation("System.SelectSequence",new object[] { dialog.DialogResult }); } } protected override void InvokeAfterUpdateProperty(Dictionary data) { if (LP1WaferAssociation == null) { LP1WaferAssociation = new WaferAssociationInfo(); LP1WaferAssociation.ModuleData = ModuleManager.ModuleInfos["LP1"]; } if (LP2WaferAssociation == null) { LP2WaferAssociation = new WaferAssociationInfo(); LP2WaferAssociation.ModuleData = ModuleManager.ModuleInfos["LP2"]; } if (LP1WaferAssociation.ModuleData == null || LP2WaferAssociation.ModuleData == null) return; LP1WaferAssociation.JobID = LP1JobName; LP1WaferAssociation.JobStatus = LP1JobStatus; LP2WaferAssociation.JobID = LP2JobName; LP2WaferAssociation.JobStatus = LP2JobStatus; 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 = ""; } } //Trace.WriteLine($" RobotMoveInfo, action:{TmRobotMoveInfo.Action} armTarget:{TmRobotMoveInfo.ArmTarget} bladeTarget:{TmRobotMoveInfo.BladeTarget}"); } #region LP Operation private string GetWaferSize(string size) { switch (size) { case "WS4": return "4'"; case "WS6": return "6'"; default: return ""; } } public void SetLP1CarrierID(string carrierID) { InvokeClient.Instance.Service.DoOperation($"LP1.LoadportLoad",new object[] { carrierID}); } public void SetLP2CarrierID(string carrierID) { InvokeClient.Instance.Service.DoOperation($"LP2.LoadportLoad", new object[] { carrierID }); } public void LoadLP(string moduleID) { InvokeClient.Instance.Service.DoOperation($"{moduleID}.LoadportLoad"); } public void ReadCarrierId(string moduleID) { InvokeClient.Instance.Service.DoOperation($"{moduleID}.ReadCarrierID"); } public void UnloadLP(string moduleID) { InvokeClient.Instance.Service.DoOperation($"{moduleID}.LoadportUnload"); } public void SetThickness(string moduleID, string thickness) { InvokeClient.Instance.Service.DoOperation($"{moduleID}.SetThickness", thickness); } public void Map(string module) { InvokeClient.Instance.Service.DoOperation($"System.MapWafer", module); } public void HomeAll() { InvokeClient.Instance.Service.DoOperation("System.HomeAll"); //InvokeClient.Instance.Service.DoOperation("PM1.Handshake.SetHandshakeCommand", "HMI.InitializeCommand", true); //InvokeClient.Instance.Service.DoOperation("PM2.Handshake.SetHandshakeCommand", "HMI.InitializeCommand", true); //InvokeClient.Instance.Service.DoOperation("PM3.Handshake.SetHandshakeCommand", "HMI.InitializeCommand", true); } public void Abort() { InvokeClient.Instance.Service.DoOperation("System.Abort"); } public void Auto() { InvokeClient.Instance.Service.DoOperation("System.SetAutoMode"); } public void Pause() { InvokeClient.Instance.Service.DoOperation("System.PauseJob"); } public void Resume() { InvokeClient.Instance.Service.DoOperation("System.ResumeJob"); } public void Manual() { InvokeClient.Instance.Service.DoOperation("System.SetManualMode"); } public void Buffer1Move() { InvokeClient.Instance.Service.DoOperation("Buffer1.Move"); } public void Buffer2To200() { InvokeClient.Instance.Service.DoOperation("Buffer2.MoveTo200"); } public void Buffer2To300() { InvokeClient.Instance.Service.DoOperation("Buffer2.MoveTo300"); } public void Buffer2Home() { InvokeClient.Instance.Service.DoOperation("Buffer2.Home"); } public void Buffer2PickDone() { InvokeClient.Instance.Service.DoOperation("Buffer2.PickDone"); } public void AlignerMoveTo200() { InvokeClient.Instance.Service.DoOperation($"Aligner.SetWaferSize", new object[] { "Lower", "WS8" }); } public void AlignerMoveTo300() { InvokeClient.Instance.Service.DoOperation($"Aligner.SetWaferSize", new object[] { "Lower", "WS12" }); } #endregion #region Wafer association #region Sequence operation public void SelectSequence(WaferAssociationInfo info) { SequenceDialogViewModel dialog = new SequenceDialogViewModel(); dialog.DisplayName = "Select Sequence"; dialog.Files = new ObservableCollection(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) { info.SlotFrom = 1; info.SlotTo = 25; AssociateSequence(info, true); } public void DeselectAll(WaferAssociationInfo info) { 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) { ObservableCollection wafers = info.ModuleData.WaferManager.Wafers; if (slot >= 0) //by wafer { int index = wafers.Count - slot - 1; if (index < wafers.Count) { if (flag && HasWaferOnSlot(wafers.ToList(), 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.ToList(), index)) wafers[index].SequenceName = info.SequenceName; else wafers[index].SequenceName = string.Empty; } } } } private bool HasWaferOnSlot(List wafers, int index) { if (wafers[index].WaferStatus == 0) return false; return true; } #endregion #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) { List slotSequence = new List(); foreach (var wafer in info.ModuleData.WaferManager.Wafers) { slotSequence.Insert(0, wafer.SequenceName); } string jobId = info.LotId.Trim(); if (string.IsNullOrEmpty(jobId)) jobId = "CJ_Local_" + info.ModuleData.ModuleID; //info.LotId = "test"; info.LotIdSaved = true; //WaferAssociationProvider.Instance.CreateJob(jobId, info.ModuleData.ModuleID, slotSequence, true); } public void AbortJob(string jobID) { if (JobCheck(jobID)) WaferAssociationProvider.Instance.AbortJob(jobID); } public void Start(string jobID) { if (JobCheck(jobID)) WaferAssociationProvider.Instance.Start(jobID); } public void Pause(string jobID) { if (JobCheck(jobID)) WaferAssociationProvider.Instance.Pause(jobID); } public void Resume(string jobID) { if (JobCheck(jobID)) WaferAssociationProvider.Instance.Resume(jobID); } public void Stop(string jobID) { if (JobCheck(jobID)) WaferAssociationProvider.Instance.Stop(jobID); } public void StartDispatchMode() { InvokeClient.Instance.Service.DoOperation("System.StartDispatchMode"); } #endregion #endregion } }