OperationOverViewModel.cs 47 KB

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