Autotransfer_LP_FA.cs 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. using Aitex.Core.Common;
  2. using Aitex.Core.RT.Event;
  3. using Aitex.Core.UI.Control;
  4. using Aitex.Core.Util;
  5. using MECF.Framework.Common.Equipment;
  6. using MECF.Framework.Common.Jobs;
  7. using MECF.Framework.Common.SubstrateTrackings;
  8. using System;
  9. using System.Collections.Generic;
  10. using System.Linq;
  11. using System.Text;
  12. using System.Threading.Tasks;
  13. using System.Windows.Controls;
  14. namespace Venus_RT.Modules
  15. {
  16. public interface ISchedulerFACallback
  17. {
  18. void JobCreated(ControlJobInfo cj, ProcessJobInfo pj);
  19. void JobCreateFailed(string module, string lotID, string jobID, string sequenceID);
  20. void JobStarted(ControlJobInfo cj, ProcessJobInfo pj);
  21. void JobStopped(ControlJobInfo cj, ProcessJobInfo pj);
  22. void JobPaused(ControlJobInfo cj, ProcessJobInfo pj);
  23. void JobResumed(ControlJobInfo cj, ProcessJobInfo pj);
  24. void JobAborted(ControlJobInfo cj, ProcessJobInfo pj);
  25. void JobFinished(ControlJobInfo cj, ProcessJobInfo pj);
  26. void JobFailed(ControlJobInfo cj, ProcessJobInfo pj);
  27. void JobWaferStart(ControlJobInfo cj, int slotID);
  28. void JobWaferEnd(ControlJobInfo cj, int slotID);
  29. }
  30. public class SchedulerFACallback : ISchedulerFACallback
  31. {
  32. private const string PortJobStarted = "PortJobStarted";
  33. private const string PortJobStopped = "PortJobStopped";
  34. private const string PortJobPaused = "PortJobPaused";
  35. private const string PortJobResumed = "PortJobResumed";
  36. private const string PortJobAborted = "PortJobAborted";
  37. private const string PortJobFinished = "PortJobFinished";
  38. private const string PortJobFailed = "PortJobFailed";
  39. private const string PortSequenceSelected = "PortPPSelected";
  40. private const string PortSequenceSelectFailed = "PortPPSelectFailed";
  41. private const string PortJobWaferStart = "PortJobWaferStart";
  42. private const string PortJobWaferEnd = "PortJobWaferEnd";
  43. private Dictionary<ModuleName, string> PortId = new Dictionary<ModuleName, string>()
  44. {
  45. {ModuleName.LP1, "1"},
  46. {ModuleName.LP2, "2"},
  47. {ModuleName.LP3, "3"},
  48. {ModuleName.VCE1, "1"},
  49. {ModuleName.VCEA, "1"},
  50. {ModuleName.VCEB, "2"},
  51. };
  52. public SchedulerFACallback()
  53. {
  54. EV.Subscribe(new EventItem("Event", PortJobStarted, PortJobStarted));
  55. EV.Subscribe(new EventItem("Event", PortJobStopped, PortJobStopped));
  56. EV.Subscribe(new EventItem("Event", PortJobPaused, PortJobPaused));
  57. EV.Subscribe(new EventItem("Event", PortJobResumed, PortJobResumed));
  58. EV.Subscribe(new EventItem("Event", PortJobAborted, PortJobAborted));
  59. EV.Subscribe(new EventItem("Event", PortJobFinished, PortJobFinished));
  60. EV.Subscribe(new EventItem("Event", PortJobFailed, PortJobFailed));
  61. EV.Subscribe(new EventItem("Event", PortSequenceSelected, PortSequenceSelected));
  62. EV.Subscribe(new EventItem("Event", PortSequenceSelectFailed, PortSequenceSelectFailed));
  63. EV.Subscribe(new EventItem("Event", PortJobWaferStart, PortJobWaferStart));
  64. EV.Subscribe(new EventItem("Event", PortJobWaferEnd, PortJobWaferEnd));
  65. }
  66. public void JobCreated(ControlJobInfo cj, ProcessJobInfo pj)
  67. {
  68. ModuleName module = ModuleHelper.Converter(cj.Module);
  69. EV.Notify(PortSequenceSelected, new SerializableDictionary<string, string>()
  70. {
  71. {DVIDName.LotID, pj.LotName},
  72. {DVIDName.JobID, pj.ControlJobName},
  73. {DVIDName.PortID, PortId[module] },
  74. {DVIDName.SequenceID, pj.Sequence.Name }
  75. });
  76. }
  77. public void JobCreateFailed(string module, string lotID, string jobID, string sequenceID)
  78. {
  79. ModuleName moduleName = ModuleHelper.Converter(module);
  80. EV.Notify(PortSequenceSelectFailed, new SerializableDictionary<string, string>()
  81. {
  82. {DVIDName.LotID, lotID},
  83. {DVIDName.JobID, jobID},
  84. {DVIDName.PortID, PortId[moduleName] },
  85. {DVIDName.SequenceID, sequenceID }
  86. });
  87. }
  88. public void JobStarted(ControlJobInfo cj,ProcessJobInfo pj)
  89. {
  90. ModuleName module= ModuleHelper.Converter(cj.Module);
  91. EV.Notify(PortJobStarted, new SerializableDictionary<string, string>()
  92. {
  93. {DVIDName.LotID, pj.LotName},
  94. {DVIDName.JobID, pj.ControlJobName},
  95. {DVIDName.PortID, PortId[module] },
  96. {DVIDName.SequenceID, pj.Sequence.Name }
  97. });
  98. }
  99. public void JobStopped(ControlJobInfo cj, ProcessJobInfo pj)
  100. {
  101. ModuleName module = ModuleHelper.Converter(cj.Module);
  102. EV.Notify(PortJobStopped, new SerializableDictionary<string, string>()
  103. {
  104. {DVIDName.LotID, pj.LotName},
  105. {DVIDName.JobID, pj.ControlJobName},
  106. {DVIDName.PortID, PortId[module] },
  107. {DVIDName.SequenceID, pj.Sequence.Name }
  108. });
  109. }
  110. public void JobPaused(ControlJobInfo cj, ProcessJobInfo pj)
  111. {
  112. ModuleName module = ModuleHelper.Converter(cj.Module);
  113. EV.Notify(PortJobPaused, new SerializableDictionary<string, string>()
  114. {
  115. {DVIDName.LotID, pj.LotName},
  116. {DVIDName.JobID, pj.ControlJobName},
  117. {DVIDName.PortID, PortId[module] },
  118. {DVIDName.SequenceID, pj.Sequence.Name }
  119. });
  120. }
  121. public void JobResumed(ControlJobInfo cj, ProcessJobInfo pj)
  122. {
  123. ModuleName module = ModuleHelper.Converter(cj.Module);
  124. EV.Notify(PortJobResumed, new SerializableDictionary<string, string>()
  125. {
  126. {DVIDName.LotID, pj.LotName},
  127. {DVIDName.JobID, pj.ControlJobName},
  128. {DVIDName.PortID, PortId[module] },
  129. {DVIDName.SequenceID, pj.Sequence.Name }
  130. });
  131. }
  132. public void JobAborted(ControlJobInfo cj, ProcessJobInfo pj)
  133. {
  134. ModuleName module = ModuleHelper.Converter(cj.Module);
  135. EV.Notify(PortJobAborted, new SerializableDictionary<string, string>()
  136. {
  137. {DVIDName.LotID, cj.LotName},
  138. {DVIDName.JobID, cj.Name},
  139. {DVIDName.PortID, PortId[module] },
  140. {DVIDName.SequenceID, "" }
  141. });
  142. }
  143. public void JobFinished(ControlJobInfo cj, ProcessJobInfo pj)
  144. {
  145. ModuleName module = ModuleHelper.Converter(cj.Module);
  146. int count = pj.SlotWafers.Count;
  147. EV.Notify(PortJobFinished, new SerializableDictionary<string, string>()
  148. {
  149. {DVIDName.LotID, pj.LotName},
  150. {DVIDName.JobID, pj.ControlJobName},
  151. {DVIDName.PortID, PortId[module] },
  152. {DVIDName.SequenceID, pj.Sequence.Name },
  153. {DVIDName.ProcessedWaferCount, count.ToString() },
  154. });
  155. }
  156. public void JobFailed(ControlJobInfo cj, ProcessJobInfo pj)
  157. {
  158. ModuleName module = ModuleHelper.Converter(cj.Module);
  159. EV.Notify(PortJobFailed, new SerializableDictionary<string, string>()
  160. {
  161. {DVIDName.LotID, pj.LotName},
  162. {DVIDName.JobID, pj.ControlJobName},
  163. {DVIDName.PortID, PortId[module] },
  164. {DVIDName.SequenceID, pj.Sequence.Name }
  165. });
  166. }
  167. public void JobWaferStart(ControlJobInfo cj, int slotID)
  168. {
  169. ModuleName module = ModuleHelper.Converter(cj.Module);
  170. WaferInfo waferInfo = WaferManager.Instance.GetWafer(module, slotID);
  171. if (waferInfo != null)
  172. {
  173. EV.Notify(PortJobWaferStart, new SerializableDictionary<string, string>()
  174. {
  175. {DVIDName.LotID, cj.LotName},
  176. {DVIDName.JobID, cj.Name},
  177. {DVIDName.PortID, PortId[module] },
  178. {DVIDName.SlotID, (slotID+1).ToString() },
  179. {DVIDName.CarrierID, waferInfo.OriginCarrierID==null?"":waferInfo.OriginCarrierID},
  180. {DVIDName.SequenceID,waferInfo.SequenceName }
  181. });
  182. }
  183. }
  184. public void JobWaferEnd(ControlJobInfo cj, int slotID)
  185. {
  186. ModuleName module = ModuleHelper.Converter(cj.Module);
  187. WaferInfo wafer = WaferManager.Instance.GetWafer(module, slotID);
  188. if (wafer != null)
  189. {
  190. EV.Notify(PortJobWaferEnd, new SerializableDictionary<string, string>()
  191. {
  192. {DVIDName.LotID, cj.LotName},
  193. {DVIDName.JobID, cj.Name},
  194. {DVIDName.PortID, PortId[module] },
  195. {DVIDName.SlotID, (slotID+1).ToString() },
  196. {DVIDName.CarrierID, wafer.OriginCarrierID==null?"":wafer.OriginCarrierID},
  197. {DVIDName.WaferProcessResult, (wafer.ProcessState == EnumWaferProcessStatus.Failed ? 0:1).ToString()},
  198. {DVIDName.SequenceID,wafer.SequenceName }
  199. });
  200. }
  201. }
  202. }
  203. }