OperationOverViewModel.cs 58 KB

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