WaferTaskManager.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593
  1. using Aitex.Core.Common;
  2. using Aitex.Core.RT.Log;
  3. using Aitex.Core.Util;
  4. using MECF.Framework.Common.Equipment;
  5. using MECF.Framework.Common.Jobs;
  6. using MECF.Framework.Common.RecipeCenter;
  7. using MECF.Framework.Common.SubstrateTrackings;
  8. using MECF.Framework.Common.WaferHolder;
  9. using CyberX8_RT.Modules.PUF;
  10. using CyberX8_RT.Modules;
  11. using CyberX8_RT.Schedulers;
  12. using System;
  13. using System.Collections.Concurrent;
  14. using System.Collections.Generic;
  15. using System.Linq;
  16. using System.Text;
  17. using System.Threading.Tasks;
  18. using System.Windows.Markup;
  19. using Aitex.Core.RT.SCCore;
  20. namespace CyberX8_RT.Dispatch
  21. {
  22. public class WaferTaskManager : Singleton<WaferTaskManager>
  23. {
  24. #region 常量
  25. private const string SIDE_A = "SideA";
  26. private const string SIDE_B = "SideB";
  27. #endregion
  28. #region 内部变量
  29. /// <summary>
  30. /// FA回复
  31. /// </summary>
  32. private SchedulerFACallback _schedulerFACallback = new SchedulerFACallback();
  33. /// <summary>
  34. /// 任务锁
  35. /// </summary>
  36. private object _taskLocker = new object();
  37. /// <summary>
  38. /// 任务集合
  39. /// </summary>
  40. private List<WaferTask> _waferTaskList = new List<WaferTask>();
  41. /// <summary>
  42. /// Wafer task字典
  43. /// </summary>
  44. private ConcurrentDictionary<string, WaferTask> _waferTasksDic = new ConcurrentDictionary<string, WaferTask>();
  45. /// <summary>
  46. /// Wafer配对字典(key-自身WaferId,value-配对WaferId)
  47. /// </summary>
  48. private ConcurrentDictionary<string, string> _waferTaskMatchDic = new ConcurrentDictionary<string, string>();
  49. /// <summary>
  50. /// Wafer--WaferHolder任务字典(key-自身WaferId,value-WaferHolder任务)
  51. /// </summary>
  52. private ConcurrentDictionary<string, WaferHolderTask> _waferWaferHolderTaskDic = new ConcurrentDictionary<string, WaferHolderTask>();
  53. #endregion
  54. /// <summary>
  55. /// 初始化Task
  56. /// </summary>
  57. /// <param name="task"></param>
  58. public void InitializeTask(WaferTask task)
  59. {
  60. _waferTasksDic[task.WaferId] = task;
  61. lock(_taskLocker)
  62. {
  63. _waferTaskList.Add(task);
  64. }
  65. }
  66. /// <summary>
  67. /// 获取WaferTask
  68. /// </summary>
  69. /// <param name="waferId"></param>
  70. /// <returns></returns>
  71. public WaferTask GetWaferTask(string waferId)
  72. {
  73. return _waferTasksDic.ContainsKey(waferId) ? _waferTasksDic[waferId] : null;
  74. }
  75. /// <summary>
  76. /// 是否包含
  77. /// </summary>
  78. /// <param name="waferId"></param>
  79. /// <returns></returns>
  80. public bool Contains(string waferId)
  81. {
  82. return _waferTasksDic.ContainsKey(waferId);
  83. }
  84. /// <summary>
  85. /// 移除任务
  86. /// </summary>
  87. /// <param name="waferId"></param>
  88. public void RemoveWaferTask(string waferId)
  89. {
  90. if(_waferTasksDic.ContainsKey(waferId))
  91. {
  92. _waferTasksDic.TryRemove(waferId, out var task);
  93. task.Dispose();
  94. task.OnTaskComplete -= WaferTask_OnTaskComplete;
  95. LOG.WriteBackgroundLog(eEvent.EV_SCHEDULER, "Scheduler", $"remove wafer {waferId} task");
  96. }
  97. if(_waferTaskMatchDic.ContainsKey(waferId))
  98. {
  99. _waferTaskMatchDic.TryRemove(waferId,out var taskMath);
  100. }
  101. lock(_taskLocker)
  102. {
  103. int index = _waferTaskList.FindIndex(O => O.WaferId == waferId);
  104. if (index >= 0)
  105. {
  106. _waferTaskList.RemoveAt(index);
  107. }
  108. }
  109. }
  110. /// <summary>
  111. /// 加载Wafer Task集合
  112. /// </summary>
  113. /// <returns></returns>
  114. public List<WaferTask> LoadWaferTaskList()
  115. {
  116. return _waferTaskList.ToList();
  117. }
  118. /// <summary>
  119. /// 创建Wafer任务
  120. /// </summary>
  121. public int CreateWaferTask(List<ProcessJobInfo> processJobInfos, WaferHolderInfo waferHolderInfo,WaferHolderTask waferHolderTask)
  122. {
  123. int count = 0;
  124. string mateWaferTask = "";
  125. List<WaferInfo> wafers = new List<WaferInfo>();
  126. if (processJobInfos.Count == 0)
  127. {
  128. return 0;
  129. }
  130. for(int i=0; i<processJobInfos.Count;i++)
  131. {
  132. ProcessJobInfo processJobInfo = processJobInfos[i];
  133. for(int j=0;j< processJobInfo.SlotWafers.Count; j++)
  134. {
  135. var item = processJobInfo.SlotWafers[j];
  136. if (WaferManager.Instance.CheckHasWafer(item.Item1, item.Item2))
  137. {
  138. WaferInfo waferInfo = WaferManager.Instance.GetWafer(item.Item1, item.Item2);
  139. if (waferInfo != null && waferInfo.ProcessState == EnumWaferProcessStatus.Idle)
  140. {
  141. if (!Contains(waferInfo.WaferID))
  142. {
  143. if (count == 0)
  144. {
  145. wafers.Add(waferInfo);
  146. count++;
  147. }
  148. else
  149. {
  150. wafers.Add(waferInfo);
  151. break;
  152. }
  153. }
  154. }
  155. }
  156. }
  157. }
  158. SequenceRecipe sequenceRecipe = processJobInfos[0].SequenceRecipe;
  159. if (wafers.Count == 1)
  160. {
  161. WaferInfo waferInfo = wafers[0];
  162. ModuleName pufModuleName = ModuleName.PUF1;
  163. string waferSide = "";
  164. string dummySide = "";
  165. bool lastSingleWaferToSideB = sequenceRecipe.LastSingleWaferToSideB;
  166. if (lastSingleWaferToSideB)
  167. {
  168. if (CheckLoaderHasSameWaferSize())
  169. {
  170. waferSide = SIDE_B;
  171. dummySide = SIDE_A;
  172. }
  173. else
  174. {
  175. string side = AnalyseLoadSide(sequenceRecipe);
  176. waferSide = side;
  177. dummySide = side;
  178. }
  179. }
  180. else
  181. {
  182. if (CheckLoaderHasSameWaferSize())
  183. {
  184. waferSide = SIDE_A;
  185. dummySide = SIDE_B;
  186. }
  187. else
  188. {
  189. string side = AnalyseLoadSide(sequenceRecipe);
  190. waferSide = side;
  191. dummySide = side;
  192. }
  193. }
  194. if (CheckWaferHolderHasSameTypeWafers(waferHolderInfo))
  195. {
  196. List<WaferInfo> dummyWafers = DummyWaferManager.Instance.LoadDummyWafersByWaferHolder(waferHolderInfo);
  197. if (dummyWafers.Count != 0)
  198. {
  199. CreateWaferTaskSchedulerSequence(waferInfo, pufModuleName, waferHolderInfo, waferInfo.ProcessJob.SequenceRecipe, "",waferSide);
  200. WaferInfo dummyInfo = null;
  201. if (dummyWafers.Count > 1)
  202. {
  203. foreach (WaferInfo info in dummyWafers)
  204. {
  205. //最后一片Wafer使用B面,那么dummy片使用0 slot
  206. if (lastSingleWaferToSideB && info.OriginSlot == 0)
  207. {
  208. dummyInfo = info;
  209. break;
  210. }
  211. //最后一片Wafer使用A面,那么dummy片使用1 slot
  212. if (!lastSingleWaferToSideB && info.OriginSlot == 1)
  213. {
  214. dummyInfo = info;
  215. break;
  216. }
  217. }
  218. if (dummyInfo == null)
  219. {
  220. dummyInfo = dummyWafers[0];
  221. }
  222. }
  223. else
  224. {
  225. dummyInfo = dummyWafers[0];
  226. }
  227. CreateDummyWaferTaskSchedulerSequence(waferHolderInfo.SequenceRecipe, dummyInfo, pufModuleName, waferInfo.WaferID,dummySide);
  228. _waferTaskMatchDic[waferInfo.WaferID] = dummyWafers[0].WaferID;
  229. _waferTaskMatchDic[dummyWafers[0].WaferID] = waferInfo.WaferID;
  230. _waferWaferHolderTaskDic[waferInfo.WaferID] = waferHolderTask;
  231. _waferWaferHolderTaskDic[dummyWafers[0].WaferID] = waferHolderTask;
  232. return 2;
  233. }
  234. else
  235. {
  236. CreateWaferTaskSchedulerSequence(waferInfo, pufModuleName, waferHolderInfo, waferInfo.ProcessJob.SequenceRecipe, "",waferSide);
  237. _waferWaferHolderTaskDic[waferInfo.WaferID] = waferHolderTask;
  238. return 1;
  239. }
  240. }
  241. else
  242. {
  243. CreateWaferTaskSchedulerSequence(waferInfo, pufModuleName, waferHolderInfo, waferInfo.ProcessJob.SequenceRecipe, "",waferSide);
  244. _waferWaferHolderTaskDic[waferInfo.WaferID] = waferHolderTask;
  245. return 1;
  246. }
  247. }
  248. else if (wafers.Count >= 2)
  249. {
  250. for (int i = 0; i < 2; i++)
  251. {
  252. WaferInfo waferInfo = wafers[i];
  253. ModuleName pufModuleName = ModuleName.PUF1;
  254. if (i == 0)
  255. {
  256. mateWaferTask = wafers[0].WaferID;
  257. if (CheckLoaderHasSameWaferSize())
  258. {
  259. CreateWaferTaskSchedulerSequence(waferInfo, pufModuleName, waferHolderInfo, waferInfo.ProcessJob.SequenceRecipe, "", SIDE_A);
  260. }
  261. else
  262. {
  263. string side = AnalyseLoadSide(sequenceRecipe);
  264. CreateWaferTaskSchedulerSequence(waferInfo, pufModuleName, waferHolderInfo, waferInfo.ProcessJob.SequenceRecipe, "", side);
  265. }
  266. }
  267. else
  268. {
  269. if (CheckLoaderHasSameWaferSize())
  270. {
  271. CreateWaferTaskSchedulerSequence(waferInfo, pufModuleName, waferHolderInfo, waferInfo.ProcessJob.SequenceRecipe, mateWaferTask, SIDE_B);
  272. }
  273. else
  274. {
  275. string side = AnalyseLoadSide(sequenceRecipe);
  276. CreateWaferTaskSchedulerSequence(waferInfo, pufModuleName, waferHolderInfo, waferInfo.ProcessJob.SequenceRecipe, mateWaferTask, side);
  277. }
  278. }
  279. }
  280. _waferTaskMatchDic[wafers[0].WaferID] = wafers[1].WaferID;
  281. _waferTaskMatchDic[wafers[1].WaferID] = wafers[0].WaferID;
  282. _waferWaferHolderTaskDic[wafers[0].WaferID] = waferHolderTask;
  283. _waferWaferHolderTaskDic[wafers[1].WaferID] = waferHolderTask;
  284. return 2;
  285. }
  286. return 0;
  287. }
  288. /// <summary>
  289. /// 检验Loader两边是不是尺寸一致
  290. /// </summary>
  291. /// <returns></returns>
  292. private bool CheckLoaderHasSameWaferSize()
  293. {
  294. int sideAWaferSize = SC.GetValue<int>($"Loader1.SideAWaferSize");
  295. int sideBWaferSize = SC.GetValue<int>($"Loader1.SideBWaferSize");
  296. return sideAWaferSize == sideBWaferSize;
  297. }
  298. /// <summary>
  299. /// Loader两边尺寸不一致,解析Loader使用side
  300. /// </summary>
  301. /// <param name="recipe"></param>
  302. /// <returns></returns>
  303. private string AnalyseLoadSide(SequenceRecipe recipe)
  304. {
  305. int sideAWaferSize = SC.GetValue<int>($"Loader1.SideAWaferSize");
  306. int sideBWaferSize = SC.GetValue<int>($"Loader1.SideBWaferSize");
  307. if (sideAWaferSize != sideBWaferSize)
  308. {
  309. if(recipe.SubstrateSize==sideAWaferSize)
  310. {
  311. return SIDE_A;
  312. }
  313. else
  314. {
  315. return SIDE_B;
  316. }
  317. }
  318. return "";
  319. }
  320. /// <summary>
  321. /// 检验WaferHolder是否存在两片生产片
  322. /// </summary>
  323. /// <param name="waferHolderInfo"></param>
  324. /// <returns></returns>
  325. private bool CheckWaferHolderHasSameTypeWafers(WaferHolderInfo waferHolderInfo)
  326. {
  327. int count = 0;
  328. WaferInfo waferAInfo = WaferManager.Instance.GetWaferByWaferId(waferHolderInfo.WaferAId);
  329. WaferType waferType = WaferType.Production;
  330. if (waferAInfo != null)
  331. {
  332. waferType = waferAInfo.WaferType;
  333. count++;
  334. }
  335. WaferInfo waferBInfo = WaferManager.Instance.GetWaferByWaferId(waferHolderInfo.WaferBId);
  336. if (waferBInfo != null)
  337. {
  338. if (waferBInfo.WaferType == waferType)
  339. {
  340. count++;
  341. }
  342. }
  343. return count >= 2;
  344. }
  345. /// <summary>
  346. /// 检验WaferHolder是否存在两片生产片
  347. /// </summary>
  348. /// <param name="waferHolderInfo"></param>
  349. /// <returns></returns>
  350. private bool CheckWaferHolderHasTwoProductionWafers(WaferHolderInfo waferHolderInfo)
  351. {
  352. int count = 0;
  353. WaferInfo waferAInfo = WaferManager.Instance.GetWaferByWaferId(waferHolderInfo.WaferAId);
  354. if (waferAInfo != null && waferAInfo.WaferType==WaferType.Production)
  355. {
  356. count++;
  357. }
  358. WaferInfo waferBInfo = WaferManager.Instance.GetWaferByWaferId(waferHolderInfo.WaferBId);
  359. if (waferBInfo != null && waferBInfo.WaferType == WaferType.Production)
  360. {
  361. count++;
  362. }
  363. return count >= 2;
  364. }
  365. /// <summary>
  366. /// 创建WaferTask SchedulerSequence
  367. /// </summary>
  368. /// <param name="waferInfo"></param>
  369. /// <param name="pufModuleName"></param>
  370. /// <param name="waferHolderInfo"></param>
  371. /// <param name="sequenceRecipe"></param>
  372. private void CreateWaferTaskSchedulerSequence(WaferInfo waferInfo, ModuleName pufModuleName, WaferHolderInfo waferHolderInfo, SequenceRecipe sequenceRecipe, string mateWafeTask,string side)
  373. {
  374. List<SchedulerSequence> sequences = SchedulerSequenceManager.Instance.AnalyWaferAllSchedulerSequence(waferInfo, pufModuleName,side, waferHolderInfo, sequenceRecipe);
  375. PUFEntity pufEntity = Singleton<RouteManager>.Instance.GetModule<PUFEntity>(pufModuleName.ToString());
  376. WaferTask waferTask = new WaferTask(waferInfo, pufEntity, sequences);
  377. if (!string.IsNullOrEmpty(mateWafeTask))
  378. {
  379. waferTask.MateWaferTask = mateWafeTask;
  380. }
  381. waferTask.OnTaskComplete += WaferTask_OnTaskComplete;
  382. LOG.WriteLog(eEvent.EV_SEQUENCE, "Scheduler", $"Create wafer {waferInfo.WaferID} task");
  383. InitializeTask(waferTask);
  384. }
  385. /// <summary>
  386. /// 创建DummyWaferTask
  387. /// </summary>
  388. /// <param name="waferInfos"></param>
  389. public int CreateDummyWaferTask(List<WaferInfo> waferInfos,SequenceRecipe sequenceRecipe,WaferHolderTask waferHolderTask)
  390. {
  391. string mateWaferTask = "";
  392. int waferCount = 0;
  393. for (int i = 0; i < waferInfos.Count; i++)
  394. {
  395. WaferInfo waferInfo = waferInfos[i];
  396. int orginalSlot = waferInfo.OriginSlot;
  397. ModuleName pufModuleName = ModuleName.PUF1;
  398. string side = orginalSlot == 0 ? SIDE_A : SIDE_B;
  399. if(!CheckLoaderHasSameWaferSize())
  400. {
  401. side = AnalyseLoadSide(sequenceRecipe);
  402. }
  403. waferCount = i;
  404. if (!Contains(waferInfo.WaferID))
  405. {
  406. if (i == 0)
  407. {
  408. mateWaferTask = waferInfo.WaferID;
  409. CreateDummyWaferTaskSchedulerSequence(sequenceRecipe,waferInfo, pufModuleName,"", side);
  410. _waferWaferHolderTaskDic[waferInfo.WaferID] = waferHolderTask;
  411. }
  412. else
  413. {
  414. CreateDummyWaferTaskSchedulerSequence(sequenceRecipe,waferInfo, pufModuleName, mateWaferTask,side);
  415. _waferTaskMatchDic[mateWaferTask] = waferInfo.WaferID;
  416. _waferTaskMatchDic[waferInfo.WaferID] = mateWaferTask;
  417. _waferWaferHolderTaskDic[waferInfo.WaferID]= waferHolderTask;
  418. break;
  419. }
  420. }
  421. }
  422. return waferCount + 1;
  423. }
  424. /// <summary>
  425. /// 创建Dummy Wafer Task 调度工序
  426. /// </summary>
  427. /// <param name="waferInfo"></param>
  428. /// <param name="pufModuleName"></param>
  429. /// <param name="mateWaferTask"></param>
  430. private void CreateDummyWaferTaskSchedulerSequence(SequenceRecipe sequenceRecipe,WaferInfo waferInfo,ModuleName pufModuleName,string mateWaferTask,string side)
  431. {
  432. List<SchedulerSequence> sequences = SchedulerSequenceManager.Instance.AnalyDummyWaferAllSchedulerSequence(sequenceRecipe,waferInfo,pufModuleName, side);
  433. PUFEntity pufEntity = Singleton<RouteManager>.Instance.GetModule<PUFEntity>(pufModuleName.ToString());
  434. WaferTask waferTask = new WaferTask(waferInfo, pufEntity,sequences);
  435. if (!string.IsNullOrEmpty(mateWaferTask))
  436. {
  437. waferTask.MateWaferTask = mateWaferTask;
  438. }
  439. LOG.WriteLog(eEvent.EV_SEQUENCE, "Scheduler", $"Create Dummy wafer {waferInfo.WaferID} task");
  440. waferTask.OnTaskStart += WaferTask_OnTaskStart;
  441. waferTask.OnTaskComplete += WaferTask_OnTaskComplete;
  442. InitializeTask(waferTask);
  443. }
  444. /// <summary>
  445. /// 任务开始
  446. /// </summary>
  447. /// <param name="id"></param>
  448. /// <exception cref="NotImplementedException"></exception>
  449. private void WaferTask_OnTaskStart(string id)
  450. {
  451. WaferInfo waferInfo = WaferManager.Instance.GetWaferByWaferId(id);
  452. if (waferInfo != null && waferInfo.WaferType == WaferType.Production)
  453. {
  454. ModuleName moduleName = (ModuleName)waferInfo.OriginStation;
  455. if (ModuleHelper.IsLoadPort(moduleName))
  456. {
  457. CycleManager.Instance.UpdateCycleWaferCount(moduleName.ToString());
  458. }
  459. _schedulerFACallback.JobWaferStart(JobProcesser.Instance.GetControlJobInfoByProcessJob(waferInfo.ProcessJob),
  460. waferInfo.SequenceName, waferInfo.OriginSlot);
  461. }
  462. }
  463. /// <summary>
  464. /// Wafer task完成事件
  465. /// </summary>
  466. /// <param name="id"></param>
  467. private void WaferTask_OnTaskComplete(string id)
  468. {
  469. WaferInfo waferInfo=WaferManager.Instance.GetWaferByWaferId(id);
  470. if (waferInfo != null&&waferInfo.WaferType==WaferType.Production)
  471. {
  472. ModuleName moduleName = (ModuleName)waferInfo.OriginStation;
  473. if (ModuleHelper.IsLoadPort(moduleName))
  474. {
  475. CycleManager.Instance.UpdateCycleWaferCount(moduleName.ToString());
  476. }
  477. _schedulerFACallback.JobWaferEnd(JobProcesser.Instance.GetControlJobInfoByProcessJob(waferInfo.ProcessJob),
  478. waferInfo.SequenceName, waferInfo.OriginSlot);
  479. }
  480. RemoveWaferTask(id);
  481. }
  482. /// <summary>
  483. /// 检验所有task是否完成
  484. /// </summary>
  485. /// <returns></returns>
  486. public bool CheckAllTaskComplete()
  487. {
  488. return _waferTaskList.Count == 0;
  489. }
  490. /// <summary>
  491. /// 暂停
  492. /// </summary>
  493. public void PauseAllTask()
  494. {
  495. List<WaferTask> waferTasks = _waferTaskList.ToList();
  496. foreach(WaferTask item in waferTasks)
  497. {
  498. item.Pause();
  499. }
  500. }
  501. /// <summary>
  502. /// 恢复所有任务
  503. /// </summary>
  504. public void ResumeAllTask()
  505. {
  506. List<WaferTask> waferTasks = _waferTaskList.ToList();
  507. foreach (WaferTask item in waferTasks)
  508. {
  509. item.Resume();
  510. }
  511. }
  512. /// <summary>
  513. /// 恢复所有任务
  514. /// </summary>
  515. public void RemoveAllTask()
  516. {
  517. List<WaferTask> waferTasks = _waferTaskList.ToList();
  518. foreach (WaferTask item in waferTasks)
  519. {
  520. RemoveWaferTask(item.WaferId);
  521. }
  522. }
  523. /// <summary>
  524. /// 根据WaferId获取配对另一个WaferId
  525. /// </summary>
  526. /// <param name="waferId"></param>
  527. /// <returns></returns>
  528. public string GetMatchWaferIdByWaferId(string waferId)
  529. {
  530. return _waferTaskMatchDic.ContainsKey(waferId) ? _waferTaskMatchDic[waferId] : "";
  531. }
  532. /// <summary>
  533. /// 移除WaferId匹配WaferHolderTask字典
  534. /// </summary>
  535. /// <param name="waferId"></param>
  536. public void RemoveWaferIdMatchWaferHolderTaskDic(string waferId)
  537. {
  538. if(_waferWaferHolderTaskDic.ContainsKey(waferId))
  539. {
  540. _waferWaferHolderTaskDic.TryRemove(waferId, out var waferHolderTask);
  541. }
  542. }
  543. /// <summary>
  544. /// 获取WaferId匹配WaferHolderTask字典
  545. /// </summary>
  546. /// <param name="waferId"></param>
  547. /// <returns></returns>
  548. public WaferHolderTask GetWaferHolderTaskByWaferId(string waferId)
  549. {
  550. return _waferWaferHolderTaskDic.ContainsKey(waferId) ? _waferWaferHolderTaskDic[waferId] : null;
  551. }
  552. /// <summary>
  553. /// 获取WaferHolder Task对应的Wafer Task WaferId集合
  554. /// </summary>
  555. /// <param name="waferHolderId"></param>
  556. /// <returns></returns>
  557. public List<string> GetWaferHolderMathWaferId(string waferHolderId)
  558. {
  559. List<string> keys = _waferWaferHolderTaskDic.Keys.ToList();
  560. List<string> result = new List<string>();
  561. foreach(string item in keys)
  562. {
  563. if(_waferWaferHolderTaskDic[item].WaferHolderInfo.Id==waferHolderId)
  564. {
  565. result.Add(item);
  566. }
  567. }
  568. return result;
  569. }
  570. /// <summary>
  571. /// 检验Wafer存在匹配的wafer任务(wafer是单片任务还是双片任务)
  572. /// </summary>
  573. /// <param name="waferId"></param>
  574. /// <returns></returns>
  575. public string CheckWaferHasMatch(string waferId)
  576. {
  577. if (_waferTaskMatchDic.ContainsKey(waferId))
  578. {
  579. return _waferTaskMatchDic[waferId];
  580. }
  581. else
  582. {
  583. return "";
  584. }
  585. }
  586. }
  587. }