TMViewModel.cs 47 KB

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