OperationOverViewModel.cs 49 KB

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