WaferInfo.cs 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Linq;
  5. using System.Runtime.Serialization;
  6. using System.Text;
  7. using DocumentFormat.OpenXml.Drawing;
  8. using MECF.Framework.Common.CommonData;
  9. using MECF.Framework.Common.Jobs;
  10. namespace Aitex.Core.Common
  11. {
  12. public enum WaferSize
  13. {
  14. WS0 = 0, //undefine, initialize status
  15. WS3 = 3,
  16. WS4 = 4,
  17. WS6 = 6,
  18. WS8 = 8,
  19. WS12 = 12,
  20. WS2 = 2,
  21. WS5 = 5,
  22. WS7 = 7,
  23. }
  24. public enum WaferStatus
  25. {
  26. Empty = 0,
  27. Normal = 1,
  28. Crossed = 2,
  29. Double = 3,
  30. Unknown = 4,
  31. Dummy = 5
  32. }
  33. public enum EnumE90Status
  34. {
  35. None = -1,
  36. NeedProcessing = 0,
  37. InProcess,
  38. Processed,
  39. Aborted,
  40. Stopped,
  41. Rejected,
  42. Lost,
  43. Skipped,
  44. }
  45. //public enum EnumWaferProcessStatus
  46. //{
  47. // NeedProcessing=0,
  48. // Processed,
  49. // Aborted,
  50. // Stopped,
  51. // Rejected,
  52. // Lost,
  53. // Skipped,
  54. //}
  55. public enum SubstrateTransportStatus
  56. {
  57. AtSource = 0,
  58. AtWork,
  59. AtDestination,
  60. None,
  61. }
  62. public enum EnumWaferProcessStatus
  63. {
  64. Idle = 0,
  65. InProcess,
  66. Completed,
  67. Failed,
  68. Wait,
  69. Abort,
  70. }
  71. public enum ProcessStatus
  72. {
  73. Idle = 0,
  74. Wait = 1,
  75. Busy = 2,
  76. Completed = 3,
  77. Failed = 4,
  78. Abort = 5,
  79. }
  80. public enum SubstAccessType
  81. {
  82. Create = 0,
  83. UpdateWaferID,
  84. Arrive,
  85. Left,
  86. UpdateLM1,
  87. UpdateLM2,
  88. Delete,
  89. Alignment,
  90. }
  91. [Serializable]
  92. [DataContract]
  93. public class SubstHistory
  94. {
  95. [DataMember]
  96. public string locationID { get; set; }
  97. [DataMember]
  98. public int SlotNO { get; set; }
  99. [DataMember]
  100. public DateTime AccessTimeIn { get; set; }
  101. [DataMember]
  102. public DateTime AccessTimeOut { get; set; }
  103. [DataMember]
  104. public SubstAccessType AccessType { get; set; }
  105. public SubstHistory(string loc, int slot, DateTime dt, SubstAccessType type)
  106. {
  107. locationID = loc;
  108. SlotNO = slot;
  109. AccessTimeIn = dt;
  110. AccessType = type;
  111. }
  112. }
  113. [Serializable]
  114. [DataContract]
  115. public class WaferInfo : NotifiableItem
  116. {
  117. private string procesjobid;
  118. [DataMember]
  119. public string ProcessJobID
  120. {
  121. get
  122. {
  123. return procesjobid;
  124. }
  125. set
  126. {
  127. procesjobid = value;
  128. InvokePropertyChanged("ProcessJobID");
  129. }
  130. }
  131. private string controljobid;
  132. [DataMember]
  133. public string ControlJobID
  134. {
  135. get
  136. {
  137. return controljobid;
  138. }
  139. set
  140. {
  141. controljobid = value;
  142. InvokePropertyChanged("ControlJobID");
  143. }
  144. }
  145. private SubstrateTransportStatus substtransstatus;
  146. [DataMember]
  147. public SubstrateTransportStatus SubstTransStatus
  148. {
  149. get
  150. {
  151. return substtransstatus;
  152. }
  153. set
  154. {
  155. substtransstatus = value;
  156. InvokePropertyChanged("SubstTransStatus");
  157. }
  158. }
  159. private EnumE90Status Subste90status;
  160. [DataMember]
  161. public EnumE90Status SubstE90Status
  162. {
  163. get
  164. {
  165. return Subste90status;
  166. }
  167. set
  168. {
  169. Subste90status = value;
  170. InvokePropertyChanged("SubstE90Status");
  171. }
  172. }
  173. private SubstHistory[] substhists;
  174. [DataMember]
  175. public SubstHistory[] SubstHists
  176. {
  177. get
  178. {
  179. return substhists;
  180. }
  181. set
  182. {
  183. substhists = value;
  184. InvokePropertyChanged("SubstHists");
  185. }
  186. }
  187. public bool IsEmpty
  188. {
  189. get { return Status == WaferStatus.Empty; }
  190. }
  191. private string waferID;
  192. [DataMember]
  193. public string WaferID
  194. {
  195. get
  196. {
  197. return waferID;
  198. }
  199. set
  200. {
  201. waferID = value;
  202. InvokePropertyChanged("WaferID");
  203. }
  204. }
  205. private string _waferOrigin;
  206. [DataMember]
  207. public string WaferOrigin
  208. {
  209. get
  210. {
  211. return _waferOrigin;
  212. }
  213. set
  214. {
  215. _waferOrigin = value;
  216. InvokePropertyChanged("WaferOrigin");
  217. }
  218. }
  219. private string hostlaserMark1;
  220. [DataMember]
  221. public string HostLaserMark1
  222. {
  223. get
  224. {
  225. return hostlaserMark1;
  226. }
  227. set
  228. {
  229. hostlaserMark1 = value;
  230. InvokePropertyChanged("HostLaserMark1");
  231. }
  232. }
  233. private string hostlaserMark2;
  234. [DataMember]
  235. public string HostLaserMark2
  236. {
  237. get
  238. {
  239. return hostlaserMark2;
  240. }
  241. set
  242. {
  243. hostlaserMark2 = value;
  244. InvokePropertyChanged("HostLaserMark2");
  245. }
  246. }
  247. private string laserMarker;
  248. [DataMember]
  249. public string LaserMarker
  250. {
  251. get
  252. {
  253. return laserMarker;
  254. }
  255. set
  256. {
  257. laserMarker = value;
  258. InvokePropertyChanged("LaserMarker");
  259. }
  260. }
  261. private string t7Code;
  262. [DataMember]
  263. public string T7Code
  264. {
  265. get
  266. {
  267. return t7Code;
  268. }
  269. set
  270. {
  271. t7Code = value;
  272. InvokePropertyChanged("T7Code");
  273. }
  274. }
  275. private string _laserMarkerScore;
  276. [DataMember]
  277. public string LaserMarkerScore
  278. {
  279. get
  280. {
  281. return _laserMarkerScore;
  282. }
  283. set
  284. {
  285. _laserMarkerScore = value;
  286. InvokePropertyChanged("LaserMarker1Score");
  287. }
  288. }
  289. private string _t7CodeScore;
  290. [DataMember]
  291. public string T7CodeScore
  292. {
  293. get
  294. {
  295. return _t7CodeScore;
  296. }
  297. set
  298. {
  299. _t7CodeScore = value;
  300. InvokePropertyChanged("T7CodeScore");
  301. }
  302. }
  303. private string _imageFileName;
  304. [DataMember]
  305. public string ImageFileName
  306. {
  307. get
  308. {
  309. return _imageFileName;
  310. }
  311. set
  312. {
  313. _imageFileName = value;
  314. InvokePropertyChanged("ImageFileName");
  315. }
  316. }
  317. private string _imageFilePath;
  318. [DataMember]
  319. public string ImageFilePath
  320. {
  321. get
  322. {
  323. return _imageFilePath;
  324. }
  325. set
  326. {
  327. _imageFilePath = value;
  328. InvokePropertyChanged("ImageFilePath");
  329. }
  330. }
  331. [DataMember]
  332. public string LotId { get; set; }
  333. [DataMember]
  334. public string TransFlag { get; set; }
  335. private WaferStatus status;
  336. [DataMember]
  337. public WaferStatus Status
  338. {
  339. get
  340. {
  341. return status;
  342. }
  343. set
  344. {
  345. status = value;
  346. InvokePropertyChanged("Status");
  347. }
  348. }
  349. [DataMember]
  350. public string CurrentCarrierID
  351. {
  352. get;
  353. set;
  354. }
  355. [DataMember]
  356. public int Station
  357. {
  358. get;
  359. set;
  360. }
  361. [DataMember]
  362. public int Slot
  363. {
  364. get;
  365. set;
  366. }
  367. [DataMember]
  368. public int OriginStation
  369. {
  370. get;
  371. set;
  372. }
  373. [DataMember]
  374. public int OriginSlot
  375. {
  376. get;
  377. set;
  378. }
  379. [DataMember]
  380. public string OriginCarrierID
  381. {
  382. get;
  383. set;
  384. }
  385. [DataMember]
  386. public int DestinationStation
  387. {
  388. get;
  389. set;
  390. }
  391. [DataMember]
  392. public string DestinationCarrierID
  393. {
  394. get;
  395. set;
  396. }
  397. [DataMember]
  398. public int DestinationSlot
  399. {
  400. get;
  401. set;
  402. }
  403. [DataMember]
  404. public int NextStation
  405. {
  406. get;
  407. set;
  408. }
  409. [DataMember]
  410. public int NextStationSlot
  411. {
  412. get;
  413. set;
  414. }
  415. [DataMember]
  416. public int Notch
  417. {
  418. get;
  419. set;
  420. }
  421. [DataMember]
  422. public WaferSize Size
  423. {
  424. get;
  425. set;
  426. }
  427. private bool isChecked;
  428. public bool IsChecked
  429. {
  430. get
  431. { return isChecked; }
  432. set
  433. {
  434. isChecked = value;
  435. InvokePropertyChanged("IsChecked");
  436. }
  437. }
  438. [DataMember]
  439. public string PPID //Recipe or Sequence
  440. {
  441. get;
  442. set;
  443. }
  444. private EnumWaferProcessStatus processState;
  445. [DataMember]
  446. public EnumWaferProcessStatus ProcessState
  447. {
  448. get
  449. {
  450. return processState;
  451. }
  452. set
  453. {
  454. processState = value;
  455. InvokePropertyChanged("ProcessStatus");
  456. }
  457. }
  458. private bool isSource;
  459. [DataMember]
  460. public bool IsSource
  461. {
  462. get
  463. {
  464. return isSource;
  465. }
  466. set
  467. {
  468. isSource = value;
  469. InvokePropertyChanged("IsSource");
  470. }
  471. }
  472. private bool isDestination;
  473. [DataMember]
  474. public bool IsDestination
  475. {
  476. get
  477. {
  478. return isDestination;
  479. }
  480. set
  481. {
  482. isDestination = value;
  483. InvokePropertyChanged("IsDestination");
  484. }
  485. }
  486. [DataMember]
  487. public Guid InnerId { get; set; }
  488. [DataMember]
  489. public ProcessJobInfo ProcessJob { get; set; }
  490. [DataMember]
  491. public int NextSequenceStep { get; set; }
  492. [DataMember]
  493. public bool HasWarning { get; set; }
  494. public WaferInfo()
  495. {
  496. InnerId = Guid.Empty;
  497. }
  498. public WaferInfo(string waferID, WaferStatus status = WaferStatus.Empty) : this()
  499. {
  500. this.WaferID = waferID;
  501. this.Status = status;
  502. }
  503. public void Update(WaferInfo source)
  504. {
  505. InnerId = source.InnerId;
  506. WaferID = source.waferID;
  507. WaferOrigin = source.WaferOrigin;
  508. LaserMarker = source.LaserMarker;
  509. LaserMarkerScore = source.LaserMarkerScore;
  510. T7Code = source.T7Code;
  511. T7CodeScore = source.T7CodeScore;
  512. Status = source.Status;
  513. ProcessState = source.ProcessState;
  514. IsSource = source.IsSource;
  515. IsDestination = source.IsDestination;
  516. Station = source.Station;
  517. Slot = source.Slot;
  518. OriginStation = source.OriginStation;
  519. OriginSlot = source.OriginSlot;
  520. if (source.OriginCarrierID != null) OriginCarrierID = source.OriginCarrierID;
  521. if (source.DestinationCarrierID != null) DestinationCarrierID = source.DestinationCarrierID;
  522. DestinationStation = source.DestinationStation;
  523. DestinationSlot = source.DestinationSlot;
  524. NextStation = source.NextStation;
  525. NextStationSlot = source.NextStationSlot;
  526. Notch = source.Notch;
  527. Size = source.Size;
  528. TransFlag = source.TransFlag;
  529. LotId = source.LotId;
  530. ProcessJob = source.ProcessJob;
  531. NextSequenceStep = source.NextSequenceStep;
  532. SubstHists = source.SubstHists;
  533. HasWarning = source.HasWarning;
  534. SubstE90Status = source.SubstE90Status;
  535. PPID = source.PPID;
  536. HostLaserMark1 = source.HostLaserMark1;
  537. HostLaserMark2 = source.HostLaserMark2;
  538. }
  539. public WaferInfo Clone()
  540. {
  541. WaferInfo source = this;
  542. return new WaferInfo()
  543. {
  544. InnerId = source.InnerId,
  545. WaferID = source.waferID,
  546. WaferOrigin = source.WaferOrigin,
  547. LaserMarker = source.LaserMarker,
  548. LaserMarkerScore = source.LaserMarkerScore,
  549. T7Code = source.T7Code,
  550. T7CodeScore = source.T7CodeScore,
  551. Status = source.Status,
  552. ProcessState = source.ProcessState,
  553. IsSource = source.IsSource,
  554. IsDestination = source.IsDestination,
  555. Station = source.Station,
  556. Slot = source.Slot,
  557. OriginStation = source.OriginStation,
  558. OriginSlot = source.OriginSlot,
  559. OriginCarrierID = source.OriginCarrierID,
  560. DestinationCarrierID = source.DestinationCarrierID,
  561. DestinationStation = source.DestinationStation,
  562. DestinationSlot = source.DestinationSlot,
  563. NextStation = source.NextStation,
  564. NextStationSlot = source.NextStationSlot,
  565. Notch = source.Notch,
  566. Size = source.Size,
  567. TransFlag = source.TransFlag,
  568. LotId = source.LotId,
  569. ProcessJob = source.ProcessJob,
  570. NextSequenceStep = source.NextSequenceStep,
  571. SubstHists = source.SubstHists,
  572. HasWarning = source.HasWarning,
  573. SubstE90Status = source.SubstE90Status,
  574. PPID = source.PPID,
  575. };
  576. }
  577. public void SetEmpty()
  578. {
  579. this.InnerId = Guid.Empty;
  580. this.WaferID = string.Empty;
  581. this.WaferOrigin = string.Empty;
  582. this.LaserMarker = string.Empty;
  583. this.LaserMarkerScore = string.Empty;
  584. this.T7Code = string.Empty;
  585. this.T7CodeScore = string.Empty;
  586. this.Status = (int)WaferStatus.Empty;
  587. this.ProcessState = EnumWaferProcessStatus.Idle;
  588. this.IsSource = false;
  589. this.IsDestination = false;
  590. this.Station = 0;
  591. this.Slot = 0;
  592. this.OriginStation = 0;
  593. this.OriginSlot = 0;
  594. //this.SourceStation = 0;
  595. //this.SourceSlot = 0;
  596. this.DestinationStation = 0;
  597. this.DestinationSlot = 0;
  598. this.Notch = 0;
  599. //保留最后一次的Wafer Size信息,便于后续判断和优化
  600. //this.Size = WaferSize.WS0;
  601. this.TransFlag = string.Empty;
  602. this.LotId = string.Empty;
  603. this.ProcessJob = null;
  604. this.NextSequenceStep = 0;
  605. this.HasWarning = false;
  606. this.PPID = "";
  607. }
  608. }
  609. }