Process_FA.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546
  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.VCEA, "1"},
  88. {(int)ModuleName.VCEB, "3"},
  89. {(int)ModuleName.CassAL, "1"},
  90. {(int)ModuleName.CassAR, "2"},
  91. {(int)ModuleName.CassBL, "3"},
  92. {(int)ModuleName.CassBR, "4"},
  93. };
  94. private const int OneValue = 1;
  95. private const int TwoValue = 2;
  96. public RecipeFACallback()
  97. {
  98. //EV.Subscribe(new EventItem("Event", RecipeStartEvent, RecipeStartEvent));
  99. //EV.Subscribe(new EventItem("Event", RecipeCompleteEvent, RecipeCompleteEvent));
  100. //EV.Subscribe(new EventItem("Event", RecipeStepStartEvent, RecipeStepStartEvent));
  101. //EV.Subscribe(new EventItem("Event", RecipeStepEndEvent, RecipeStepEndEvent));
  102. //EV.Subscribe(new EventItem("Event", RecipeFailedEvent, RecipeFailedEvent));
  103. EV.Subscribe(new EventItem("Event", PMARecipeStartEvent, PMARecipeStartEvent));
  104. EV.Subscribe(new EventItem("Event", PMARecipeCompleteEvent, PMARecipeCompleteEvent));
  105. EV.Subscribe(new EventItem("Event", PMARecipeStepStartEvent, PMARecipeStepStartEvent));
  106. EV.Subscribe(new EventItem("Event", PMARecipeStepEndEvent, PMARecipeStepEndEvent));
  107. EV.Subscribe(new EventItem("Event", PMARecipeFailedEvent, PMARecipeFailedEvent));
  108. EV.Subscribe(new EventItem("Event", PMBRecipeStartEvent, PMBRecipeStartEvent));
  109. EV.Subscribe(new EventItem("Event", PMBRecipeCompleteEvent, PMBRecipeCompleteEvent));
  110. EV.Subscribe(new EventItem("Event", PMBRecipeStepStartEvent, PMBRecipeStepStartEvent));
  111. EV.Subscribe(new EventItem("Event", PMBRecipeStepEndEvent, PMBRecipeStepEndEvent));
  112. EV.Subscribe(new EventItem("Event", PMBRecipeFailedEvent, PMBRecipeFailedEvent));
  113. EV.Subscribe(new EventItem("Event", PMCRecipeStartEvent, PMCRecipeStartEvent));
  114. EV.Subscribe(new EventItem("Event", PMCRecipeCompleteEvent, PMCRecipeCompleteEvent));
  115. EV.Subscribe(new EventItem("Event", PMCRecipeStepStartEvent, PMCRecipeStepStartEvent));
  116. EV.Subscribe(new EventItem("Event", PMCRecipeStepEndEvent, PMCRecipeStepEndEvent));
  117. EV.Subscribe(new EventItem("Event", PMCRecipeFailedEvent, PMCRecipeFailedEvent));
  118. EV.Subscribe(new EventItem("Event", PMDRecipeStartEvent, PMDRecipeStartEvent));
  119. EV.Subscribe(new EventItem("Event", PMDRecipeCompleteEvent, PMDRecipeCompleteEvent));
  120. EV.Subscribe(new EventItem("Event", PMDRecipeStepStartEvent, PMDRecipeStepStartEvent));
  121. EV.Subscribe(new EventItem("Event", PMDRecipeStepEndEvent, PMDRecipeStepEndEvent));
  122. EV.Subscribe(new EventItem("Event", PMDRecipeFailedEvent, PMDRecipeFailedEvent));
  123. }
  124. public void RecipeComplete(string module, string recipeName)
  125. {
  126. if (!ModuleHelper.IsPm(module))
  127. return;
  128. WaferInfo wafer0 = WaferManager.Instance.GetWafer(ModuleHelper.Converter(module), 0);
  129. WaferInfo wafer1 = WaferManager.Instance.GetWafer(ModuleHelper.Converter(module), 1);
  130. if (!wafer0.IsEmpty && module == ModuleName.PMA.ToString())
  131. {
  132. NotifyRecipeComplete(PMARecipeCompleteEvent, wafer0, recipeName, module, OneValue);
  133. }
  134. if (!wafer1.IsEmpty && module == ModuleName.PMA.ToString())
  135. {
  136. NotifyRecipeComplete(PMARecipeCompleteEvent,wafer1 , recipeName, module, TwoValue);
  137. }
  138. if (!wafer0.IsEmpty && module == ModuleName.PMB.ToString())
  139. {
  140. NotifyRecipeComplete(PMBRecipeCompleteEvent,wafer0 , recipeName, module, OneValue);
  141. }
  142. if (!wafer1.IsEmpty && module == ModuleName.PMB.ToString())
  143. {
  144. NotifyRecipeComplete(PMBRecipeCompleteEvent, wafer1, recipeName, module, TwoValue);
  145. }
  146. if (!wafer0.IsEmpty && module == ModuleName.PMC.ToString())
  147. {
  148. NotifyRecipeComplete(PMCRecipeCompleteEvent, wafer0, recipeName, module, OneValue);
  149. }
  150. if (!wafer1.IsEmpty && module == ModuleName.PMC.ToString())
  151. {
  152. NotifyRecipeComplete(PMCRecipeCompleteEvent, wafer1, recipeName, module, TwoValue);
  153. }
  154. if (!wafer0.IsEmpty && module == ModuleName.PMD.ToString())
  155. {
  156. NotifyRecipeComplete(PMDRecipeStepEndEvent, wafer0, recipeName, module, OneValue);
  157. }
  158. if (!wafer1.IsEmpty && module == ModuleName.PMD.ToString())
  159. {
  160. NotifyRecipeComplete(PMDRecipeStepEndEvent, wafer1, recipeName, module, TwoValue);
  161. }
  162. }
  163. /// <summary>
  164. /// 上报Recipe完成事件
  165. /// </summary>
  166. /// <param name="eventName"></param>
  167. /// <param name="waferInfo"></param>
  168. /// <param name="recipeName"></param>
  169. /// <param name="module"></param>
  170. /// <param name="pmValue"></param>
  171. private void NotifyRecipeComplete(string eventName,WaferInfo waferInfo,string recipeName,string module,int oneTwoValue)
  172. {
  173. if (PortId.ContainsKey(waferInfo.OriginStation))
  174. {
  175. EV.Notify(eventName, new SerializableDictionary<string, string>()
  176. {
  177. {DataVariables.LotID, waferInfo.LotId},
  178. {DataVariables.RecipeID, recipeName},
  179. {DataVariables.StationName, GetEAPName(module, oneTwoValue)},
  180. {DataVariables.PortID, PortId[waferInfo.OriginStation]},
  181. {DataVariables.CarrierID, waferInfo.OriginCarrierID},
  182. {DataVariables.SlotID, (waferInfo.OriginSlot+1).ToString()}
  183. });
  184. }
  185. else
  186. {
  187. EV.Notify(eventName, new SerializableDictionary<string, string>()
  188. {
  189. {DataVariables.LotID, waferInfo.LotId},
  190. {DataVariables.RecipeID, recipeName},
  191. {DataVariables.StationName, GetEAPName(module, oneTwoValue)},
  192. {DataVariables.CarrierID, waferInfo.OriginCarrierID},
  193. {DataVariables.SlotID, (waferInfo.OriginSlot+1).ToString()}
  194. });
  195. }
  196. }
  197. private string GetEAPName(string module, int slot)
  198. {
  199. var key = $"{module}{slot}";
  200. var map = Aitex.Core.RT.RecipeCenter.RecipeFileManager.Instance.GetPMToEapConvert();
  201. if (map != null && map.ContainsKey(key))
  202. {
  203. return map[key];
  204. }
  205. return module;
  206. }
  207. public void RecipeFailed(string module, string recipeName)
  208. {
  209. if (!ModuleHelper.IsPm(module))
  210. return;
  211. WaferInfo wafer0 = WaferManager.Instance.GetWafer(ModuleHelper.Converter(module), 0);
  212. WaferInfo wafer1 = WaferManager.Instance.GetWafer(ModuleHelper.Converter(module), 1);
  213. if (!wafer0.IsEmpty && module == ModuleName.PMA.ToString())
  214. {
  215. NotifyRecipeFailedEvent(PMARecipeFailedEvent, wafer0, recipeName, module, OneValue);
  216. }
  217. if (!wafer1.IsEmpty && module == ModuleName.PMA.ToString())
  218. {
  219. NotifyRecipeFailedEvent(PMARecipeFailedEvent, wafer1, recipeName, module, TwoValue);
  220. }
  221. if (!wafer0.IsEmpty && module == ModuleName.PMB.ToString())
  222. {
  223. NotifyRecipeFailedEvent(PMBRecipeFailedEvent, wafer0, recipeName, module, OneValue);
  224. }
  225. if (!wafer1.IsEmpty && module == ModuleName.PMB.ToString())
  226. {
  227. NotifyRecipeFailedEvent(PMBRecipeFailedEvent, wafer1, recipeName, module, TwoValue);
  228. }
  229. if (!wafer0.IsEmpty && module == ModuleName.PMC.ToString())
  230. {
  231. NotifyRecipeFailedEvent(PMCRecipeFailedEvent, wafer0, recipeName, module, OneValue);
  232. }
  233. if (!wafer1.IsEmpty && module == ModuleName.PMC.ToString())
  234. {
  235. NotifyRecipeFailedEvent(PMCRecipeFailedEvent, wafer1, recipeName, module, TwoValue);
  236. }
  237. if (!wafer0.IsEmpty && module == ModuleName.PMD.ToString())
  238. {
  239. NotifyRecipeFailedEvent(PMARecipeFailedEvent, wafer0, recipeName, module, OneValue);
  240. }
  241. if (!wafer1.IsEmpty && module == ModuleName.PMD.ToString())
  242. {
  243. NotifyRecipeFailedEvent(PMARecipeFailedEvent, wafer1, recipeName, module, TwoValue);
  244. }
  245. }
  246. private void NotifyRecipeFailedEvent(string eventName,WaferInfo waferInfo,string recipeName,string module,int oneTwoValue)
  247. {
  248. if (PortId.ContainsKey(waferInfo.OriginStation))
  249. {
  250. EV.Notify(eventName, new SerializableDictionary<string, string>()
  251. {
  252. {DataVariables.LotID, waferInfo.LotId},
  253. {DataVariables.RecipeID, recipeName},
  254. {DataVariables.StationName, GetEAPName(module, oneTwoValue)},
  255. {DataVariables.PortID, PortId[waferInfo.OriginStation]},
  256. {DataVariables.CarrierID, waferInfo.OriginCarrierID},
  257. {DataVariables.SlotID, (waferInfo.OriginSlot+1).ToString()}
  258. });
  259. }
  260. else
  261. {
  262. EV.Notify(eventName, new SerializableDictionary<string, string>()
  263. {
  264. {DataVariables.LotID, waferInfo.LotId},
  265. {DataVariables.RecipeID, recipeName},
  266. {DataVariables.StationName, GetEAPName(module, oneTwoValue)},
  267. {DataVariables.CarrierID, waferInfo.OriginCarrierID},
  268. {DataVariables.SlotID, (waferInfo.OriginSlot+1).ToString()}
  269. });
  270. }
  271. }
  272. public void RecipeStart(string module, string recipeName)
  273. {
  274. if (!ModuleHelper.IsPm(module))
  275. return;
  276. WaferInfo wafer0 = WaferManager.Instance.GetWafer(ModuleHelper.Converter(module), 0);
  277. WaferInfo wafer1 = WaferManager.Instance.GetWafer(ModuleHelper.Converter(module), 1);
  278. if (!wafer0.IsEmpty && module == ModuleName.PMA.ToString())
  279. {
  280. NotifyRecipeStartEvent(PMARecipeStartEvent, wafer0, recipeName, module, OneValue);
  281. }
  282. if (!wafer1.IsEmpty && module == ModuleName.PMA.ToString())
  283. {
  284. NotifyRecipeStartEvent(PMARecipeStartEvent, wafer1, recipeName, module, TwoValue);
  285. }
  286. if (!wafer0.IsEmpty && module == ModuleName.PMB.ToString())
  287. {
  288. NotifyRecipeStartEvent(PMBRecipeStartEvent, wafer0, recipeName, module, OneValue);
  289. }
  290. if (!wafer1.IsEmpty && module == ModuleName.PMB.ToString())
  291. {
  292. NotifyRecipeStartEvent(PMBRecipeStartEvent, wafer1, recipeName, module, TwoValue);
  293. }
  294. if (!wafer0.IsEmpty && module == ModuleName.PMC.ToString())
  295. {
  296. NotifyRecipeStartEvent(PMCRecipeStartEvent, wafer0, recipeName, module, OneValue);
  297. }
  298. if (!wafer1.IsEmpty && module == ModuleName.PMC.ToString())
  299. {
  300. NotifyRecipeStartEvent(PMCRecipeStartEvent, wafer1, recipeName, module, TwoValue);
  301. }
  302. if (!wafer0.IsEmpty && module == ModuleName.PMD.ToString())
  303. {
  304. NotifyRecipeStartEvent(PMDRecipeStartEvent, wafer0, recipeName, module, OneValue);
  305. }
  306. if (!wafer1.IsEmpty && module == ModuleName.PMD.ToString())
  307. {
  308. NotifyRecipeStartEvent(PMDRecipeStartEvent, wafer1, recipeName, module, TwoValue);
  309. }
  310. }
  311. private void NotifyRecipeStartEvent(string eventName,WaferInfo waferInfo,string recipeName,string module,int oneTwoValue)
  312. {
  313. if (PortId.ContainsKey(waferInfo.OriginStation))
  314. {
  315. EV.Notify(eventName, new SerializableDictionary<string, string>()
  316. {
  317. {DataVariables.LotID, waferInfo.LotId},
  318. {DataVariables.RecipeID, recipeName},
  319. {DataVariables.StationName, GetEAPName(module, oneTwoValue)},
  320. {DataVariables.PortID, PortId[waferInfo.OriginStation]},
  321. {DataVariables.CarrierID, waferInfo.OriginCarrierID},
  322. {DataVariables.SlotID, (waferInfo.OriginSlot+1).ToString()}
  323. });
  324. }
  325. else
  326. {
  327. EV.Notify(eventName, new SerializableDictionary<string, string>()
  328. {
  329. {DataVariables.LotID, waferInfo.LotId},
  330. {DataVariables.RecipeID, recipeName},
  331. {DataVariables.StationName, GetEAPName(module, oneTwoValue)},
  332. {DataVariables.CarrierID, waferInfo.OriginCarrierID},
  333. {DataVariables.SlotID, (waferInfo.OriginSlot+1).ToString()}
  334. });
  335. }
  336. }
  337. public void RecipeStepEnd(string module, string recipeName, int stepNumber)
  338. {
  339. if (!ModuleHelper.IsPm(module))
  340. return;
  341. WaferInfo wafer0 = WaferManager.Instance.GetWafer(ModuleHelper.Converter(module), 0);
  342. WaferInfo wafer1 = WaferManager.Instance.GetWafer(ModuleHelper.Converter(module), 1);
  343. if (!wafer0.IsEmpty && module == ModuleName.PMA.ToString())
  344. {
  345. NotifyRecipeStepEndEvet(PMARecipeStepEndEvent, wafer0, recipeName, stepNumber, module, OneValue);
  346. }
  347. if (!wafer1.IsEmpty && module == ModuleName.PMA.ToString())
  348. {
  349. NotifyRecipeStepEndEvet(PMARecipeStepEndEvent, wafer1, recipeName, stepNumber, module, TwoValue);
  350. }
  351. if (!wafer0.IsEmpty && module == ModuleName.PMB.ToString())
  352. {
  353. NotifyRecipeStepEndEvet(PMDRecipeStepEndEvent, wafer0, recipeName, stepNumber, module, OneValue);
  354. }
  355. if (!wafer1.IsEmpty && module == ModuleName.PMB.ToString())
  356. {
  357. NotifyRecipeStepEndEvet(PMBRecipeStepEndEvent, wafer1, recipeName, stepNumber, module, TwoValue);
  358. }
  359. if (!wafer0.IsEmpty && module == ModuleName.PMC.ToString())
  360. {
  361. NotifyRecipeStepEndEvet(PMCRecipeStepEndEvent, wafer0, recipeName, stepNumber, module, OneValue);
  362. }
  363. if (!wafer1.IsEmpty && module == ModuleName.PMC.ToString())
  364. {
  365. NotifyRecipeStepEndEvet(PMCRecipeStepEndEvent, wafer1, recipeName, stepNumber, module, TwoValue);
  366. }
  367. if (!wafer0.IsEmpty && module == ModuleName.PMD.ToString())
  368. {
  369. NotifyRecipeStepEndEvet(PMDRecipeStepEndEvent, wafer0, recipeName, stepNumber, module, OneValue);
  370. }
  371. if (!wafer1.IsEmpty && module == ModuleName.PMD.ToString())
  372. {
  373. NotifyRecipeStepEndEvet(PMDRecipeStepEndEvent, wafer1, recipeName, stepNumber, module, TwoValue);
  374. }
  375. }
  376. private void NotifyRecipeStepEndEvet(string eventName,WaferInfo waferInfo,string recipeName,int stepNumber,string module,int oneTwoValue)
  377. {
  378. if (PortId.ContainsKey(waferInfo.OriginStation))
  379. {
  380. EV.Notify(eventName, new SerializableDictionary<string, string>()
  381. {
  382. {DataVariables.LotID, waferInfo.LotId},
  383. {DataVariables.RecipeID, recipeName},
  384. { DataVariables.RecipeStepNumber, (stepNumber + 1).ToString() },
  385. {DataVariables.StationName, GetEAPName(module, oneTwoValue)},
  386. {DataVariables.PortID, PortId[waferInfo.OriginStation]},
  387. {DataVariables.CarrierID, waferInfo.OriginCarrierID},
  388. {DataVariables.SlotID, (waferInfo.OriginSlot+1).ToString()}
  389. });
  390. }
  391. else
  392. {
  393. EV.Notify(eventName, new SerializableDictionary<string, string>()
  394. {
  395. {DataVariables.LotID, waferInfo.LotId},
  396. {DataVariables.RecipeID, recipeName},
  397. { DataVariables.RecipeStepNumber, (stepNumber + 1).ToString() },
  398. {DataVariables.StationName, GetEAPName(module, oneTwoValue)},
  399. {DataVariables.CarrierID, waferInfo.OriginCarrierID},
  400. {DataVariables.SlotID, (waferInfo.OriginSlot+1).ToString()}
  401. });
  402. }
  403. }
  404. public void RecipeStepStart(string module, string recipeName, int stepNumber)
  405. {
  406. if (!ModuleHelper.IsPm(module))
  407. return;
  408. WaferInfo wafer0 = WaferManager.Instance.GetWafer(ModuleHelper.Converter(module), 0);
  409. WaferInfo wafer1 = WaferManager.Instance.GetWafer(ModuleHelper.Converter(module), 1);
  410. if (!wafer0.IsEmpty && module == ModuleName.PMA.ToString())
  411. {
  412. NotifyRecipeStepStartEvent(PMARecipeStepStartEvent, wafer0, recipeName, stepNumber, module, OneValue);
  413. }
  414. if (!wafer1.IsEmpty && module == ModuleName.PMA.ToString())
  415. {
  416. NotifyRecipeStepStartEvent(PMARecipeStepStartEvent, wafer1, recipeName, stepNumber, module, TwoValue);
  417. }
  418. if (!wafer0.IsEmpty && module == ModuleName.PMB.ToString())
  419. {
  420. NotifyRecipeStepStartEvent(PMBRecipeStepStartEvent, wafer0, recipeName, stepNumber, module, OneValue);
  421. }
  422. if (!wafer1.IsEmpty && module == ModuleName.PMB.ToString())
  423. {
  424. NotifyRecipeStepStartEvent(PMBRecipeStepStartEvent, wafer1, recipeName, stepNumber, module, TwoValue);
  425. }
  426. if (!wafer0.IsEmpty && module == ModuleName.PMC.ToString())
  427. {
  428. NotifyRecipeStepStartEvent(PMCRecipeStepStartEvent, wafer0, recipeName, stepNumber, module, OneValue);
  429. }
  430. if (!wafer1.IsEmpty && module == ModuleName.PMC.ToString())
  431. {
  432. NotifyRecipeStepStartEvent(PMCRecipeStepStartEvent, wafer1, recipeName, stepNumber, module, TwoValue);
  433. }
  434. if (!wafer0.IsEmpty && module == ModuleName.PMD.ToString())
  435. {
  436. NotifyRecipeStepStartEvent(PMDRecipeStepStartEvent, wafer0, recipeName, stepNumber, module, OneValue);
  437. }
  438. if (!wafer1.IsEmpty && module == ModuleName.PMD.ToString())
  439. {
  440. NotifyRecipeStepStartEvent(PMDRecipeStepStartEvent, wafer1, recipeName, stepNumber, module, TwoValue);
  441. }
  442. }
  443. /// <summary>
  444. /// 上报RecipeStep开始事件
  445. /// </summary>
  446. /// <param name="eventName"></param>
  447. /// <param name="waferInfo"></param>
  448. /// <param name="recipeName"></param>
  449. /// <param name="stepNumber"></param>
  450. /// <param name="module"></param>
  451. /// <param name="oneTwoValue"></param>
  452. private void NotifyRecipeStepStartEvent(string eventName,WaferInfo waferInfo,string recipeName,int stepNumber,string module,int oneTwoValue)
  453. {
  454. if (PortId.ContainsKey(waferInfo.OriginStation))
  455. {
  456. EV.Notify(eventName, new SerializableDictionary<string, string>()
  457. {
  458. {DataVariables.LotID, waferInfo.LotId},
  459. {DataVariables.RecipeID, recipeName},
  460. { DataVariables.RecipeStepNumber, (stepNumber + 1).ToString() },
  461. {DataVariables.StationName, GetEAPName(module, oneTwoValue)},
  462. {DataVariables.PortID, PortId[waferInfo.OriginStation]},
  463. {DataVariables.CarrierID, waferInfo.OriginCarrierID},
  464. {DataVariables.SlotID, (waferInfo.OriginSlot+1).ToString()}
  465. });
  466. }
  467. else
  468. {
  469. EV.Notify(eventName, new SerializableDictionary<string, string>()
  470. {
  471. {DataVariables.LotID, waferInfo.LotId},
  472. {DataVariables.RecipeID, recipeName},
  473. { DataVariables.RecipeStepNumber, (stepNumber + 1).ToString() },
  474. {DataVariables.StationName, GetEAPName(module, oneTwoValue)},
  475. {DataVariables.CarrierID, waferInfo.OriginCarrierID},
  476. {DataVariables.SlotID, (waferInfo.OriginSlot+1).ToString()}
  477. });
  478. }
  479. }
  480. }
  481. }