using Aitex.Core.Util; using DocumentFormat.OpenXml.Drawing; using FurnaceUI.Common; using FurnaceUI.Models; using MECF.Framework.Common.DataCenter; using MECF.Framework.Common.OperationCenter; using MECF.Framework.Common.SubstrateTrackings; using OpenSEMI.ClientBase; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Net.Sockets; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; using System.Windows; namespace FurnaceUI.Views.Jobs { public class LoadJOBUnLoadViewModel : FurnaceModuleUIViewModelBase { public bool IsExecuteRTCommand { get; set; } = true; public bool IsPChecked { get; set; } = true; public bool IsSDChecked { get; set; } = false; public bool IsEDChecked { get; set; } = false; public bool IsMChecked { get; set; } = false; public bool IsM1Checked { get; set; } = false; public bool IsM2Checked { get; set; } = false; public Visibility IsWaferTypeExceptPVisible => IsExecuteRTCommand ? Visibility.Visible : Visibility.Collapsed; public Visibility PTypeRadioButtonVisibility { get; set; } public Visibility MTypeRadioButtonVisibility { get; set; } public Visibility SDTypeRadioButtonVisibility { get; set; } public Visibility EDTypeRadioButtonVisibility { get; set; } public LoadJOBUnLoadViewModel() { } [Subscription("Stocker1.LotID")] public string Stocker1LotID { get; set; } [Subscription("Stocker2.LotID")] public string Stocker2LotID { get; set; } [Subscription("Stocker3.LotID")] public string Stocker3LotID { get; set; } [Subscription("Stocker4.LotID")] public string Stocker4LotID { get; set; } [Subscription("Stocker5.LotID")] public string Stocker5LotID { get; set; } [Subscription("Stocker6.LotID")] public string Stocker6LotID { get; set; } [Subscription("Stocker7.LotID")] public string Stocker7LotID { get; set; } [Subscription("Stocker8.LotID")] public string Stocker8LotID { get; set; } [Subscription("Stocker9.LotID")] public string Stocker9LotID { get; set; } [Subscription("Stocker10.LotID")] public string Stocker10LotID { get; set; } [Subscription("Stocker11.LotID")] public string Stocker11LotID { get; set; } [Subscription("Stocker12.LotID")] public string Stocker12LotID { get; set; } [Subscription("Stocker13.LotID")] public string Stocker13LotID { get; set; } [Subscription("Stocker14.LotID")] public string Stocker14LotID { get; set; } [Subscription("Stocker15.LotID")] public string Stocker15LotID { get; set; } [Subscription("Stocker16.LotID")] public string Stocker16LotID { get; set; } [Subscription("Stocker17.LotID")] public string Stocker17LotID { get; set; } [Subscription("Stocker18.LotID")] public string Stocker18LotID { get; set; } #region Stocker Carrier Info [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; } [Subscription("Stocker19.Carrier")] public CarrierInfo Stocker19CarrierData { get; set; } [Subscription("Stocker20.Carrier")] public CarrierInfo Stocker20CarrierData { get; set; } [Subscription("Stocker21.Carrier")] public CarrierInfo Stocker21CarrierData { get; set; } #endregion private int _stockValue; public int StockValue { get => _stockValue; set { _stockValue = value; NotifyOfPropertyChange("StockValue"); } } public string ExecCommand { get; set; } public bool IsStockNumberChangeButtonVisible { get; set; } = true; public bool IsLotIDInputEnable { get; set; } = true; private Visibility _pTypeVisibility = Visibility.Visible; public Visibility PTypeVisibility { get => _pTypeVisibility; set { _pTypeVisibility = value; NotifyOfPropertyChange("PTypeVisibility"); } } private Visibility _sdTypeVisibility = Visibility.Hidden; public Visibility SDTypeVisibility { get => _sdTypeVisibility; set { _sdTypeVisibility = value; NotifyOfPropertyChange("SDTypeVisibility"); } } private Visibility _edTypeVisibility = Visibility.Hidden; public Visibility EDTypeVisibility { get => _edTypeVisibility; set { _edTypeVisibility = value; NotifyOfPropertyChange("EDTypeVisibility"); } } private Visibility _m2TypeVisibility = Visibility.Hidden; public Visibility M2TypeVisibility { get => _m2TypeVisibility; set { _m2TypeVisibility = value; NotifyOfPropertyChange("M2TypeVisibility"); } } private Visibility _mTypeVisibility = Visibility.Hidden; public Visibility MTypeVisibility { get => _mTypeVisibility; set { _mTypeVisibility = value; NotifyOfPropertyChange("MTypeVisibility"); } } private Visibility _m1TypeVisibility = Visibility.Hidden; public Visibility M1TypeVisibility { get => _m1TypeVisibility; set { _m1TypeVisibility = value; NotifyOfPropertyChange("M1TypeVisibility"); } } private Visibility _allTypeVisibility = Visibility.Hidden; public Visibility AllTypeVisibility { get => _allTypeVisibility; set { _allTypeVisibility = value; NotifyOfPropertyChange("AllTypeVisibility"); } } private string _WaferType = "P"; public string WaferType { get => _WaferType; set { _WaferType = value; NotifyOfPropertyChange(nameof(WaferType)); } } private string _batchType = "P"; public int point1Count { get; set; } public int point2Count { get; set; } public int point3Count { get; set; } public int point4Count { get; set; } public int point5Count { get; set; } public int point6Count { get; set; } public int point7Count { get; set; } public int point8Count { get; set; } public int point9Count { get; set; } public int point10Count { get; set; } public int point11Count { get; set; } public int point12Count { get; set; } public int point13Count { get; set; } public int point14Count { get; set; } public int point15Count { get; set; } public int point16Count { get; set; } public int point17Count { get; set; } public int point18Count { get; set; } public int point19Count { get; set; } public int point20Count { get; set; } public int point21Count { get; set; } public ObservableCollection SlotNoList { get; set; } = new ObservableCollection(); public string LoadJobPara { get; set; } public ObservableCollection CarrierMItemList { get; set; } = new ObservableCollection(); public ObservableCollection CarrierM1ItemList { get; set; } = new ObservableCollection(); public ObservableCollection CarrierM2ItemList { get; set; } = new ObservableCollection(); public ObservableCollection CarrierSDItemList { get; set; } = new ObservableCollection(); public ObservableCollection CarrierEDItemList { get; set; } = new ObservableCollection(); public ObservableCollection CarrierPItemList { get; set; } = new ObservableCollection(); public ObservableCollection CarrierAllItemList { get; set; } = new ObservableCollection(); public ObservableCollection CarrierDataNameList { get; set; } = new ObservableCollection(); public ObservableCollection M1Carrierlist = new ObservableCollection(); public ObservableCollection M2Carrierlist = new ObservableCollection(); public ObservableCollection SDCarrierlist = new ObservableCollection(); public ObservableCollection EDCarrierlist = new ObservableCollection(); public ObservableCollection PCarrierlist = new ObservableCollection(); public ObservableCollection AllCarrierlist = new ObservableCollection(); public ObservableCollection Carrierlist = new ObservableCollection(); protected override void OnInitialize() { base.OnInitialize(); for (int i = 0; i < 25; i++) { SlotNoList.Add(new SlotItem() { SlotNoEnable = false, SlotNoExist = "None" }); } } public void SlotNoCheck(string SlotNo) { switch (SlotNo) { case "1": point1Count++; if (point1Count % 2 == 0) { SlotNoList[0].SlotNoEnable = false; } else { SlotNoList[0].SlotNoEnable = true; } break; case "2": point2Count++; if (point2Count % 2 == 0) { SlotNoList[1].SlotNoEnable = false; } else { SlotNoList[1].SlotNoEnable = true; } break; case "3": point3Count++; if (point3Count % 2 == 0) { SlotNoList[2].SlotNoEnable = false; } else { SlotNoList[2].SlotNoEnable = true; } break; case "4": point4Count++; if (point4Count % 2 == 0) { SlotNoList[3].SlotNoEnable = false; } else { SlotNoList[3].SlotNoEnable = true; } break; case "5": point5Count++; if (point5Count % 2 == 0) { SlotNoList[4].SlotNoEnable = false; } else { SlotNoList[4].SlotNoEnable = true; } break; case "6": point6Count++; if (point6Count % 2 == 0) { SlotNoList[5].SlotNoEnable = false; } else { SlotNoList[5].SlotNoEnable = true; } break; case "7": point7Count++; if (point7Count % 2 == 0) { SlotNoList[6].SlotNoEnable = false; } else { SlotNoList[6].SlotNoEnable = true; } break; case "8": point8Count++; if (point8Count % 2 == 0) { SlotNoList[7].SlotNoEnable = false; } else { SlotNoList[7].SlotNoEnable = true; } break; case "9": point9Count++; if (point9Count % 2 == 0) { SlotNoList[8].SlotNoEnable = false; } else { SlotNoList[8].SlotNoEnable = true; } break; case "10": point10Count++; if (point10Count % 2 == 0) { SlotNoList[9].SlotNoEnable = false; } else { SlotNoList[9].SlotNoEnable = true; } break; case "11": point11Count++; if (point11Count % 2 == 0) { SlotNoList[10].SlotNoEnable = false; } else { SlotNoList[10].SlotNoEnable = true; } break; case "12": point12Count++; if (point12Count % 2 == 0) { SlotNoList[11].SlotNoEnable = false; } else { SlotNoList[11].SlotNoEnable = true; } break; case "13": point13Count++; if (point13Count % 2 == 0) { SlotNoList[12].SlotNoEnable = false; } else { SlotNoList[12].SlotNoEnable = true; } break; case "14": point14Count++; if (point14Count % 2 == 0) { SlotNoList[13].SlotNoEnable = false; } else { SlotNoList[13].SlotNoEnable = true; } break; case "15": point15Count++; if (point15Count % 2 == 0) { SlotNoList[14].SlotNoEnable = false; } else { SlotNoList[14].SlotNoEnable = true; } break; case "16": point16Count++; if (point16Count % 2 == 0) { SlotNoList[15].SlotNoEnable = false; } else { SlotNoList[15].SlotNoEnable = true; } break; case "17": point17Count++; if (point17Count % 2 == 0) { SlotNoList[16].SlotNoEnable = false; } else { SlotNoList[16].SlotNoEnable = true; } break; case "18": point18Count++; if (point18Count % 2 == 0) { SlotNoList[17].SlotNoEnable = false; } else { SlotNoList[17].SlotNoEnable = true; } break; case "19": point19Count++; if (point19Count % 2 == 0) { SlotNoList[18].SlotNoEnable = false; } else { SlotNoList[18].SlotNoEnable = true; } break; case "20": point20Count++; if (point20Count % 2 == 0) { SlotNoList[19].SlotNoEnable = false; } else { SlotNoList[19].SlotNoEnable = true; } break; case "21": point21Count++; if (point21Count % 2 == 0) { SlotNoList[20].SlotNoEnable = false; } else { SlotNoList[20].SlotNoEnable = true; } break; } } protected override void OnViewLoaded(object view) { base.OnViewLoaded(view); StockerCarrier(); M1Carrierlist.Clear(); M2Carrierlist.Clear(); EDCarrierlist.Clear(); SDCarrierlist.Clear(); PCarrierlist.Clear(); for (int i = 0; i < CarrierDataNameList.Count; i++) { string configType = (string)QueryDataClient.Instance.Service.GetConfig($"System.Stocker.Stocker{CarrierDataNameList[i].StockerIndex}WaferType"); var boolNoneAndM1 = CarrierType.None.ToString().Equals(configType) && CarrierType.M1.Equals(CarrierDataNameList[i].CarrierType); var boolNoneAndM2 = CarrierType.None.ToString().Equals(configType) && CarrierType.M2.Equals(CarrierDataNameList[i].CarrierType); var boolNoneAndSD = CarrierType.None.ToString().Equals(configType) && CarrierType.SD.Equals(CarrierDataNameList[i].CarrierType); var boolNoneAndED = CarrierType.None.ToString().Equals(configType) && CarrierType.ED.Equals(CarrierDataNameList[i].CarrierType); var boolNoneAndP = CarrierType.None.ToString().Equals(configType) && CarrierDataNameList[i].CarrierType.ToString().StartsWith( CarrierType.P.ToString()); //如果自身是M1类型或者自身是None类型但是创建了M1类型的Carrier 则添加到对应的集合中; 其余逻辑一致 if (CarrierType.M1.ToString().Equals(configType) || boolNoneAndM1) { CarrierDataNameList[i].CarrierType = CarrierType.M1; M1Carrierlist.Add(CarrierDataNameList[i]); } if (CarrierType.M2.ToString().Equals(configType) || boolNoneAndM2) { CarrierDataNameList[i].CarrierType = CarrierType.M2; M2Carrierlist.Add(CarrierDataNameList[i]); } if (CarrierType.ED.ToString().Equals(configType) || boolNoneAndED) { CarrierDataNameList[i].CarrierType = CarrierType.ED; EDCarrierlist.Add(CarrierDataNameList[i]); } if (CarrierType.SD.ToString().Equals(configType) || boolNoneAndSD) { CarrierDataNameList[i].CarrierType = CarrierType.SD; SDCarrierlist.Add(CarrierDataNameList[i]); } if (configType.StartsWith(CarrierType.P.ToString())|| boolNoneAndP) { CarrierDataNameList[i].CarrierType = CarrierType.P; PCarrierlist.Add(CarrierDataNameList[i]); } AllCarrierlist.Add(CarrierDataNameList[i]); } WaferTypeSelect(WaferType); } public void StockerCarrier() { CarrierDataNameList.Clear(); if (Stocker1CarrierData != null) { Stocker1CarrierData.StockerIndex = 1; CarrierDataNameList.Add(Stocker1CarrierData); } if (Stocker2CarrierData != null) { Stocker2CarrierData.StockerIndex = 2; CarrierDataNameList.Add(Stocker2CarrierData); } if (Stocker3CarrierData != null) { Stocker3CarrierData.StockerIndex = 3; CarrierDataNameList.Add(Stocker3CarrierData); } if (Stocker4CarrierData != null) { Stocker4CarrierData.StockerIndex = 4; CarrierDataNameList.Add(Stocker4CarrierData); } if (Stocker5CarrierData != null) { Stocker5CarrierData.StockerIndex = 5; CarrierDataNameList.Add(Stocker5CarrierData); } if (Stocker6CarrierData != null) { Stocker6CarrierData.StockerIndex = 6; CarrierDataNameList.Add(Stocker6CarrierData); } if (Stocker7CarrierData != null) { Stocker7CarrierData.StockerIndex = 7; CarrierDataNameList.Add(Stocker7CarrierData); } if (Stocker8CarrierData != null) { Stocker8CarrierData.StockerIndex = 8; CarrierDataNameList.Add(Stocker8CarrierData); } if (Stocker9CarrierData != null) { Stocker9CarrierData.StockerIndex = 9; CarrierDataNameList.Add(Stocker9CarrierData); } if (Stocker10CarrierData != null) { Stocker10CarrierData.StockerIndex = 10; CarrierDataNameList.Add(Stocker10CarrierData); } if (Stocker11CarrierData != null) { Stocker11CarrierData.StockerIndex = 11; CarrierDataNameList.Add(Stocker11CarrierData); } if (Stocker12CarrierData != null) { Stocker12CarrierData.StockerIndex = 12; CarrierDataNameList.Add(Stocker12CarrierData); } if (Stocker13CarrierData != null) { Stocker13CarrierData.StockerIndex = 13; CarrierDataNameList.Add(Stocker13CarrierData); } if (Stocker14CarrierData != null) { Stocker14CarrierData.StockerIndex = 14; CarrierDataNameList.Add(Stocker14CarrierData); } if (Stocker15CarrierData != null) { Stocker15CarrierData.StockerIndex = 15; CarrierDataNameList.Add(Stocker15CarrierData); } if (Stocker16CarrierData != null) { Stocker16CarrierData.StockerIndex = 16; CarrierDataNameList.Add(Stocker16CarrierData); } if (Stocker17CarrierData != null) { Stocker17CarrierData.StockerIndex = 17; CarrierDataNameList.Add(Stocker17CarrierData); } if (Stocker18CarrierData != null) { Stocker18CarrierData.StockerIndex = 18; CarrierDataNameList.Add(Stocker18CarrierData); } } protected override void OnViewReady(object view) { base.OnViewReady(view); if (WaferType == "P") Carrierlist = PCarrierlist; if (WaferType == "SD") Carrierlist = SDCarrierlist; if (WaferType == "ED") Carrierlist = EDCarrierlist; if (WaferType == "M1") Carrierlist = M1Carrierlist; if (WaferType == "M2") Carrierlist = M2Carrierlist; CarrierPItemList.Clear(); CarrierSDItemList.Clear(); CarrierEDItemList.Clear(); CarrierMItemList.Clear(); CarrierM1ItemList.Clear(); CarrierM2ItemList.Clear(); for (int i = 0; i < Carrierlist.Count; i++) { if ((bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker{Carrierlist[i].StockerIndex}Installed")) continue; CarrierMaterialInformation carrierInfo = new CarrierMaterialInformation(); carrierInfo.No = $"{Carrierlist[i].StockerIndex}"; carrierInfo.ModuleName = $"Stocker{Carrierlist[i].StockerIndex}"; carrierInfo.CarrierType = $"{WaferType}"; carrierInfo.CarrierId = Carrierlist[i].CarrierId; carrierInfo.WaferCount = Carrierlist[i].WaferCount.ToString(); carrierInfo.StockerCarrierEnable = CarrierDataNameList[Carrierlist[i].StockerIndex - 1].IsEmpty ? false : true; carrierInfo.WaferStauts = Carrierlist[i].Status.ToString(); if (WaferType == "P") CarrierPItemList.Add(carrierInfo); if (WaferType == "SD") CarrierSDItemList.Add(carrierInfo); if (WaferType == "ED") CarrierEDItemList.Add(carrierInfo); if (WaferType == "M1") CarrierM1ItemList.Add(carrierInfo); if (WaferType == "M2") CarrierM2ItemList.Add(carrierInfo); } } public void WaferTypeSelect(string type) { var waferTypeList = QueryDataClient.Instance.Service.GetConfigItemList().Where(m => m.Name.StartsWith(ConstantsCommon.Stocker)).ToList(); switch (type) { case "P": StockValue = waferTypeList.Where(n => n.Value.ToString().Contains(CarrierType.P.ToString())).Count(); WaferType = CarrierType.P.ToString(); PTypeVisibility = Visibility.Visible; SDTypeVisibility = Visibility.Collapsed; EDTypeVisibility = Visibility.Collapsed; M1TypeVisibility = Visibility.Collapsed; M2TypeVisibility = Visibility.Collapsed; AllTypeVisibility = Visibility.Collapsed; CarrierPItemList.Clear(); for (int i = 0; i < PCarrierlist.Count; i++) { CarrierMaterialInformation carrierInfo = new CarrierMaterialInformation(); carrierInfo.No = $"{PCarrierlist[i].StockerIndex}"; carrierInfo.ModuleName = $"Stocker{PCarrierlist[i].StockerIndex}"; carrierInfo.CarrierType = PCarrierlist[i].CarrierType.ToString(); carrierInfo.CarrierId = PCarrierlist[i].CarrierId; carrierInfo.WaferCount = PCarrierlist[i].WaferCount.ToString(); carrierInfo.StockerCarrierEnable = PCarrierlist[i].IsEmpty ? false : true; carrierInfo.WaferStauts = PCarrierlist[i].Status.ToString(); CarrierPItemList.Add(carrierInfo); } break; case "SD": StockValue = waferTypeList.Where(n => n.Value.ToString().Contains(CarrierType.SD.ToString())).Count(); WaferType = CarrierType.SD.ToString(); PTypeVisibility = Visibility.Collapsed; SDTypeVisibility = Visibility.Visible; EDTypeVisibility = Visibility.Collapsed; M1TypeVisibility = Visibility.Collapsed; M2TypeVisibility = Visibility.Collapsed; AllTypeVisibility = Visibility.Collapsed; CarrierSDItemList.Clear(); for (int i = 0; i < SDCarrierlist.Count; i++) { CarrierMaterialInformation carrierInfo = new CarrierMaterialInformation(); carrierInfo.No = $"{SDCarrierlist[i].StockerIndex}"; carrierInfo.ModuleName = $"Stocker{SDCarrierlist[i].StockerIndex}"; carrierInfo.CarrierType = SDCarrierlist[i].CarrierType.ToString(); carrierInfo.CarrierId = SDCarrierlist[i].CarrierId; carrierInfo.WaferCount = SDCarrierlist[i].WaferCount.ToString(); carrierInfo.StockerCarrierEnable = SDCarrierlist[i].IsEmpty ? false : true; carrierInfo.WaferStauts = SDCarrierlist[i].Status.ToString(); CarrierSDItemList.Add(carrierInfo); } break; case "ED": StockValue = waferTypeList.Where(n => n.Value.ToString().Contains(CarrierType.ED.ToString())).Count(); WaferType = CarrierType.ED.ToString(); PTypeVisibility = Visibility.Collapsed; SDTypeVisibility = Visibility.Collapsed; EDTypeVisibility = Visibility.Visible; M1TypeVisibility = Visibility.Collapsed; M2TypeVisibility = Visibility.Collapsed; AllTypeVisibility = Visibility.Collapsed; CarrierEDItemList.Clear(); for (int i = 0; i < EDCarrierlist.Count; i++) { CarrierMaterialInformation carrierInfo = new CarrierMaterialInformation(); carrierInfo.No = $"{EDCarrierlist[i].StockerIndex}"; ; carrierInfo.ModuleName = $"Stocker{EDCarrierlist[i].StockerIndex}"; carrierInfo.CarrierType = EDCarrierlist[i].CarrierType.ToString(); carrierInfo.CarrierId = EDCarrierlist[i].CarrierId; carrierInfo.WaferCount = EDCarrierlist[i].WaferCount.ToString(); carrierInfo.StockerCarrierEnable = EDCarrierlist[i].IsEmpty ? false : true; carrierInfo.WaferStauts = EDCarrierlist[i].Status.ToString(); CarrierEDItemList.Add(carrierInfo); } break; case "M1": StockValue = waferTypeList.Where(n => n.Value.ToString().Equals(CarrierType.M1.ToString())).Count(); WaferType = CarrierType.M1.ToString(); PTypeVisibility = Visibility.Collapsed; SDTypeVisibility = Visibility.Collapsed; EDTypeVisibility = Visibility.Collapsed; M1TypeVisibility = Visibility.Visible; M2TypeVisibility = Visibility.Collapsed; AllTypeVisibility = Visibility.Collapsed; CarrierM1ItemList.Clear(); for (int i = 0; i < M1Carrierlist.Count; i++) { string StockerNo = (string)QueryDataClient.Instance.Service.GetConfig($"System.StockerDisplayName.Stocker{M1Carrierlist[i].StockerIndex}"); CarrierMaterialInformation carrierInfo = new CarrierMaterialInformation(); carrierInfo.No = $"{M1Carrierlist[i].StockerIndex}"; ; carrierInfo.ModuleName = $"Stocker{M1Carrierlist[i].StockerIndex}"; carrierInfo.CarrierType = M1Carrierlist[i].CarrierType.ToString(); carrierInfo.CarrierId = M1Carrierlist[i].CarrierId; carrierInfo.WaferCount = M1Carrierlist[i].WaferCount.ToString(); carrierInfo.StockerCarrierEnable = CarrierDataNameList[M1Carrierlist[i].StockerIndex - 1].IsEmpty ? false : true; carrierInfo.WaferStauts = M1Carrierlist[i].Status.ToString(); CarrierM1ItemList.Add(carrierInfo); } break; case "M2": StockValue = waferTypeList.Where(n => n.Value.ToString().Equals(CarrierType.M2.ToString())).Count(); WaferType = CarrierType.M2.ToString(); PTypeVisibility = Visibility.Collapsed; SDTypeVisibility = Visibility.Collapsed; EDTypeVisibility = Visibility.Collapsed; M1TypeVisibility = Visibility.Collapsed; M2TypeVisibility = Visibility.Visible; AllTypeVisibility = Visibility.Collapsed; CarrierM2ItemList.Clear(); for (int i = 0; i < M2Carrierlist.Count; i++) { CarrierMaterialInformation carrierInfo = new CarrierMaterialInformation(); carrierInfo.No = $"{M2Carrierlist[i].StockerIndex}"; carrierInfo.ModuleName = $"Stocker{M2Carrierlist[i].StockerIndex}"; carrierInfo.CarrierType = M2Carrierlist[i].CarrierType.ToString(); carrierInfo.CarrierId = M2Carrierlist[i].CarrierId; carrierInfo.WaferCount = M2Carrierlist[i].WaferCount.ToString(); carrierInfo.StockerCarrierEnable = M2Carrierlist[i].IsEmpty ? false : true; carrierInfo.WaferStauts = M2Carrierlist[i].Status.ToString(); CarrierM2ItemList.Add(carrierInfo); } break; case "All": PTypeVisibility = Visibility.Collapsed; SDTypeVisibility = Visibility.Collapsed; EDTypeVisibility = Visibility.Collapsed; M1TypeVisibility = Visibility.Collapsed; M2TypeVisibility = Visibility.Collapsed; AllTypeVisibility = Visibility.Visible; CarrierAllItemList.Clear(); for (int i = 0; i < AllCarrierlist.Count; i++) { CarrierMaterialInformation carrierInfo = new CarrierMaterialInformation(); carrierInfo.No = $"{AllCarrierlist[i].StockerIndex}"; carrierInfo.ModuleName = $"Stocker{AllCarrierlist[i].StockerIndex}"; carrierInfo.CarrierType = AllCarrierlist[i].CarrierType.ToString(); carrierInfo.CarrierId = AllCarrierlist[i].CarrierId; carrierInfo.WaferCount = AllCarrierlist[i].WaferCount.ToString(); carrierInfo.StockerCarrierEnable = AllCarrierlist[i].IsEmpty ? false : true; carrierInfo.WaferStauts = AllCarrierlist[i].Status.ToString(); CarrierAllItemList.Add(carrierInfo); } break; default: break; } } public void LoadPortCheck(string StockerName, string LPName) { string LoadJobPara1, LoadJobPara2, LoadJobPara3, LoadJobPara4, LoadJobPara5, LoadJobPara6, LoadJobPara7, LoadJobPara8, LoadJobPara9, LoadJobPara10, LoadJobPara11, LoadJobPara12, LoadJobPara13, LoadJobPara14, LoadJobPara15, LoadJobPara16, LoadJobPara17, LoadJobPara18, LoadJobPara19, LoadJobPara20, LoadJobPara21; switch (StockerName) { case "Stocker1": LoadJobPara1 = StockerName + "," + LPName + ";"; if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName)) { this.LoadPortSelect(StockerName, LoadJobPara1); } else LoadJobPara += LoadJobPara1; break; case "Stocker2": LoadJobPara2 = StockerName + "," + LPName + ";"; if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName)) { this.LoadPortSelect(StockerName, LoadJobPara2); } else LoadJobPara += LoadJobPara2; break; case "Stocker3": LoadJobPara3 = StockerName + "," + LPName + ";"; if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName)) { this.LoadPortSelect(StockerName, LoadJobPara3); } else LoadJobPara += LoadJobPara3; break; case "Stocker4": LoadJobPara4 = StockerName + "," + LPName + ";"; if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName)) { this.LoadPortSelect(StockerName, LoadJobPara4); } else LoadJobPara += LoadJobPara4; break; case "Stocker5": LoadJobPara5 = StockerName + "," + LPName + ";"; if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName)) { this.LoadPortSelect(StockerName, LoadJobPara5); } else LoadJobPara += LoadJobPara5; break; case "Stocker6": LoadJobPara6 = StockerName + "," + LPName + ";"; if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName)) { this.LoadPortSelect(StockerName, LoadJobPara6); } else LoadJobPara += LoadJobPara6; break; case "Stocker7": LoadJobPara7 = StockerName + "," + LPName + ";"; if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName)) { this.LoadPortSelect(StockerName, LoadJobPara7); } else LoadJobPara += LoadJobPara7; break; case "Stocker8": LoadJobPara8 = StockerName + "," + LPName + ";"; if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName)) { this.LoadPortSelect(StockerName, LoadJobPara8); } else LoadJobPara += LoadJobPara8; break; case "Stocker9": LoadJobPara9 = StockerName + "," + LPName + ";"; if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName)) { this.LoadPortSelect(StockerName, LoadJobPara9); } else LoadJobPara += LoadJobPara9; break; case "Stocker10": LoadJobPara10 = StockerName + "," + LPName + ";"; if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName)) { this.LoadPortSelect(StockerName, LoadJobPara10); } else LoadJobPara += LoadJobPara10; break; case "Stocker11": LoadJobPara11 = StockerName + "," + LPName + ";"; if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName)) { this.LoadPortSelect(StockerName, LoadJobPara11); } else LoadJobPara += LoadJobPara11; break; case "Stocker12": LoadJobPara12 = StockerName + "," + LPName + ";"; if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName)) { this.LoadPortSelect(StockerName, LoadJobPara12); } else LoadJobPara += LoadJobPara12; break; case "Stocker13": LoadJobPara13 = StockerName + "," + LPName + ";"; if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName)) { this.LoadPortSelect(StockerName, LoadJobPara13); } else LoadJobPara += LoadJobPara13; break; case "Stocker14": LoadJobPara14 = StockerName + "," + LPName + ";"; if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName)) { this.LoadPortSelect(StockerName, LoadJobPara14); } else LoadJobPara += LoadJobPara14; break; case "Stocker15": LoadJobPara15 = StockerName + "," + LPName + ";"; if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName)) { this.LoadPortSelect(StockerName, LoadJobPara15); } else LoadJobPara += LoadJobPara15; break; case "Stocker16": LoadJobPara16 = StockerName + "," + LPName + ";"; if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName)) { this.LoadPortSelect(StockerName, LoadJobPara16); } else LoadJobPara += LoadJobPara16; break; case "Stocker17": LoadJobPara17 = StockerName + "," + LPName + ";"; if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName)) { this.LoadPortSelect(StockerName, LoadJobPara17); } else LoadJobPara += LoadJobPara17; break; case "Stocker18": LoadJobPara18 = StockerName + "," + LPName + ";"; if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName)) { this.LoadPortSelect(StockerName, LoadJobPara18); } else LoadJobPara += LoadJobPara18; break; case "Stocker19": LoadJobPara19 = StockerName + "," + LPName + ";"; if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName)) { this.LoadPortSelect(StockerName, LoadJobPara19); } else LoadJobPara += LoadJobPara19; break; case "Stocker20": LoadJobPara20 = StockerName + "," + LPName + ";"; if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName)) { this.LoadPortSelect(StockerName, LoadJobPara20); } else LoadJobPara += LoadJobPara20; break; case "Stocker21": LoadJobPara21 = StockerName + "," + LPName + ";"; if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName)) { this.LoadPortSelect(StockerName, LoadJobPara21); } else LoadJobPara += LoadJobPara21; break; } } public void LoadPortSelect(string StockerName, string LoadJobPara1) { string[] StockArray = LoadJobPara.Split(';'); string para = ""; foreach (var item in StockArray) { if (item.Contains(StockerName)) { para = LoadJobPara.Replace(item + ";", LoadJobPara1); } } LoadJobPara = para; } protected override void InvokeAfterUpdateProperty(Dictionary data) { base.InvokeAfterUpdateProperty(data); StockerCarrier(); //InitialPortName(IsBatchAChecked ? "P1" : "P2"); } public void EXECCmd(string cmdPar) { if (string.IsNullOrEmpty(LoadJobPara)) { DialogBox.ShowWarning("Load job parameter is empty,please select loadport number!"); return; } if (!DialogBox.Confirm("Are you sure to accept?")) return; //string para = "Stocker1,LP1;Stocker2,LP2"; Dictionary param = new Dictionary() { {"WaferType", WaferType }, {"CarrierPara", LoadJobPara.TrimEnd(';')}, {"TransferType", "Unloading"}, }; SetValueToSC(param); if (IsExecuteRTCommand) { InvokeClient.Instance.Service.DoOperation($"System.{ExecCommand}", param); } ((Window)GetView()).DialogResult = true; } private void SetValueToSC(Dictionary param) { foreach (var item in param.Keys) { InvokeClient.Instance.Service.DoOperation($"System.SetConfig", $"System.Job.JOBUnLoad.{item}", param[item]); } } public void ClosedCmd(string cmdPar) { (GetView() as Window).Close(); } } }