Process_FA.cs 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using Aitex.Core.Common;
  7. using Aitex.Core.RT.Event;
  8. using Aitex.Core.Util;
  9. using MECF.Framework.Common.Equipment;
  10. using MECF.Framework.Common.FAServices;
  11. using MECF.Framework.Common.Jobs;
  12. using MECF.Framework.Common.SubstrateTrackings;
  13. namespace JetVirgoPM.PMs.Routines
  14. {
  15. public interface IRecipeFACallback
  16. {
  17. void RecipeStart(string module, string recipeName);
  18. void RecipeComplete(string module, string recipeName);
  19. void RecipeStepStart(string module, string recipeName, int stepNumber);
  20. void RecipeStepEnd(string module, string recipeName, int stepNumber);
  21. void RecipeFailed(string module, string recipeName);
  22. }
  23. public class RecipeFACallback : IRecipeFACallback
  24. {
  25. //private const string RecipeStartEvent = "RecipeStart";
  26. //private const string RecipeCompleteEvent = "RecipeComplete";
  27. //private const string RecipeStepStartEvent = "RecipeStepStart";
  28. //private const string RecipeStepEndEvent = "RecipeStepEnd";
  29. //private const string RecipeFailedEvent = "RecipeFailed";
  30. private const string PMARecipeStartEvent = "PMARecipeStart";
  31. private const string PMARecipeCompleteEvent = "PMARecipeComplete";
  32. private const string PMARecipeStepStartEvent = "PMARecipeStepStart";
  33. private const string PMARecipeStepEndEvent = "PMARecipeStepEnd";
  34. private const string PMARecipeFailedEvent = "PMARecipeFailed";
  35. private const string PMBRecipeStartEvent = "PMBRecipeStart";
  36. private const string PMBRecipeCompleteEvent = "PMBRecipeComplete";
  37. private const string PMBRecipeStepStartEvent = "PMBRecipeStepStart";
  38. private const string PMBRecipeStepEndEvent = "PMBRecipeStepEnd";
  39. private const string PMBRecipeFailedEvent = "PMBRecipeFailed";
  40. private const string PMCRecipeStartEvent = "PMCRecipeStart";
  41. private const string PMCRecipeCompleteEvent = "PMCRecipeComplete";
  42. private const string PMCRecipeStepStartEvent = "PMCRecipeStepStart";
  43. private const string PMCRecipeStepEndEvent = "PMCRecipeStepEnd";
  44. private const string PMCRecipeFailedEvent = "PMCRecipeFailed";
  45. private const string PMDRecipeStartEvent = "PMDRecipeStart";
  46. private const string PMDRecipeCompleteEvent = "PMDRecipeComplete";
  47. private const string PMDRecipeStepStartEvent = "PMDRecipeStepStart";
  48. private const string PMDRecipeStepEndEvent = "PMDRecipeStepEnd";
  49. private const string PMDRecipeFailedEvent = "PMDRecipeFailed";
  50. //private const string PM1RecipeStart = "PM1RecipeStart";
  51. //private const string PM1RecipeComplete = "PM1RecipeComplete";
  52. //private const string PM1RecipeStepStart = "PM1RecipeStepStart";
  53. //private const string PM1RecipeStepEnd = "PM1RecipeStepEnd";
  54. //private const string PM1RecipeFailed = "PM1RecipeFailed";
  55. //private const string PM2RecipeStart = "PM2RecipeStart";
  56. //private const string PM2RecipeComplete = "PM2RecipeComplete";
  57. //private const string PM2RecipeStepStart = "PM2RecipeStepStart";
  58. //private const string PM2RecipeStepEnd = "PM2RecipeStepEnd";
  59. //private const string PM2RecipeFailed = "PM2RecipeFailed";
  60. //private Dictionary<ModuleName, string> PMRecipeStart = new Dictionary<ModuleName, string>()
  61. //{
  62. // {ModuleName.PMA, PM1RecipeStart},
  63. // {ModuleName.PMB, PM2RecipeStart},
  64. //};
  65. //private Dictionary<ModuleName, string> PMRecipeComplete = new Dictionary<ModuleName, string>()
  66. //{
  67. // {ModuleName.PMA, PM1RecipeComplete},
  68. // {ModuleName.PMB, PM2RecipeComplete},
  69. //};
  70. //private Dictionary<ModuleName, string> PMRecipeStepStart = new Dictionary<ModuleName, string>()
  71. //{
  72. // {ModuleName.PMA, PM1RecipeStepStart},
  73. // {ModuleName.PMB, PM2RecipeStepStart},
  74. //};
  75. //private Dictionary<ModuleName, string> PMRecipeStepEnd = new Dictionary<ModuleName, string>()
  76. //{
  77. // {ModuleName.PMA, PM1RecipeStepEnd},
  78. // {ModuleName.PMB, PM2RecipeStepEnd},
  79. //};
  80. //private Dictionary<ModuleName, string> PMRecipeFailed = new Dictionary<ModuleName, string>()
  81. //{
  82. // {ModuleName.PMA, PM1RecipeFailed},
  83. // {ModuleName.PMB, PM2RecipeFailed},
  84. //};
  85. private Dictionary<int, string> PortId = new Dictionary<int, string>()
  86. {
  87. {(int)ModuleName.LP1, "1"},
  88. {(int)ModuleName.LP2, "2"},
  89. {(int)ModuleName.LP3, "3"},
  90. };
  91. private const int OneValue = 1;
  92. private const int TwoValue = 2;
  93. public RecipeFACallback()
  94. {
  95. //EV.Subscribe(new EventItem("Event", RecipeStartEvent, RecipeStartEvent));
  96. //EV.Subscribe(new EventItem("Event", RecipeCompleteEvent, RecipeCompleteEvent));
  97. //EV.Subscribe(new EventItem("Event", RecipeStepStartEvent, RecipeStepStartEvent));
  98. //EV.Subscribe(new EventItem("Event", RecipeStepEndEvent, RecipeStepEndEvent));
  99. //EV.Subscribe(new EventItem("Event", RecipeFailedEvent, RecipeFailedEvent));
  100. EV.Subscribe(new EventItem("Event", PMARecipeStartEvent, PMARecipeStartEvent));
  101. EV.Subscribe(new EventItem("Event", PMARecipeCompleteEvent, PMARecipeCompleteEvent));
  102. EV.Subscribe(new EventItem("Event", PMARecipeStepStartEvent, PMARecipeStepStartEvent));
  103. EV.Subscribe(new EventItem("Event", PMARecipeStepEndEvent, PMARecipeStepEndEvent));
  104. EV.Subscribe(new EventItem("Event", PMARecipeFailedEvent, PMARecipeFailedEvent));
  105. EV.Subscribe(new EventItem("Event", PMBRecipeStartEvent, PMBRecipeStartEvent));
  106. EV.Subscribe(new EventItem("Event", PMBRecipeCompleteEvent, PMBRecipeCompleteEvent));
  107. EV.Subscribe(new EventItem("Event", PMBRecipeStepStartEvent, PMBRecipeStepStartEvent));
  108. EV.Subscribe(new EventItem("Event", PMBRecipeStepEndEvent, PMBRecipeStepEndEvent));
  109. EV.Subscribe(new EventItem("Event", PMBRecipeFailedEvent, PMBRecipeFailedEvent));
  110. EV.Subscribe(new EventItem("Event", PMCRecipeStartEvent, PMCRecipeStartEvent));
  111. EV.Subscribe(new EventItem("Event", PMCRecipeCompleteEvent, PMCRecipeCompleteEvent));
  112. EV.Subscribe(new EventItem("Event", PMCRecipeStepStartEvent, PMCRecipeStepStartEvent));
  113. EV.Subscribe(new EventItem("Event", PMCRecipeStepEndEvent, PMCRecipeStepEndEvent));
  114. EV.Subscribe(new EventItem("Event", PMCRecipeFailedEvent, PMCRecipeFailedEvent));
  115. EV.Subscribe(new EventItem("Event", PMDRecipeStartEvent, PMDRecipeStartEvent));
  116. EV.Subscribe(new EventItem("Event", PMDRecipeCompleteEvent, PMDRecipeCompleteEvent));
  117. EV.Subscribe(new EventItem("Event", PMDRecipeStepStartEvent, PMDRecipeStepStartEvent));
  118. EV.Subscribe(new EventItem("Event", PMDRecipeStepEndEvent, PMDRecipeStepEndEvent));
  119. EV.Subscribe(new EventItem("Event", PMDRecipeFailedEvent, PMDRecipeFailedEvent));
  120. }
  121. public void RecipeComplete(string module, string recipeName)
  122. {
  123. if (!ModuleHelper.IsPm(module))
  124. return;
  125. WaferInfo wafer0 = WaferManager.Instance.GetWafer(ModuleHelper.Converter(module), 0);
  126. WaferInfo wafer1 = WaferManager.Instance.GetWafer(ModuleHelper.Converter(module), 1);
  127. if (!wafer0.IsEmpty && module == ModuleName.PMA.ToString())
  128. {
  129. if (PortId.ContainsKey(wafer0.OriginStation))
  130. {
  131. EV.Notify(PMARecipeCompleteEvent, new SerializableDictionary<string, string>()
  132. {
  133. {DataVariables.LotID, wafer0.LotId},
  134. {DataVariables.RecipeID, recipeName},
  135. {DataVariables.StationName, GetEAPName(module, OneValue)},
  136. {DataVariables.PortID, PortId[wafer0.OriginStation]},
  137. {DataVariables.CarrierID, wafer0.OriginCarrierID},
  138. {DataVariables.SlotID, (wafer0.OriginSlot+1).ToString()}
  139. });
  140. }
  141. else
  142. {
  143. EV.Notify(PMARecipeCompleteEvent, new SerializableDictionary<string, string>()
  144. {
  145. {DataVariables.LotID, wafer0.LotId},
  146. {DataVariables.RecipeID, recipeName},
  147. {DataVariables.StationName, GetEAPName(module, OneValue)},
  148. {DataVariables.CarrierID, wafer0.OriginCarrierID},
  149. {DataVariables.SlotID, (wafer0.OriginSlot+1).ToString()}
  150. });
  151. }
  152. }
  153. if (!wafer1.IsEmpty && module == ModuleName.PMA.ToString())
  154. {
  155. if (PortId.ContainsKey(wafer1.OriginStation))
  156. {
  157. EV.Notify(PMBRecipeCompleteEvent, new SerializableDictionary<string, string>()
  158. {
  159. {DataVariables.LotID, wafer1.LotId},
  160. {DataVariables.RecipeID, recipeName},
  161. {DataVariables.StationName, GetEAPName(module, TwoValue)},
  162. {DataVariables.PortID, PortId[wafer1.OriginStation]},
  163. {DataVariables.CarrierID, wafer1.OriginCarrierID},
  164. {DataVariables.SlotID, (wafer1.OriginSlot+1).ToString()}
  165. });
  166. }
  167. else
  168. {
  169. EV.Notify(PMBRecipeCompleteEvent, new SerializableDictionary<string, string>()
  170. {
  171. {DataVariables.LotID, wafer1.LotId},
  172. {DataVariables.RecipeID, recipeName},
  173. {DataVariables.StationName, GetEAPName(module, TwoValue)},
  174. {DataVariables.CarrierID, wafer1.OriginCarrierID},
  175. {DataVariables.SlotID, (wafer1.OriginSlot+1).ToString()}
  176. });
  177. }
  178. }
  179. if (!wafer0.IsEmpty && module == ModuleName.PMB.ToString())
  180. {
  181. if (PortId.ContainsKey(wafer0.OriginStation))
  182. {
  183. EV.Notify(PMCRecipeCompleteEvent, new SerializableDictionary<string, string>()
  184. {
  185. {DataVariables.LotID, wafer0.LotId},
  186. {DataVariables.RecipeID, recipeName},
  187. {DataVariables.StationName, GetEAPName(module, OneValue)},
  188. {DataVariables.PortID, PortId[wafer0.OriginStation]},
  189. {DataVariables.CarrierID, wafer0.OriginCarrierID},
  190. {DataVariables.SlotID, (wafer0.OriginSlot+1).ToString()}
  191. });
  192. }
  193. else
  194. {
  195. EV.Notify(PMCRecipeCompleteEvent, new SerializableDictionary<string, string>()
  196. {
  197. {DataVariables.LotID, wafer0.LotId},
  198. {DataVariables.RecipeID, recipeName},
  199. {DataVariables.StationName, GetEAPName(module, OneValue)},
  200. {DataVariables.CarrierID, wafer0.OriginCarrierID},
  201. {DataVariables.SlotID, (wafer0.OriginSlot+1).ToString()}
  202. });
  203. }
  204. }
  205. if (!wafer1.IsEmpty && module == ModuleName.PMB.ToString())
  206. {
  207. if (PortId.ContainsKey(wafer1.OriginStation))
  208. {
  209. EV.Notify(PMDRecipeCompleteEvent, new SerializableDictionary<string, string>()
  210. {
  211. {DataVariables.LotID, wafer1.LotId},
  212. {DataVariables.RecipeID, recipeName},
  213. {DataVariables.StationName, GetEAPName(module, TwoValue)},
  214. {DataVariables.PortID, PortId[wafer1.OriginStation]},
  215. {DataVariables.CarrierID, wafer1.OriginCarrierID},
  216. {DataVariables.SlotID, (wafer1.OriginSlot+1).ToString()}
  217. });
  218. }
  219. else
  220. {
  221. EV.Notify(PMDRecipeCompleteEvent, new SerializableDictionary<string, string>()
  222. {
  223. {DataVariables.LotID, wafer1.LotId},
  224. {DataVariables.RecipeID, recipeName},
  225. {DataVariables.StationName, GetEAPName(module, TwoValue)},
  226. {DataVariables.CarrierID, wafer1.OriginCarrierID},
  227. {DataVariables.SlotID, (wafer1.OriginSlot+1).ToString()}
  228. });
  229. }
  230. }
  231. }
  232. private string GetEAPName(string module, int slot)
  233. {
  234. var key = $"{module}{slot}";
  235. var map = Aitex.Core.RT.RecipeCenter.RecipeFileManager.Instance.GetPMToEapConvert();
  236. if (map != null && map.ContainsKey(key))
  237. {
  238. return map[key];
  239. }
  240. return module;
  241. }
  242. public void RecipeFailed(string module, string recipeName)
  243. {
  244. if (!ModuleHelper.IsPm(module))
  245. return;
  246. WaferInfo wafer0 = WaferManager.Instance.GetWafer(ModuleHelper.Converter(module), 0);
  247. WaferInfo wafer1 = WaferManager.Instance.GetWafer(ModuleHelper.Converter(module), 1);
  248. if (!wafer0.IsEmpty && module == ModuleName.PMA.ToString())
  249. {
  250. if (PortId.ContainsKey(wafer0.OriginStation))
  251. {
  252. EV.Notify(PMARecipeFailedEvent, new SerializableDictionary<string, string>()
  253. {
  254. {DataVariables.LotID, wafer0.LotId},
  255. {DataVariables.RecipeID, recipeName},
  256. {DataVariables.StationName, GetEAPName(module, OneValue)},
  257. {DataVariables.PortID, PortId[wafer0.OriginStation]},
  258. {DataVariables.CarrierID, wafer0.OriginCarrierID},
  259. {DataVariables.SlotID, (wafer0.OriginSlot+1).ToString()}
  260. });
  261. }
  262. else
  263. {
  264. EV.Notify(PMARecipeFailedEvent, new SerializableDictionary<string, string>()
  265. {
  266. {DataVariables.LotID, wafer0.LotId},
  267. {DataVariables.RecipeID, recipeName},
  268. {DataVariables.StationName, GetEAPName(module, OneValue)},
  269. {DataVariables.CarrierID, wafer0.OriginCarrierID},
  270. {DataVariables.SlotID, (wafer0.OriginSlot+1).ToString()}
  271. });
  272. }
  273. }
  274. if (!wafer1.IsEmpty && module == ModuleName.PMA.ToString())
  275. {
  276. if (PortId.ContainsKey(wafer1.OriginStation))
  277. {
  278. EV.Notify(PMBRecipeFailedEvent, new SerializableDictionary<string, string>()
  279. {
  280. {DataVariables.LotID, wafer1.LotId},
  281. {DataVariables.RecipeID, recipeName},
  282. {DataVariables.StationName, GetEAPName(module, TwoValue)},
  283. {DataVariables.PortID, PortId[wafer1.OriginStation]},
  284. {DataVariables.CarrierID, wafer1.OriginCarrierID},
  285. {DataVariables.SlotID, (wafer1.OriginSlot+1).ToString()}
  286. });
  287. }
  288. else
  289. {
  290. EV.Notify(PMBRecipeFailedEvent, new SerializableDictionary<string, string>()
  291. {
  292. {DataVariables.LotID, wafer1.LotId},
  293. {DataVariables.RecipeID, recipeName},
  294. {DataVariables.StationName, GetEAPName(module, TwoValue)},
  295. {DataVariables.CarrierID, wafer1.OriginCarrierID},
  296. {DataVariables.SlotID, (wafer1.OriginSlot+1).ToString()}
  297. });
  298. }
  299. }
  300. if (!wafer0.IsEmpty && module == ModuleName.PMB.ToString())
  301. {
  302. if (PortId.ContainsKey(wafer0.OriginStation))
  303. {
  304. EV.Notify(PMCRecipeFailedEvent, new SerializableDictionary<string, string>()
  305. {
  306. {DataVariables.LotID, wafer0.LotId},
  307. {DataVariables.RecipeID, recipeName},
  308. {DataVariables.StationName, GetEAPName(module, OneValue)},
  309. {DataVariables.PortID, PortId[wafer0.OriginStation]},
  310. {DataVariables.CarrierID, wafer0.OriginCarrierID},
  311. {DataVariables.SlotID, (wafer0.OriginSlot+1).ToString()}
  312. });
  313. }
  314. else
  315. {
  316. EV.Notify(PMCRecipeFailedEvent, new SerializableDictionary<string, string>()
  317. {
  318. {DataVariables.LotID, wafer0.LotId},
  319. {DataVariables.RecipeID, recipeName},
  320. {DataVariables.StationName, GetEAPName(module, OneValue)},
  321. {DataVariables.CarrierID, wafer0.OriginCarrierID},
  322. {DataVariables.SlotID, (wafer0.OriginSlot+1).ToString()}
  323. });
  324. }
  325. }
  326. if (!wafer1.IsEmpty && module == ModuleName.PMB.ToString())
  327. {
  328. if (PortId.ContainsKey(wafer1.OriginStation))
  329. {
  330. EV.Notify(PMDRecipeFailedEvent, new SerializableDictionary<string, string>()
  331. {
  332. {DataVariables.LotID, wafer1.LotId},
  333. {DataVariables.RecipeID, recipeName},
  334. {DataVariables.StationName, GetEAPName(module, TwoValue)},
  335. {DataVariables.PortID, PortId[wafer1.OriginStation]},
  336. {DataVariables.CarrierID, wafer1.OriginCarrierID},
  337. {DataVariables.SlotID, (wafer1.OriginSlot+1).ToString()}
  338. });
  339. }
  340. else
  341. {
  342. EV.Notify(PMDRecipeFailedEvent, new SerializableDictionary<string, string>()
  343. {
  344. {DataVariables.LotID, wafer1.LotId},
  345. {DataVariables.RecipeID, recipeName},
  346. {DataVariables.StationName, GetEAPName(module, TwoValue)},
  347. {DataVariables.CarrierID, wafer1.OriginCarrierID},
  348. {DataVariables.SlotID, (wafer1.OriginSlot+1).ToString()}
  349. });
  350. }
  351. }
  352. }
  353. public void RecipeStart(string module, string recipeName)
  354. {
  355. if (!ModuleHelper.IsPm(module))
  356. return;
  357. WaferInfo wafer0 = WaferManager.Instance.GetWafer(ModuleHelper.Converter(module), 0);
  358. WaferInfo wafer1 = WaferManager.Instance.GetWafer(ModuleHelper.Converter(module), 1);
  359. if (!wafer0.IsEmpty && module == ModuleName.PMA.ToString())
  360. {
  361. if (PortId.ContainsKey(wafer0.OriginStation))
  362. {
  363. EV.Notify(PMARecipeStartEvent, new SerializableDictionary<string, string>()
  364. {
  365. {DataVariables.LotID, wafer0.LotId},
  366. {DataVariables.RecipeID, recipeName},
  367. {DataVariables.StationName, GetEAPName(module, OneValue)},
  368. {DataVariables.PortID, PortId[wafer0.OriginStation]},
  369. {DataVariables.CarrierID, wafer0.OriginCarrierID},
  370. {DataVariables.SlotID, (wafer0.OriginSlot+1).ToString()}
  371. });
  372. }
  373. else
  374. {
  375. EV.Notify(PMARecipeStartEvent, new SerializableDictionary<string, string>()
  376. {
  377. {DataVariables.LotID, wafer0.LotId},
  378. {DataVariables.RecipeID, recipeName},
  379. {DataVariables.StationName, GetEAPName(module, OneValue)},
  380. {DataVariables.CarrierID, wafer0.OriginCarrierID},
  381. {DataVariables.SlotID, (wafer0.OriginSlot+1).ToString()}
  382. });
  383. }
  384. }
  385. if (!wafer1.IsEmpty && module == ModuleName.PMA.ToString())
  386. {
  387. if (PortId.ContainsKey(wafer1.OriginStation))
  388. {
  389. EV.Notify(PMBRecipeStartEvent, new SerializableDictionary<string, string>()
  390. {
  391. {DataVariables.LotID, wafer1.LotId},
  392. {DataVariables.RecipeID, recipeName},
  393. {DataVariables.StationName, GetEAPName(module, TwoValue)},
  394. {DataVariables.PortID, PortId[wafer1.OriginStation]},
  395. {DataVariables.CarrierID, wafer1.OriginCarrierID},
  396. {DataVariables.SlotID, (wafer1.OriginSlot+1).ToString()}
  397. });
  398. }
  399. else
  400. {
  401. EV.Notify(PMBRecipeStartEvent, new SerializableDictionary<string, string>()
  402. {
  403. {DataVariables.LotID, wafer1.LotId},
  404. {DataVariables.RecipeID, recipeName},
  405. {DataVariables.StationName, GetEAPName(module, TwoValue)},
  406. {DataVariables.CarrierID, wafer1.OriginCarrierID},
  407. {DataVariables.SlotID, (wafer1.OriginSlot+1).ToString()}
  408. });
  409. }
  410. }
  411. if (!wafer0.IsEmpty && module == ModuleName.PMB.ToString())
  412. {
  413. if (PortId.ContainsKey(wafer0.OriginStation))
  414. {
  415. EV.Notify(PMCRecipeStartEvent, new SerializableDictionary<string, string>()
  416. {
  417. {DataVariables.LotID, wafer0.LotId},
  418. {DataVariables.RecipeID, recipeName},
  419. {DataVariables.StationName, GetEAPName(module, OneValue)},
  420. {DataVariables.PortID, PortId[wafer0.OriginStation]},
  421. {DataVariables.CarrierID, wafer0.OriginCarrierID},
  422. {DataVariables.SlotID, (wafer0.OriginSlot+1).ToString()}
  423. });
  424. }
  425. else
  426. {
  427. EV.Notify(PMCRecipeStartEvent, new SerializableDictionary<string, string>()
  428. {
  429. {DataVariables.LotID, wafer0.LotId},
  430. {DataVariables.RecipeID, recipeName},
  431. {DataVariables.StationName, GetEAPName(module, OneValue)},
  432. {DataVariables.CarrierID, wafer0.OriginCarrierID},
  433. {DataVariables.SlotID, (wafer0.OriginSlot+1).ToString()}
  434. });
  435. }
  436. }
  437. if (!wafer1.IsEmpty && module == ModuleName.PMB.ToString())
  438. {
  439. if (PortId.ContainsKey(wafer1.OriginStation))
  440. {
  441. EV.Notify(PMDRecipeStartEvent, new SerializableDictionary<string, string>()
  442. {
  443. {DataVariables.LotID, wafer1.LotId},
  444. {DataVariables.RecipeID, recipeName},
  445. {DataVariables.StationName, GetEAPName(module, TwoValue)},
  446. {DataVariables.PortID, PortId[wafer1.OriginStation]},
  447. {DataVariables.CarrierID, wafer1.OriginCarrierID},
  448. {DataVariables.SlotID, (wafer1.OriginSlot+1).ToString()}
  449. });
  450. }
  451. else
  452. {
  453. EV.Notify(PMDRecipeStartEvent, new SerializableDictionary<string, string>()
  454. {
  455. {DataVariables.LotID, wafer1.LotId},
  456. {DataVariables.RecipeID, recipeName},
  457. {DataVariables.StationName, GetEAPName(module, TwoValue)},
  458. {DataVariables.CarrierID, wafer1.OriginCarrierID},
  459. {DataVariables.SlotID, (wafer1.OriginSlot+1).ToString()}
  460. });
  461. }
  462. }
  463. }
  464. public void RecipeStepEnd(string module, string recipeName, int stepNumber)
  465. {
  466. if (!ModuleHelper.IsPm(module))
  467. return;
  468. WaferInfo wafer0 = WaferManager.Instance.GetWafer(ModuleHelper.Converter(module), 0);
  469. WaferInfo wafer1 = WaferManager.Instance.GetWafer(ModuleHelper.Converter(module), 1);
  470. if (!wafer0.IsEmpty && module == ModuleName.PMA.ToString())
  471. {
  472. if (PortId.ContainsKey(wafer0.OriginStation))
  473. {
  474. EV.Notify(PMARecipeStepEndEvent, new SerializableDictionary<string, string>()
  475. {
  476. {DataVariables.LotID, wafer0.LotId},
  477. {DataVariables.RecipeID, recipeName},
  478. { DataVariables.RecipeStepNumber, (stepNumber + 1).ToString() },
  479. {DataVariables.StationName, GetEAPName(module, OneValue)},
  480. {DataVariables.PortID, PortId[wafer0.OriginStation]},
  481. {DataVariables.CarrierID, wafer0.OriginCarrierID},
  482. {DataVariables.SlotID, (wafer0.OriginSlot+1).ToString()}
  483. });
  484. }
  485. else
  486. {
  487. EV.Notify(PMARecipeStepEndEvent, new SerializableDictionary<string, string>()
  488. {
  489. {DataVariables.LotID, wafer0.LotId},
  490. {DataVariables.RecipeID, recipeName},
  491. { DataVariables.RecipeStepNumber, (stepNumber + 1).ToString() },
  492. {DataVariables.StationName, GetEAPName(module, OneValue)},
  493. {DataVariables.CarrierID, wafer0.OriginCarrierID},
  494. {DataVariables.SlotID, (wafer0.OriginSlot+1).ToString()}
  495. });
  496. }
  497. }
  498. if (!wafer1.IsEmpty && module == ModuleName.PMA.ToString())
  499. {
  500. if (PortId.ContainsKey(wafer1.OriginStation))
  501. {
  502. EV.Notify(PMBRecipeStepEndEvent, new SerializableDictionary<string, string>()
  503. {
  504. {DataVariables.LotID, wafer1.LotId},
  505. {DataVariables.RecipeID, recipeName},
  506. { DataVariables.RecipeStepNumber, (stepNumber + 1).ToString() },
  507. {DataVariables.StationName, GetEAPName(module, TwoValue)},
  508. {DataVariables.PortID, PortId[wafer1.OriginStation]},
  509. {DataVariables.CarrierID, wafer1.OriginCarrierID},
  510. {DataVariables.SlotID, (wafer1.OriginSlot+1).ToString()}
  511. });
  512. }
  513. else
  514. {
  515. EV.Notify(PMBRecipeStepEndEvent, new SerializableDictionary<string, string>()
  516. {
  517. {DataVariables.LotID, wafer1.LotId},
  518. {DataVariables.RecipeID, recipeName},
  519. { DataVariables.RecipeStepNumber, (stepNumber + 1).ToString() },
  520. {DataVariables.StationName, GetEAPName(module, TwoValue)},
  521. {DataVariables.CarrierID, wafer1.OriginCarrierID},
  522. {DataVariables.SlotID, (wafer1.OriginSlot+1).ToString()}
  523. });
  524. }
  525. }
  526. if (!wafer0.IsEmpty && module == ModuleName.PMB.ToString())
  527. {
  528. if (PortId.ContainsKey(wafer0.OriginStation))
  529. {
  530. EV.Notify(PMCRecipeStepEndEvent, new SerializableDictionary<string, string>()
  531. {
  532. {DataVariables.LotID, wafer0.LotId},
  533. {DataVariables.RecipeID, recipeName},
  534. { DataVariables.RecipeStepNumber, (stepNumber + 1).ToString() },
  535. {DataVariables.StationName, GetEAPName(module, OneValue)},
  536. {DataVariables.PortID, PortId[wafer0.OriginStation]},
  537. {DataVariables.CarrierID, wafer0.OriginCarrierID},
  538. {DataVariables.SlotID, (wafer0.OriginSlot+1).ToString()}
  539. });
  540. }
  541. else
  542. {
  543. EV.Notify(PMCRecipeStepEndEvent, new SerializableDictionary<string, string>()
  544. {
  545. {DataVariables.LotID, wafer0.LotId},
  546. {DataVariables.RecipeID, recipeName},
  547. { DataVariables.RecipeStepNumber, (stepNumber + 1).ToString() },
  548. {DataVariables.StationName, GetEAPName(module, OneValue)},
  549. {DataVariables.CarrierID, wafer0.OriginCarrierID},
  550. {DataVariables.SlotID, (wafer0.OriginSlot+1).ToString()}
  551. });
  552. }
  553. }
  554. if (!wafer1.IsEmpty && module == ModuleName.PMB.ToString())
  555. {
  556. if (PortId.ContainsKey(wafer1.OriginStation))
  557. {
  558. EV.Notify(PMDRecipeStepEndEvent, new SerializableDictionary<string, string>()
  559. {
  560. {DataVariables.LotID, wafer1.LotId},
  561. {DataVariables.RecipeID, recipeName},
  562. { DataVariables.RecipeStepNumber, (stepNumber + 1).ToString() },
  563. {DataVariables.StationName, GetEAPName(module, TwoValue)},
  564. {DataVariables.PortID, PortId[wafer1.OriginStation]},
  565. {DataVariables.CarrierID, wafer1.OriginCarrierID},
  566. {DataVariables.SlotID, (wafer1.OriginSlot+1).ToString()}
  567. });
  568. }
  569. else
  570. {
  571. EV.Notify(PMDRecipeStepEndEvent, new SerializableDictionary<string, string>()
  572. {
  573. {DataVariables.LotID, wafer1.LotId},
  574. {DataVariables.RecipeID, recipeName},
  575. { DataVariables.RecipeStepNumber, (stepNumber + 1).ToString() },
  576. {DataVariables.StationName, GetEAPName(module, TwoValue)},
  577. {DataVariables.CarrierID, wafer1.OriginCarrierID},
  578. {DataVariables.SlotID, (wafer1.OriginSlot+1).ToString()}
  579. });
  580. }
  581. }
  582. }
  583. public void RecipeStepStart(string module, string recipeName, int stepNumber)
  584. {
  585. if (!ModuleHelper.IsPm(module))
  586. return;
  587. WaferInfo wafer0 = WaferManager.Instance.GetWafer(ModuleHelper.Converter(module), 0);
  588. WaferInfo wafer1 = WaferManager.Instance.GetWafer(ModuleHelper.Converter(module), 1);
  589. if (!wafer0.IsEmpty && module == ModuleName.PMA.ToString())
  590. {
  591. if (PortId.ContainsKey(wafer0.OriginStation))
  592. {
  593. EV.Notify(PMARecipeStepStartEvent, new SerializableDictionary<string, string>()
  594. {
  595. {DataVariables.LotID, wafer0.LotId},
  596. {DataVariables.RecipeID, recipeName},
  597. { DataVariables.RecipeStepNumber, (stepNumber + 1).ToString() },
  598. {DataVariables.StationName, GetEAPName(module, OneValue)},
  599. {DataVariables.PortID, PortId[wafer0.OriginStation]},
  600. {DataVariables.CarrierID, wafer0.OriginCarrierID},
  601. {DataVariables.SlotID, (wafer0.OriginSlot+1).ToString()}
  602. });
  603. }
  604. else
  605. {
  606. EV.Notify(PMARecipeStepStartEvent, new SerializableDictionary<string, string>()
  607. {
  608. {DataVariables.LotID, wafer0.LotId},
  609. {DataVariables.RecipeID, recipeName},
  610. { DataVariables.RecipeStepNumber, (stepNumber + 1).ToString() },
  611. {DataVariables.StationName, GetEAPName(module, OneValue)},
  612. {DataVariables.CarrierID, wafer0.OriginCarrierID},
  613. {DataVariables.SlotID, (wafer0.OriginSlot+1).ToString()}
  614. });
  615. }
  616. }
  617. if (!wafer1.IsEmpty && module == ModuleName.PMA.ToString())
  618. {
  619. if (PortId.ContainsKey(wafer1.OriginStation))
  620. {
  621. EV.Notify(PMBRecipeStepStartEvent, new SerializableDictionary<string, string>()
  622. {
  623. {DataVariables.LotID, wafer1.LotId},
  624. {DataVariables.RecipeID, recipeName},
  625. { DataVariables.RecipeStepNumber, (stepNumber + 1).ToString() },
  626. {DataVariables.StationName, GetEAPName(module, TwoValue)},
  627. {DataVariables.PortID, PortId[wafer1.OriginStation]},
  628. {DataVariables.CarrierID, wafer1.OriginCarrierID},
  629. {DataVariables.SlotID, (wafer1.OriginSlot+1).ToString()}
  630. });
  631. }
  632. else
  633. {
  634. EV.Notify(PMBRecipeStepStartEvent, new SerializableDictionary<string, string>()
  635. {
  636. {DataVariables.LotID, wafer1.LotId},
  637. {DataVariables.RecipeID, recipeName},
  638. { DataVariables.RecipeStepNumber, (stepNumber + 1).ToString() },
  639. {DataVariables.StationName, GetEAPName(module, TwoValue)},
  640. {DataVariables.CarrierID, wafer1.OriginCarrierID},
  641. {DataVariables.SlotID, (wafer1.OriginSlot+1).ToString()}
  642. });
  643. }
  644. }
  645. if (!wafer0.IsEmpty && module == ModuleName.PMB.ToString())
  646. {
  647. if (PortId.ContainsKey(wafer0.OriginStation))
  648. {
  649. EV.Notify(PMCRecipeStepStartEvent, new SerializableDictionary<string, string>()
  650. {
  651. {DataVariables.LotID, wafer0.LotId},
  652. {DataVariables.RecipeID, recipeName},
  653. { DataVariables.RecipeStepNumber, (stepNumber + 1).ToString() },
  654. {DataVariables.StationName, GetEAPName(module, OneValue)},
  655. {DataVariables.PortID, PortId[wafer0.OriginStation]},
  656. {DataVariables.CarrierID, wafer0.OriginCarrierID},
  657. {DataVariables.SlotID, (wafer0.OriginSlot+1).ToString()}
  658. });
  659. }
  660. else
  661. {
  662. EV.Notify(PMCRecipeStepStartEvent, new SerializableDictionary<string, string>()
  663. {
  664. {DataVariables.LotID, wafer0.LotId},
  665. {DataVariables.RecipeID, recipeName},
  666. { DataVariables.RecipeStepNumber, (stepNumber + 1).ToString() },
  667. {DataVariables.StationName, GetEAPName(module, OneValue)},
  668. {DataVariables.CarrierID, wafer0.OriginCarrierID},
  669. {DataVariables.SlotID, (wafer0.OriginSlot+1).ToString()}
  670. });
  671. }
  672. }
  673. if (!wafer1.IsEmpty && module == ModuleName.PMB.ToString())
  674. {
  675. if (PortId.ContainsKey(wafer1.OriginStation))
  676. {
  677. EV.Notify(PMDRecipeStepStartEvent, new SerializableDictionary<string, string>()
  678. {
  679. {DataVariables.LotID, wafer1.LotId},
  680. {DataVariables.RecipeID, recipeName},
  681. { DataVariables.RecipeStepNumber, (stepNumber + 1).ToString() },
  682. {DataVariables.StationName, GetEAPName(module, TwoValue)},
  683. {DataVariables.PortID, PortId[wafer1.OriginStation]},
  684. {DataVariables.CarrierID, wafer1.OriginCarrierID},
  685. {DataVariables.SlotID, (wafer1.OriginSlot+1).ToString()}
  686. });
  687. }
  688. else
  689. {
  690. EV.Notify(PMDRecipeStepStartEvent, new SerializableDictionary<string, string>()
  691. {
  692. {DataVariables.LotID, wafer1.LotId},
  693. {DataVariables.RecipeID, recipeName},
  694. { DataVariables.RecipeStepNumber, (stepNumber + 1).ToString() },
  695. {DataVariables.StationName, GetEAPName(module, TwoValue)},
  696. {DataVariables.CarrierID, wafer1.OriginCarrierID},
  697. {DataVariables.SlotID, (wafer1.OriginSlot+1).ToString()}
  698. });
  699. }
  700. }
  701. }
  702. }
  703. }