OperationOverViewModel.cs 48 KB

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