EfemViewModel.cs 54 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390
  1. using Aitex.Sorter.Common;
  2. using ExcelLibrary.BinaryFileFormat;
  3. using MECF.Framework.Common.CommonData;
  4. using MECF.Framework.Common.DataCenter;
  5. using MECF.Framework.Common.Equipment;
  6. using MECF.Framework.Common.OperationCenter;
  7. using MECF.Framework.Common.Schedulers;
  8. using OpenSEMI.ClientBase;
  9. using OpenSEMI.Ctrlib.Controls;
  10. using Prism.Commands;
  11. using Prism.Mvvm;
  12. using System;
  13. using System.Collections.Generic;
  14. using System.Collections.ObjectModel;
  15. using System.Linq;
  16. using System.Threading.Tasks;
  17. using System.Windows.Threading;
  18. using CyberX8_Core;
  19. using CyberX8_MainPages.Unity;
  20. using CyberX8_Themes.CustomControls;
  21. using CyberX8_Themes.Unity;
  22. using MECF.Framework.Common.Utilities;
  23. using CyberX8_Themes.UserControls;
  24. using Caliburn.Micro;
  25. using System.Windows.Documents;
  26. using System.Windows.Input;
  27. using System.Windows;
  28. using MECF.Framework.Common.Jobs;
  29. using System.Configuration;
  30. namespace CyberX8_MainPages.ViewModels
  31. {
  32. public enum EFEMModule
  33. {
  34. LP1,LP2,LP3,Aligner1,PUF1,PUF2,SRD1,SRD2,Dummy1,Dummy2
  35. }
  36. public enum EFEMBlade
  37. {
  38. Blade1
  39. }
  40. internal class EfemViewModel:BindableBase
  41. {
  42. #region 私有字段
  43. private bool m_puf1IsInstalled;
  44. private bool m_puf2IsInstalled;
  45. private bool m_srd1IsInstalled;
  46. private bool m_srd2IsInstalled;
  47. private bool m_puf1IsInRobotStation;
  48. private bool m_puf2IsInRobotStation;
  49. private bool _isAlignerVacuumOn;
  50. private bool _isRobotVacuumOn;
  51. private ModuleInfo m_LP1ModuleInfo;
  52. private ModuleInfo m_LP2ModuleInfo;
  53. private ModuleInfo m_LP3ModuleInfo;
  54. private ModuleInfo m_EFEMModuleInfo;
  55. private ModuleInfo m_srd1ModuleInfo;//upper
  56. private ModuleInfo m_srd2ModuleInfo;
  57. private ModuleInfo m_puf1ModuleInfo;
  58. private ModuleInfo m_puf2ModuleInfo;
  59. private List<EFEMModule> m_EFEMModules = new List<EFEMModule>();
  60. private List<EFEMModule> m_PUFModules = new List<EFEMModule>();
  61. private EFEMBlade m_PickSelectedBlade;
  62. private EFEMBlade m_PlaceSelectedBlade;
  63. private EFEMBlade m_ExtendSelectedBlade;
  64. private EFEMBlade m_RetractSelectedBlade;
  65. private ObservableCollection<int> m_PlaceSoltItemsSource = new ObservableCollection<int>();
  66. private ObservableCollection<int> m_PickSoltItemsSource = new ObservableCollection<int>();
  67. private ObservableCollection<int> m_PUFPlaceSoltItemsSource = new ObservableCollection<int>();
  68. private ObservableCollection<int> m_PUFPickSoltItemsSource = new ObservableCollection<int>();
  69. private ObservableCollection<int> m_ExtendSoltItemsSource = new ObservableCollection<int>();
  70. private ObservableCollection<int> m_RetractSoltItemsSource = new ObservableCollection<int>();
  71. private int m_PickSoltSelectedIndex;
  72. private int m_PlaceSoltSelectedIndex;
  73. private int m_PUFPickSoltSelectedIndex;
  74. private int m_PUFPlaceSoltSelectedIndex;
  75. private int m_ExtendSoltSelectedIndex;
  76. private int m_RetractSoltSelectedIndex;
  77. private EFEMModule m_PickSelectedModule;
  78. private EFEMModule m_PlaceSelectedModule;
  79. private EFEMModule m_ExtendSelectedModule;
  80. private EFEMModule m_RetractSelectedModule;
  81. private EFEMModule m_PUFPickSelectedModule;
  82. private EFEMModule m_PUFPlaceSelectedModule;
  83. private WaferInfo m_BladeAWafer;
  84. private WaferInfo m_BladeBWafer;
  85. private WaferInfo m_puf1Wafer;
  86. private WaferInfo m_puf2Wafer;
  87. private WaferInfo m_srd1Wafer;
  88. private WaferInfo m_srd2Wafer;
  89. private WaferInfo m_Aligner1Wafer;
  90. private string m_LP1Status;
  91. private string m_LP2Status;
  92. private string m_LP3Status;
  93. private string _setLP1IDValue;
  94. private string _setLP2IDValue;
  95. private string _setLP3IDValue;
  96. private int _setLP1CycleValue;
  97. private int _setLP2CycleValue;
  98. private int _setLP3CycleValue;
  99. private bool _isLp1Unable;
  100. private bool _isLp2Unable;
  101. private bool _isLp3Unable;
  102. private List<string> m_RtDataKeys=new List<string>();
  103. private Dictionary<string, object> m_RtDataValues;
  104. private int m_AlignValue;
  105. private int m_RobotSpeedValue;
  106. private WaferRobotTAction m_Robot1TAction;
  107. private WaferRobotXAction m_Robot1XAction;
  108. private WaferRobotTAction m_Robot2TAction;
  109. private WaferRobotXAction m_Robot2XAction;
  110. //int arm1oldWaferStatus = 100;
  111. //int arm2oldWaferStatus = 100;
  112. private EFEM.RobotPosition m_CurrentRobotPosition;
  113. private ModuleInfo _dummy1ModuleInfo;
  114. private ModuleInfo _dummy2ModuleInfo;
  115. private int m_dummy1WaferCount;
  116. private int m_dummy2WaferCount;
  117. private bool _isLp1HasNoJob;
  118. private bool _isLp2HasNoJob;
  119. private bool _isLp3HasNoJob;
  120. private bool _isHomeAllEnable;
  121. private double _vacuumValue;
  122. #endregion
  123. #region 属性
  124. public bool IsHomeAllEnable
  125. {
  126. get { return _isHomeAllEnable; }
  127. set { SetProperty(ref _isHomeAllEnable, value); }
  128. }
  129. public ModuleInfo LP1ModuleInfo
  130. {
  131. get { return m_LP1ModuleInfo; }
  132. set { SetProperty(ref m_LP1ModuleInfo, value); }
  133. }
  134. public ModuleInfo LP2ModuleInfo
  135. {
  136. get { return m_LP2ModuleInfo; }
  137. set { SetProperty(ref m_LP2ModuleInfo, value); }
  138. }
  139. public ModuleInfo LP3ModuleInfo
  140. {
  141. get { return m_LP3ModuleInfo; }
  142. set { SetProperty(ref m_LP3ModuleInfo, value); }
  143. }
  144. public bool IsLP1Unable
  145. {
  146. get { return _isLp1Unable; }
  147. set { SetProperty(ref _isLp1Unable, value); }
  148. }
  149. public bool IsLP2Unable
  150. {
  151. get { return _isLp2Unable; }
  152. set { SetProperty(ref _isLp2Unable, value); }
  153. }
  154. public bool IsLP3Unable
  155. {
  156. get { return _isLp3Unable; }
  157. set { SetProperty(ref _isLp3Unable, value); }
  158. }
  159. public bool IsLP1HasNoJob
  160. {
  161. get { return _isLp1HasNoJob; }
  162. set { SetProperty(ref _isLp1HasNoJob, value); }
  163. }
  164. public bool IsLP2HasNoJob
  165. {
  166. get { return _isLp2HasNoJob; }
  167. set { SetProperty(ref _isLp2HasNoJob, value); }
  168. }
  169. public bool IsLP3HasNoJob
  170. {
  171. get { return _isLp3HasNoJob; }
  172. set { SetProperty(ref _isLp3HasNoJob, value); }
  173. }
  174. public ModuleInfo EFEMModuleInfo
  175. {
  176. get { return m_EFEMModuleInfo; }
  177. set { SetProperty(ref m_EFEMModuleInfo, value); }
  178. }
  179. public List<EFEMModule> EFEMModules
  180. {
  181. get { return m_EFEMModules; }
  182. set { SetProperty(ref m_EFEMModules, value); }
  183. }
  184. public List<EFEMModule> PUFModules
  185. {
  186. get { return m_PUFModules; }
  187. set { SetProperty(ref m_PUFModules, value); }
  188. }
  189. public EFEMBlade PickSelectedBlade
  190. {
  191. get { return m_PickSelectedBlade; }
  192. set { SetProperty(ref m_PickSelectedBlade, value); }
  193. }
  194. public EFEMBlade PlaceSelectedBlade
  195. {
  196. get { return m_PlaceSelectedBlade; }
  197. set { SetProperty(ref m_PlaceSelectedBlade, value); }
  198. }
  199. public EFEMBlade ExtendSelectedBlade
  200. {
  201. get { return m_ExtendSelectedBlade; }
  202. set { SetProperty(ref m_ExtendSelectedBlade, value); }
  203. }
  204. public EFEMBlade RetractSelectedBlade
  205. {
  206. get { return m_RetractSelectedBlade; }
  207. set { SetProperty(ref m_RetractSelectedBlade, value); }
  208. }
  209. public ObservableCollection<int> PickSoltItemsSource
  210. {
  211. get { return m_PickSoltItemsSource; }
  212. set { SetProperty(ref m_PickSoltItemsSource, value); }
  213. }
  214. public ObservableCollection<int> PlaceSoltItemsSource
  215. {
  216. get { return m_PlaceSoltItemsSource; }
  217. set { SetProperty(ref m_PlaceSoltItemsSource, value); }
  218. }
  219. public ObservableCollection<int> PUFPickSoltItemsSource
  220. {
  221. get { return m_PUFPickSoltItemsSource; }
  222. set { SetProperty(ref m_PUFPickSoltItemsSource, value); }
  223. }
  224. public ObservableCollection<int> PUFPlaceSoltItemsSource
  225. {
  226. get { return m_PUFPlaceSoltItemsSource; }
  227. set { SetProperty(ref m_PUFPlaceSoltItemsSource, value); }
  228. }
  229. public ObservableCollection<int> ExtendSoltItemsSource
  230. {
  231. get { return m_ExtendSoltItemsSource; }
  232. set { SetProperty(ref m_ExtendSoltItemsSource, value); }
  233. }
  234. public ObservableCollection<int> RetractSoltItemsSource
  235. {
  236. get { return m_RetractSoltItemsSource; }
  237. set { SetProperty(ref m_RetractSoltItemsSource, value); }
  238. }
  239. public int PickSoltSelectedIndex
  240. {
  241. get { return m_PickSoltSelectedIndex; }
  242. set { SetProperty(ref m_PickSoltSelectedIndex, value); }
  243. }
  244. public int PlaceSoltSelectedIndex
  245. {
  246. get { return m_PlaceSoltSelectedIndex; }
  247. set { SetProperty(ref m_PlaceSoltSelectedIndex, value); }
  248. }
  249. public int PUFPickSoltSelectedIndex
  250. {
  251. get { return m_PUFPickSoltSelectedIndex; }
  252. set { SetProperty(ref m_PUFPickSoltSelectedIndex, value); }
  253. }
  254. public int PUFPlaceSoltSelectedIndex
  255. {
  256. get { return m_PUFPlaceSoltSelectedIndex; }
  257. set { SetProperty(ref m_PUFPlaceSoltSelectedIndex, value); }
  258. }
  259. public int ExtendSoltSelectedIndex
  260. {
  261. get { return m_ExtendSoltSelectedIndex; }
  262. set { SetProperty(ref m_ExtendSoltSelectedIndex, value); }
  263. }
  264. public int RetractSoltSelectedIndex
  265. {
  266. get { return m_RetractSoltSelectedIndex; }
  267. set { SetProperty(ref m_RetractSoltSelectedIndex, value); }
  268. }
  269. public EFEMModule PickSelectedModule
  270. {
  271. get { return m_PickSelectedModule; }
  272. set { SetProperty(ref m_PickSelectedModule, value); }
  273. }
  274. public EFEMModule PlaceSelectedModule
  275. {
  276. get { return m_PlaceSelectedModule; }
  277. set { SetProperty(ref m_PlaceSelectedModule, value); }
  278. }
  279. public EFEMModule PUFPickSelectedModule
  280. {
  281. get { return m_PUFPickSelectedModule; }
  282. set { SetProperty(ref m_PUFPickSelectedModule, value); }
  283. }
  284. public EFEMModule PUFPlaceSelectedModule
  285. {
  286. get { return m_PUFPlaceSelectedModule; }
  287. set { SetProperty(ref m_PUFPlaceSelectedModule, value); }
  288. }
  289. public EFEMModule ExtendSelectedModule
  290. {
  291. get { return m_ExtendSelectedModule; }
  292. set { SetProperty(ref m_ExtendSelectedModule, value); }
  293. }
  294. public EFEMModule RetractSelectedModule
  295. {
  296. get { return m_RetractSelectedModule; }
  297. set { SetProperty(ref m_RetractSelectedModule, value); }
  298. }
  299. public WaferInfo BladeAWafer
  300. {
  301. get { return m_BladeAWafer; }
  302. set { SetProperty(ref m_BladeAWafer, value); }
  303. }
  304. public WaferInfo Aligner1Wafer
  305. {
  306. get { return m_Aligner1Wafer; }
  307. set { SetProperty(ref m_Aligner1Wafer, value); }
  308. }
  309. public WaferInfo Puf1Wafer
  310. {
  311. get { return m_puf1Wafer; }
  312. set { SetProperty(ref m_puf1Wafer, value); }
  313. }
  314. public WaferInfo Puf2Wafer
  315. {
  316. get { return m_puf2Wafer; }
  317. set { SetProperty(ref m_puf2Wafer, value); }
  318. }
  319. public bool Puf1IsInstalled
  320. {
  321. get { return m_puf1IsInstalled; }
  322. set { SetProperty(ref m_puf1IsInstalled, value); }
  323. }
  324. public bool Puf2IsInstalled
  325. {
  326. get { return m_puf2IsInstalled; }
  327. set { SetProperty(ref m_puf2IsInstalled, value); }
  328. }
  329. public bool Srd1IsInstalled
  330. {
  331. get { return m_srd1IsInstalled; }
  332. set { SetProperty(ref m_srd1IsInstalled, value); }
  333. }
  334. public bool Srd2IsInstalled
  335. {
  336. get { return m_srd2IsInstalled; }
  337. set { SetProperty(ref m_srd2IsInstalled, value); }
  338. }
  339. public ModuleInfo Puf1ModuleInfo
  340. {
  341. get { return m_puf1ModuleInfo; }
  342. set { SetProperty(ref m_puf1ModuleInfo, value); }
  343. }
  344. public ModuleInfo Puf2ModuleInfo
  345. {
  346. get { return m_puf2ModuleInfo; }
  347. set { SetProperty(ref m_puf2ModuleInfo, value); }
  348. }
  349. public bool Puf1IsInRobotStation
  350. {
  351. get { return m_puf1IsInRobotStation; }
  352. set { SetProperty(ref m_puf1IsInRobotStation, value); }
  353. }
  354. public bool Puf2IsInRobotStation
  355. {
  356. get { return m_puf2IsInRobotStation; }
  357. set { SetProperty(ref m_puf2IsInRobotStation, value); }
  358. }
  359. public bool IsAlignerVacuumOn
  360. {
  361. get { return _isAlignerVacuumOn; }
  362. set { SetProperty(ref _isAlignerVacuumOn, value); }
  363. }
  364. public bool IsRobotVacuumOn
  365. {
  366. get { return _isRobotVacuumOn; }
  367. set { SetProperty(ref _isRobotVacuumOn, value); }
  368. }
  369. public string LP1Status
  370. {
  371. get { return m_LP1Status; }
  372. set { SetProperty(ref m_LP1Status, value); }
  373. }
  374. public string LP2Status
  375. {
  376. get { return m_LP2Status; }
  377. set { SetProperty(ref m_LP2Status, value); }
  378. }
  379. public string LP3Status
  380. {
  381. get { return m_LP3Status; }
  382. set { SetProperty(ref m_LP3Status, value); }
  383. }
  384. public string SetLP1IDValue
  385. {
  386. get { return _setLP1IDValue; }
  387. set { SetProperty(ref _setLP1IDValue, value); }
  388. }
  389. public string SetLP2IDValue
  390. {
  391. get { return _setLP1IDValue; }
  392. set { SetProperty(ref _setLP1IDValue, value); }
  393. }
  394. public string SetLP3IDValue
  395. {
  396. get { return _setLP1IDValue; }
  397. set { SetProperty(ref _setLP1IDValue, value); }
  398. }
  399. public int SetLP1CycleValue
  400. {
  401. get { return _setLP1CycleValue; }
  402. set { SetProperty(ref _setLP1CycleValue, value); }
  403. }
  404. public int SetLP2CycleValue
  405. {
  406. get { return _setLP2CycleValue; }
  407. set { SetProperty(ref _setLP2CycleValue, value); }
  408. }
  409. public int SetLP3CycleValue
  410. {
  411. get { return _setLP3CycleValue; }
  412. set { SetProperty(ref _setLP3CycleValue, value); }
  413. }
  414. public Dictionary<string, object> RtDataValues
  415. {
  416. get { return m_RtDataValues; }
  417. set { SetProperty(ref m_RtDataValues, value); }
  418. }
  419. public int AlignValue
  420. {
  421. get { return m_AlignValue; }
  422. set { SetProperty(ref m_AlignValue, value); }
  423. }
  424. public int RobotSpeedValue
  425. {
  426. get { return m_RobotSpeedValue; }
  427. set { SetProperty(ref m_RobotSpeedValue, value); }
  428. }
  429. public WaferRobotTAction Robot1TAction
  430. {
  431. get { return m_Robot1TAction; }
  432. set { SetProperty(ref m_Robot1TAction, value); }
  433. }
  434. public WaferRobotXAction Robot1XAction
  435. {
  436. get { return m_Robot1XAction; }
  437. set { SetProperty(ref m_Robot1XAction, value); }
  438. }
  439. public WaferRobotTAction Robot2TAction
  440. {
  441. get { return m_Robot2TAction; }
  442. set { SetProperty(ref m_Robot2TAction, value); }
  443. }
  444. public WaferRobotXAction Robot2XAction
  445. {
  446. get { return m_Robot2XAction; }
  447. set { SetProperty(ref m_Robot2XAction, value); }
  448. }
  449. private string m_RobotTarget;
  450. public string RobotTarget
  451. {
  452. get { return m_RobotTarget; }
  453. set
  454. {
  455. SetProperty(ref m_RobotTarget, value);
  456. }
  457. }
  458. public RobotMoveInfo m_robotMoveInfo;
  459. public RobotMoveInfo RobotMoveInfo
  460. {
  461. get { return m_robotMoveInfo; }
  462. set
  463. {
  464. RobotMoveInfoChanged(m_robotMoveInfo, value);
  465. m_robotMoveInfo = value;
  466. }
  467. }
  468. public EFEM.RobotPosition CurrentRobotPosition
  469. {
  470. get { return m_CurrentRobotPosition; }
  471. set { SetProperty(ref m_CurrentRobotPosition, value); }
  472. }
  473. public ModuleInfo Dummy1ModuleInfo
  474. {
  475. get { return _dummy1ModuleInfo; }
  476. set { SetProperty(ref _dummy1ModuleInfo, value); }
  477. }
  478. public ModuleInfo Dummy2ModuleInfo
  479. {
  480. get { return _dummy2ModuleInfo; }
  481. set { SetProperty(ref _dummy2ModuleInfo, value); }
  482. }
  483. public int Dummy1WaferCount
  484. {
  485. get { return m_dummy1WaferCount; }
  486. set { SetProperty(ref m_dummy1WaferCount, value); }
  487. }
  488. public int Dummy2WaferCount
  489. {
  490. get { return m_dummy2WaferCount; }
  491. set { SetProperty(ref m_dummy2WaferCount, value); }
  492. }
  493. public ModuleInfo Srd1ModuleInfo
  494. {
  495. get { return m_srd1ModuleInfo; }
  496. set { SetProperty(ref m_srd1ModuleInfo, value); }
  497. }
  498. public ModuleInfo Srd2ModuleInfo
  499. {
  500. get { return m_srd2ModuleInfo; }
  501. set { SetProperty(ref m_srd2ModuleInfo, value); }
  502. }
  503. public WaferInfo Srd1Wafer
  504. {
  505. get { return m_srd1Wafer; }
  506. set { SetProperty(ref m_srd1Wafer, value); }
  507. }
  508. public WaferInfo Srd2Wafer
  509. {
  510. get { return m_srd2Wafer; }
  511. set { SetProperty(ref m_srd2Wafer, value); }
  512. }
  513. /// <summary>
  514. /// 真空数值
  515. /// </summary>
  516. public double VacuumValue
  517. {
  518. get { return _vacuumValue; }
  519. set { SetProperty(ref _vacuumValue, value); }
  520. }
  521. #endregion
  522. #region 命令
  523. private DelegateCommand _ExtendCommand;
  524. public DelegateCommand ExtendCommand =>
  525. _ExtendCommand ?? (_ExtendCommand = new DelegateCommand(OnExtend));
  526. private DelegateCommand _RetractCommand;
  527. public DelegateCommand RetractCommand =>
  528. _RetractCommand ?? (_RetractCommand = new DelegateCommand(OnRetract));
  529. private DelegateCommand<object> _PUFModuleChangeCommand;
  530. public DelegateCommand<object> PUFModuleChangeCommand =>
  531. _PUFModuleChangeCommand ?? (_PUFModuleChangeCommand = new DelegateCommand<object>(OnPUFModuleChange));
  532. private DelegateCommand<object> _ModuleChangeCommand;
  533. public DelegateCommand<object> ModuleChangeCommand =>
  534. _ModuleChangeCommand ?? (_ModuleChangeCommand = new DelegateCommand<object>(OnModuleChange));
  535. private DelegateCommand _PickCommand;
  536. public DelegateCommand PickCommand =>
  537. _PickCommand ?? (_PickCommand = new DelegateCommand(OnPick));
  538. private DelegateCommand _PlaceCommand;
  539. public DelegateCommand PlaceCommand =>
  540. _PlaceCommand ?? (_PlaceCommand = new DelegateCommand(OnPlace));
  541. private DelegateCommand _BFMapCommand;
  542. public DelegateCommand BFMapCommand =>
  543. _BFMapCommand ?? (_BFMapCommand = new DelegateCommand(OnBFMap));
  544. private DelegateCommand _SetRobotSpeedCommand;
  545. public DelegateCommand SetRobotSpeedCommand =>
  546. _SetRobotSpeedCommand ?? (_SetRobotSpeedCommand = new DelegateCommand(OnSetRobotSpeed));
  547. private DelegateCommand<object> _PUFPickCommand;
  548. public DelegateCommand<object> PUFPickCommand =>
  549. _PUFPickCommand ?? (_PUFPickCommand = new DelegateCommand<object>(OnPUFPick));
  550. private DelegateCommand<object> _PUFPlaceCommand;
  551. public DelegateCommand<object> PUFPlaceCommand =>
  552. _PUFPlaceCommand ?? (_PUFPlaceCommand = new DelegateCommand<object>(OnPUFPlace));
  553. private DelegateCommand _HomeAllCommand;
  554. public DelegateCommand HomeAllCommand =>
  555. _HomeAllCommand ?? (_HomeAllCommand = new DelegateCommand(OnHomeAll));
  556. private DelegateCommand _ClearErrorCommand;
  557. public DelegateCommand ClearErrorCommand =>
  558. _ClearErrorCommand ?? (_ClearErrorCommand = new DelegateCommand(OnClearError));
  559. private DelegateCommand _AbortCommand;
  560. public DelegateCommand AbortCommand =>
  561. _AbortCommand ?? (_AbortCommand = new DelegateCommand(OnAbort));
  562. private DelegateCommand _CloseBuzzerCommand;
  563. public DelegateCommand CloseBuzzerCommand =>
  564. _CloseBuzzerCommand ?? (_CloseBuzzerCommand = new DelegateCommand(OnCloseBuzzer));
  565. private DelegateCommand _Align1HomeCommand;
  566. public DelegateCommand Align1HomeCommand =>
  567. _Align1HomeCommand ?? (_Align1HomeCommand = new DelegateCommand(OnAlign1Home));
  568. private DelegateCommand _Align1AlignCommand;
  569. public DelegateCommand Align1AlignCommand =>
  570. _Align1AlignCommand ?? (_Align1AlignCommand = new DelegateCommand(OnAlign1Align));
  571. private DelegateCommand _RobotHomeCommand;
  572. public DelegateCommand RobotHomeCommand =>
  573. _RobotHomeCommand ?? (_RobotHomeCommand = new DelegateCommand(OnRobotHome));
  574. private DelegateCommand _RobotPowerOnCommand;
  575. public DelegateCommand RobotPowerOnCommand =>
  576. _RobotPowerOnCommand ?? (_RobotPowerOnCommand = new DelegateCommand(RobotPowerOn));
  577. private DelegateCommand _RobotPowerOffCommand;
  578. public DelegateCommand RobotPowerOffCommand =>
  579. _RobotPowerOffCommand ?? (_RobotPowerOffCommand = new DelegateCommand(RobotPowerOff));
  580. private DelegateCommand<object> _LPHomeCommand;
  581. public DelegateCommand<object> LPHomeCommand =>
  582. _LPHomeCommand ?? (_LPHomeCommand = new DelegateCommand<object>(OnLPHome));
  583. private DelegateCommand<object> _LPAbortCommand;
  584. public DelegateCommand<object> LPAbortCommand =>
  585. _LPAbortCommand ?? (_LPAbortCommand = new DelegateCommand<object>(OnLPAbort));
  586. private DelegateCommand<object> _LPResetCommand;
  587. public DelegateCommand<object> LPResetCommand =>
  588. _LPResetCommand ?? (_LPResetCommand = new DelegateCommand<object>(OnLPReset));
  589. private DelegateCommand<object> _LPLoadCommand;
  590. public DelegateCommand<object> LPLoadCommand =>
  591. _LPLoadCommand ?? (_LPLoadCommand = new DelegateCommand<object>(OnLPLoad));
  592. private DelegateCommand<object> _LPUnLoadCommand;
  593. public DelegateCommand<object> LPUnLoadCommand =>
  594. _LPUnLoadCommand ?? (_LPUnLoadCommand = new DelegateCommand<object>(OnLPUnLoad));
  595. private DelegateCommand<object> _LPMapCommand;
  596. public DelegateCommand<object> LPMapCommand =>
  597. _LPMapCommand ?? (_LPMapCommand = new DelegateCommand<object>(OnLPMap));
  598. private DelegateCommand<object> _LPReadIDCommand;
  599. public DelegateCommand<object> LPReadIDCommand =>
  600. _LPReadIDCommand ?? (_LPReadIDCommand = new DelegateCommand<object>(OnLPReadID));
  601. private DelegateCommand<object> _LP1WriteIDCommand;
  602. public DelegateCommand<object> LP1WriteIDCommand =>
  603. _LP1WriteIDCommand ?? (_LP1WriteIDCommand = new DelegateCommand<object>(OnLP1WriteID));
  604. private DelegateCommand<object> _LP2WriteIDCommand;
  605. public DelegateCommand<object> LP2WriteIDCommand =>
  606. _LP2WriteIDCommand ?? (_LP2WriteIDCommand = new DelegateCommand<object>(OnLP2WriteID));
  607. private DelegateCommand<object> _LP3WriteIDCommand;
  608. public DelegateCommand<object> LP3WriteIDCommand =>
  609. _LP3WriteIDCommand ?? (_LP3WriteIDCommand = new DelegateCommand<object>(OnLP3WriteID));
  610. private DelegateCommand<object> _LPClampCommand;
  611. public DelegateCommand<object> LPClampCommand =>
  612. _LPClampCommand ?? (_LPClampCommand = new DelegateCommand<object>(OnLPClamp));
  613. private DelegateCommand<object> _LPUnClampCommand;
  614. public DelegateCommand<object> LPUnClampCommand =>
  615. _LPUnClampCommand ?? (_LPUnClampCommand = new DelegateCommand<object>(OnLPUnClamp));
  616. private DelegateCommand<object> _LPDockCommand;
  617. public DelegateCommand<object> LPDockCommand =>
  618. _LPDockCommand ?? (_LPDockCommand = new DelegateCommand<object>(OnLPDock));
  619. private DelegateCommand<object> _LPUnDockCommand;
  620. public DelegateCommand<object> LPUnDockCommand =>
  621. _LPUnDockCommand ?? (_LPUnDockCommand = new DelegateCommand<object>(OnLPUnDock));
  622. private DelegateCommand<object> _LPOpenDoorCommand;
  623. public DelegateCommand<object> LPOpenDoorCommand =>
  624. _LPOpenDoorCommand ?? (_LPOpenDoorCommand = new DelegateCommand<object>(OnLPOpenDoor));
  625. private DelegateCommand<object> _LPCloseDoorCommand;
  626. public DelegateCommand<object> LPCloseDoorCommand =>
  627. _LPCloseDoorCommand ?? (_LPCloseDoorCommand = new DelegateCommand<object>(OnLPCloseDoor));
  628. private DelegateCommand _OnlineCommand;
  629. public DelegateCommand OnlineCommand =>
  630. _OnlineCommand ?? (_OnlineCommand = new DelegateCommand(OnOnline));
  631. private DelegateCommand _OfflineCommand;
  632. public DelegateCommand OfflineCommand =>
  633. _OfflineCommand ?? (_OfflineCommand = new DelegateCommand(OnOffline));
  634. private DelegateCommand _AlignerVacuumCommand;
  635. public DelegateCommand AlignerVacuumCommand =>
  636. _AlignerVacuumCommand ?? (_AlignerVacuumCommand = new DelegateCommand(AlignerVacuum));
  637. private DelegateCommand _RobotVacuumCommand;
  638. public DelegateCommand RobotVacuumCommand =>
  639. _RobotVacuumCommand ?? (_RobotVacuumCommand = new DelegateCommand(RobotVacuum));
  640. private ICommand _lP1CycleCommand;
  641. public ICommand LP1CycleCommand => _lP1CycleCommand ?? (_lP1CycleCommand = new DelegateCommand<object>(OnLP1CycleAction));
  642. private ICommand _lP2CycleCommand;
  643. public ICommand LP2CycleCommand => _lP2CycleCommand ?? (_lP2CycleCommand = new DelegateCommand<object>(OnLP2CycleAction));
  644. private ICommand _lP3CycleCommand;
  645. public ICommand LP3CycleCommand => _lP3CycleCommand ?? (_lP3CycleCommand = new DelegateCommand<object>(OnLP3CycleAction));
  646. #endregion
  647. #region 构造函数
  648. public EfemViewModel()
  649. {
  650. Dictionary<string, object> allModulesDictionary = QueryDataClient.Instance.Service.PollData(new List<string>() { "System.InstalledModules" });
  651. if (allModulesDictionary != null)
  652. {
  653. List<string> allModules = CommonFunction.GetValue<List<string>>(allModulesDictionary, "System.InstalledModules");
  654. Puf1IsInstalled = allModules.Contains("PUF1");
  655. Puf2IsInstalled = allModules.Contains("PUF2");
  656. Srd1IsInstalled = allModules.Contains("SRD1");
  657. Srd2IsInstalled = allModules.Contains("SRD2");
  658. }
  659. DispatcherTimer timer = new DispatcherTimer();
  660. timer.Interval = TimeSpan.FromSeconds(0.1);
  661. timer.Tick += Timer_Tick;
  662. timer.Start();
  663. EFEMModules.Add(EFEMModule.LP1);
  664. EFEMModules.Add(EFEMModule.LP2);
  665. EFEMModules.Add(EFEMModule.LP3);
  666. EFEMModules.Add(EFEMModule.Aligner1);
  667. EFEMModules.Add(EFEMModule.PUF1);
  668. EFEMModules.Add(EFEMModule.PUF2);
  669. EFEMModules.Add(EFEMModule.SRD1);
  670. EFEMModules.Add(EFEMModule.SRD2);
  671. EFEMModules.Add(EFEMModule.Dummy1);
  672. EFEMModules.Add(EFEMModule.Dummy2);
  673. PUFModules.Add(EFEMModule.PUF1);
  674. PUFModules.Add(EFEMModule.PUF2);
  675. OnModuleChange("Pick");
  676. OnModuleChange("Place");
  677. OnPUFModuleChange("Pick");
  678. OnPUFModuleChange("Place");
  679. Init();
  680. }
  681. #endregion
  682. #region 命令方法
  683. private void OnPUFModuleChange(object obj)
  684. {
  685. var value = obj.ToString();
  686. switch (value)
  687. {
  688. case "Pick":
  689. PUFPickSoltItemsSource.Clear();
  690. switch (PUFPickSelectedModule)
  691. {
  692. case EFEMModule.PUF1:
  693. case EFEMModule.PUF2:
  694. PUFPickSoltItemsSource.Add(1);
  695. PUFPickSoltItemsSource.Add(2);
  696. break;
  697. }
  698. PUFPickSoltSelectedIndex = 0;
  699. break;
  700. case "Place":
  701. PUFPlaceSoltItemsSource.Clear();
  702. switch (PUFPlaceSelectedModule)
  703. {
  704. case EFEMModule.PUF1:
  705. case EFEMModule.PUF2:
  706. PUFPlaceSoltItemsSource.Add(1);
  707. PUFPlaceSoltItemsSource.Add(2);
  708. break;
  709. }
  710. PUFPlaceSoltSelectedIndex = 0;
  711. break;
  712. }
  713. }
  714. private void OnModuleChange(object obj)
  715. {
  716. var value = obj.ToString();
  717. switch (value)
  718. {
  719. case "Pick":
  720. PickSoltItemsSource.Clear();
  721. switch (PickSelectedModule)
  722. {
  723. case EFEMModule.PUF1:
  724. case EFEMModule.PUF2:
  725. PickSoltItemsSource.Add(1);
  726. PickSoltItemsSource.Add(2);
  727. break;
  728. case EFEMModule.Dummy1:
  729. case EFEMModule.Dummy2:
  730. for (int i = 1; i < 17; i++)
  731. {
  732. PickSoltItemsSource.Add(i);
  733. }
  734. break;
  735. case EFEMModule.LP1:
  736. case EFEMModule.LP2:
  737. case EFEMModule.LP3:
  738. for (int i = 1; i < 26; i++)
  739. {
  740. PickSoltItemsSource.Add(i);
  741. }
  742. break;
  743. default:
  744. PickSoltItemsSource.Add(1);
  745. break;
  746. }
  747. PickSoltSelectedIndex = 0;
  748. break;
  749. case "Place":
  750. PlaceSoltItemsSource.Clear();
  751. switch (PlaceSelectedModule)
  752. {
  753. case EFEMModule.PUF1:
  754. case EFEMModule.PUF2:
  755. PlaceSoltItemsSource.Add(1);
  756. PlaceSoltItemsSource.Add(2);
  757. break;
  758. case EFEMModule.Dummy1:
  759. case EFEMModule.Dummy2:
  760. for (int i = 1; i < 17; i++)
  761. {
  762. PlaceSoltItemsSource.Add(i);
  763. }
  764. break;
  765. case EFEMModule.LP1:
  766. case EFEMModule.LP2:
  767. case EFEMModule.LP3:
  768. for (int i = 1; i < 26; i++)
  769. {
  770. PlaceSoltItemsSource.Add(i);
  771. }
  772. break;
  773. default:
  774. PlaceSoltItemsSource.Add(1);
  775. break;
  776. }
  777. PlaceSoltSelectedIndex = 0;
  778. break;
  779. }
  780. }
  781. private void OnExtend()
  782. {
  783. var moduleName = (ModuleName)Enum.Parse(typeof(ModuleName), PlaceSelectedModule.ToString(), true);
  784. var selectedHand = (Hand)Enum.Parse(typeof(Hand), PlaceSelectedBlade.ToString(), true);
  785. InvokeClient.Instance.Service.DoOperation($"EFEM.{RtOperation.Extend}", moduleName, 0, selectedHand);
  786. }
  787. private void OnRetract()
  788. {
  789. var moduleName = (ModuleName)Enum.Parse(typeof(ModuleName), PlaceSelectedModule.ToString(), true);
  790. var selectedHand = (Hand)Enum.Parse(typeof(Hand), PlaceSelectedBlade.ToString(), true);
  791. InvokeClient.Instance.Service.DoOperation($"EFEM.{RtOperation.Retract}", moduleName, 0, selectedHand);
  792. }
  793. private void OnPick()
  794. {
  795. Queue<MoveItem> moveItems = new Queue<MoveItem>();
  796. var moduleName = (ModuleName)Enum.Parse(typeof(ModuleName), PickSelectedModule.ToString(), true);
  797. var selectedHand = (Hand)Enum.Parse(typeof(Hand), PickSelectedBlade.ToString(), true);
  798. MoveItem moveItem = new MoveItem(moduleName, PickSoltItemsSource[PickSoltSelectedIndex]-1, ModuleName.EfemRobot, 0, selectedHand);
  799. moveItems.Enqueue(moveItem);
  800. InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Pick}", moveItems);
  801. }
  802. private void OnPlace()
  803. {
  804. Queue<MoveItem> moveItems = new Queue<MoveItem>();
  805. var moduleName = (ModuleName)Enum.Parse(typeof(ModuleName), PlaceSelectedModule.ToString(), true);
  806. var selectedHand = (Hand)Enum.Parse(typeof(Hand), PlaceSelectedBlade.ToString(), true);
  807. MoveItem moveItem = new MoveItem(ModuleName.EfemRobot, 0, moduleName, PlaceSoltItemsSource[PlaceSoltSelectedIndex]-1, selectedHand);
  808. moveItems.Enqueue(moveItem);
  809. InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Place}", moveItems);
  810. }
  811. private void OnPUFPick(object obj)
  812. {
  813. var moduleName = (ModuleName)Enum.Parse(typeof(ModuleName), PUFPickSelectedModule.ToString(), true);
  814. var PufSlot = PUFPickSoltSelectedIndex == 0 ? "SideA" : "SideB";
  815. InvokeClient.Instance.Service.DoOperation($"{moduleName}.GotoRobotPositionForPick", PufSlot);
  816. }
  817. private void OnPUFPlace(object obj)
  818. {
  819. var moduleName = (ModuleName)Enum.Parse(typeof(ModuleName), PUFPlaceSelectedModule.ToString(), true);
  820. var PufSlot = PUFPlaceSoltSelectedIndex == 0 ? "SideA" : "SideB";
  821. InvokeClient.Instance.Service.DoOperation($"{moduleName}.GotoRobotPositionForPlace", PufSlot);
  822. }
  823. private void OnHomeAll()
  824. {
  825. InvokeClient.Instance.Service.DoOperation($"EFEM.{EfemOperation.Home}");
  826. }
  827. private void OnClearError()
  828. {
  829. InvokeClient.Instance.Service.DoOperation($"EFEM.{EfemOperation.ClearError}");
  830. }
  831. private void OnCloseBuzzer()
  832. {
  833. InvokeClient.Instance.Service.DoOperation($"EFEM.{EfemOperation.TurnOffBuzzer}");
  834. }
  835. private void OnAbort()
  836. {
  837. InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Abort}");
  838. }
  839. private void OnAlign1Home()
  840. {
  841. InvokeClient.Instance.Service.DoOperation($"{ModuleName.Aligner1}.{EfemOperation.Home}");
  842. }
  843. private void OnAlign1Align()
  844. {
  845. InvokeClient.Instance.Service.DoOperation($"{ModuleName.Aligner1}.{EfemOperation.Align}",0, AlignValue);
  846. }
  847. private void AlignerVacuum()
  848. {
  849. InvokeClient.Instance.Service.DoOperation($"{ModuleName.Aligner1}.{EfemOperation.Vacuum}", ModuleName.Aligner1,IsAlignerVacuumOn);
  850. }
  851. private void RobotVacuum()
  852. {
  853. InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Vacuum}", ModuleName.EfemRobot, IsRobotVacuumOn);
  854. }
  855. private void OnRobotHome()
  856. {
  857. InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Home}");
  858. }
  859. private void RobotPowerOn()
  860. {
  861. InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.PowerOn}", true);
  862. }
  863. private void RobotPowerOff()
  864. {
  865. InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.PowerOn}", false);
  866. }
  867. private void OnBFMap()
  868. {
  869. InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.DummyMap}");
  870. }
  871. private void OnSetRobotSpeed()
  872. {
  873. InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Speed}", RobotSpeedValue);
  874. }
  875. private void OnLPHome(object obj)
  876. {
  877. InvokeClient.Instance.Service.DoOperation($"{obj.ToString()}.Home");
  878. }
  879. private void OnLPAbort(object obj)
  880. {
  881. InvokeClient.Instance.Service.DoOperation($"{obj.ToString()}.Abort");
  882. }
  883. private void OnLPReset(object obj)
  884. {
  885. //InvokeClient.Instance.Service.DoOperation($"{obj.ToString()}.ReSet");
  886. }
  887. private void OnLPLoad(object obj)
  888. {
  889. InvokeClient.Instance.Service.DoOperation($"{obj.ToString()}.Load");
  890. }
  891. private void OnLPUnLoad(object obj)
  892. {
  893. InvokeClient.Instance.Service.DoOperation($"{obj.ToString()}.Unload");
  894. }
  895. private void OnLPMap(object obj)
  896. {
  897. InvokeClient.Instance.Service.DoOperation($"{obj.ToString()}.Map");
  898. }
  899. private void OnLPReadID(object obj)
  900. {
  901. InvokeClient.Instance.Service.DoOperation($"{obj.ToString()}.ReadCarrierId");
  902. }
  903. private void OnLP1WriteID(object obj)
  904. {
  905. InvokeClient.Instance.Service.DoOperation($"{obj.ToString()}.WriteCarrierID", SetLP1IDValue);
  906. }
  907. private void OnLP2WriteID(object obj)
  908. {
  909. InvokeClient.Instance.Service.DoOperation($"{obj.ToString()}.WriteCarrierID", SetLP2IDValue);
  910. }
  911. private void OnLP3WriteID(object obj)
  912. {
  913. InvokeClient.Instance.Service.DoOperation($"{obj.ToString()}.WriteCarrierID", SetLP3IDValue);
  914. }
  915. private void OnLPClamp(object obj)
  916. {
  917. InvokeClient.Instance.Service.DoOperation($"{obj.ToString()}.Clamp");
  918. }
  919. private void OnLPUnClamp(object obj)
  920. {
  921. InvokeClient.Instance.Service.DoOperation($"{obj.ToString()}.Unclamp");
  922. }
  923. private void OnLPDock(object obj)
  924. {
  925. InvokeClient.Instance.Service.DoOperation($"{obj.ToString()}.Dock");
  926. }
  927. private void OnLPUnDock(object obj)
  928. {
  929. InvokeClient.Instance.Service.DoOperation($"{obj.ToString()}.Undock");
  930. }
  931. private void OnLPOpenDoor(object obj)
  932. {
  933. InvokeClient.Instance.Service.DoOperation($"{obj.ToString()}.OpenDoor");
  934. }
  935. private void OnLPCloseDoor(object obj)
  936. {
  937. InvokeClient.Instance.Service.DoOperation($"{obj.ToString()}.CloseDoor");
  938. }
  939. private void OnOnline()
  940. {
  941. InvokeClient.Instance.Service.DoOperation($"{ModuleName.EFEM}.Online",true);
  942. }
  943. private void OnOffline()
  944. {
  945. InvokeClient.Instance.Service.DoOperation($"{ModuleName.EFEM}.Online", false);
  946. }
  947. private void OnLP1CycleAction(object obj)
  948. {
  949. InvokeClient.Instance.Service.DoOperation($"{obj.ToString()}.CycleLoadUnload", SetLP1CycleValue);
  950. }
  951. private void OnLP2CycleAction(object obj)
  952. {
  953. InvokeClient.Instance.Service.DoOperation($"{obj.ToString()}.CycleLoadUnload", SetLP2CycleValue);
  954. }
  955. private void OnLP3CycleAction(object obj)
  956. {
  957. InvokeClient.Instance.Service.DoOperation($"{obj.ToString()}.CycleLoadUnload", SetLP3CycleValue);
  958. }
  959. #endregion
  960. #region 私有方法
  961. private void Timer_Tick(object sender, EventArgs e)
  962. {
  963. if (Puf1IsInstalled)
  964. {
  965. if (ModuleManager.ModuleInfos["PUF1"].WaferManager.Wafers.Count != 0)
  966. {
  967. Puf1Wafer = ModuleManager.ModuleInfos["PUF1"].WaferManager.Wafers[0];
  968. }
  969. Puf1ModuleInfo = ModuleManager.ModuleInfos["PUF1"];
  970. }
  971. if (Puf2IsInstalled)
  972. {
  973. if (ModuleManager.ModuleInfos["PUF2"].WaferManager.Wafers.Count != 0)
  974. {
  975. Puf2Wafer = ModuleManager.ModuleInfos["PUF2"].WaferManager.Wafers[0];
  976. }
  977. Puf2ModuleInfo = ModuleManager.ModuleInfos["PUF2"];
  978. }
  979. if (Srd1IsInstalled)
  980. {
  981. if (ModuleManager.ModuleInfos["SRD1"].WaferManager.Wafers.Count != 0)
  982. {
  983. Srd1Wafer = ModuleManager.ModuleInfos["SRD1"].WaferManager.Wafers[0];
  984. }
  985. Srd1ModuleInfo = ModuleManager.ModuleInfos["SRD1"];
  986. }
  987. if (Srd2IsInstalled)
  988. {
  989. if (ModuleManager.ModuleInfos["SRD2"].WaferManager.Wafers.Count != 0)
  990. {
  991. Srd2Wafer = ModuleManager.ModuleInfos["SRD2"].WaferManager.Wafers[0];
  992. }
  993. Srd2ModuleInfo = ModuleManager.ModuleInfos["SRD2"];
  994. }
  995. LP1ModuleInfo = ModuleManager.ModuleInfos["LP1"];
  996. LP2ModuleInfo = ModuleManager.ModuleInfos["LP2"];
  997. LP3ModuleInfo = ModuleManager.ModuleInfos["LP3"];
  998. EFEMModuleInfo = ModuleManager.ModuleInfos["EfemRobot"];
  999. if (ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers.Count != 0)
  1000. {
  1001. BladeAWafer = ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[0];
  1002. }
  1003. if (ModuleManager.ModuleInfos["Aligner1"].WaferManager.Wafers.Count != 0)
  1004. {
  1005. Aligner1Wafer = ModuleManager.ModuleInfos["Aligner1"].WaferManager.Wafers[0];
  1006. }
  1007. RtDataValues = QueryDataClient.Instance.Service.PollData(m_RtDataKeys);
  1008. if(RtDataValues!=null)
  1009. {
  1010. IsHomeAllEnable = !CommonFunction.GetValue<bool>(RtDataValues, "System.IsAutoMode");
  1011. Puf1IsInRobotStation = CommonFunction.GetValue<bool>(RtDataValues, "PUF1.IsInRobotStation");
  1012. Puf2IsInRobotStation = CommonFunction.GetValue<bool>(RtDataValues, "PUF2.IsInRobotStation");
  1013. ControlJobInfo lp1Cj = CommonFunction.GetValue<ControlJobInfo>(RtDataValues, "LP1.CurrentControlJob");
  1014. IsLP1HasNoJob = lp1Cj == null ? true : false;
  1015. ControlJobInfo lp2Cj = CommonFunction.GetValue<ControlJobInfo>(RtDataValues, "LP2.CurrentControlJob");
  1016. IsLP2HasNoJob = lp2Cj == null ? true : false;
  1017. ControlJobInfo lp3Cj = CommonFunction.GetValue<ControlJobInfo>(RtDataValues, "LP3.CurrentControlJob");
  1018. IsLP3HasNoJob = lp3Cj == null ? true : false;
  1019. VacuumValue = CommonFunction.GetValue<double>(RtDataValues, "EFEM.VacuumValue");
  1020. }
  1021. RobotMoveInfo = (RobotMoveInfo)QueryDataClient.Instance.Service.GetData("EFEM.RobotMoveAction");
  1022. Dummy1ModuleInfo = ModuleManager.ModuleInfos["Dummy1"];
  1023. Dummy1WaferCount = Dummy1ModuleInfo.WaferManager.Wafers.Where(x => x.WaferStatus != 0).Count();
  1024. Dummy2ModuleInfo = ModuleManager.ModuleInfos["Dummy2"];
  1025. Dummy2WaferCount = Dummy2ModuleInfo.WaferManager.Wafers.Where(x => x.WaferStatus != 0).Count();
  1026. IsLP1Unable = (bool)QueryDataClient.Instance.Service.GetConfig("EFEM.IsLoadPort1Unable");
  1027. IsLP2Unable = (bool)QueryDataClient.Instance.Service.GetConfig("EFEM.IsLoadPort2Unable");
  1028. IsLP3Unable = (bool)QueryDataClient.Instance.Service.GetConfig("EFEM.IsLoadPort3Unable");
  1029. }
  1030. private void Init()
  1031. {
  1032. m_RtDataKeys.Add("System.IsAutoMode");
  1033. m_RtDataKeys.Add("LP1.Status");
  1034. m_RtDataKeys.Add("LP2.Status");
  1035. m_RtDataKeys.Add("LP3.Status");
  1036. m_RtDataKeys.Add("LP1.IsLoaded");
  1037. m_RtDataKeys.Add("LP2.IsLoaded");
  1038. m_RtDataKeys.Add("LP3.IsLoaded");
  1039. m_RtDataKeys.Add("LP1.CarrierId");
  1040. m_RtDataKeys.Add("LP2.CarrierId");
  1041. m_RtDataKeys.Add("LP3.CarrierId");
  1042. m_RtDataKeys.Add("LP1.IsClamped");
  1043. m_RtDataKeys.Add("LP2.IsClamped");
  1044. m_RtDataKeys.Add("LP3.IsClamped");
  1045. m_RtDataKeys.Add("LP1.IsDocked");
  1046. m_RtDataKeys.Add("LP2.IsDocked");
  1047. m_RtDataKeys.Add("LP3.IsDocked");
  1048. m_RtDataKeys.Add("LP1.IsDoorOpened");
  1049. m_RtDataKeys.Add("LP2.IsDoorOpened");
  1050. m_RtDataKeys.Add("LP3.IsDoorOpened");
  1051. m_RtDataKeys.Add("TM.LLATSlitDoor.IsClosed");
  1052. m_RtDataKeys.Add("TM.LLBTSlitDoor.IsClosed");
  1053. m_RtDataKeys.Add("TM.LLAESlitDoor.IsClosed");
  1054. m_RtDataKeys.Add("TM.LLBESlitDoor.IsClosed");
  1055. m_RtDataKeys.Add("LP1.CassettePlaced");
  1056. m_RtDataKeys.Add("LP2.CassettePlaced");
  1057. m_RtDataKeys.Add("LP3.CassettePlaced");
  1058. m_RtDataKeys.Add("Dummy1.CassettePlaced");
  1059. m_RtDataKeys.Add("Dummy2.CassettePlaced");
  1060. m_RtDataKeys.Add("PUF1.IsInRobotStation");
  1061. m_RtDataKeys.Add("PUF2.IsInRobotStation");
  1062. m_RtDataKeys.Add("LP1.CurrentControlJob");
  1063. m_RtDataKeys.Add("LP2.CurrentControlJob");
  1064. m_RtDataKeys.Add("LP3.CurrentControlJob");
  1065. m_RtDataKeys.Add("LP1.WaferSize");
  1066. m_RtDataKeys.Add("LP2.WaferSize");
  1067. m_RtDataKeys.Add("LP3.WaferSize");
  1068. m_RtDataKeys.Add("Dummy1.WaferSize");
  1069. m_RtDataKeys.Add("Dummy2.WaferSize");
  1070. m_RtDataKeys.Add("EFEM.VacuumValue");
  1071. }
  1072. /// <summary>
  1073. /// Robot位置信息变更(动画)
  1074. /// </summary>
  1075. /// <param name="oldValue"></param>
  1076. /// <param name="newValue"></param>
  1077. private async void RobotMoveInfoChanged(RobotMoveInfo oldValue, RobotMoveInfo newValue)
  1078. {
  1079. if (oldValue == null || newValue == null)
  1080. {
  1081. return;
  1082. }
  1083. if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && (newValue.Action == RobotAction.Placing || newValue.Action == RobotAction.Picking))
  1084. {
  1085. var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
  1086. if (TMRobotMoveActionBladeTarget != null)
  1087. {
  1088. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  1089. }
  1090. else
  1091. {
  1092. return;
  1093. }
  1094. var values = RobotTarget.Split('.');
  1095. var arm = values[0];
  1096. var module = values[1];
  1097. if (arm == "ArmA")
  1098. {
  1099. var robot1Robot1TAction= (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  1100. //Robot整体平移动画
  1101. await ChangePosition(robot1Robot1TAction, newValue.Action);
  1102. if (Robot1TAction != robot1Robot1TAction)
  1103. {
  1104. Robot1TAction = robot1Robot1TAction;
  1105. await Task.Delay(600);
  1106. }
  1107. //await Task.Delay(1500);
  1108. Robot1XAction = WaferRobotXAction.Extend;
  1109. while ((newValue.Action == RobotAction.Placing && ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[0].WaferStatus != 0) || (newValue.Action == RobotAction.Picking && ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[0].WaferStatus == 0))
  1110. {
  1111. await Task.Delay(100);
  1112. }
  1113. Robot1XAction = WaferRobotXAction.Retract;
  1114. if(newValue.Action == RobotAction.Placing)
  1115. {
  1116. await ChangePosition(WaferRobotTAction.T_Origin, newValue.Action);
  1117. }
  1118. }
  1119. }
  1120. #region Home
  1121. else if (oldValue.Action == RobotAction.None && newValue.Action == RobotAction.Homing)
  1122. {
  1123. if (Robot1XAction == WaferRobotXAction.Extend||Robot2XAction == WaferRobotXAction.Extend2)
  1124. {
  1125. Robot1XAction = WaferRobotXAction.Retract2;
  1126. }
  1127. if (Robot2XAction == WaferRobotXAction.Extend|| Robot2XAction == WaferRobotXAction.Extend2)
  1128. {
  1129. Robot2XAction = WaferRobotXAction.Retract2;
  1130. }
  1131. await Task.Delay(2000);
  1132. if (Robot1TAction != WaferRobotTAction.T_Origin)
  1133. {
  1134. Robot1TAction = WaferRobotTAction.T_Origin;
  1135. }
  1136. if (Robot2TAction != WaferRobotTAction.T_Origin)
  1137. {
  1138. Robot2TAction = WaferRobotTAction.T_Origin;
  1139. }
  1140. if (CurrentRobotPosition != EFEM.RobotPosition.Origin)
  1141. {
  1142. CurrentRobotPosition = EFEM.RobotPosition.Origin;
  1143. }
  1144. await ChangePosition(WaferRobotTAction.T_Origin, newValue.Action);
  1145. }
  1146. #endregion
  1147. }
  1148. private async Task ChangePosition(WaferRobotTAction waferRobotTAction, RobotAction robotAction)
  1149. {
  1150. //CurrentRobotPosition = RobotPosition.Origin;
  1151. //await Task.Delay(1000);
  1152. if(robotAction == RobotAction.Placing)
  1153. {
  1154. if (waferRobotTAction == WaferRobotTAction.LP1 || waferRobotTAction == WaferRobotTAction.PUF1)
  1155. {
  1156. CurrentRobotPosition = EFEM.RobotPosition.Left_Place;
  1157. }
  1158. else if (waferRobotTAction == WaferRobotTAction.LP3)
  1159. {
  1160. CurrentRobotPosition = EFEM.RobotPosition.Right_Place;
  1161. }
  1162. else if (waferRobotTAction == WaferRobotTAction.LP2 || waferRobotTAction == WaferRobotTAction.PUF2)
  1163. {
  1164. CurrentRobotPosition = EFEM.RobotPosition.Middle_Place;
  1165. }
  1166. else if (waferRobotTAction == WaferRobotTAction.Aligner1)
  1167. {
  1168. CurrentRobotPosition = EFEM.RobotPosition.Aligner_Place;
  1169. }
  1170. else if (waferRobotTAction == WaferRobotTAction.SRD1 || waferRobotTAction == WaferRobotTAction.SRD2)
  1171. {
  1172. CurrentRobotPosition = EFEM.RobotPosition.SRD_Place;
  1173. }
  1174. else if (waferRobotTAction == WaferRobotTAction.Dummy1 || waferRobotTAction == WaferRobotTAction.Dummy2)
  1175. {
  1176. CurrentRobotPosition = EFEM.RobotPosition.Dummy_Place;
  1177. }
  1178. else
  1179. {
  1180. CurrentRobotPosition = EFEM.RobotPosition.Origin;
  1181. }
  1182. }
  1183. else
  1184. {
  1185. if (waferRobotTAction == WaferRobotTAction.LP1 || waferRobotTAction == WaferRobotTAction.PUF1)
  1186. {
  1187. CurrentRobotPosition = EFEM.RobotPosition.Left;
  1188. }
  1189. else if (waferRobotTAction == WaferRobotTAction.LP3)
  1190. {
  1191. CurrentRobotPosition = EFEM.RobotPosition.Right;
  1192. }
  1193. else if (waferRobotTAction == WaferRobotTAction.LP2 || waferRobotTAction == WaferRobotTAction.PUF2)
  1194. {
  1195. CurrentRobotPosition = EFEM.RobotPosition.Middle;
  1196. }
  1197. else if (waferRobotTAction == WaferRobotTAction.Aligner1)
  1198. {
  1199. CurrentRobotPosition = EFEM.RobotPosition.Aligner;
  1200. }
  1201. else if (waferRobotTAction == WaferRobotTAction.SRD1 || waferRobotTAction == WaferRobotTAction.SRD2)
  1202. {
  1203. CurrentRobotPosition = EFEM.RobotPosition.SRD;
  1204. }
  1205. else if (waferRobotTAction == WaferRobotTAction.Dummy1 || waferRobotTAction == WaferRobotTAction.Dummy2)
  1206. {
  1207. CurrentRobotPosition = EFEM.RobotPosition.Dummy;
  1208. }
  1209. else
  1210. {
  1211. CurrentRobotPosition = EFEM.RobotPosition.Origin;
  1212. }
  1213. }
  1214. await Task.Delay(600);
  1215. }
  1216. #endregion
  1217. }
  1218. }