OperationOverViewModel.cs 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258
  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 OnResumeAllJob()
  504. {
  505. var t = CommonFunction.GetValue<List<string>>(RtDataValues, "Scheduler.PjNameList");
  506. if (t == null && t.Count == 0)
  507. {
  508. return;
  509. }
  510. if (CommonFunction.GetValue<int>(RtDataValues, "EquipmentStatus") == 4)
  511. {
  512. t.ForEach(x =>
  513. {
  514. InvokeClient.Instance.Service.DoOperation("System.ResumeJob", x);
  515. });
  516. }
  517. else
  518. {
  519. t.ForEach(x =>
  520. {
  521. InvokeClient.Instance.Service.DoOperation("System.PauseJob", x);
  522. });
  523. }
  524. }
  525. private void OnAbortAll()
  526. {
  527. InvokeClient.Instance.Service.DoOperation("System.Abort");
  528. }
  529. private void OnReturnAllWafer()
  530. {
  531. //Dialog
  532. WaferDialogView dialog = new WaferDialogView()
  533. {
  534. Owner = Application.Current.MainWindow,
  535. };
  536. dialog.Height = 300;
  537. dialog.Width = 400;
  538. double angel = 0;
  539. double coolingtime = 0;
  540. string message = "Please Confirm Return Wafer";
  541. WaferDialogViewModel vm = new WaferDialogViewModel();
  542. vm.ConfirmText = message;
  543. dialog.DataContext = vm;
  544. if (dialog.ShowDialog() == true)
  545. {
  546. if ((bool)dialog.AlignFlag == true && !string.IsNullOrEmpty(dialog.Angle))
  547. {
  548. angel = Convert.ToDouble(dialog.Angle);
  549. }
  550. if ((bool)dialog.CoolingFlag == true && !string.IsNullOrEmpty(dialog.CoolingTime))
  551. {
  552. coolingtime = Convert.ToDouble(dialog.CoolingTime);
  553. }
  554. InvokeClient.Instance.Service.DoOperation("System.ReturnAllWafer", dialog.CoolingFlag, coolingtime, dialog.AlignFlag, angel);
  555. }
  556. }
  557. private void OnSetSequence(object obj)
  558. {
  559. var info = obj as WaferInfo;
  560. bool flag = info.SequenceName != "" ? false : true;
  561. if (info.ModuleID == "LP1")
  562. {
  563. AssociateSequence(LP1WaferAssociation, flag, info.SlotID);
  564. }
  565. else if (info.ModuleID == "LP2")
  566. {
  567. AssociateSequence(LP2WaferAssociation, flag, info.SlotID);
  568. }
  569. else if (info.ModuleID == "LP3")
  570. {
  571. AssociateSequence(LP3WaferAssociation, flag, info.SlotID);
  572. }
  573. }
  574. private void OnCreateJob(object obj)
  575. {
  576. var info = obj as WaferAssociationInfo;
  577. List<string> slotSequence = new List<string>();
  578. info.ModuleData.WaferManager.Wafers.ForEach(key => { slotSequence.Insert(0, key.SequenceName); });
  579. string jobId = info.LotId.Trim();
  580. if (string.IsNullOrEmpty(jobId))
  581. jobId = "CJ_Local_" + info.ModuleData.ModuleID;
  582. info.LotId = jobId;
  583. info.JobID = jobId;
  584. info.JobStatus = "WaitingForStart";
  585. info.LotIdSaved = true;
  586. Dictionary<string, object> param = new Dictionary<string, object>()
  587. {
  588. {"JobId", jobId},
  589. {"Module", info.ModuleData.ModuleID},
  590. {"SlotSequence", slotSequence.ToArray()},
  591. {"AutoStart", true},
  592. { "PreCleanRecipeName",info.PreCleanRecipeName},
  593. { "PostCleanRecipeName",info.PostCleanRecipeName}
  594. };
  595. InvokeClient.Instance.Service.DoOperation("System.CreateJob", param);
  596. }
  597. private void OnEnableAuto()
  598. {
  599. InvokeClient.Instance.Service.DoOperation("System.SetAutoMode");
  600. }
  601. private void OnEnableManual()
  602. {
  603. InvokeClient.Instance.Service.DoOperation("System.SetManualMode");
  604. }
  605. #endregion
  606. #region 私有方法
  607. private void Timer_Tick(object sender, EventArgs e)
  608. {
  609. LP1ModuleInfo = ModuleManager.ModuleInfos["LP1"];
  610. LP2ModuleInfo = ModuleManager.ModuleInfos["LP2"];
  611. LP3ModuleInfo = ModuleManager.ModuleInfos["LP3"];
  612. EFEMModuleInfo = ModuleManager.ModuleInfos["EfemRobot"];
  613. TMModuleInfo = ModuleManager.ModuleInfos["TMRobot"];
  614. BladeAWafer = ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[0];
  615. BladeBWafer = ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[1];
  616. RtDataValues = QueryDataClient.Instance.Service.PollData(m_RtDataKeys);
  617. if (LLAIsInstalled == true)
  618. {
  619. LLAModuleInfo = ModuleManager.ModuleInfos["LLA"];
  620. LLAWafer = ModuleManager.ModuleInfos["LLA"].WaferManager.Wafers.FirstOrDefault(x => x.WaferStatus != 0);
  621. }
  622. if (LLBIsInstalled == true)
  623. {
  624. LLBModuleInfo = ModuleManager.ModuleInfos["LLB"];
  625. LLBWafer = ModuleManager.ModuleInfos["LLB"].WaferManager.Wafers.FirstOrDefault(x => x.WaferStatus != 0);
  626. }
  627. if (PMAIsInstalled == true)
  628. {
  629. PMAWafer = ModuleManager.ModuleInfos["PMA"].WaferManager.Wafers[0];
  630. PMARecipeResult = CommonFunction.GetValue<RecipeResult>(RtDataValues, $"PMA.CurrentRecipeResult");
  631. }
  632. if (PMBIsInstalled == true)
  633. {
  634. PMBWafer = ModuleManager.ModuleInfos["PMB"].WaferManager.Wafers[0];
  635. PMBRecipeResult = CommonFunction.GetValue<RecipeResult>(RtDataValues, $"PMB.CurrentRecipeResult");
  636. }
  637. if (PMCIsInstalled == true)
  638. {
  639. PMCWafer = ModuleManager.ModuleInfos["PMC"].WaferManager.Wafers[0];
  640. PMCRecipeResult = CommonFunction.GetValue<RecipeResult>(RtDataValues, $"PMC.CurrentRecipeResult");
  641. }
  642. if (PMDIsInstalled == true)
  643. {
  644. PMDWafer = ModuleManager.ModuleInfos["PMD"].WaferManager.Wafers[0];
  645. PMDRecipeResult = CommonFunction.GetValue<RecipeResult>(RtDataValues, $"PMD.CurrentRecipeResult");
  646. }
  647. if (TMIsInstalled == true)
  648. {
  649. TMBladeAWafer = ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[0];
  650. TMBladeBWafer = ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[1];
  651. TMPressure= CommonFunction.GetValue<float>(RtDataValues, $"TM.TMProcessGauge.Value");
  652. }
  653. if (EFEMIsInstalled == true)
  654. {
  655. EFEMBladeAWafer = ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[0];
  656. EFEMBladeBWafer = ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[1];
  657. Aligner1Wafer = ModuleManager.ModuleInfos["Aligner1"].WaferManager.Wafers[0];
  658. }
  659. RobotMoveInfo = (RobotMoveInfo)QueryDataClient.Instance.Service.GetData("TM.RobotMoveAction");
  660. EfemRobotMoveInfo = (RobotMoveInfo)QueryDataClient.Instance.Service.GetData("EFEM.RobotMoveAction");
  661. LP1WaferCount = LP1ModuleInfo.WaferManager.Wafers.Where(x => x.WaferStatus != 0).Count();
  662. LP2WaferCount = LP2ModuleInfo.WaferManager.Wafers.Where(x => x.WaferStatus != 0).Count();
  663. LP3WaferCount = LP3ModuleInfo.WaferManager.Wafers.Where(x => x.WaferStatus != 0).Count();
  664. if (CommonFunction.GetValue<int>(RtDataValues, "EquipmentStatus") == 4)
  665. {
  666. RouteState = "Resume";
  667. }
  668. else
  669. {
  670. RouteState = "Pause";
  671. }
  672. }
  673. private async void RobotMoveInfoChanged(RobotMoveInfo oldValue, RobotMoveInfo newValue)
  674. {
  675. string RobotTarget;
  676. if (oldValue == null || newValue == null)
  677. {
  678. return;
  679. }
  680. #region Rotating
  681. if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && (newValue.Action == RobotAction.Rotating))
  682. {
  683. var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
  684. if (TMRobotMoveActionBladeTarget != null)
  685. {
  686. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  687. }
  688. else
  689. {
  690. return;
  691. }
  692. var values = RobotTarget.Split('.');
  693. var arm = values[0];
  694. var module = values[1];
  695. if (arm == "ArmA")
  696. {
  697. Robot1TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  698. }
  699. else if (arm == "ArmB")
  700. {
  701. Robot2TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  702. }
  703. }
  704. #endregion
  705. #region pick 和 place LL
  706. else if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && (newValue.Action == RobotAction.Placing || newValue.Action == RobotAction.Picking))
  707. {
  708. var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
  709. if (TMRobotMoveActionBladeTarget != null)
  710. {
  711. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  712. }
  713. else
  714. {
  715. return;
  716. }
  717. var values = RobotTarget.Split('.');
  718. var arm = values[0];
  719. var module = values[1];
  720. if (arm == "ArmA")
  721. {
  722. var waferRobotTAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  723. if (waferRobotTAction != Robot1TAction)
  724. {
  725. Robot1TAction = waferRobotTAction;
  726. }
  727. else
  728. {
  729. //await Task.Delay(100);
  730. }
  731. await Task.Delay(600);
  732. //Robot1TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  733. //await Task.Delay(600);
  734. Robot1XAction = WaferRobotXAction.Extend;
  735. 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))
  736. {
  737. await Task.Delay(100);
  738. }
  739. Robot1XAction = WaferRobotXAction.Retract;
  740. }
  741. else if (arm == "ArmB")
  742. {
  743. var waferRobotTAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  744. if (waferRobotTAction != Robot2TAction)
  745. {
  746. Robot2TAction = waferRobotTAction;
  747. }
  748. else
  749. {
  750. //await Task.Delay(100);
  751. }
  752. await Task.Delay(600);
  753. //Robot2TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  754. //await Task.Delay(600);
  755. Robot2XAction = WaferRobotXAction.Extend;
  756. 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))
  757. {
  758. await Task.Delay(100);
  759. }
  760. Robot2XAction = WaferRobotXAction.Retract;
  761. }
  762. }
  763. #endregion
  764. #region pick 和 place pm
  765. else if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && newValue.Action == RobotAction.Extending)
  766. {
  767. var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
  768. if (TMRobotMoveActionBladeTarget != null)
  769. {
  770. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  771. }
  772. else
  773. {
  774. return;
  775. }
  776. var values = RobotTarget.Split('.');
  777. var arm = values[0];
  778. var module = values[1];
  779. if (arm == "ArmA")
  780. {
  781. var waferRobotTAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  782. if (waferRobotTAction != Robot1TAction)
  783. {
  784. Robot1TAction = waferRobotTAction;
  785. }
  786. else
  787. {
  788. // await Task.Delay(100);
  789. }
  790. await Task.Delay(600);
  791. Robot1XAction = WaferRobotXAction.Extend;
  792. }
  793. else if (arm == "ArmB")
  794. {
  795. var waferRobotTAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  796. if (waferRobotTAction != Robot2TAction)
  797. {
  798. Robot2TAction = waferRobotTAction;
  799. }
  800. else
  801. {
  802. // await Task.Delay(100);
  803. }
  804. await Task.Delay(600);
  805. Robot2XAction = WaferRobotXAction.Extend;
  806. }
  807. }
  808. else if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && newValue.Action == RobotAction.Retracting)
  809. {
  810. var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
  811. if (TMRobotMoveActionBladeTarget != null)
  812. {
  813. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  814. }
  815. else
  816. {
  817. return;
  818. }
  819. var values = RobotTarget.Split('.');
  820. var arm = values[0];
  821. if (arm == "ArmA")
  822. {
  823. Robot1XAction = WaferRobotXAction.Retract;
  824. }
  825. else if (arm == "ArmB")
  826. {
  827. Robot2XAction = WaferRobotXAction.Retract;
  828. }
  829. }
  830. #endregion
  831. #region Home
  832. else if (oldValue.Action == RobotAction.None && newValue.Action == RobotAction.Homing)
  833. {
  834. if (Robot1XAction == WaferRobotXAction.Extend)
  835. {
  836. Robot1XAction = WaferRobotXAction.Retract;
  837. }
  838. if (Robot2XAction == WaferRobotXAction.Extend)
  839. {
  840. Robot2XAction = WaferRobotXAction.Retract;
  841. }
  842. await Task.Delay(2000);
  843. if (Robot1TAction != WaferRobotTAction.T_Origin)
  844. {
  845. Robot1TAction = WaferRobotTAction.T_Origin;
  846. }
  847. if (Robot2TAction != WaferRobotTAction.T_Origin)
  848. {
  849. Robot2TAction = WaferRobotTAction.T_Origin;
  850. }
  851. }
  852. #endregion
  853. }
  854. private async void EFEMRobotMoveInfoChanged(RobotMoveInfo oldValue, RobotMoveInfo newValue)
  855. {
  856. string RobotTarget;
  857. if (oldValue == null || newValue == null)
  858. {
  859. return;
  860. }
  861. #region pick 和 place LL
  862. if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && (newValue.Action == RobotAction.Placing || newValue.Action == RobotAction.Picking))
  863. {
  864. var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
  865. if (TMRobotMoveActionBladeTarget != null)
  866. {
  867. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  868. }
  869. else
  870. {
  871. return;
  872. }
  873. var values = RobotTarget.Split('.');
  874. var arm = values[0];
  875. var module = values[1];
  876. if (arm == "ArmA")
  877. {
  878. var robot3Robot3TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  879. //await Task.Delay(1000);
  880. await ChangePosition(robot3Robot3TAction);
  881. if (Robot3TAction != robot3Robot3TAction)
  882. {
  883. Robot3TAction = robot3Robot3TAction;
  884. await Task.Delay(600);
  885. }
  886. Robot3XAction = WaferRobotXAction.Extend;
  887. 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))
  888. {
  889. await Task.Delay(100);
  890. }
  891. Robot3XAction = WaferRobotXAction.Retract;
  892. }
  893. else if (arm == "ArmB")
  894. {
  895. var robot4Robot4TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  896. //await Task.Delay(1000);
  897. await ChangePosition(robot4Robot4TAction);
  898. if (Robot4TAction != robot4Robot4TAction)
  899. {
  900. Robot4TAction = robot4Robot4TAction;
  901. await Task.Delay(600);
  902. }
  903. //ChangePosition(Robot4TAction);
  904. //await Task.Delay(2000);
  905. Robot4XAction = WaferRobotXAction.Extend;
  906. 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))
  907. {
  908. await Task.Delay(100);
  909. }
  910. Robot4XAction = WaferRobotXAction.Retract;
  911. }
  912. }
  913. #endregion
  914. #region pick 和 place pm
  915. if (oldValue.Action == RobotAction.None && newValue.Action == RobotAction.Extending)
  916. {
  917. var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
  918. if (TMRobotMoveActionBladeTarget != null)
  919. {
  920. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  921. }
  922. else
  923. {
  924. return;
  925. }
  926. var values = RobotTarget.Split('.');
  927. var arm = values[0];
  928. var module = values[1];
  929. if (arm == "ArmA")
  930. {
  931. Robot3TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  932. await Task.Delay(1500);
  933. //ChangePosition(Robot3TAction);
  934. //await Task.Delay(2000);
  935. Robot3XAction = WaferRobotXAction.Extend;
  936. }
  937. else if (arm == "ArmB")
  938. {
  939. Robot4TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  940. await Task.Delay(1500);
  941. //ChangePosition(Robot4TAction);
  942. //await Task.Delay(2000);
  943. Robot4XAction = WaferRobotXAction.Extend;
  944. }
  945. }
  946. if (oldValue.Action == RobotAction.None && newValue.Action == RobotAction.Retracting)
  947. {
  948. var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
  949. if (TMRobotMoveActionBladeTarget != null)
  950. {
  951. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  952. }
  953. else
  954. {
  955. return;
  956. }
  957. var values = RobotTarget.Split('.');
  958. var arm = values[0];
  959. if (arm == "ArmA")
  960. {
  961. Robot3XAction = WaferRobotXAction.Retract;
  962. await Task.Delay(3000);
  963. //ChangePosition(Robot3TAction);
  964. //await Task.Delay(2000);
  965. }
  966. else if (arm == "ArmB")
  967. {
  968. Robot4XAction = WaferRobotXAction.Retract;
  969. await Task.Delay(3000);
  970. //ChangePosition(Robot3TAction);
  971. //await Task.Delay(2000);
  972. }
  973. }
  974. #endregion
  975. #region Home
  976. else if (oldValue.Action == RobotAction.None && newValue.Action == RobotAction.Homing)
  977. {
  978. if (Robot3XAction == WaferRobotXAction.Extend)
  979. {
  980. Robot3XAction = WaferRobotXAction.Retract;
  981. }
  982. if (Robot4XAction == WaferRobotXAction.Extend)
  983. {
  984. Robot4XAction = WaferRobotXAction.Retract;
  985. }
  986. if (Robot3TAction != WaferRobotTAction.T_Origin)
  987. {
  988. Robot3TAction = WaferRobotTAction.T_Origin;
  989. }
  990. if (Robot4TAction != WaferRobotTAction.T_Origin)
  991. {
  992. Robot4TAction = WaferRobotTAction.T_Origin;
  993. }
  994. await Task.Delay(1000);
  995. await ChangePosition(WaferRobotTAction.T_Origin);
  996. }
  997. #endregion
  998. }
  999. private void addDataKeys()
  1000. {
  1001. if (PMAIsInstalled == true)
  1002. {
  1003. m_RtDataKeys.Add("PMA.IsSlitDoorClosed");
  1004. m_RtDataKeys.Add("PMA.CurrentRecipeResult");
  1005. m_RtDataKeys.Add("PMA.IsOnline");
  1006. m_RtDataKeys.Add("PMA.CalculationPressure");
  1007. }
  1008. if (PMBIsInstalled == true)
  1009. {
  1010. m_RtDataKeys.Add("PMB.IsSlitDoorClosed");
  1011. m_RtDataKeys.Add("PMB.CurrentRecipeResult");
  1012. m_RtDataKeys.Add("PMB.IsOnline");
  1013. m_RtDataKeys.Add("PMB.CalculationPressure");
  1014. }
  1015. if (PMCIsInstalled == true)
  1016. {
  1017. m_RtDataKeys.Add("PMC.IsSlitDoorClosed");
  1018. m_RtDataKeys.Add("PMC.CurrentRecipeResult");
  1019. m_RtDataKeys.Add("PMC.IsOnline");
  1020. m_RtDataKeys.Add("PMC.CalculationPressure");
  1021. }
  1022. if (PMDIsInstalled == true)
  1023. {
  1024. m_RtDataKeys.Add("PMD.IsSlitDoorClosed");
  1025. m_RtDataKeys.Add("PMD.CurrentRecipeResult");
  1026. m_RtDataKeys.Add("PMD.IsOnline");
  1027. m_RtDataKeys.Add("PMD.CalculationPressure");
  1028. }
  1029. if (TMIsInstalled == true)
  1030. {
  1031. m_RtDataKeys.Add("TM.LLATSlitDoor.IsClosed");
  1032. m_RtDataKeys.Add("TM.LLBTSlitDoor.IsClosed");
  1033. m_RtDataKeys.Add("TM.LLAESlitDoor.IsClosed");
  1034. m_RtDataKeys.Add("TM.LLBESlitDoor.IsClosed");
  1035. m_RtDataKeys.Add("TM.IsOnline");
  1036. m_RtDataKeys.Add("TM.TMProcessGauge.Value");
  1037. m_RtDataKeys.Add("TM.TMATMSwitch.Value");
  1038. m_RtDataKeys.Add("TM.TMVacSwitch.Value");
  1039. m_RtDataKeys.Add("TM.TMProcessGauge.Value");
  1040. m_RtDataKeys.Add("TM.TMLidClosed");
  1041. m_RtDataKeys.Add("TM.LLALidClosed");
  1042. m_RtDataKeys.Add("TM.LLBLidClosed");
  1043. }
  1044. if (LLAIsInstalled == true)
  1045. {
  1046. m_RtDataKeys.Add("LLA.IsOnline");
  1047. m_RtDataKeys.Add($"TM.LLAPressureGauge.Value");
  1048. m_RtDataKeys.Add($"TM.LLAVacSwitch.Value");
  1049. m_RtDataKeys.Add($"TM.LLAATMSwitch.Value");
  1050. }
  1051. if (LLBIsInstalled == true)
  1052. {
  1053. m_RtDataKeys.Add("LLB.IsOnline");
  1054. m_RtDataKeys.Add($"TM.LLBPressureGauge.Value");
  1055. m_RtDataKeys.Add($"TM.LLBVacSwitch.Value");
  1056. m_RtDataKeys.Add($"TM.LLBATMSwitch.Value");
  1057. }
  1058. if (EFEMIsInstalled == true)
  1059. {
  1060. m_RtDataKeys.Add("LP1.IsLoaded");
  1061. m_RtDataKeys.Add("LP2.IsLoaded");
  1062. m_RtDataKeys.Add("LP3.IsLoaded");
  1063. m_RtDataKeys.Add("LP1.CassettePlaced");
  1064. m_RtDataKeys.Add("LP2.CassettePlaced");
  1065. m_RtDataKeys.Add("LP3.CassettePlaced");
  1066. m_RtDataKeys.Add("EFEM.IsOnline");
  1067. }
  1068. m_RtDataKeys.Add("System.IsAutoMode");
  1069. m_RtDataKeys.Add("System.IsBusy");
  1070. m_RtDataKeys.Add("Scheduler.CycledCount");
  1071. m_RtDataKeys.Add("Scheduler.CycledWafer");
  1072. m_RtDataKeys.Add("Scheduler.CycleSetPoint");
  1073. m_RtDataKeys.Add("Scheduler.Throughput");
  1074. m_RtDataKeys.Add("EquipmentStatus");
  1075. m_RtDataKeys.Add("Scheduler.PjNameList");
  1076. }
  1077. private void AssociateSequence(WaferAssociationInfo info, bool flag, int slot = -1)
  1078. {
  1079. List<WaferInfo> wafers = info.ModuleData.WaferManager.Wafers;
  1080. if (slot >= 0) //by wafer
  1081. {
  1082. int index = wafers.Count - slot - 1;
  1083. if (index < wafers.Count)
  1084. {
  1085. if (flag && HasWaferOnSlot(wafers, index))
  1086. wafers[index].SequenceName = info.SequenceName;
  1087. else
  1088. wafers[index].SequenceName = string.Empty;
  1089. }
  1090. }
  1091. else //by from-to
  1092. {
  1093. for (int i = info.SlotFrom - 1; i < info.SlotTo; i++)
  1094. {
  1095. int index = wafers.Count - i - 1;
  1096. if (index < wafers.Count)
  1097. {
  1098. if (flag && HasWaferOnSlot(wafers, index))
  1099. wafers[index].SequenceName = info.SequenceName;
  1100. else
  1101. wafers[index].SequenceName = string.Empty;
  1102. }
  1103. }
  1104. }
  1105. switch (info.ModuleData.ModuleID)
  1106. {
  1107. case "LP1":
  1108. LP1WaferAssociation = info;
  1109. break;
  1110. case "LP2":
  1111. LP2WaferAssociation = info;
  1112. break;
  1113. case "LP3":
  1114. LP3WaferAssociation = info;
  1115. break;
  1116. }
  1117. }
  1118. private bool HasWaferOnSlot(List<WaferInfo> wafers, int index)
  1119. {
  1120. if (wafers[index].WaferStatus == 0)
  1121. return false;
  1122. return true;
  1123. }
  1124. private async Task ChangePosition(WaferRobotTAction waferRobotTAction)
  1125. {
  1126. await Task.Delay(500);
  1127. int delay = 500;
  1128. if (waferRobotTAction == WaferRobotTAction.LP1)
  1129. {
  1130. CurrentRobotPosition = RobotPosition.Left;
  1131. await Task.Delay(delay);
  1132. }
  1133. else if (waferRobotTAction == WaferRobotTAction.LP3)
  1134. {
  1135. CurrentRobotPosition = RobotPosition.Right;
  1136. await Task.Delay(delay);
  1137. }
  1138. else if (waferRobotTAction == WaferRobotTAction.LP2)
  1139. {
  1140. CurrentRobotPosition = RobotPosition.Middle;
  1141. await Task.Delay(delay);
  1142. }
  1143. else
  1144. {
  1145. CurrentRobotPosition = RobotPosition.Origin;
  1146. await Task.Delay(delay);
  1147. }
  1148. }
  1149. #endregion
  1150. }
  1151. }