OperationOverViewModel.cs 47 KB

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