OperationOverViewModel.cs 47 KB

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