WaferInfo.cs 11 KB

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