OperationOverViewModel.cs 57 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507
  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
  370. {
  371. if (m_ButtonIsEnableLP1 == false && value == true && LP1WaferAssociation!=null)
  372. {
  373. LP1WaferAssociation.IsEnableCycle = false;
  374. LP1WaferAssociation.CycleNumber = 1;
  375. }
  376. SetProperty(ref m_ButtonIsEnableLP1, value);
  377. }
  378. }
  379. public bool ButtonIsEnableLP2
  380. {
  381. get { return m_ButtonIsEnableLP2; }
  382. set
  383. {
  384. if (m_ButtonIsEnableLP2 == false && value == true && LP2WaferAssociation != null)
  385. {
  386. LP2WaferAssociation.IsEnableCycle = false;
  387. LP2WaferAssociation.CycleNumber = 1;
  388. }
  389. SetProperty(ref m_ButtonIsEnableLP2, value);
  390. }
  391. }
  392. public bool ButtonIsEnableLP3
  393. {
  394. get { return m_ButtonIsEnableLP3; }
  395. set
  396. {
  397. if (m_ButtonIsEnableLP3 == false && value == true && LP3WaferAssociation != null)
  398. {
  399. LP3WaferAssociation.IsEnableCycle = false;
  400. LP3WaferAssociation.CycleNumber = 1;
  401. }
  402. SetProperty(ref m_ButtonIsEnableLP3, value);
  403. }
  404. }
  405. public WaferInfo EFEMBladeAWafer
  406. {
  407. get { return m_EFEMBladeAWafer; }
  408. set { SetProperty(ref m_EFEMBladeAWafer, value); }
  409. }
  410. public WaferInfo EFEMBladeBWafer
  411. {
  412. get { return m_EFEMBladeBWafer; }
  413. set { SetProperty(ref m_EFEMBladeBWafer, value); }
  414. }
  415. public WaferInfo Aligner1Wafer
  416. {
  417. get { return m_Aligner1Wafer; }
  418. set { SetProperty(ref m_Aligner1Wafer, value); }
  419. }
  420. public int LP1WaferCount
  421. {
  422. get { return m_LP1WaferCount; }
  423. set { SetProperty(ref m_LP1WaferCount, value); }
  424. }
  425. public int LP2WaferCount
  426. {
  427. get { return m_LP2WaferCount; }
  428. set { SetProperty(ref m_LP2WaferCount, value); }
  429. }
  430. public int LP3WaferCount
  431. {
  432. get { return m_LP3WaferCount; }
  433. set { SetProperty(ref m_LP3WaferCount, value); }
  434. }
  435. public WaferAssociationInfo LP1WaferAssociation
  436. {
  437. get { return _lp1WaferAssociation; }
  438. set { SetProperty(ref _lp1WaferAssociation, value); }
  439. }
  440. public WaferAssociationInfo LP2WaferAssociation
  441. {
  442. get { return _lp2WaferAssociation; }
  443. set { SetProperty(ref _lp2WaferAssociation, value); }
  444. }
  445. public WaferAssociationInfo LP3WaferAssociation
  446. {
  447. get { return _lp3WaferAssociation; }
  448. set { SetProperty(ref _lp3WaferAssociation, value); }
  449. }
  450. public int CycledWafer
  451. {
  452. get { return m_CycledWafer; }
  453. set { SetProperty(ref m_CycledWafer, value); }
  454. }
  455. public int CycleCountDisplay
  456. {
  457. get { return m_CycleCountDisplay; }
  458. set { SetProperty(ref m_CycleCountDisplay, value); }
  459. }
  460. public RobotMoveInfo m_EfemRobotMoveInfo;
  461. public RobotMoveInfo EfemRobotMoveInfo
  462. {
  463. get { return m_EfemRobotMoveInfo; }
  464. set
  465. {
  466. EFEMRobotMoveInfoChanged(m_EfemRobotMoveInfo, value);
  467. //m_EfemRobotMoveInfo = value;
  468. SetProperty(ref m_EfemRobotMoveInfo, value);
  469. }
  470. }
  471. //public RobotPosition CurrentRobotPosition
  472. //{
  473. // get { return m_CurrentRobotPosition; }
  474. // set { SetProperty(ref m_CurrentRobotPosition, value); }
  475. //}
  476. public WaferInfo BladeAWafer
  477. {
  478. get { return m_BladeAWafer; }
  479. set { SetProperty(ref m_BladeAWafer, value); }
  480. }
  481. public WaferInfo BladeBWafer
  482. {
  483. get { return m_BladeBWafer; }
  484. set { SetProperty(ref m_BladeBWafer, value); }
  485. }
  486. public RecipeResult PMARecipeResult
  487. {
  488. get { return m_PMARecipeResult; }
  489. set { SetProperty(ref m_PMARecipeResult, value); }
  490. }
  491. public RecipeResult PMBRecipeResult
  492. {
  493. get { return m_PMBRecipeResult; }
  494. set { SetProperty(ref m_PMBRecipeResult, value); }
  495. }
  496. public RecipeResult PMCRecipeResult
  497. {
  498. get { return m_PMCRecipeResult; }
  499. set { SetProperty(ref m_PMCRecipeResult, value); }
  500. }
  501. public RecipeResult PMDRecipeResult
  502. {
  503. get { return m_PMDRecipeResult; }
  504. set { SetProperty(ref m_PMDRecipeResult, value); }
  505. }
  506. public bool ATMModeIsOn
  507. {
  508. get { return m_ATMModeIsOn; }
  509. set { SetProperty(ref m_ATMModeIsOn, value); }
  510. }
  511. public float TMPressure
  512. {
  513. get { return m_TMPressure; }
  514. set { SetProperty(ref m_TMPressure, value); }
  515. }
  516. public string RouteState
  517. {
  518. get { return m_RouteState; }
  519. set { SetProperty(ref m_RouteState, value); }
  520. }
  521. #endregion
  522. #region 命令
  523. private DelegateCommand<object> _LoadCommand;
  524. public DelegateCommand<object> LoadCommand =>
  525. _LoadCommand ?? (_LoadCommand = new DelegateCommand<object>(OnLoad));
  526. private DelegateCommand<object> _LoadWaferCommand;
  527. public DelegateCommand<object> LoadWaferCommand =>
  528. _LoadWaferCommand ?? (_LoadWaferCommand = new DelegateCommand<object>(OnLoadWafer));
  529. private DelegateCommand<object> _UnLoadWaferCommand;
  530. public DelegateCommand<object> UnLoadWaferCommand =>
  531. _UnLoadWaferCommand ?? (_UnLoadWaferCommand = new DelegateCommand<object>(OnUnLoadWafer));
  532. private DelegateCommand<object> _SelectAllCommand;
  533. public DelegateCommand<object> SelectAllCommand =>
  534. _SelectAllCommand ?? (_SelectAllCommand = new DelegateCommand<object>(OnSelectAll));
  535. private DelegateCommand<object> _UnSelectAllCommand;
  536. public DelegateCommand<object> UnSelectAllCommand =>
  537. _UnSelectAllCommand ?? (_UnSelectAllCommand = new DelegateCommand<object>(OnUnSelectAll));
  538. private DelegateCommand<object> _StartCommand;
  539. public DelegateCommand<object> StartCommand =>
  540. _StartCommand ?? (_StartCommand = new DelegateCommand<object>(OnStart));
  541. private DelegateCommand<object> _StopCommand;
  542. public DelegateCommand<object> StopCommand =>
  543. _StopCommand ?? (_StopCommand = new DelegateCommand<object>(OnStop));
  544. private DelegateCommand<object> _AbortCommand;
  545. public DelegateCommand<object> AbortCommand =>
  546. _AbortCommand ?? (_AbortCommand = new DelegateCommand<object>(OnAbort));
  547. private DelegateCommand _HomeAllCommand;
  548. public DelegateCommand HomeAllCommand =>
  549. _HomeAllCommand ?? (_HomeAllCommand = new DelegateCommand(OnHomeAll));
  550. private DelegateCommand _ResumeAllJobCommand;
  551. public DelegateCommand ResumeAllJobCommand =>
  552. _ResumeAllJobCommand ?? (_ResumeAllJobCommand = new DelegateCommand(OnResumeAllJob));
  553. private DelegateCommand _AbortAllCommand;
  554. public DelegateCommand AbortAllCommand =>
  555. _AbortAllCommand ?? (_AbortAllCommand = new DelegateCommand(OnAbortAll));
  556. private DelegateCommand _ReturnAllWaferCommand;
  557. public DelegateCommand ReturnAllWaferCommand =>
  558. _ReturnAllWaferCommand ?? (_ReturnAllWaferCommand = new DelegateCommand(OnReturnAllWafer));
  559. private DelegateCommand<object> _SetSequenceCommand;
  560. public DelegateCommand<object> SetSequenceCommand =>
  561. _SetSequenceCommand ?? (_SetSequenceCommand = new DelegateCommand<object>(OnSetSequence));
  562. private DelegateCommand<object> _CreateJobCommand;
  563. public DelegateCommand<object> CreateJobCommand =>
  564. _CreateJobCommand ?? (_CreateJobCommand = new DelegateCommand<object>(OnCreateJob));
  565. private DelegateCommand<object> _AbortJobCommand;
  566. public DelegateCommand<object> AbortJobCommand =>
  567. _AbortJobCommand ?? (_AbortJobCommand = new DelegateCommand<object>(OnAbortJob));
  568. private DelegateCommand _EnableAutoCommand;
  569. public DelegateCommand EnableAutoCommand =>
  570. _EnableAutoCommand ?? (_EnableAutoCommand = new DelegateCommand(OnEnableAuto));
  571. private DelegateCommand _EnableManualCommand;
  572. public DelegateCommand EnableManualCommand =>
  573. _EnableManualCommand ?? (_EnableManualCommand = new DelegateCommand(OnEnableManual));
  574. private DelegateCommand _LostFocusCommand;
  575. public DelegateCommand LostFocusCommand =>
  576. _LostFocusCommand ?? (_LostFocusCommand = new DelegateCommand(OnLostFocus));
  577. private DelegateCommand _GotFocusCommand;
  578. public DelegateCommand GotFocusCommand =>
  579. _GotFocusCommand ?? (_GotFocusCommand = new DelegateCommand(OnGotFocus));
  580. public bool SwitchFlag;
  581. #endregion
  582. #region 构造函数
  583. public OperationOverViewModel()
  584. {
  585. string allModules = QueryDataClient.Instance.Service.GetConfig($"System.InstalledModules").ToString();
  586. PMAIsInstalled = allModules.Contains("PMA");
  587. PMBIsInstalled = allModules.Contains("PMB");
  588. PMCIsInstalled = allModules.Contains("PMC");
  589. PMDIsInstalled = allModules.Contains("PMD");
  590. LLAIsInstalled = allModules.Contains("LLA");
  591. LLBIsInstalled = allModules.Contains("LLB");
  592. EFEMIsInstalled = allModules.Contains("EFEM");
  593. TMIsInstalled = allModules.Contains("TM");
  594. timer = new DispatcherTimer();
  595. timer.Interval = TimeSpan.FromSeconds(0.5);
  596. addDataKeys();
  597. RtDataValues = QueryDataClient.Instance.Service.PollData(m_RtDataKeys);
  598. timer.Tick += Timer_Tick;
  599. timer.Start();
  600. if (PMAIsInstalled)
  601. {
  602. PMAChamberType = ((JetChamber)QueryDataClient.Instance.Service.GetConfig($"PMA.ChamberType")).ToString().Substring(6);
  603. }
  604. if (PMBIsInstalled)
  605. {
  606. PMBChamberType = ((JetChamber)QueryDataClient.Instance.Service.GetConfig($"PMB.ChamberType")).ToString().Substring(6);
  607. }
  608. if (PMCIsInstalled)
  609. {
  610. PMCChamberType = ((JetChamber)QueryDataClient.Instance.Service.GetConfig($"PMC.ChamberType")).ToString().Substring(6);
  611. }
  612. if (PMDIsInstalled)
  613. {
  614. PMDChamberType = ((JetChamber)QueryDataClient.Instance.Service.GetConfig($"PMD.ChamberType")).ToString().Substring(6);
  615. }
  616. SwitchFlag = false;
  617. ATMModeIsOn = Convert.ToBoolean(QueryDataClient.Instance.Service.GetConfig("System.IsATMMode"));
  618. LOG.Info("开启UI界面");
  619. }
  620. #endregion
  621. #region 命令方法
  622. private void OnLoad(object obj)
  623. {
  624. if (!SwitchFlag)
  625. {
  626. //var t = (obj as OperationOverView);
  627. LP1WaferAssociation = new WaferAssociationInfo();
  628. LP3WaferAssociation = new WaferAssociationInfo();
  629. LP2WaferAssociation = new WaferAssociationInfo();
  630. LP1WaferAssociation.ModuleData = ModuleManager.ModuleInfos["LP1"];
  631. LP2WaferAssociation.ModuleData = ModuleManager.ModuleInfos["LP2"];
  632. LP3WaferAssociation.ModuleData = ModuleManager.ModuleInfos["LP3"];
  633. SwitchFlag = true;
  634. PressureType = (PressureType)Convert.ToInt32(QueryDataClient.Instance.Service.GetData("System.PressureUnitType"));
  635. }
  636. }
  637. //private void T_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
  638. //{
  639. // if (timer.IsEnabled)
  640. // {
  641. // timer.Stop();
  642. // }
  643. // else
  644. // {
  645. // timer.Start();
  646. // }
  647. //}
  648. private void OnLoadWafer(object obj)
  649. {
  650. InvokeClient.Instance.Service.DoOperation($"{obj.ToString()}.Load", ModuleManager.ModuleInfos[obj.ToString()].ModuleID);
  651. }
  652. private void OnUnLoadWafer(object obj)
  653. {
  654. InvokeClient.Instance.Service.DoOperation($"{obj.ToString()}.Unload", ModuleManager.ModuleInfos[obj.ToString()].ModuleID);
  655. }
  656. private void OnSelectAll(object obj)
  657. {
  658. var info = obj as WaferAssociationInfo;
  659. var module = info.ModuleData.ModuleID;
  660. if (CommonFunction.GetValue<bool>(RtDataValues, $"{module}.IsLoaded"))
  661. {
  662. info.SlotFrom = 1;
  663. info.SlotTo = 25;
  664. AssociateSequence(info, true);
  665. }
  666. }
  667. private void OnUnSelectAll(object obj)
  668. {
  669. var info = obj as WaferAssociationInfo;
  670. var module = info.ModuleData.ModuleID;
  671. info.SlotFrom = 1;
  672. info.SlotTo = 25;
  673. AssociateSequence(info, false);
  674. }
  675. private void OnStart(object obj)
  676. {
  677. var info = obj as WaferAssociationInfo;
  678. InvokeClient.Instance.Service.DoOperation("System.StartJob", info.JobID);
  679. LOG.Info("System,Start Job");
  680. }
  681. private void OnStop(object obj)
  682. {
  683. var info = obj as WaferAssociationInfo;
  684. InvokeClient.Instance.Service.DoOperation("System.AbortJob", info.JobID);
  685. LOG.Info($"System,Stop Job{info.JobID}");
  686. }
  687. private void OnAbort(object obj)
  688. {
  689. var info = obj as WaferAssociationInfo;
  690. InvokeClient.Instance.Service.DoOperation("System.StopJob", info.JobID);
  691. LOG.Info($"System,Stop Job{info.JobID}");
  692. }
  693. private void OnHomeAll()
  694. {
  695. InvokeClient.Instance.Service.DoOperation("System.HomeAll");
  696. LOG.Info("System,Home All");
  697. }
  698. private void OnResumeAllJob()
  699. {
  700. var t = CommonFunction.GetValue<List<string>>(RtDataValues, "Scheduler.PjNameList");
  701. if (t == null && t.Count == 0)
  702. {
  703. return;
  704. }
  705. if (CommonFunction.GetValue<int>(RtDataValues, "EquipmentStatus") == 4)
  706. {
  707. t.ForEach(x =>
  708. {
  709. InvokeClient.Instance.Service.DoOperation("System.ResumeJob", x);
  710. });
  711. LOG.Info("System,Resume All Job");
  712. }
  713. else
  714. {
  715. t.ForEach(x =>
  716. {
  717. InvokeClient.Instance.Service.DoOperation("System.PauseJob", x);
  718. });
  719. LOG.Info("System,Pause All Job");
  720. }
  721. }
  722. private void OnAbortAll()
  723. {
  724. InvokeClient.Instance.Service.DoOperation("System.Abort");
  725. LOG.Info("System, Abort");
  726. }
  727. private void OnReturnAllWafer()
  728. {
  729. //Dialog
  730. //WaferDialogView dialog = new WaferDialogView()
  731. //{
  732. // Owner = Application.Current.MainWindow,
  733. //};
  734. //dialog.Height = 300;
  735. //dialog.Width = 400;
  736. //double angel = 0;
  737. //double coolingtime = 0;
  738. //string message = "Please Confirm Return Wafer";
  739. //WaferDialogViewModel vm = new WaferDialogViewModel();
  740. //vm.ConfirmText = message;
  741. //dialog.DataContext = vm;
  742. //if (dialog.ShowDialog() == true)
  743. //{
  744. // if ((bool)dialog.AlignFlag == true && !string.IsNullOrEmpty(dialog.Angle))
  745. // {
  746. // angel = Convert.ToDouble(dialog.Angle);
  747. // }
  748. // if ((bool)dialog.CoolingFlag == true && !string.IsNullOrEmpty(dialog.CoolingTime))
  749. // {
  750. // coolingtime = Convert.ToDouble(dialog.CoolingTime);
  751. // }
  752. //}
  753. InvokeClient.Instance.Service.DoOperation("System.ReturnAllWafer", false, 0, false, 0);
  754. LOG.Info("System,Return All Wafer");
  755. }
  756. private void OnSetSequence(object obj)
  757. {
  758. var info = obj as WaferInfo;
  759. bool flag = info.SequenceName != "" ? false : true;
  760. if (info.ModuleID == "LP1" && (CommonFunction.GetValue<bool>(RtDataValues, "LP1.IsLoaded")))
  761. {
  762. AssociateSequence(LP1WaferAssociation, flag, info.SlotID);
  763. }
  764. else if (info.ModuleID == "LP2" && (CommonFunction.GetValue<bool>(RtDataValues, "LP2.IsLoaded")))
  765. {
  766. AssociateSequence(LP2WaferAssociation, flag, info.SlotID);
  767. }
  768. else if (info.ModuleID == "LP3" && (CommonFunction.GetValue<bool>(RtDataValues, "LP3.IsLoaded")))
  769. {
  770. AssociateSequence(LP3WaferAssociation, flag, info.SlotID);
  771. }
  772. }
  773. private void OnCreateJob(object obj)
  774. {
  775. var info = obj as WaferAssociationInfo;
  776. List<string> slotSequence = new List<string>();
  777. info.ModuleData.WaferManager.Wafers.ForEach(key => { slotSequence.Insert(0, key.SequenceName); });
  778. //string jobId = info.LotId.Trim();
  779. info.LotIdSaved = true;
  780. Dictionary<string, object> param = new Dictionary<string, object>()
  781. {
  782. {"JobId", info.JobID},
  783. {"LotId", info.LotId},
  784. {"Module", info.ModuleData.ModuleID},
  785. {"SlotSequence", slotSequence.ToArray()},
  786. {"AutoStart", true},
  787. { "PreCleanRecipeName",info.PreCleanRecipeName},
  788. { "PostCleanRecipeName",info.PostCleanRecipeName},
  789. { "CycleNumber",info.CycleNumber}
  790. };
  791. InvokeClient.Instance.Service.DoOperation("System.CreateJob", param);
  792. }
  793. private void OnAbortJob(object obj)
  794. {
  795. InvokeClient.Instance.Service.DoOperation("System.AbortJob", obj.ToString());
  796. }
  797. private void OnEnableAuto()
  798. {
  799. InvokeClient.Instance.Service.DoOperation("System.SetAutoMode");
  800. }
  801. private void OnEnableManual()
  802. {
  803. InvokeClient.Instance.Service.DoOperation("System.SetManualMode");
  804. }
  805. private void OnLostFocus()
  806. {
  807. timer.Stop();
  808. }
  809. private void OnGotFocus()
  810. {
  811. timer.Start();
  812. }
  813. #endregion
  814. #region 私有方法
  815. private void Timer_Tick(object sender, EventArgs e)
  816. {
  817. RobotMoveInfo = (RobotMoveInfo)QueryDataClient.Instance.Service.GetData("TM.RobotMoveAction");
  818. EfemRobotMoveInfo = (RobotMoveInfo)QueryDataClient.Instance.Service.GetData("EFEM.RobotMoveAction");
  819. RtDataValues = QueryDataClient.Instance.Service.PollData(m_RtDataKeys);
  820. if (RtDataValues == null || RtDataValues.Count==0)
  821. {
  822. return;
  823. }
  824. LP1ModuleInfo = ModuleManager.ModuleInfos["LP1"];
  825. LP2ModuleInfo = ModuleManager.ModuleInfos["LP2"];
  826. LP3ModuleInfo = ModuleManager.ModuleInfos["LP3"];
  827. EFEMModuleInfo = ModuleManager.ModuleInfos["EfemRobot"];
  828. TMModuleInfo = ModuleManager.ModuleInfos["TMRobot"];
  829. BladeAWafer = ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[0];
  830. BladeBWafer = ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[1];
  831. if (LLAIsInstalled == true)
  832. {
  833. LLAModuleInfo = ModuleManager.ModuleInfos["LLA"];
  834. LLAWafer = ModuleManager.ModuleInfos["LLA"].WaferManager.Wafers.FirstOrDefault(x => x.WaferStatus != 0);
  835. }
  836. if (LLBIsInstalled == true)
  837. {
  838. LLBModuleInfo = ModuleManager.ModuleInfos["LLB"];
  839. LLBWafer = ModuleManager.ModuleInfos["LLB"].WaferManager.Wafers.FirstOrDefault(x => x.WaferStatus != 0);
  840. }
  841. if (PMAIsInstalled == true)
  842. {
  843. PMAWafer = ModuleManager.ModuleInfos["PMA"].WaferManager.Wafers[0];
  844. PMARecipeResult = CommonFunction.GetValue<RecipeResult>(RtDataValues, $"PMA.CurrentRecipeResult");
  845. }
  846. if (PMBIsInstalled == true)
  847. {
  848. PMBWafer = ModuleManager.ModuleInfos["PMB"].WaferManager.Wafers[0];
  849. PMBRecipeResult = CommonFunction.GetValue<RecipeResult>(RtDataValues, $"PMB.CurrentRecipeResult");
  850. }
  851. if (PMCIsInstalled == true)
  852. {
  853. PMCWafer = ModuleManager.ModuleInfos["PMC"].WaferManager.Wafers[0];
  854. PMCRecipeResult = CommonFunction.GetValue<RecipeResult>(RtDataValues, $"PMC.CurrentRecipeResult");
  855. }
  856. if (PMDIsInstalled == true)
  857. {
  858. PMDWafer = ModuleManager.ModuleInfos["PMD"].WaferManager.Wafers[0];
  859. PMDRecipeResult = CommonFunction.GetValue<RecipeResult>(RtDataValues, $"PMD.CurrentRecipeResult");
  860. }
  861. if (TMIsInstalled == true)
  862. {
  863. TMBladeAWafer = ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[0];
  864. TMBladeBWafer = ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[1];
  865. TMPressure = CommonFunction.GetValue<float>(RtDataValues, $"TM.TMProcessGauge.Value");
  866. }
  867. if (EFEMIsInstalled == true)
  868. {
  869. EFEMBladeAWafer = ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[0];
  870. EFEMBladeBWafer = ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[1];
  871. Aligner1Wafer = ModuleManager.ModuleInfos["Aligner1"].WaferManager.Wafers[0];
  872. ControlJobInfo lp1Cj = CommonFunction.GetValue<ControlJobInfo>(RtDataValues, "LP1.CurrentControlJob");
  873. if (lp1Cj == null)
  874. {
  875. ButtonIsEnableLP1 = true;
  876. }
  877. else
  878. {
  879. ButtonIsEnableLP1= false;
  880. UPdateWaferAssociation(LP1WaferAssociation, lp1Cj);
  881. }
  882. ControlJobInfo lp2Cj = CommonFunction.GetValue<ControlJobInfo>(RtDataValues, "LP2.CurrentControlJob");
  883. if (lp2Cj == null)
  884. {
  885. ButtonIsEnableLP2 = true;
  886. }
  887. else
  888. {
  889. ButtonIsEnableLP2 = false;
  890. UPdateWaferAssociation(LP2WaferAssociation, lp2Cj);
  891. }
  892. ControlJobInfo lp3Cj = CommonFunction.GetValue<ControlJobInfo>(RtDataValues, "LP3.CurrentControlJob");
  893. if (lp3Cj == null)
  894. {
  895. ButtonIsEnableLP3 = true;
  896. }
  897. else
  898. {
  899. ButtonIsEnableLP3 = false;
  900. UPdateWaferAssociation(LP3WaferAssociation, lp3Cj);
  901. }
  902. }
  903. //LP1WaferCount = LP1ModuleInfo.WaferManager.Wafers.Where(x => x.WaferStatus != 0).Count();
  904. //LP2WaferCount = LP2ModuleInfo.WaferManager.Wafers.Where(x => x.WaferStatus != 0).Count();
  905. //LP3WaferCount = LP3ModuleInfo.WaferManager.Wafers.Where(x => x.WaferStatus != 0).Count();
  906. if (CommonFunction.GetValue<int>(RtDataValues, "EquipmentStatus") == 4)
  907. {
  908. RouteState = "Resume";
  909. }
  910. else
  911. {
  912. RouteState = "Pause";
  913. }
  914. }
  915. /// <summary>
  916. /// 更新Wafer情况
  917. /// </summary>
  918. /// <param name="info"></param>
  919. /// <param name="cjInfo"></param>
  920. private void UPdateWaferAssociation(WaferAssociationInfo info, ControlJobInfo cjInfo)
  921. {
  922. if(info==null)
  923. {
  924. return;
  925. }
  926. if (cjInfo != null)
  927. {
  928. info.LotId = cjInfo.LotName;
  929. info.JobID = cjInfo.Name;
  930. info.JobStatus = cjInfo.State.ToString();
  931. if (cjInfo.SequenceNameList != null)
  932. {
  933. for (int i = 0; i < cjInfo.SequenceNameList.Length; i++)
  934. {
  935. info.ModuleData.WaferManager.Wafers[24 - i].SequenceName = cjInfo.SequenceNameList[i];
  936. }
  937. }
  938. info.PreCleanRecipeName = cjInfo.PreJobClean;
  939. info.PostCleanRecipeName = cjInfo.PostJobClean;
  940. }
  941. else
  942. {
  943. if (!string.IsNullOrEmpty(info.JobID))
  944. {
  945. info.LotId = "";
  946. info.JobID = "";
  947. info.JobStatus = "";
  948. info.PreCleanRecipeName = "";
  949. info.PostCleanRecipeName = "";
  950. AssociateSequence(info, false);
  951. }
  952. }
  953. }
  954. private async void TMRobotMoveInfoChanged(RobotMoveInfo oldValue, RobotMoveInfo newValue)
  955. {
  956. string RobotTarget;
  957. if (oldValue == null || newValue == null)
  958. {
  959. return;
  960. }
  961. #region Rotating
  962. if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && (newValue.Action == RobotAction.Rotating))
  963. {
  964. var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
  965. if (TMRobotMoveActionBladeTarget != null)
  966. {
  967. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  968. }
  969. else
  970. {
  971. return;
  972. }
  973. var values = RobotTarget.Split('.');
  974. var arm = values[0];
  975. var module = values[1];
  976. bool isParseOK;
  977. BladeNiceXinSongWaferRobotTAction = CommonFunction.ToEnum<NiceXinSongWaferRobotTAction>(module, out isParseOK);
  978. if (isParseOK == false)
  979. {
  980. return;
  981. }
  982. //if (arm == "ArmA")
  983. //{
  984. //}
  985. //else if (arm == "ArmB")
  986. //{
  987. // Blade2NiceXinSongWaferRobotTAction = (NiceXinSongWaferRobotTAction)Enum.Parse(typeof(NiceXinSongWaferRobotTAction), module, true);
  988. //}
  989. }
  990. #endregion
  991. #region pick 和 place LL
  992. if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && (newValue.Action == RobotAction.Placing || newValue.Action == RobotAction.Picking))
  993. {
  994. var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
  995. if (TMRobotMoveActionBladeTarget != null)
  996. {
  997. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  998. }
  999. else
  1000. {
  1001. return;
  1002. }
  1003. var values = RobotTarget.Split('.');
  1004. var arm = values[0];
  1005. var module = values[1];
  1006. if (arm == "ArmA")
  1007. {
  1008. bool isParseOK;
  1009. BladeNiceXinSongWaferRobotTAction = CommonFunction.ToEnum<NiceXinSongWaferRobotTAction>(module, out isParseOK);
  1010. if (isParseOK == false)
  1011. {
  1012. return;
  1013. }
  1014. //var waferRobotTAction = (NiceXinSongWaferRobotTAction)Enum.Parse(typeof(NiceXinSongWaferRobotTAction), module, true);
  1015. //BladeNiceXinSongWaferRobotTAction = waferRobotTAction;
  1016. await Task.Delay(600);
  1017. Blade1NiceXinSongWaferRobotXAction = NiceXinSongWaferRobotXAction.Extend1;
  1018. 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))
  1019. {
  1020. await Task.Delay(100);
  1021. }
  1022. //Robot1XAction = WaferRobotXAction.Retract;
  1023. Blade1NiceXinSongWaferRobotXAction = NiceXinSongWaferRobotXAction.Retract1;
  1024. }
  1025. else if (arm == "ArmB")
  1026. {
  1027. bool isParseOK;
  1028. BladeNiceXinSongWaferRobotTAction = CommonFunction.ToEnum<NiceXinSongWaferRobotTAction>(module, out isParseOK);
  1029. if (isParseOK == false)
  1030. {
  1031. return;
  1032. }
  1033. //var waferRobotTAction = (NiceXinSongWaferRobotTAction)Enum.Parse(typeof(NiceXinSongWaferRobotTAction), module, true);
  1034. //BladeNiceXinSongWaferRobotTAction = waferRobotTAction;
  1035. //var waferRobotTAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  1036. //var waferRobotTAction = (NiceXinSongWaferRobotTAction)Enum.Parse(typeof(NiceXinSongWaferRobotTAction), module, true);
  1037. //Blade2NiceXinSongWaferRobotTAction = waferRobotTAction;
  1038. //if (waferRobotTAction != Blade2NiceXinSongWaferRobotTAction)
  1039. //{
  1040. //}
  1041. await Task.Delay(600);
  1042. Blade2NiceXinSongWaferRobotXAction = NiceXinSongWaferRobotXAction.Extend2;
  1043. 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))
  1044. {
  1045. await Task.Delay(100);
  1046. }
  1047. Blade2NiceXinSongWaferRobotXAction = NiceXinSongWaferRobotXAction.Retract2;
  1048. }
  1049. }
  1050. #endregion
  1051. #region pick 和 place pm
  1052. else if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && newValue.Action == RobotAction.Extending)
  1053. {
  1054. var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
  1055. if (TMRobotMoveActionBladeTarget != null)
  1056. {
  1057. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  1058. }
  1059. else
  1060. {
  1061. return;
  1062. }
  1063. var values = RobotTarget.Split('.');
  1064. var arm = values[0];
  1065. var module = values[1];
  1066. bool isParseOK;
  1067. BladeNiceXinSongWaferRobotTAction = CommonFunction.ToEnum<NiceXinSongWaferRobotTAction>(module, out isParseOK);
  1068. if (isParseOK == false)
  1069. {
  1070. return;
  1071. }
  1072. //var waferRobotTAction = (NiceXinSongWaferRobotTAction)Enum.Parse(typeof(NiceXinSongWaferRobotTAction), module, true);
  1073. //BladeNiceXinSongWaferRobotTAction = waferRobotTAction;
  1074. if (arm == "ArmA")
  1075. {
  1076. await Task.Delay(600);
  1077. Blade1NiceXinSongWaferRobotXAction = NiceXinSongWaferRobotXAction.Extend1;
  1078. }
  1079. else if (arm == "ArmB")
  1080. {
  1081. await Task.Delay(600);
  1082. Blade2NiceXinSongWaferRobotXAction = NiceXinSongWaferRobotXAction.Extend2;
  1083. }
  1084. }
  1085. else if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && newValue.Action == RobotAction.Retracting)
  1086. {
  1087. var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
  1088. if (TMRobotMoveActionBladeTarget != null)
  1089. {
  1090. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  1091. }
  1092. else
  1093. {
  1094. return;
  1095. }
  1096. var values = RobotTarget.Split('.');
  1097. var arm = values[0];
  1098. if (arm == "ArmA")
  1099. {
  1100. //Robot1XAction = WaferRobotXAction.Retract;
  1101. Blade1NiceXinSongWaferRobotXAction = NiceXinSongWaferRobotXAction.Retract1;
  1102. }
  1103. else if (arm == "ArmB")
  1104. {
  1105. //Robot2XAction = WaferRobotXAction.Retract;
  1106. Blade2NiceXinSongWaferRobotXAction = NiceXinSongWaferRobotXAction.Retract2;
  1107. }
  1108. }
  1109. #endregion
  1110. #region Home
  1111. else if (oldValue.Action == RobotAction.None && newValue.Action == RobotAction.Homing)
  1112. {
  1113. Blade1NiceXinSongWaferRobotXAction = NiceXinSongWaferRobotXAction.Retract1;
  1114. Blade2NiceXinSongWaferRobotXAction = NiceXinSongWaferRobotXAction.Retract2;
  1115. await Task.Delay(2000);
  1116. BladeNiceXinSongWaferRobotTAction = NiceXinSongWaferRobotTAction.T_Origin;
  1117. }
  1118. #endregion
  1119. }
  1120. private async void EFEMRobotMoveInfoChanged(RobotMoveInfo oldValue, RobotMoveInfo newValue)
  1121. {
  1122. string RobotTarget;
  1123. if (oldValue == null || newValue == null)
  1124. {
  1125. return;
  1126. }
  1127. #region pick 和 place LL
  1128. if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget))
  1129. {
  1130. var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
  1131. if (TMRobotMoveActionBladeTarget != null)
  1132. {
  1133. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  1134. }
  1135. else
  1136. {
  1137. return;
  1138. }
  1139. var values = RobotTarget.Split('.');
  1140. var arm = values[0];
  1141. var module = values[1];
  1142. if (arm == "ArmA")
  1143. {
  1144. var bladeWaferRobotTAction = (NiceGuangChuanWaferRobotTAction)Enum.Parse(typeof(NiceGuangChuanWaferRobotTAction), module, true);
  1145. if (BladeNiceGuangChuanWaferRobotTAction != bladeWaferRobotTAction)
  1146. {
  1147. BladeNiceGuangChuanWaferRobotTAction = bladeWaferRobotTAction;
  1148. await Task.Delay(600);
  1149. }
  1150. Blade1NiceGuangChuanWaferRobotXAction = NiceGuangChuanWaferRobotXAction.Extend1;
  1151. //Robot3XAction = WaferRobotXAction.Extend;
  1152. 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))
  1153. {
  1154. await Task.Delay(100);
  1155. }
  1156. //Robot3XAction = WaferRobotXAction.Retract;
  1157. Blade1NiceGuangChuanWaferRobotXAction = NiceGuangChuanWaferRobotXAction.Retract1;
  1158. }
  1159. else if (arm == "ArmB")
  1160. {
  1161. var bladeWaferRobotTAction = (NiceGuangChuanWaferRobotTAction)Enum.Parse(typeof(NiceGuangChuanWaferRobotTAction), module, true);
  1162. if (BladeNiceGuangChuanWaferRobotTAction != bladeWaferRobotTAction)
  1163. {
  1164. BladeNiceGuangChuanWaferRobotTAction = bladeWaferRobotTAction;
  1165. await Task.Delay(600);
  1166. }
  1167. //var blade2WaferRobotTAction = (NiceGuangChuanWaferRobotTAction)Enum.Parse(typeof(NiceGuangChuanWaferRobotTAction), module, true);
  1168. //if (Blade2NiceGuangChuanWaferRobotTAction != blade2WaferRobotTAction)
  1169. //{
  1170. // Blade2NiceGuangChuanWaferRobotTAction = blade2WaferRobotTAction;
  1171. // await Task.Delay(600);
  1172. //}
  1173. Blade2NiceGuangChuanWaferRobotXAction = NiceGuangChuanWaferRobotXAction.Extend2;
  1174. 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))
  1175. {
  1176. await Task.Delay(100);
  1177. }
  1178. // Robot4XAction = WaferRobotXAction.Retract;
  1179. Blade2NiceGuangChuanWaferRobotXAction = NiceGuangChuanWaferRobotXAction.Retract2;
  1180. }
  1181. }
  1182. #endregion
  1183. #region Home
  1184. else if (oldValue.Action == RobotAction.Homing && newValue.Action == RobotAction.None)
  1185. {
  1186. Blade1NiceGuangChuanWaferRobotXAction = NiceGuangChuanWaferRobotXAction.Retract1;
  1187. Blade2NiceGuangChuanWaferRobotXAction = NiceGuangChuanWaferRobotXAction.Retract2;
  1188. await Task.Delay(1000);
  1189. BladeNiceGuangChuanWaferRobotTAction = NiceGuangChuanWaferRobotTAction.T_Origin;
  1190. //Blade2NiceGuangChuanWaferRobotTAction = NiceGuangChuanWaferRobotTAction.T_Origin;
  1191. }
  1192. #endregion
  1193. }
  1194. private void addDataKeys()
  1195. {
  1196. if (PMAIsInstalled)
  1197. {
  1198. m_RtDataKeys.Add("PMA.IsSlitDoorClosed");
  1199. m_RtDataKeys.Add("PMA.CurrentRecipeResult");
  1200. m_RtDataKeys.Add("PMA.IsOnline");
  1201. m_RtDataKeys.Add("PMA.CalculationPressure");
  1202. m_RtDataKeys.Add("PMA.IsLidClosed");
  1203. m_RtDataKeys.Add("PMA.HighTemperatureHeater.DeviceData");
  1204. }
  1205. if (PMBIsInstalled)
  1206. {
  1207. m_RtDataKeys.Add("PMB.IsSlitDoorClosed");
  1208. m_RtDataKeys.Add("PMB.CurrentRecipeResult");
  1209. m_RtDataKeys.Add("PMB.IsOnline");
  1210. m_RtDataKeys.Add("PMB.CalculationPressure");
  1211. m_RtDataKeys.Add("PMB.IsLidClosed");
  1212. m_RtDataKeys.Add("PMB.HighTemperatureHeater.DeviceData");
  1213. }
  1214. if (PMCIsInstalled)
  1215. {
  1216. m_RtDataKeys.Add("PMC.IsSlitDoorClosed");
  1217. m_RtDataKeys.Add("PMC.CurrentRecipeResult");
  1218. m_RtDataKeys.Add("PMC.IsOnline");
  1219. m_RtDataKeys.Add("PMC.CalculationPressure");
  1220. m_RtDataKeys.Add("PMC.IsLidClosed");
  1221. m_RtDataKeys.Add("PMC.HighTemperatureHeater.DeviceData");
  1222. }
  1223. if (PMDIsInstalled)
  1224. {
  1225. m_RtDataKeys.Add("PMD.IsSlitDoorClosed");
  1226. m_RtDataKeys.Add("PMD.CurrentRecipeResult");
  1227. m_RtDataKeys.Add("PMD.IsOnline");
  1228. m_RtDataKeys.Add("PMD.CalculationPressure");
  1229. m_RtDataKeys.Add("PMD.IsLidClosed");
  1230. m_RtDataKeys.Add("PMD.HighTemperatureHeater.DeviceData");
  1231. }
  1232. m_RtDataKeys.Add("TM.LLATSlitDoor.IsClosed");
  1233. m_RtDataKeys.Add("TM.LLBTSlitDoor.IsClosed");
  1234. m_RtDataKeys.Add("TM.LLAESlitDoor.IsClosed");
  1235. m_RtDataKeys.Add("TM.LLBESlitDoor.IsClosed");
  1236. m_RtDataKeys.Add("TM.IsOnline");
  1237. m_RtDataKeys.Add("TM.TMProcessGauge.Value");
  1238. m_RtDataKeys.Add("TM.IoSensor.TMATMSwitch.Value");
  1239. m_RtDataKeys.Add("TM.IoSensor.TMVacSwitch.Value");
  1240. m_RtDataKeys.Add("TM.TMProcessGauge.Value");
  1241. //m_RtDataKeys.Add("TM.TMLidClosed");
  1242. //m_RtDataKeys.Add("TM.LLALidClosed");
  1243. //m_RtDataKeys.Add("TM.LLBLidClosed");
  1244. m_RtDataKeys.Add("TM.PMASlitDoor.IsClosed");
  1245. m_RtDataKeys.Add("TM.PMBSlitDoor.IsClosed");
  1246. m_RtDataKeys.Add("TM.PMCSlitDoor.IsClosed");
  1247. m_RtDataKeys.Add("TM.PMDSlitDoor.IsClosed");
  1248. m_RtDataKeys.Add("LLA.IsOnline");
  1249. m_RtDataKeys.Add($"TM.LLAPressureGauge.Value");
  1250. m_RtDataKeys.Add($"TM.IoSensor.LLAVacSwitch.Value");
  1251. m_RtDataKeys.Add($"TM.IoSensor.LLAATMSwitch.Value");
  1252. m_RtDataKeys.Add("LLB.IsOnline");
  1253. m_RtDataKeys.Add($"TM.LLBPressureGauge.Value");
  1254. m_RtDataKeys.Add($"TM.IoSensor.LLBVacSwitch.Value");
  1255. m_RtDataKeys.Add($"TM.IoSensor.LLBATMSwitch.Value");
  1256. m_RtDataKeys.Add("LP1.IsLoaded");
  1257. m_RtDataKeys.Add("LP2.IsLoaded");
  1258. m_RtDataKeys.Add("LP3.IsLoaded");
  1259. m_RtDataKeys.Add("LP1.CassettePlaced");
  1260. m_RtDataKeys.Add("LP2.CassettePlaced");
  1261. m_RtDataKeys.Add("LP3.CassettePlaced");
  1262. m_RtDataKeys.Add("LP1.CurrentControlJob");
  1263. m_RtDataKeys.Add("LP2.CurrentControlJob");
  1264. m_RtDataKeys.Add("LP3.CurrentControlJob");
  1265. m_RtDataKeys.Add("EFEM.IsOnline");
  1266. m_RtDataKeys.Add("System.IsAutoMode");
  1267. m_RtDataKeys.Add("System.IsBusy");
  1268. m_RtDataKeys.Add("LP1.CycledCount");
  1269. m_RtDataKeys.Add("LP1.CycledWafer");
  1270. m_RtDataKeys.Add("LP1.CycleSetPoint");
  1271. //m_RtDataKeys.Add("LP1.Throughput");
  1272. m_RtDataKeys.Add("LP2.CycledCount");
  1273. m_RtDataKeys.Add("LP2.CycledWafer");
  1274. m_RtDataKeys.Add("LP2.CycleSetPoint");
  1275. //m_RtDataKeys.Add("LP2.Throughput");
  1276. m_RtDataKeys.Add("LP3.CycledCount");
  1277. m_RtDataKeys.Add("LP3.CycledWafer");
  1278. m_RtDataKeys.Add("LP3.CycleSetPoint");
  1279. //m_RtDataKeys.Add("LP3.Throughput");
  1280. m_RtDataKeys.Add("EquipmentStatus");
  1281. m_RtDataKeys.Add("Scheduler.PjNameList");
  1282. m_RtDataKeys.Add("LLA.CoolingTime");
  1283. m_RtDataKeys.Add("LLB.CoolingTime");
  1284. }
  1285. private void AssociateSequence(WaferAssociationInfo info, bool flag, int slot = -1)
  1286. {
  1287. List<WaferInfo> wafers = info.ModuleData.WaferManager.Wafers;
  1288. if (slot >= 0) //by wafer
  1289. {
  1290. int index = wafers.Count - slot - 1;
  1291. if (index < wafers.Count)
  1292. {
  1293. if (flag && HasWaferOnSlot(wafers, index))
  1294. wafers[index].SequenceName = info.SequenceName;
  1295. else
  1296. wafers[index].SequenceName = string.Empty;
  1297. }
  1298. }
  1299. else //by from-to
  1300. {
  1301. for (int i = info.SlotFrom - 1; i < info.SlotTo; i++)
  1302. {
  1303. int index = wafers.Count - i - 1;
  1304. if (index < wafers.Count)
  1305. {
  1306. if (flag && HasWaferOnSlot(wafers, index))
  1307. wafers[index].SequenceName = info.SequenceName;
  1308. else
  1309. wafers[index].SequenceName = string.Empty;
  1310. }
  1311. }
  1312. }
  1313. switch (info.ModuleData.ModuleID)
  1314. {
  1315. case "LP1":
  1316. LP1WaferAssociation = info;
  1317. break;
  1318. case "LP2":
  1319. LP2WaferAssociation = info;
  1320. break;
  1321. case "LP3":
  1322. LP3WaferAssociation = info;
  1323. break;
  1324. }
  1325. }
  1326. private bool HasWaferOnSlot(List<WaferInfo> wafers, int index)
  1327. {
  1328. if (wafers[index].WaferStatus == 0)
  1329. return false;
  1330. return true;
  1331. }
  1332. public void EnterExitView(bool isEnter)
  1333. {
  1334. if (isEnter)
  1335. {
  1336. Timer_Tick(null, null);
  1337. timer.Start();
  1338. }
  1339. else
  1340. {
  1341. timer.Stop();
  1342. }
  1343. }
  1344. #endregion
  1345. }
  1346. }