OperationOverViewModel.cs 61 KB

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