LoadJOBUnLoadViewModel.cs 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074
  1. using Aitex.Core.Util;
  2. using DocumentFormat.OpenXml.Drawing;
  3. using FurnaceUI.Common;
  4. using FurnaceUI.Models;
  5. using MECF.Framework.Common.DataCenter;
  6. using MECF.Framework.Common.OperationCenter;
  7. using MECF.Framework.Common.SubstrateTrackings;
  8. using OpenSEMI.ClientBase;
  9. using System;
  10. using System.Collections.Generic;
  11. using System.Collections.ObjectModel;
  12. using System.Linq;
  13. using System.Net.Sockets;
  14. using System.Text;
  15. using System.Text.RegularExpressions;
  16. using System.Threading.Tasks;
  17. using System.Windows;
  18. namespace FurnaceUI.Views.Jobs
  19. {
  20. public class LoadJOBUnLoadViewModel : FurnaceModuleUIViewModelBase
  21. {
  22. public bool IsExecuteRTCommand { get; set; } = true;
  23. public bool IsPChecked { get; set; } = true;
  24. public bool IsSDChecked { get; set; } = false;
  25. public bool IsEDChecked { get; set; } = false;
  26. public bool IsMChecked { get; set; } = false;
  27. public bool IsM1Checked { get; set; } = false;
  28. public bool IsM2Checked { get; set; } = false;
  29. public Visibility IsWaferTypeExceptPVisible => IsExecuteRTCommand ? Visibility.Visible : Visibility.Collapsed;
  30. public Visibility PTypeRadioButtonVisibility { get; set; }
  31. public Visibility MTypeRadioButtonVisibility { get; set; }
  32. public Visibility SDTypeRadioButtonVisibility { get; set; }
  33. public Visibility EDTypeRadioButtonVisibility { get; set; }
  34. public LoadJOBUnLoadViewModel()
  35. {
  36. }
  37. [Subscription("Stocker1.LotID")]
  38. public string Stocker1LotID { get; set; }
  39. [Subscription("Stocker2.LotID")]
  40. public string Stocker2LotID { get; set; }
  41. [Subscription("Stocker3.LotID")]
  42. public string Stocker3LotID { get; set; }
  43. [Subscription("Stocker4.LotID")]
  44. public string Stocker4LotID { get; set; }
  45. [Subscription("Stocker5.LotID")]
  46. public string Stocker5LotID { get; set; }
  47. [Subscription("Stocker6.LotID")]
  48. public string Stocker6LotID { get; set; }
  49. [Subscription("Stocker7.LotID")]
  50. public string Stocker7LotID { get; set; }
  51. [Subscription("Stocker8.LotID")]
  52. public string Stocker8LotID { get; set; }
  53. [Subscription("Stocker9.LotID")]
  54. public string Stocker9LotID { get; set; }
  55. [Subscription("Stocker10.LotID")]
  56. public string Stocker10LotID { get; set; }
  57. [Subscription("Stocker11.LotID")]
  58. public string Stocker11LotID { get; set; }
  59. [Subscription("Stocker12.LotID")]
  60. public string Stocker12LotID { get; set; }
  61. [Subscription("Stocker13.LotID")]
  62. public string Stocker13LotID { get; set; }
  63. [Subscription("Stocker14.LotID")]
  64. public string Stocker14LotID { get; set; }
  65. [Subscription("Stocker15.LotID")]
  66. public string Stocker15LotID { get; set; }
  67. [Subscription("Stocker16.LotID")]
  68. public string Stocker16LotID { get; set; }
  69. [Subscription("Stocker17.LotID")]
  70. public string Stocker17LotID { get; set; }
  71. [Subscription("Stocker18.LotID")]
  72. public string Stocker18LotID { get; set; }
  73. #region Stocker Carrier Info
  74. [Subscription("Stocker1.Carrier")]
  75. public CarrierInfo Stocker1CarrierData { get; set; }
  76. [Subscription("Stocker2.Carrier")]
  77. public CarrierInfo Stocker2CarrierData { get; set; }
  78. [Subscription("Stocker3.Carrier")]
  79. public CarrierInfo Stocker3CarrierData { get; set; }
  80. [Subscription("Stocker4.Carrier")]
  81. public CarrierInfo Stocker4CarrierData { get; set; }
  82. [Subscription("Stocker5.Carrier")]
  83. public CarrierInfo Stocker5CarrierData { get; set; }
  84. [Subscription("Stocker6.Carrier")]
  85. public CarrierInfo Stocker6CarrierData { get; set; }
  86. [Subscription("Stocker7.Carrier")]
  87. public CarrierInfo Stocker7CarrierData { get; set; }
  88. [Subscription("Stocker8.Carrier")]
  89. public CarrierInfo Stocker8CarrierData { get; set; }
  90. [Subscription("Stocker9.Carrier")]
  91. public CarrierInfo Stocker9CarrierData { get; set; }
  92. [Subscription("Stocker10.Carrier")]
  93. public CarrierInfo Stocker10CarrierData { get; set; }
  94. [Subscription("Stocker11.Carrier")]
  95. public CarrierInfo Stocker11CarrierData { get; set; }
  96. [Subscription("Stocker12.Carrier")]
  97. public CarrierInfo Stocker12CarrierData { get; set; }
  98. [Subscription("Stocker13.Carrier")]
  99. public CarrierInfo Stocker13CarrierData { get; set; }
  100. [Subscription("Stocker14.Carrier")]
  101. public CarrierInfo Stocker14CarrierData { get; set; }
  102. [Subscription("Stocker15.Carrier")]
  103. public CarrierInfo Stocker15CarrierData { get; set; }
  104. [Subscription("Stocker16.Carrier")]
  105. public CarrierInfo Stocker16CarrierData { get; set; }
  106. [Subscription("Stocker17.Carrier")]
  107. public CarrierInfo Stocker17CarrierData { get; set; }
  108. [Subscription("Stocker18.Carrier")]
  109. public CarrierInfo Stocker18CarrierData { get; set; }
  110. [Subscription("Stocker19.Carrier")]
  111. public CarrierInfo Stocker19CarrierData { get; set; }
  112. [Subscription("Stocker20.Carrier")]
  113. public CarrierInfo Stocker20CarrierData { get; set; }
  114. [Subscription("Stocker21.Carrier")]
  115. public CarrierInfo Stocker21CarrierData { get; set; }
  116. #endregion
  117. private int _stockValue;
  118. public int StockValue
  119. {
  120. get => _stockValue;
  121. set
  122. {
  123. _stockValue = value;
  124. NotifyOfPropertyChange("StockValue");
  125. }
  126. }
  127. public string ExecCommand { get; set; }
  128. public bool IsStockNumberChangeButtonVisible { get; set; } = true;
  129. public bool IsLotIDInputEnable { get; set; } = true;
  130. private Visibility _pTypeVisibility = Visibility.Visible;
  131. public Visibility PTypeVisibility
  132. {
  133. get => _pTypeVisibility;
  134. set
  135. {
  136. _pTypeVisibility = value;
  137. NotifyOfPropertyChange("PTypeVisibility");
  138. }
  139. }
  140. private Visibility _sdTypeVisibility = Visibility.Hidden;
  141. public Visibility SDTypeVisibility
  142. {
  143. get => _sdTypeVisibility;
  144. set
  145. {
  146. _sdTypeVisibility = value;
  147. NotifyOfPropertyChange("SDTypeVisibility");
  148. }
  149. }
  150. private Visibility _edTypeVisibility = Visibility.Hidden;
  151. public Visibility EDTypeVisibility
  152. {
  153. get => _edTypeVisibility;
  154. set
  155. {
  156. _edTypeVisibility = value;
  157. NotifyOfPropertyChange("EDTypeVisibility");
  158. }
  159. }
  160. private Visibility _m2TypeVisibility = Visibility.Hidden;
  161. public Visibility M2TypeVisibility
  162. {
  163. get => _m2TypeVisibility;
  164. set
  165. {
  166. _m2TypeVisibility = value;
  167. NotifyOfPropertyChange("M2TypeVisibility");
  168. }
  169. }
  170. private Visibility _mTypeVisibility = Visibility.Hidden;
  171. public Visibility MTypeVisibility
  172. {
  173. get => _mTypeVisibility;
  174. set
  175. {
  176. _mTypeVisibility = value;
  177. NotifyOfPropertyChange("MTypeVisibility");
  178. }
  179. }
  180. private Visibility _m1TypeVisibility = Visibility.Hidden;
  181. public Visibility M1TypeVisibility
  182. {
  183. get => _m1TypeVisibility;
  184. set
  185. {
  186. _m1TypeVisibility = value;
  187. NotifyOfPropertyChange("M1TypeVisibility");
  188. }
  189. }
  190. private Visibility _allTypeVisibility = Visibility.Hidden;
  191. public Visibility AllTypeVisibility
  192. {
  193. get => _allTypeVisibility;
  194. set
  195. {
  196. _allTypeVisibility = value;
  197. NotifyOfPropertyChange("AllTypeVisibility");
  198. }
  199. }
  200. private string _WaferType = "P";
  201. public string WaferType
  202. {
  203. get => _WaferType;
  204. set
  205. {
  206. _WaferType = value;
  207. NotifyOfPropertyChange(nameof(WaferType));
  208. }
  209. }
  210. private string _batchType = "P";
  211. public int point1Count { get; set; }
  212. public int point2Count { get; set; }
  213. public int point3Count { get; set; }
  214. public int point4Count { get; set; }
  215. public int point5Count { get; set; }
  216. public int point6Count { get; set; }
  217. public int point7Count { get; set; }
  218. public int point8Count { get; set; }
  219. public int point9Count { get; set; }
  220. public int point10Count { get; set; }
  221. public int point11Count { get; set; }
  222. public int point12Count { get; set; }
  223. public int point13Count { get; set; }
  224. public int point14Count { get; set; }
  225. public int point15Count { get; set; }
  226. public int point16Count { get; set; }
  227. public int point17Count { get; set; }
  228. public int point18Count { get; set; }
  229. public int point19Count { get; set; }
  230. public int point20Count { get; set; }
  231. public int point21Count { get; set; }
  232. public ObservableCollection<SlotItem> SlotNoList { get; set; } = new ObservableCollection<SlotItem>();
  233. public string LoadJobPara { get; set; }
  234. public ObservableCollection<CarrierMaterialInformation> CarrierMItemList { get; set; } = new ObservableCollection<CarrierMaterialInformation>();
  235. public ObservableCollection<CarrierMaterialInformation> CarrierM1ItemList { get; set; } = new ObservableCollection<CarrierMaterialInformation>();
  236. public ObservableCollection<CarrierMaterialInformation> CarrierM2ItemList { get; set; } = new ObservableCollection<CarrierMaterialInformation>();
  237. public ObservableCollection<CarrierMaterialInformation> CarrierSDItemList { get; set; } = new ObservableCollection<CarrierMaterialInformation>();
  238. public ObservableCollection<CarrierMaterialInformation> CarrierEDItemList { get; set; } = new ObservableCollection<CarrierMaterialInformation>();
  239. public ObservableCollection<CarrierMaterialInformation> CarrierPItemList { get; set; } = new ObservableCollection<CarrierMaterialInformation>();
  240. public ObservableCollection<CarrierMaterialInformation> CarrierAllItemList { get; set; } = new ObservableCollection<CarrierMaterialInformation>();
  241. public ObservableCollection<CarrierInfo> CarrierDataNameList { get; set; } = new ObservableCollection<CarrierInfo>();
  242. public ObservableCollection<CarrierInfo> M1Carrierlist = new ObservableCollection<CarrierInfo>();
  243. public ObservableCollection<CarrierInfo> M2Carrierlist = new ObservableCollection<CarrierInfo>();
  244. public ObservableCollection<CarrierInfo> SDCarrierlist = new ObservableCollection<CarrierInfo>();
  245. public ObservableCollection<CarrierInfo> EDCarrierlist = new ObservableCollection<CarrierInfo>();
  246. public ObservableCollection<CarrierInfo> PCarrierlist = new ObservableCollection<CarrierInfo>();
  247. public ObservableCollection<CarrierInfo> AllCarrierlist = new ObservableCollection<CarrierInfo>();
  248. public ObservableCollection<CarrierInfo> Carrierlist = new ObservableCollection<CarrierInfo>();
  249. protected override void OnInitialize()
  250. {
  251. base.OnInitialize();
  252. for (int i = 0; i < 25; i++)
  253. {
  254. SlotNoList.Add(new SlotItem() { SlotNoEnable = false, SlotNoExist = "None" });
  255. }
  256. }
  257. public void SlotNoCheck(string SlotNo)
  258. {
  259. switch (SlotNo)
  260. {
  261. case "1":
  262. point1Count++;
  263. if (point1Count % 2 == 0)
  264. {
  265. SlotNoList[0].SlotNoEnable = false;
  266. }
  267. else
  268. {
  269. SlotNoList[0].SlotNoEnable = true;
  270. }
  271. break;
  272. case "2":
  273. point2Count++;
  274. if (point2Count % 2 == 0)
  275. {
  276. SlotNoList[1].SlotNoEnable = false;
  277. }
  278. else
  279. {
  280. SlotNoList[1].SlotNoEnable = true;
  281. }
  282. break;
  283. case "3":
  284. point3Count++;
  285. if (point3Count % 2 == 0)
  286. {
  287. SlotNoList[2].SlotNoEnable = false;
  288. }
  289. else
  290. {
  291. SlotNoList[2].SlotNoEnable = true;
  292. }
  293. break;
  294. case "4":
  295. point4Count++;
  296. if (point4Count % 2 == 0)
  297. {
  298. SlotNoList[3].SlotNoEnable = false;
  299. }
  300. else
  301. {
  302. SlotNoList[3].SlotNoEnable = true;
  303. }
  304. break;
  305. case "5":
  306. point5Count++;
  307. if (point5Count % 2 == 0)
  308. {
  309. SlotNoList[4].SlotNoEnable = false;
  310. }
  311. else
  312. {
  313. SlotNoList[4].SlotNoEnable = true;
  314. }
  315. break;
  316. case "6":
  317. point6Count++;
  318. if (point6Count % 2 == 0)
  319. {
  320. SlotNoList[5].SlotNoEnable = false;
  321. }
  322. else
  323. {
  324. SlotNoList[5].SlotNoEnable = true;
  325. }
  326. break;
  327. case "7":
  328. point7Count++;
  329. if (point7Count % 2 == 0)
  330. {
  331. SlotNoList[6].SlotNoEnable = false;
  332. }
  333. else
  334. {
  335. SlotNoList[6].SlotNoEnable = true;
  336. }
  337. break;
  338. case "8":
  339. point8Count++;
  340. if (point8Count % 2 == 0)
  341. {
  342. SlotNoList[7].SlotNoEnable = false;
  343. }
  344. else
  345. {
  346. SlotNoList[7].SlotNoEnable = true;
  347. }
  348. break;
  349. case "9":
  350. point9Count++;
  351. if (point9Count % 2 == 0)
  352. {
  353. SlotNoList[8].SlotNoEnable = false;
  354. }
  355. else
  356. {
  357. SlotNoList[8].SlotNoEnable = true;
  358. }
  359. break;
  360. case "10":
  361. point10Count++;
  362. if (point10Count % 2 == 0)
  363. {
  364. SlotNoList[9].SlotNoEnable = false;
  365. }
  366. else
  367. {
  368. SlotNoList[9].SlotNoEnable = true;
  369. }
  370. break;
  371. case "11":
  372. point11Count++;
  373. if (point11Count % 2 == 0)
  374. {
  375. SlotNoList[10].SlotNoEnable = false;
  376. }
  377. else
  378. {
  379. SlotNoList[10].SlotNoEnable = true;
  380. }
  381. break;
  382. case "12":
  383. point12Count++;
  384. if (point12Count % 2 == 0)
  385. {
  386. SlotNoList[11].SlotNoEnable = false;
  387. }
  388. else
  389. {
  390. SlotNoList[11].SlotNoEnable = true;
  391. }
  392. break;
  393. case "13":
  394. point13Count++;
  395. if (point13Count % 2 == 0)
  396. {
  397. SlotNoList[12].SlotNoEnable = false;
  398. }
  399. else
  400. {
  401. SlotNoList[12].SlotNoEnable = true;
  402. }
  403. break;
  404. case "14":
  405. point14Count++;
  406. if (point14Count % 2 == 0)
  407. {
  408. SlotNoList[13].SlotNoEnable = false;
  409. }
  410. else
  411. {
  412. SlotNoList[13].SlotNoEnable = true;
  413. }
  414. break;
  415. case "15":
  416. point15Count++;
  417. if (point15Count % 2 == 0)
  418. {
  419. SlotNoList[14].SlotNoEnable = false;
  420. }
  421. else
  422. {
  423. SlotNoList[14].SlotNoEnable = true;
  424. }
  425. break;
  426. case "16":
  427. point16Count++;
  428. if (point16Count % 2 == 0)
  429. {
  430. SlotNoList[15].SlotNoEnable = false;
  431. }
  432. else
  433. {
  434. SlotNoList[15].SlotNoEnable = true;
  435. }
  436. break;
  437. case "17":
  438. point17Count++;
  439. if (point17Count % 2 == 0)
  440. {
  441. SlotNoList[16].SlotNoEnable = false;
  442. }
  443. else
  444. {
  445. SlotNoList[16].SlotNoEnable = true;
  446. }
  447. break;
  448. case "18":
  449. point18Count++;
  450. if (point18Count % 2 == 0)
  451. {
  452. SlotNoList[17].SlotNoEnable = false;
  453. }
  454. else
  455. {
  456. SlotNoList[17].SlotNoEnable = true;
  457. }
  458. break;
  459. case "19":
  460. point19Count++;
  461. if (point19Count % 2 == 0)
  462. {
  463. SlotNoList[18].SlotNoEnable = false;
  464. }
  465. else
  466. {
  467. SlotNoList[18].SlotNoEnable = true;
  468. }
  469. break;
  470. case "20":
  471. point20Count++;
  472. if (point20Count % 2 == 0)
  473. {
  474. SlotNoList[19].SlotNoEnable = false;
  475. }
  476. else
  477. {
  478. SlotNoList[19].SlotNoEnable = true;
  479. }
  480. break;
  481. case "21":
  482. point21Count++;
  483. if (point21Count % 2 == 0)
  484. {
  485. SlotNoList[20].SlotNoEnable = false;
  486. }
  487. else
  488. {
  489. SlotNoList[20].SlotNoEnable = true;
  490. }
  491. break;
  492. }
  493. }
  494. protected override void OnViewLoaded(object view)
  495. {
  496. base.OnViewLoaded(view);
  497. StockerCarrier();
  498. M1Carrierlist.Clear();
  499. M2Carrierlist.Clear();
  500. EDCarrierlist.Clear();
  501. SDCarrierlist.Clear();
  502. PCarrierlist.Clear();
  503. for (int i = 0; i < CarrierDataNameList.Count; i++)
  504. {
  505. string configType = (string)QueryDataClient.Instance.Service.GetConfig($"System.Stocker.Stocker{CarrierDataNameList[i].StockerIndex}WaferType");
  506. var boolNoneAndM1 = CarrierType.None.ToString().Equals(configType) && CarrierType.M1.Equals(CarrierDataNameList[i].CarrierType);
  507. var boolNoneAndM2 = CarrierType.None.ToString().Equals(configType) && CarrierType.M2.Equals(CarrierDataNameList[i].CarrierType);
  508. var boolNoneAndSD = CarrierType.None.ToString().Equals(configType) && CarrierType.SD.Equals(CarrierDataNameList[i].CarrierType);
  509. var boolNoneAndED = CarrierType.None.ToString().Equals(configType) && CarrierType.ED.Equals(CarrierDataNameList[i].CarrierType);
  510. var boolNoneAndP = CarrierType.None.ToString().Equals(configType) && CarrierDataNameList[i].CarrierType.ToString().StartsWith( CarrierType.P.ToString());
  511. //如果自身是M1类型或者自身是None类型但是创建了M1类型的Carrier 则添加到对应的集合中; 其余逻辑一致
  512. if (CarrierType.M1.ToString().Equals(configType) || boolNoneAndM1)
  513. {
  514. CarrierDataNameList[i].CarrierType = CarrierType.M1;
  515. M1Carrierlist.Add(CarrierDataNameList[i]);
  516. }
  517. if (CarrierType.M2.ToString().Equals(configType) || boolNoneAndM2)
  518. {
  519. CarrierDataNameList[i].CarrierType = CarrierType.M2;
  520. M2Carrierlist.Add(CarrierDataNameList[i]);
  521. }
  522. if (CarrierType.ED.ToString().Equals(configType) || boolNoneAndED)
  523. {
  524. CarrierDataNameList[i].CarrierType = CarrierType.ED;
  525. EDCarrierlist.Add(CarrierDataNameList[i]);
  526. }
  527. if (CarrierType.SD.ToString().Equals(configType) || boolNoneAndSD)
  528. {
  529. CarrierDataNameList[i].CarrierType = CarrierType.SD;
  530. SDCarrierlist.Add(CarrierDataNameList[i]);
  531. }
  532. if (configType.StartsWith(CarrierType.P.ToString())|| boolNoneAndP)
  533. {
  534. CarrierDataNameList[i].CarrierType = CarrierType.P;
  535. PCarrierlist.Add(CarrierDataNameList[i]);
  536. }
  537. AllCarrierlist.Add(CarrierDataNameList[i]);
  538. }
  539. WaferTypeSelect(WaferType);
  540. }
  541. public void StockerCarrier()
  542. {
  543. CarrierDataNameList.Clear();
  544. if (Stocker1CarrierData != null) { Stocker1CarrierData.StockerIndex = 1; CarrierDataNameList.Add(Stocker1CarrierData); }
  545. if (Stocker2CarrierData != null) { Stocker2CarrierData.StockerIndex = 2; CarrierDataNameList.Add(Stocker2CarrierData); }
  546. if (Stocker3CarrierData != null) { Stocker3CarrierData.StockerIndex = 3; CarrierDataNameList.Add(Stocker3CarrierData); }
  547. if (Stocker4CarrierData != null) { Stocker4CarrierData.StockerIndex = 4; CarrierDataNameList.Add(Stocker4CarrierData); }
  548. if (Stocker5CarrierData != null) { Stocker5CarrierData.StockerIndex = 5; CarrierDataNameList.Add(Stocker5CarrierData); }
  549. if (Stocker6CarrierData != null) { Stocker6CarrierData.StockerIndex = 6; CarrierDataNameList.Add(Stocker6CarrierData); }
  550. if (Stocker7CarrierData != null) { Stocker7CarrierData.StockerIndex = 7; CarrierDataNameList.Add(Stocker7CarrierData); }
  551. if (Stocker8CarrierData != null) { Stocker8CarrierData.StockerIndex = 8; CarrierDataNameList.Add(Stocker8CarrierData); }
  552. if (Stocker9CarrierData != null) { Stocker9CarrierData.StockerIndex = 9; CarrierDataNameList.Add(Stocker9CarrierData); }
  553. if (Stocker10CarrierData != null) { Stocker10CarrierData.StockerIndex = 10; CarrierDataNameList.Add(Stocker10CarrierData); }
  554. if (Stocker11CarrierData != null) { Stocker11CarrierData.StockerIndex = 11; CarrierDataNameList.Add(Stocker11CarrierData); }
  555. if (Stocker12CarrierData != null) { Stocker12CarrierData.StockerIndex = 12; CarrierDataNameList.Add(Stocker12CarrierData); }
  556. if (Stocker13CarrierData != null) { Stocker13CarrierData.StockerIndex = 13; CarrierDataNameList.Add(Stocker13CarrierData); }
  557. if (Stocker14CarrierData != null) { Stocker14CarrierData.StockerIndex = 14; CarrierDataNameList.Add(Stocker14CarrierData); }
  558. if (Stocker15CarrierData != null) { Stocker15CarrierData.StockerIndex = 15; CarrierDataNameList.Add(Stocker15CarrierData); }
  559. if (Stocker16CarrierData != null) { Stocker16CarrierData.StockerIndex = 16; CarrierDataNameList.Add(Stocker16CarrierData); }
  560. if (Stocker17CarrierData != null) { Stocker17CarrierData.StockerIndex = 17; CarrierDataNameList.Add(Stocker17CarrierData); }
  561. if (Stocker18CarrierData != null) { Stocker18CarrierData.StockerIndex = 18; CarrierDataNameList.Add(Stocker18CarrierData); }
  562. }
  563. protected override void OnViewReady(object view)
  564. {
  565. base.OnViewReady(view);
  566. if (WaferType == "P")
  567. Carrierlist = PCarrierlist;
  568. if (WaferType == "SD")
  569. Carrierlist = SDCarrierlist;
  570. if (WaferType == "ED")
  571. Carrierlist = EDCarrierlist;
  572. if (WaferType == "M1")
  573. Carrierlist = M1Carrierlist;
  574. if (WaferType == "M2")
  575. Carrierlist = M2Carrierlist;
  576. CarrierPItemList.Clear();
  577. CarrierSDItemList.Clear();
  578. CarrierEDItemList.Clear();
  579. CarrierMItemList.Clear();
  580. CarrierM1ItemList.Clear();
  581. CarrierM2ItemList.Clear();
  582. for (int i = 0; i < Carrierlist.Count; i++)
  583. {
  584. if ((bool)QueryDataClient.Instance.Service.GetConfig($"System.SetUp.IsStocker{Carrierlist[i].StockerIndex}Installed")) continue;
  585. CarrierMaterialInformation carrierInfo = new CarrierMaterialInformation();
  586. carrierInfo.No = $"{Carrierlist[i].StockerIndex}";
  587. carrierInfo.ModuleName = $"Stocker{Carrierlist[i].StockerIndex}";
  588. carrierInfo.CarrierType = $"{WaferType}";
  589. carrierInfo.CarrierId = Carrierlist[i].CarrierId;
  590. carrierInfo.WaferCount = Carrierlist[i].WaferCount.ToString();
  591. carrierInfo.StockerCarrierEnable = CarrierDataNameList[Carrierlist[i].StockerIndex - 1].IsEmpty ? false : true;
  592. carrierInfo.WaferStauts = Carrierlist[i].Status.ToString();
  593. if (WaferType == "P")
  594. CarrierPItemList.Add(carrierInfo);
  595. if (WaferType == "SD")
  596. CarrierSDItemList.Add(carrierInfo);
  597. if (WaferType == "ED")
  598. CarrierEDItemList.Add(carrierInfo);
  599. if (WaferType == "M1")
  600. CarrierM1ItemList.Add(carrierInfo);
  601. if (WaferType == "M2")
  602. CarrierM2ItemList.Add(carrierInfo);
  603. }
  604. }
  605. public void WaferTypeSelect(string type)
  606. {
  607. var waferTypeList = QueryDataClient.Instance.Service.GetConfigItemList().Where(m => m.Name.StartsWith(ConstantsCommon.Stocker)).ToList();
  608. switch (type)
  609. {
  610. case "P":
  611. StockValue = waferTypeList.Where(n => n.Value.ToString().Contains(CarrierType.P.ToString())).Count();
  612. WaferType = CarrierType.P.ToString();
  613. PTypeVisibility = Visibility.Visible;
  614. SDTypeVisibility = Visibility.Collapsed;
  615. EDTypeVisibility = Visibility.Collapsed;
  616. M1TypeVisibility = Visibility.Collapsed;
  617. M2TypeVisibility = Visibility.Collapsed;
  618. AllTypeVisibility = Visibility.Collapsed;
  619. CarrierPItemList.Clear();
  620. for (int i = 0; i < PCarrierlist.Count; i++)
  621. {
  622. CarrierMaterialInformation carrierInfo = new CarrierMaterialInformation();
  623. carrierInfo.No = $"{PCarrierlist[i].StockerIndex}";
  624. carrierInfo.ModuleName = $"Stocker{PCarrierlist[i].StockerIndex}";
  625. carrierInfo.CarrierType = PCarrierlist[i].CarrierType.ToString();
  626. carrierInfo.CarrierId = PCarrierlist[i].CarrierId;
  627. carrierInfo.WaferCount = PCarrierlist[i].WaferCount.ToString();
  628. carrierInfo.StockerCarrierEnable = PCarrierlist[i].IsEmpty ? false : true;
  629. carrierInfo.WaferStauts = PCarrierlist[i].Status.ToString();
  630. CarrierPItemList.Add(carrierInfo);
  631. }
  632. break;
  633. case "SD":
  634. StockValue = waferTypeList.Where(n => n.Value.ToString().Contains(CarrierType.SD.ToString())).Count();
  635. WaferType = CarrierType.SD.ToString();
  636. PTypeVisibility = Visibility.Collapsed;
  637. SDTypeVisibility = Visibility.Visible;
  638. EDTypeVisibility = Visibility.Collapsed;
  639. M1TypeVisibility = Visibility.Collapsed;
  640. M2TypeVisibility = Visibility.Collapsed;
  641. AllTypeVisibility = Visibility.Collapsed;
  642. CarrierSDItemList.Clear();
  643. for (int i = 0; i < SDCarrierlist.Count; i++)
  644. {
  645. CarrierMaterialInformation carrierInfo = new CarrierMaterialInformation();
  646. carrierInfo.No = $"{SDCarrierlist[i].StockerIndex}";
  647. carrierInfo.ModuleName = $"Stocker{SDCarrierlist[i].StockerIndex}";
  648. carrierInfo.CarrierType = SDCarrierlist[i].CarrierType.ToString();
  649. carrierInfo.CarrierId = SDCarrierlist[i].CarrierId;
  650. carrierInfo.WaferCount = SDCarrierlist[i].WaferCount.ToString();
  651. carrierInfo.StockerCarrierEnable = SDCarrierlist[i].IsEmpty ? false : true;
  652. carrierInfo.WaferStauts = SDCarrierlist[i].Status.ToString();
  653. CarrierSDItemList.Add(carrierInfo);
  654. }
  655. break;
  656. case "ED":
  657. StockValue = waferTypeList.Where(n => n.Value.ToString().Contains(CarrierType.ED.ToString())).Count();
  658. WaferType = CarrierType.ED.ToString();
  659. PTypeVisibility = Visibility.Collapsed;
  660. SDTypeVisibility = Visibility.Collapsed;
  661. EDTypeVisibility = Visibility.Visible;
  662. M1TypeVisibility = Visibility.Collapsed;
  663. M2TypeVisibility = Visibility.Collapsed;
  664. AllTypeVisibility = Visibility.Collapsed;
  665. CarrierEDItemList.Clear();
  666. for (int i = 0; i < EDCarrierlist.Count; i++)
  667. {
  668. CarrierMaterialInformation carrierInfo = new CarrierMaterialInformation();
  669. carrierInfo.No = $"{EDCarrierlist[i].StockerIndex}"; ;
  670. carrierInfo.ModuleName = $"Stocker{EDCarrierlist[i].StockerIndex}";
  671. carrierInfo.CarrierType = EDCarrierlist[i].CarrierType.ToString();
  672. carrierInfo.CarrierId = EDCarrierlist[i].CarrierId;
  673. carrierInfo.WaferCount = EDCarrierlist[i].WaferCount.ToString();
  674. carrierInfo.StockerCarrierEnable = EDCarrierlist[i].IsEmpty ? false : true;
  675. carrierInfo.WaferStauts = EDCarrierlist[i].Status.ToString();
  676. CarrierEDItemList.Add(carrierInfo);
  677. }
  678. break;
  679. case "M1":
  680. StockValue = waferTypeList.Where(n => n.Value.ToString().Equals(CarrierType.M1.ToString())).Count();
  681. WaferType = CarrierType.M1.ToString();
  682. PTypeVisibility = Visibility.Collapsed;
  683. SDTypeVisibility = Visibility.Collapsed;
  684. EDTypeVisibility = Visibility.Collapsed;
  685. M1TypeVisibility = Visibility.Visible;
  686. M2TypeVisibility = Visibility.Collapsed;
  687. AllTypeVisibility = Visibility.Collapsed;
  688. CarrierM1ItemList.Clear();
  689. for (int i = 0; i < M1Carrierlist.Count; i++)
  690. {
  691. string StockerNo = (string)QueryDataClient.Instance.Service.GetConfig($"System.StockerDisplayName.Stocker{M1Carrierlist[i].StockerIndex}");
  692. CarrierMaterialInformation carrierInfo = new CarrierMaterialInformation();
  693. carrierInfo.No = $"{M1Carrierlist[i].StockerIndex}"; ;
  694. carrierInfo.ModuleName = $"Stocker{M1Carrierlist[i].StockerIndex}";
  695. carrierInfo.CarrierType = M1Carrierlist[i].CarrierType.ToString();
  696. carrierInfo.CarrierId = M1Carrierlist[i].CarrierId;
  697. carrierInfo.WaferCount = M1Carrierlist[i].WaferCount.ToString();
  698. carrierInfo.StockerCarrierEnable = CarrierDataNameList[M1Carrierlist[i].StockerIndex - 1].IsEmpty ? false : true;
  699. carrierInfo.WaferStauts = M1Carrierlist[i].Status.ToString();
  700. CarrierM1ItemList.Add(carrierInfo);
  701. }
  702. break;
  703. case "M2":
  704. StockValue = waferTypeList.Where(n => n.Value.ToString().Equals(CarrierType.M2.ToString())).Count();
  705. WaferType = CarrierType.M2.ToString();
  706. PTypeVisibility = Visibility.Collapsed;
  707. SDTypeVisibility = Visibility.Collapsed;
  708. EDTypeVisibility = Visibility.Collapsed;
  709. M1TypeVisibility = Visibility.Collapsed;
  710. M2TypeVisibility = Visibility.Visible;
  711. AllTypeVisibility = Visibility.Collapsed;
  712. CarrierM2ItemList.Clear();
  713. for (int i = 0; i < M2Carrierlist.Count; i++)
  714. {
  715. CarrierMaterialInformation carrierInfo = new CarrierMaterialInformation();
  716. carrierInfo.No = $"{M2Carrierlist[i].StockerIndex}";
  717. carrierInfo.ModuleName = $"Stocker{M2Carrierlist[i].StockerIndex}";
  718. carrierInfo.CarrierType = M2Carrierlist[i].CarrierType.ToString();
  719. carrierInfo.CarrierId = M2Carrierlist[i].CarrierId;
  720. carrierInfo.WaferCount = M2Carrierlist[i].WaferCount.ToString();
  721. carrierInfo.StockerCarrierEnable = M2Carrierlist[i].IsEmpty ? false : true;
  722. carrierInfo.WaferStauts = M2Carrierlist[i].Status.ToString();
  723. CarrierM2ItemList.Add(carrierInfo);
  724. }
  725. break;
  726. case "All":
  727. PTypeVisibility = Visibility.Collapsed;
  728. SDTypeVisibility = Visibility.Collapsed;
  729. EDTypeVisibility = Visibility.Collapsed;
  730. M1TypeVisibility = Visibility.Collapsed;
  731. M2TypeVisibility = Visibility.Collapsed;
  732. AllTypeVisibility = Visibility.Visible;
  733. CarrierAllItemList.Clear();
  734. for (int i = 0; i < AllCarrierlist.Count; i++)
  735. {
  736. CarrierMaterialInformation carrierInfo = new CarrierMaterialInformation();
  737. carrierInfo.No = $"{AllCarrierlist[i].StockerIndex}";
  738. carrierInfo.ModuleName = $"Stocker{AllCarrierlist[i].StockerIndex}";
  739. carrierInfo.CarrierType = AllCarrierlist[i].CarrierType.ToString();
  740. carrierInfo.CarrierId = AllCarrierlist[i].CarrierId;
  741. carrierInfo.WaferCount = AllCarrierlist[i].WaferCount.ToString();
  742. carrierInfo.StockerCarrierEnable = AllCarrierlist[i].IsEmpty ? false : true;
  743. carrierInfo.WaferStauts = AllCarrierlist[i].Status.ToString();
  744. CarrierAllItemList.Add(carrierInfo);
  745. }
  746. break;
  747. default:
  748. break;
  749. }
  750. }
  751. public void LoadPortCheck(string StockerName, string LPName)
  752. {
  753. string LoadJobPara1, LoadJobPara2, LoadJobPara3, LoadJobPara4, LoadJobPara5, LoadJobPara6, LoadJobPara7, LoadJobPara8, LoadJobPara9,
  754. LoadJobPara10, LoadJobPara11, LoadJobPara12, LoadJobPara13, LoadJobPara14, LoadJobPara15, LoadJobPara16, LoadJobPara17, LoadJobPara18,
  755. LoadJobPara19, LoadJobPara20, LoadJobPara21;
  756. switch (StockerName)
  757. {
  758. case "Stocker1":
  759. LoadJobPara1 = StockerName + "," + LPName + ";";
  760. if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName))
  761. {
  762. this.LoadPortSelect(StockerName, LoadJobPara1);
  763. }
  764. else
  765. LoadJobPara += LoadJobPara1;
  766. break;
  767. case "Stocker2":
  768. LoadJobPara2 = StockerName + "," + LPName + ";";
  769. if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName))
  770. {
  771. this.LoadPortSelect(StockerName, LoadJobPara2);
  772. }
  773. else
  774. LoadJobPara += LoadJobPara2;
  775. break;
  776. case "Stocker3":
  777. LoadJobPara3 = StockerName + "," + LPName + ";";
  778. if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName))
  779. {
  780. this.LoadPortSelect(StockerName, LoadJobPara3);
  781. }
  782. else
  783. LoadJobPara += LoadJobPara3;
  784. break;
  785. case "Stocker4":
  786. LoadJobPara4 = StockerName + "," + LPName + ";";
  787. if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName))
  788. {
  789. this.LoadPortSelect(StockerName, LoadJobPara4);
  790. }
  791. else
  792. LoadJobPara += LoadJobPara4;
  793. break;
  794. case "Stocker5":
  795. LoadJobPara5 = StockerName + "," + LPName + ";";
  796. if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName))
  797. {
  798. this.LoadPortSelect(StockerName, LoadJobPara5);
  799. }
  800. else
  801. LoadJobPara += LoadJobPara5;
  802. break;
  803. case "Stocker6":
  804. LoadJobPara6 = StockerName + "," + LPName + ";";
  805. if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName))
  806. {
  807. this.LoadPortSelect(StockerName, LoadJobPara6);
  808. }
  809. else
  810. LoadJobPara += LoadJobPara6;
  811. break;
  812. case "Stocker7":
  813. LoadJobPara7 = StockerName + "," + LPName + ";";
  814. if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName))
  815. {
  816. this.LoadPortSelect(StockerName, LoadJobPara7);
  817. }
  818. else
  819. LoadJobPara += LoadJobPara7;
  820. break;
  821. case "Stocker8":
  822. LoadJobPara8 = StockerName + "," + LPName + ";";
  823. if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName))
  824. {
  825. this.LoadPortSelect(StockerName, LoadJobPara8);
  826. }
  827. else
  828. LoadJobPara += LoadJobPara8;
  829. break;
  830. case "Stocker9":
  831. LoadJobPara9 = StockerName + "," + LPName + ";";
  832. if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName))
  833. {
  834. this.LoadPortSelect(StockerName, LoadJobPara9);
  835. }
  836. else
  837. LoadJobPara += LoadJobPara9;
  838. break;
  839. case "Stocker10":
  840. LoadJobPara10 = StockerName + "," + LPName + ";";
  841. if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName))
  842. {
  843. this.LoadPortSelect(StockerName, LoadJobPara10);
  844. }
  845. else
  846. LoadJobPara += LoadJobPara10;
  847. break;
  848. case "Stocker11":
  849. LoadJobPara11 = StockerName + "," + LPName + ";";
  850. if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName))
  851. {
  852. this.LoadPortSelect(StockerName, LoadJobPara11);
  853. }
  854. else
  855. LoadJobPara += LoadJobPara11;
  856. break;
  857. case "Stocker12":
  858. LoadJobPara12 = StockerName + "," + LPName + ";";
  859. if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName))
  860. {
  861. this.LoadPortSelect(StockerName, LoadJobPara12);
  862. }
  863. else
  864. LoadJobPara += LoadJobPara12;
  865. break;
  866. case "Stocker13":
  867. LoadJobPara13 = StockerName + "," + LPName + ";";
  868. if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName))
  869. {
  870. this.LoadPortSelect(StockerName, LoadJobPara13);
  871. }
  872. else
  873. LoadJobPara += LoadJobPara13;
  874. break;
  875. case "Stocker14":
  876. LoadJobPara14 = StockerName + "," + LPName + ";";
  877. if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName))
  878. {
  879. this.LoadPortSelect(StockerName, LoadJobPara14);
  880. }
  881. else
  882. LoadJobPara += LoadJobPara14;
  883. break;
  884. case "Stocker15":
  885. LoadJobPara15 = StockerName + "," + LPName + ";";
  886. if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName))
  887. {
  888. this.LoadPortSelect(StockerName, LoadJobPara15);
  889. }
  890. else
  891. LoadJobPara += LoadJobPara15;
  892. break;
  893. case "Stocker16":
  894. LoadJobPara16 = StockerName + "," + LPName + ";";
  895. if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName))
  896. {
  897. this.LoadPortSelect(StockerName, LoadJobPara16);
  898. }
  899. else
  900. LoadJobPara += LoadJobPara16;
  901. break;
  902. case "Stocker17":
  903. LoadJobPara17 = StockerName + "," + LPName + ";";
  904. if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName))
  905. {
  906. this.LoadPortSelect(StockerName, LoadJobPara17);
  907. }
  908. else
  909. LoadJobPara += LoadJobPara17;
  910. break;
  911. case "Stocker18":
  912. LoadJobPara18 = StockerName + "," + LPName + ";";
  913. if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName))
  914. {
  915. this.LoadPortSelect(StockerName, LoadJobPara18);
  916. }
  917. else
  918. LoadJobPara += LoadJobPara18;
  919. break;
  920. case "Stocker19":
  921. LoadJobPara19 = StockerName + "," + LPName + ";";
  922. if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName))
  923. {
  924. this.LoadPortSelect(StockerName, LoadJobPara19);
  925. }
  926. else
  927. LoadJobPara += LoadJobPara19;
  928. break;
  929. case "Stocker20":
  930. LoadJobPara20 = StockerName + "," + LPName + ";";
  931. if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName))
  932. {
  933. this.LoadPortSelect(StockerName, LoadJobPara20);
  934. }
  935. else
  936. LoadJobPara += LoadJobPara20;
  937. break;
  938. case "Stocker21":
  939. LoadJobPara21 = StockerName + "," + LPName + ";";
  940. if (!string.IsNullOrEmpty(LoadJobPara) && LoadJobPara.Contains(StockerName))
  941. {
  942. this.LoadPortSelect(StockerName, LoadJobPara21);
  943. }
  944. else
  945. LoadJobPara += LoadJobPara21;
  946. break;
  947. }
  948. }
  949. public void LoadPortSelect(string StockerName, string LoadJobPara1)
  950. {
  951. string[] StockArray = LoadJobPara.Split(';');
  952. string para = "";
  953. foreach (var item in StockArray)
  954. {
  955. if (item.Contains(StockerName))
  956. {
  957. para = LoadJobPara.Replace(item + ";", LoadJobPara1);
  958. }
  959. }
  960. LoadJobPara = para;
  961. }
  962. protected override void InvokeAfterUpdateProperty(Dictionary<string, object> data)
  963. {
  964. base.InvokeAfterUpdateProperty(data);
  965. StockerCarrier();
  966. //InitialPortName(IsBatchAChecked ? "P1" : "P2");
  967. }
  968. public void EXECCmd(string cmdPar)
  969. {
  970. if (string.IsNullOrEmpty(LoadJobPara))
  971. {
  972. DialogBox.ShowWarning("Load job parameter is empty,please select loadport number!");
  973. return;
  974. }
  975. if (!DialogBox.Confirm("Are you sure to accept?"))
  976. return;
  977. //string para = "Stocker1,LP1;Stocker2,LP2";
  978. Dictionary<string, object> param = new Dictionary<string, object>()
  979. {
  980. {"WaferType", WaferType },
  981. {"CarrierPara", LoadJobPara.TrimEnd(';')},
  982. {"TransferType", "Unloading"},
  983. };
  984. SetValueToSC(param);
  985. if (IsExecuteRTCommand)
  986. {
  987. InvokeClient.Instance.Service.DoOperation($"System.{ExecCommand}", param);
  988. }
  989. ((Window)GetView()).DialogResult = true;
  990. }
  991. private void SetValueToSC(Dictionary<string, object> param)
  992. {
  993. foreach (var item in param.Keys)
  994. {
  995. InvokeClient.Instance.Service.DoOperation($"System.SetConfig", $"System.Job.JOBUnLoad.{item}", param[item]);
  996. }
  997. }
  998. public void ClosedCmd(string cmdPar)
  999. {
  1000. (GetView() as Window).Close();
  1001. }
  1002. }
  1003. }