123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074 |
- 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<SlotItem> SlotNoList { get; set; } = new ObservableCollection<SlotItem>();
- public string LoadJobPara { get; set; }
- public ObservableCollection<CarrierMaterialInformation> CarrierMItemList { get; set; } = new ObservableCollection<CarrierMaterialInformation>();
- public ObservableCollection<CarrierMaterialInformation> CarrierM1ItemList { get; set; } = new ObservableCollection<CarrierMaterialInformation>();
- public ObservableCollection<CarrierMaterialInformation> CarrierM2ItemList { get; set; } = new ObservableCollection<CarrierMaterialInformation>();
- public ObservableCollection<CarrierMaterialInformation> CarrierSDItemList { get; set; } = new ObservableCollection<CarrierMaterialInformation>();
- public ObservableCollection<CarrierMaterialInformation> CarrierEDItemList { get; set; } = new ObservableCollection<CarrierMaterialInformation>();
- public ObservableCollection<CarrierMaterialInformation> CarrierPItemList { get; set; } = new ObservableCollection<CarrierMaterialInformation>();
- public ObservableCollection<CarrierMaterialInformation> CarrierAllItemList { get; set; } = new ObservableCollection<CarrierMaterialInformation>();
- public ObservableCollection<CarrierInfo> CarrierDataNameList { get; set; } = new ObservableCollection<CarrierInfo>();
- public ObservableCollection<CarrierInfo> M1Carrierlist = new ObservableCollection<CarrierInfo>();
- public ObservableCollection<CarrierInfo> M2Carrierlist = new ObservableCollection<CarrierInfo>();
- public ObservableCollection<CarrierInfo> SDCarrierlist = new ObservableCollection<CarrierInfo>();
- public ObservableCollection<CarrierInfo> EDCarrierlist = new ObservableCollection<CarrierInfo>();
- public ObservableCollection<CarrierInfo> PCarrierlist = new ObservableCollection<CarrierInfo>();
- public ObservableCollection<CarrierInfo> AllCarrierlist = new ObservableCollection<CarrierInfo>();
- public ObservableCollection<CarrierInfo> Carrierlist = new ObservableCollection<CarrierInfo>();
- 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<string, object> 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<string, object> param = new Dictionary<string, object>()
- {
- {"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<string, object> 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();
- }
- }
- }
|