OperationOverViewModel.cs 56 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477
  1. using Aitex.Core.RT.Log;
  2. using MECF.Framework.Common.CommonData;
  3. using MECF.Framework.Common.DataCenter;
  4. using MECF.Framework.Common.Equipment;
  5. using MECF.Framework.Common.Jobs;
  6. using MECF.Framework.Common.OperationCenter;
  7. using OpenSEMI.ClientBase;
  8. using Prism.Commands;
  9. using Prism.Mvvm;
  10. using System;
  11. using System.Collections.Generic;
  12. using System.Linq;
  13. using System.Threading.Tasks;
  14. using System.Windows;
  15. using System.Windows.Threading;
  16. using Venus_Core;
  17. using Venus_MainPages.Unity;
  18. using Venus_MainPages.Views;
  19. using Venus_Themes.CustomControls;
  20. using static Venus_Core.NiceRobotAction;
  21. using static Venus_Themes.UserControls.EFEM;
  22. namespace Venus_MainPages.ViewModels
  23. {
  24. public class OperationOverViewModel : BindableBase
  25. {
  26. #region 私有字段
  27. private bool m_TabIsChecked = true;
  28. private ModuleInfo m_LP1ModuleInfo;
  29. private ModuleInfo m_LP2ModuleInfo;
  30. private ModuleInfo m_LLAModuleInfo;
  31. private ModuleInfo m_LLBModuleInfo;
  32. private ModuleInfo m_LP3ModuleInfo;
  33. private ModuleInfo m_EFEMModuleInfo;
  34. private ModuleInfo m_TMModuleInfo;
  35. private WaferRobotTAction m_Robot1TAction;
  36. private WaferRobotXAction m_Robot1XAction;
  37. private WaferRobotTAction m_Robot2TAction;
  38. private WaferRobotXAction m_Robot2XAction;
  39. private WaferRobotTAction m_Robot3TAction;
  40. private WaferRobotXAction m_Robot3XAction;
  41. private WaferRobotTAction m_Robot4TAction;
  42. private WaferRobotXAction m_Robot4XAction;
  43. private NiceGuangChuanWaferRobotTAction m_BladeNiceGuangChuanWaferRobotTAction;
  44. //private NiceGuangChuanWaferRobotTAction m_Blade2NiceGuangChuanWaferRobotTAction;
  45. private NiceGuangChuanWaferRobotXAction m_Blade1NiceGuangChuanWaferRobotXAction = NiceGuangChuanWaferRobotXAction.Retract1;
  46. private NiceGuangChuanWaferRobotXAction m_Blade2NiceGuangChuanWaferRobotXAction = NiceGuangChuanWaferRobotXAction.Retract2;
  47. private NiceXinSongWaferRobotTAction m_BladeNiceXinSongWaferRobotTAction;
  48. //private NiceXinSongWaferRobotTAction m_Blade2NiceXinSongWaferRobotTAction;
  49. private NiceXinSongWaferRobotXAction m_Blade1NiceXinSongWaferRobotXAction;
  50. private NiceXinSongWaferRobotXAction m_Blade2NiceXinSongWaferRobotXAction;
  51. private RobotMoveInfo m_robotMoveInfo;
  52. private WaferInfo m_PMAWafer;
  53. private WaferInfo m_PMBWafer;
  54. private WaferInfo m_PMCWafer;
  55. private WaferInfo m_PMDWafer;
  56. private WaferInfo m_LLAWafer;
  57. private WaferInfo m_LLBWafer;
  58. private WaferInfo m_TMBladeAWafer;
  59. private WaferInfo m_TMBladeBWafer;
  60. private List<string> m_RtDataKeys = new List<string>();
  61. private Dictionary<string, object> m_RtDataValues;
  62. private bool m_PMAIsInstalled;
  63. private bool m_PMBIsInstalled;
  64. private bool m_PMCIsInstalled;
  65. private bool m_PMDIsInstalled;
  66. private bool m_LLAIsInstalled;
  67. private bool m_LLBIsInstalled;
  68. private bool m_TMIsInstalled;
  69. private bool m_EFEMIsInstalled;
  70. private bool m_ButtonIsEnableLP1;
  71. private bool m_ButtonIsEnableLP2;
  72. private bool m_ButtonIsEnableLP3;
  73. private WaferInfo m_EFEMBladeAWafer;
  74. private WaferInfo m_EFEMBladeBWafer;
  75. private WaferInfo m_Aligner1Wafer;
  76. private int m_LP1WaferCount;
  77. private int m_LP2WaferCount;
  78. private int m_LP3WaferCount;
  79. private WaferAssociationInfo _lp1WaferAssociation;
  80. private WaferAssociationInfo _lp2WaferAssociation;
  81. private WaferAssociationInfo _lp3WaferAssociation;
  82. private int m_CycledWafer;
  83. private int m_CycleCountDisplay;
  84. private RobotPosition m_CurrentRobotPosition;
  85. private WaferInfo m_BladeAWafer;
  86. private WaferInfo m_BladeBWafer;
  87. private RecipeResult m_PMARecipeResult;
  88. private RecipeResult m_PMBRecipeResult;
  89. private RecipeResult m_PMCRecipeResult;
  90. private RecipeResult m_PMDRecipeResult;
  91. private bool m_ATMModeIsOn;
  92. private float m_TMPressure;
  93. private string m_RouteState;
  94. private PressureType m_PressureType;
  95. DispatcherTimer timer;
  96. private string m_PMAChamberType;
  97. private string m_PMBChamberType;
  98. private string m_PMCChamberType;
  99. private string m_PMDChamberType;
  100. #endregion
  101. #region 属性
  102. public string PMAChamberType
  103. {
  104. get { return m_PMAChamberType; }
  105. set { SetProperty(ref m_PMAChamberType, value); }
  106. }
  107. public string PMBChamberType
  108. {
  109. get { return m_PMBChamberType; }
  110. set { SetProperty(ref m_PMBChamberType, value); }
  111. }
  112. public string PMCChamberType
  113. {
  114. get { return m_PMCChamberType; }
  115. set { SetProperty(ref m_PMCChamberType, value); }
  116. }
  117. public PressureType PressureType
  118. {
  119. get { return m_PressureType; }
  120. set { SetProperty(ref m_PressureType, value); }
  121. }
  122. public string PMDChamberType
  123. {
  124. get { return m_PMDChamberType; }
  125. set { SetProperty(ref m_PMDChamberType, value); }
  126. }
  127. public bool TabIsChecked
  128. {
  129. get { return m_TabIsChecked; }
  130. set { SetProperty(ref m_TabIsChecked, value); }
  131. }
  132. public ModuleInfo LP1ModuleInfo
  133. {
  134. get { return m_LP1ModuleInfo; }
  135. set { SetProperty(ref m_LP1ModuleInfo, value); }
  136. }
  137. public ModuleInfo LLAModuleInfo
  138. {
  139. get { return m_LLAModuleInfo; }
  140. set { SetProperty(ref m_LLAModuleInfo, value); }
  141. }
  142. public ModuleInfo LLBModuleInfo
  143. {
  144. get { return m_LLBModuleInfo; }
  145. set { SetProperty(ref m_LLBModuleInfo, value); }
  146. }
  147. public ModuleInfo EFEMModuleInfo
  148. {
  149. get { return m_EFEMModuleInfo; }
  150. set { SetProperty(ref m_EFEMModuleInfo, value); }
  151. }
  152. public ModuleInfo TMModuleInfo
  153. {
  154. get { return m_TMModuleInfo; }
  155. set { SetProperty(ref m_TMModuleInfo, value); }
  156. }
  157. public ModuleInfo LP2ModuleInfo
  158. {
  159. get { return m_LP2ModuleInfo; }
  160. set { SetProperty(ref m_LP2ModuleInfo, value); }
  161. }
  162. public ModuleInfo LP3ModuleInfo
  163. {
  164. get { return m_LP3ModuleInfo; }
  165. set { SetProperty(ref m_LP3ModuleInfo, value); }
  166. }
  167. public WaferRobotTAction Robot1TAction
  168. {
  169. get { return m_Robot1TAction; }
  170. set { SetProperty(ref m_Robot1TAction, value); }
  171. }
  172. public WaferRobotXAction Robot1XAction
  173. {
  174. get { return m_Robot1XAction; }
  175. set { SetProperty(ref m_Robot1XAction, value); }
  176. }
  177. public WaferRobotTAction Robot2TAction
  178. {
  179. get { return m_Robot2TAction; }
  180. set { SetProperty(ref m_Robot2TAction, value); }
  181. }
  182. public WaferRobotXAction Robot2XAction
  183. {
  184. get { return m_Robot2XAction; }
  185. set { SetProperty(ref m_Robot2XAction, value); }
  186. }
  187. public WaferRobotTAction Robot3TAction
  188. {
  189. get { return m_Robot3TAction; }
  190. set { SetProperty(ref m_Robot3TAction, value); }
  191. }
  192. public WaferRobotXAction Robot3XAction
  193. {
  194. get { return m_Robot3XAction; }
  195. set { SetProperty(ref m_Robot3XAction, value); }
  196. }
  197. public WaferRobotTAction Robot4TAction
  198. {
  199. get { return m_Robot4TAction; }
  200. set { SetProperty(ref m_Robot4TAction, value); }
  201. }
  202. public WaferRobotXAction Robot4XAction
  203. {
  204. get { return m_Robot4XAction; }
  205. set { SetProperty(ref m_Robot4XAction, value); }
  206. }
  207. public RobotMoveInfo RobotMoveInfo
  208. {
  209. get { return m_robotMoveInfo; }
  210. set
  211. {
  212. TMRobotMoveInfoChanged(m_robotMoveInfo, value);
  213. //m_robotMoveInfo = value;
  214. SetProperty(ref m_robotMoveInfo, value);
  215. }
  216. }
  217. public NiceGuangChuanWaferRobotTAction BladeNiceGuangChuanWaferRobotTAction
  218. {
  219. get { return m_BladeNiceGuangChuanWaferRobotTAction; }
  220. set
  221. {
  222. SetProperty(ref m_BladeNiceGuangChuanWaferRobotTAction, value);
  223. }
  224. }
  225. //public NiceGuangChuanWaferRobotTAction Blade2NiceGuangChuanWaferRobotTAction
  226. //{
  227. // get { return m_Blade2NiceGuangChuanWaferRobotTAction; }
  228. // set
  229. // {
  230. // SetProperty(ref m_Blade2NiceGuangChuanWaferRobotTAction, value);
  231. // }
  232. //}
  233. public NiceGuangChuanWaferRobotXAction Blade1NiceGuangChuanWaferRobotXAction
  234. {
  235. get { return m_Blade1NiceGuangChuanWaferRobotXAction; }
  236. set
  237. {
  238. SetProperty(ref m_Blade1NiceGuangChuanWaferRobotXAction, value);
  239. }
  240. }
  241. public NiceGuangChuanWaferRobotXAction Blade2NiceGuangChuanWaferRobotXAction
  242. {
  243. get { return m_Blade2NiceGuangChuanWaferRobotXAction; }
  244. set
  245. {
  246. SetProperty(ref m_Blade2NiceGuangChuanWaferRobotXAction, value);
  247. }
  248. }
  249. public NiceXinSongWaferRobotTAction BladeNiceXinSongWaferRobotTAction
  250. {
  251. get { return m_BladeNiceXinSongWaferRobotTAction; }
  252. set
  253. {
  254. SetProperty(ref m_BladeNiceXinSongWaferRobotTAction, value);
  255. }
  256. }
  257. //public NiceXinSongWaferRobotTAction Blade2NiceXinSongWaferRobotTAction
  258. //{
  259. // get { return m_Blade2NiceXinSongWaferRobotTAction; }
  260. // set
  261. // {
  262. // SetProperty(ref m_Blade2NiceXinSongWaferRobotTAction, value);
  263. // }
  264. //}
  265. public NiceXinSongWaferRobotXAction Blade1NiceXinSongWaferRobotXAction
  266. {
  267. get { return m_Blade1NiceXinSongWaferRobotXAction; }
  268. set
  269. {
  270. SetProperty(ref m_Blade1NiceXinSongWaferRobotXAction, value);
  271. }
  272. }
  273. public NiceXinSongWaferRobotXAction Blade2NiceXinSongWaferRobotXAction
  274. {
  275. get { return m_Blade2NiceXinSongWaferRobotXAction; }
  276. set
  277. {
  278. SetProperty(ref m_Blade2NiceXinSongWaferRobotXAction, value);
  279. }
  280. }
  281. public WaferInfo LLAWafer
  282. {
  283. get { return m_LLAWafer; }
  284. set { SetProperty(ref m_LLAWafer, value); }
  285. }
  286. public WaferInfo LLBWafer
  287. {
  288. get { return m_LLBWafer; }
  289. set { SetProperty(ref m_LLBWafer, value); }
  290. }
  291. public WaferInfo PMAWafer
  292. {
  293. get { return m_PMAWafer; }
  294. set { SetProperty(ref m_PMAWafer, value); }
  295. }
  296. public WaferInfo PMBWafer
  297. {
  298. get { return m_PMBWafer; }
  299. set { SetProperty(ref m_PMBWafer, value); }
  300. }
  301. public WaferInfo PMCWafer
  302. {
  303. get { return m_PMCWafer; }
  304. set { SetProperty(ref m_PMCWafer, value); }
  305. }
  306. public WaferInfo PMDWafer
  307. {
  308. get { return m_PMDWafer; }
  309. set { SetProperty(ref m_PMDWafer, value); }
  310. }
  311. public WaferInfo TMBladeAWafer
  312. {
  313. get { return m_TMBladeAWafer; }
  314. set { SetProperty(ref m_TMBladeAWafer, value); }
  315. }
  316. public WaferInfo TMBladeBWafer
  317. {
  318. get { return m_TMBladeBWafer; }
  319. set { SetProperty(ref m_TMBladeBWafer, value); }
  320. }
  321. public Dictionary<string, object> RtDataValues
  322. {
  323. get { return m_RtDataValues; }
  324. set { SetProperty(ref m_RtDataValues, value); }
  325. }
  326. public bool PMAIsInstalled
  327. {
  328. get { return m_PMAIsInstalled; }
  329. set { SetProperty(ref m_PMAIsInstalled, value); }
  330. }
  331. public bool PMBIsInstalled
  332. {
  333. get { return m_PMBIsInstalled; }
  334. set { SetProperty(ref m_PMBIsInstalled, value); }
  335. }
  336. public bool PMCIsInstalled
  337. {
  338. get { return m_PMCIsInstalled; }
  339. set { SetProperty(ref m_PMCIsInstalled, value); }
  340. }
  341. public bool PMDIsInstalled
  342. {
  343. get { return m_PMDIsInstalled; }
  344. set { SetProperty(ref m_PMDIsInstalled, value); }
  345. }
  346. public bool LLAIsInstalled
  347. {
  348. get { return m_LLAIsInstalled; }
  349. set { SetProperty(ref m_LLAIsInstalled, value); }
  350. }
  351. public bool LLBIsInstalled
  352. {
  353. get { return m_LLBIsInstalled; }
  354. set { SetProperty(ref m_LLBIsInstalled, value); }
  355. }
  356. public bool TMIsInstalled
  357. {
  358. get { return m_TMIsInstalled; }
  359. set { SetProperty(ref m_TMIsInstalled, value); }
  360. }
  361. public bool EFEMIsInstalled
  362. {
  363. get { return m_EFEMIsInstalled; }
  364. set { SetProperty(ref m_EFEMIsInstalled, value); }
  365. }
  366. public bool ButtonIsEnableLP1
  367. {
  368. get { return m_ButtonIsEnableLP1; }
  369. set { SetProperty(ref m_ButtonIsEnableLP1, value); }
  370. }
  371. public bool ButtonIsEnableLP2
  372. {
  373. get { return m_ButtonIsEnableLP2; }
  374. set { SetProperty(ref m_ButtonIsEnableLP2, value); }
  375. }
  376. public bool ButtonIsEnableLP3
  377. {
  378. get { return m_ButtonIsEnableLP3; }
  379. set { SetProperty(ref m_ButtonIsEnableLP3, value); }
  380. }
  381. public WaferInfo EFEMBladeAWafer
  382. {
  383. get { return m_EFEMBladeAWafer; }
  384. set { SetProperty(ref m_EFEMBladeAWafer, value); }
  385. }
  386. public WaferInfo EFEMBladeBWafer
  387. {
  388. get { return m_EFEMBladeBWafer; }
  389. set { SetProperty(ref m_EFEMBladeBWafer, value); }
  390. }
  391. public WaferInfo Aligner1Wafer
  392. {
  393. get { return m_Aligner1Wafer; }
  394. set { SetProperty(ref m_Aligner1Wafer, value); }
  395. }
  396. public int LP1WaferCount
  397. {
  398. get { return m_LP1WaferCount; }
  399. set { SetProperty(ref m_LP1WaferCount, value); }
  400. }
  401. public int LP2WaferCount
  402. {
  403. get { return m_LP2WaferCount; }
  404. set { SetProperty(ref m_LP2WaferCount, value); }
  405. }
  406. public int LP3WaferCount
  407. {
  408. get { return m_LP3WaferCount; }
  409. set { SetProperty(ref m_LP3WaferCount, value); }
  410. }
  411. public WaferAssociationInfo LP1WaferAssociation
  412. {
  413. get { return _lp1WaferAssociation; }
  414. set { SetProperty(ref _lp1WaferAssociation, value); }
  415. }
  416. public WaferAssociationInfo LP2WaferAssociation
  417. {
  418. get { return _lp2WaferAssociation; }
  419. set { SetProperty(ref _lp2WaferAssociation, value); }
  420. }
  421. public WaferAssociationInfo LP3WaferAssociation
  422. {
  423. get { return _lp3WaferAssociation; }
  424. set { SetProperty(ref _lp3WaferAssociation, value); }
  425. }
  426. public int CycledWafer
  427. {
  428. get { return m_CycledWafer; }
  429. set { SetProperty(ref m_CycledWafer, value); }
  430. }
  431. public int CycleCountDisplay
  432. {
  433. get { return m_CycleCountDisplay; }
  434. set { SetProperty(ref m_CycleCountDisplay, value); }
  435. }
  436. public RobotMoveInfo m_EfemRobotMoveInfo;
  437. public RobotMoveInfo EfemRobotMoveInfo
  438. {
  439. get { return m_EfemRobotMoveInfo; }
  440. set
  441. {
  442. EFEMRobotMoveInfoChanged(m_EfemRobotMoveInfo, value);
  443. //m_EfemRobotMoveInfo = value;
  444. SetProperty(ref m_EfemRobotMoveInfo, value);
  445. }
  446. }
  447. public RobotPosition CurrentRobotPosition
  448. {
  449. get { return m_CurrentRobotPosition; }
  450. set { SetProperty(ref m_CurrentRobotPosition, value); }
  451. }
  452. public WaferInfo BladeAWafer
  453. {
  454. get { return m_BladeAWafer; }
  455. set { SetProperty(ref m_BladeAWafer, value); }
  456. }
  457. public WaferInfo BladeBWafer
  458. {
  459. get { return m_BladeBWafer; }
  460. set { SetProperty(ref m_BladeBWafer, value); }
  461. }
  462. public RecipeResult PMARecipeResult
  463. {
  464. get { return m_PMARecipeResult; }
  465. set { SetProperty(ref m_PMARecipeResult, value); }
  466. }
  467. public RecipeResult PMBRecipeResult
  468. {
  469. get { return m_PMBRecipeResult; }
  470. set { SetProperty(ref m_PMBRecipeResult, value); }
  471. }
  472. public RecipeResult PMCRecipeResult
  473. {
  474. get { return m_PMCRecipeResult; }
  475. set { SetProperty(ref m_PMCRecipeResult, value); }
  476. }
  477. public RecipeResult PMDRecipeResult
  478. {
  479. get { return m_PMDRecipeResult; }
  480. set { SetProperty(ref m_PMDRecipeResult, value); }
  481. }
  482. public bool ATMModeIsOn
  483. {
  484. get { return m_ATMModeIsOn; }
  485. set { SetProperty(ref m_ATMModeIsOn, value); }
  486. }
  487. public float TMPressure
  488. {
  489. get { return m_TMPressure; }
  490. set { SetProperty(ref m_TMPressure, value); }
  491. }
  492. public string RouteState
  493. {
  494. get { return m_RouteState; }
  495. set { SetProperty(ref m_RouteState, value); }
  496. }
  497. #endregion
  498. #region 命令
  499. private DelegateCommand<object> _LoadCommand;
  500. public DelegateCommand<object> LoadCommand =>
  501. _LoadCommand ?? (_LoadCommand = new DelegateCommand<object>(OnLoad));
  502. private DelegateCommand<object> _LoadWaferCommand;
  503. public DelegateCommand<object> LoadWaferCommand =>
  504. _LoadWaferCommand ?? (_LoadWaferCommand = new DelegateCommand<object>(OnLoadWafer));
  505. private DelegateCommand<object> _UnLoadWaferCommand;
  506. public DelegateCommand<object> UnLoadWaferCommand =>
  507. _UnLoadWaferCommand ?? (_UnLoadWaferCommand = new DelegateCommand<object>(OnUnLoadWafer));
  508. private DelegateCommand<object> _SelectAllCommand;
  509. public DelegateCommand<object> SelectAllCommand =>
  510. _SelectAllCommand ?? (_SelectAllCommand = new DelegateCommand<object>(OnSelectAll));
  511. private DelegateCommand<object> _UnSelectAllCommand;
  512. public DelegateCommand<object> UnSelectAllCommand =>
  513. _UnSelectAllCommand ?? (_UnSelectAllCommand = new DelegateCommand<object>(OnUnSelectAll));
  514. private DelegateCommand<object> _StartCommand;
  515. public DelegateCommand<object> StartCommand =>
  516. _StartCommand ?? (_StartCommand = new DelegateCommand<object>(OnStart));
  517. private DelegateCommand<object> _StopCommand;
  518. public DelegateCommand<object> StopCommand =>
  519. _StopCommand ?? (_StopCommand = new DelegateCommand<object>(OnStop));
  520. private DelegateCommand<object> _AbortCommand;
  521. public DelegateCommand<object> AbortCommand =>
  522. _AbortCommand ?? (_AbortCommand = new DelegateCommand<object>(OnAbort));
  523. private DelegateCommand _HomeAllCommand;
  524. public DelegateCommand HomeAllCommand =>
  525. _HomeAllCommand ?? (_HomeAllCommand = new DelegateCommand(OnHomeAll));
  526. private DelegateCommand _ResumeAllJobCommand;
  527. public DelegateCommand ResumeAllJobCommand =>
  528. _ResumeAllJobCommand ?? (_ResumeAllJobCommand = new DelegateCommand(OnResumeAllJob));
  529. private DelegateCommand _AbortAllCommand;
  530. public DelegateCommand AbortAllCommand =>
  531. _AbortAllCommand ?? (_AbortAllCommand = new DelegateCommand(OnAbortAll));
  532. private DelegateCommand _ReturnAllWaferCommand;
  533. public DelegateCommand ReturnAllWaferCommand =>
  534. _ReturnAllWaferCommand ?? (_ReturnAllWaferCommand = new DelegateCommand(OnReturnAllWafer));
  535. private DelegateCommand<object> _SetSequenceCommand;
  536. public DelegateCommand<object> SetSequenceCommand =>
  537. _SetSequenceCommand ?? (_SetSequenceCommand = new DelegateCommand<object>(OnSetSequence));
  538. private DelegateCommand<object> _CreateJobCommand;
  539. public DelegateCommand<object> CreateJobCommand =>
  540. _CreateJobCommand ?? (_CreateJobCommand = new DelegateCommand<object>(OnCreateJob));
  541. private DelegateCommand<object> _AbortJobCommand;
  542. public DelegateCommand<object> AbortJobCommand =>
  543. _AbortJobCommand ?? (_AbortJobCommand = new DelegateCommand<object>(OnAbortJob));
  544. private DelegateCommand _EnableAutoCommand;
  545. public DelegateCommand EnableAutoCommand =>
  546. _EnableAutoCommand ?? (_EnableAutoCommand = new DelegateCommand(OnEnableAuto));
  547. private DelegateCommand _EnableManualCommand;
  548. public DelegateCommand EnableManualCommand =>
  549. _EnableManualCommand ?? (_EnableManualCommand = new DelegateCommand(OnEnableManual));
  550. private DelegateCommand _LostFocusCommand;
  551. public DelegateCommand LostFocusCommand =>
  552. _LostFocusCommand ?? (_LostFocusCommand = new DelegateCommand(OnLostFocus));
  553. private DelegateCommand _GotFocusCommand;
  554. public DelegateCommand GotFocusCommand =>
  555. _GotFocusCommand ?? (_GotFocusCommand = new DelegateCommand(OnGotFocus));
  556. public bool SwitchFlag;
  557. #endregion
  558. #region 构造函数
  559. public OperationOverViewModel()
  560. {
  561. string allModules = QueryDataClient.Instance.Service.GetConfig($"System.InstalledModules").ToString();
  562. PMAIsInstalled = allModules.Contains("PMA");
  563. PMBIsInstalled = allModules.Contains("PMB");
  564. PMCIsInstalled = allModules.Contains("PMC");
  565. PMDIsInstalled = allModules.Contains("PMD");
  566. LLAIsInstalled = allModules.Contains("LLA");
  567. LLBIsInstalled = allModules.Contains("LLB");
  568. EFEMIsInstalled = allModules.Contains("EFEM");
  569. TMIsInstalled = allModules.Contains("TM");
  570. timer = new DispatcherTimer();
  571. timer.Interval = TimeSpan.FromSeconds(0.5);
  572. addDataKeys();
  573. RtDataValues = QueryDataClient.Instance.Service.PollData(m_RtDataKeys);
  574. timer.Tick += Timer_Tick;
  575. timer.Start();
  576. if (PMAIsInstalled)
  577. {
  578. PMAChamberType = ((JetChamber)QueryDataClient.Instance.Service.GetConfig($"PMA.ChamberType")).ToString().Substring(6);
  579. }
  580. if (PMBIsInstalled)
  581. {
  582. PMBChamberType = ((JetChamber)QueryDataClient.Instance.Service.GetConfig($"PMB.ChamberType")).ToString().Substring(6);
  583. }
  584. if (PMCIsInstalled)
  585. {
  586. PMCChamberType = ((JetChamber)QueryDataClient.Instance.Service.GetConfig($"PMC.ChamberType")).ToString().Substring(6);
  587. }
  588. if (PMDIsInstalled)
  589. {
  590. PMDChamberType = ((JetChamber)QueryDataClient.Instance.Service.GetConfig($"PMD.ChamberType")).ToString().Substring(6);
  591. }
  592. SwitchFlag = false;
  593. ATMModeIsOn = Convert.ToBoolean(QueryDataClient.Instance.Service.GetConfig("System.IsATMMode"));
  594. LOG.Info("开启UI界面");
  595. }
  596. #endregion
  597. #region 命令方法
  598. private void OnLoad(object obj)
  599. {
  600. if (!SwitchFlag)
  601. {
  602. var t = (obj as OperationOverView);
  603. LP1WaferAssociation = new WaferAssociationInfo();
  604. LP3WaferAssociation = new WaferAssociationInfo();
  605. LP2WaferAssociation = new WaferAssociationInfo();
  606. LP1WaferAssociation.ModuleData = ModuleManager.ModuleInfos["LP1"];
  607. LP2WaferAssociation.ModuleData = ModuleManager.ModuleInfos["LP2"];
  608. LP3WaferAssociation.ModuleData = ModuleManager.ModuleInfos["LP3"];
  609. SwitchFlag = true;
  610. PressureType = (PressureType)Convert.ToInt32(QueryDataClient.Instance.Service.GetData("System.PressureUnitType"));
  611. }
  612. }
  613. //private void T_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
  614. //{
  615. // if (timer.IsEnabled)
  616. // {
  617. // timer.Stop();
  618. // }
  619. // else
  620. // {
  621. // timer.Start();
  622. // }
  623. //}
  624. private void OnLoadWafer(object obj)
  625. {
  626. InvokeClient.Instance.Service.DoOperation($"{obj.ToString()}.Load", ModuleManager.ModuleInfos[obj.ToString()].ModuleID);
  627. }
  628. private void OnUnLoadWafer(object obj)
  629. {
  630. InvokeClient.Instance.Service.DoOperation($"{obj.ToString()}.Unload", ModuleManager.ModuleInfos[obj.ToString()].ModuleID);
  631. }
  632. private void OnSelectAll(object obj)
  633. {
  634. var info = obj as WaferAssociationInfo;
  635. var module = info.ModuleData.ModuleID;
  636. if (CommonFunction.GetValue<bool>(RtDataValues, $"{module}.IsLoaded"))
  637. {
  638. info.SlotFrom = 1;
  639. info.SlotTo = 25;
  640. AssociateSequence(info, true);
  641. }
  642. }
  643. private void OnUnSelectAll(object obj)
  644. {
  645. var info = obj as WaferAssociationInfo;
  646. var module = info.ModuleData.ModuleID;
  647. info.SlotFrom = 1;
  648. info.SlotTo = 25;
  649. AssociateSequence(info, false);
  650. }
  651. private void OnStart(object obj)
  652. {
  653. var info = obj as WaferAssociationInfo;
  654. InvokeClient.Instance.Service.DoOperation("System.StartJob", info.JobID);
  655. LOG.Info("System,Start Job");
  656. }
  657. private void OnStop(object obj)
  658. {
  659. var info = obj as WaferAssociationInfo;
  660. InvokeClient.Instance.Service.DoOperation("System.AbortJob", info.JobID);
  661. LOG.Info($"System,Stop Job{info.JobID}");
  662. }
  663. private void OnAbort(object obj)
  664. {
  665. var info = obj as WaferAssociationInfo;
  666. InvokeClient.Instance.Service.DoOperation("System.StopJob", info.JobID);
  667. LOG.Info($"System,Stop Job{info.JobID}");
  668. }
  669. private void OnHomeAll()
  670. {
  671. InvokeClient.Instance.Service.DoOperation("System.HomeAll");
  672. LOG.Info("System,Home All");
  673. }
  674. private void OnResumeAllJob()
  675. {
  676. var t = CommonFunction.GetValue<List<string>>(RtDataValues, "Scheduler.PjNameList");
  677. if (t == null && t.Count == 0)
  678. {
  679. return;
  680. }
  681. if (CommonFunction.GetValue<int>(RtDataValues, "EquipmentStatus") == 4)
  682. {
  683. t.ForEach(x =>
  684. {
  685. InvokeClient.Instance.Service.DoOperation("System.ResumeJob", x);
  686. });
  687. LOG.Info("System,Resume All Job");
  688. }
  689. else
  690. {
  691. t.ForEach(x =>
  692. {
  693. InvokeClient.Instance.Service.DoOperation("System.PauseJob", x);
  694. });
  695. LOG.Info("System,Pause All Job");
  696. }
  697. }
  698. private void OnAbortAll()
  699. {
  700. InvokeClient.Instance.Service.DoOperation("System.Abort");
  701. LOG.Info("System, Abort");
  702. }
  703. private void OnReturnAllWafer()
  704. {
  705. //Dialog
  706. //WaferDialogView dialog = new WaferDialogView()
  707. //{
  708. // Owner = Application.Current.MainWindow,
  709. //};
  710. //dialog.Height = 300;
  711. //dialog.Width = 400;
  712. //double angel = 0;
  713. //double coolingtime = 0;
  714. //string message = "Please Confirm Return Wafer";
  715. //WaferDialogViewModel vm = new WaferDialogViewModel();
  716. //vm.ConfirmText = message;
  717. //dialog.DataContext = vm;
  718. //if (dialog.ShowDialog() == true)
  719. //{
  720. // if ((bool)dialog.AlignFlag == true && !string.IsNullOrEmpty(dialog.Angle))
  721. // {
  722. // angel = Convert.ToDouble(dialog.Angle);
  723. // }
  724. // if ((bool)dialog.CoolingFlag == true && !string.IsNullOrEmpty(dialog.CoolingTime))
  725. // {
  726. // coolingtime = Convert.ToDouble(dialog.CoolingTime);
  727. // }
  728. //}
  729. InvokeClient.Instance.Service.DoOperation("System.ReturnAllWafer", false, 0, false, 0);
  730. LOG.Info("System,Return All Wafer");
  731. }
  732. private void OnSetSequence(object obj)
  733. {
  734. var info = obj as WaferInfo;
  735. bool flag = info.SequenceName != "" ? false : true;
  736. if (info.ModuleID == "LP1" && (CommonFunction.GetValue<bool>(RtDataValues, "LP1.IsLoaded")))
  737. {
  738. AssociateSequence(LP1WaferAssociation, flag, info.SlotID);
  739. }
  740. else if (info.ModuleID == "LP2" && (CommonFunction.GetValue<bool>(RtDataValues, "LP2.IsLoaded")))
  741. {
  742. AssociateSequence(LP2WaferAssociation, flag, info.SlotID);
  743. }
  744. else if (info.ModuleID == "LP3" && (CommonFunction.GetValue<bool>(RtDataValues, "LP3.IsLoaded")))
  745. {
  746. AssociateSequence(LP3WaferAssociation, flag, info.SlotID);
  747. }
  748. }
  749. private void OnCreateJob(object obj)
  750. {
  751. var info = obj as WaferAssociationInfo;
  752. List<string> slotSequence = new List<string>();
  753. info.ModuleData.WaferManager.Wafers.ForEach(key => { slotSequence.Insert(0, key.SequenceName); });
  754. //string jobId = info.LotId.Trim();
  755. info.LotIdSaved = true;
  756. Dictionary<string, object> param = new Dictionary<string, object>()
  757. {
  758. {"JobId", info.JobID},
  759. {"LotId", info.LotId},
  760. {"Module", info.ModuleData.ModuleID},
  761. {"SlotSequence", slotSequence.ToArray()},
  762. {"AutoStart", true},
  763. { "PreCleanRecipeName",info.PreCleanRecipeName},
  764. { "PostCleanRecipeName",info.PostCleanRecipeName},
  765. { "CycleNumber",info.CycleNumber}
  766. };
  767. InvokeClient.Instance.Service.DoOperation("System.CreateJob", param);
  768. }
  769. private void OnAbortJob(object obj)
  770. {
  771. InvokeClient.Instance.Service.DoOperation("System.AbortJob", obj.ToString());
  772. }
  773. private void OnEnableAuto()
  774. {
  775. InvokeClient.Instance.Service.DoOperation("System.SetAutoMode");
  776. }
  777. private void OnEnableManual()
  778. {
  779. InvokeClient.Instance.Service.DoOperation("System.SetManualMode");
  780. }
  781. private void OnLostFocus()
  782. {
  783. timer.Stop();
  784. }
  785. private void OnGotFocus()
  786. {
  787. timer.Start();
  788. }
  789. #endregion
  790. #region 私有方法
  791. private void Timer_Tick(object sender, EventArgs e)
  792. {
  793. RtDataValues = QueryDataClient.Instance.Service.PollData(m_RtDataKeys);
  794. if (RtDataValues == null || RtDataValues.Count==0)
  795. {
  796. return;
  797. }
  798. LP1ModuleInfo = ModuleManager.ModuleInfos["LP1"];
  799. LP2ModuleInfo = ModuleManager.ModuleInfos["LP2"];
  800. LP3ModuleInfo = ModuleManager.ModuleInfos["LP3"];
  801. EFEMModuleInfo = ModuleManager.ModuleInfos["EfemRobot"];
  802. TMModuleInfo = ModuleManager.ModuleInfos["TMRobot"];
  803. BladeAWafer = ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[0];
  804. BladeBWafer = ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[1];
  805. if (LLAIsInstalled == true)
  806. {
  807. LLAModuleInfo = ModuleManager.ModuleInfos["LLA"];
  808. LLAWafer = ModuleManager.ModuleInfos["LLA"].WaferManager.Wafers.FirstOrDefault(x => x.WaferStatus != 0);
  809. }
  810. if (LLBIsInstalled == true)
  811. {
  812. LLBModuleInfo = ModuleManager.ModuleInfos["LLB"];
  813. LLBWafer = ModuleManager.ModuleInfos["LLB"].WaferManager.Wafers.FirstOrDefault(x => x.WaferStatus != 0);
  814. }
  815. if (PMAIsInstalled == true)
  816. {
  817. PMAWafer = ModuleManager.ModuleInfos["PMA"].WaferManager.Wafers[0];
  818. PMARecipeResult = CommonFunction.GetValue<RecipeResult>(RtDataValues, $"PMA.CurrentRecipeResult");
  819. }
  820. if (PMBIsInstalled == true)
  821. {
  822. PMBWafer = ModuleManager.ModuleInfos["PMB"].WaferManager.Wafers[0];
  823. PMBRecipeResult = CommonFunction.GetValue<RecipeResult>(RtDataValues, $"PMB.CurrentRecipeResult");
  824. }
  825. if (PMCIsInstalled == true)
  826. {
  827. PMCWafer = ModuleManager.ModuleInfos["PMC"].WaferManager.Wafers[0];
  828. PMCRecipeResult = CommonFunction.GetValue<RecipeResult>(RtDataValues, $"PMC.CurrentRecipeResult");
  829. }
  830. if (PMDIsInstalled == true)
  831. {
  832. PMDWafer = ModuleManager.ModuleInfos["PMD"].WaferManager.Wafers[0];
  833. PMDRecipeResult = CommonFunction.GetValue<RecipeResult>(RtDataValues, $"PMD.CurrentRecipeResult");
  834. }
  835. if (TMIsInstalled == true)
  836. {
  837. TMBladeAWafer = ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[0];
  838. TMBladeBWafer = ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[1];
  839. TMPressure = CommonFunction.GetValue<float>(RtDataValues, $"TM.TMProcessGauge.Value");
  840. }
  841. if (EFEMIsInstalled == true)
  842. {
  843. EFEMBladeAWafer = ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[0];
  844. EFEMBladeBWafer = ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[1];
  845. Aligner1Wafer = ModuleManager.ModuleInfos["Aligner1"].WaferManager.Wafers[0];
  846. ControlJobInfo lp1Cj = CommonFunction.GetValue<ControlJobInfo>(RtDataValues, "LP1.CurrentControlJob");
  847. if (lp1Cj == null)
  848. {
  849. ButtonIsEnableLP1 = true;
  850. }
  851. else
  852. {
  853. ButtonIsEnableLP1= false;
  854. UPdateWaferAssociation(LP1WaferAssociation, lp1Cj);
  855. }
  856. ControlJobInfo lp2Cj = CommonFunction.GetValue<ControlJobInfo>(RtDataValues, "LP2.CurrentControlJob");
  857. if (lp2Cj == null)
  858. {
  859. ButtonIsEnableLP2 = true;
  860. }
  861. else
  862. {
  863. ButtonIsEnableLP2 = false;
  864. UPdateWaferAssociation(LP2WaferAssociation, lp2Cj);
  865. }
  866. ControlJobInfo lp3Cj = CommonFunction.GetValue<ControlJobInfo>(RtDataValues, "LP3.CurrentControlJob");
  867. if (lp3Cj == null)
  868. {
  869. ButtonIsEnableLP3 = true;
  870. }
  871. else
  872. {
  873. ButtonIsEnableLP3 = false;
  874. UPdateWaferAssociation(LP3WaferAssociation, lp3Cj);
  875. }
  876. }
  877. RobotMoveInfo = (RobotMoveInfo)QueryDataClient.Instance.Service.GetData("TM.RobotMoveAction");
  878. EfemRobotMoveInfo = (RobotMoveInfo)QueryDataClient.Instance.Service.GetData("EFEM.RobotMoveAction");
  879. LP1WaferCount = LP1ModuleInfo.WaferManager.Wafers.Where(x => x.WaferStatus != 0).Count();
  880. LP2WaferCount = LP2ModuleInfo.WaferManager.Wafers.Where(x => x.WaferStatus != 0).Count();
  881. LP3WaferCount = LP3ModuleInfo.WaferManager.Wafers.Where(x => x.WaferStatus != 0).Count();
  882. if (CommonFunction.GetValue<int>(RtDataValues, "EquipmentStatus") == 4)
  883. {
  884. RouteState = "Resume";
  885. }
  886. else
  887. {
  888. RouteState = "Pause";
  889. }
  890. }
  891. /// <summary>
  892. /// 更新Wafer情况
  893. /// </summary>
  894. /// <param name="info"></param>
  895. /// <param name="cjInfo"></param>
  896. private void UPdateWaferAssociation(WaferAssociationInfo info, ControlJobInfo cjInfo)
  897. {
  898. if(info==null)
  899. {
  900. return;
  901. }
  902. if (cjInfo != null)
  903. {
  904. info.LotId = cjInfo.LotName;
  905. info.JobID = cjInfo.Name;
  906. info.JobStatus = cjInfo.State.ToString();
  907. if (cjInfo.SequenceNameList != null)
  908. {
  909. for (int i = 0; i < cjInfo.SequenceNameList.Length; i++)
  910. {
  911. info.ModuleData.WaferManager.Wafers[24 - i].SequenceName = cjInfo.SequenceNameList[i];
  912. }
  913. }
  914. info.PreCleanRecipeName = cjInfo.PreJobClean;
  915. info.PostCleanRecipeName = cjInfo.PostJobClean;
  916. }
  917. else
  918. {
  919. if (!string.IsNullOrEmpty(info.JobID))
  920. {
  921. info.LotId = "";
  922. info.JobID = "";
  923. info.JobStatus = "";
  924. info.PreCleanRecipeName = "";
  925. info.PostCleanRecipeName = "";
  926. AssociateSequence(info, false);
  927. }
  928. }
  929. }
  930. private async void TMRobotMoveInfoChanged(RobotMoveInfo oldValue, RobotMoveInfo newValue)
  931. {
  932. string RobotTarget;
  933. if (oldValue == null || newValue == null)
  934. {
  935. return;
  936. }
  937. #region Rotating
  938. if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && (newValue.Action == RobotAction.Rotating))
  939. {
  940. var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
  941. if (TMRobotMoveActionBladeTarget != null)
  942. {
  943. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  944. }
  945. else
  946. {
  947. return;
  948. }
  949. var values = RobotTarget.Split('.');
  950. var arm = values[0];
  951. var module = values[1];
  952. bool isParseOK;
  953. BladeNiceXinSongWaferRobotTAction = CommonFunction.ToEnum<NiceXinSongWaferRobotTAction>(module, out isParseOK);
  954. if (isParseOK == false)
  955. {
  956. return;
  957. }
  958. //if (arm == "ArmA")
  959. //{
  960. //}
  961. //else if (arm == "ArmB")
  962. //{
  963. // Blade2NiceXinSongWaferRobotTAction = (NiceXinSongWaferRobotTAction)Enum.Parse(typeof(NiceXinSongWaferRobotTAction), module, true);
  964. //}
  965. }
  966. #endregion
  967. #region pick 和 place LL
  968. if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && (newValue.Action == RobotAction.Placing || newValue.Action == RobotAction.Picking))
  969. {
  970. var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
  971. if (TMRobotMoveActionBladeTarget != null)
  972. {
  973. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  974. }
  975. else
  976. {
  977. return;
  978. }
  979. var values = RobotTarget.Split('.');
  980. var arm = values[0];
  981. var module = values[1];
  982. if (arm == "ArmA")
  983. {
  984. bool isParseOK;
  985. BladeNiceXinSongWaferRobotTAction = CommonFunction.ToEnum<NiceXinSongWaferRobotTAction>(module, out isParseOK);
  986. if (isParseOK == false)
  987. {
  988. return;
  989. }
  990. //var waferRobotTAction = (NiceXinSongWaferRobotTAction)Enum.Parse(typeof(NiceXinSongWaferRobotTAction), module, true);
  991. //BladeNiceXinSongWaferRobotTAction = waferRobotTAction;
  992. await Task.Delay(600);
  993. Blade1NiceXinSongWaferRobotXAction = NiceXinSongWaferRobotXAction.Extend1;
  994. 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))
  995. {
  996. await Task.Delay(100);
  997. }
  998. //Robot1XAction = WaferRobotXAction.Retract;
  999. Blade1NiceXinSongWaferRobotXAction = NiceXinSongWaferRobotXAction.Retract1;
  1000. }
  1001. else if (arm == "ArmB")
  1002. {
  1003. bool isParseOK;
  1004. BladeNiceXinSongWaferRobotTAction = CommonFunction.ToEnum<NiceXinSongWaferRobotTAction>(module, out isParseOK);
  1005. if (isParseOK == false)
  1006. {
  1007. return;
  1008. }
  1009. //var waferRobotTAction = (NiceXinSongWaferRobotTAction)Enum.Parse(typeof(NiceXinSongWaferRobotTAction), module, true);
  1010. //BladeNiceXinSongWaferRobotTAction = waferRobotTAction;
  1011. //var waferRobotTAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  1012. //var waferRobotTAction = (NiceXinSongWaferRobotTAction)Enum.Parse(typeof(NiceXinSongWaferRobotTAction), module, true);
  1013. //Blade2NiceXinSongWaferRobotTAction = waferRobotTAction;
  1014. //if (waferRobotTAction != Blade2NiceXinSongWaferRobotTAction)
  1015. //{
  1016. //}
  1017. await Task.Delay(600);
  1018. Blade2NiceXinSongWaferRobotXAction = NiceXinSongWaferRobotXAction.Extend2;
  1019. 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))
  1020. {
  1021. await Task.Delay(100);
  1022. }
  1023. Blade2NiceXinSongWaferRobotXAction = NiceXinSongWaferRobotXAction.Retract2;
  1024. }
  1025. }
  1026. #endregion
  1027. #region pick 和 place pm
  1028. else if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && newValue.Action == RobotAction.Extending)
  1029. {
  1030. var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
  1031. if (TMRobotMoveActionBladeTarget != null)
  1032. {
  1033. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  1034. }
  1035. else
  1036. {
  1037. return;
  1038. }
  1039. var values = RobotTarget.Split('.');
  1040. var arm = values[0];
  1041. var module = values[1];
  1042. bool isParseOK;
  1043. BladeNiceXinSongWaferRobotTAction = CommonFunction.ToEnum<NiceXinSongWaferRobotTAction>(module, out isParseOK);
  1044. if (isParseOK == false)
  1045. {
  1046. return;
  1047. }
  1048. //var waferRobotTAction = (NiceXinSongWaferRobotTAction)Enum.Parse(typeof(NiceXinSongWaferRobotTAction), module, true);
  1049. //BladeNiceXinSongWaferRobotTAction = waferRobotTAction;
  1050. if (arm == "ArmA")
  1051. {
  1052. await Task.Delay(600);
  1053. Blade1NiceXinSongWaferRobotXAction = NiceXinSongWaferRobotXAction.Extend1;
  1054. }
  1055. else if (arm == "ArmB")
  1056. {
  1057. await Task.Delay(600);
  1058. Blade2NiceXinSongWaferRobotXAction = NiceXinSongWaferRobotXAction.Extend2;
  1059. }
  1060. }
  1061. else if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && newValue.Action == RobotAction.Retracting)
  1062. {
  1063. var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
  1064. if (TMRobotMoveActionBladeTarget != null)
  1065. {
  1066. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  1067. }
  1068. else
  1069. {
  1070. return;
  1071. }
  1072. var values = RobotTarget.Split('.');
  1073. var arm = values[0];
  1074. if (arm == "ArmA")
  1075. {
  1076. //Robot1XAction = WaferRobotXAction.Retract;
  1077. Blade1NiceXinSongWaferRobotXAction = NiceXinSongWaferRobotXAction.Retract1;
  1078. }
  1079. else if (arm == "ArmB")
  1080. {
  1081. //Robot2XAction = WaferRobotXAction.Retract;
  1082. Blade2NiceXinSongWaferRobotXAction = NiceXinSongWaferRobotXAction.Retract2;
  1083. }
  1084. }
  1085. #endregion
  1086. #region Home
  1087. else if (oldValue.Action == RobotAction.None && newValue.Action == RobotAction.Homing)
  1088. {
  1089. Blade1NiceXinSongWaferRobotXAction = NiceXinSongWaferRobotXAction.Retract1;
  1090. Blade2NiceXinSongWaferRobotXAction = NiceXinSongWaferRobotXAction.Retract2;
  1091. await Task.Delay(2000);
  1092. BladeNiceXinSongWaferRobotTAction = NiceXinSongWaferRobotTAction.T_Origin;
  1093. }
  1094. #endregion
  1095. }
  1096. private async void EFEMRobotMoveInfoChanged(RobotMoveInfo oldValue, RobotMoveInfo newValue)
  1097. {
  1098. string RobotTarget;
  1099. if (oldValue == null || newValue == null)
  1100. {
  1101. return;
  1102. }
  1103. #region pick 和 place LL
  1104. if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget))
  1105. {
  1106. var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
  1107. if (TMRobotMoveActionBladeTarget != null)
  1108. {
  1109. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  1110. }
  1111. else
  1112. {
  1113. return;
  1114. }
  1115. var values = RobotTarget.Split('.');
  1116. var arm = values[0];
  1117. var module = values[1];
  1118. if (arm == "ArmA")
  1119. {
  1120. var bladeWaferRobotTAction = (NiceGuangChuanWaferRobotTAction)Enum.Parse(typeof(NiceGuangChuanWaferRobotTAction), module, true);
  1121. if (BladeNiceGuangChuanWaferRobotTAction != bladeWaferRobotTAction)
  1122. {
  1123. BladeNiceGuangChuanWaferRobotTAction = bladeWaferRobotTAction;
  1124. await Task.Delay(600);
  1125. }
  1126. Blade1NiceGuangChuanWaferRobotXAction = NiceGuangChuanWaferRobotXAction.Extend1;
  1127. //Robot3XAction = WaferRobotXAction.Extend;
  1128. 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))
  1129. {
  1130. await Task.Delay(100);
  1131. }
  1132. //Robot3XAction = WaferRobotXAction.Retract;
  1133. Blade1NiceGuangChuanWaferRobotXAction = NiceGuangChuanWaferRobotXAction.Retract1;
  1134. }
  1135. else if (arm == "ArmB")
  1136. {
  1137. var bladeWaferRobotTAction = (NiceGuangChuanWaferRobotTAction)Enum.Parse(typeof(NiceGuangChuanWaferRobotTAction), module, true);
  1138. if (BladeNiceGuangChuanWaferRobotTAction != bladeWaferRobotTAction)
  1139. {
  1140. BladeNiceGuangChuanWaferRobotTAction = bladeWaferRobotTAction;
  1141. await Task.Delay(600);
  1142. }
  1143. //var blade2WaferRobotTAction = (NiceGuangChuanWaferRobotTAction)Enum.Parse(typeof(NiceGuangChuanWaferRobotTAction), module, true);
  1144. //if (Blade2NiceGuangChuanWaferRobotTAction != blade2WaferRobotTAction)
  1145. //{
  1146. // Blade2NiceGuangChuanWaferRobotTAction = blade2WaferRobotTAction;
  1147. // await Task.Delay(600);
  1148. //}
  1149. Blade2NiceGuangChuanWaferRobotXAction = NiceGuangChuanWaferRobotXAction.Extend2;
  1150. while ((newValue.Action == RobotAction.Placing && ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[1].WaferStatus != 0) || (newValue.Action == RobotAction.Picking && ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[1].WaferStatus == 0))
  1151. {
  1152. await Task.Delay(100);
  1153. }
  1154. // Robot4XAction = WaferRobotXAction.Retract;
  1155. Blade2NiceGuangChuanWaferRobotXAction = NiceGuangChuanWaferRobotXAction.Retract2;
  1156. }
  1157. }
  1158. #endregion
  1159. #region Home
  1160. else if (oldValue.Action == RobotAction.Homing && newValue.Action == RobotAction.None)
  1161. {
  1162. Blade1NiceGuangChuanWaferRobotXAction = NiceGuangChuanWaferRobotXAction.Retract1;
  1163. Blade2NiceGuangChuanWaferRobotXAction = NiceGuangChuanWaferRobotXAction.Retract2;
  1164. await Task.Delay(1000);
  1165. BladeNiceGuangChuanWaferRobotTAction = NiceGuangChuanWaferRobotTAction.T_Origin;
  1166. //Blade2NiceGuangChuanWaferRobotTAction = NiceGuangChuanWaferRobotTAction.T_Origin;
  1167. }
  1168. #endregion
  1169. }
  1170. private void addDataKeys()
  1171. {
  1172. if (PMAIsInstalled)
  1173. {
  1174. m_RtDataKeys.Add("PMA.IsSlitDoorClosed");
  1175. m_RtDataKeys.Add("PMA.CurrentRecipeResult");
  1176. m_RtDataKeys.Add("PMA.IsOnline");
  1177. m_RtDataKeys.Add("PMA.CalculationPressure");
  1178. m_RtDataKeys.Add("PMA.IsLidClosed");
  1179. m_RtDataKeys.Add("PMA.HighTemperatureHeater.DeviceData");
  1180. }
  1181. if (PMBIsInstalled)
  1182. {
  1183. m_RtDataKeys.Add("PMB.IsSlitDoorClosed");
  1184. m_RtDataKeys.Add("PMB.CurrentRecipeResult");
  1185. m_RtDataKeys.Add("PMB.IsOnline");
  1186. m_RtDataKeys.Add("PMB.CalculationPressure");
  1187. m_RtDataKeys.Add("PMB.IsLidClosed");
  1188. m_RtDataKeys.Add("PMB.HighTemperatureHeater.DeviceData");
  1189. }
  1190. if (PMCIsInstalled)
  1191. {
  1192. m_RtDataKeys.Add("PMC.IsSlitDoorClosed");
  1193. m_RtDataKeys.Add("PMC.CurrentRecipeResult");
  1194. m_RtDataKeys.Add("PMC.IsOnline");
  1195. m_RtDataKeys.Add("PMC.CalculationPressure");
  1196. m_RtDataKeys.Add("PMC.IsLidClosed");
  1197. m_RtDataKeys.Add("PMC.HighTemperatureHeater.DeviceData");
  1198. }
  1199. if (PMDIsInstalled)
  1200. {
  1201. m_RtDataKeys.Add("PMD.IsSlitDoorClosed");
  1202. m_RtDataKeys.Add("PMD.CurrentRecipeResult");
  1203. m_RtDataKeys.Add("PMD.IsOnline");
  1204. m_RtDataKeys.Add("PMD.CalculationPressure");
  1205. m_RtDataKeys.Add("PMD.IsLidClosed");
  1206. m_RtDataKeys.Add("PMD.HighTemperatureHeater.DeviceData");
  1207. }
  1208. m_RtDataKeys.Add("TM.LLATSlitDoor.IsClosed");
  1209. m_RtDataKeys.Add("TM.LLBTSlitDoor.IsClosed");
  1210. m_RtDataKeys.Add("TM.LLAESlitDoor.IsClosed");
  1211. m_RtDataKeys.Add("TM.LLBESlitDoor.IsClosed");
  1212. m_RtDataKeys.Add("TM.IsOnline");
  1213. m_RtDataKeys.Add("TM.TMProcessGauge.Value");
  1214. m_RtDataKeys.Add("TM.IoSensor.TMATMSwitch.Value");
  1215. m_RtDataKeys.Add("TM.IoSensor.TMVacSwitch.Value");
  1216. m_RtDataKeys.Add("TM.TMProcessGauge.Value");
  1217. m_RtDataKeys.Add("TM.TMLidClosed");
  1218. m_RtDataKeys.Add("TM.LLALidClosed");
  1219. m_RtDataKeys.Add("TM.LLBLidClosed");
  1220. m_RtDataKeys.Add("TM.PMASlitDoor.IsClosed");
  1221. m_RtDataKeys.Add("TM.PMBSlitDoor.IsClosed");
  1222. m_RtDataKeys.Add("TM.PMCSlitDoor.IsClosed");
  1223. m_RtDataKeys.Add("TM.PMDSlitDoor.IsClosed");
  1224. m_RtDataKeys.Add("LLA.IsOnline");
  1225. m_RtDataKeys.Add($"TM.LLAPressureGauge.Value");
  1226. m_RtDataKeys.Add($"TM.IoSensor.LLAVacSwitch.Value");
  1227. m_RtDataKeys.Add($"TM.IoSensor.LLAATMSwitch.Value");
  1228. m_RtDataKeys.Add("LLB.IsOnline");
  1229. m_RtDataKeys.Add($"TM.LLBPressureGauge.Value");
  1230. m_RtDataKeys.Add($"TM.IoSensor.LLBVacSwitch.Value");
  1231. m_RtDataKeys.Add($"TM.IoSensor.LLBATMSwitch.Value");
  1232. m_RtDataKeys.Add("LP1.IsLoaded");
  1233. m_RtDataKeys.Add("LP2.IsLoaded");
  1234. m_RtDataKeys.Add("LP3.IsLoaded");
  1235. m_RtDataKeys.Add("LP1.CassettePlaced");
  1236. m_RtDataKeys.Add("LP2.CassettePlaced");
  1237. m_RtDataKeys.Add("LP3.CassettePlaced");
  1238. m_RtDataKeys.Add("LP1.CurrentControlJob");
  1239. m_RtDataKeys.Add("LP2.CurrentControlJob");
  1240. m_RtDataKeys.Add("LP3.CurrentControlJob");
  1241. m_RtDataKeys.Add("EFEM.IsOnline");
  1242. m_RtDataKeys.Add("System.IsAutoMode");
  1243. m_RtDataKeys.Add("System.IsBusy");
  1244. m_RtDataKeys.Add("LP1.CycledCount");
  1245. m_RtDataKeys.Add("LP1.CycledWafer");
  1246. m_RtDataKeys.Add("LP1.CycleSetPoint");
  1247. m_RtDataKeys.Add("LP1.Throughput");
  1248. m_RtDataKeys.Add("LP2.CycledCount");
  1249. m_RtDataKeys.Add("LP2.CycledWafer");
  1250. m_RtDataKeys.Add("LP2.CycleSetPoint");
  1251. m_RtDataKeys.Add("LP2.Throughput");
  1252. m_RtDataKeys.Add("LP3.CycledCount");
  1253. m_RtDataKeys.Add("LP3.CycledWafer");
  1254. m_RtDataKeys.Add("LP3.CycleSetPoint");
  1255. m_RtDataKeys.Add("LP3.Throughput");
  1256. m_RtDataKeys.Add("EquipmentStatus");
  1257. m_RtDataKeys.Add("Scheduler.PjNameList");
  1258. }
  1259. private void AssociateSequence(WaferAssociationInfo info, bool flag, int slot = -1)
  1260. {
  1261. List<WaferInfo> wafers = info.ModuleData.WaferManager.Wafers;
  1262. if (slot >= 0) //by wafer
  1263. {
  1264. int index = wafers.Count - slot - 1;
  1265. if (index < wafers.Count)
  1266. {
  1267. if (flag && HasWaferOnSlot(wafers, index))
  1268. wafers[index].SequenceName = info.SequenceName;
  1269. else
  1270. wafers[index].SequenceName = string.Empty;
  1271. }
  1272. }
  1273. else //by from-to
  1274. {
  1275. for (int i = info.SlotFrom - 1; i < info.SlotTo; i++)
  1276. {
  1277. int index = wafers.Count - i - 1;
  1278. if (index < wafers.Count)
  1279. {
  1280. if (flag && HasWaferOnSlot(wafers, index))
  1281. wafers[index].SequenceName = info.SequenceName;
  1282. else
  1283. wafers[index].SequenceName = string.Empty;
  1284. }
  1285. }
  1286. }
  1287. switch (info.ModuleData.ModuleID)
  1288. {
  1289. case "LP1":
  1290. LP1WaferAssociation = info;
  1291. break;
  1292. case "LP2":
  1293. LP2WaferAssociation = info;
  1294. break;
  1295. case "LP3":
  1296. LP3WaferAssociation = info;
  1297. break;
  1298. }
  1299. }
  1300. private bool HasWaferOnSlot(List<WaferInfo> wafers, int index)
  1301. {
  1302. if (wafers[index].WaferStatus == 0)
  1303. return false;
  1304. return true;
  1305. }
  1306. //public void EnterExitView(bool isEnter)
  1307. //{
  1308. // if (isEnter)
  1309. // {
  1310. // Timer_Tick(null, null);
  1311. // timer.Start();
  1312. // }
  1313. // else
  1314. // {
  1315. // timer.Stop();
  1316. // }
  1317. //}
  1318. #endregion
  1319. }
  1320. }