TMViewModel.cs 47 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295
  1. using Aitex.Sorter.Common;
  2. using MECF.Framework.Common.CommonData;
  3. using MECF.Framework.Common.DataCenter;
  4. using MECF.Framework.Common.Equipment;
  5. using MECF.Framework.Common.OperationCenter;
  6. using MECF.Framework.Common.Schedulers;
  7. using OpenSEMI.ClientBase;
  8. using Prism.Commands;
  9. using Prism.Mvvm;
  10. using System;
  11. using System.Collections.Generic;
  12. using System.Collections.ObjectModel;
  13. using System.Linq;
  14. using System.Threading.Tasks;
  15. using System.Windows.Threading;
  16. using Venus_Core;
  17. using Venus_MainPages.Unity;
  18. using Venus_Themes.CustomControls;
  19. using Venus_Themes.Unity;
  20. namespace Venus_MainPages.ViewModels
  21. {
  22. public enum TMModule
  23. {
  24. PMA, PMB, PMC, PMD, LLA, LLB
  25. }
  26. public enum TMBlade
  27. {
  28. Blade1, Blade2
  29. }
  30. internal class TMViewModel : BindableBase
  31. {
  32. #region 私有字段
  33. //private ModuleInfo m_PMAWafer;
  34. private ModuleInfo m_LLAModuleInfo;
  35. private ModuleInfo m_LLBModuleInfo;
  36. private ModuleInfo m_TMModuleInfo;
  37. private bool m_TMIsOFFline;
  38. private bool m_LLIsOFFline;
  39. private WaferInfo m_PMAWafer;
  40. private WaferInfo m_PMBWafer;
  41. private WaferInfo m_PMCWafer;
  42. private WaferInfo m_PMDWafer;
  43. private WaferInfo m_LLAWafer;
  44. private WaferInfo m_LLBWafer;
  45. private WaferInfo m_BladeAWafer;
  46. private WaferInfo m_BladeBWafer;
  47. private bool m_PMADoorIsOpen;
  48. //private bool m_PMBDoorIsOpen;
  49. //private bool m_PMCDoorIsOpen;
  50. //private bool m_PMDDoorIsOpen;
  51. private bool m_LLADoorIsOpen;
  52. private WaferRobotTAction m_WaferRobotTAction;
  53. private WaferRobotTAction m_Robot1TAction;
  54. private WaferRobotXAction m_Robot1XAction;
  55. private WaferRobotTAction m_Robot2TAction;
  56. private WaferRobotXAction m_Robot2XAction;
  57. private TMModule m_PickSelectedModule;
  58. private TMModule m_PlaceSelectedModule;
  59. private TMModule m_ExtendSelectedModule;
  60. private TMModule m_RetractSelectedModule;
  61. private TMBlade m_PickSelectedBlade;
  62. private TMBlade m_PlaceSelectedBlade;
  63. private TMBlade m_ExtendSelectedBlade;
  64. private TMBlade m_RetractSelectedBlade;
  65. private TMBlade m_GoToSelectedBlade;
  66. private ObservableCollection<int> m_PlaceSoltItemsSource = new ObservableCollection<int>();
  67. private ObservableCollection<int> m_PickSoltItemsSource = new ObservableCollection<int>();
  68. private ObservableCollection<int> m_ExtendSoltItemsSource = new ObservableCollection<int>();
  69. private ObservableCollection<int> m_RetractSoltItemsSource = new ObservableCollection<int>();
  70. private int m_PickSoltSelectedIndex;
  71. private int m_PlaceSoltSelectedIndex;
  72. private int m_ExtendSoltSelectedIndex;
  73. private int m_RetractSoltSelectedIndex;
  74. private List<string> m_RtDataKeys=new List<string> ();
  75. private Dictionary<string, object> m_RtDataValues;
  76. private string m_ModuleCheckedName="TM";
  77. private string m_RobotAction;
  78. private string m_RobotTarget;
  79. private string m_RobotArm;
  80. private bool m_PMAIsInstalled;
  81. private bool m_PMBIsInstalled;
  82. private bool m_PMCIsInstalled;
  83. private bool m_PMDIsInstalled;
  84. private bool m_LLAIsInstalled;
  85. private bool m_LLBIsInstalled;
  86. private bool m_TMIsInstalled;
  87. private List<string> m_OriginalCycle=new List<string> ();
  88. private List<string> m_ToCycle = new List<string>();
  89. private List<TMModule> m_TMModules= new List<TMModule>();
  90. private bool m_CycleEnable;
  91. private string m_OriginalCycleSelectedItem;
  92. private string m_ToCycleSelectedItem;
  93. private bool m_PMAIsCycle;
  94. private bool m_PMBIsCycle;
  95. private bool m_PMCIsCycle;
  96. private bool m_PMDIsCycle;
  97. private int m_CycleCount;
  98. #endregion
  99. #region 属性
  100. public List<string> OriginalCycle
  101. {
  102. get { return m_OriginalCycle; }
  103. set { SetProperty(ref m_OriginalCycle, value); }
  104. }
  105. public List<string> ToCycle
  106. {
  107. get { return m_ToCycle; }
  108. set { SetProperty(ref m_ToCycle, value); }
  109. }
  110. public string RobotAction2
  111. {
  112. get { return m_RobotAction; }
  113. set
  114. {
  115. //RobotActiont(m_RobotAction, value);
  116. SetProperty(ref m_RobotAction, value);
  117. }
  118. }
  119. public RobotMoveInfo m_robotMoveInfo;
  120. public RobotMoveInfo RobotMoveInfo
  121. {
  122. get { return m_robotMoveInfo; }
  123. set
  124. {
  125. RobotMoveInfoChanged(m_robotMoveInfo, value);
  126. m_robotMoveInfo = value;
  127. }
  128. }
  129. public string RobotTarget
  130. {
  131. get { return m_RobotTarget; }
  132. set
  133. {
  134. SetProperty(ref m_RobotTarget, value);
  135. }
  136. }
  137. public string RobotArm
  138. {
  139. get { return m_RobotArm; }
  140. set
  141. {
  142. SetProperty(ref m_RobotArm, value);
  143. }
  144. }
  145. int arm1oldWaferStatus = 100;
  146. int arm2oldWaferStatus = 100;
  147. private async void RobotMoveInfoChanged(RobotMoveInfo oldValue, RobotMoveInfo newValue)
  148. {
  149. string RobotTarget;
  150. if (oldValue == null || newValue == null)
  151. {
  152. return;
  153. }
  154. #region Rotating
  155. if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && (newValue.Action == RobotAction.Rotating))
  156. {
  157. var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
  158. if (TMRobotMoveActionBladeTarget != null)
  159. {
  160. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  161. }
  162. else
  163. {
  164. return;
  165. }
  166. var values = RobotTarget.Split('.');
  167. var arm = values[0];
  168. var module = values[1];
  169. if (arm == "ArmA")
  170. {
  171. Robot1TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  172. }
  173. else if (arm == "ArmB")
  174. {
  175. Robot2TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  176. }
  177. }
  178. #endregion
  179. #region pick 和 place LL
  180. else if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && (newValue.Action == RobotAction.Placing || newValue.Action == RobotAction.Picking))
  181. {
  182. var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
  183. if (TMRobotMoveActionBladeTarget != null)
  184. {
  185. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  186. }
  187. else
  188. {
  189. return;
  190. }
  191. var values = RobotTarget.Split('.');
  192. var arm = values[0];
  193. var module = values[1];
  194. if (arm == "ArmA")
  195. {
  196. var waferRobotTAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  197. if (waferRobotTAction != Robot1TAction)
  198. {
  199. Robot1TAction = waferRobotTAction;
  200. }
  201. else
  202. {
  203. //await Task.Delay(100);
  204. }
  205. await Task.Delay(600);
  206. //Robot1TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  207. //await Task.Delay(600);
  208. Robot1XAction = WaferRobotXAction.Extend;
  209. 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))
  210. {
  211. await Task.Delay(100);
  212. }
  213. Robot1XAction = WaferRobotXAction.Retract;
  214. }
  215. else if (arm == "ArmB")
  216. {
  217. var waferRobotTAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  218. if (waferRobotTAction != Robot2TAction)
  219. {
  220. Robot2TAction = waferRobotTAction;
  221. }
  222. else
  223. {
  224. //await Task.Delay(100);
  225. }
  226. await Task.Delay(600);
  227. //Robot2TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  228. //await Task.Delay(600);
  229. Robot2XAction = WaferRobotXAction.Extend;
  230. 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))
  231. {
  232. await Task.Delay(100);
  233. }
  234. Robot2XAction = WaferRobotXAction.Retract;
  235. }
  236. }
  237. #endregion
  238. #region pick 和 place pm
  239. else if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && newValue.Action == RobotAction.Extending)
  240. {
  241. var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
  242. if (TMRobotMoveActionBladeTarget != null)
  243. {
  244. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  245. }
  246. else
  247. {
  248. return;
  249. }
  250. var values = RobotTarget.Split('.');
  251. var arm = values[0];
  252. var module = values[1];
  253. if (arm == "ArmA")
  254. {
  255. var waferRobotTAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  256. if (waferRobotTAction != Robot1TAction)
  257. {
  258. Robot1TAction = waferRobotTAction;
  259. }
  260. else
  261. {
  262. // await Task.Delay(100);
  263. }
  264. await Task.Delay(600);
  265. Robot1XAction = WaferRobotXAction.Extend;
  266. }
  267. else if (arm == "ArmB")
  268. {
  269. var waferRobotTAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  270. if (waferRobotTAction != Robot2TAction)
  271. {
  272. Robot2TAction = waferRobotTAction;
  273. }
  274. else
  275. {
  276. // await Task.Delay(100);
  277. }
  278. await Task.Delay(600);
  279. Robot2XAction = WaferRobotXAction.Extend;
  280. }
  281. }
  282. else if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && newValue.Action == RobotAction.Retracting)
  283. {
  284. var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
  285. if (TMRobotMoveActionBladeTarget != null)
  286. {
  287. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  288. }
  289. else
  290. {
  291. return;
  292. }
  293. var values = RobotTarget.Split('.');
  294. var arm = values[0];
  295. if (arm == "ArmA")
  296. {
  297. Robot1XAction = WaferRobotXAction.Retract;
  298. }
  299. else if (arm == "ArmB")
  300. {
  301. Robot2XAction = WaferRobotXAction.Retract;
  302. }
  303. }
  304. #endregion
  305. #region Home
  306. else if (oldValue.Action == RobotAction.None && newValue.Action == RobotAction.Homing)
  307. {
  308. if (Robot1XAction == WaferRobotXAction.Extend)
  309. {
  310. Robot1XAction = WaferRobotXAction.Retract;
  311. }
  312. if (Robot2XAction == WaferRobotXAction.Extend)
  313. {
  314. Robot2XAction = WaferRobotXAction.Retract;
  315. }
  316. await Task.Delay(2000);
  317. if (Robot1TAction != WaferRobotTAction.T_Origin)
  318. {
  319. Robot1TAction = WaferRobotTAction.T_Origin;
  320. }
  321. if (Robot2TAction != WaferRobotTAction.T_Origin)
  322. {
  323. Robot2TAction = WaferRobotTAction.T_Origin;
  324. }
  325. }
  326. #endregion
  327. }
  328. private async void RobotActiont(string oldValue,string newValue)
  329. {
  330. if (oldValue == "None" && newValue == "Placing" && ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[0].WaferStatus==1)
  331. {
  332. var TMRobotMoveActionBladeTarget = QueryDataClient.Instance.Service.GetData("TM.RobotMoveAction.BladeTarget");
  333. if (TMRobotMoveActionBladeTarget != null)
  334. {
  335. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  336. }
  337. else
  338. {
  339. return;
  340. }
  341. var values = RobotTarget.Split('.');
  342. var arm = values[0];
  343. var module = values[1];
  344. Robot1TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  345. await Task.Delay(1500);
  346. Robot1XAction = WaferRobotXAction.Extend;
  347. if (arm == "ArmA")
  348. {
  349. Robot1TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  350. await Task.Delay(1500);
  351. Robot1XAction = WaferRobotXAction.Extend;
  352. }
  353. else if (arm == "ArmB")
  354. {
  355. Robot2TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  356. await Task.Delay(1500);
  357. Robot2XAction = WaferRobotXAction.Extend;
  358. }
  359. }
  360. if (oldValue == "None" && newValue == "Placing" && ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[1].WaferStatus == 1)
  361. {
  362. var TMRobotMoveActionBladeTarget = QueryDataClient.Instance.Service.GetData("TM.RobotMoveAction.BladeTarget");
  363. if (TMRobotMoveActionBladeTarget != null)
  364. {
  365. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  366. }
  367. else
  368. {
  369. return;
  370. }
  371. var values = RobotTarget.Split('.');
  372. var arm = values[0];
  373. var module = values[1];
  374. if (arm == "ArmA")
  375. {
  376. Robot1TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  377. await Task.Delay(1500);
  378. Robot1XAction = WaferRobotXAction.Extend;
  379. }
  380. else if (arm == "ArmB")
  381. {
  382. Robot2TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  383. await Task.Delay(1500);
  384. Robot2XAction = WaferRobotXAction.Extend;
  385. }
  386. //Robot2TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  387. //await Task.Delay(1500);
  388. //Robot2XAction = WaferRobotXAction.Extend;
  389. }
  390. if (arm1oldWaferStatus != ModuleManager.ModuleInfos["TM"].WaferManager.Wafers[0].WaferStatus)
  391. {
  392. Robot1XAction = WaferRobotXAction.Retract;
  393. }
  394. if (arm2oldWaferStatus != ModuleManager.ModuleInfos["TM"].WaferManager.Wafers[1].WaferStatus)
  395. {
  396. Robot2XAction = WaferRobotXAction.Retract;
  397. }
  398. if (oldValue == "None" && newValue == "Picking" && ModuleManager.ModuleInfos["TM"].WaferManager.Wafers[1].WaferStatus == 0)
  399. {
  400. var TMRobotMoveActionBladeTarget = QueryDataClient.Instance.Service.GetData("TM.RobotMoveAction.BladeTarget");
  401. if (TMRobotMoveActionBladeTarget != null)
  402. {
  403. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  404. }
  405. else
  406. {
  407. return;
  408. }
  409. var values = RobotTarget.Split('.');
  410. var arm = values[0];
  411. var module = values[1];
  412. if (arm == "ArmA")
  413. {
  414. Robot1TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  415. await Task.Delay(1500);
  416. Robot1XAction = WaferRobotXAction.Extend;
  417. }
  418. else if (arm == "ArmB")
  419. {
  420. Robot2TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  421. await Task.Delay(1500);
  422. Robot2XAction = WaferRobotXAction.Extend;
  423. }
  424. }
  425. #region pick 和 place pm
  426. if (oldValue == "None" && newValue == "Extending")
  427. {
  428. var TMRobotMoveActionBladeTarget = QueryDataClient.Instance.Service.GetData("TM.RobotMoveAction.BladeTarget");
  429. if (TMRobotMoveActionBladeTarget != null)
  430. {
  431. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  432. }
  433. else
  434. {
  435. return;
  436. }
  437. var values = RobotTarget.Split('.');
  438. var arm = values[0];
  439. var module = values[1];
  440. if (arm == "ArmA")
  441. {
  442. Robot1TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  443. await Task.Delay(1500);
  444. Robot1XAction = WaferRobotXAction.Extend;
  445. }
  446. else if (arm == "ArmB")
  447. {
  448. Robot2TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
  449. await Task.Delay(1500);
  450. Robot2XAction = WaferRobotXAction.Extend;
  451. }
  452. }
  453. if (oldValue == "None" && newValue == "Retracting")
  454. {
  455. var TMRobotMoveActionBladeTarget = QueryDataClient.Instance.Service.GetData("TM.RobotMoveAction.BladeTarget");
  456. if (TMRobotMoveActionBladeTarget != null)
  457. {
  458. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  459. }
  460. else
  461. {
  462. return;
  463. }
  464. var values = RobotTarget.Split('.');
  465. var arm = values[0];
  466. if (arm == "ArmA")
  467. {
  468. Robot1XAction = WaferRobotXAction.Retract;
  469. }
  470. else if (arm == "ArmB")
  471. {
  472. Robot2XAction = WaferRobotXAction.Retract;
  473. }
  474. }
  475. #endregion
  476. arm1oldWaferStatus = ModuleManager.ModuleInfos["TM"].WaferManager.Wafers[0].WaferStatus;
  477. arm2oldWaferStatus = ModuleManager.ModuleInfos["TM"].WaferManager.Wafers[1].WaferStatus;
  478. }
  479. public WaferInfo LLAWafer
  480. {
  481. get { return m_LLAWafer; }
  482. set { SetProperty(ref m_LLAWafer, value); }
  483. }
  484. public WaferInfo LLBWafer
  485. {
  486. get { return m_LLBWafer; }
  487. set { SetProperty(ref m_LLBWafer, value); }
  488. }
  489. public WaferInfo PMAWafer
  490. {
  491. get { return m_PMAWafer; }
  492. set { SetProperty(ref m_PMAWafer, value); }
  493. }
  494. public WaferInfo PMBWafer
  495. {
  496. get { return m_PMBWafer; }
  497. set { SetProperty(ref m_PMBWafer, value); }
  498. }
  499. public WaferInfo PMCWafer
  500. {
  501. get { return m_PMCWafer; }
  502. set { SetProperty(ref m_PMCWafer, value); }
  503. }
  504. public WaferInfo PMDWafer
  505. {
  506. get { return m_PMDWafer; }
  507. set { SetProperty(ref m_PMDWafer, value); }
  508. }
  509. public WaferInfo BladeAWafer
  510. {
  511. get { return m_BladeAWafer; }
  512. set { SetProperty(ref m_BladeAWafer, value); }
  513. }
  514. public WaferInfo BladeBWafer
  515. {
  516. get { return m_BladeBWafer; }
  517. set { SetProperty(ref m_BladeBWafer, value); }
  518. }
  519. public ModuleInfo LLAModuleInfo
  520. {
  521. get { return m_LLAModuleInfo; }
  522. set { SetProperty(ref m_LLAModuleInfo, value); }
  523. }
  524. public ModuleInfo LLBModuleInfo
  525. {
  526. get { return m_LLBModuleInfo; }
  527. set { SetProperty(ref m_LLBModuleInfo, value); }
  528. }
  529. public ModuleInfo TMModuleInfo
  530. {
  531. get { return m_TMModuleInfo; }
  532. set { SetProperty(ref m_TMModuleInfo, value); }
  533. }
  534. public bool TMIsOFFline
  535. {
  536. get { return m_TMIsOFFline; }
  537. set { SetProperty(ref m_TMIsOFFline, value); }
  538. }
  539. public bool LLIsOFFline
  540. {
  541. get { return m_LLIsOFFline; }
  542. set { SetProperty(ref m_LLIsOFFline, value); }
  543. }
  544. public bool PMADoorIsOpen
  545. {
  546. get { return m_PMADoorIsOpen; }
  547. set { SetProperty(ref m_PMADoorIsOpen, value); }
  548. }
  549. public bool LLADoorIsOpen
  550. {
  551. get { return m_LLADoorIsOpen; }
  552. set { SetProperty(ref m_LLADoorIsOpen, value); }
  553. }
  554. public WaferRobotTAction WaferRobotTAction
  555. {
  556. get { return m_WaferRobotTAction; }
  557. set { SetProperty(ref m_WaferRobotTAction, value); }
  558. }
  559. public WaferRobotTAction Robot1TAction
  560. {
  561. get { return m_Robot1TAction; }
  562. set { SetProperty(ref m_Robot1TAction, value); }
  563. }
  564. public WaferRobotXAction Robot1XAction
  565. {
  566. get { return m_Robot1XAction; }
  567. set { SetProperty(ref m_Robot1XAction, value); }
  568. }
  569. public WaferRobotTAction Robot2TAction
  570. {
  571. get { return m_Robot2TAction; }
  572. set { SetProperty(ref m_Robot2TAction, value); }
  573. }
  574. public WaferRobotXAction Robot2XAction
  575. {
  576. get { return m_Robot2XAction; }
  577. set { SetProperty(ref m_Robot2XAction, value); }
  578. }
  579. public TMModule PickSelectedModule
  580. {
  581. get { return m_PickSelectedModule; }
  582. set { SetProperty(ref m_PickSelectedModule, value); }
  583. }
  584. public TMModule PlaceSelectedModule
  585. {
  586. get { return m_PlaceSelectedModule; }
  587. set { SetProperty(ref m_PlaceSelectedModule, value); }
  588. }
  589. public TMModule ExtendSelectedModule
  590. {
  591. get { return m_ExtendSelectedModule; }
  592. set { SetProperty(ref m_ExtendSelectedModule, value); }
  593. }
  594. public TMModule RetractSelectedModule
  595. {
  596. get { return m_RetractSelectedModule; }
  597. set { SetProperty(ref m_RetractSelectedModule, value); }
  598. }
  599. public TMBlade PickSelectedBlade
  600. {
  601. get { return m_PickSelectedBlade; }
  602. set { SetProperty(ref m_PickSelectedBlade, value); }
  603. }
  604. public TMBlade PlaceSelectedBlade
  605. {
  606. get { return m_PlaceSelectedBlade; }
  607. set { SetProperty(ref m_PlaceSelectedBlade, value); }
  608. }
  609. public TMBlade ExtendSelectedBlade
  610. {
  611. get { return m_ExtendSelectedBlade; }
  612. set { SetProperty(ref m_ExtendSelectedBlade, value); }
  613. }
  614. public TMBlade RetractSelectedBlade
  615. {
  616. get { return m_RetractSelectedBlade; }
  617. set { SetProperty(ref m_RetractSelectedBlade, value); }
  618. }
  619. public TMBlade GoToSelectedBlade
  620. {
  621. get { return m_GoToSelectedBlade; }
  622. set { SetProperty(ref m_GoToSelectedBlade, value); }
  623. }
  624. public ObservableCollection<int> PickSoltItemsSource
  625. {
  626. get { return m_PickSoltItemsSource; }
  627. set { SetProperty(ref m_PickSoltItemsSource, value); }
  628. }
  629. public ObservableCollection<int> PlaceSoltItemsSource
  630. {
  631. get { return m_PlaceSoltItemsSource; }
  632. set { SetProperty(ref m_PlaceSoltItemsSource, value); }
  633. }
  634. public ObservableCollection<int> ExtendSoltItemsSource
  635. {
  636. get { return m_ExtendSoltItemsSource; }
  637. set { SetProperty(ref m_ExtendSoltItemsSource, value); }
  638. }
  639. public ObservableCollection<int> RetractSoltItemsSource
  640. {
  641. get { return m_RetractSoltItemsSource; }
  642. set { SetProperty(ref m_RetractSoltItemsSource, value); }
  643. }
  644. public int PickSoltSelectedIndex
  645. {
  646. get { return m_PickSoltSelectedIndex; }
  647. set { SetProperty(ref m_PickSoltSelectedIndex, value); }
  648. }
  649. public int PlaceSoltSelectedIndex
  650. {
  651. get { return m_PlaceSoltSelectedIndex; }
  652. set { SetProperty(ref m_PlaceSoltSelectedIndex, value); }
  653. }
  654. public int ExtendSoltSelectedIndex
  655. {
  656. get { return m_ExtendSoltSelectedIndex; }
  657. set { SetProperty(ref m_ExtendSoltSelectedIndex, value); }
  658. }
  659. public int RetractSoltSelectedIndex
  660. {
  661. get { return m_RetractSoltSelectedIndex; }
  662. set { SetProperty(ref m_RetractSoltSelectedIndex, value); }
  663. }
  664. public Dictionary<string, object> RtDataValues
  665. {
  666. get { return m_RtDataValues; }
  667. set { SetProperty(ref m_RtDataValues, value); }
  668. }
  669. public bool PMAIsInstalled
  670. {
  671. get { return m_PMAIsInstalled; }
  672. set { SetProperty(ref m_PMAIsInstalled, value); }
  673. }
  674. public bool PMBIsInstalled
  675. {
  676. get { return m_PMBIsInstalled; }
  677. set { SetProperty(ref m_PMBIsInstalled, value); }
  678. }
  679. public bool PMCIsInstalled
  680. {
  681. get { return m_PMCIsInstalled; }
  682. set { SetProperty(ref m_PMCIsInstalled, value); }
  683. }
  684. public bool PMDIsInstalled
  685. {
  686. get { return m_PMDIsInstalled; }
  687. set { SetProperty(ref m_PMDIsInstalled, value); }
  688. }
  689. public bool LLAIsInstalled
  690. {
  691. get { return m_LLAIsInstalled; }
  692. set { SetProperty(ref m_LLAIsInstalled, value); }
  693. }
  694. public bool LLBIsInstalled
  695. {
  696. get { return m_LLBIsInstalled; }
  697. set { SetProperty(ref m_LLBIsInstalled, value); }
  698. }
  699. public bool TMIsInstalled
  700. {
  701. get { return m_TMIsInstalled; }
  702. set { SetProperty(ref m_TMIsInstalled, value); }
  703. }
  704. public List<TMModule> TMModules
  705. {
  706. get { return m_TMModules; }
  707. set { SetProperty(ref m_TMModules, value); }
  708. }
  709. public bool CycleEnable
  710. {
  711. get { return m_CycleEnable; }
  712. set { SetProperty(ref m_CycleEnable, value); }
  713. }
  714. public string OriginalCycleSelectedItem
  715. {
  716. get { return m_OriginalCycleSelectedItem; }
  717. set { SetProperty(ref m_OriginalCycleSelectedItem, value); }
  718. }
  719. public string ToCycleSelectedItem
  720. {
  721. get { return m_ToCycleSelectedItem; }
  722. set { SetProperty(ref m_ToCycleSelectedItem, value); }
  723. }
  724. public bool PMAIsCycle
  725. {
  726. get { return m_PMAIsCycle; }
  727. set { SetProperty(ref m_PMAIsCycle, value); }
  728. }
  729. public bool PMBIsCycle
  730. {
  731. get { return m_PMBIsCycle; }
  732. set { SetProperty(ref m_PMBIsCycle, value); }
  733. }
  734. public bool PMCIsCycle
  735. {
  736. get { return m_PMCIsCycle; }
  737. set { SetProperty(ref m_PMCIsCycle, value); }
  738. }
  739. public bool PMDIsCycle
  740. {
  741. get { return m_PMDIsCycle; }
  742. set { SetProperty(ref m_PMDIsCycle, value); }
  743. }
  744. public int CycleCount
  745. {
  746. get { return m_CycleCount; }
  747. set { SetProperty(ref m_CycleCount, value); }
  748. }
  749. #endregion
  750. #region 命令
  751. private DelegateCommand _RobotHomeCommand;
  752. public DelegateCommand RobotHomeCommand =>
  753. _RobotHomeCommand ?? (_RobotHomeCommand = new DelegateCommand(OnRobotHome));
  754. private DelegateCommand _GotoCommand;
  755. public DelegateCommand GotoCommand =>
  756. _GotoCommand ?? (_GotoCommand = new DelegateCommand(OnGoto));
  757. private DelegateCommand _ExtendCommand;
  758. public DelegateCommand ExtendCommand =>
  759. _ExtendCommand ?? (_ExtendCommand = new DelegateCommand(OnExtend));
  760. private DelegateCommand _RetractCommand;
  761. public DelegateCommand RetractCommand =>
  762. _RetractCommand ?? (_RetractCommand = new DelegateCommand(OnRetract));
  763. private DelegateCommand<object> _ModuleChangeCommand;
  764. public DelegateCommand<object> ModuleChangeCommand =>
  765. _ModuleChangeCommand ?? (_ModuleChangeCommand = new DelegateCommand<object>(OnModuleChange));
  766. private DelegateCommand _PickCommand;
  767. public DelegateCommand PickCommand =>
  768. _PickCommand ?? (_PickCommand = new DelegateCommand(OnPick));
  769. private DelegateCommand _PlaceCommand;
  770. public DelegateCommand PlaceCommand =>
  771. _PlaceCommand ?? (_PlaceCommand = new DelegateCommand(OnPlace));
  772. private DelegateCommand _HomeCommand;
  773. public DelegateCommand HomeCommand =>
  774. _HomeCommand ?? (_HomeCommand = new DelegateCommand(OnHome));
  775. private DelegateCommand _VentCommand;
  776. public DelegateCommand VentCommand =>
  777. _VentCommand ?? (_VentCommand = new DelegateCommand(OnVent));
  778. private DelegateCommand _PumpCommand;
  779. public DelegateCommand PumpCommand =>
  780. _PumpCommand ?? (_PumpCommand = new DelegateCommand(OnPump));
  781. private DelegateCommand _PurgeCommand;
  782. public DelegateCommand PurgeCommand =>
  783. _PurgeCommand ?? (_PurgeCommand = new DelegateCommand(OnPurge));
  784. private DelegateCommand<object> _ModuleCheckedCommand;
  785. public DelegateCommand<object> ModuleCheckedCommand =>
  786. _ModuleCheckedCommand ?? (_ModuleCheckedCommand = new DelegateCommand<object>(OnModuleChecked));
  787. private DelegateCommand _AbortCommand;
  788. public DelegateCommand AbortCommand =>
  789. _AbortCommand ?? (_AbortCommand = new DelegateCommand(OnAbort));
  790. private DelegateCommand _StartCycleCommand;
  791. public DelegateCommand StartCycleCommand =>
  792. _StartCycleCommand ?? (_StartCycleCommand = new DelegateCommand(OnStartCycle));
  793. private DelegateCommand _StopCycleCommand;
  794. public DelegateCommand StopCycleCommand =>
  795. _StopCycleCommand ?? (_StopCycleCommand = new DelegateCommand(OnStopCycle));
  796. private DelegateCommand _SystemHomeCommand;
  797. public DelegateCommand SystemHomeCommand =>
  798. _SystemHomeCommand ?? (_SystemHomeCommand = new DelegateCommand(OnSystemHome));
  799. private DelegateCommand<object> _ChamberDoorOpenCommand;
  800. public DelegateCommand<object> ChamberDoorOpenCommand =>
  801. _ChamberDoorOpenCommand ?? (_ChamberDoorOpenCommand = new DelegateCommand<object>(OnChamberDoorOpen));
  802. private DelegateCommand<object> _ChamberDoorCloseCommand;
  803. public DelegateCommand<object> ChamberDoorCloseCommand =>
  804. _ChamberDoorCloseCommand ?? (_ChamberDoorCloseCommand = new DelegateCommand<object>(OnChamberDoorClose));
  805. #endregion
  806. #region 构造函数
  807. public TMViewModel()
  808. {
  809. string allModules = QueryDataClient.Instance.Service.GetConfig($"System.InstalledModules").ToString();
  810. PMAIsInstalled = allModules.Contains("PMA");
  811. PMBIsInstalled = allModules.Contains("PMB");
  812. PMCIsInstalled = allModules.Contains("PMC");
  813. PMDIsInstalled = allModules.Contains("PMD");
  814. LLAIsInstalled = allModules.Contains("LLA");
  815. LLBIsInstalled = allModules.Contains("LLB");
  816. TMIsInstalled= allModules.Contains("TM");
  817. if (PMAIsInstalled == true)
  818. {
  819. TMModules.Add(TMModule.PMA);
  820. }
  821. if (PMBIsInstalled == true)
  822. {
  823. TMModules.Add(TMModule.PMB);
  824. }
  825. if (PMCIsInstalled == true)
  826. {
  827. TMModules.Add(TMModule.PMC);
  828. }
  829. if (PMDIsInstalled == true)
  830. {
  831. TMModules.Add(TMModule.PMD);
  832. }
  833. if (LLAIsInstalled == true)
  834. {
  835. OriginalCycle.Add("LLA");
  836. ToCycle.Add("LLA");
  837. TMModules.Add(TMModule.LLA);
  838. }
  839. if (LLBIsInstalled == true)
  840. {
  841. OriginalCycle.Add("LLB");
  842. ToCycle.Add("LLB");
  843. TMModules.Add(TMModule.LLB);
  844. }
  845. addDataKeys();
  846. DispatcherTimer timer = new DispatcherTimer();
  847. timer.Interval = TimeSpan.FromSeconds(0.1);
  848. timer.Tick += Timer_Tick;
  849. timer.Start();
  850. PickSoltItemsSource.Add(1);
  851. PlaceSoltItemsSource.Add(1);
  852. ExtendSoltItemsSource.Add(1);
  853. RetractSoltItemsSource.Add(1);
  854. //Robot1TAction = WaferRobotTAction.PMA;
  855. //Robot2TAction = WaferRobotTAction.PMD;
  856. //UIEvents.PMDoorRaiseChangedEvent += UIEvents_PMDoorRaiseChangedEvent;
  857. //UIEvents.LLTDoorRaiseChangedEvent += UIEvents_LLTDoorRaiseChangedEvent;
  858. //UIEvents.LLEDoorRaiseChangedEvent += UIEvents_LLEDoorRaiseChangedEvent;
  859. }
  860. private void Timer_Tick(object sender, EventArgs e)
  861. {
  862. if (LLAIsInstalled == true)
  863. {
  864. LLAWafer = ModuleManager.ModuleInfos["LLA"].WaferManager.Wafers.FirstOrDefault(x=>x.WaferStatus!=0);
  865. LLAModuleInfo = ModuleManager.ModuleInfos["LLA"];
  866. }
  867. if (LLBIsInstalled == true)
  868. {
  869. LLBWafer = ModuleManager.ModuleInfos["LLB"].WaferManager.Wafers.FirstOrDefault(x => x.WaferStatus != 0);
  870. LLBModuleInfo = ModuleManager.ModuleInfos["LLB"];
  871. }
  872. if (PMAIsInstalled == true)
  873. {
  874. PMAWafer = ModuleManager.ModuleInfos["PMA"].WaferManager.Wafers[0];
  875. }
  876. if (PMBIsInstalled == true)
  877. {
  878. PMBWafer = ModuleManager.ModuleInfos["PMB"].WaferManager.Wafers[0];
  879. }
  880. if (PMCIsInstalled == true)
  881. {
  882. PMCWafer = ModuleManager.ModuleInfos["PMC"].WaferManager.Wafers[0];
  883. }
  884. if (PMDIsInstalled == true)
  885. {
  886. PMDWafer = ModuleManager.ModuleInfos["PMD"].WaferManager.Wafers[0];
  887. }
  888. if (TMIsInstalled == true)
  889. {
  890. BladeAWafer = ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[0];
  891. BladeBWafer = ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[1];
  892. TMModuleInfo = ModuleManager.ModuleInfos["TMRobot"];
  893. }
  894. RtDataValues = QueryDataClient.Instance.Service.PollData(m_RtDataKeys);
  895. var TMRobotMoveActionArmTarget = QueryDataClient.Instance.Service.GetData("TM.RobotMoveAction.ArmTarget");
  896. if (TMRobotMoveActionArmTarget != null)
  897. {
  898. RobotArm = ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[0].WaferStatus.ToString();
  899. }
  900. var TMRobotMoveActionBladeTarget = QueryDataClient.Instance.Service.GetData("TM.RobotMoveAction.BladeTarget");
  901. if (TMRobotMoveActionBladeTarget != null)
  902. {
  903. RobotTarget = TMRobotMoveActionBladeTarget.ToString();
  904. }
  905. var TMRobotMoveActionRobotAction = QueryDataClient.Instance.Service.GetData("TM.RobotMoveAction.RobotAction");
  906. if (TMRobotMoveActionRobotAction != null)
  907. {
  908. RobotAction2 = TMRobotMoveActionRobotAction.ToString();
  909. }
  910. RobotMoveInfo = (RobotMoveInfo)QueryDataClient.Instance.Service.GetData("TM.RobotMoveAction");
  911. }
  912. #endregion
  913. #region 命令方法
  914. private void OnRobotHome()
  915. {
  916. InvokeClient.Instance.Service.DoOperation($"TM.RobotHome", "TMRobot");
  917. }
  918. private void OnGoto()
  919. {
  920. //if (GoToSelectedBlade == TMBlade.Blade1)
  921. //{
  922. // Robot1TAction = WaferRobotTAction;
  923. //}
  924. //else if (GoToSelectedBlade == TMBlade.Blade2)
  925. //{
  926. // Robot2TAction = WaferRobotTAction;
  927. //}
  928. var moduleName = (ModuleName)Enum.Parse(typeof(ModuleName), WaferRobotTAction.ToString(), true);
  929. var selectedHand = (Hand)Enum.Parse(typeof(Hand), GoToSelectedBlade.ToString(), true);
  930. InvokeClient.Instance.Service.DoOperation($"TM.{RtOperation.Goto}", moduleName, 0, selectedHand);
  931. }
  932. private void OnExtend()
  933. {
  934. var moduleName = (ModuleName)Enum.Parse(typeof(ModuleName), PlaceSelectedModule.ToString(), true);
  935. var selectedHand = (Hand)Enum.Parse(typeof(Hand), PlaceSelectedBlade.ToString(), true);
  936. InvokeClient.Instance.Service.DoOperation($"TM.{RtOperation.Extend}", moduleName, 0, selectedHand);
  937. }
  938. private void OnRetract()
  939. {
  940. var moduleName = (ModuleName)Enum.Parse(typeof(ModuleName), PlaceSelectedModule.ToString(), true);
  941. var selectedHand = (Hand)Enum.Parse(typeof(Hand), PlaceSelectedBlade.ToString(), true);
  942. InvokeClient.Instance.Service.DoOperation($"TM.{RtOperation.Retract}", moduleName, 0, selectedHand);
  943. }
  944. private void OnModuleChange(object obj)
  945. {
  946. var value = obj.ToString();
  947. switch (value)
  948. {
  949. case "Pick":
  950. PickSoltItemsSource.Clear();
  951. if ((int)PickSelectedModule == 4)
  952. {
  953. for (int i = 1; i <= LLAModuleInfo.WaferManager.Wafers.Count; i++)
  954. {
  955. PickSoltItemsSource.Add(i);
  956. }
  957. }
  958. else if ((int)PickSelectedModule == 5)
  959. {
  960. for (int i = 1; i <= LLBModuleInfo.WaferManager.Wafers.Count; i++)
  961. {
  962. PickSoltItemsSource.Add(i);
  963. }
  964. }
  965. else
  966. {
  967. PickSoltItemsSource.Add(1);
  968. }
  969. PickSoltSelectedIndex = 0;
  970. break;
  971. case "Place":
  972. PlaceSoltItemsSource.Clear();
  973. if ((int)PlaceSelectedModule == 4)
  974. {
  975. for (int i = 1; i <= LLAModuleInfo.WaferManager.Wafers.Count; i++)
  976. {
  977. PlaceSoltItemsSource.Add(i);
  978. }
  979. }
  980. else if ((int)PlaceSelectedModule == 5)
  981. {
  982. for (int i = 1; i <= LLBModuleInfo.WaferManager.Wafers.Count; i++)
  983. {
  984. PlaceSoltItemsSource.Add(i);
  985. }
  986. }
  987. else
  988. {
  989. PlaceSoltItemsSource.Add(1);
  990. }
  991. PlaceSoltSelectedIndex = 0;
  992. break;
  993. case "Extend":
  994. ExtendSoltItemsSource.Clear();
  995. if ((int)ExtendSelectedModule == 4)
  996. {
  997. for (int i = 1; i <= LLAModuleInfo.WaferManager.Wafers.Count; i++)
  998. {
  999. ExtendSoltItemsSource.Add(i);
  1000. }
  1001. }
  1002. else if ((int)ExtendSelectedModule == 5)
  1003. {
  1004. for (int i = 1; i <= LLBModuleInfo.WaferManager.Wafers.Count; i++)
  1005. {
  1006. ExtendSoltItemsSource.Add(i);
  1007. }
  1008. }
  1009. else
  1010. {
  1011. ExtendSoltItemsSource.Add(1);
  1012. }
  1013. ExtendSoltSelectedIndex = 0;
  1014. break;
  1015. case "Retract":
  1016. RetractSoltItemsSource.Clear();
  1017. if ((int)RetractSelectedModule == 4)
  1018. {
  1019. for (int i = 1; i <= LLAModuleInfo.WaferManager.Wafers.Count; i++)
  1020. {
  1021. RetractSoltItemsSource.Add(i);
  1022. }
  1023. //RetractSoltItemsSource = new List<int> { 1, 2, 3, 4, 5, 6, 7, 8 };
  1024. }
  1025. else if ((int)RetractSelectedModule == 5)
  1026. {
  1027. for (int i = 1; i <= LLBModuleInfo.WaferManager.Wafers.Count; i++)
  1028. {
  1029. RetractSoltItemsSource.Add(i);
  1030. }
  1031. }
  1032. else
  1033. {
  1034. RetractSoltItemsSource.Add(1);
  1035. }
  1036. RetractSoltSelectedIndex = 0;
  1037. break;
  1038. }
  1039. }
  1040. private void OnPick()
  1041. {
  1042. Queue<MoveItem> moveItems = new Queue<MoveItem>();
  1043. var moduleName= (ModuleName)Enum.Parse(typeof(ModuleName), PickSelectedModule.ToString(), true);
  1044. var selectedHand= (Hand)Enum.Parse(typeof(Hand), PickSelectedBlade.ToString(), true);
  1045. MoveItem moveItem = new MoveItem(moduleName, PickSoltItemsSource[PickSoltSelectedIndex] - 1, 0, 0, selectedHand);
  1046. moveItems.Enqueue(moveItem);
  1047. if ((int)PickSelectedModule > 3)
  1048. {
  1049. InvokeClient.Instance.Service.DoOperation($"TM.{RtOperation.LLPick}", moveItems);
  1050. }
  1051. else
  1052. {
  1053. InvokeClient.Instance.Service.DoOperation($"TM.{RtOperation.PMPick}", moveItems);
  1054. }
  1055. }
  1056. private void OnPlace()
  1057. {
  1058. Queue<MoveItem> moveItems = new Queue<MoveItem>();
  1059. var moduleName = (ModuleName)Enum.Parse(typeof(ModuleName), PlaceSelectedModule.ToString(), true);
  1060. var selectedHand = (Hand)Enum.Parse(typeof(Hand), PlaceSelectedBlade.ToString(), true);
  1061. MoveItem moveItem = new MoveItem(0,0,moduleName, PlaceSoltItemsSource[PlaceSoltSelectedIndex]-1, selectedHand);
  1062. moveItems.Enqueue(moveItem);
  1063. if ((int)PlaceSelectedModule > 3)
  1064. {
  1065. InvokeClient.Instance.Service.DoOperation($"TM.{RtOperation.LLPlace}", moveItems);
  1066. }
  1067. else
  1068. {
  1069. InvokeClient.Instance.Service.DoOperation($"TM.{RtOperation.PMPlace}", moveItems);
  1070. }
  1071. }
  1072. private void OnHome()
  1073. {
  1074. InvokeClient.Instance.Service.DoOperation($"{m_ModuleCheckedName}.Home");
  1075. }
  1076. private void OnVent()
  1077. {
  1078. InvokeClient.Instance.Service.DoOperation($"{m_ModuleCheckedName}.{RtOperation.Vent}");
  1079. }
  1080. private void OnPump()
  1081. {
  1082. InvokeClient.Instance.Service.DoOperation($"{m_ModuleCheckedName}.{RtOperation.Pump}");
  1083. }
  1084. private void OnPurge()
  1085. {
  1086. InvokeClient.Instance.Service.DoOperation($"{m_ModuleCheckedName}.{RtOperation.Purge}");
  1087. }
  1088. private void OnModuleChecked(object obj)
  1089. {
  1090. m_ModuleCheckedName=obj.ToString();
  1091. }
  1092. private void OnAbort()
  1093. {
  1094. InvokeClient.Instance.Service.DoOperation($"{m_ModuleCheckedName}.{RtOperation.Abort}");
  1095. }
  1096. private void OnStartCycle()
  1097. {
  1098. if (CycleEnable == false)
  1099. {
  1100. return;
  1101. }
  1102. List<string> strings = new List<string>();
  1103. if (OriginalCycleSelectedItem != "")
  1104. {
  1105. strings.Add(OriginalCycleSelectedItem);
  1106. }
  1107. else
  1108. {
  1109. return;
  1110. }
  1111. if (PMAIsCycle==true)
  1112. {
  1113. strings.Add("PMA");
  1114. }
  1115. if (PMBIsCycle == true)
  1116. {
  1117. strings.Add("PMB");
  1118. }
  1119. if (PMCIsCycle == true)
  1120. {
  1121. strings.Add("PMC");
  1122. }
  1123. if (PMDIsCycle == true)
  1124. {
  1125. strings.Add("PMD");
  1126. }
  1127. if (ToCycleSelectedItem != "")
  1128. {
  1129. strings.Add(ToCycleSelectedItem);
  1130. }
  1131. else
  1132. {
  1133. return;
  1134. }
  1135. InvokeClient.Instance.Service.DoOperation("TMCycle.Start", strings.ToArray(),CycleCount);
  1136. }
  1137. private void OnStopCycle()
  1138. {
  1139. InvokeClient.Instance.Service.DoOperation("TMCycle.Abort");
  1140. }
  1141. private void OnSystemHome()
  1142. {
  1143. InvokeClient.Instance.Service.DoOperation("System.Home");
  1144. }
  1145. private void OnChamberDoorOpen(object obj)
  1146. {
  1147. InvokeClient.Instance.Service.DoOperation($"{obj?.ToString()}.SlitDoor.Open");
  1148. }
  1149. private void OnChamberDoorClose(object obj)
  1150. {
  1151. InvokeClient.Instance.Service.DoOperation($"{obj?.ToString()}.SlitDoor.Close");
  1152. }
  1153. #endregion
  1154. #region 私有方法
  1155. private void addDataKeys()
  1156. {
  1157. m_RtDataKeys.Add("PMA.IsSlitDoorClosed");
  1158. m_RtDataKeys.Add("PMB.IsSlitDoorClosed");
  1159. m_RtDataKeys.Add("PMC.IsSlitDoorClosed");
  1160. m_RtDataKeys.Add("PMD.IsSlitDoorClosed");
  1161. m_RtDataKeys.Add("TM.LLATSlitDoor.IsClosed");
  1162. m_RtDataKeys.Add("TM.LLBTSlitDoor.IsClosed");
  1163. m_RtDataKeys.Add("TM.LLAESlitDoor.IsClosed");
  1164. m_RtDataKeys.Add("TM.LLBESlitDoor.IsClosed");
  1165. m_RtDataKeys.Add("TMCycle.CycleIndex");
  1166. }
  1167. //private void UIEvents_PMDoorRaiseChangedEvent(DoorPara obj)
  1168. //{
  1169. // InvokeClient.Instance.Service.DoOperation($"{obj?.ModuleName}.SlitDoor.{obj?.IsOpen}");
  1170. //}
  1171. //private void UIEvents_LLTDoorRaiseChangedEvent(DoorPara obj)
  1172. //{
  1173. // InvokeClient.Instance.Service.DoOperation($"TM.{obj.ModuleName}TSlitDoor.{obj?.IsOpen}");
  1174. //}
  1175. //private void UIEvents_LLEDoorRaiseChangedEvent(DoorPara obj)
  1176. //{
  1177. // InvokeClient.Instance.Service.DoOperation($"TM.{obj.ModuleName}ESlitDoor.{obj?.IsOpen}");
  1178. //}
  1179. #endregion
  1180. }
  1181. }