SchedulerFACallback.cs 26 KB

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