DeviceManager.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using Aitex.Core.Common;
  5. using Aitex.Core.RT.Device;
  6. using Aitex.Core.RT.OperationCenter;
  7. using Aitex.Core.RT.SCCore;
  8. using Aitex.RT.Device.Custom;
  9. using MECF.Framework.Common.Equipment;
  10. using Venus_RT.Modules;
  11. using Venus_RT.Devices;
  12. using Venus_RT.Devices.EPD;
  13. using Venus_Core;
  14. using Aitex.Common.Util;
  15. using System.Reflection;
  16. using Venus_RT.Devices.AdLinkEthercat;
  17. using System.Windows;
  18. using Aitex.Core.RT.Log;
  19. //using Venus_RT.Devices.TM;
  20. namespace Venus_RT.Instances
  21. {
  22. public class DeviceEntity : DeviceEntityT<DeviceManager>
  23. {
  24. public DeviceEntity()
  25. {
  26. }
  27. }
  28. public class DeviceManager : DeviceManagerBase
  29. {
  30. private string device_model_file;
  31. private readonly string device_model_file_MF;
  32. private readonly string device_model_file_SEMF;
  33. private readonly string device_model_file_DEMF;
  34. Int32 v_board_id = -1;
  35. Int32 v_StartAxisID = 0;
  36. Int32 BUS_No = 0;
  37. private bool startEthercatOK;
  38. public DeviceManager()
  39. {
  40. device_model_file_MF = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config\\", "TM", RtInstance.DeviceModelFileName_MF);
  41. device_model_file_SEMF = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config\\", "TM", RtInstance.DeviceModelFileName_SE);
  42. device_model_file_DEMF = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config\\", "TM", RtInstance.DeviceModelFileName_DE);
  43. }
  44. public bool InitEthercat()
  45. {
  46. Int32 boardID_InBits = 0;
  47. Int32 mode = 0;
  48. Int32 ret = 0;
  49. Int32 card_name = 0;
  50. Int32 tamp = 0;
  51. Int32 StartAxisID = 0;
  52. Int32 TotalAxisNum = 0;
  53. // Card(Board) initial
  54. ret = APS168.APS_initial(ref boardID_InBits, mode);
  55. if (ret == 0)
  56. {
  57. for (int i = 0; i < 16; i++)
  58. {
  59. tamp = (boardID_InBits >> i) & 1;
  60. if (tamp == 1)
  61. {
  62. ret = APS168.APS_get_card_name(i, ref card_name);
  63. if ((card_name >= (Int32)APS_Define.DEVICE_NAME_EM_2P00)
  64. && (card_name <= (Int32)APS_Define.DEVICE_NAME_EM_FA00))
  65. {
  66. ret = APS168.APS_get_first_axisId(i, ref StartAxisID, ref TotalAxisNum);
  67. //v_card_name = card_name;
  68. v_board_id = i;
  69. v_StartAxisID = StartAxisID;
  70. LOG.Write(eEvent.EV_DEVICE_INFO, ModuleName.System, "Ethercat Initial Success!");
  71. break;
  72. }
  73. }
  74. }
  75. if (v_board_id == -1)
  76. {
  77. LOG.Write(eEvent.ERR_DEVICE_INFO, ModuleName.System, $"Ethercat Board Id search Fail!");
  78. }
  79. else
  80. {
  81. LOG.Write(eEvent.EV_DEVICE_INFO, ModuleName.System, "Ethercat Board Id search Success!");
  82. return true;
  83. }
  84. }
  85. else
  86. {
  87. LOG.Write(eEvent.ERR_DEVICE_INFO, ModuleName.System, $"Ethercat Initial Fail!");
  88. }
  89. return false;
  90. }
  91. public bool StarteEthercat()
  92. {
  93. Int32 ret = 0;
  94. Int32 Board_ID = v_board_id;
  95. ret = APS168.APS_start_field_bus(Board_ID, BUS_No, v_StartAxisID);
  96. if (ret != 0)
  97. {
  98. LOG.Write(eEvent.ERR_DEVICE_INFO, ModuleName.System, $"Ethercat Start field bus Fail");
  99. return false;
  100. }
  101. else
  102. {
  103. LOG.Write(eEvent.EV_DEVICE_INFO, ModuleName.System, $"Ethercat Start field bus Success");
  104. return true;
  105. }
  106. }
  107. public override bool Initialize()
  108. {
  109. if (SC.GetValue<bool>("System.IsEnableEthercat"))
  110. {
  111. if (InitEthercat())
  112. {
  113. if (StarteEthercat())
  114. {
  115. startEthercatOK = true;
  116. }
  117. }
  118. }
  119. if (ModuleHelper.IsInstalled(ModuleName.PMA))
  120. {
  121. JetChamber jetChamber = (JetChamber)SC.GetValue<int>("PMA.ChamberType");
  122. InitPM(ModuleName.PMA, jetChamber);
  123. }
  124. if (ModuleHelper.IsInstalled(ModuleName.PMB))
  125. {
  126. JetChamber jetChamber = (JetChamber)SC.GetValue<int>("PMB.ChamberType");
  127. InitPM(ModuleName.PMB, jetChamber);
  128. }
  129. if (ModuleHelper.IsInstalled(ModuleName.PMC))
  130. {
  131. JetChamber jetChamber = (JetChamber)SC.GetValue<int>("PMC.ChamberType");
  132. InitPM(ModuleName.PMC, jetChamber);
  133. }
  134. if (ModuleHelper.IsInstalled(ModuleName.PMD))
  135. {
  136. JetChamber jetChamber = (JetChamber)SC.GetValue<int>("PMD.ChamberType");
  137. InitPM(ModuleName.PMD, jetChamber);
  138. }
  139. //if (ModuleHelper.IsInstalled(ModuleName.TM))
  140. //{
  141. // if (RtInstance.ConfigType == ConfigType.Kepler2200 || RtInstance.ConfigType == ConfigType.Kepler2300)
  142. // InitTM(ModuleName.TM);
  143. // if (RtInstance.ConfigType == ConfigType.VenusSE)
  144. // {
  145. // InitSETM(ModuleName.TM);
  146. // }
  147. // if (RtInstance.ConfigType == ConfigType.VenusDE)
  148. // {
  149. // InitDETM(ModuleName.TM);
  150. // }
  151. //}
  152. //if (RtInstance.ConfigType != ConfigType.VenusDE && RtInstance.ConfigType != ConfigType.VenusSE)
  153. // AddCustomModuleDevice(new KeplerSignalTower("System", "SignalTower"));
  154. OP.Subscribe("DeviceOperation", this.Invoke);
  155. return true;
  156. }
  157. private void InitPM(ModuleName mod, JetChamber jetChamber)
  158. {
  159. device_model_file = PathManager.GetCfgDir() + "PM" + "\\" + jetChamber.ToString() + "\\" + $"{jetChamber.ToString()}DeviceModel.xml";
  160. Initialize(device_model_file, jetChamber.ToString(), mod, mod.ToString());
  161. switch (jetChamber)
  162. {
  163. case JetChamber.Kepler2300:
  164. AddAdixenTurboPump(mod);
  165. AddEPD(mod);
  166. AddPendulumValve(mod);
  167. AddChiller(ChillerType.InnerChiller, mod);
  168. AddChiller(ChillerType.OuterChiller, mod);
  169. AddChiller(ChillerType.TopChiller, mod);
  170. AddMatch(mod);
  171. AddBiasMatch(mod);
  172. AddRF(mod);
  173. AddBiasRF(mod);
  174. AddDryPump(mod);
  175. AddCustomDevice(new JetKepler2300PM(mod));
  176. break;
  177. }
  178. }
  179. private void AddEPD(ModuleName mod)
  180. {
  181. if (SC.GetValue<bool>($"{mod}.EPD.IsEnabled") == true)
  182. {
  183. if (SC.GetValue<int>($"{mod}.EPD.EPDType") == 0)
  184. {
  185. AddCustomModuleDevice(new EPDClient(mod));
  186. }
  187. else
  188. {
  189. AddCustomModuleDevice(new EPDDevice(mod));
  190. }
  191. }
  192. }
  193. private void AddAdixenTurboPump(ModuleName mod)
  194. {
  195. AddCustomModuleDevice(new AdixenTurboPump(mod));
  196. }
  197. private void AddPendulumValve(ModuleName mod, PressureType pressureType = PressureType.mTorr)
  198. {
  199. AddCustomModuleDevice(new PendulumValve(mod, pressureType));
  200. }
  201. private void AddChiller(ChillerType chillerType, ModuleName mod)
  202. {
  203. if (SC.GetValue<bool>($"{mod}.{chillerType}.EnableChiller") &&
  204. SC.GetValue<int>($"{mod}.{chillerType}.CommunicationType") == (int)CommunicationType.RS232)
  205. {
  206. if (SC.GetValue<int>($"{mod}.{chillerType}.MFG") == (int)ChillerMFG.SMC)
  207. {
  208. AddCustomModuleDevice(new SMCChiller(mod, chillerType.ToString()));
  209. }
  210. else if (SC.GetValue<int>($"{mod}.{chillerType}.MFG") == (int)ChillerMFG.AIRSYS)
  211. {
  212. AddCustomModuleDevice(new AIRSYSChiller(mod, chillerType.ToString()));
  213. }
  214. }
  215. else if (SC.GetValue<bool>($"{mod}.{chillerType}.EnableChiller") &&
  216. SC.GetValue<int>($"{mod}.{chillerType}.CommunicationType") == (int)CommunicationType.RS485 &&
  217. SC.GetValue<bool>($"{mod}.{chillerType}.ShareCOM"))
  218. {
  219. if (SC.GetValue<int>($"{mod}.{chillerType}.MFG") == (int)ChillerMFG.SMC)
  220. {
  221. AddCustomModuleDevice(new SMCShareChiller(mod, chillerType.ToString()));
  222. }
  223. //else if (SC.GetValue<int>($"{mod}.{chillerType}.MFG") == (int)ChillerMFG.AIRSYS)
  224. //{
  225. // AddCustomModuleDevice(new AIRSYSChiller(mod, chillerType.ToString()));
  226. //}
  227. }
  228. }
  229. private void AddMatch(ModuleName mod)
  230. {
  231. if (SC.GetValue<bool>($"{mod}.Match.EnableMatch") &&
  232. SC.GetValue<int>($"{mod}.Match.CommunicationType") == (int)CommunicationType.RS232 &&
  233. SC.GetValue<int>($"{mod}.Match.MFG") == (int)MatchMFG.AdTec)
  234. {
  235. AddCustomModuleDevice(new AdTecMatch(mod, Venus_Core.VenusDevice.Match));
  236. }
  237. else if (SC.GetValue<bool>($"{mod}.Match.EnableMatch") &&
  238. SC.GetValue<int>($"{mod}.Match.CommunicationType") == (int)CommunicationType.RS232 &&
  239. SC.GetValue<int>($"{mod}.Match.MFG") == (int)MatchMFG.Revtech)
  240. {
  241. AddCustomModuleDevice(new RevtechMatch(mod, Venus_Core.VenusDevice.Match, MatchCommunicationType.RS232));
  242. }
  243. else if (SC.GetValue<bool>($"{mod}.Match.EnableMatch") &&
  244. SC.GetValue<int>($"{mod}.Match.CommunicationType") == (int)CommunicationType.Ethernet &&
  245. SC.GetValue<int>($"{mod}.Match.MFG") == (int)MatchMFG.Revtech)
  246. {
  247. AddCustomModuleDevice(new RevtechMatch(mod, Venus_Core.VenusDevice.Match, MatchCommunicationType.Ethernet));
  248. }
  249. }
  250. private void AddRFBox(ModuleName mod)
  251. {
  252. if (SC.GetValue<bool>($"{mod}.RFBox.EnableMatch") &&
  253. SC.GetValue<int>($"{mod}.RFBox.CommunicationType") == (int)CommunicationType.RS232 &&
  254. SC.GetValue<int>($"{mod}.RFBox.MFG") == (int)MatchMFG.AdTec)
  255. {
  256. AddCustomModuleDevice(new AdTecMatch(mod, Venus_Core.VenusDevice.RFBox));
  257. }
  258. else if (SC.GetValue<bool>($"{mod}.RFBox.EnableMatch") &&
  259. SC.GetValue<int>($"{mod}.RFBox.CommunicationType") == (int)CommunicationType.RS232 &&
  260. SC.GetValue<int>($"{mod}.RFBox.MFG") == (int)MatchMFG.Revtech)
  261. {
  262. AddCustomModuleDevice(new RevtechMatch(mod, Venus_Core.VenusDevice.RFBox, MatchCommunicationType.RS232));
  263. }
  264. else if (SC.GetValue<bool>($"{mod}.RFBox.EnableMatch") &&
  265. SC.GetValue<int>($"{mod}.RFBox.CommunicationType") == (int)CommunicationType.Ethernet &&
  266. SC.GetValue<int>($"{mod}.RFBox.MFG") == (int)MatchMFG.Revtech)
  267. {
  268. AddCustomModuleDevice(new RevtechMatch(mod, Venus_Core.VenusDevice.RFBox, MatchCommunicationType.Ethernet));
  269. }
  270. else if (SC.GetValue<bool>($"{mod}.RFBox.EnableMatch") &&
  271. SC.GetValue<int>($"{mod}.RFBox.MFG") == (int)MatchMFG.Lz_Ethercat && startEthercatOK)
  272. {
  273. AddCustomModuleDevice(new LzMatch_Ethercat(mod, Venus_Core.VenusDevice.RFBox, v_board_id));
  274. }
  275. }
  276. private void AddBiasMatch(ModuleName mod)
  277. {
  278. if (SC.GetValue<bool>($"{mod}.BiasMatch.EnableBiasMatch") &&
  279. SC.GetValue<int>($"{mod}.BiasMatch.CommunicationType") == (int)CommunicationType.RS232 &&
  280. SC.GetValue<int>($"{mod}.BiasMatch.MFG") == (int)MatchMFG.AdTec)
  281. {
  282. AddCustomModuleDevice(new AdTecMatch(mod, Venus_Core.VenusDevice.BiasMatch));
  283. }
  284. else if (SC.GetValue<bool>($"{mod}.BiasMatch.EnableBiasMatch") &&
  285. SC.GetValue<int>($"{mod}.BiasMatch.CommunicationType") == (int)CommunicationType.RS232 &&
  286. SC.GetValue<int>($"{mod}.BiasMatch.MFG") == (int)MatchMFG.Revtech)
  287. {
  288. AddCustomModuleDevice(new RevtechMatch(mod, Venus_Core.VenusDevice.BiasMatch, MatchCommunicationType.RS232));
  289. }
  290. else if (SC.GetValue<bool>($"{mod}.BiasMatch.EnableBiasMatch") &&
  291. SC.GetValue<int>($"{mod}.BiasMatch.CommunicationType") == (int)CommunicationType.Ethernet &&
  292. SC.GetValue<int>($"{mod}.BiasMatch.MFG") == (int)MatchMFG.Revtech)
  293. {
  294. AddCustomModuleDevice(new RevtechMatch(mod, Venus_Core.VenusDevice.BiasMatch, MatchCommunicationType.Ethernet));
  295. }
  296. else if (SC.GetValue<bool>($"{mod}.BiasMatch.EnableBiasMatch") &&
  297. SC.GetValue<int>($"{mod}.BiasMatch.MFG") == (int)MatchMFG.Lz_Ethercat && startEthercatOK)
  298. {
  299. AddCustomModuleDevice(new LzMatch_Ethercat(mod, Venus_Core.VenusDevice.BiasMatch, v_board_id));
  300. }
  301. else if (SC.GetValue<bool>($"{mod}.BiasMatch.EnableBiasMatch") &&
  302. SC.GetValue<int>($"{mod}.BiasMatch.CommunicationType") == (int)CommunicationType.RS232 &&
  303. SC.GetValue<int>($"{mod}.BiasMatch.MFG") == (int)MatchMFG.Tru)
  304. {
  305. AddCustomModuleDevice(new TruPlasmaMatch(mod, Venus_Core.VenusDevice.BiasMatch));
  306. }
  307. }
  308. private void AddRF(ModuleName mod)
  309. {
  310. if (SC.GetValue<int>($"{mod}.Rf.CommunicationType") == (int)CommunicationType.RS232 &&
  311. SC.GetValue<int>($"{mod}.Rf.MFG") == (int)GeneratorMFG.AdTec)
  312. {
  313. AddCustomModuleDevice(new AdTecGenerator(mod, Venus_Core.VenusDevice.Rf));
  314. }
  315. }
  316. private void AddBiasRF(ModuleName mod)
  317. {
  318. if (SC.GetValue<bool>($"{mod}.BiasRf.EnableBiasRF"))
  319. {
  320. if (SC.GetValue<int>($"{mod}.BiasRf.CommunicationType") == (int)CommunicationType.Ethernet &&
  321. SC.GetValue<int>($"{mod}.BiasRf.MFG") == (int)GeneratorMFG.Comet)
  322. {
  323. AddCustomModuleDevice(new CometRF(mod, SC.GetStringValue($"{mod}.BiasRf.IPAddress")));
  324. }
  325. else if (SC.GetValue<int>($"{mod}.BiasRf.MFG") == (int)GeneratorMFG.AdTec)
  326. {
  327. AddCustomModuleDevice(new AdTecGenerator(mod, Venus_Core.VenusDevice.BiasRf));
  328. }
  329. else if (SC.GetValue<int>($"{mod}.BiasRf.MFG") == (int)GeneratorMFG.Truplasma)
  330. {
  331. AddCustomModuleDevice(new TruPlasmaRF(mod, Venus_Core.VenusDevice.BiasRf));
  332. }
  333. else if (SC.GetValue<int>($"{mod}.BiasRf.MFG") == (int)GeneratorMFG.Truplasma_Ethercat && startEthercatOK)
  334. {
  335. AddCustomModuleDevice(new TruPlasmaRF_Ethercat(mod, Venus_Core.VenusDevice.BiasRf, v_board_id));
  336. }
  337. }
  338. }
  339. private void AddDryPump(ModuleName mod)
  340. {
  341. if (SC.GetValue<int>($"{mod}.DryPump.CommunicationType") == (int)CommunicationType.RS232)
  342. {
  343. if (SC.GetValue<int>($"{mod}.DryPump.MFG") == (int)DryPumpMFG.SKY)
  344. {
  345. AddCustomModuleDevice(new SkyPump(mod));
  346. }
  347. else if (SC.GetValue<int>($"{mod}.DryPump.MFG") == (int)DryPumpMFG.Edwards)
  348. {
  349. AddCustomModuleDevice(new EdwardsPump(mod));
  350. }
  351. }
  352. }
  353. private void AddEscHighVoltage(ModuleName mod)
  354. {
  355. AddCustomModuleDevice(new ESC5HighVoltage(mod));
  356. }
  357. private void InitTM(ModuleName mod)
  358. {
  359. Initialize(device_model_file_MF, mod.ToString(), mod, mod.ToString());
  360. if (SC.GetValue<int>($"LLA.DryPump.CommunicationType") == (int)CommunicationType.RS232)
  361. {
  362. if (SC.GetValue<int>($"LLA.DryPump.MFG") == (int)DryPumpMFG.SKY)
  363. {
  364. AddCustomModuleDevice(new SkyPump(ModuleName.LLA));
  365. }
  366. else if (SC.GetValue<int>($"LLA.DryPump.MFG") == (int)DryPumpMFG.Edwards)
  367. {
  368. AddCustomModuleDevice(new EdwardsPump(ModuleName.LLA));
  369. }
  370. }
  371. if (SC.GetValue<int>($"LLB.DryPump.CommunicationType") == (int)CommunicationType.RS232)
  372. {
  373. if (SC.GetValue<int>($"LLB.DryPump.MFG") == (int)DryPumpMFG.SKY)
  374. {
  375. AddCustomModuleDevice(new SkyPump(ModuleName.LLB));
  376. }
  377. else if (SC.GetValue<int>($"LLB.DryPump.MFG") == (int)DryPumpMFG.Edwards)
  378. {
  379. AddCustomModuleDevice(new EdwardsPump(ModuleName.LLB));
  380. }
  381. }
  382. if (SC.GetValue<int>($"{mod}.DryPump.CommunicationType") == (int)CommunicationType.RS232)
  383. {
  384. if (SC.GetValue<int>($"{mod}.DryPump.MFG") == (int)DryPumpMFG.SKY)
  385. {
  386. AddCustomModuleDevice(new SkyPump(mod));
  387. }
  388. else if (SC.GetValue<int>($"{mod}.DryPump.MFG") == (int)DryPumpMFG.Edwards)
  389. {
  390. AddCustomModuleDevice(new EdwardsPump(mod));
  391. }
  392. }
  393. //AddCustomModuleDevice(new SkyPump(mod));
  394. //AddCustomModuleDevice(new SkyPump(ModuleName.LLA));
  395. //AddCustomDevice(new JetTM());
  396. }
  397. //private void InitSETM(ModuleName mod)
  398. //{
  399. // Initialize(device_model_file_SEMF, mod.ToString(), mod, mod.ToString());
  400. // if (SC.GetValue<int>($"{mod}.DryPump.CommunicationType") == (int)CommunicationType.RS232)
  401. // {
  402. // if (SC.GetValue<int>($"{mod}.DryPump.MFG") == (int)DryPumpMFG.SKY)
  403. // {
  404. // AddCustomModuleDevice(new SkyPump(mod));
  405. // }
  406. // else if (SC.GetValue<int>($"{mod}.DryPump.MFG") == (int)DryPumpMFG.Edwards)
  407. // {
  408. // AddCustomModuleDevice(new EdwardsPump(mod));
  409. // }
  410. // }
  411. // AddCustomDevice(new HongHuTM());
  412. //}
  413. //private void InitDETM(ModuleName mod)
  414. //{
  415. // Initialize(device_model_file_DEMF, mod.ToString(), mod, mod.ToString());
  416. // if (SC.GetValue<int>($"{mod}.DryPump.CommunicationType") == (int)CommunicationType.RS232)
  417. // {
  418. // if (SC.GetValue<int>($"{mod}.DryPump.MFG") == (int)DryPumpMFG.SKY)
  419. // {
  420. // AddCustomModuleDevice(new SkyPump(mod));
  421. // }
  422. // else if (SC.GetValue<int>($"{mod}.DryPump.MFG") == (int)DryPumpMFG.Edwards)
  423. // {
  424. // AddCustomModuleDevice(new EdwardsPump(mod));
  425. // }
  426. // }
  427. // if (SC.GetValue<int>($"VCEA.DryPump.CommunicationType") == (int)CommunicationType.RS232)
  428. // {
  429. // if (SC.GetValue<int>($"VCEA.DryPump.MFG") == (int)DryPumpMFG.SKY)
  430. // {
  431. // AddCustomModuleDevice(new SkyPump(ModuleName.VCEA));
  432. // }
  433. // else if (SC.GetValue<int>($"VCEA.DryPump.MFG") == (int)DryPumpMFG.Edwards)
  434. // {
  435. // AddCustomModuleDevice(new EdwardsPump(ModuleName.VCEA));
  436. // }
  437. // }
  438. // AddCustomDevice(new HongHuDETM());
  439. //}
  440. private WaferSize MapWaferSize(int value)
  441. {
  442. switch (value)
  443. {
  444. case 3: return WaferSize.WS3;
  445. case 4: return WaferSize.WS4;
  446. case 6: return WaferSize.WS6;
  447. case 8: return WaferSize.WS8;
  448. }
  449. return WaferSize.WS0;
  450. }
  451. private bool Invoke(string arg1, object[] args)
  452. {
  453. string name = (string)args[0];
  454. string func = (string)args[1];
  455. object[] param = new object[args.Length - 2];
  456. for (int i = 2; i < args.Length; i++)
  457. param[i - 2] = args[i].ToString();
  458. DEVICE.Do(string.Format("{0}.{1}", name, func), 0, true, param);
  459. return true;
  460. }
  461. public void RTExitPMEvent()
  462. {
  463. if (ModuleHelper.IsInstalled(ModuleName.PMA))
  464. {
  465. DEVICE.GetDevice<JetPMBase>("PMA")?.RTCloseEvent();
  466. }
  467. if (ModuleHelper.IsInstalled(ModuleName.PMB))
  468. {
  469. DEVICE.GetDevice<JetPMBase>("PMB")?.RTCloseEvent();
  470. }
  471. if (ModuleHelper.IsInstalled(ModuleName.PMC))
  472. {
  473. DEVICE.GetDevice<JetPMBase>("PMC")?.RTCloseEvent();
  474. }
  475. if (ModuleHelper.IsInstalled(ModuleName.PMD))
  476. {
  477. DEVICE.GetDevice<JetPMBase>("PMD")?.RTCloseEvent();
  478. }
  479. }
  480. public bool CheckPMDisconnetCondition(out string reason)
  481. {
  482. if (ModuleHelper.IsInstalled(ModuleName.PMA) && DEVICE.GetDevice<JetPMBase>("PMA")?.IsPenVOpen == true)
  483. {
  484. reason = "PMA VAT is open";
  485. return false;
  486. }
  487. if (ModuleHelper.IsInstalled(ModuleName.PMB) && DEVICE.GetDevice<JetPMBase>("PMB")?.IsPenVOpen == true)
  488. {
  489. reason = "PMB VAT is open";
  490. return false;
  491. }
  492. if (ModuleHelper.IsInstalled(ModuleName.PMC) && DEVICE.GetDevice<JetPMBase>("PMC")?.IsPenVOpen == true)
  493. {
  494. reason = "PMC VAT is open";
  495. return false;
  496. }
  497. if (ModuleHelper.IsInstalled(ModuleName.PMD) && DEVICE.GetDevice<JetPMBase>("PMD")?.IsPenVOpen == true)
  498. {
  499. reason = "PMD VAT is open";
  500. return false;
  501. }
  502. reason = "ALL is close";
  503. return true;
  504. }
  505. }
  506. }