DeviceManager.cs 23 KB

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