PMProcess_FA.cs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. using Aitex.Core.Common;
  2. using Aitex.Core.RT.Event;
  3. using Aitex.Core.Util;
  4. using MECF.Framework.Common.CommonData;
  5. using MECF.Framework.Common.Equipment;
  6. using MECF.Framework.Common.SubstrateTrackings;
  7. using System;
  8. using System.Collections.Generic;
  9. using System.Linq;
  10. using System.Text;
  11. using System.Threading.Tasks;
  12. namespace Venus_RT.Modules.PMs
  13. {
  14. public interface IRecipeFACallback
  15. {
  16. void RecipeStart(string module,string recipeName);
  17. void RecipeComplete(string module,string recipeName);
  18. void RecipeFailed(string module, string recipeName);
  19. void RecipeStepStart(string module, string recipeName, int stepNumber);
  20. void RecipeStepEnd(string module, string recipeName, int stepNumber);
  21. }
  22. public class RecipeFACallback : IRecipeFACallback
  23. {
  24. private const string PMARecipeStart = "PMARecipeStart";
  25. private const string PMARecipeComplete = "PMARecipeComplete";
  26. private const string PMARecipeStepStart = "PMARecipeStepStart";
  27. private const string PMARecipeStepEnd = "PMARecipeStepEnd";
  28. private const string PMARecipeFailed = "PMARecipeFailed";
  29. private const string PMBRecipeStart = "PMBRecipeStart";
  30. private const string PMBRecipeComplete = "PMBRecipeComplete";
  31. private const string PMBRecipeStepStart = "PMBRecipeStepStart";
  32. private const string PMBRecipeStepEnd = "PMBRecipeStepEnd";
  33. private const string PMBRecipeFailed = "PMBRecipeFailed";
  34. private const string PMCRecipeStart = "PMCRecipeStart";
  35. private const string PMCRecipeComplete = "PMCRecipeComplete";
  36. private const string PMCRecipeStepStart = "PMCRecipeStepStart";
  37. private const string PMCRecipeStepEnd = "PMCRecipeStepEnd";
  38. private const string PMCRecipeFailed = "PMCRecipeFailed";
  39. private const string PMDRecipeStart = "PMDRecipeStart";
  40. private const string PMDRecipeComplete = "PMDRecipeComplete";
  41. private const string PMDRecipeStepStart = "PMDRecipeStepStart";
  42. private const string PMDRecipeStepEnd = "PMDRecipeStepEnd";
  43. private const string PMDRecipeFailed = "PMDRecipeFailed";
  44. private Dictionary<ModuleName, string> PMRecipeStart = new Dictionary<ModuleName, string>()
  45. {
  46. {ModuleName.PMA, PMARecipeStart},
  47. {ModuleName.PMB, PMBRecipeStart},
  48. {ModuleName.PMC, PMCRecipeStart},
  49. {ModuleName.PMD, PMDRecipeStart}
  50. };
  51. private Dictionary<ModuleName, string> PMRecipeComplete = new Dictionary<ModuleName, string>()
  52. {
  53. {ModuleName.PMA, PMARecipeComplete},
  54. {ModuleName.PMB, PMBRecipeComplete},
  55. {ModuleName.PMC, PMCRecipeComplete},
  56. {ModuleName.PMD, PMDRecipeComplete},
  57. };
  58. private Dictionary<ModuleName, string> PMRecipeStepStart = new Dictionary<ModuleName, string>()
  59. {
  60. {ModuleName.PMA, PMARecipeStepStart},
  61. {ModuleName.PMB, PMBRecipeStepStart},
  62. {ModuleName.PMC, PMCRecipeStepStart},
  63. {ModuleName.PMD, PMDRecipeStepStart},
  64. };
  65. private Dictionary<ModuleName, string> PMRecipeStepEnd = new Dictionary<ModuleName, string>()
  66. {
  67. {ModuleName.PMA, PMARecipeStepEnd},
  68. {ModuleName.PMB, PMBRecipeStepEnd},
  69. {ModuleName.PMC, PMCRecipeStepEnd},
  70. {ModuleName.PMD, PMDRecipeStepEnd},
  71. };
  72. private Dictionary<ModuleName, string> PMRecipeFailed = new Dictionary<ModuleName, string>()
  73. {
  74. {ModuleName.PMA, PMARecipeFailed},
  75. {ModuleName.PMB, PMBRecipeFailed},
  76. {ModuleName.PMC, PMCRecipeFailed},
  77. {ModuleName.PMD, PMDRecipeFailed},
  78. };
  79. private Dictionary<int, string> PortId = new Dictionary<int, string>()
  80. {
  81. {(int)ModuleName.LP1, "1"},
  82. {(int)ModuleName.LP2, "2"},
  83. };
  84. public RecipeFACallback()
  85. {
  86. EV.Subscribe(new EventItem("Event", PMARecipeStart, PMARecipeStart));
  87. EV.Subscribe(new EventItem("Event", PMARecipeComplete, PMARecipeComplete));
  88. EV.Subscribe(new EventItem("Event", PMARecipeStepStart, PMARecipeStepStart));
  89. EV.Subscribe(new EventItem("Event", PMARecipeStepEnd, PMARecipeStepEnd));
  90. EV.Subscribe(new EventItem("Event", PMARecipeFailed, PMARecipeFailed));
  91. EV.Subscribe(new EventItem("Event", PMBRecipeStart, PMBRecipeStart));
  92. EV.Subscribe(new EventItem("Event", PMBRecipeComplete, PMBRecipeComplete));
  93. EV.Subscribe(new EventItem("Event", PMBRecipeStepStart, PMBRecipeStepStart));
  94. EV.Subscribe(new EventItem("Event", PMBRecipeStepEnd, PMBRecipeStepEnd));
  95. EV.Subscribe(new EventItem("Event", PMBRecipeFailed, PMBRecipeFailed));
  96. EV.Subscribe(new EventItem("Event", PMCRecipeStart, PMCRecipeStart));
  97. EV.Subscribe(new EventItem("Event", PMCRecipeComplete, PMCRecipeComplete));
  98. EV.Subscribe(new EventItem("Event", PMCRecipeStepStart, PMCRecipeStepStart));
  99. EV.Subscribe(new EventItem("Event", PMCRecipeStepEnd, PMCRecipeStepEnd));
  100. EV.Subscribe(new EventItem("Event", PMCRecipeFailed, PMCRecipeFailed));
  101. EV.Subscribe(new EventItem("Event", PMDRecipeStart, PMDRecipeStart));
  102. EV.Subscribe(new EventItem("Event", PMDRecipeComplete, PMDRecipeComplete));
  103. EV.Subscribe(new EventItem("Event", PMDRecipeStepStart, PMDRecipeStepStart));
  104. EV.Subscribe(new EventItem("Event", PMDRecipeStepEnd, PMDRecipeStepEnd));
  105. EV.Subscribe(new EventItem("Event", PMDRecipeFailed, PMDRecipeFailed));
  106. }
  107. public void RecipeComplete(string module, string recipeName)
  108. {
  109. WaferInfo wafer = WaferManager.Instance.GetWafer(ModuleHelper.Converter(module), 0);
  110. if (wafer.IsEmpty)
  111. return;
  112. ModuleName moduleName = ModuleHelper.Converter(module);
  113. if (PortId.ContainsKey(wafer.OriginStation))
  114. {
  115. EV.Notify(PMRecipeComplete[moduleName], new SerializableDictionary<string, string>()
  116. {
  117. {DVIDName.RecipeID, recipeName},
  118. {DVIDName.StationName, module},
  119. {DVIDName.PortID, PortId[wafer.OriginStation]},
  120. {DVIDName.SlotID, (wafer.OriginSlot+1).ToString()},
  121. {DVIDName.LotID, wafer.LotId},
  122. {DVIDName.CarrierID,wafer.OriginCarrierID == null ? "" : wafer.OriginCarrierID }
  123. });
  124. }
  125. else
  126. {
  127. EV.Notify(PMRecipeComplete[moduleName], new SerializableDictionary<string, string>()
  128. {
  129. {DVIDName.RecipeID, recipeName},
  130. {DVIDName.StationName, module},
  131. {DVIDName.SlotID, (wafer.OriginSlot+1).ToString()},
  132. {DVIDName.LotID, wafer.LotId},
  133. {DVIDName.CarrierID,wafer.OriginCarrierID==null?"":wafer.OriginCarrierID }
  134. });
  135. }
  136. }
  137. public void RecipeFailed(string module, string recipeName)
  138. {
  139. WaferInfo wafer = WaferManager.Instance.GetWafer(ModuleHelper.Converter(module), 0);
  140. if (wafer.IsEmpty)
  141. return;
  142. ModuleName moduleName = ModuleHelper.Converter(module);
  143. if (PortId.ContainsKey(wafer.OriginStation))
  144. {
  145. EV.Notify(PMRecipeFailed[moduleName], new SerializableDictionary<string, string>()
  146. {
  147. {DVIDName.RecipeID, recipeName},
  148. {DVIDName.StationName, module},
  149. {DVIDName.PortID, PortId[wafer.OriginStation]},
  150. {DVIDName.SlotID, (wafer.OriginSlot + 1).ToString()},
  151. {DVIDName.LotID, wafer.LotId}
  152. });
  153. }
  154. else
  155. {
  156. EV.Notify(PMRecipeFailed[moduleName], new SerializableDictionary<string, string>()
  157. {
  158. {DVIDName.RecipeID, recipeName},
  159. {DVIDName.StationName, module},
  160. {DVIDName.SlotID, (wafer.OriginSlot + 1).ToString()},
  161. {DVIDName.LotID, wafer.LotId}
  162. });
  163. }
  164. }
  165. public void RecipeStart(string module, string recipeName)
  166. {
  167. WaferInfo wafer = WaferManager.Instance.GetWafer(ModuleHelper.Converter(module), 0);
  168. if (wafer.IsEmpty)
  169. return;
  170. ModuleName moduleName = ModuleHelper.Converter(module);
  171. if (PortId.ContainsKey(wafer.OriginStation))
  172. {
  173. EV.Notify(PMRecipeStart[moduleName], new SerializableDictionary<string, string>()
  174. {
  175. {DVIDName.RecipeID, recipeName},
  176. {DVIDName.StationName, module},
  177. {DVIDName.PortID, PortId[wafer.OriginStation]},
  178. {DVIDName.SlotID, (wafer.OriginSlot + 1).ToString()},
  179. {DVIDName.LotID, wafer.LotId},
  180. //{DVIDName.CarrierID,wafer.OriginCarrierID.ToString() }
  181. {DVIDName.CarrierID,"" }
  182. });
  183. }
  184. else
  185. {
  186. EV.Notify(PMRecipeStart[moduleName], new SerializableDictionary<string, string>()
  187. {
  188. {DVIDName.RecipeID, recipeName},
  189. {DVIDName.StationName, module},
  190. {DVIDName.SlotID, (wafer.OriginSlot + 1).ToString()},
  191. {DVIDName.LotID, wafer.LotId},
  192. //{DVIDName.CarrierID,wafer.OriginCarrierID.ToString() }
  193. });
  194. }
  195. }
  196. public void RecipeStepEnd(string module, string recipeName, int stepNumber)
  197. {
  198. WaferInfo wafer = WaferManager.Instance.GetWafer(ModuleHelper.Converter(module), 0);
  199. if (wafer.IsEmpty)
  200. return;
  201. ModuleName moduleName = ModuleHelper.Converter(module);
  202. if (PortId.ContainsKey(wafer.OriginStation))
  203. {
  204. EV.Notify(PMRecipeStepEnd[moduleName], new SerializableDictionary<string, object>()
  205. {
  206. {DVIDName.RecipeID, recipeName},
  207. {DVIDName.StationName, module},
  208. {DVIDName.RecipeStepNumber, (stepNumber + 1).ToString()},
  209. {DVIDName.PortID, PortId[wafer.OriginStation]},
  210. {DVIDName.SlotID, (wafer.OriginSlot + 1).ToString()},
  211. //{DVIDName.RecipeStepEndDataSummary, fdc},
  212. {DVIDName.LotID, wafer.LotId},
  213. {DVIDName.CarrierID,wafer.OriginCarrierID==null?"":wafer.OriginCarrierID }
  214. });
  215. }
  216. else
  217. {
  218. EV.Notify(PMRecipeStepEnd[moduleName], new SerializableDictionary<string, object>()
  219. {
  220. {DVIDName.RecipeID, recipeName},
  221. {DVIDName.StationName, module},
  222. {DVIDName.RecipeStepNumber, (stepNumber + 1).ToString()},
  223. {DVIDName.SlotID, (wafer.OriginSlot + 1).ToString()},
  224. //{DVIDName.RecipeStepEndDataSummary, fdc},
  225. {DVIDName.LotID, wafer.LotId},
  226. {DVIDName.CarrierID,wafer.OriginCarrierID==null?"":wafer.OriginCarrierID }
  227. });
  228. }
  229. }
  230. public void RecipeStepStart(string module, string recipeName, int stepNumber)
  231. {
  232. WaferInfo wafer = WaferManager.Instance.GetWafer(ModuleHelper.Converter(module), 0);
  233. if (wafer.IsEmpty)
  234. return;
  235. ModuleName moduleName = ModuleHelper.Converter(module);
  236. if (PortId.ContainsKey(wafer.OriginStation))
  237. {
  238. EV.Notify(PMRecipeStepStart[moduleName], new SerializableDictionary<string, string>()
  239. {
  240. {DVIDName.RecipeID, recipeName},
  241. {DVIDName.StationName, module},
  242. {DVIDName.RecipeStepNumber, (stepNumber + 1).ToString()},
  243. {DVIDName.PortID, PortId[wafer.OriginStation]},
  244. {DVIDName.SlotID, (wafer.OriginSlot + 1).ToString()},
  245. {DVIDName.LotID, wafer.LotId},
  246. {DVIDName.CarrierID,wafer.OriginCarrierID==null?"":wafer.OriginCarrierID }
  247. });
  248. }
  249. else
  250. {
  251. EV.Notify(PMRecipeStepStart[moduleName], new SerializableDictionary<string, string>()
  252. {
  253. {DVIDName.RecipeID, recipeName},
  254. {DVIDName.StationName, module},
  255. {DVIDName.RecipeStepNumber, (stepNumber + 1).ToString()},
  256. {DVIDName.SlotID, (wafer.OriginSlot + 1).ToString()},
  257. {DVIDName.LotID, wafer.LotId},
  258. {DVIDName.CarrierID,wafer.OriginCarrierID==null?"":wafer.OriginCarrierID.ToString() }
  259. });
  260. }
  261. }
  262. }
  263. }