VenusDeOperationOverViewModel.cs 53 KB

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