OperationOverViewModel.cs 47 KB

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