OperationOverViewModel.cs 56 KB

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