WaferInfo.cs 11 KB

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