OperationOverViewModel.cs 48 KB

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