VenusDeOperationOverViewModel.cs 50 KB

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