SchedulerFACallback.cs 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606
  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.RT.Event;
  7. using Aitex.Core.Util;
  8. using MECF.Framework.Common.Equipment;
  9. using MECF.Framework.Common.Jobs;
  10. using FurnaceRT.FAs;
  11. using Aitex.Core.RT.SCCore;
  12. using static MECF.Framework.Common.FAServices.Gem300Events;
  13. using MECF.Framework.Common.FAServices;
  14. using Aitex.Core.Common;
  15. using MECF.Framework.Common.SubstrateTrackings;
  16. using FabConnect.SecsGemInterface.Common;
  17. using Aitex.Core.RT.DataCenter;
  18. using MECF.Framework.FA.Core.FAControl;
  19. using FurnaceRT.Equipments.Systems;
  20. namespace FurnaceRT.Equipments.Schedulers
  21. {
  22. public class SchedulerFACallback : ISchedulerFACallback
  23. {
  24. private Dictionary<ModuleName, string> PortJobStarted;
  25. private Dictionary<ModuleName, string> PortJobStopped;
  26. private Dictionary<ModuleName, string> PortJobPaused;
  27. private Dictionary<ModuleName, string> PortJobResumed;
  28. private Dictionary<ModuleName, string> PortJobAborted;
  29. private Dictionary<ModuleName, string> PortJobFinished;
  30. private Dictionary<ModuleName, string> PortJobFailed;
  31. private Dictionary<ModuleName, string> PortSequenceSelected;
  32. private Dictionary<ModuleName, string> PortSequenceSelectFailed;
  33. private Dictionary<ModuleName, string> PortId;
  34. public SchedulerFACallback()
  35. {
  36. PortJobStarted = new Dictionary<ModuleName, string>();
  37. PortJobStopped = new Dictionary<ModuleName, string>();
  38. PortJobPaused = new Dictionary<ModuleName, string>();
  39. PortJobResumed = new Dictionary<ModuleName, string>();
  40. PortJobAborted = new Dictionary<ModuleName, string>();
  41. PortJobFinished = new Dictionary<ModuleName, string>();
  42. PortJobFailed = new Dictionary<ModuleName, string>();
  43. PortSequenceSelected = new Dictionary<ModuleName, string>();
  44. PortSequenceSelectFailed = new Dictionary<ModuleName, string>();
  45. PortId = new Dictionary<ModuleName, string>();
  46. for (int i = 1; i < 45; i++)
  47. {
  48. if (!SC.ContainsItem($"System.Stocker.Stocker{i}WaferType"))
  49. continue;
  50. var module = ModuleHelper.Converter($"Stocker{i}");
  51. EV.Subscribe(new EventItem("Event", $"{module}JobStarted", $"{module}JobStarted"));
  52. EV.Subscribe(new EventItem("Event", $"{module}JobStopped", $"{module}JobStopped"));
  53. EV.Subscribe(new EventItem("Event", $"{module}JobPaused", $"{module}JobPaused"));
  54. EV.Subscribe(new EventItem("Event", $"{module}JobResumed", $"{module}JobResumed"));
  55. EV.Subscribe(new EventItem("Event", $"{module}JobAborted", $"{module}JobAborted"));
  56. EV.Subscribe(new EventItem("Event", $"{module}JobFinished", $"{module}JobFinished"));
  57. EV.Subscribe(new EventItem("Event", $"{module}JobFailed", $"{module}JobFailed"));
  58. EV.Subscribe(new EventItem("Event", $"{module}SequenceSelected", $"{module}SequenceSelected"));
  59. EV.Subscribe(new EventItem("Event", $"{module}SequenceSelectFailed", $"{module}SequenceSelectFailed"));
  60. EV.Subscribe(new EventItem("Event", UniversalEvents.EquipmentOFFLINE, $"EquipmentOFFLINE"));
  61. EV.Subscribe(new EventItem("Event", UniversalEvents.ControlStateLOCAL, $"ControlStateLOCAL"));
  62. EV.Subscribe(new EventItem("Event", UniversalEvents.ControlStateREMOTE, $"ControlStateREMOTE"));
  63. EV.Subscribe(new EventItem("Event", UniversalEvents.ProcessingStarted, $"ProcessingStarted"));
  64. EV.Subscribe(new EventItem("Event", UniversalEvents.ProcessingCompleted, $"ProcessingCompleted"));
  65. EV.Subscribe(new EventItem("Event", UniversalEvents.ProcessingStopped, $"ProcessingStopped"));
  66. EV.Subscribe(new EventItem("Event", UniversalEvents.ProcessingStateChanged, $"ProcessingStateChanged"));
  67. EV.Subscribe(new EventItem("Event", UniversalEvents.EquipmentConstantChanged, $"EquipmentConstantChanged"));
  68. EV.Subscribe(new EventItem("Event", UniversalEvents.ProcessProgramChanged, $"ProcessProgramChanged"));
  69. EV.Subscribe(new EventItem("Event", UniversalEvents.ProcessProgramSelected, $"ProcessProgramSelected"));
  70. EV.Subscribe(new EventItem("Event", UniversalEvents.ProcessProgramCreated, $"ProcessProgramCreated"));
  71. EV.Subscribe(new EventItem("Event", UniversalEvents.SpoolingActivated, $"SpoolingActivated"));
  72. EV.Subscribe(new EventItem("Event", UniversalEvents.SpoolingDeactivated, $"SpoolingDeactivated"));
  73. EV.Subscribe(new EventItem("Event", UniversalEvents.SpoolingFailed, $"SpoolingFailed"));
  74. EV.Subscribe(new EventItem("Event", UniversalEvents.SpoolingFailed, $"SpoolingFailed"));
  75. EV.Subscribe(new EventItem("Event", UniversalEvents.ChargeStart, $"ChargeStart"));
  76. EV.Subscribe(new EventItem("Event", UniversalEvents.ChargeEnd, $"ChargeEnd"));
  77. EV.Subscribe(new EventItem("Event", UniversalEvents.DischargeStart, $"DischargeStart"));
  78. EV.Subscribe(new EventItem("Event", UniversalEvents.DischargeEnd, $"DischargeEnd"));
  79. EV.Subscribe(new EventItem("Event", UniversalEvents.BatchLocOccupied, $"BatchLocOccupied"));
  80. EV.Subscribe(new EventItem("Event", UniversalEvents.BatchLocUnOccupied, $"BatchLocUnOccupied"));
  81. EV.Subscribe(new EventItem("Event", UniversalEvents.CarrierInEnd, $"CarrierInEnd"));
  82. EV.Subscribe(new EventItem("Event", UniversalEvents.CarrierInStart, $"CarrierInStart"));
  83. EV.Subscribe(new EventItem("Event", UniversalEvents.CarrierOutStart, $"CarrierOutStart"));
  84. EV.Subscribe(new EventItem("Event", UniversalEvents.CarrierOutEnd, $"CarrierOutEnd"));
  85. EV.Subscribe(new EventItem("Event", UniversalEvents.SideDummyStateAlarm, $"SideDummyStateAlarm"));
  86. EV.Subscribe(new EventItem("Event", UniversalEvents.ExtraDummyStateAlarm, $"ExtraDummyStateAlarm"));
  87. EV.Subscribe(new EventItem("Event", UniversalEvents.SideDummyStateWarning, $"SideDummyStateWarning"));
  88. EV.Subscribe(new EventItem("Event", UniversalEvents.ExtraDummyStateWarning, $"ExtraDummyStateWarning"));
  89. PortId[module] = i.ToString();
  90. PortJobStarted[module] = $"{module}JobStarted";
  91. PortJobStopped[module] = $"{module}JobStopped";
  92. PortJobPaused[module] = $"{module}JobPaused";
  93. PortJobResumed[module] = $"{module}JobResumed";
  94. PortJobAborted[module] = $"{module}JobAborted";
  95. PortJobFinished[module] = $"{module}JobFinished";
  96. PortJobFailed[module] = $"{module}JobFailed";
  97. PortSequenceSelected[module] = $"{module}SequenceSelected";
  98. PortSequenceSelectFailed[module] = $"{module}SequenceSelectFailed";
  99. }
  100. }
  101. public void JobCreated(ControlJobInfo cj)
  102. {
  103. if (cj != null)
  104. {
  105. EV.Notify(Gem300Events.CJ_CREATED, new SerializableDictionary<string, object>()
  106. {
  107. {DataVariables.CJID, cj.Name},
  108. });
  109. }
  110. }
  111. public void JobCreated(ProcessJobInfo pj)
  112. {
  113. if (pj != null)
  114. {
  115. EV.Notify(Gem300Events.PJ_CREATED, new SerializableDictionary<string, object>()
  116. {
  117. {DataVariables.PRJobID, pj.Name},
  118. });
  119. }
  120. }
  121. public void JobCreateFailed(string module, string lotID, string jobID, string sequenceID)
  122. {
  123. ModuleName moduleName = ModuleHelper.Converter(module);
  124. EV.Notify(PortSequenceSelectFailed[moduleName], new SerializableDictionary<string, object>()
  125. {
  126. {DVIDName.LotID, lotID},
  127. {DVIDName.JobID, jobID},
  128. {DVIDName.PortID, PortId[moduleName] },
  129. {DVIDName.SequenceID, sequenceID }
  130. });
  131. }
  132. public void JobStarted(ControlJobInfo cj, ProcessJobInfo pj)
  133. {
  134. if (cj != null && pj != null)
  135. {
  136. foreach (var s in pj.Stockers)
  137. {
  138. var type = SC.GetStringValue($"System.Stocker.{s.Item1}WaferType");
  139. if (!string.IsNullOrEmpty(type) && (type.Contains("P") || type.Contains("M")))
  140. {
  141. ModuleName module = ModuleHelper.Converter(s.Item1);
  142. EV.Notify(PortJobStarted[module], new SerializableDictionary<string, object>()
  143. {
  144. {DVIDName.LotID, cj.LotName},
  145. {DVIDName.JobID, pj.ControlJobName},
  146. {DVIDName.PortID, PortId[module] },
  147. {DVIDName.SequenceID, pj.JobRecipe }
  148. });
  149. }
  150. }
  151. }
  152. }
  153. public void JobStopped(ControlJobInfo cj, ProcessJobInfo pj)
  154. {
  155. if (cj != null && pj != null)
  156. {
  157. foreach (var s in pj.Stockers)
  158. {
  159. var type = SC.GetStringValue($"System.Stocker.{s.Item1}WaferType");
  160. if (!string.IsNullOrEmpty(type) && (type.Contains("P") || type.Contains("M")))
  161. {
  162. ModuleName module = ModuleHelper.Converter(s.Item1);
  163. EV.Notify(PortJobStopped[module], new SerializableDictionary<string, object>()
  164. {
  165. {DVIDName.LotID, cj.LotName},
  166. {DVIDName.JobID, pj.ControlJobName},
  167. {DVIDName.PortID, PortId[module] },
  168. {DVIDName.SequenceID, pj.JobRecipe }
  169. });
  170. }
  171. }
  172. }
  173. }
  174. public void JobPaused(ControlJobInfo cj, ProcessJobInfo pj)
  175. {
  176. if (cj != null && pj != null)
  177. {
  178. foreach (var s in pj.Stockers)
  179. {
  180. var type = SC.GetStringValue($"System.Stocker.{s.Item1}WaferType");
  181. if (!string.IsNullOrEmpty(type) && (type.Contains("P") || type.Contains("M")))
  182. {
  183. ModuleName module = ModuleHelper.Converter(s.Item1);
  184. EV.Notify(PortJobPaused[module], new SerializableDictionary<string, object>()
  185. {
  186. {DVIDName.LotID, cj.LotName},
  187. {DVIDName.JobID, pj.ControlJobName},
  188. {DVIDName.PortID, PortId[module] },
  189. {DVIDName.SequenceID, pj.JobRecipe }
  190. });
  191. }
  192. }
  193. }
  194. }
  195. public void JobResumed(ControlJobInfo cj, ProcessJobInfo pj)
  196. {
  197. if (cj != null && pj != null)
  198. {
  199. foreach (var s in pj.Stockers)
  200. {
  201. var type = SC.GetStringValue($"System.Stocker.{s.Item1}WaferType");
  202. if (!string.IsNullOrEmpty(type) && (type.Contains("P") || type.Contains("M")))
  203. {
  204. ModuleName module = ModuleHelper.Converter(s.Item1);
  205. EV.Notify(PortJobResumed[module], new SerializableDictionary<string, object>()
  206. {
  207. {DVIDName.LotID, cj.LotName},
  208. {DVIDName.JobID, pj.ControlJobName},
  209. {DVIDName.PortID, PortId[module] },
  210. {DVIDName.SequenceID, pj.JobRecipe }
  211. });
  212. }
  213. }
  214. }
  215. }
  216. public void JobAborted(ControlJobInfo cj, ProcessJobInfo pj)
  217. {
  218. if (cj != null && pj != null)
  219. {
  220. foreach (var s in pj.Stockers)
  221. {
  222. var type = SC.GetStringValue($"System.Stocker.{s.Item1}WaferType");
  223. if (!string.IsNullOrEmpty(type) && (type.Contains("P") || type.Contains("M")))
  224. {
  225. ModuleName module = ModuleHelper.Converter(s.Item1);
  226. EV.Notify(PortJobAborted[module], new SerializableDictionary<string, object>()
  227. {
  228. {DVIDName.LotID, cj.LotName},
  229. {DVIDName.JobID, pj.ControlJobName},
  230. {DVIDName.PortID, PortId[module] },
  231. {DVIDName.SequenceID, pj.JobRecipe }
  232. });
  233. }
  234. }
  235. }
  236. }
  237. public void JobFinished(ControlJobInfo cj, ProcessJobInfo pj)
  238. {
  239. if (cj != null && pj != null)
  240. {
  241. foreach (var s in pj.Stockers)
  242. {
  243. var type = SC.GetStringValue($"System.Stocker.{s.Item1}WaferType");
  244. if (!string.IsNullOrEmpty(type) && (type.Contains("P") || type.Contains("M")))
  245. {
  246. ModuleName module = ModuleHelper.Converter(s.Item1);
  247. EV.Notify(PortJobFinished[module], new SerializableDictionary<string, object>()
  248. {
  249. {DVIDName.LotID, cj.LotName},
  250. {DVIDName.JobID, pj.ControlJobName},
  251. {DVIDName.PortID, PortId[module] },
  252. {DVIDName.SequenceID, pj.JobRecipe }
  253. });
  254. }
  255. }
  256. }
  257. }
  258. public void JobFailed(ControlJobInfo cj, ProcessJobInfo pj)
  259. {
  260. if (cj != null && pj != null)
  261. {
  262. foreach (var s in pj.Stockers)
  263. {
  264. var type = SC.GetStringValue($"System.Stocker.{s.Item1}WaferType");
  265. if (!string.IsNullOrEmpty(type) && (type.Contains("P") || type.Contains("M")))
  266. {
  267. ModuleName module = ModuleHelper.Converter(s.Item1);
  268. EV.Notify(PortJobFailed[module], new SerializableDictionary<string, object>()
  269. {
  270. {DVIDName.LotID, cj.LotName},
  271. {DVIDName.JobID, pj.ControlJobName},
  272. {DVIDName.PortID, PortId[module] },
  273. {DVIDName.SequenceID, pj.JobRecipe }
  274. });
  275. }
  276. }
  277. }
  278. }
  279. public void StartCharge(ProcessJobInfo pj)
  280. {
  281. List<string> crids = CarrierManager.Instance.GetStokerCarrierID();
  282. SECsDataItem data = new SECsDataItem(SECsFormat.List);
  283. foreach (var _id in crids)
  284. {
  285. data.Add("CarrierID", _id);
  286. }
  287. if (pj != null)
  288. {
  289. EV.Notify(UniversalEvents.ChargeStart, new SerializableDictionary<string, object>()
  290. {
  291. {DataVariables.PRJobID, pj.Name},
  292. {DataVariables.BatchLocID, "BatchBuild1"},
  293. {DataVariables.BoatID, "Boat1"},
  294. {DataVariables.CarrierIDList, data},
  295. });
  296. }
  297. }
  298. public void EndCharge(ProcessJobInfo pj, List<string> _slotmap)
  299. {
  300. List<string> crids = CarrierManager.Instance.GetStokerCarrierID();
  301. SECsDataItem data = new SECsDataItem(SECsFormat.List);
  302. foreach (var _id in crids)
  303. {
  304. data.Add("CarrierID", _id);
  305. }
  306. if (pj != null)
  307. {
  308. EV.Notify(UniversalEvents.ChargeEnd, new SerializableDictionary<string, object>()
  309. {
  310. {DataVariables.PRJobID, pj.Name},
  311. {DataVariables.BoatSlotMapList, _slotmap},
  312. {DataVariables.WaferIDList, _slotmap},
  313. {DataVariables.BatchLocID, "BatchBuild1"},
  314. {DataVariables.BoatID, "Boat1"},
  315. {DataVariables.CarrierIDList, data},
  316. });
  317. }
  318. }
  319. public void StartDischarge(ProcessJobInfo pj, List<string> _slotmap)
  320. {
  321. List<string> crids = CarrierManager.Instance.GetStokerCarrierID();
  322. SECsDataItem data = new SECsDataItem(SECsFormat.List);
  323. foreach (var _id in crids)
  324. {
  325. data.Add("CarrierID", _id);
  326. }
  327. if (pj != null)
  328. {
  329. EV.Notify(UniversalEvents.DischargeStart, new SerializableDictionary<string, object>()
  330. {
  331. {DataVariables.PRJobID, pj.Name},
  332. {DataVariables.BoatSlotMapList, _slotmap},
  333. {DataVariables.WaferIDList, _slotmap},
  334. {DataVariables.BatchLocID, "BatchBuild1"},
  335. {DataVariables.BoatID, "Boat1"},
  336. {DataVariables.CarrierIDList, data},
  337. });
  338. }
  339. }
  340. public void EndDischarge(ProcessJobInfo pj)
  341. {
  342. if (pj != null)
  343. {
  344. EV.Notify(UniversalEvents.DischargeEnd, new SerializableDictionary<string, object>()
  345. {
  346. {DataVariables.PRJobID, pj.Name},
  347. });
  348. }
  349. }
  350. public void CarrierInEnd(CarrierInfo carrier)
  351. {
  352. List<string> crids = CarrierManager.Instance.GetBufferMaterialInfo();
  353. SECsDataItem BufferMaterialInfos = new SECsDataItem(SECsFormat.List);
  354. SECsDataItem BufferMaterialInfo = new SECsDataItem(SECsFormat.List);
  355. foreach (var _id in crids)
  356. {
  357. BufferMaterialInfo = new SECsDataItem(SECsFormat.List);
  358. BufferMaterialInfo.Add("StockerName", _id.Split(';')[0], SECsFormat.Ascii);
  359. BufferMaterialInfo.Add("StockerCarrierID", _id.Split(';')[1].Replace("emptyid", ""), SECsFormat.Ascii);
  360. BufferMaterialInfos.Add(BufferMaterialInfo);
  361. }
  362. if (carrier != null)
  363. {
  364. EV.Notify(UniversalEvents.CarrierInEnd, new SerializableDictionary<string, object>()
  365. {
  366. {DataVariables.Usage, carrier.CarrierType.ToString()},
  367. {DataVariables.BufferCapacitiyList, GetBufferCapacitiyList()},
  368. {DataVariables.BufferMaterialInfo, BufferMaterialInfos},
  369. {DataVariables.CarrierID, carrier.CarrierId},
  370. });
  371. }
  372. }
  373. public void CarrierOutEnd(CarrierInfo carrier)
  374. {
  375. List<string> crids = CarrierManager.Instance.GetBufferMaterialInfo();
  376. SECsDataItem BufferMaterialInfos = new SECsDataItem(SECsFormat.List);
  377. SECsDataItem BufferMaterialInfo = new SECsDataItem(SECsFormat.List);
  378. foreach (var _id in crids)
  379. {
  380. BufferMaterialInfo = new SECsDataItem(SECsFormat.List);
  381. BufferMaterialInfo.Add("StockerName", _id.Split(';')[0], SECsFormat.Ascii);
  382. BufferMaterialInfo.Add("StockerCarrierID", _id.Split(';')[1].Replace("emptyid", ""), SECsFormat.Ascii);
  383. BufferMaterialInfos.Add(BufferMaterialInfo);
  384. }
  385. if (carrier != null)
  386. {
  387. EV.Notify(UniversalEvents.CarrierOutEnd, new SerializableDictionary<string, object>()
  388. {
  389. {DataVariables.Usage, carrier.CarrierType.ToString()},
  390. {DataVariables.BufferCapacitiyList, GetBufferCapacitiyList()},
  391. {DataVariables.BufferMaterialInfo, BufferMaterialInfos},
  392. {DataVariables.CarrierID, carrier.CarrierId},
  393. });
  394. }
  395. }
  396. public void CarrierInStart(CarrierType carrierType, string _carrierid)
  397. {
  398. List<string> crids = CarrierManager.Instance.GetBufferMaterialInfo();
  399. SECsDataItem BufferMaterialInfos = new SECsDataItem(SECsFormat.List);
  400. SECsDataItem BufferMaterialInfo = new SECsDataItem(SECsFormat.List);
  401. foreach (var _id in crids)
  402. {
  403. BufferMaterialInfo = new SECsDataItem(SECsFormat.List);
  404. BufferMaterialInfo.Add("StockerName", _id.Split(';')[0], SECsFormat.Ascii);
  405. BufferMaterialInfo.Add("StockerCarrierID", _id.Split(';')[1].Replace("emptyid", ""), SECsFormat.Ascii);
  406. BufferMaterialInfos.Add(BufferMaterialInfo);
  407. }
  408. EV.Notify(UniversalEvents.CarrierInStart, new SerializableDictionary<string, object>()
  409. {
  410. {DataVariables.Usage, carrierType.ToString()},
  411. {DataVariables.CarrierID, _carrierid},
  412. {DataVariables.BufferCapacitiyList, GetBufferCapacitiyList()},
  413. {DataVariables.BufferMaterialInfo, BufferMaterialInfos},
  414. });
  415. }
  416. public void CarrierOutStart(CarrierInfo carrier)
  417. {
  418. List<string> crids = CarrierManager.Instance.GetBufferMaterialInfo();
  419. SECsDataItem BufferMaterialInfos = new SECsDataItem(SECsFormat.List);
  420. SECsDataItem BufferMaterialInfo = new SECsDataItem(SECsFormat.List);
  421. foreach (var _id in crids)
  422. {
  423. BufferMaterialInfo = new SECsDataItem(SECsFormat.List);
  424. BufferMaterialInfo.Add("StockerName", _id.Split(';')[0], SECsFormat.Ascii);
  425. BufferMaterialInfo.Add("StockerCarrierID", _id.Split(';')[1].Replace("emptyid", ""), SECsFormat.Ascii);
  426. BufferMaterialInfos.Add(BufferMaterialInfo);
  427. }
  428. if (carrier != null)
  429. {
  430. EV.Notify(UniversalEvents.CarrierOutStart, new SerializableDictionary<string, object>()
  431. {
  432. {DataVariables.Usage, carrier.CarrierType.ToString()},
  433. {DataVariables.CarrierID, carrier.CarrierId},
  434. {DataVariables.BufferCapacitiyList, GetBufferCapacitiyList()},
  435. {DataVariables.BufferMaterialInfo, BufferMaterialInfos},
  436. });
  437. }
  438. }
  439. public void JobCreated(ControlJobInfo cj, ProcessJobInfo pj)
  440. {
  441. }
  442. public void SideDummyStateAlarm(CarrierInfo carrier)
  443. {
  444. EV.Notify(UniversalEvents.SideDummyStateAlarm, new SerializableDictionary<string, object>()
  445. {
  446. {DataVariables.CarrierID, carrier.CarrierId},
  447. });
  448. }
  449. public void ExtraDummyStateAlarm(CarrierInfo carrier)
  450. {
  451. EV.Notify(UniversalEvents.ExtraDummyStateAlarm, new SerializableDictionary<string, object>()
  452. {
  453. {DataVariables.CarrierID, carrier.CarrierId},
  454. });
  455. }
  456. public void SideDummyStateWarning(CarrierInfo carrier)
  457. {
  458. EV.Notify(UniversalEvents.SideDummyStateWarning, new SerializableDictionary<string, object>()
  459. {
  460. {DataVariables.CarrierID, carrier.CarrierId},
  461. });
  462. }
  463. public void ExtraDummyStateWarning(CarrierInfo carrier)
  464. {
  465. EV.Notify(UniversalEvents.ExtraDummyStateWarning, new SerializableDictionary<string, object>()
  466. {
  467. {DataVariables.CarrierID, carrier.CarrierId},
  468. });
  469. }
  470. public void CarrierInEnd(ModuleName module)
  471. {
  472. var carrier = CarrierManager.Instance.GetCarrier(module, 0);
  473. if (carrier == null || carrier.IsEmpty)
  474. return;
  475. List<int> slotMapList = new List<int>();
  476. var wafers = WaferManager.Instance.GetWafers(module);
  477. if (wafers != null)
  478. {
  479. foreach (var wafer in wafers)
  480. {
  481. switch (wafer.Status)
  482. {
  483. case WaferStatus.Normal:
  484. slotMapList.Add(3);
  485. break;
  486. case WaferStatus.Empty:
  487. slotMapList.Add(1);
  488. break;
  489. case WaferStatus.Double:
  490. slotMapList.Add(2);
  491. break;
  492. case WaferStatus.Crossed:
  493. slotMapList.Add(4);
  494. break;
  495. case WaferStatus.Unknown:
  496. slotMapList.Add(5);
  497. break;
  498. }
  499. }
  500. }
  501. SerializableDictionary<string, object> dvid = new SerializableDictionary<string, object>();
  502. string slotMap = "";
  503. foreach (var item in slotMapList)
  504. {
  505. slotMap += item;
  506. }
  507. dvid["SlotMap"] = slotMap;
  508. dvid["SlotMapList"] = slotMapList;
  509. dvid["CarrierType"] = carrier.CarrierType;
  510. dvid["CarrierID"] = carrier.CarrierId;
  511. EV.Notify("SLOT_MAP_AVAILABLE", dvid);
  512. Singleton<FAJobController>.Instance.Eqp_NoteCarrierSlotMapRead(carrier.PortID, slotMap);
  513. CarrierInEnd(carrier);
  514. }
  515. public SECsDataItem GetBufferCapacitiyList()
  516. {
  517. SECsDataItem bufinfo = new SECsDataItem(SECsFormat.List);
  518. bufinfo.Add("BUFPara", "Partition1");
  519. bufinfo.Add("BUFPara", "General");
  520. int emptyStocker = 0;
  521. int totalStocker = 0;
  522. foreach (var key in Singleton<EquipmentManager>.Instance.Modules.Keys)
  523. {
  524. if (ModuleHelper.IsStocker(key))
  525. totalStocker++;
  526. if (ModuleHelper.IsStocker(key) && CarrierManager.Instance.CheckNoCarrier(key, 0))
  527. {
  528. var has = false;
  529. foreach (var key1 in Singleton<EquipmentManager>.Instance.Modules.Keys)
  530. {
  531. if (CarrierManager.Instance.CheckHasCarrier(key1, 0) && CarrierManager.Instance.GetCarrier(key1, 0).InternalModuleName == key)
  532. {
  533. has = true;
  534. break;
  535. }
  536. }
  537. if (has)
  538. continue;
  539. emptyStocker++;
  540. }
  541. }
  542. bufinfo.Add("BUFPara", emptyStocker, SECsFormat.U1);
  543. bufinfo.Add("BUFPara", totalStocker, SECsFormat.U1);
  544. int unallocatedPartitionCapacity = 0;
  545. List<ModuleName> checkList = new List<ModuleName>()
  546. {
  547. ModuleName.LP1,
  548. ModuleName.LP2,
  549. ModuleName.FIMS1,
  550. ModuleName.FIMS2,
  551. };
  552. foreach (var module in checkList)
  553. {
  554. if (CarrierManager.Instance.CheckHasCarrier(module, 0))
  555. unallocatedPartitionCapacity++;
  556. }
  557. bufinfo.Add("BUFPara", unallocatedPartitionCapacity, SECsFormat.U1);
  558. return bufinfo;
  559. }
  560. }
  561. }