VenusDeOperationOverViewModel.cs 52 KB

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