LoadJOBUnLoadViewModel.cs 48 KB

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