DeviceManager.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566
  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. InitTM(ModuleName.TM);
  141. if (ModuleHelper.IsInstalled(ModuleName.SETM))
  142. {
  143. InitSETM(ModuleName.SETM);
  144. }
  145. if (ModuleHelper.IsInstalled(ModuleName.DETM))
  146. {
  147. InitDETM(ModuleName.DETM);
  148. }
  149. AddCustomModuleDevice(new KeplerSignalTower("System", "SignalTower"));
  150. OP.Subscribe("DeviceOperation", this.Invoke);
  151. return true;
  152. }
  153. private void InitPM(ModuleName mod, JetChamber jetChamber)
  154. {
  155. device_model_file = PathManager.GetCfgDir() + "PM" + "\\" + jetChamber.ToString() + "\\" + $"{jetChamber.ToString()}DeviceModel.xml";
  156. Initialize(device_model_file, jetChamber.ToString(), mod, mod.ToString());
  157. switch (jetChamber)
  158. {
  159. case JetChamber.Kepler2300:
  160. AddAdixenTurboPump(mod);
  161. AddEPD(mod);
  162. AddPendulumValve(mod);
  163. AddChiller(ChillerType.InnerChiller, mod);
  164. AddChiller(ChillerType.OuterChiller, mod);
  165. AddChiller(ChillerType.TopChiller, mod);
  166. AddMatch(mod);
  167. AddBiasMatch(mod);
  168. AddRF(mod);
  169. AddBiasRF(mod);
  170. AddDryPump(mod);
  171. AddCustomDevice(new JetKepler2300PM(mod));
  172. break;
  173. case JetChamber.Kepler2200A:
  174. AddAdixenTurboPump(mod);
  175. AddPendulumValve(mod,PressureType.Pa);
  176. AddMatch(mod);
  177. AddRF(mod);
  178. AddDryPump(mod);
  179. AddCustomDevice(new JetKepler2200APM(mod));
  180. break;
  181. case JetChamber.Kepler2200B:
  182. AddAdixenTurboPump(mod);
  183. AddPendulumValve(mod, PressureType.Pa);
  184. AddMatch(mod);
  185. AddRF(mod);
  186. AddDryPump(mod);
  187. AddRFBox(mod);
  188. AddCustomDevice(new JetKepler2200BPM(mod));
  189. break;
  190. case JetChamber.VenusSE:
  191. AddEscHighVoltage(mod);
  192. AddAdixenTurboPump(mod);
  193. AddEPD(mod);
  194. AddPendulumValve(mod);
  195. AddChiller(ChillerType.Chiller, mod);
  196. AddMatch(mod);
  197. AddBiasMatch(mod);
  198. AddRF(mod);
  199. AddBiasRF(mod);
  200. AddDryPump(mod);
  201. AddCustomDevice(new JetVenusSEPM(mod));
  202. break;
  203. case JetChamber.VenusDE:
  204. AddEscHighVoltage(mod);
  205. AddAdixenTurboPump(mod);
  206. AddEPD(mod);
  207. AddPendulumValve(mod);
  208. AddChiller(ChillerType.Chiller, mod);
  209. AddChiller(ChillerType.WallChiller, mod);
  210. AddMatch(mod);
  211. AddBiasMatch(mod);
  212. //AddRF(mod);
  213. AddBiasRF(mod);
  214. AddDryPump(mod);
  215. AddCustomDevice(new JetVenusDEPM(mod));
  216. break;
  217. }
  218. }
  219. private void AddEPD(ModuleName mod)
  220. {
  221. if (SC.GetValue<bool>($"{mod}.EPD.IsEnabled") == true)
  222. {
  223. if (SC.GetValue<int>($"{mod}.EPD.EPDType") == 0)
  224. {
  225. AddCustomModuleDevice(new EPDClient(mod));
  226. }
  227. else
  228. {
  229. AddCustomModuleDevice(new EPDDevice(mod));
  230. }
  231. }
  232. }
  233. private void AddAdixenTurboPump(ModuleName mod)
  234. {
  235. AddCustomModuleDevice(new AdixenTurboPump(mod));
  236. }
  237. private void AddPendulumValve(ModuleName mod,PressureType pressureType=PressureType.mTorr)
  238. {
  239. AddCustomModuleDevice(new PendulumValve(mod,pressureType));
  240. }
  241. private void AddChiller(ChillerType chillerType, ModuleName mod)
  242. {
  243. if (SC.GetValue<bool>($"{mod}.{chillerType}.EnableChiller") &&
  244. SC.GetValue<int>($"{mod}.{chillerType}.CommunicationType") == (int)CommunicationType.RS232)
  245. {
  246. if (SC.GetValue<int>($"{mod}.{chillerType}.MFG") == (int)ChillerMFG.SMC)
  247. {
  248. AddCustomModuleDevice(new SMCChiller(mod, chillerType.ToString()));
  249. }
  250. else if (SC.GetValue<int>($"{mod}.{chillerType}.MFG") == (int)ChillerMFG.AIRSYS)
  251. {
  252. AddCustomModuleDevice(new AIRSYSChiller(mod, chillerType.ToString()));
  253. }
  254. }
  255. else if (SC.GetValue<bool>($"{mod}.{chillerType}.EnableChiller") &&
  256. SC.GetValue<int>($"{mod}.{chillerType}.CommunicationType") == (int)CommunicationType.RS485 &&
  257. SC.GetValue<bool>($"{mod}.{chillerType}.ShareCOM"))
  258. {
  259. if (SC.GetValue<int>($"{mod}.{chillerType}.MFG") == (int)ChillerMFG.SMC)
  260. {
  261. AddCustomModuleDevice(new SMCShareChiller(mod, chillerType.ToString()));
  262. }
  263. //else if (SC.GetValue<int>($"{mod}.{chillerType}.MFG") == (int)ChillerMFG.AIRSYS)
  264. //{
  265. // AddCustomModuleDevice(new AIRSYSChiller(mod, chillerType.ToString()));
  266. //}
  267. }
  268. }
  269. private void AddMatch(ModuleName mod)
  270. {
  271. if (SC.GetValue<bool>($"{mod}.Match.EnableMatch") &&
  272. SC.GetValue<int>($"{mod}.Match.CommunicationType") == (int)CommunicationType.RS232 &&
  273. SC.GetValue<int>($"{mod}.Match.MFG") == (int)MatchMFG.AdTec)
  274. {
  275. AddCustomModuleDevice(new AdTecMatch(mod, Venus_Core.VenusDevice.Match));
  276. }
  277. else if (SC.GetValue<bool>($"{mod}.Match.EnableMatch") &&
  278. SC.GetValue<int>($"{mod}.Match.CommunicationType") == (int)CommunicationType.RS232 &&
  279. SC.GetValue<int>($"{mod}.Match.MFG") == (int)MatchMFG.Revtech)
  280. {
  281. AddCustomModuleDevice(new RevtechMatch(mod, Venus_Core.VenusDevice.Match, MatchCommunicationType.RS232));
  282. }
  283. else if (SC.GetValue<bool>($"{mod}.Match.EnableMatch") &&
  284. SC.GetValue<int>($"{mod}.Match.CommunicationType") == (int)CommunicationType.Ethernet &&
  285. SC.GetValue<int>($"{mod}.Match.MFG") == (int)MatchMFG.Revtech)
  286. {
  287. AddCustomModuleDevice(new RevtechMatch(mod, Venus_Core.VenusDevice.Match, MatchCommunicationType.Ethernet));
  288. }
  289. }
  290. private void AddRFBox(ModuleName mod)
  291. {
  292. if (SC.GetValue<bool>($"{mod}.RFBox.EnableMatch") &&
  293. SC.GetValue<int>($"{mod}.RFBox.CommunicationType") == (int)CommunicationType.RS232 &&
  294. SC.GetValue<int>($"{mod}.RFBox.MFG") == (int)MatchMFG.AdTec)
  295. {
  296. AddCustomModuleDevice(new AdTecMatch(mod, Venus_Core.VenusDevice.RFBox));
  297. }
  298. else if (SC.GetValue<bool>($"{mod}.RFBox.EnableMatch") &&
  299. SC.GetValue<int>($"{mod}.RFBox.CommunicationType") == (int)CommunicationType.RS232 &&
  300. SC.GetValue<int>($"{mod}.RFBox.MFG") == (int)MatchMFG.Revtech)
  301. {
  302. AddCustomModuleDevice(new RevtechMatch(mod, Venus_Core.VenusDevice.RFBox, MatchCommunicationType.RS232));
  303. }
  304. else if (SC.GetValue<bool>($"{mod}.RFBox.EnableMatch") &&
  305. SC.GetValue<int>($"{mod}.RFBox.CommunicationType") == (int)CommunicationType.Ethernet &&
  306. SC.GetValue<int>($"{mod}.RFBox.MFG") == (int)MatchMFG.Revtech)
  307. {
  308. AddCustomModuleDevice(new RevtechMatch(mod, Venus_Core.VenusDevice.RFBox, MatchCommunicationType.Ethernet));
  309. }
  310. else if (SC.GetValue<bool>($"{mod}.RFBox.EnableMatch") &&
  311. SC.GetValue<int>($"{mod}.RFBox.MFG") == (int)MatchMFG.Lz_Ethercat && startEthercatOK)
  312. {
  313. AddCustomModuleDevice(new LzMatch_Ethercat(mod, Venus_Core.VenusDevice.RFBox, v_board_id));
  314. }
  315. }
  316. private void AddBiasMatch(ModuleName mod)
  317. {
  318. if (SC.GetValue<bool>($"{mod}.BiasMatch.EnableBiasMatch") &&
  319. SC.GetValue<int>($"{mod}.BiasMatch.CommunicationType") == (int)CommunicationType.RS232 &&
  320. SC.GetValue<int>($"{mod}.BiasMatch.MFG") == (int)MatchMFG.AdTec)
  321. {
  322. AddCustomModuleDevice(new AdTecMatch(mod, Venus_Core.VenusDevice.BiasMatch));
  323. }
  324. else if (SC.GetValue<bool>($"{mod}.BiasMatch.EnableBiasMatch") &&
  325. SC.GetValue<int>($"{mod}.BiasMatch.CommunicationType") == (int)CommunicationType.RS232 &&
  326. SC.GetValue<int>($"{mod}.BiasMatch.MFG") == (int)MatchMFG.Revtech)
  327. {
  328. AddCustomModuleDevice(new RevtechMatch(mod, Venus_Core.VenusDevice.BiasMatch, MatchCommunicationType.RS232));
  329. }
  330. else if (SC.GetValue<bool>($"{mod}.BiasMatch.EnableBiasMatch") &&
  331. SC.GetValue<int>($"{mod}.BiasMatch.CommunicationType") == (int)CommunicationType.Ethernet &&
  332. SC.GetValue<int>($"{mod}.BiasMatch.MFG") == (int)MatchMFG.Revtech)
  333. {
  334. AddCustomModuleDevice(new RevtechMatch(mod, Venus_Core.VenusDevice.BiasMatch, MatchCommunicationType.Ethernet));
  335. }
  336. else if (SC.GetValue<bool>($"{mod}.BiasMatch.EnableBiasMatch") &&
  337. SC.GetValue<int>($"{mod}.BiasMatch.MFG") == (int)MatchMFG.Lz_Ethercat && startEthercatOK)
  338. {
  339. AddCustomModuleDevice(new LzMatch_Ethercat(mod, Venus_Core.VenusDevice.BiasMatch, v_board_id));
  340. }
  341. else if (SC.GetValue<bool>($"{mod}.BiasMatch.EnableBiasMatch") &&
  342. SC.GetValue<int>($"{mod}.BiasMatch.CommunicationType") == (int)CommunicationType.RS232 &&
  343. SC.GetValue<int>($"{mod}.BiasMatch.MFG") == (int)MatchMFG.Tru)
  344. {
  345. AddCustomModuleDevice(new TruPlasmaMatch(mod, Venus_Core.VenusDevice.BiasMatch));
  346. }
  347. }
  348. private void AddRF(ModuleName mod)
  349. {
  350. if (SC.GetValue<int>($"{mod}.Rf.CommunicationType") == (int)CommunicationType.RS232 &&
  351. SC.GetValue<int>($"{mod}.Rf.MFG") == (int)GeneratorMFG.AdTec)
  352. {
  353. AddCustomModuleDevice(new AdTecGenerator(mod, Venus_Core.VenusDevice.Rf));
  354. }
  355. }
  356. private void AddBiasRF(ModuleName mod)
  357. {
  358. if (SC.GetValue<bool>($"{mod}.BiasRf.EnableBiasRF"))
  359. {
  360. if (SC.GetValue<int>($"{mod}.BiasRf.CommunicationType") == (int)CommunicationType.Ethernet &&
  361. SC.GetValue<int>($"{mod}.BiasRf.MFG") == (int)GeneratorMFG.Comet)
  362. {
  363. AddCustomModuleDevice(new CometRF(mod, SC.GetStringValue($"{mod}.BiasRf.IPAddress")));
  364. }
  365. else if (SC.GetValue<int>($"{mod}.BiasRf.MFG") == (int)GeneratorMFG.AdTec)
  366. {
  367. AddCustomModuleDevice(new AdTecGenerator(mod, Venus_Core.VenusDevice.BiasRf));
  368. }
  369. else if (SC.GetValue<int>($"{mod}.BiasRf.MFG") == (int)GeneratorMFG.Truplasma)
  370. {
  371. AddCustomModuleDevice(new TruPlasmaRF(mod, Venus_Core.VenusDevice.BiasRf));
  372. }
  373. else if (SC.GetValue<int>($"{mod}.BiasRf.MFG") == (int)GeneratorMFG.Truplasma_Ethercat && startEthercatOK)
  374. {
  375. AddCustomModuleDevice(new TruPlasmaRF_Ethercat(mod, Venus_Core.VenusDevice.BiasRf, v_board_id));
  376. }
  377. }
  378. }
  379. private void AddDryPump(ModuleName mod)
  380. {
  381. if (SC.GetValue<int>($"{mod}.DryPump.CommunicationType") == (int)CommunicationType.RS232)
  382. {
  383. if (SC.GetValue<int>($"{mod}.DryPump.MFG") == (int)DryPumpMFG.SKY)
  384. {
  385. AddCustomModuleDevice(new SkyPump(mod));
  386. }
  387. else if (SC.GetValue<int>($"{mod}.DryPump.MFG") == (int)DryPumpMFG.Edwards)
  388. {
  389. AddCustomModuleDevice(new EdwardsPump(mod));
  390. }
  391. }
  392. }
  393. private void AddEscHighVoltage(ModuleName mod)
  394. {
  395. AddCustomModuleDevice(new ESC5HighVoltage(mod));
  396. }
  397. private void InitTM(ModuleName mod)
  398. {
  399. Initialize(device_model_file_MF, mod.ToString(), mod, mod.ToString());
  400. if (SC.GetValue<int>($"LLA.DryPump.CommunicationType") == (int)CommunicationType.RS232)
  401. {
  402. if (SC.GetValue<int>($"LLA.DryPump.MFG") == (int)DryPumpMFG.SKY)
  403. {
  404. AddCustomModuleDevice(new SkyPump(ModuleName.LLA));
  405. }
  406. else if (SC.GetValue<int>($"LLA.DryPump.MFG") == (int)DryPumpMFG.Edwards)
  407. {
  408. AddCustomModuleDevice(new EdwardsPump(ModuleName.LLA));
  409. }
  410. }
  411. if (SC.GetValue<int>($"LLB.DryPump.CommunicationType") == (int)CommunicationType.RS232)
  412. {
  413. if (SC.GetValue<int>($"LLB.DryPump.MFG") == (int)DryPumpMFG.SKY)
  414. {
  415. AddCustomModuleDevice(new SkyPump(ModuleName.LLB));
  416. }
  417. else if (SC.GetValue<int>($"LLB.DryPump.MFG") == (int)DryPumpMFG.Edwards)
  418. {
  419. AddCustomModuleDevice(new EdwardsPump(ModuleName.LLB));
  420. }
  421. }
  422. if (SC.GetValue<int>($"{mod}.DryPump.CommunicationType") == (int)CommunicationType.RS232)
  423. {
  424. if (SC.GetValue<int>($"{mod}.DryPump.MFG") == (int)DryPumpMFG.SKY)
  425. {
  426. AddCustomModuleDevice(new SkyPump(mod));
  427. }
  428. else if (SC.GetValue<int>($"{mod}.DryPump.MFG") == (int)DryPumpMFG.Edwards)
  429. {
  430. AddCustomModuleDevice(new EdwardsPump(mod));
  431. }
  432. }
  433. //AddCustomModuleDevice(new SkyPump(mod));
  434. //AddCustomModuleDevice(new SkyPump(ModuleName.LLA));
  435. AddCustomDevice(new JetTM());
  436. }
  437. private void InitSETM(ModuleName mod)
  438. {
  439. Initialize(device_model_file_SEMF, mod.ToString(), mod, mod.ToString());
  440. if (SC.GetValue<int>($"{mod}.DryPump.CommunicationType") == (int)CommunicationType.RS232)
  441. {
  442. if (SC.GetValue<int>($"{mod}.DryPump.MFG") == (int)DryPumpMFG.SKY)
  443. {
  444. AddCustomModuleDevice(new SkyPump(mod));
  445. }
  446. else if (SC.GetValue<int>($"{mod}.DryPump.MFG") == (int)DryPumpMFG.Edwards)
  447. {
  448. AddCustomModuleDevice(new EdwardsPump(mod));
  449. }
  450. }
  451. AddCustomDevice(new HongHuTM());
  452. }
  453. private void InitDETM(ModuleName mod)
  454. {
  455. Initialize(device_model_file_DEMF, mod.ToString(), mod, mod.ToString());
  456. if (SC.GetValue<int>($"{mod}.DryPump.CommunicationType") == (int)CommunicationType.RS232)
  457. {
  458. if (SC.GetValue<int>($"{mod}.DryPump.MFG") == (int)DryPumpMFG.SKY)
  459. {
  460. AddCustomModuleDevice(new SkyPump(mod));
  461. }
  462. else if (SC.GetValue<int>($"{mod}.DryPump.MFG") == (int)DryPumpMFG.Edwards)
  463. {
  464. AddCustomModuleDevice(new EdwardsPump(mod));
  465. }
  466. }
  467. if (SC.GetValue<int>($"VCEA.DryPump.CommunicationType") == (int)CommunicationType.RS232)
  468. {
  469. if (SC.GetValue<int>($"VCEA.DryPump.MFG") == (int)DryPumpMFG.SKY)
  470. {
  471. AddCustomModuleDevice(new SkyPump(ModuleName.VCEA));
  472. }
  473. else if (SC.GetValue<int>($"VCEA.DryPump.MFG") == (int)DryPumpMFG.Edwards)
  474. {
  475. AddCustomModuleDevice(new EdwardsPump(ModuleName.VCEA));
  476. }
  477. }
  478. AddCustomDevice(new HongHuDETM());
  479. }
  480. private WaferSize MapWaferSize(int value)
  481. {
  482. switch (value)
  483. {
  484. case 3: return WaferSize.WS3;
  485. case 4: return WaferSize.WS4;
  486. case 6: return WaferSize.WS6;
  487. case 8: return WaferSize.WS8;
  488. }
  489. return WaferSize.WS0;
  490. }
  491. private bool Invoke(string arg1, object[] args)
  492. {
  493. string name = (string)args[0];
  494. string func = (string)args[1];
  495. object[] param = new object[args.Length - 2];
  496. for (int i = 2; i < args.Length; i++)
  497. param[i - 2] = args[i].ToString();
  498. DEVICE.Do(string.Format("{0}.{1}", name, func), 0, true, param);
  499. return true;
  500. }
  501. public void RTExitPMEvent()
  502. {
  503. if (ModuleHelper.IsInstalled(ModuleName.PMA))
  504. {
  505. DEVICE.GetDevice<JetPMBase>("PMA")?.RTCloseEvent();
  506. }
  507. if (ModuleHelper.IsInstalled(ModuleName.PMB))
  508. {
  509. DEVICE.GetDevice<JetPMBase>("PMB")?.RTCloseEvent();
  510. }
  511. if (ModuleHelper.IsInstalled(ModuleName.PMC))
  512. {
  513. DEVICE.GetDevice<JetPMBase>("PMC")?.RTCloseEvent();
  514. }
  515. if (ModuleHelper.IsInstalled(ModuleName.PMD))
  516. {
  517. DEVICE.GetDevice<JetPMBase>("PMD")?.RTCloseEvent();
  518. }
  519. }
  520. }
  521. }