VenusDeOperationOverViewModel.cs 51 KB

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