WaferInfo.cs 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460
  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 _waferOrigin;
  79. [DataMember]
  80. public string WaferOrigin
  81. {
  82. get
  83. {
  84. return _waferOrigin;
  85. }
  86. set
  87. {
  88. _waferOrigin = value;
  89. InvokePropertyChanged("WaferOrigin");
  90. }
  91. }
  92. private string laserMarker;
  93. [DataMember]
  94. public string LaserMarker
  95. {
  96. get
  97. {
  98. return laserMarker;
  99. }
  100. set
  101. {
  102. laserMarker = value;
  103. InvokePropertyChanged("LaserMarker");
  104. }
  105. }
  106. private string t7Code;
  107. [DataMember]
  108. public string T7Code
  109. {
  110. get
  111. {
  112. return t7Code;
  113. }
  114. set
  115. {
  116. t7Code = value;
  117. InvokePropertyChanged("T7Code");
  118. }
  119. }
  120. [DataMember]
  121. public string LotId { get; set; }
  122. [DataMember]
  123. public string TransFlag { get; set; }
  124. private WaferStatus status;
  125. [DataMember]
  126. public WaferStatus Status
  127. {
  128. get
  129. {
  130. return status;
  131. }
  132. set
  133. {
  134. status = value;
  135. InvokePropertyChanged("Status");
  136. }
  137. }
  138. [DataMember]
  139. public int Station
  140. {
  141. get;
  142. set;
  143. }
  144. [DataMember]
  145. public int Slot
  146. {
  147. get;
  148. set;
  149. }
  150. [DataMember]
  151. public int OriginStation
  152. {
  153. get;
  154. set;
  155. }
  156. [DataMember]
  157. public int OriginSlot
  158. {
  159. get;
  160. set;
  161. }
  162. [DataMember]
  163. public string OriginCarrierID
  164. {
  165. get;
  166. set;
  167. }
  168. [DataMember]
  169. public int SourceStation
  170. {
  171. get;
  172. set;
  173. }
  174. [DataMember]
  175. public int SourceSlot
  176. {
  177. get;
  178. set;
  179. }
  180. [DataMember]
  181. public int DestinationStation
  182. {
  183. get;
  184. set;
  185. }
  186. [DataMember]
  187. public int DestinationSlot
  188. {
  189. get;
  190. set;
  191. }
  192. [DataMember]
  193. public int Notch
  194. {
  195. get;
  196. set;
  197. }
  198. [DataMember]
  199. public WaferSize Size
  200. {
  201. get;
  202. set;
  203. }
  204. [DataMember]
  205. public string SequenceName
  206. {
  207. get;
  208. set;
  209. }
  210. private EnumWaferProcessStatus processState;
  211. [DataMember]
  212. public EnumWaferProcessStatus ProcessState
  213. {
  214. get
  215. {
  216. return processState;
  217. }
  218. set
  219. {
  220. processState = value;
  221. InvokePropertyChanged("ProcessState");
  222. }
  223. }
  224. private EnumWaferChuckStatus chuckState;
  225. [DataMember]
  226. public EnumWaferChuckStatus ChuckState
  227. {
  228. get
  229. {
  230. return chuckState;
  231. }
  232. set
  233. {
  234. chuckState = value;
  235. InvokePropertyChanged("ChuckState");
  236. }
  237. }
  238. private bool isSource;
  239. [DataMember]
  240. public bool IsSource
  241. {
  242. get
  243. {
  244. return isSource;
  245. }
  246. set
  247. {
  248. isSource = value;
  249. InvokePropertyChanged("IsSource");
  250. }
  251. }
  252. private bool isDestination;
  253. [DataMember]
  254. public bool IsDestination
  255. {
  256. get
  257. {
  258. return isDestination;
  259. }
  260. set
  261. {
  262. isDestination = value;
  263. InvokePropertyChanged("IsDestination");
  264. }
  265. }
  266. [DataMember]
  267. public Guid InnerId { get; set; }
  268. [DataMember]
  269. public ProcessJobInfo ProcessJob { get; set; }
  270. [DataMember]
  271. public int NextSequenceStep { get; set; }
  272. public WaferInfo()
  273. {
  274. InnerId = Guid.Empty;
  275. _isDuplicated = false;
  276. }
  277. public WaferInfo(string waferID, WaferStatus status = WaferStatus.Empty) : this()
  278. {
  279. this.WaferID = waferID;
  280. this.Status = status;
  281. }
  282. public void Update(WaferInfo source)
  283. {
  284. InnerId = source.InnerId;
  285. WaferID = source.waferID;
  286. WaferOrigin = source.WaferOrigin;
  287. LaserMarker = source.LaserMarker;
  288. T7Code = source.T7Code;
  289. Status = source.Status;
  290. ProcessState = source.ProcessState;
  291. ChuckState = source.ChuckState;
  292. IsSource = source.IsSource;
  293. IsDestination = source.IsDestination;
  294. IsDuplicated = source.IsDuplicated;
  295. Station = source.Station;
  296. Slot = source.Slot;
  297. OriginStation = source.OriginStation;
  298. OriginSlot = source.OriginSlot;
  299. if(source.OriginCarrierID!=null) OriginCarrierID = source.OriginCarrierID;
  300. SourceStation = source.SourceStation;
  301. SourceSlot = source.SourceSlot;
  302. DestinationStation = source.DestinationStation;
  303. DestinationSlot = source.DestinationSlot;
  304. Notch = source.Notch;
  305. Size = source.Size;
  306. TransFlag = source.TransFlag;
  307. LotId = source.LotId;
  308. ProcessJob = source.ProcessJob;
  309. NextSequenceStep = source.NextSequenceStep;
  310. }
  311. public void SetEmpty()
  312. {
  313. this.InnerId = Guid.Empty;
  314. this.WaferID = string.Empty;
  315. this.WaferOrigin = string.Empty;
  316. this.LaserMarker = string.Empty;
  317. this.T7Code = string.Empty;
  318. this.Status = (int)WaferStatus.Empty;
  319. this.ProcessState = EnumWaferProcessStatus.Idle;
  320. this.ChuckState = EnumWaferChuckStatus.Init;
  321. this.IsSource = false;
  322. this.IsDestination = false;
  323. this.IsDuplicated = false;
  324. this.Station = 0;
  325. this.Slot = 0;
  326. this.OriginStation = 0;
  327. this.OriginSlot = 0;
  328. this.SourceStation = 0;
  329. this.SourceSlot = 0;
  330. this.DestinationStation = 0;
  331. this.DestinationSlot = 0;
  332. this.Notch = 0;
  333. //this.Size = WaferSize.WS0; //wafersize 保留最后的一次的记录
  334. this.TransFlag = string.Empty;
  335. this.LotId = string.Empty;
  336. this.ProcessJob = null;
  337. this.NextSequenceStep = 0;
  338. }
  339. public WaferInfo Clone(WaferInfo source)
  340. {
  341. WaferInfo newValue = new WaferInfo();
  342. newValue.InnerId = source.InnerId;
  343. newValue.WaferID = source.waferID;
  344. newValue.WaferOrigin = source.WaferOrigin;
  345. newValue.LaserMarker = source.LaserMarker;
  346. newValue.T7Code = source.T7Code;
  347. newValue.Status = source.Status;
  348. newValue.ProcessState = source.ProcessState;
  349. newValue.ChuckState = source.ChuckState;
  350. newValue.IsSource = source.IsSource;
  351. newValue.IsDestination = source.IsDestination;
  352. newValue.IsDuplicated = source.IsDuplicated;
  353. newValue.Station = source.Station;
  354. newValue.Slot = source.Slot;
  355. newValue.OriginStation = source.OriginStation;
  356. newValue.OriginSlot = source.OriginSlot;
  357. if (source.OriginCarrierID != null) newValue.OriginCarrierID = source.OriginCarrierID;
  358. newValue.SourceStation = source.SourceStation;
  359. newValue.SourceSlot = source.SourceSlot;
  360. newValue.DestinationStation = source.DestinationStation;
  361. newValue.DestinationSlot = source.DestinationSlot;
  362. newValue.Notch = source.Notch;
  363. newValue.Size = source.Size;
  364. newValue.TransFlag = source.TransFlag;
  365. newValue.LotId = source.LotId;
  366. newValue.NextSequenceStep = source.NextSequenceStep;
  367. if(source.ProcessJob != null)
  368. {
  369. newValue.ProcessJob = new ProcessJobInfo();
  370. if(source.ProcessJob.Sequence != null)
  371. {
  372. newValue.ProcessJob.Sequence = new SequenceInfo(source.ProcessJob.Sequence.Name);
  373. newValue.ProcessJob.Sequence.InnerId = source.ProcessJob.Sequence.InnerId;
  374. newValue.ProcessJob.Sequence.ThicknessType = source.ProcessJob.Sequence.ThicknessType;
  375. foreach(var step in source.ProcessJob.Sequence.Steps)
  376. {
  377. var newStep = new SequenceStepInfo();
  378. newStep.StepModules = new List<MECF.Framework.Common.Equipment.ModuleName>(step.StepModules.ToArray());
  379. newStep.StepParameter = step.StepParameter.ToDictionary(entry => entry.Key, entry => entry.Value);
  380. newValue.ProcessJob.Sequence.Steps.Add(newStep);
  381. }
  382. }
  383. }
  384. return newValue;
  385. }
  386. }
  387. }