VenusDeOperationOverViewModel.cs 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377
  1. using MECF.Framework.Common.CommonData;
  2. using MECF.Framework.Common.DataCenter;
  3. using MECF.Framework.Common.Equipment;
  4. using MECF.Framework.Common.OperationCenter;
  5. using OpenSEMI.ClientBase;
  6. using Prism.Commands;
  7. using Prism.Mvvm;
  8. using System;
  9. using System.Collections.Generic;
  10. using System.Linq;
  11. using System.Text;
  12. using System.Threading.Tasks;
  13. using Venus_Core;
  14. using Venus_Themes.CustomControls;
  15. using System.Windows.Threading;
  16. using Venus_MainPages.Unity;
  17. using Microsoft.VisualBasic;
  18. using ExcelLibrary.BinaryFileFormat;
  19. using MECF.Framework.Common.Schedulers;
  20. using Venus_MainPages.Views;
  21. using System.Windows;
  22. using System.Security.RightsManagement;
  23. using System.Collections.ObjectModel;
  24. using Aitex.Core.Util;
  25. using static Venus_MainPages.ViewModels.VenusDETMViewModel;
  26. using static Venus_Themes.CustomControls.DERobot;
  27. using MECF.Framework.Common.Jobs;
  28. using Aitex.Core.RT.Log;
  29. using Venus_Themes.UserControls;
  30. namespace Venus_MainPages.ViewModels
  31. {
  32. public class VenusDeOperationOverViewModel : BindableBase
  33. {
  34. #region 私有字段
  35. private ModuleInfo m_VCEAModuleInfo;
  36. private ModuleInfo m_VCEBModuleInfo;
  37. private ModuleInfo m_PMAModuleInfo;
  38. private ModuleInfo m_PMBModuleInfo;
  39. private ModuleInfo m_PMCModuleInfo;
  40. private ModuleInfo m_PMDModuleInfo;
  41. private ModuleInfo m_AlignerModuleInfo;
  42. private ModuleInfo m_TMModuleInfo;
  43. public WaferInfo m_PMAWafer;
  44. public WaferInfo m_PMBWafer;
  45. public WaferInfo m_PMCWafer;
  46. public WaferInfo m_PMDWafer;
  47. public WaferInfo m_RobotUpperWafer;
  48. public WaferInfo m_RobotLowerWafer;
  49. public WaferInfo m_PAWafer;
  50. private DERobotTAction m_Robot1TAction;
  51. private DERobotXAction m_Robot1XAction;
  52. private DERobotTAction m_Robot2TAction;
  53. private DERobotXAction m_Robot2XAction;
  54. public RobotMoveInfo m_robotMoveInfo;
  55. private int m_VCEAWaferCount;
  56. private int m_VCEBWaferCount;
  57. private bool m_PMAIsInstalled;
  58. private bool m_PMBIsInstalled;
  59. private bool m_PMCIsInstalled;
  60. private bool m_PMDIsInstalled;
  61. private bool m_VCEAIsInstalled;
  62. private bool m_VCEBIsInstalled;
  63. private bool m_ButtonIsEnableVCEA;
  64. private bool m_ButtonIsEnableVCEB;
  65. private bool m_VCEADoorIsOpen;
  66. private bool m_VCEBDoorIsOpen;
  67. private bool m_PMADoorIsOpen;
  68. private bool m_PMBDoorIsOpen;
  69. private bool m_PMCDoorIsOpen;
  70. private bool m_PMDDoorIsOpen;
  71. private bool m_VCEAOutDoorIsOpen;
  72. private bool m_VCEBOutDoorIsOpen;
  73. private bool m_IsAlignerOnRight;
  74. private Dictionary<string, object> m_RtDataValues = new Dictionary<string, object>();
  75. private List<string> m_RtDataKeys = new List<string>();
  76. private double m_PMAPercent;
  77. private double m_PMBPercent;
  78. private double m_PMCPercent;
  79. private double m_PMDPercent;
  80. private double m_VCEAPercent;
  81. private double m_VCEBPercent;
  82. private int m_PickNum;
  83. private RecipeResult m_PMARecipeResult;
  84. private RecipeResult m_PMBRecipeResult;
  85. private RecipeResult m_PMCRecipeResult;
  86. private RecipeResult m_PMDRecipeResult;
  87. private WaferAssociationInfo m_VCEAwaferAssociation;
  88. private WaferAssociationInfo m_VCEBwaferAssociation;
  89. private bool loadflag;
  90. private bool m_NeedAutoUnLoad;
  91. private bool m_IsCycleInfoVisibility;
  92. private bool m_TMIsVAC;
  93. private bool m_VCEAIsVAC;
  94. private bool m_VCEBIsVAC;
  95. private string m_PMAChamberLabel;
  96. private string m_PMBChamberLabel;
  97. private string m_PMCChamberLabel;
  98. private string m_PMDChamberLabel;
  99. private int m_CurrentSlotA;
  100. private int m_CurrentSlotB;
  101. private ObservableCollection<int> m_VCEASlots = new ObservableCollection<int>();
  102. private ObservableCollection<int> m_VCEBSlots = new ObservableCollection<int>();
  103. #endregion
  104. #region 属性
  105. public bool IsAligner1OnRight
  106. {
  107. get => m_IsAlignerOnRight;
  108. set => SetProperty(ref m_IsAlignerOnRight, value);
  109. }
  110. public int CurrentSlotA
  111. {
  112. get { return m_CurrentSlotA; }
  113. set { SetProperty(ref m_CurrentSlotA, value); }
  114. }
  115. public int CurrentSlotB
  116. {
  117. get { return m_CurrentSlotB; }
  118. set { SetProperty(ref m_CurrentSlotB, value); }
  119. }
  120. public ObservableCollection<int> VCEASlots
  121. {
  122. get { return m_VCEASlots; }
  123. set { SetProperty(ref m_VCEASlots, value); }
  124. }
  125. public ObservableCollection<int> VCEBSlots
  126. {
  127. get { return m_VCEBSlots; }
  128. set { SetProperty(ref m_VCEBSlots, value); }
  129. }
  130. public bool NeedAutoUnLoad
  131. {
  132. get { return m_NeedAutoUnLoad; }
  133. set { SetProperty(ref m_NeedAutoUnLoad, value); }
  134. }
  135. public bool IsCycleInfoVisibility
  136. {
  137. get { return m_IsCycleInfoVisibility; }
  138. set { SetProperty(ref m_IsCycleInfoVisibility, value); }
  139. }
  140. public bool TMIsVAC
  141. {
  142. get { return m_TMIsVAC; }
  143. set { SetProperty(ref m_TMIsVAC, value); }
  144. }
  145. public bool VCEAIsVAC
  146. {
  147. get { return m_VCEAIsVAC; }
  148. set { SetProperty(ref m_VCEAIsVAC, value); }
  149. }
  150. public bool VCEBIsVAC
  151. {
  152. get { return m_VCEBIsVAC; }
  153. set { SetProperty(ref m_VCEBIsVAC, value); }
  154. }
  155. public string PMAChamberLabel
  156. {
  157. get { return m_PMAChamberLabel; }
  158. set { SetProperty(ref m_PMAChamberLabel, value); }
  159. }
  160. public string PMBChamberLabel
  161. {
  162. get { return m_PMBChamberLabel; }
  163. set { SetProperty(ref m_PMBChamberLabel, value); }
  164. }
  165. public string PMCChamberLabel
  166. {
  167. get { return m_PMCChamberLabel; }
  168. set { SetProperty(ref m_PMCChamberLabel, value); }
  169. }
  170. public string PMDChamberLabel
  171. {
  172. get { return m_PMDChamberLabel; }
  173. set { SetProperty(ref m_PMDChamberLabel, value); }
  174. }
  175. public DERobotTAction Robot1TAction
  176. {
  177. get { return m_Robot1TAction; }
  178. set { SetProperty(ref m_Robot1TAction, value); }
  179. }
  180. private DelegateCommand<object> _AbortJobCommand;
  181. public DelegateCommand<object> AbortJobCommand =>
  182. _AbortJobCommand ?? (_AbortJobCommand = new DelegateCommand<object>(OnAbortJob));
  183. public DERobotXAction Robot1XAction
  184. {
  185. get { return m_Robot1XAction; }
  186. set { SetProperty(ref m_Robot1XAction, value); }
  187. }
  188. public DERobotTAction Robot2TAction
  189. {
  190. get { return m_Robot2TAction; }
  191. set { SetProperty(ref m_Robot2TAction, value); }
  192. }
  193. public DERobotXAction Robot2XAction
  194. {
  195. get { return m_Robot2XAction; }
  196. set { SetProperty(ref m_Robot2XAction, value); }
  197. }
  198. public RobotMoveInfo RobotMoveInfo
  199. {
  200. get { return m_robotMoveInfo; }
  201. set
  202. {
  203. RobotMoveInfoChanged(m_robotMoveInfo, value);
  204. SetProperty(ref m_robotMoveInfo, value);
  205. }
  206. }
  207. public RecipeResult PMARecipeResult
  208. {
  209. get { return m_PMARecipeResult; }
  210. set { SetProperty(ref m_PMARecipeResult, value); }
  211. }
  212. public RecipeResult PMBRecipeResult
  213. {
  214. get { return m_PMBRecipeResult; }
  215. set { SetProperty(ref m_PMBRecipeResult, value); }
  216. }
  217. public RecipeResult PMCRecipeResult
  218. {
  219. get { return m_PMCRecipeResult; }
  220. set { SetProperty(ref m_PMCRecipeResult, value); }
  221. }
  222. public RecipeResult PMDRecipeResult
  223. {
  224. get { return m_PMDRecipeResult; }
  225. set { SetProperty(ref m_PMDRecipeResult, value); }
  226. }
  227. public double PMAPercent
  228. {
  229. get { return m_PMAPercent; }
  230. set { SetProperty(ref m_PMAPercent, value); }
  231. }
  232. public double PMBPercent
  233. {
  234. get { return m_PMBPercent; }
  235. set { SetProperty(ref m_PMBPercent, value); }
  236. }
  237. public double PMCPercent
  238. {
  239. get { return m_PMCPercent; }
  240. set { SetProperty(ref m_PMCPercent, value); }
  241. }
  242. public double PMDPercent
  243. {
  244. get { return m_PMDPercent; }
  245. set { SetProperty(ref m_PMDPercent, value); }
  246. }
  247. public double VCEAPercent
  248. {
  249. get { return m_VCEAPercent; }
  250. set { SetProperty(ref m_VCEAPercent, value); }
  251. }
  252. public double VCEBPercent
  253. {
  254. get { return m_VCEBPercent; }
  255. set { SetProperty(ref m_VCEBPercent, value); }
  256. }
  257. public int PickNum
  258. {
  259. get { return m_PickNum; }
  260. set { SetProperty(ref m_PickNum, value); }
  261. }
  262. public WaferInfo PMAWafer
  263. {
  264. get { return m_PMAWafer; }
  265. set { SetProperty(ref m_PMAWafer, value); }
  266. }
  267. public WaferInfo PMBWafer
  268. {
  269. get { return m_PMBWafer; }
  270. set { SetProperty(ref m_PMBWafer, value); }
  271. }
  272. public WaferInfo PMCWafer
  273. {
  274. get { return m_PMCWafer; }
  275. set { SetProperty(ref m_PMCWafer, value); }
  276. }
  277. public WaferInfo PMDWafer
  278. {
  279. get { return m_PMDWafer; }
  280. set { SetProperty(ref m_PMDWafer, value); }
  281. }
  282. public WaferInfo RobotUpperWafer
  283. {
  284. get { return m_RobotUpperWafer; }
  285. set { SetProperty(ref m_RobotUpperWafer, value); }
  286. }
  287. public WaferInfo RobotLowerWafer
  288. {
  289. get { return m_RobotLowerWafer; }
  290. set { SetProperty(ref m_RobotLowerWafer, value); }
  291. }
  292. public WaferInfo PAWafer
  293. {
  294. get { return m_PAWafer; }
  295. set { SetProperty(ref m_PAWafer, value); }
  296. }
  297. public ModuleInfo VCEAModuleInfo
  298. {
  299. get { return m_VCEAModuleInfo; }
  300. set
  301. {
  302. SetProperty(ref m_VCEAModuleInfo, value);
  303. }
  304. }
  305. public ModuleInfo VCEBModuleInfo
  306. {
  307. get { return m_VCEBModuleInfo; }
  308. set
  309. {
  310. SetProperty(ref m_VCEBModuleInfo, value);
  311. }
  312. }
  313. public ModuleInfo PMAModuleInfo
  314. {
  315. get { return m_PMAModuleInfo; }
  316. set
  317. {
  318. SetProperty(ref m_PMAModuleInfo, value);
  319. }
  320. }
  321. public ModuleInfo PMBModuleInfo
  322. {
  323. get { return m_PMBModuleInfo; }
  324. set
  325. {
  326. SetProperty(ref m_PMBModuleInfo, value);
  327. }
  328. }
  329. public ModuleInfo PMCModuleInfo
  330. {
  331. get { return m_PMCModuleInfo; }
  332. set
  333. {
  334. SetProperty(ref m_PMCModuleInfo, value);
  335. }
  336. }
  337. public ModuleInfo PMDModuleInfo
  338. {
  339. get { return m_PMDModuleInfo; }
  340. set
  341. {
  342. SetProperty(ref m_PMDModuleInfo, value);
  343. }
  344. }
  345. public ModuleInfo AlignerModuleInfo
  346. {
  347. get { return m_AlignerModuleInfo; }
  348. set
  349. {
  350. SetProperty(ref m_AlignerModuleInfo, value);
  351. }
  352. }
  353. public ModuleInfo TMModuleInfo
  354. {
  355. get { return m_TMModuleInfo; }
  356. set
  357. {
  358. SetProperty(ref m_TMModuleInfo, value);
  359. }
  360. }
  361. public bool PMAIsInstalled
  362. {
  363. get { return m_PMAIsInstalled; }
  364. set
  365. {
  366. SetProperty(ref m_PMAIsInstalled, value);
  367. }
  368. }
  369. public bool PMBIsInstalled
  370. {
  371. get { return m_PMBIsInstalled; }
  372. set
  373. {
  374. SetProperty(ref m_PMBIsInstalled, value);
  375. }
  376. }
  377. public bool PMCIsInstalled
  378. {
  379. get { return m_PMCIsInstalled; }
  380. set
  381. {
  382. SetProperty(ref m_PMCIsInstalled, value);
  383. }
  384. }
  385. public bool PMDIsInstalled
  386. {
  387. get { return m_PMDIsInstalled; }
  388. set
  389. {
  390. SetProperty(ref m_PMDIsInstalled, value);
  391. }
  392. }
  393. public bool VCEAIsInstalled
  394. {
  395. get { return m_VCEAIsInstalled; }
  396. set
  397. {
  398. SetProperty(ref m_VCEAIsInstalled, value);
  399. }
  400. }
  401. public bool VCEBIsInstalled
  402. {
  403. get { return m_VCEBIsInstalled; }
  404. set
  405. {
  406. SetProperty(ref m_VCEBIsInstalled, value);
  407. }
  408. }
  409. public bool ButtonIsEnableVCEA
  410. {
  411. get { return m_ButtonIsEnableVCEA; }
  412. set { SetProperty(ref m_ButtonIsEnableVCEA, value); }
  413. }
  414. public bool ButtonIsEnableVCEB
  415. {
  416. get { return m_ButtonIsEnableVCEB; }
  417. set { SetProperty(ref m_ButtonIsEnableVCEB, value); }
  418. }
  419. public bool VCEADoorIsOpen { get => m_VCEADoorIsOpen; set => SetProperty(ref m_VCEADoorIsOpen, value); }
  420. public bool VCEBDoorIsOpen { get => m_VCEBDoorIsOpen; set => SetProperty(ref m_VCEBDoorIsOpen, value); }
  421. public bool PMADoorIsOpen { get => m_PMADoorIsOpen; set => SetProperty(ref m_PMADoorIsOpen, value); }
  422. public bool PMBDoorIsOpen { get => m_PMBDoorIsOpen; set => SetProperty(ref m_PMBDoorIsOpen, value); }
  423. public bool PMCDoorIsOpen { get => m_PMCDoorIsOpen; set => SetProperty(ref m_PMCDoorIsOpen, value); }
  424. public bool PMDDoorIsOpen { get => m_PMDDoorIsOpen; set => SetProperty(ref m_PMDDoorIsOpen, value); }
  425. public bool VCEAOutDoorIsOpen { get => m_VCEAOutDoorIsOpen; set => SetProperty(ref m_VCEAOutDoorIsOpen, value); }
  426. public bool VCEBOutDoorIsOpen { get => m_VCEBOutDoorIsOpen; set => SetProperty(ref m_VCEBOutDoorIsOpen, value); }
  427. public int VCEAWaferCount
  428. {
  429. get { return m_VCEAWaferCount; }
  430. set
  431. {
  432. SetProperty(ref m_VCEAWaferCount, value);
  433. }
  434. }
  435. public int VCEBWaferCount
  436. {
  437. get { return m_VCEBWaferCount; }
  438. set
  439. {
  440. SetProperty(ref m_VCEBWaferCount, value);
  441. }
  442. }
  443. public Dictionary<string, object> RtDataValues
  444. {
  445. get { return m_RtDataValues; }
  446. set { SetProperty(ref m_RtDataValues, value); }
  447. }
  448. public WaferAssociationInfo VCEAwaferAssociation
  449. {
  450. get { return m_VCEAwaferAssociation; }
  451. set { SetProperty(ref m_VCEAwaferAssociation, value); }
  452. }
  453. public WaferAssociationInfo VCEBwaferAssociation
  454. {
  455. get { return m_VCEBwaferAssociation; }
  456. set { SetProperty(ref m_VCEBwaferAssociation, value); }
  457. }
  458. #endregion
  459. #region 命令
  460. private DelegateCommand _HomeAll;
  461. public DelegateCommand HomeAll => _HomeAll ?? (_HomeAll = new DelegateCommand(onHomeAll));
  462. private DelegateCommand _SetAutoMode;
  463. public DelegateCommand SetAutoMode => _SetAutoMode ?? (_SetAutoMode = new DelegateCommand(onSetAutoMode));
  464. private DelegateCommand _SetManualMode;
  465. public DelegateCommand SetManualMode => _SetManualMode ?? (_SetManualMode = new DelegateCommand(onSetManualMode));
  466. private DelegateCommand _StartSETMCycle;
  467. public DelegateCommand StartSETMCycle => _StartSETMCycle ?? (_StartSETMCycle = new DelegateCommand(onStartSETMCycle));
  468. private DelegateCommand<object> _StartCommand;
  469. public DelegateCommand<object> StartCommand =>
  470. _StartCommand ?? (_StartCommand = new DelegateCommand<object>(OnStart));
  471. private DelegateCommand<object> _StopCommand;
  472. public DelegateCommand<object> StopCommand =>
  473. _StopCommand ?? (_StopCommand = new DelegateCommand<object>(OnStop));
  474. private DelegateCommand<object> _AbortCommand;
  475. public DelegateCommand<object> AbortCommand =>
  476. _AbortCommand ?? (_AbortCommand = new DelegateCommand<object>(OnAbort));
  477. private DelegateCommand _StopCycle;
  478. public DelegateCommand StopCycle => _StopCycle ?? (_StopCycle = new DelegateCommand(onStopCycle));
  479. private DelegateCommand<object> _VCEHome;
  480. public DelegateCommand<object> VCEHome => _VCEHome ?? (_VCEHome = new DelegateCommand<object>(vceHome));
  481. private DelegateCommand<object> _VCEReadMap;
  482. public DelegateCommand<object> VCEReadMap => _VCEReadMap ?? (_VCEReadMap = new DelegateCommand<object>(vceReadMap));
  483. private DelegateCommand<object> _VCELoadPrepare;
  484. public DelegateCommand<object> VCELoadPrepare =>
  485. _VCELoadPrepare ?? (_VCELoadPrepare = new DelegateCommand<object>(vceLoadPrepare));
  486. private DelegateCommand<object> __VCELoad;
  487. public DelegateCommand<object> VCELoad =>
  488. __VCELoad ?? (__VCELoad = new DelegateCommand<object>(vceLoad));
  489. private DelegateCommand<object> __VCELoadWithSMIF;
  490. public DelegateCommand<object> VCELoadWithSMIF =>
  491. __VCELoadWithSMIF ?? (__VCELoadWithSMIF = new DelegateCommand<object>(vceLoadWithSMIF));
  492. private DelegateCommand<object> __VCEUnLoadWithSMIF;
  493. public DelegateCommand<object> VCEUnLoadWithSMIF =>
  494. __VCEUnLoadWithSMIF ?? (__VCEUnLoadWithSMIF = new DelegateCommand<object>(vceUnLoadWithSMIF));
  495. private DelegateCommand<object> _VCEUnLoad;
  496. public DelegateCommand<object> VCEUnLoad =>
  497. _VCEUnLoad ?? (_VCEUnLoad = new DelegateCommand<object>(vceUnLoad));
  498. private DelegateCommand<object> _VCEOpen;
  499. public DelegateCommand<object> VCEOpen =>
  500. _VCEOpen ?? (_VCEOpen = new DelegateCommand<object>(vceOpen));
  501. private DelegateCommand _SMIFLoad;
  502. public DelegateCommand SMIFLoad =>
  503. _SMIFLoad ?? (_SMIFLoad = new DelegateCommand(smifLoad));
  504. private DelegateCommand _SMIFULoad;
  505. public DelegateCommand SMIFULoad =>
  506. _SMIFULoad ?? (_SMIFULoad = new DelegateCommand(smifUnLoad));
  507. private DelegateCommand _tmhome;
  508. public DelegateCommand TmHome =>
  509. _tmhome ?? (_tmhome = new DelegateCommand(tmhome));
  510. private DelegateCommand _tmPick;
  511. public DelegateCommand TmPick =>
  512. _tmPick ?? (_tmPick = new DelegateCommand(tmpick));
  513. private DelegateCommand _tmPlace;
  514. public DelegateCommand TMPlace =>
  515. _tmPlace ?? (_tmPlace = new DelegateCommand(tmplace));
  516. //private DelegateCommand _tmSave;
  517. private DelegateCommand _LoadCommand;
  518. public DelegateCommand LoadCommand =>
  519. _LoadCommand ?? (_LoadCommand = new DelegateCommand(OnLoad));
  520. private DelegateCommand _PauseAllJobCommand;
  521. public DelegateCommand PauseAllJobCommand =>
  522. _PauseAllJobCommand ?? (_PauseAllJobCommand = new DelegateCommand(OnPauseAllJob));
  523. private DelegateCommand _AbortAllCommand;
  524. public DelegateCommand AbortAllCommand =>
  525. _AbortAllCommand ?? (_AbortAllCommand = new DelegateCommand(OnAbortAll));
  526. private DelegateCommand<object> _SetSequenceCommand;
  527. public DelegateCommand<object> SetSequenceCommand =>
  528. _SetSequenceCommand ?? (_SetSequenceCommand = new DelegateCommand<object>(OnSetSequence));
  529. private DelegateCommand<object> _CreateJobCommand;
  530. public DelegateCommand<object> CreateJobCommand =>
  531. _CreateJobCommand ?? (_CreateJobCommand = new DelegateCommand<object>(OnCreateJob));
  532. private DelegateCommand<object> _SelectAllCommand;
  533. public DelegateCommand<object> SelectAllCommand =>
  534. _SelectAllCommand ?? (_SelectAllCommand = new DelegateCommand<object>(OnSelectAll));
  535. private DelegateCommand<object> _UnSelectAllCommand;
  536. public DelegateCommand<object> UnSelectAllCommand =>
  537. _UnSelectAllCommand ?? (_UnSelectAllCommand = new DelegateCommand<object>(OnDeSelectAll));
  538. private DelegateCommand<object> _ReturnAllWafer;
  539. public DelegateCommand<object> ReturnAllWafer =>
  540. _ReturnAllWafer ?? (_ReturnAllWafer = new DelegateCommand<object>(OnReturnAllWafer));
  541. private DelegateCommand _NeedUnloadCommand;
  542. public DelegateCommand NeedUnloadCommand =>
  543. _NeedUnloadCommand ?? (_NeedUnloadCommand = new DelegateCommand(OnNeedUnloadCommand));
  544. #endregion
  545. #region 构造函数
  546. public VenusDeOperationOverViewModel()
  547. {
  548. //页面不刷错的方法 页面中的PM做成List的形式 通过itemsource显示 同时提供各个位置的pm点位 旋转角度
  549. VCEAWaferCount = 25;
  550. VCEBWaferCount = 25;
  551. string[] allModules = QueryDataClient.Instance.Service.GetConfig($"System.InstalledModules").ToString().Split(',');
  552. IsCycleInfoVisibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.IsCycleMode");
  553. NeedAutoUnLoad = (bool)QueryDataClient.Instance.Service.GetConfig($"System.IsAutoUnload");
  554. PMAIsInstalled = allModules.Contains("PMA");
  555. PMBIsInstalled = allModules.Contains("PMB");
  556. PMCIsInstalled = allModules.Contains("PMC");
  557. PMDIsInstalled = allModules.Contains("PMD");
  558. VCEAIsInstalled = allModules.Contains("VCEA");
  559. VCEBIsInstalled = allModules.Contains("VCEB");
  560. IsAligner1OnRight = true;
  561. if (PMDIsInstalled == true)
  562. {
  563. IsAligner1OnRight = false;
  564. }
  565. addDataKeys();
  566. RtDataValues = QueryDataClient.Instance.Service.PollData(m_RtDataKeys);
  567. VCEADoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "TM.VCESlitDoorClosed");
  568. VCEBDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "TM.VCESlitDoorClosed");
  569. PMADoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "TM.PMASlitDoorClosed");
  570. PMBDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "TM.PMBSlitDoorClosed");
  571. PMCDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "TM.PMCSlitDoorClosed");
  572. PMDDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "TM.PMDSlitDoorClosed");
  573. VCEAOutDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "VCEA.VCEOutDoorClosed");
  574. VCEBOutDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "VCEB.VCEOutDoorClosed");
  575. for (int i = 26; i >= 1; --i)
  576. {
  577. if (i == 26)
  578. {
  579. VCEASlots.Add(0);
  580. VCEBSlots.Add(0);
  581. }
  582. else
  583. {
  584. VCEASlots.Add(i);
  585. VCEBSlots.Add(i);
  586. }
  587. }
  588. loadflag = false;
  589. DispatcherTimer timer = new DispatcherTimer();
  590. timer.Interval = TimeSpan.FromSeconds(0.1);
  591. timer.Tick += Timer_Tick;
  592. timer.Start();
  593. }
  594. #endregion
  595. #region 命令实现
  596. private void OnLoad()
  597. {
  598. if (!loadflag)
  599. {
  600. if (VCEAIsInstalled && VCEAwaferAssociation == null)
  601. {
  602. VCEAwaferAssociation = new WaferAssociationInfo
  603. {
  604. ModuleData = ModuleManager.ModuleInfos["LP1"]
  605. };
  606. }
  607. if (VCEBIsInstalled && VCEBwaferAssociation == null)
  608. {
  609. VCEBwaferAssociation = new WaferAssociationInfo
  610. {
  611. ModuleData = ModuleManager.ModuleInfos["LP2"]
  612. };
  613. }
  614. loadflag = true;
  615. }
  616. }
  617. private void OnResumeAllJob()
  618. {
  619. var t = CommonFunction.GetValue<List<string>>(RtDataValues, "Scheduler.PjNameList");
  620. if (t == null && t.Count == 0)
  621. {
  622. return;
  623. }
  624. if (CommonFunction.GetValue<int>(RtDataValues, "EquipmentStatus") == 4)
  625. {
  626. t.ForEach(x =>
  627. {
  628. InvokeClient.Instance.Service.DoOperation("System.ResumeJob", x);
  629. });
  630. }
  631. else
  632. {
  633. t.ForEach(x =>
  634. {
  635. InvokeClient.Instance.Service.DoOperation("System.PauseJob", x);
  636. });
  637. }
  638. }
  639. private void OnAbortJob(object obj)
  640. {
  641. InvokeClient.Instance.Service.DoOperation("System.AbortJob", obj.ToString());
  642. }
  643. private void OnSelectAll(object obj)
  644. {
  645. var info = obj as WaferAssociationInfo;
  646. info.SlotFrom = 1;
  647. info.SlotTo = 25;
  648. AssociateSequence(info, true);
  649. }
  650. private void OnDeSelectAll(object obj)
  651. {
  652. var info = obj as WaferAssociationInfo;
  653. info.SlotFrom = 1;
  654. info.SlotTo = 25;
  655. AssociateSequence(info, false);
  656. }
  657. private void OnNeedUnloadCommand()
  658. {
  659. if (NeedAutoUnLoad != (bool)QueryDataClient.Instance.Service.GetConfig($"System.IsAutoUnload"))
  660. {
  661. InvokeClient.Instance.Service.DoOperation("System.SetConfig", $"System.IsAutoUnload", NeedAutoUnLoad.ToString());
  662. NeedAutoUnLoad = (bool)QueryDataClient.Instance.Service.GetConfig($"System.IsAutoUnload");
  663. }
  664. }
  665. private void OnReturnAllWafer(object obj)
  666. {
  667. WaferDialogView dialog = new WaferDialogView()
  668. {
  669. Owner = Application.Current.MainWindow,
  670. };
  671. dialog.Height = 300;
  672. dialog.Width = 400;
  673. double angel = 0;
  674. double coolingtime = 0;
  675. string message = "Please Confirm Return Wafer";
  676. WaferDialogViewModel vm = new WaferDialogViewModel();
  677. vm.ConfirmText = message;
  678. dialog.DataContext = vm;
  679. if (dialog.ShowDialog() == true)
  680. {
  681. if ((bool)dialog.AlignFlag == true && !string.IsNullOrEmpty(dialog.Angle))
  682. {
  683. angel = Convert.ToDouble(dialog.Angle);
  684. }
  685. if ((bool)dialog.CoolingFlag == true && !string.IsNullOrEmpty(dialog.CoolingTime))
  686. {
  687. coolingtime = Convert.ToDouble(dialog.CoolingTime);
  688. }
  689. InvokeClient.Instance.Service.DoOperation("System.ReturnAllSEWafer", dialog.CoolingFlag, coolingtime, dialog.AlignFlag, angel);
  690. }
  691. }
  692. private void OnCreateJob(object obj)
  693. {
  694. var info = obj as WaferAssociationInfo;
  695. List<string> slotSequence = new List<string>();
  696. info.ModuleData.WaferManager.Wafers.ForEach(key => { slotSequence.Insert(0, key.SequenceName); });
  697. string jobId = info.LotId.Trim();
  698. //if (string.IsNullOrEmpty(jobId))
  699. // jobId = "CJ_Local_" + info.ModuleData.ModuleID;
  700. //info.LotId = jobId;
  701. //info.JobID = jobId;
  702. //info.JobStatus = "WaitingForStart";
  703. info.LotIdSaved = true;
  704. Dictionary<string, object> param = new Dictionary<string, object>()
  705. {
  706. {"JobId", jobId},
  707. {"Module", info.ModuleData.ModuleID},
  708. {"SlotSequence", slotSequence.ToArray()},
  709. {"AutoStart", true},
  710. { "PreCleanRecipeName",info.PreCleanRecipeName},
  711. { "PostCleanRecipeName",info.PostCleanRecipeName}
  712. };
  713. InvokeClient.Instance.Service.DoOperation("System.CreateSEJob", param);
  714. }
  715. private void OnSetSequence(object obj)
  716. {
  717. var info = obj as WaferInfo;
  718. bool flag = info.SequenceName != "" ? false : true;
  719. if (info.ModuleID == "LP1")
  720. {
  721. AssociateSequence(VCEAwaferAssociation, flag, info.SlotID);
  722. }
  723. if (info.ModuleID == "LP2")
  724. {
  725. AssociateSequence(VCEBwaferAssociation, flag, info.SlotID);
  726. }
  727. }
  728. private void OnPauseAllJob()
  729. {
  730. }
  731. private void OnAbortAll()
  732. {
  733. ControlJobInfo lp1Cj = CommonFunction.GetValue<ControlJobInfo>(RtDataValues, "LP1.CurrentControlJob");
  734. UPdateWaferAssociation(VCEAwaferAssociation, lp1Cj);
  735. ControlJobInfo lp2Cj = CommonFunction.GetValue<ControlJobInfo>(RtDataValues, "LP2.CurrentControlJob");
  736. UPdateWaferAssociation(VCEBwaferAssociation, lp2Cj);
  737. InvokeClient.Instance.Service.DoOperation("System.Abort");
  738. }
  739. private void AssociateSequence(WaferAssociationInfo info, bool flag, int slot = -1)
  740. {
  741. List<WaferInfo> wafers = info.ModuleData.WaferManager.Wafers;
  742. if (slot >= 0) //by wafer
  743. {
  744. int index = wafers.Count - slot - 1;
  745. if (index < wafers.Count)
  746. {
  747. //has wafer
  748. if (flag && !(wafers[index].WaferStatus == 0))
  749. wafers[index].SequenceName = info.SequenceName;
  750. else
  751. wafers[index].SequenceName = string.Empty;
  752. }
  753. }
  754. else //by from-to
  755. {
  756. for (int i = info.SlotFrom - 1; i < info.SlotTo; i++)
  757. {
  758. int index = wafers.Count - i - 1;
  759. if (index < wafers.Count)
  760. {
  761. if (flag && !(wafers[index].WaferStatus == 0))
  762. wafers[index].SequenceName = info.SequenceName;
  763. else
  764. wafers[index].SequenceName = string.Empty;
  765. }
  766. }
  767. }
  768. }
  769. private void addDataKeys()
  770. {
  771. m_RtDataKeys.Add($"TM.VCEASlitDoorClosed");
  772. m_RtDataKeys.Add($"TM.VCEBSlitDoorClosed");
  773. m_RtDataKeys.Add($"TM.PMASlitDoorClosed");
  774. m_RtDataKeys.Add($"TM.PMBSlitDoorClosed");
  775. m_RtDataKeys.Add($"TM.PMCSlitDoorClosed");
  776. m_RtDataKeys.Add($"TM.PMDSlitDoorClosed");
  777. m_RtDataKeys.Add($"TM.TMPressure.Value");
  778. m_RtDataKeys.Add($"TM.VCEAPressure.Value");
  779. m_RtDataKeys.Add($"TM.VCEBPressure.Value");
  780. m_RtDataKeys.Add($"TM.IsOnline");
  781. m_RtDataKeys.Add($"VCEA.VCEOutDoorClosed");
  782. m_RtDataKeys.Add($"VCEA.IsOnline");
  783. m_RtDataKeys.Add($"LP1.CassettePlaced");
  784. m_RtDataKeys.Add($"LP1.CurrentControlJob");
  785. m_RtDataKeys.Add($"VCEB.VCEOutDoorClosed");
  786. m_RtDataKeys.Add($"VCEB.IsOnline");
  787. m_RtDataKeys.Add($"LP2.CassettePlaced");
  788. m_RtDataKeys.Add($"LP2.CurrentControlJob");
  789. //m_RtDataKeys.Add($"SEScheduler.CycledWafer");
  790. //m_RtDataKeys.Add($"SEScheduler.CycleSetPoint");
  791. //m_RtDataKeys.Add($"SEScheduler.CycleCount");
  792. //m_RtDataKeys.Add($"SEScheduler.ThroughPut");
  793. m_RtDataKeys.Add($"PMA.ChamberPressure");
  794. m_RtDataKeys.Add($"PMA.VentingFlag");
  795. m_RtDataKeys.Add($"PMA.CurrentRecipeResult");
  796. m_RtDataKeys.Add($"PMA.IsOnline");
  797. m_RtDataKeys.Add($"PMB.ChamberPressure");
  798. m_RtDataKeys.Add($"PMB.VentingFlag");
  799. m_RtDataKeys.Add($"PMB.CurrentRecipeResult");
  800. m_RtDataKeys.Add($"PMB.IsOnline");
  801. m_RtDataKeys.Add($"PMC.ChamberPressure");
  802. m_RtDataKeys.Add($"PMC.VentingFlag");
  803. m_RtDataKeys.Add($"PMC.CurrentRecipeResult");
  804. m_RtDataKeys.Add($"PMC.IsOnline");
  805. m_RtDataKeys.Add($"PMD.ChamberPressure");
  806. m_RtDataKeys.Add($"PMD.VentingFlag");
  807. m_RtDataKeys.Add($"PMD.CurrentRecipeResult");
  808. m_RtDataKeys.Add($"PMD.IsOnline");
  809. m_RtDataKeys.Add($"VCEA.CurrentSlot");
  810. m_RtDataKeys.Add($"VCEB.CurrentSlot");
  811. m_RtDataKeys.Add($"TM.TMIsATM");
  812. m_RtDataKeys.Add($"TM.VCEAIsATM");
  813. m_RtDataKeys.Add($"TM.VCEBIsATM");
  814. m_RtDataKeys.Add("System.IsAutoMode");
  815. m_RtDataKeys.Add("System.IsBusy");
  816. m_RtDataKeys.Add("LP1.CycledCount");
  817. m_RtDataKeys.Add("LP1.CycledWafer");
  818. m_RtDataKeys.Add("LP1.CycleSetPoint");
  819. m_RtDataKeys.Add("LP1.Throughput");
  820. m_RtDataKeys.Add("LP2.CycledCount");
  821. m_RtDataKeys.Add("LP2.CycledWafer");
  822. m_RtDataKeys.Add("LP2.CycleSetPoint");
  823. m_RtDataKeys.Add("LP2.Throughput");
  824. //m_RtDataKeys.Add("EquipmentStatus");
  825. m_RtDataKeys.Add("Scheduler.PjNameList");
  826. //if (PMAIsInstalled)
  827. //{
  828. // m_RtDataKeys.Add($"PMA.ChamberPressure");
  829. // m_RtDataKeys.Add($"PMA.VentingFlag");
  830. // m_RtDataKeys.Add($"PMA.CurrentRecipeResult");
  831. //}
  832. //if (PMBIsInstalled)
  833. //{
  834. // m_RtDataKeys.Add($"PMB.ChamberPressure");
  835. // m_RtDataKeys.Add($"PMB.VentingFlag");
  836. // m_RtDataKeys.Add($"PMB.CurrentRecipeResult");
  837. //}
  838. //if (PMCIsInstalled)
  839. //{
  840. // m_RtDataKeys.Add($"PMC.ChamberPressure");
  841. // m_RtDataKeys.Add($"PMC.VentingFlag");
  842. // m_RtDataKeys.Add($"PMC.CurrentRecipeResult");
  843. //}
  844. }
  845. private void onHomeAll()
  846. {
  847. InvokeClient.Instance.Service.DoOperation("System.HomeAll");
  848. }
  849. private void onSetAutoMode()
  850. {
  851. InvokeClient.Instance.Service.DoOperation("System.SetAutoMode");
  852. }
  853. private void onSetManualMode()
  854. {
  855. InvokeClient.Instance.Service.DoOperation("System.SetManualMode");
  856. }
  857. private void onStopCycle()
  858. {
  859. InvokeClient.Instance.Service.DoOperation("System.StopSECycle");
  860. }
  861. private void onStartSETMCycle()
  862. {
  863. List<string> stations = new List<string>();
  864. stations.Add("VCEA");
  865. stations.Add("Aligner1");
  866. if (PMAIsInstalled)
  867. {
  868. stations.Add("PMA");
  869. }
  870. if (PMBIsInstalled)
  871. {
  872. stations.Add("PMB");
  873. }
  874. if (PMCIsInstalled)
  875. {
  876. stations.Add("PMC");
  877. }
  878. if (PMCIsInstalled)
  879. {
  880. stations.Add("PMD");
  881. }
  882. stations.Add("VCEA");
  883. InvokeClient.Instance.Service.DoOperation("System.SETMCycle", stations.ToArray(), 1);
  884. }
  885. private void OnStart(object obj)
  886. {
  887. var info = obj as WaferAssociationInfo;
  888. InvokeClient.Instance.Service.DoOperation("System.StartSEJob", info.LotId);
  889. }
  890. private void OnStop(object obj)
  891. {
  892. var info = obj as WaferAssociationInfo;
  893. InvokeClient.Instance.Service.DoOperation("System.StopJob", info.JobID);
  894. }
  895. private void OnAbort(object obj)
  896. {
  897. var info = obj as WaferAssociationInfo;
  898. InvokeClient.Instance.Service.DoOperation("System.AbortJob", info.JobID);
  899. }
  900. private void UPdateWaferAssociation(WaferAssociationInfo info, ControlJobInfo cjInfo)
  901. {
  902. if (info == null)
  903. {
  904. return;
  905. }
  906. if (cjInfo != null)
  907. {
  908. info.LotId = cjInfo.Name;
  909. info.JobID = cjInfo.Name;
  910. info.JobStatus = cjInfo.State.ToString();
  911. if (cjInfo.SequenceNameList != null)
  912. {
  913. for (int i = 0; i < cjInfo.SequenceNameList.Length; i++)
  914. {
  915. info.ModuleData.WaferManager.Wafers[24 - i].SequenceName = cjInfo.SequenceNameList[i];
  916. }
  917. }
  918. info.PreCleanRecipeName = cjInfo.PreJobClean;
  919. info.PostCleanRecipeName = cjInfo.PostJobClean;
  920. }
  921. else
  922. {
  923. if (!string.IsNullOrEmpty(info.JobID))
  924. {
  925. info.LotId = "";
  926. info.JobID = "";
  927. info.JobStatus = "";
  928. //info.PreCleanRecipeName = "";
  929. //info.PostCleanRecipeName = "";
  930. AssociateSequence(info, false);
  931. }
  932. }
  933. }
  934. private void vceHome(object obj)
  935. {
  936. InvokeClient.Instance.Service.DoOperation($"{obj}.HOME");
  937. }
  938. private void vceReadMap(object obj)
  939. {
  940. InvokeClient.Instance.Service.DoOperation($"{obj}.ReadMap");
  941. }
  942. private void vceLoadPrepare(object obj)
  943. {
  944. InvokeClient.Instance.Service.DoOperation($"{obj}.LoadPrepare");
  945. }
  946. private void vceLoad(object obj)
  947. {
  948. InvokeClient.Instance.Service.DoOperation($"{obj}.SafeLoad");
  949. }
  950. private void vceLoadWithSMIF(object obj)
  951. {
  952. InvokeClient.Instance.Service.DoOperation($"{obj}.LoadWithSMIF");
  953. }
  954. private void vceUnLoadWithSMIF(object obj)
  955. {
  956. InvokeClient.Instance.Service.DoOperation($"{obj}.UnLoadWithSMIF");
  957. }
  958. private void vceUnLoad(object obj)
  959. {
  960. InvokeClient.Instance.Service.DoOperation($"{obj}.SafeUnload");
  961. }
  962. private void vceOpen(object obj)
  963. {
  964. string[] param = obj.ToString().Split(',');
  965. if (param[1] == "0")
  966. InvokeClient.Instance.Service.DoOperation($"{param[0]}.DoorClose");
  967. else
  968. InvokeClient.Instance.Service.DoOperation($"{param[0]}.DoorOpen");
  969. }
  970. private void smifLoad() { }
  971. private void smifUnLoad() { }
  972. private void tmhome()
  973. {
  974. InvokeClient.Instance.Service.DoOperation("TM.Home");
  975. }
  976. private void tmpick()
  977. {
  978. ModuleName target = ModuleName.VCE1;
  979. int slot = PickNum;
  980. MoveItem moveItem = new MoveItem(target, slot - 1, ModuleName.TMRobot, 0, 0);
  981. Queue<MoveItem> que = new Queue<MoveItem>();
  982. que.Enqueue(moveItem);
  983. InvokeClient.Instance.Service.DoOperation("TM.Pick", que);
  984. }
  985. private void tmplace()
  986. {
  987. ModuleName target = ModuleName.VCE1;
  988. int slot = PickNum;
  989. MoveItem moveItem = new MoveItem(ModuleName.TMRobot, 0, target, slot - 1, 0);
  990. Queue<MoveItem> que = new Queue<MoveItem>();
  991. que.Enqueue(moveItem);
  992. InvokeClient.Instance.Service.DoOperation("TM.Place", que);
  993. }
  994. #endregion
  995. #region 私有方法
  996. private void Timer_Tick(object sender, EventArgs e)
  997. {
  998. try
  999. {
  1000. RtDataValues = QueryDataClient.Instance.Service.PollData(m_RtDataKeys);
  1001. IsCycleInfoVisibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.IsCycleMode");
  1002. VCEADoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "TM.VCEASlitDoorClosed");
  1003. VCEBDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "TM.VCEBSlitDoorClosed");
  1004. PMADoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "TM.PMASlitDoorClosed");
  1005. PMBDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "TM.PMBSlitDoorClosed");
  1006. PMCDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "TM.PMCSlitDoorClosed");
  1007. PMDDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "TM.PMDSlitDoorClosed");
  1008. VCEAOutDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "VCEA.VCEOutDoorClosed");
  1009. VCEBOutDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "VCEB.VCEOutDoorClosed");
  1010. VCEAPercent = CommonFunction.GetValue<double>(RtDataValues, "TM.VCEAPressure.Value") * 260 / 750000;
  1011. VCEBPercent = CommonFunction.GetValue<double>(RtDataValues, "TM.VCEBPressure.Value") * 260 / 750000;
  1012. CurrentSlotA = CommonFunction.GetValue<int>(RtDataValues, "VCEA.CurrentSlot");
  1013. CurrentSlotB = CommonFunction.GetValue<int>(RtDataValues, "VCEB.CurrentSlot");
  1014. TMIsVAC = (CommonFunction.GetValue<int>(RtDataValues, "TM.TMPressure.Value") < Convert.ToInt32(QueryDataClient.Instance.Service.GetConfig($"TM.VACTargetPressure")));
  1015. VCEAIsVAC = (CommonFunction.GetValue<int>(RtDataValues, "TM.VCEAPressure.Value") < Convert.ToInt32(QueryDataClient.Instance.Service.GetConfig($"VCEA.VACTargetPressure")));
  1016. VCEBIsVAC = (CommonFunction.GetValue<int>(RtDataValues, "TM.VCEBPressure.Value") < Convert.ToInt32(QueryDataClient.Instance.Service.GetConfig($"VCEB.VACTargetPressure")));
  1017. PMAChamberLabel = QueryDataClient.Instance.Service.GetConfig($"PMA.ChamberLabel").ToString();
  1018. PMBChamberLabel = QueryDataClient.Instance.Service.GetConfig($"PMB.ChamberLabel").ToString();
  1019. PMCChamberLabel = QueryDataClient.Instance.Service.GetConfig($"PMC.ChamberLabel").ToString();
  1020. PMDChamberLabel = QueryDataClient.Instance.Service.GetConfig($"PMD.ChamberLabel").ToString();
  1021. if (PMAIsInstalled == true)
  1022. {
  1023. PMAModuleInfo = ModuleManager.ModuleInfos["PMA"];
  1024. PMAWafer = PMAModuleInfo.WaferManager.Wafers[0];
  1025. PMAPercent = CommonFunction.GetValue<double>(RtDataValues, "PMA.ChamberPressure") * 260 / 750000;
  1026. PMARecipeResult = CommonFunction.GetValue<RecipeResult>(RtDataValues, "PMA.CurrentRecipeResult");
  1027. }
  1028. if (PMBIsInstalled == true)
  1029. {
  1030. PMBModuleInfo = ModuleManager.ModuleInfos["PMB"];
  1031. PMBWafer = PMBModuleInfo.WaferManager.Wafers[0];
  1032. PMBPercent = CommonFunction.GetValue<double>(RtDataValues, "PMB.ChamberPressure") * 260 / 750000;
  1033. PMBRecipeResult = CommonFunction.GetValue<RecipeResult>(RtDataValues, "PMB.CurrentRecipeResult");
  1034. }
  1035. if (PMCIsInstalled == true)
  1036. {
  1037. PMCModuleInfo = ModuleManager.ModuleInfos["PMC"];
  1038. PMCWafer = PMCModuleInfo.WaferManager.Wafers[0];
  1039. PMCPercent = CommonFunction.GetValue<double>(RtDataValues, "PMC.ChamberPressure") * 260 / 750000;
  1040. PMCRecipeResult = CommonFunction.GetValue<RecipeResult>(RtDataValues, "PMC.CurrentRecipeResult");
  1041. }
  1042. if (PMDIsInstalled == true)
  1043. {
  1044. PMDModuleInfo = ModuleManager.ModuleInfos["PMD"];
  1045. PMDWafer = PMDModuleInfo.WaferManager.Wafers[0];
  1046. PMDPercent = CommonFunction.GetValue<double>(RtDataValues, "PMD.ChamberPressure") * 260 / 750000;
  1047. PMDRecipeResult = CommonFunction.GetValue<RecipeResult>(RtDataValues, "PMD.CurrentRecipeResult");
  1048. }
  1049. if (VCEAIsInstalled == true)
  1050. {
  1051. VCEAModuleInfo = ModuleManager.ModuleInfos["LP1"];
  1052. ControlJobInfo lp1Cj = CommonFunction.GetValue<ControlJobInfo>(RtDataValues, "LP1.CurrentControlJob");
  1053. if (lp1Cj != null)
  1054. ButtonIsEnableVCEA = false;
  1055. else
  1056. ButtonIsEnableVCEA = true;
  1057. UPdateWaferAssociation(VCEAwaferAssociation, lp1Cj);
  1058. }
  1059. if (VCEBIsInstalled == true)
  1060. {
  1061. VCEBModuleInfo = ModuleManager.ModuleInfos["LP2"];
  1062. ControlJobInfo lp2Cj = CommonFunction.GetValue<ControlJobInfo>(RtDataValues, "LP2.CurrentControlJob");
  1063. if (lp2Cj != null)
  1064. ButtonIsEnableVCEB = false;
  1065. else
  1066. ButtonIsEnableVCEB = true;
  1067. UPdateWaferAssociation(VCEBwaferAssociation, lp2Cj);
  1068. }
  1069. RobotMoveInfo = (RobotMoveInfo)QueryDataClient.Instance.Service.GetData("TM.RobotMoveAction");
  1070. PAWafer = ModuleManager.ModuleInfos["Aligner1"].WaferManager.Wafers[0];
  1071. TMModuleInfo = ModuleManager.ModuleInfos["TMRobot"];
  1072. RobotUpperWafer = TMModuleInfo.WaferManager.Wafers[0];
  1073. RobotLowerWafer = TMModuleInfo.WaferManager.Wafers[1];
  1074. }
  1075. catch
  1076. {
  1077. }
  1078. }
  1079. #endregion
  1080. private async void RobotMoveInfoChanged(RobotMoveInfo oldValue, RobotMoveInfo newValue)
  1081. {
  1082. string RobotTarget;
  1083. if (oldValue == null || newValue == null)
  1084. {
  1085. return;
  1086. }
  1087. #region Rotating
  1088. if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && (newValue.Action == RobotAction.Rotating))
  1089. {
  1090. var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
  1091. if (TMRobotMoveActionBladeTarget != null)
  1092. {
  1093. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  1094. }
  1095. else
  1096. {
  1097. return;
  1098. }
  1099. var values = RobotTarget.Split('.');
  1100. var arm = values[0];
  1101. var module = values[1];
  1102. var DERobotTAction = (DERobotTAction)Enum.Parse(typeof(DERobotTAction), module, true);
  1103. if (DERobotTAction != Robot1TAction || DERobotTAction != Robot2TAction)
  1104. {
  1105. Robot1TAction = DERobotTAction;
  1106. Robot2TAction = DERobotTAction;
  1107. }
  1108. }
  1109. #endregion
  1110. #region Aligner1、VCE Pick、Place
  1111. else if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && (newValue.Action == RobotAction.Placing || newValue.Action == RobotAction.Picking))
  1112. {
  1113. var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
  1114. if (TMRobotMoveActionBladeTarget != null)
  1115. {
  1116. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  1117. }
  1118. else
  1119. {
  1120. return;
  1121. }
  1122. var values = RobotTarget.Split('.');
  1123. var arm = values[0];
  1124. var module = values[1];
  1125. if (module == "Aligner1")
  1126. {
  1127. module = IsAligner1OnRight ? "PMD" : "Aligner1";
  1128. }
  1129. var DERobotTAction = (DERobotTAction)Enum.Parse(typeof(DERobotTAction), module, true);
  1130. if (DERobotTAction != Robot1TAction || DERobotTAction != Robot2TAction)
  1131. {
  1132. Robot1TAction = DERobotTAction;
  1133. Robot2TAction = DERobotTAction;
  1134. }
  1135. if (arm == "ArmA")
  1136. {
  1137. await Task.Delay(600);
  1138. if (module == "VCEA" || module == "VCEB")
  1139. {
  1140. Robot1XAction = DERobotXAction.ToVCE;
  1141. 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))
  1142. {
  1143. await Task.Delay(100);
  1144. }
  1145. Robot1XAction = DERobotXAction.FromVCE;
  1146. }
  1147. else
  1148. {
  1149. Robot1XAction = DERobotXAction.Extend;
  1150. 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))
  1151. {
  1152. await Task.Delay(100);
  1153. }
  1154. Robot1XAction = DERobotXAction.Retract;
  1155. }
  1156. }
  1157. else if (arm == "ArmB")
  1158. {
  1159. await Task.Delay(600);
  1160. if (module == "VCEA" || module == "VCEB")
  1161. {
  1162. Robot2XAction = DERobotXAction.ToVCE2;
  1163. 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))
  1164. {
  1165. await Task.Delay(100);
  1166. }
  1167. Robot2XAction = DERobotXAction.FromVCE2;
  1168. }
  1169. else
  1170. {
  1171. Robot2XAction = DERobotXAction.Extend2;
  1172. 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))
  1173. {
  1174. await Task.Delay(100);
  1175. }
  1176. Robot2XAction = DERobotXAction.Retract2;
  1177. }
  1178. }
  1179. }
  1180. #endregion
  1181. #region PM pick、PM place
  1182. else if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && newValue.Action == RobotAction.Extending)
  1183. {
  1184. var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
  1185. if (TMRobotMoveActionBladeTarget != null)
  1186. {
  1187. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  1188. }
  1189. else
  1190. {
  1191. return;
  1192. }
  1193. var values = RobotTarget.Split('.');
  1194. var arm = values[0];
  1195. var module = values[1];
  1196. var DERobotTAction = (DERobotTAction)Enum.Parse(typeof(DERobotTAction), module, true);
  1197. if (DERobotTAction != Robot1TAction || DERobotTAction != Robot2TAction)
  1198. {
  1199. Robot1TAction = DERobotTAction;
  1200. Robot2TAction = DERobotTAction;
  1201. }
  1202. if (arm == "ArmA")
  1203. {
  1204. await Task.Delay(600);
  1205. Robot1XAction = DERobotXAction.Extend;
  1206. }
  1207. else if (arm == "ArmB")
  1208. {
  1209. await Task.Delay(600);
  1210. Robot2XAction = DERobotXAction.Extend2;
  1211. }
  1212. }
  1213. else if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && newValue.Action == RobotAction.Retracting)
  1214. {
  1215. var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
  1216. if (TMRobotMoveActionBladeTarget != null)
  1217. {
  1218. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  1219. }
  1220. else
  1221. {
  1222. return;
  1223. }
  1224. var values = RobotTarget.Split('.');
  1225. var arm = values[0];
  1226. if (arm == "ArmA")
  1227. {
  1228. await Task.Delay(100);
  1229. Robot1XAction = DERobotXAction.Retract;
  1230. }
  1231. else if (arm == "ArmB")
  1232. {
  1233. await Task.Delay(100);
  1234. Robot2XAction = DERobotXAction.Retract2;
  1235. }
  1236. }
  1237. #endregion
  1238. #region Home
  1239. else if (oldValue.Action == RobotAction.None && newValue.Action == RobotAction.Homing)
  1240. {
  1241. if (Robot1XAction == DERobotXAction.Extend)
  1242. {
  1243. Robot1XAction = DERobotXAction.Retract;
  1244. }
  1245. if (Robot2XAction == DERobotXAction.Extend2)
  1246. {
  1247. Robot2XAction = DERobotXAction.Retract2;
  1248. }
  1249. await Task.Delay(2000);
  1250. if (Robot1TAction != DERobotTAction.T_Origin)
  1251. {
  1252. Robot1TAction = DERobotTAction.T_Origin;
  1253. }
  1254. if (Robot2TAction != DERobotTAction.T_Origin)
  1255. {
  1256. Robot2TAction = DERobotTAction.T_Origin;
  1257. }
  1258. }
  1259. #endregion
  1260. }
  1261. }
  1262. }