WaferInfo.cs 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517
  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 MECF.Framework.Common.CommonData;
  8. using MECF.Framework.Common.Jobs;
  9. namespace Aitex.Core.Common
  10. {
  11. public enum WaferSize
  12. {
  13. WS0, //undefine, initialize status
  14. WS3,
  15. WS4,
  16. WS6,
  17. WS150, //150mm
  18. WS159, //150mm with tray
  19. WS8,
  20. WS12,
  21. }
  22. public enum WaferStatus
  23. {
  24. Empty = 0,
  25. Normal = 1,
  26. Crossed = 3,
  27. Double = 7,
  28. Unknown = 8,
  29. Dummy = 4
  30. }
  31. public enum EnumWaferProcessStatus
  32. {
  33. Idle = 0,
  34. InProcess,
  35. Completed,
  36. Failed,
  37. Wait
  38. }
  39. public enum EnumWaferChuckStatus
  40. {
  41. Init = 0,
  42. Chucked,
  43. Dechucked,
  44. }
  45. [Serializable]
  46. [DataContract]
  47. public class WaferInfo : NotifiableItem
  48. {
  49. public bool IsEmpty
  50. {
  51. get { return Status == WaferStatus.Empty; }
  52. }
  53. private bool _isDuplicated;
  54. [DataMember]
  55. public bool IsDuplicated
  56. {
  57. get { return _isDuplicated; }
  58. set
  59. {
  60. _isDuplicated = value;
  61. InvokePropertyChanged("WaferID");
  62. }
  63. }
  64. private string waferID;
  65. [DataMember]
  66. public string WaferID
  67. {
  68. get
  69. {
  70. return waferID;
  71. }
  72. set
  73. {
  74. waferID = value;
  75. InvokePropertyChanged("WaferID");
  76. }
  77. }
  78. private string lotType;
  79. [DataMember]
  80. public string LotType
  81. {
  82. get
  83. {
  84. return lotType;
  85. }
  86. set
  87. {
  88. lotType = value;
  89. InvokePropertyChanged("LotType");
  90. }
  91. }
  92. private string eapWaferID;
  93. [DataMember]
  94. public string EAPWaferID
  95. {
  96. get
  97. {
  98. return eapWaferID;
  99. }
  100. set
  101. {
  102. eapWaferID = value;
  103. InvokePropertyChanged("EAPWaferID");
  104. }
  105. }
  106. private string _waferOrigin;
  107. [DataMember]
  108. public string WaferOrigin
  109. {
  110. get
  111. {
  112. return _waferOrigin;
  113. }
  114. set
  115. {
  116. _waferOrigin = value;
  117. InvokePropertyChanged("WaferOrigin");
  118. }
  119. }
  120. private string laserMarker;
  121. [DataMember]
  122. public string LaserMarker
  123. {
  124. get
  125. {
  126. return laserMarker;
  127. }
  128. set
  129. {
  130. laserMarker = value;
  131. InvokePropertyChanged("LaserMarker");
  132. }
  133. }
  134. private string t7Code;
  135. [DataMember]
  136. public string T7Code
  137. {
  138. get
  139. {
  140. return t7Code;
  141. }
  142. set
  143. {
  144. t7Code = value;
  145. InvokePropertyChanged("T7Code");
  146. }
  147. }
  148. [DataMember]
  149. public string LotId { get; set; }
  150. [DataMember]
  151. public string TransFlag { get; set; }
  152. private WaferStatus status;
  153. [DataMember]
  154. public WaferStatus Status
  155. {
  156. get
  157. {
  158. return status;
  159. }
  160. set
  161. {
  162. status = value;
  163. InvokePropertyChanged("Status");
  164. }
  165. }
  166. [DataMember]
  167. public int Station
  168. {
  169. get;
  170. set;
  171. }
  172. [DataMember]
  173. public int Slot
  174. {
  175. get;
  176. set;
  177. }
  178. [DataMember]
  179. public int OriginStation
  180. {
  181. get;
  182. set;
  183. }
  184. [DataMember]
  185. public int OriginSlot
  186. {
  187. get;
  188. set;
  189. }
  190. [DataMember]
  191. public string OriginCarrierID
  192. {
  193. get;
  194. set;
  195. }
  196. [DataMember]
  197. public int SourceStation
  198. {
  199. get;
  200. set;
  201. }
  202. [DataMember]
  203. public int SourceSlot
  204. {
  205. get;
  206. set;
  207. }
  208. [DataMember]
  209. public int DestinationStation
  210. {
  211. get;
  212. set;
  213. }
  214. [DataMember]
  215. public int DestinationSlot
  216. {
  217. get;
  218. set;
  219. }
  220. [DataMember]
  221. public int Notch
  222. {
  223. get;
  224. set;
  225. }
  226. [DataMember]
  227. public WaferSize Size
  228. {
  229. get;
  230. set;
  231. }
  232. [DataMember]
  233. public string SequenceName
  234. {
  235. get;
  236. set;
  237. }
  238. private EnumWaferProcessStatus processState;
  239. [DataMember]
  240. public EnumWaferProcessStatus ProcessState
  241. {
  242. get
  243. {
  244. return processState;
  245. }
  246. set
  247. {
  248. processState = value;
  249. InvokePropertyChanged("ProcessState");
  250. }
  251. }
  252. private EnumWaferChuckStatus chuckState;
  253. [DataMember]
  254. public EnumWaferChuckStatus ChuckState
  255. {
  256. get
  257. {
  258. return chuckState;
  259. }
  260. set
  261. {
  262. chuckState = value;
  263. InvokePropertyChanged("ChuckState");
  264. }
  265. }
  266. private bool isSource;
  267. [DataMember]
  268. public bool IsSource
  269. {
  270. get
  271. {
  272. return isSource;
  273. }
  274. set
  275. {
  276. isSource = value;
  277. InvokePropertyChanged("IsSource");
  278. }
  279. }
  280. private bool isDestination;
  281. [DataMember]
  282. public bool IsDestination
  283. {
  284. get
  285. {
  286. return isDestination;
  287. }
  288. set
  289. {
  290. isDestination = value;
  291. InvokePropertyChanged("IsDestination");
  292. }
  293. }
  294. [DataMember]
  295. public Guid InnerId { get; set; }
  296. [DataMember]
  297. public ProcessJobInfo ProcessJob { get; set; }
  298. [DataMember]
  299. public int NextSequenceStep { get; set; }
  300. public WaferInfo()
  301. {
  302. InnerId = Guid.Empty;
  303. _isDuplicated = false;
  304. }
  305. public WaferInfo(string waferID, WaferStatus status = WaferStatus.Empty) : this()
  306. {
  307. this.WaferID = waferID;
  308. this.Status = status;
  309. }
  310. public void Update(WaferInfo source)
  311. {
  312. InnerId = source.InnerId;
  313. WaferID = source.waferID;
  314. WaferOrigin = source.WaferOrigin;
  315. LaserMarker = source.LaserMarker;
  316. T7Code = source.T7Code;
  317. Status = source.Status;
  318. ProcessState = source.ProcessState;
  319. ChuckState = source.ChuckState;
  320. IsSource = source.IsSource;
  321. IsDestination = source.IsDestination;
  322. IsDuplicated = source.IsDuplicated;
  323. Station = source.Station;
  324. Slot = source.Slot;
  325. OriginStation = source.OriginStation;
  326. OriginSlot = source.OriginSlot;
  327. if(source.OriginCarrierID!=null) OriginCarrierID = source.OriginCarrierID;
  328. SourceStation = source.SourceStation;
  329. SourceSlot = source.SourceSlot;
  330. DestinationStation = source.DestinationStation;
  331. DestinationSlot = source.DestinationSlot;
  332. Notch = source.Notch;
  333. Size = source.Size;
  334. TransFlag = source.TransFlag;
  335. LotId = source.LotId;
  336. ProcessJob = source.ProcessJob;
  337. NextSequenceStep = source.NextSequenceStep;
  338. EAPWaferID = source.EAPWaferID;
  339. LotType= source.LotType;
  340. }
  341. public void SetEmpty()
  342. {
  343. this.InnerId = Guid.Empty;
  344. this.WaferID = string.Empty;
  345. this.WaferOrigin = string.Empty;
  346. this.LaserMarker = string.Empty;
  347. this.T7Code = string.Empty;
  348. this.Status = (int)WaferStatus.Empty;
  349. this.ProcessState = EnumWaferProcessStatus.Idle;
  350. this.ChuckState = EnumWaferChuckStatus.Init;
  351. this.IsSource = false;
  352. this.IsDestination = false;
  353. this.IsDuplicated = false;
  354. this.Station = 0;
  355. this.Slot = 0;
  356. this.OriginStation = 0;
  357. this.OriginSlot = 0;
  358. this.SourceStation = 0;
  359. this.SourceSlot = 0;
  360. this.DestinationStation = 0;
  361. this.DestinationSlot = 0;
  362. this.Notch = 0;
  363. //this.Size = WaferSize.WS0; //wafersize 保留最后的一次的记录
  364. this.TransFlag = string.Empty;
  365. this.LotId = string.Empty;
  366. this.ProcessJob = null;
  367. this.NextSequenceStep = 0;
  368. }
  369. public WaferInfo Clone(WaferInfo source)
  370. {
  371. WaferInfo newValue = new WaferInfo();
  372. newValue.InnerId = source.InnerId;
  373. newValue.WaferID = source.waferID;
  374. newValue.WaferOrigin = source.WaferOrigin;
  375. newValue.LaserMarker = source.LaserMarker;
  376. newValue.T7Code = source.T7Code;
  377. newValue.Status = source.Status;
  378. newValue.ProcessState = source.ProcessState;
  379. newValue.ChuckState = source.ChuckState;
  380. newValue.IsSource = source.IsSource;
  381. newValue.IsDestination = source.IsDestination;
  382. newValue.IsDuplicated = source.IsDuplicated;
  383. newValue.Station = source.Station;
  384. newValue.Slot = source.Slot;
  385. newValue.OriginStation = source.OriginStation;
  386. newValue.OriginSlot = source.OriginSlot;
  387. if (source.OriginCarrierID != null) newValue.OriginCarrierID = source.OriginCarrierID;
  388. newValue.SourceStation = source.SourceStation;
  389. newValue.SourceSlot = source.SourceSlot;
  390. newValue.DestinationStation = source.DestinationStation;
  391. newValue.DestinationSlot = source.DestinationSlot;
  392. newValue.Notch = source.Notch;
  393. newValue.Size = source.Size;
  394. newValue.TransFlag = source.TransFlag;
  395. newValue.LotId = source.LotId;
  396. newValue.NextSequenceStep = source.NextSequenceStep;
  397. if(source.ProcessJob != null)
  398. {
  399. newValue.ProcessJob = new ProcessJobInfo();
  400. if(source.ProcessJob.Sequence != null)
  401. {
  402. newValue.ProcessJob.Sequence = new SequenceInfo(source.ProcessJob.Sequence.Name);
  403. newValue.ProcessJob.Sequence.InnerId = source.ProcessJob.Sequence.InnerId;
  404. newValue.ProcessJob.Sequence.ThicknessType = source.ProcessJob.Sequence.ThicknessType;
  405. foreach(var step in source.ProcessJob.Sequence.Steps)
  406. {
  407. var newStep = new SequenceStepInfo();
  408. newStep.StepModules = new List<MECF.Framework.Common.Equipment.ModuleName>(step.StepModules.ToArray());
  409. newStep.StepParameter = step.StepParameter.ToDictionary(entry => entry.Key, entry => entry.Value);
  410. newValue.ProcessJob.Sequence.Steps.Add(newStep);
  411. }
  412. }
  413. }
  414. return newValue;
  415. }
  416. }
  417. [Serializable]
  418. [DataContract]
  419. public class DulicatedWaferInfo
  420. {
  421. [DataMember]
  422. public Guid waferId { get; set; }
  423. [DataMember]
  424. public int source { get; set; }
  425. [DataMember]
  426. public int sourceSlot { get; set; }
  427. [DataMember]
  428. public int destination { get; set; }
  429. [DataMember]
  430. public int destSlot { get; set; }
  431. public DulicatedWaferInfo(Guid id, int Source, int SrcSlot, int Destination, int DestSlot)
  432. {
  433. waferId = id;
  434. source = Source;
  435. sourceSlot = SrcSlot;
  436. destination = Destination;
  437. destSlot = DestSlot;
  438. }
  439. }
  440. }