OperationOverViewModel.cs 51 KB

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