OperationOverViewModel.cs 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293
  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("开启UI界面");
  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. LOG.Info("System,Start Job");
  501. }
  502. private void OnStop(object obj)
  503. {
  504. var info = obj as WaferAssociationInfo;
  505. InvokeClient.Instance.Service.DoOperation("System.PauseJob", info.JobID);
  506. LOG.Info("System,Pause Job");
  507. }
  508. private void OnAbort(object obj)
  509. {
  510. var info = obj as WaferAssociationInfo;
  511. InvokeClient.Instance.Service.DoOperation("System.ResumeJob", info.JobID);
  512. LOG.Info("System,Resume Job");
  513. }
  514. private void OnHomeAll()
  515. {
  516. InvokeClient.Instance.Service.DoOperation("System.HomeAll");
  517. LOG.Info("System,Home All");
  518. }
  519. private void OnResumeAllJob()
  520. {
  521. var t = CommonFunction.GetValue<List<string>>(RtDataValues, "Scheduler.PjNameList");
  522. if (t == null && t.Count == 0)
  523. {
  524. return;
  525. }
  526. if (CommonFunction.GetValue<int>(RtDataValues, "EquipmentStatus") == 4)
  527. {
  528. t.ForEach(x =>
  529. {
  530. InvokeClient.Instance.Service.DoOperation("System.ResumeJob", x);
  531. });
  532. }
  533. else
  534. {
  535. t.ForEach(x =>
  536. {
  537. InvokeClient.Instance.Service.DoOperation("System.PauseJob", x);
  538. });
  539. }
  540. LOG.Info("System,Resume All Job");
  541. }
  542. private void OnAbortAll()
  543. {
  544. InvokeClient.Instance.Service.DoOperation("System.Abort");
  545. LOG.Info("System, Abort");
  546. }
  547. private void OnReturnAllWafer()
  548. {
  549. //Dialog
  550. WaferDialogView dialog = new WaferDialogView()
  551. {
  552. Owner = Application.Current.MainWindow,
  553. };
  554. dialog.Height = 300;
  555. dialog.Width = 400;
  556. double angel = 0;
  557. double coolingtime = 0;
  558. string message = "Please Confirm Return Wafer";
  559. WaferDialogViewModel vm = new WaferDialogViewModel();
  560. vm.ConfirmText = message;
  561. dialog.DataContext = vm;
  562. if (dialog.ShowDialog() == true)
  563. {
  564. if ((bool)dialog.AlignFlag == true && !string.IsNullOrEmpty(dialog.Angle))
  565. {
  566. angel = Convert.ToDouble(dialog.Angle);
  567. }
  568. if ((bool)dialog.CoolingFlag == true && !string.IsNullOrEmpty(dialog.CoolingTime))
  569. {
  570. coolingtime = Convert.ToDouble(dialog.CoolingTime);
  571. }
  572. InvokeClient.Instance.Service.DoOperation("System.ReturnAllWafer", dialog.CoolingFlag, coolingtime, dialog.AlignFlag, angel);
  573. }
  574. LOG.Info("System,Return All Wafer");
  575. }
  576. private void OnSetSequence(object obj)
  577. {
  578. var info = obj as WaferInfo;
  579. bool flag = info.SequenceName != "" ? false : true;
  580. if (info.ModuleID == "LP1")
  581. {
  582. AssociateSequence(LP1WaferAssociation, flag, info.SlotID);
  583. }
  584. else if (info.ModuleID == "LP2")
  585. {
  586. AssociateSequence(LP2WaferAssociation, flag, info.SlotID);
  587. }
  588. else if (info.ModuleID == "LP3")
  589. {
  590. AssociateSequence(LP3WaferAssociation, flag, info.SlotID);
  591. }
  592. }
  593. private void OnCreateJob(object obj)
  594. {
  595. var info = obj as WaferAssociationInfo;
  596. List<string> slotSequence = new List<string>();
  597. info.ModuleData.WaferManager.Wafers.ForEach(key => { slotSequence.Insert(0, key.SequenceName); });
  598. string jobId = info.LotId.Trim();
  599. if (string.IsNullOrEmpty(jobId))
  600. jobId = "CJ_Local_" + info.ModuleData.ModuleID;
  601. info.LotId = jobId;
  602. info.JobID = jobId;
  603. info.JobStatus = "WaitingForStart";
  604. info.LotIdSaved = true;
  605. Dictionary<string, object> param = new Dictionary<string, object>()
  606. {
  607. {"JobId", jobId},
  608. {"Module", info.ModuleData.ModuleID},
  609. {"SlotSequence", slotSequence.ToArray()},
  610. {"AutoStart", true},
  611. { "PreCleanRecipeName",info.PreCleanRecipeName},
  612. { "PostCleanRecipeName",info.PostCleanRecipeName}
  613. };
  614. InvokeClient.Instance.Service.DoOperation("System.CreateJob", param);
  615. }
  616. private void OnAbortJob(object obj)
  617. {
  618. InvokeClient.Instance.Service.DoOperation("System.AbortJob", obj.ToString());
  619. }
  620. private void OnEnableAuto()
  621. {
  622. InvokeClient.Instance.Service.DoOperation("System.SetAutoMode");
  623. }
  624. private void OnEnableManual()
  625. {
  626. InvokeClient.Instance.Service.DoOperation("System.SetManualMode");
  627. }
  628. #endregion
  629. #region 私有方法
  630. private void Timer_Tick(object sender, EventArgs e)
  631. {
  632. LP1ModuleInfo = ModuleManager.ModuleInfos["LP1"];
  633. LP2ModuleInfo = ModuleManager.ModuleInfos["LP2"];
  634. LP3ModuleInfo = ModuleManager.ModuleInfos["LP3"];
  635. EFEMModuleInfo = ModuleManager.ModuleInfos["EfemRobot"];
  636. TMModuleInfo = ModuleManager.ModuleInfos["TMRobot"];
  637. BladeAWafer = ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[0];
  638. BladeBWafer = ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[1];
  639. RtDataValues = QueryDataClient.Instance.Service.PollData(m_RtDataKeys);
  640. if (LLAIsInstalled == true)
  641. {
  642. LLAModuleInfo = ModuleManager.ModuleInfos["LLA"];
  643. LLAWafer = ModuleManager.ModuleInfos["LLA"].WaferManager.Wafers.FirstOrDefault(x => x.WaferStatus != 0);
  644. }
  645. if (LLBIsInstalled == true)
  646. {
  647. LLBModuleInfo = ModuleManager.ModuleInfos["LLB"];
  648. LLBWafer = ModuleManager.ModuleInfos["LLB"].WaferManager.Wafers.FirstOrDefault(x => x.WaferStatus != 0);
  649. }
  650. if (PMAIsInstalled == true)
  651. {
  652. PMAWafer = ModuleManager.ModuleInfos["PMA"].WaferManager.Wafers[0];
  653. PMARecipeResult = CommonFunction.GetValue<RecipeResult>(RtDataValues, $"PMA.CurrentRecipeResult");
  654. }
  655. if (PMBIsInstalled == true)
  656. {
  657. PMBWafer = ModuleManager.ModuleInfos["PMB"].WaferManager.Wafers[0];
  658. PMBRecipeResult = CommonFunction.GetValue<RecipeResult>(RtDataValues, $"PMB.CurrentRecipeResult");
  659. }
  660. if (PMCIsInstalled == true)
  661. {
  662. PMCWafer = ModuleManager.ModuleInfos["PMC"].WaferManager.Wafers[0];
  663. PMCRecipeResult = CommonFunction.GetValue<RecipeResult>(RtDataValues, $"PMC.CurrentRecipeResult");
  664. }
  665. if (PMDIsInstalled == true)
  666. {
  667. PMDWafer = ModuleManager.ModuleInfos["PMD"].WaferManager.Wafers[0];
  668. PMDRecipeResult = CommonFunction.GetValue<RecipeResult>(RtDataValues, $"PMD.CurrentRecipeResult");
  669. }
  670. if (TMIsInstalled == true)
  671. {
  672. TMBladeAWafer = ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[0];
  673. TMBladeBWafer = ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[1];
  674. TMPressure= CommonFunction.GetValue<float>(RtDataValues, $"TM.TMProcessGauge.Value");
  675. }
  676. if (EFEMIsInstalled == true)
  677. {
  678. EFEMBladeAWafer = ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[0];
  679. EFEMBladeBWafer = ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[1];
  680. Aligner1Wafer = ModuleManager.ModuleInfos["Aligner1"].WaferManager.Wafers[0];
  681. }
  682. RobotMoveInfo = (RobotMoveInfo)QueryDataClient.Instance.Service.GetData("TM.RobotMoveAction");
  683. EfemRobotMoveInfo = (RobotMoveInfo)QueryDataClient.Instance.Service.GetData("EFEM.RobotMoveAction");
  684. LP1WaferCount = LP1ModuleInfo.WaferManager.Wafers.Where(x => x.WaferStatus != 0).Count();
  685. LP2WaferCount = LP2ModuleInfo.WaferManager.Wafers.Where(x => x.WaferStatus != 0).Count();
  686. LP3WaferCount = LP3ModuleInfo.WaferManager.Wafers.Where(x => x.WaferStatus != 0).Count();
  687. if (CommonFunction.GetValue<int>(RtDataValues, "EquipmentStatus") == 4)
  688. {
  689. RouteState = "Resume";
  690. }
  691. else
  692. {
  693. RouteState = "Pause";
  694. }
  695. }
  696. private async void RobotMoveInfoChanged(RobotMoveInfo oldValue, RobotMoveInfo newValue)
  697. {
  698. string RobotTarget;
  699. if (oldValue == null || newValue == null)
  700. {
  701. return;
  702. }
  703. #region Rotating
  704. if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && (newValue.Action == RobotAction.Rotating))
  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. Robot1TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  721. }
  722. else if (arm == "ArmB")
  723. {
  724. Robot2TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  725. }
  726. }
  727. #endregion
  728. #region pick 和 place LL
  729. else if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && (newValue.Action == RobotAction.Placing || newValue.Action == RobotAction.Picking))
  730. {
  731. var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
  732. if (TMRobotMoveActionBladeTarget != null)
  733. {
  734. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  735. }
  736. else
  737. {
  738. return;
  739. }
  740. var values = RobotTarget.Split('.');
  741. var arm = values[0];
  742. var module = values[1];
  743. if (arm == "ArmA")
  744. {
  745. var waferRobotTAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  746. if (waferRobotTAction != Robot1TAction)
  747. {
  748. Robot1TAction = waferRobotTAction;
  749. }
  750. else
  751. {
  752. //await Task.Delay(100);
  753. }
  754. await Task.Delay(600);
  755. //Robot1TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  756. //await Task.Delay(600);
  757. Robot1XAction = WaferRobotXAction.Extend;
  758. 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))
  759. {
  760. await Task.Delay(100);
  761. }
  762. Robot1XAction = WaferRobotXAction.Retract;
  763. }
  764. else if (arm == "ArmB")
  765. {
  766. var waferRobotTAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  767. if (waferRobotTAction != Robot2TAction)
  768. {
  769. Robot2TAction = waferRobotTAction;
  770. }
  771. else
  772. {
  773. //await Task.Delay(100);
  774. }
  775. await Task.Delay(600);
  776. //Robot2TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  777. //await Task.Delay(600);
  778. Robot2XAction = WaferRobotXAction.Extend;
  779. 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))
  780. {
  781. await Task.Delay(100);
  782. }
  783. Robot2XAction = WaferRobotXAction.Retract;
  784. }
  785. }
  786. #endregion
  787. #region pick 和 place pm
  788. else if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && newValue.Action == RobotAction.Extending)
  789. {
  790. var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
  791. if (TMRobotMoveActionBladeTarget != null)
  792. {
  793. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  794. }
  795. else
  796. {
  797. return;
  798. }
  799. var values = RobotTarget.Split('.');
  800. var arm = values[0];
  801. var module = values[1];
  802. if (arm == "ArmA")
  803. {
  804. var waferRobotTAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  805. if (waferRobotTAction != Robot1TAction)
  806. {
  807. Robot1TAction = waferRobotTAction;
  808. }
  809. else
  810. {
  811. // await Task.Delay(100);
  812. }
  813. await Task.Delay(600);
  814. Robot1XAction = WaferRobotXAction.Extend;
  815. }
  816. else if (arm == "ArmB")
  817. {
  818. var waferRobotTAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  819. if (waferRobotTAction != Robot2TAction)
  820. {
  821. Robot2TAction = waferRobotTAction;
  822. }
  823. else
  824. {
  825. // await Task.Delay(100);
  826. }
  827. await Task.Delay(600);
  828. Robot2XAction = WaferRobotXAction.Extend;
  829. }
  830. }
  831. else if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && newValue.Action == RobotAction.Retracting)
  832. {
  833. var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
  834. if (TMRobotMoveActionBladeTarget != null)
  835. {
  836. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  837. }
  838. else
  839. {
  840. return;
  841. }
  842. var values = RobotTarget.Split('.');
  843. var arm = values[0];
  844. if (arm == "ArmA")
  845. {
  846. Robot1XAction = WaferRobotXAction.Retract;
  847. }
  848. else if (arm == "ArmB")
  849. {
  850. Robot2XAction = WaferRobotXAction.Retract;
  851. }
  852. }
  853. #endregion
  854. #region Home
  855. else if (oldValue.Action == RobotAction.None && newValue.Action == RobotAction.Homing)
  856. {
  857. if (Robot1XAction == WaferRobotXAction.Extend)
  858. {
  859. Robot1XAction = WaferRobotXAction.Retract;
  860. }
  861. if (Robot2XAction == WaferRobotXAction.Extend)
  862. {
  863. Robot2XAction = WaferRobotXAction.Retract;
  864. }
  865. await Task.Delay(2000);
  866. if (Robot1TAction != WaferRobotTAction.T_Origin)
  867. {
  868. Robot1TAction = WaferRobotTAction.T_Origin;
  869. }
  870. if (Robot2TAction != WaferRobotTAction.T_Origin)
  871. {
  872. Robot2TAction = WaferRobotTAction.T_Origin;
  873. }
  874. }
  875. #endregion
  876. }
  877. private async void EFEMRobotMoveInfoChanged(RobotMoveInfo oldValue, RobotMoveInfo newValue)
  878. {
  879. string RobotTarget;
  880. if (oldValue == null || newValue == null)
  881. {
  882. return;
  883. }
  884. #region pick 和 place LL
  885. if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && (newValue.Action == RobotAction.Placing || newValue.Action == RobotAction.Picking))
  886. {
  887. var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
  888. if (TMRobotMoveActionBladeTarget != null)
  889. {
  890. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  891. }
  892. else
  893. {
  894. return;
  895. }
  896. var values = RobotTarget.Split('.');
  897. var arm = values[0];
  898. var module = values[1];
  899. if (arm == "ArmA")
  900. {
  901. var robot3Robot3TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  902. //await Task.Delay(1000);
  903. await ChangePosition(robot3Robot3TAction);
  904. if (Robot3TAction != robot3Robot3TAction)
  905. {
  906. Robot3TAction = robot3Robot3TAction;
  907. await Task.Delay(600);
  908. }
  909. Robot3XAction = WaferRobotXAction.Extend;
  910. 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))
  911. {
  912. await Task.Delay(100);
  913. }
  914. Robot3XAction = WaferRobotXAction.Retract;
  915. }
  916. else if (arm == "ArmB")
  917. {
  918. var robot4Robot4TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  919. //await Task.Delay(1000);
  920. await ChangePosition(robot4Robot4TAction);
  921. if (Robot4TAction != robot4Robot4TAction)
  922. {
  923. Robot4TAction = robot4Robot4TAction;
  924. await Task.Delay(600);
  925. }
  926. //ChangePosition(Robot4TAction);
  927. //await Task.Delay(2000);
  928. Robot4XAction = WaferRobotXAction.Extend;
  929. 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))
  930. {
  931. await Task.Delay(100);
  932. }
  933. Robot4XAction = WaferRobotXAction.Retract;
  934. }
  935. }
  936. #endregion
  937. #region pick 和 place pm
  938. if (oldValue.Action == RobotAction.None && newValue.Action == RobotAction.Extending)
  939. {
  940. var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
  941. if (TMRobotMoveActionBladeTarget != null)
  942. {
  943. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  944. }
  945. else
  946. {
  947. return;
  948. }
  949. var values = RobotTarget.Split('.');
  950. var arm = values[0];
  951. var module = values[1];
  952. if (arm == "ArmA")
  953. {
  954. Robot3TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  955. await Task.Delay(1500);
  956. //ChangePosition(Robot3TAction);
  957. //await Task.Delay(2000);
  958. Robot3XAction = WaferRobotXAction.Extend;
  959. }
  960. else if (arm == "ArmB")
  961. {
  962. Robot4TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  963. await Task.Delay(1500);
  964. //ChangePosition(Robot4TAction);
  965. //await Task.Delay(2000);
  966. Robot4XAction = WaferRobotXAction.Extend;
  967. }
  968. }
  969. if (oldValue.Action == RobotAction.None && newValue.Action == RobotAction.Retracting)
  970. {
  971. var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
  972. if (TMRobotMoveActionBladeTarget != null)
  973. {
  974. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  975. }
  976. else
  977. {
  978. return;
  979. }
  980. var values = RobotTarget.Split('.');
  981. var arm = values[0];
  982. if (arm == "ArmA")
  983. {
  984. Robot3XAction = WaferRobotXAction.Retract;
  985. await Task.Delay(3000);
  986. //ChangePosition(Robot3TAction);
  987. //await Task.Delay(2000);
  988. }
  989. else if (arm == "ArmB")
  990. {
  991. Robot4XAction = WaferRobotXAction.Retract;
  992. await Task.Delay(3000);
  993. //ChangePosition(Robot3TAction);
  994. //await Task.Delay(2000);
  995. }
  996. }
  997. #endregion
  998. #region Home
  999. else if (oldValue.Action == RobotAction.None && newValue.Action == RobotAction.Homing)
  1000. {
  1001. if (Robot3XAction == WaferRobotXAction.Extend)
  1002. {
  1003. Robot3XAction = WaferRobotXAction.Retract;
  1004. }
  1005. if (Robot4XAction == WaferRobotXAction.Extend)
  1006. {
  1007. Robot4XAction = WaferRobotXAction.Retract;
  1008. }
  1009. if (Robot3TAction != WaferRobotTAction.T_Origin)
  1010. {
  1011. Robot3TAction = WaferRobotTAction.T_Origin;
  1012. }
  1013. if (Robot4TAction != WaferRobotTAction.T_Origin)
  1014. {
  1015. Robot4TAction = WaferRobotTAction.T_Origin;
  1016. }
  1017. await Task.Delay(1000);
  1018. await ChangePosition(WaferRobotTAction.T_Origin);
  1019. }
  1020. #endregion
  1021. }
  1022. private void addDataKeys()
  1023. {
  1024. if (PMAIsInstalled == true)
  1025. {
  1026. m_RtDataKeys.Add("PMA.IsSlitDoorClosed");
  1027. m_RtDataKeys.Add("PMA.CurrentRecipeResult");
  1028. m_RtDataKeys.Add("PMA.IsOnline");
  1029. m_RtDataKeys.Add("PMA.CalculationPressure");
  1030. }
  1031. if (PMBIsInstalled == true)
  1032. {
  1033. m_RtDataKeys.Add("PMB.IsSlitDoorClosed");
  1034. m_RtDataKeys.Add("PMB.CurrentRecipeResult");
  1035. m_RtDataKeys.Add("PMB.IsOnline");
  1036. m_RtDataKeys.Add("PMB.CalculationPressure");
  1037. }
  1038. if (PMCIsInstalled == true)
  1039. {
  1040. m_RtDataKeys.Add("PMC.IsSlitDoorClosed");
  1041. m_RtDataKeys.Add("PMC.CurrentRecipeResult");
  1042. m_RtDataKeys.Add("PMC.IsOnline");
  1043. m_RtDataKeys.Add("PMC.CalculationPressure");
  1044. }
  1045. if (PMDIsInstalled == true)
  1046. {
  1047. m_RtDataKeys.Add("PMD.IsSlitDoorClosed");
  1048. m_RtDataKeys.Add("PMD.CurrentRecipeResult");
  1049. m_RtDataKeys.Add("PMD.IsOnline");
  1050. m_RtDataKeys.Add("PMD.CalculationPressure");
  1051. }
  1052. if (TMIsInstalled == true)
  1053. {
  1054. m_RtDataKeys.Add("TM.LLATSlitDoor.IsClosed");
  1055. m_RtDataKeys.Add("TM.LLBTSlitDoor.IsClosed");
  1056. m_RtDataKeys.Add("TM.LLAESlitDoor.IsClosed");
  1057. m_RtDataKeys.Add("TM.LLBESlitDoor.IsClosed");
  1058. m_RtDataKeys.Add("TM.IsOnline");
  1059. m_RtDataKeys.Add("TM.TMProcessGauge.Value");
  1060. m_RtDataKeys.Add("TM.TMATMSwitch.Value");
  1061. m_RtDataKeys.Add("TM.TMVacSwitch.Value");
  1062. m_RtDataKeys.Add("TM.TMProcessGauge.Value");
  1063. m_RtDataKeys.Add("TM.TMLidClosed");
  1064. m_RtDataKeys.Add("TM.LLALidClosed");
  1065. m_RtDataKeys.Add("TM.LLBLidClosed");
  1066. m_RtDataKeys.Add("TM.PMASlitDoor.IsClosed");
  1067. m_RtDataKeys.Add("TM.PMBSlitDoor.IsClosed");
  1068. m_RtDataKeys.Add("TM.PMCSlitDoor.IsClosed");
  1069. m_RtDataKeys.Add("TM.PMDSlitDoor.IsClosed");
  1070. }
  1071. if (LLAIsInstalled == true)
  1072. {
  1073. m_RtDataKeys.Add("LLA.IsOnline");
  1074. m_RtDataKeys.Add($"TM.LLAPressureGauge.Value");
  1075. m_RtDataKeys.Add($"TM.LLAVacSwitch.Value");
  1076. m_RtDataKeys.Add($"TM.LLAATMSwitch.Value");
  1077. }
  1078. if (LLBIsInstalled == true)
  1079. {
  1080. m_RtDataKeys.Add("LLB.IsOnline");
  1081. m_RtDataKeys.Add($"TM.LLBPressureGauge.Value");
  1082. m_RtDataKeys.Add($"TM.LLBVacSwitch.Value");
  1083. m_RtDataKeys.Add($"TM.LLBATMSwitch.Value");
  1084. }
  1085. if (EFEMIsInstalled == true)
  1086. {
  1087. m_RtDataKeys.Add("LP1.IsLoaded");
  1088. m_RtDataKeys.Add("LP2.IsLoaded");
  1089. m_RtDataKeys.Add("LP3.IsLoaded");
  1090. m_RtDataKeys.Add("LP1.CassettePlaced");
  1091. m_RtDataKeys.Add("LP2.CassettePlaced");
  1092. m_RtDataKeys.Add("LP3.CassettePlaced");
  1093. m_RtDataKeys.Add("EFEM.IsOnline");
  1094. }
  1095. m_RtDataKeys.Add("System.IsAutoMode");
  1096. m_RtDataKeys.Add("System.IsBusy");
  1097. m_RtDataKeys.Add("Scheduler.CycledCount");
  1098. m_RtDataKeys.Add("Scheduler.CycledWafer");
  1099. m_RtDataKeys.Add("Scheduler.CycleSetPoint");
  1100. m_RtDataKeys.Add("Scheduler.Throughput");
  1101. m_RtDataKeys.Add("EquipmentStatus");
  1102. m_RtDataKeys.Add("Scheduler.PjNameList");
  1103. }
  1104. private void AssociateSequence(WaferAssociationInfo info, bool flag, int slot = -1)
  1105. {
  1106. List<WaferInfo> wafers = info.ModuleData.WaferManager.Wafers;
  1107. if (slot >= 0) //by wafer
  1108. {
  1109. int index = wafers.Count - slot - 1;
  1110. if (index < wafers.Count)
  1111. {
  1112. if (flag && HasWaferOnSlot(wafers, index))
  1113. wafers[index].SequenceName = info.SequenceName;
  1114. else
  1115. wafers[index].SequenceName = string.Empty;
  1116. }
  1117. }
  1118. else //by from-to
  1119. {
  1120. for (int i = info.SlotFrom - 1; i < info.SlotTo; i++)
  1121. {
  1122. int index = wafers.Count - i - 1;
  1123. if (index < wafers.Count)
  1124. {
  1125. if (flag && HasWaferOnSlot(wafers, index))
  1126. wafers[index].SequenceName = info.SequenceName;
  1127. else
  1128. wafers[index].SequenceName = string.Empty;
  1129. }
  1130. }
  1131. }
  1132. switch (info.ModuleData.ModuleID)
  1133. {
  1134. case "LP1":
  1135. LP1WaferAssociation = info;
  1136. break;
  1137. case "LP2":
  1138. LP2WaferAssociation = info;
  1139. break;
  1140. case "LP3":
  1141. LP3WaferAssociation = info;
  1142. break;
  1143. }
  1144. }
  1145. private bool HasWaferOnSlot(List<WaferInfo> wafers, int index)
  1146. {
  1147. if (wafers[index].WaferStatus == 0)
  1148. return false;
  1149. return true;
  1150. }
  1151. private async Task ChangePosition(WaferRobotTAction waferRobotTAction)
  1152. {
  1153. await Task.Delay(500);
  1154. int delay = 500;
  1155. if (waferRobotTAction == WaferRobotTAction.LP1)
  1156. {
  1157. CurrentRobotPosition = RobotPosition.Left;
  1158. await Task.Delay(delay);
  1159. }
  1160. else if (waferRobotTAction == WaferRobotTAction.LP3)
  1161. {
  1162. CurrentRobotPosition = RobotPosition.Right;
  1163. await Task.Delay(delay);
  1164. }
  1165. else if (waferRobotTAction == WaferRobotTAction.LP2)
  1166. {
  1167. CurrentRobotPosition = RobotPosition.Middle;
  1168. await Task.Delay(delay);
  1169. }
  1170. else
  1171. {
  1172. CurrentRobotPosition = RobotPosition.Origin;
  1173. await Task.Delay(delay);
  1174. }
  1175. }
  1176. #endregion
  1177. }
  1178. }