OperationOverViewModel.cs 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225
  1. using MECF.Framework.Common.CommonData;
  2. using MECF.Framework.Common.DataCenter;
  3. using MECF.Framework.Common.Equipment;
  4. using MECF.Framework.Common.OperationCenter;
  5. using OpenSEMI.ClientBase;
  6. using Prism.Commands;
  7. using Prism.Mvvm;
  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;
  14. using System.Windows.Threading;
  15. using Venus_Core;
  16. using Venus_MainPages.Unity;
  17. using Venus_MainPages.Views;
  18. using Venus_Themes.CustomControls;
  19. using Venus_Themes.Unity;
  20. using static Venus_Themes.UserControls.EFEM;
  21. namespace Venus_MainPages.ViewModels
  22. {
  23. public class OperationOverViewModel : BindableBase
  24. {
  25. #region 私有字段
  26. private bool m_TabIsChecked = true;
  27. private ModuleInfo m_LP1ModuleInfo;
  28. private ModuleInfo m_LP2ModuleInfo;
  29. private ModuleInfo m_LLAModuleInfo;
  30. private ModuleInfo m_LLBModuleInfo;
  31. private ModuleInfo m_LP3ModuleInfo;
  32. private ModuleInfo m_EFEMModuleInfo;
  33. private ModuleInfo m_TMModuleInfo;
  34. private WaferRobotTAction m_Robot1TAction;
  35. private WaferRobotXAction m_Robot1XAction;
  36. private WaferRobotTAction m_Robot2TAction;
  37. private WaferRobotXAction m_Robot2XAction;
  38. private WaferRobotTAction m_Robot3TAction;
  39. private WaferRobotXAction m_Robot3XAction;
  40. private WaferRobotTAction m_Robot4TAction;
  41. private WaferRobotXAction m_Robot4XAction;
  42. private RobotMoveInfo m_robotMoveInfo;
  43. private WaferInfo m_PMAWafer;
  44. private WaferInfo m_PMBWafer;
  45. private WaferInfo m_PMCWafer;
  46. private WaferInfo m_PMDWafer;
  47. private WaferInfo m_LLAWafer;
  48. private WaferInfo m_LLBWafer;
  49. private WaferInfo m_TMBladeAWafer;
  50. private WaferInfo m_TMBladeBWafer;
  51. private List<string> m_RtDataKeys = new List<string>();
  52. private Dictionary<string, object> m_RtDataValues;
  53. private bool m_PMAIsInstalled;
  54. private bool m_PMBIsInstalled;
  55. private bool m_PMCIsInstalled;
  56. private bool m_PMDIsInstalled;
  57. private bool m_LLAIsInstalled;
  58. private bool m_LLBIsInstalled;
  59. private bool m_TMIsInstalled;
  60. private bool m_EFEMIsInstalled;
  61. private WaferInfo m_EFEMBladeAWafer;
  62. private WaferInfo m_EFEMBladeBWafer;
  63. private WaferInfo m_Aligner1Wafer;
  64. private int m_LP1WaferCount;
  65. private int m_LP2WaferCount;
  66. private int m_LP3WaferCount;
  67. private WaferAssociationInfo _lp1WaferAssociation;
  68. private WaferAssociationInfo _lp2WaferAssociation;
  69. private WaferAssociationInfo _lp3WaferAssociation;
  70. private int m_CycledWafer;
  71. private int m_CycleCountDisplay;
  72. private RobotPosition m_CurrentRobotPosition;
  73. private WaferInfo m_BladeAWafer;
  74. private WaferInfo m_BladeBWafer;
  75. private RecipeResult m_PMARecipeResult;
  76. private RecipeResult m_PMBRecipeResult;
  77. private RecipeResult m_PMCRecipeResult;
  78. private RecipeResult m_PMDRecipeResult;
  79. private string m_ATMModeIsOn;
  80. private float m_TMPressure;
  81. #endregion
  82. #region 属性
  83. public bool TabIsChecked
  84. {
  85. get { return m_TabIsChecked; }
  86. set { SetProperty(ref m_TabIsChecked, value); }
  87. }
  88. public ModuleInfo LP1ModuleInfo
  89. {
  90. get { return m_LP1ModuleInfo; }
  91. set { SetProperty(ref m_LP1ModuleInfo, value); }
  92. }
  93. public ModuleInfo LLAModuleInfo
  94. {
  95. get { return m_LLAModuleInfo; }
  96. set { SetProperty(ref m_LLAModuleInfo, value); }
  97. }
  98. public ModuleInfo LLBModuleInfo
  99. {
  100. get { return m_LLBModuleInfo; }
  101. set { SetProperty(ref m_LLBModuleInfo, value); }
  102. }
  103. public ModuleInfo EFEMModuleInfo
  104. {
  105. get { return m_EFEMModuleInfo; }
  106. set { SetProperty(ref m_EFEMModuleInfo, value); }
  107. }
  108. public ModuleInfo TMModuleInfo
  109. {
  110. get { return m_TMModuleInfo; }
  111. set { SetProperty(ref m_TMModuleInfo, value); }
  112. }
  113. public ModuleInfo LP2ModuleInfo
  114. {
  115. get { return m_LP2ModuleInfo; }
  116. set { SetProperty(ref m_LP2ModuleInfo, value); }
  117. }
  118. public ModuleInfo LP3ModuleInfo
  119. {
  120. get { return m_LP3ModuleInfo; }
  121. set { SetProperty(ref m_LP3ModuleInfo, value); }
  122. }
  123. public WaferRobotTAction Robot1TAction
  124. {
  125. get { return m_Robot1TAction; }
  126. set { SetProperty(ref m_Robot1TAction, value); }
  127. }
  128. public WaferRobotXAction Robot1XAction
  129. {
  130. get { return m_Robot1XAction; }
  131. set { SetProperty(ref m_Robot1XAction, value); }
  132. }
  133. public WaferRobotTAction Robot2TAction
  134. {
  135. get { return m_Robot2TAction; }
  136. set { SetProperty(ref m_Robot2TAction, value); }
  137. }
  138. public WaferRobotXAction Robot2XAction
  139. {
  140. get { return m_Robot2XAction; }
  141. set { SetProperty(ref m_Robot2XAction, value); }
  142. }
  143. public WaferRobotTAction Robot3TAction
  144. {
  145. get { return m_Robot3TAction; }
  146. set { SetProperty(ref m_Robot3TAction, value); }
  147. }
  148. public WaferRobotXAction Robot3XAction
  149. {
  150. get { return m_Robot3XAction; }
  151. set { SetProperty(ref m_Robot3XAction, value); }
  152. }
  153. public WaferRobotTAction Robot4TAction
  154. {
  155. get { return m_Robot4TAction; }
  156. set { SetProperty(ref m_Robot4TAction, value); }
  157. }
  158. public WaferRobotXAction Robot4XAction
  159. {
  160. get { return m_Robot4XAction; }
  161. set { SetProperty(ref m_Robot4XAction, value); }
  162. }
  163. public RobotMoveInfo RobotMoveInfo
  164. {
  165. get { return m_robotMoveInfo; }
  166. set
  167. {
  168. RobotMoveInfoChanged(m_robotMoveInfo, value);
  169. //m_robotMoveInfo = value;
  170. SetProperty(ref m_robotMoveInfo, value);
  171. }
  172. }
  173. public WaferInfo LLAWafer
  174. {
  175. get { return m_LLAWafer; }
  176. set { SetProperty(ref m_LLAWafer, value); }
  177. }
  178. public WaferInfo LLBWafer
  179. {
  180. get { return m_LLBWafer; }
  181. set { SetProperty(ref m_LLBWafer, value); }
  182. }
  183. public WaferInfo PMAWafer
  184. {
  185. get { return m_PMAWafer; }
  186. set { SetProperty(ref m_PMAWafer, value); }
  187. }
  188. public WaferInfo PMBWafer
  189. {
  190. get { return m_PMBWafer; }
  191. set { SetProperty(ref m_PMBWafer, value); }
  192. }
  193. public WaferInfo PMCWafer
  194. {
  195. get { return m_PMCWafer; }
  196. set { SetProperty(ref m_PMCWafer, value); }
  197. }
  198. public WaferInfo PMDWafer
  199. {
  200. get { return m_PMDWafer; }
  201. set { SetProperty(ref m_PMDWafer, value); }
  202. }
  203. public WaferInfo TMBladeAWafer
  204. {
  205. get { return m_TMBladeAWafer; }
  206. set { SetProperty(ref m_TMBladeAWafer, value); }
  207. }
  208. public WaferInfo TMBladeBWafer
  209. {
  210. get { return m_TMBladeBWafer; }
  211. set { SetProperty(ref m_TMBladeBWafer, value); }
  212. }
  213. public Dictionary<string, object> RtDataValues
  214. {
  215. get { return m_RtDataValues; }
  216. set { SetProperty(ref m_RtDataValues, value); }
  217. }
  218. public bool PMAIsInstalled
  219. {
  220. get { return m_PMAIsInstalled; }
  221. set { SetProperty(ref m_PMAIsInstalled, value); }
  222. }
  223. public bool PMBIsInstalled
  224. {
  225. get { return m_PMBIsInstalled; }
  226. set { SetProperty(ref m_PMBIsInstalled, value); }
  227. }
  228. public bool PMCIsInstalled
  229. {
  230. get { return m_PMCIsInstalled; }
  231. set { SetProperty(ref m_PMCIsInstalled, value); }
  232. }
  233. public bool PMDIsInstalled
  234. {
  235. get { return m_PMDIsInstalled; }
  236. set { SetProperty(ref m_PMDIsInstalled, value); }
  237. }
  238. public bool LLAIsInstalled
  239. {
  240. get { return m_LLAIsInstalled; }
  241. set { SetProperty(ref m_LLAIsInstalled, value); }
  242. }
  243. public bool LLBIsInstalled
  244. {
  245. get { return m_LLBIsInstalled; }
  246. set { SetProperty(ref m_LLBIsInstalled, value); }
  247. }
  248. public bool TMIsInstalled
  249. {
  250. get { return m_TMIsInstalled; }
  251. set { SetProperty(ref m_TMIsInstalled, value); }
  252. }
  253. public bool EFEMIsInstalled
  254. {
  255. get { return m_EFEMIsInstalled; }
  256. set { SetProperty(ref m_EFEMIsInstalled, value); }
  257. }
  258. public WaferInfo EFEMBladeAWafer
  259. {
  260. get { return m_EFEMBladeAWafer; }
  261. set { SetProperty(ref m_EFEMBladeAWafer, value); }
  262. }
  263. public WaferInfo EFEMBladeBWafer
  264. {
  265. get { return m_EFEMBladeBWafer; }
  266. set { SetProperty(ref m_EFEMBladeBWafer, value); }
  267. }
  268. public WaferInfo Aligner1Wafer
  269. {
  270. get { return m_Aligner1Wafer; }
  271. set { SetProperty(ref m_Aligner1Wafer, value); }
  272. }
  273. public int LP1WaferCount
  274. {
  275. get { return m_LP1WaferCount; }
  276. set { SetProperty(ref m_LP1WaferCount, value); }
  277. }
  278. public int LP2WaferCount
  279. {
  280. get { return m_LP2WaferCount; }
  281. set { SetProperty(ref m_LP2WaferCount, value); }
  282. }
  283. public int LP3WaferCount
  284. {
  285. get { return m_LP3WaferCount; }
  286. set { SetProperty(ref m_LP3WaferCount, value); }
  287. }
  288. public WaferAssociationInfo LP1WaferAssociation
  289. {
  290. get { return _lp1WaferAssociation; }
  291. set { SetProperty(ref _lp1WaferAssociation, value); }
  292. }
  293. public WaferAssociationInfo LP2WaferAssociation
  294. {
  295. get { return _lp2WaferAssociation; }
  296. set { SetProperty(ref _lp2WaferAssociation, value); }
  297. }
  298. public WaferAssociationInfo LP3WaferAssociation
  299. {
  300. get { return _lp3WaferAssociation; }
  301. set { SetProperty(ref _lp3WaferAssociation, value); }
  302. }
  303. public int CycledWafer
  304. {
  305. get { return m_CycledWafer; }
  306. set { SetProperty(ref m_CycledWafer, value); }
  307. }
  308. public int CycleCountDisplay
  309. {
  310. get { return m_CycleCountDisplay; }
  311. set { SetProperty(ref m_CycleCountDisplay, value); }
  312. }
  313. public RobotMoveInfo m_EfemRobotMoveInfo;
  314. public RobotMoveInfo EfemRobotMoveInfo
  315. {
  316. get { return m_EfemRobotMoveInfo; }
  317. set
  318. {
  319. EFEMRobotMoveInfoChanged(m_EfemRobotMoveInfo, value);
  320. //m_EfemRobotMoveInfo = value;
  321. SetProperty(ref m_EfemRobotMoveInfo, value);
  322. }
  323. }
  324. public RobotPosition CurrentRobotPosition
  325. {
  326. get { return m_CurrentRobotPosition; }
  327. set { SetProperty(ref m_CurrentRobotPosition, value); }
  328. }
  329. public WaferInfo BladeAWafer
  330. {
  331. get { return m_BladeAWafer; }
  332. set { SetProperty(ref m_BladeAWafer, value); }
  333. }
  334. public WaferInfo BladeBWafer
  335. {
  336. get { return m_BladeBWafer; }
  337. set { SetProperty(ref m_BladeBWafer, value); }
  338. }
  339. public RecipeResult PMARecipeResult
  340. {
  341. get { return m_PMARecipeResult; }
  342. set { SetProperty(ref m_PMARecipeResult, value); }
  343. }
  344. public RecipeResult PMBRecipeResult
  345. {
  346. get { return m_PMBRecipeResult; }
  347. set { SetProperty(ref m_PMBRecipeResult, value); }
  348. }
  349. public RecipeResult PMCRecipeResult
  350. {
  351. get { return m_PMCRecipeResult; }
  352. set { SetProperty(ref m_PMCRecipeResult, value); }
  353. }
  354. public RecipeResult PMDRecipeResult
  355. {
  356. get { return m_PMDRecipeResult; }
  357. set { SetProperty(ref m_PMDRecipeResult, value); }
  358. }
  359. public string ATMModeIsOn
  360. {
  361. get { return m_ATMModeIsOn; }
  362. set { SetProperty(ref m_ATMModeIsOn, value); }
  363. }
  364. public float TMPressure
  365. {
  366. get { return m_TMPressure; }
  367. set { SetProperty(ref m_TMPressure, value); }
  368. }
  369. #endregion
  370. #region 命令
  371. private DelegateCommand _LoadCommand;
  372. public DelegateCommand LoadCommand =>
  373. _LoadCommand ?? (_LoadCommand = new DelegateCommand(OnLoad));
  374. private DelegateCommand<object> _LoadWaferCommand;
  375. public DelegateCommand<object> LoadWaferCommand =>
  376. _LoadWaferCommand ?? (_LoadWaferCommand = new DelegateCommand<object>(OnLoadWafer));
  377. private DelegateCommand<object> _UnLoadWaferCommand;
  378. public DelegateCommand<object> UnLoadWaferCommand =>
  379. _UnLoadWaferCommand ?? (_UnLoadWaferCommand = new DelegateCommand<object>(OnUnLoadWafer));
  380. private DelegateCommand<object> _SelectAllCommand;
  381. public DelegateCommand<object> SelectAllCommand =>
  382. _SelectAllCommand ?? (_SelectAllCommand = new DelegateCommand<object>(OnSelectAll));
  383. private DelegateCommand<object> _UnSelectAllCommand;
  384. public DelegateCommand<object> UnSelectAllCommand =>
  385. _UnSelectAllCommand ?? (_UnSelectAllCommand = new DelegateCommand<object>(OnUnSelectAll));
  386. private DelegateCommand<object> _StartCommand;
  387. public DelegateCommand<object> StartCommand =>
  388. _StartCommand ?? (_StartCommand = new DelegateCommand<object>(OnStart));
  389. private DelegateCommand<object> _StopCommand;
  390. public DelegateCommand<object> StopCommand =>
  391. _StopCommand ?? (_StopCommand = new DelegateCommand<object>(OnStop));
  392. private DelegateCommand<object> _AbortCommand;
  393. public DelegateCommand<object> AbortCommand =>
  394. _AbortCommand ?? (_AbortCommand = new DelegateCommand<object>(OnAbort));
  395. private DelegateCommand _HomeAllCommand;
  396. public DelegateCommand HomeAllCommand =>
  397. _HomeAllCommand ?? (_HomeAllCommand = new DelegateCommand(OnHomeAll));
  398. private DelegateCommand _PauseAllJobCommand;
  399. public DelegateCommand PauseAllJobCommand =>
  400. _PauseAllJobCommand ?? (_PauseAllJobCommand = new DelegateCommand(OnPauseAllJob));
  401. private DelegateCommand _AbortAllCommand;
  402. public DelegateCommand AbortAllCommand =>
  403. _AbortAllCommand ?? (_AbortAllCommand = new DelegateCommand(OnAbortAll));
  404. private DelegateCommand _ReturnAllWaferCommand;
  405. public DelegateCommand ReturnAllWaferCommand =>
  406. _ReturnAllWaferCommand ?? (_ReturnAllWaferCommand = new DelegateCommand(OnReturnAllWafer));
  407. private DelegateCommand<object> _SetSequenceCommand;
  408. public DelegateCommand<object> SetSequenceCommand =>
  409. _SetSequenceCommand ?? (_SetSequenceCommand = new DelegateCommand<object>(OnSetSequence));
  410. private DelegateCommand<object> _CreateJobCommand;
  411. public DelegateCommand<object> CreateJobCommand =>
  412. _CreateJobCommand ?? (_CreateJobCommand = new DelegateCommand<object>(OnCreateJob));
  413. private DelegateCommand _EnableAutoCommand;
  414. public DelegateCommand EnableAutoCommand =>
  415. _EnableAutoCommand ?? (_EnableAutoCommand = new DelegateCommand(OnEnableAuto));
  416. private DelegateCommand _EnableManualCommand;
  417. public DelegateCommand EnableManualCommand =>
  418. _EnableManualCommand ?? (_EnableManualCommand = new DelegateCommand(OnEnableManual));
  419. public bool SwitchFlag;
  420. #endregion
  421. #region 构造函数
  422. public OperationOverViewModel()
  423. {
  424. DispatcherTimer timer = new DispatcherTimer();
  425. timer.Interval = TimeSpan.FromSeconds(0.1);
  426. timer.Tick += Timer_Tick;
  427. timer.Start();
  428. string allModules = QueryDataClient.Instance.Service.GetConfig($"System.InstalledModules").ToString();
  429. PMAIsInstalled = allModules.Contains("PMA");
  430. PMBIsInstalled = allModules.Contains("PMB");
  431. PMCIsInstalled = allModules.Contains("PMC");
  432. PMDIsInstalled = allModules.Contains("PMD");
  433. LLAIsInstalled = allModules.Contains("LLA");
  434. LLBIsInstalled = allModules.Contains("LLB");
  435. EFEMIsInstalled = allModules.Contains("EFEM");
  436. TMIsInstalled = allModules.Contains("TM");
  437. addDataKeys();
  438. SwitchFlag = false;
  439. ATMModeIsOn = Convert.ToBoolean(QueryDataClient.Instance.Service.GetConfig("System.IsATMMode")) == true ? "ATM Mode On" : "ATM Mode Off";
  440. }
  441. #endregion
  442. #region 命令方法
  443. private void OnLoad()
  444. {
  445. if (!SwitchFlag)
  446. {
  447. LP1WaferAssociation = new WaferAssociationInfo();
  448. LP3WaferAssociation = new WaferAssociationInfo();
  449. LP2WaferAssociation = new WaferAssociationInfo();
  450. LP1WaferAssociation.ModuleData = ModuleManager.ModuleInfos["LP1"];
  451. LP2WaferAssociation.ModuleData = ModuleManager.ModuleInfos["LP2"];
  452. LP3WaferAssociation.ModuleData = ModuleManager.ModuleInfos["LP3"];
  453. SwitchFlag = true;
  454. }
  455. }
  456. private void OnLoadWafer(object obj)
  457. {
  458. InvokeClient.Instance.Service.DoOperation($"{obj.ToString()}.Load", ModuleManager.ModuleInfos[obj.ToString()].ModuleID);
  459. }
  460. private void OnUnLoadWafer(object obj)
  461. {
  462. InvokeClient.Instance.Service.DoOperation($"{obj.ToString()}.Unload", ModuleManager.ModuleInfos[obj.ToString()].ModuleID);
  463. }
  464. private void OnSelectAll(object obj)
  465. {
  466. var info = obj as WaferAssociationInfo;
  467. info.SlotFrom = 1;
  468. info.SlotTo = 25;
  469. AssociateSequence(info, true);
  470. }
  471. private void OnUnSelectAll(object obj)
  472. {
  473. var info = obj as WaferAssociationInfo;
  474. info.SlotFrom = 1;
  475. info.SlotTo = 25;
  476. AssociateSequence(info, false);
  477. }
  478. private void OnStart(object obj)
  479. {
  480. var info = obj as WaferAssociationInfo;
  481. InvokeClient.Instance.Service.DoOperation("System.StartJob", info.LotId);
  482. }
  483. private void OnStop(object obj)
  484. {
  485. var info = obj as WaferAssociationInfo;
  486. InvokeClient.Instance.Service.DoOperation("System.PauseJob", info.JobID);
  487. }
  488. private void OnAbort(object obj)
  489. {
  490. var info = obj as WaferAssociationInfo;
  491. InvokeClient.Instance.Service.DoOperation("System.ResumeJob", info.JobID);
  492. }
  493. private void OnHomeAll()
  494. {
  495. InvokeClient.Instance.Service.DoOperation("System.HomeAll");
  496. }
  497. private void OnPauseAllJob()
  498. {
  499. InvokeClient.Instance.Service.DoOperation("System.PauseJob", LP1WaferAssociation.JobID);
  500. InvokeClient.Instance.Service.DoOperation("System.PauseJob", LP2WaferAssociation.JobID);
  501. InvokeClient.Instance.Service.DoOperation("System.PauseJob", LP3WaferAssociation.JobID);
  502. }
  503. private void OnAbortAll()
  504. {
  505. InvokeClient.Instance.Service.DoOperation("System.Abort");
  506. }
  507. private void OnReturnAllWafer()
  508. {
  509. //Dialog
  510. WaferDialogView dialog = new WaferDialogView()
  511. {
  512. Owner = Application.Current.MainWindow,
  513. };
  514. dialog.Height = 300;
  515. dialog.Width = 400;
  516. double angel = 0;
  517. double coolingtime = 0;
  518. string message = "Please Confirm Return Wafer";
  519. WaferDialogViewModel vm = new WaferDialogViewModel();
  520. vm.ConfirmText = message;
  521. dialog.DataContext = vm;
  522. if (dialog.ShowDialog() == true)
  523. {
  524. if ((bool)dialog.AlignFlag == true && !string.IsNullOrEmpty(dialog.Angle))
  525. {
  526. angel = Convert.ToDouble(dialog.Angle);
  527. }
  528. if ((bool)dialog.CoolingFlag == true && !string.IsNullOrEmpty(dialog.CoolingTime))
  529. {
  530. coolingtime = Convert.ToDouble(dialog.CoolingTime);
  531. }
  532. InvokeClient.Instance.Service.DoOperation("System.ReturnAllWafer", dialog.CoolingFlag, coolingtime, dialog.AlignFlag, angel);
  533. }
  534. }
  535. private void OnSetSequence(object obj)
  536. {
  537. var info = obj as WaferInfo;
  538. bool flag = info.SequenceName != "" ? false : true;
  539. if (info.ModuleID == "LP1")
  540. {
  541. AssociateSequence(LP1WaferAssociation, flag, info.SlotID);
  542. }
  543. else if (info.ModuleID == "LP2")
  544. {
  545. AssociateSequence(LP2WaferAssociation, flag, info.SlotID);
  546. }
  547. else if (info.ModuleID == "LP3")
  548. {
  549. AssociateSequence(LP3WaferAssociation, flag, info.SlotID);
  550. }
  551. }
  552. private void OnCreateJob(object obj)
  553. {
  554. var info = obj as WaferAssociationInfo;
  555. List<string> slotSequence = new List<string>();
  556. info.ModuleData.WaferManager.Wafers.ForEach(key => { slotSequence.Insert(0, key.SequenceName); });
  557. string jobId = info.LotId.Trim();
  558. if (string.IsNullOrEmpty(jobId))
  559. jobId = "CJ_Local_" + info.ModuleData.ModuleID;
  560. info.LotId = jobId;
  561. info.JobID = jobId;
  562. info.JobStatus = "WaitingForStart";
  563. info.LotIdSaved = true;
  564. Dictionary<string, object> param = new Dictionary<string, object>()
  565. {
  566. {"JobId", jobId},
  567. {"Module", info.ModuleData.ModuleID},
  568. {"SlotSequence", slotSequence.ToArray()},
  569. {"AutoStart", true},
  570. };
  571. InvokeClient.Instance.Service.DoOperation("System.CreateJob", param);
  572. }
  573. private void OnEnableAuto()
  574. {
  575. InvokeClient.Instance.Service.DoOperation("System.SetAutoMode");
  576. }
  577. private void OnEnableManual()
  578. {
  579. InvokeClient.Instance.Service.DoOperation("System.SetManualMode");
  580. }
  581. #endregion
  582. #region 私有方法
  583. private void Timer_Tick(object sender, EventArgs e)
  584. {
  585. LP1ModuleInfo = ModuleManager.ModuleInfos["LP1"];
  586. LP2ModuleInfo = ModuleManager.ModuleInfos["LP2"];
  587. LP3ModuleInfo = ModuleManager.ModuleInfos["LP3"];
  588. EFEMModuleInfo = ModuleManager.ModuleInfos["EfemRobot"];
  589. TMModuleInfo = ModuleManager.ModuleInfos["TMRobot"];
  590. BladeAWafer = ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[0];
  591. BladeBWafer = ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[1];
  592. RtDataValues = QueryDataClient.Instance.Service.PollData(m_RtDataKeys);
  593. if (LLAIsInstalled == true)
  594. {
  595. LLAModuleInfo = ModuleManager.ModuleInfos["LLA"];
  596. LLAWafer = ModuleManager.ModuleInfos["LLA"].WaferManager.Wafers.FirstOrDefault(x => x.WaferStatus != 0);
  597. }
  598. if (LLBIsInstalled == true)
  599. {
  600. LLBModuleInfo = ModuleManager.ModuleInfos["LLB"];
  601. LLBWafer = ModuleManager.ModuleInfos["LLB"].WaferManager.Wafers.FirstOrDefault(x => x.WaferStatus != 0);
  602. }
  603. if (PMAIsInstalled == true)
  604. {
  605. PMAWafer = ModuleManager.ModuleInfos["PMA"].WaferManager.Wafers[0];
  606. PMARecipeResult = CommonFunction.GetValue<RecipeResult>(RtDataValues, $"PMA.CurrentRecipeResult");
  607. }
  608. if (PMBIsInstalled == true)
  609. {
  610. PMBWafer = ModuleManager.ModuleInfos["PMB"].WaferManager.Wafers[0];
  611. PMBRecipeResult = CommonFunction.GetValue<RecipeResult>(RtDataValues, $"PMB.CurrentRecipeResult");
  612. }
  613. if (PMCIsInstalled == true)
  614. {
  615. PMCWafer = ModuleManager.ModuleInfos["PMC"].WaferManager.Wafers[0];
  616. PMCRecipeResult = CommonFunction.GetValue<RecipeResult>(RtDataValues, $"PMC.CurrentRecipeResult");
  617. }
  618. if (PMDIsInstalled == true)
  619. {
  620. PMDWafer = ModuleManager.ModuleInfos["PMD"].WaferManager.Wafers[0];
  621. PMDRecipeResult = CommonFunction.GetValue<RecipeResult>(RtDataValues, $"PMD.CurrentRecipeResult");
  622. }
  623. if (TMIsInstalled == true)
  624. {
  625. TMBladeAWafer = ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[0];
  626. TMBladeBWafer = ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[1];
  627. TMPressure= CommonFunction.GetValue<float>(RtDataValues, $"TM.TMProcessGauge.Value");
  628. }
  629. if (EFEMIsInstalled == true)
  630. {
  631. EFEMBladeAWafer = ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[0];
  632. EFEMBladeBWafer = ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[1];
  633. Aligner1Wafer = ModuleManager.ModuleInfos["Aligner1"].WaferManager.Wafers[0];
  634. }
  635. RobotMoveInfo = (RobotMoveInfo)QueryDataClient.Instance.Service.GetData("TM.RobotMoveAction");
  636. EfemRobotMoveInfo = (RobotMoveInfo)QueryDataClient.Instance.Service.GetData("EFEM.RobotMoveAction");
  637. LP1WaferCount = LP1ModuleInfo.WaferManager.Wafers.Where(x => x.WaferStatus != 0).Count();
  638. LP2WaferCount = LP2ModuleInfo.WaferManager.Wafers.Where(x => x.WaferStatus != 0).Count();
  639. LP3WaferCount = LP3ModuleInfo.WaferManager.Wafers.Where(x => x.WaferStatus != 0).Count();
  640. }
  641. private async void RobotMoveInfoChanged(RobotMoveInfo oldValue, RobotMoveInfo newValue)
  642. {
  643. string RobotTarget;
  644. if (oldValue == null || newValue == null)
  645. {
  646. return;
  647. }
  648. #region Rotating
  649. if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && (newValue.Action == RobotAction.Rotating))
  650. {
  651. var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
  652. if (TMRobotMoveActionBladeTarget != null)
  653. {
  654. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  655. }
  656. else
  657. {
  658. return;
  659. }
  660. var values = RobotTarget.Split('.');
  661. var arm = values[0];
  662. var module = values[1];
  663. if (arm == "ArmA")
  664. {
  665. Robot1TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  666. }
  667. else if (arm == "ArmB")
  668. {
  669. Robot2TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  670. }
  671. }
  672. #endregion
  673. #region pick 和 place LL
  674. else if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && (newValue.Action == RobotAction.Placing || newValue.Action == RobotAction.Picking))
  675. {
  676. var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
  677. if (TMRobotMoveActionBladeTarget != null)
  678. {
  679. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  680. }
  681. else
  682. {
  683. return;
  684. }
  685. var values = RobotTarget.Split('.');
  686. var arm = values[0];
  687. var module = values[1];
  688. if (arm == "ArmA")
  689. {
  690. var waferRobotTAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  691. if (waferRobotTAction != Robot1TAction)
  692. {
  693. Robot1TAction = waferRobotTAction;
  694. }
  695. else
  696. {
  697. //await Task.Delay(100);
  698. }
  699. await Task.Delay(600);
  700. //Robot1TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  701. //await Task.Delay(600);
  702. Robot1XAction = WaferRobotXAction.Extend;
  703. while ((newValue.Action == RobotAction.Placing && ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[0].WaferStatus != 0) || (newValue.Action == RobotAction.Picking && ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[0].WaferStatus == 0))
  704. {
  705. await Task.Delay(100);
  706. }
  707. Robot1XAction = WaferRobotXAction.Retract;
  708. }
  709. else if (arm == "ArmB")
  710. {
  711. var waferRobotTAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  712. if (waferRobotTAction != Robot2TAction)
  713. {
  714. Robot2TAction = waferRobotTAction;
  715. }
  716. else
  717. {
  718. //await Task.Delay(100);
  719. }
  720. await Task.Delay(600);
  721. //Robot2TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  722. //await Task.Delay(600);
  723. Robot2XAction = WaferRobotXAction.Extend;
  724. while ((newValue.Action == RobotAction.Placing && ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[1].WaferStatus != 0) || (newValue.Action == RobotAction.Picking && ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[1].WaferStatus == 0))
  725. {
  726. await Task.Delay(100);
  727. }
  728. Robot2XAction = WaferRobotXAction.Retract;
  729. }
  730. }
  731. #endregion
  732. #region pick 和 place pm
  733. else if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && newValue.Action == RobotAction.Extending)
  734. {
  735. var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
  736. if (TMRobotMoveActionBladeTarget != null)
  737. {
  738. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  739. }
  740. else
  741. {
  742. return;
  743. }
  744. var values = RobotTarget.Split('.');
  745. var arm = values[0];
  746. var module = values[1];
  747. if (arm == "ArmA")
  748. {
  749. var waferRobotTAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  750. if (waferRobotTAction != Robot1TAction)
  751. {
  752. Robot1TAction = waferRobotTAction;
  753. }
  754. else
  755. {
  756. // await Task.Delay(100);
  757. }
  758. await Task.Delay(600);
  759. Robot1XAction = WaferRobotXAction.Extend;
  760. }
  761. else if (arm == "ArmB")
  762. {
  763. var waferRobotTAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  764. if (waferRobotTAction != Robot2TAction)
  765. {
  766. Robot2TAction = waferRobotTAction;
  767. }
  768. else
  769. {
  770. // await Task.Delay(100);
  771. }
  772. await Task.Delay(600);
  773. Robot2XAction = WaferRobotXAction.Extend;
  774. }
  775. }
  776. else if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && newValue.Action == RobotAction.Retracting)
  777. {
  778. var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
  779. if (TMRobotMoveActionBladeTarget != null)
  780. {
  781. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  782. }
  783. else
  784. {
  785. return;
  786. }
  787. var values = RobotTarget.Split('.');
  788. var arm = values[0];
  789. if (arm == "ArmA")
  790. {
  791. Robot1XAction = WaferRobotXAction.Retract;
  792. }
  793. else if (arm == "ArmB")
  794. {
  795. Robot2XAction = WaferRobotXAction.Retract;
  796. }
  797. }
  798. #endregion
  799. #region Home
  800. else if (oldValue.Action == RobotAction.None && newValue.Action == RobotAction.Homing)
  801. {
  802. if (Robot1XAction == WaferRobotXAction.Extend)
  803. {
  804. Robot1XAction = WaferRobotXAction.Retract;
  805. }
  806. if (Robot2XAction == WaferRobotXAction.Extend)
  807. {
  808. Robot2XAction = WaferRobotXAction.Retract;
  809. }
  810. await Task.Delay(2000);
  811. if (Robot1TAction != WaferRobotTAction.T_Origin)
  812. {
  813. Robot1TAction = WaferRobotTAction.T_Origin;
  814. }
  815. if (Robot2TAction != WaferRobotTAction.T_Origin)
  816. {
  817. Robot2TAction = WaferRobotTAction.T_Origin;
  818. }
  819. }
  820. #endregion
  821. }
  822. private async void EFEMRobotMoveInfoChanged(RobotMoveInfo oldValue, RobotMoveInfo newValue)
  823. {
  824. string RobotTarget;
  825. if (oldValue == null || newValue == null)
  826. {
  827. return;
  828. }
  829. #region pick 和 place LL
  830. if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && (newValue.Action == RobotAction.Placing || newValue.Action == RobotAction.Picking))
  831. {
  832. var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
  833. if (TMRobotMoveActionBladeTarget != null)
  834. {
  835. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  836. }
  837. else
  838. {
  839. return;
  840. }
  841. var values = RobotTarget.Split('.');
  842. var arm = values[0];
  843. var module = values[1];
  844. if (arm == "ArmA")
  845. {
  846. var robot3Robot3TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  847. //await Task.Delay(1000);
  848. await ChangePosition(robot3Robot3TAction);
  849. if (Robot3TAction != robot3Robot3TAction)
  850. {
  851. Robot3TAction = robot3Robot3TAction;
  852. await Task.Delay(600);
  853. }
  854. Robot3XAction = WaferRobotXAction.Extend;
  855. while ((newValue.Action == RobotAction.Placing && ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[0].WaferStatus != 0) || (newValue.Action == RobotAction.Picking && ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[0].WaferStatus == 0))
  856. {
  857. await Task.Delay(100);
  858. }
  859. Robot3XAction = WaferRobotXAction.Retract;
  860. }
  861. else if (arm == "ArmB")
  862. {
  863. var robot4Robot4TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  864. //await Task.Delay(1000);
  865. await ChangePosition(robot4Robot4TAction);
  866. if (Robot4TAction != robot4Robot4TAction)
  867. {
  868. Robot4TAction = robot4Robot4TAction;
  869. await Task.Delay(600);
  870. }
  871. //ChangePosition(Robot4TAction);
  872. //await Task.Delay(2000);
  873. Robot4XAction = WaferRobotXAction.Extend;
  874. while ((newValue.Action == RobotAction.Placing && ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[1].WaferStatus != 0) || (newValue.Action == RobotAction.Picking && ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[1].WaferStatus == 0))
  875. {
  876. await Task.Delay(100);
  877. }
  878. Robot4XAction = WaferRobotXAction.Retract;
  879. }
  880. }
  881. #endregion
  882. #region pick 和 place pm
  883. if (oldValue.Action == RobotAction.None && newValue.Action == RobotAction.Extending)
  884. {
  885. var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
  886. if (TMRobotMoveActionBladeTarget != null)
  887. {
  888. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  889. }
  890. else
  891. {
  892. return;
  893. }
  894. var values = RobotTarget.Split('.');
  895. var arm = values[0];
  896. var module = values[1];
  897. if (arm == "ArmA")
  898. {
  899. Robot3TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  900. await Task.Delay(1500);
  901. //ChangePosition(Robot3TAction);
  902. //await Task.Delay(2000);
  903. Robot3XAction = WaferRobotXAction.Extend;
  904. }
  905. else if (arm == "ArmB")
  906. {
  907. Robot4TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  908. await Task.Delay(1500);
  909. //ChangePosition(Robot4TAction);
  910. //await Task.Delay(2000);
  911. Robot4XAction = WaferRobotXAction.Extend;
  912. }
  913. }
  914. if (oldValue.Action == RobotAction.None && newValue.Action == RobotAction.Retracting)
  915. {
  916. var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
  917. if (TMRobotMoveActionBladeTarget != null)
  918. {
  919. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  920. }
  921. else
  922. {
  923. return;
  924. }
  925. var values = RobotTarget.Split('.');
  926. var arm = values[0];
  927. if (arm == "ArmA")
  928. {
  929. Robot3XAction = WaferRobotXAction.Retract;
  930. await Task.Delay(3000);
  931. //ChangePosition(Robot3TAction);
  932. //await Task.Delay(2000);
  933. }
  934. else if (arm == "ArmB")
  935. {
  936. Robot4XAction = WaferRobotXAction.Retract;
  937. await Task.Delay(3000);
  938. //ChangePosition(Robot3TAction);
  939. //await Task.Delay(2000);
  940. }
  941. }
  942. #endregion
  943. #region Home
  944. else if (oldValue.Action == RobotAction.None && newValue.Action == RobotAction.Homing)
  945. {
  946. if (Robot3XAction == WaferRobotXAction.Extend)
  947. {
  948. Robot3XAction = WaferRobotXAction.Retract;
  949. }
  950. if (Robot4XAction == WaferRobotXAction.Extend)
  951. {
  952. Robot4XAction = WaferRobotXAction.Retract;
  953. }
  954. await Task.Delay(2000);
  955. if (Robot3TAction != WaferRobotTAction.T_Origin)
  956. {
  957. Robot3TAction = WaferRobotTAction.T_Origin;
  958. }
  959. if (Robot4TAction != WaferRobotTAction.T_Origin)
  960. {
  961. Robot4TAction = WaferRobotTAction.T_Origin;
  962. }
  963. }
  964. #endregion
  965. }
  966. private void addDataKeys()
  967. {
  968. if (PMAIsInstalled == true)
  969. {
  970. m_RtDataKeys.Add("PMA.IsSlitDoorClosed");
  971. m_RtDataKeys.Add("PMA.CurrentRecipeResult");
  972. m_RtDataKeys.Add("PMA.IsOnline");
  973. m_RtDataKeys.Add("PMA.CalculationPressure");
  974. }
  975. if (PMBIsInstalled == true)
  976. {
  977. m_RtDataKeys.Add("PMB.IsSlitDoorClosed");
  978. m_RtDataKeys.Add("PMB.CurrentRecipeResult");
  979. m_RtDataKeys.Add("PMB.IsOnline");
  980. m_RtDataKeys.Add("PMB.CalculationPressure");
  981. }
  982. if (PMCIsInstalled == true)
  983. {
  984. m_RtDataKeys.Add("PMC.IsSlitDoorClosed");
  985. m_RtDataKeys.Add("PMC.CurrentRecipeResult");
  986. m_RtDataKeys.Add("PMC.IsOnline");
  987. m_RtDataKeys.Add("PMC.CalculationPressure");
  988. }
  989. if (PMDIsInstalled == true)
  990. {
  991. m_RtDataKeys.Add("PMD.IsSlitDoorClosed");
  992. m_RtDataKeys.Add("PMD.CurrentRecipeResult");
  993. m_RtDataKeys.Add("PMD.IsOnline");
  994. m_RtDataKeys.Add("PMD.CalculationPressure");
  995. }
  996. if (TMIsInstalled == true)
  997. {
  998. m_RtDataKeys.Add("TM.LLATSlitDoor.IsClosed");
  999. m_RtDataKeys.Add("TM.LLBTSlitDoor.IsClosed");
  1000. m_RtDataKeys.Add("TM.LLAESlitDoor.IsClosed");
  1001. m_RtDataKeys.Add("TM.LLBESlitDoor.IsClosed");
  1002. m_RtDataKeys.Add("TM.IsOnline");
  1003. m_RtDataKeys.Add("TM.TMProcessGauge.Value");
  1004. m_RtDataKeys.Add("TM.TMATMSwitch.Value");
  1005. m_RtDataKeys.Add("TM.TMVacSwitch.Value");
  1006. m_RtDataKeys.Add("TM.TMProcessGauge.Value");
  1007. m_RtDataKeys.Add("TM.TMLidClosed");
  1008. m_RtDataKeys.Add("TM.LLALidClosed");
  1009. m_RtDataKeys.Add("TM.LLBLidClosed");
  1010. }
  1011. if (LLAIsInstalled == true)
  1012. {
  1013. m_RtDataKeys.Add("LLA.IsOnline");
  1014. m_RtDataKeys.Add($"TM.LLAPressureGauge.Value");
  1015. m_RtDataKeys.Add($"TM.LLAVacSwitch.Value");
  1016. m_RtDataKeys.Add($"TM.LLAATMSwitch.Value");
  1017. }
  1018. if (LLBIsInstalled == true)
  1019. {
  1020. m_RtDataKeys.Add("LLB.IsOnline");
  1021. m_RtDataKeys.Add($"TM.LLBPressureGauge.Value");
  1022. m_RtDataKeys.Add($"TM.LLBVacSwitch.Value");
  1023. m_RtDataKeys.Add($"TM.LLBATMSwitch.Value");
  1024. }
  1025. if (EFEMIsInstalled == true)
  1026. {
  1027. m_RtDataKeys.Add("LP1.IsLoaded");
  1028. m_RtDataKeys.Add("LP2.IsLoaded");
  1029. m_RtDataKeys.Add("LP3.IsLoaded");
  1030. m_RtDataKeys.Add("LP1.CassettePlaced");
  1031. m_RtDataKeys.Add("LP2.CassettePlaced");
  1032. m_RtDataKeys.Add("LP3.CassettePlaced");
  1033. m_RtDataKeys.Add("EFEM.IsOnline");
  1034. }
  1035. m_RtDataKeys.Add("System.IsAutoMode");
  1036. m_RtDataKeys.Add("Scheduler.CycledCount");
  1037. m_RtDataKeys.Add("Scheduler.CycledWafer");
  1038. m_RtDataKeys.Add("Scheduler.CycleSetPoint");
  1039. m_RtDataKeys.Add("Scheduler.Throughput");
  1040. }
  1041. private void AssociateSequence(WaferAssociationInfo info, bool flag, int slot = -1)
  1042. {
  1043. List<WaferInfo> wafers = info.ModuleData.WaferManager.Wafers;
  1044. if (slot >= 0) //by wafer
  1045. {
  1046. int index = wafers.Count - slot - 1;
  1047. if (index < wafers.Count)
  1048. {
  1049. if (flag && HasWaferOnSlot(wafers, index))
  1050. wafers[index].SequenceName = info.SequenceName;
  1051. else
  1052. wafers[index].SequenceName = string.Empty;
  1053. }
  1054. }
  1055. else //by from-to
  1056. {
  1057. for (int i = info.SlotFrom - 1; i < info.SlotTo; i++)
  1058. {
  1059. int index = wafers.Count - i - 1;
  1060. if (index < wafers.Count)
  1061. {
  1062. if (flag && HasWaferOnSlot(wafers, index))
  1063. wafers[index].SequenceName = info.SequenceName;
  1064. else
  1065. wafers[index].SequenceName = string.Empty;
  1066. }
  1067. }
  1068. }
  1069. switch (info.ModuleData.ModuleID)
  1070. {
  1071. case "LP1":
  1072. LP1WaferAssociation = info;
  1073. break;
  1074. case "LP2":
  1075. LP2WaferAssociation = info;
  1076. break;
  1077. case "LP3":
  1078. LP3WaferAssociation = info;
  1079. break;
  1080. }
  1081. }
  1082. private bool HasWaferOnSlot(List<WaferInfo> wafers, int index)
  1083. {
  1084. if (wafers[index].WaferStatus == 0)
  1085. return false;
  1086. return true;
  1087. }
  1088. private async Task ChangePosition(WaferRobotTAction waferRobotTAction)
  1089. {
  1090. await Task.Delay(500);
  1091. int delay = 500;
  1092. if (waferRobotTAction == WaferRobotTAction.LP1)
  1093. {
  1094. CurrentRobotPosition = RobotPosition.Left;
  1095. await Task.Delay(delay);
  1096. }
  1097. else if (waferRobotTAction == WaferRobotTAction.LP3)
  1098. {
  1099. CurrentRobotPosition = RobotPosition.Right;
  1100. await Task.Delay(delay);
  1101. }
  1102. else if (waferRobotTAction == WaferRobotTAction.LP2)
  1103. {
  1104. CurrentRobotPosition = RobotPosition.Middle;
  1105. await Task.Delay(delay);
  1106. }
  1107. else
  1108. {
  1109. CurrentRobotPosition = RobotPosition.Origin;
  1110. await Task.Delay(delay);
  1111. }
  1112. }
  1113. #endregion
  1114. }
  1115. }