JetPM.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685
  1. using System;
  2. using Aitex.Core.RT.Device;
  3. using Aitex.Core.RT.Device.Unit;
  4. using Aitex.Core.RT.Event;
  5. using Aitex.Core.Common.DeviceData;
  6. using Aitex.Core.RT.SCCore;
  7. using MECF.Framework.Common.Device.Bases;
  8. using MECF.Framework.Common.Equipment;
  9. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.PMs;
  10. using Venus_RT.Devices.IODevices;
  11. using Venus_Core;
  12. namespace Venus_RT.Devices
  13. {
  14. enum ValveType
  15. {
  16. PVN21,
  17. PVN22,
  18. PV11,
  19. PV12,
  20. PV21,
  21. PV22,
  22. PV31,
  23. PV32,
  24. PV41,
  25. PV42,
  26. N2,
  27. Mfc1,
  28. Mfc2,
  29. Mfc3,
  30. Mfc4,
  31. Mfc5,
  32. Mfc6,
  33. Mfc7,
  34. Mfc8,
  35. PVHe1,
  36. PVHe2,
  37. GasFinal,
  38. SoftPump,
  39. FastPump,
  40. CHBPurge,
  41. TurboPumpPumping,
  42. TurboPumpPurge,
  43. Guage,
  44. LoadlockVent,
  45. LoadlockPumping
  46. }
  47. class JetPM : PM
  48. {
  49. private readonly IoLid _Lid;
  50. private readonly IoLid _LidLoadlock;
  51. private readonly IoCylinder _slitDoor;
  52. private readonly IoCylinder _LiftPin;
  53. private readonly IoCylinder _LoadLockArm;
  54. private readonly IoValve _PVN21Valve;
  55. private readonly IoValve _PVN22Valve;
  56. private readonly IoValve _PV11Valve;
  57. private readonly IoValve _PV12Valve;
  58. private readonly IoValve _PV21Valve;
  59. private readonly IoValve _PV22Valve;
  60. private readonly IoValve _PV31Valve;
  61. private readonly IoValve _PV32Valve;
  62. private readonly IoValve _PV41Valve;
  63. private readonly IoValve _PV42Valve;
  64. private readonly IoValve _N2Valve;
  65. private readonly IoValve _Mfc1Valve;
  66. private readonly IoValve _Mfc2Valve;
  67. private readonly IoValve _Mfc3Valve;
  68. private readonly IoValve _Mfc4Valve;
  69. private readonly IoValve _Mfc5Valve;
  70. private readonly IoValve _Mfc6Valve;
  71. private readonly IoValve _Mfc7Valve;
  72. private readonly IoValve _Mfc8Valve;
  73. private readonly IoValve _PVHe1Valve;
  74. private readonly IoValve _PVHe2Valve;
  75. private readonly IoValve _GasFinalValve;
  76. private readonly IoValve _SoftPumpValve;
  77. private readonly IoValve _FastPumpValve;
  78. private readonly IoValve _TurboPumpPumpingValve;
  79. private readonly IoValve _TurboPumpPurgeValve;
  80. private readonly IoValve _GuageValve;
  81. private readonly IoValve _LoadlockVentValve;
  82. private readonly IoValve _LoadlockPumpingValve;
  83. private readonly IoSensor _ATM_sw;
  84. private readonly IoSensor _CDAPressure;
  85. private readonly IoSensor _ATM_Loadlock_sw;
  86. private readonly IoSensor _N2Pressure_sw;
  87. private readonly IoSensor _VAC_sw;
  88. private readonly IoSensor _WLK_sw;
  89. private readonly IoSensor _RFG_Interlock;
  90. private readonly PumpBase _MainPump;
  91. private readonly ESC5HighVoltage _ESCHV;
  92. private readonly AdixenTurboPump _TurboPump;
  93. private readonly PendulumValve _pendulumValve;
  94. private readonly SMCChiller _Chiller;
  95. private readonly RfPowerBase _Generator;
  96. private readonly RfPowerBase _GeneratorBias;
  97. private readonly RfMatchBase _Match;
  98. private readonly IoSignalTower _SignalTower;
  99. private readonly IoHeater _ForelineTC;
  100. private readonly IoPressureControl _pressureController;
  101. private readonly IoGasStick[] _gasLines;
  102. private readonly IoGasStick _gasLineN2;
  103. private readonly IoGasStick _gasLineHe;
  104. // 盖子的状态
  105. public bool IsLidClosed => _Lid.OFFFeedback;
  106. public bool IsLidLoadlockClosed => _LidLoadlock.OFFFeedback;
  107. public bool IsSlitDoorClosed => !_slitDoor.ONFeedback && _slitDoor.OFFFeedback;
  108. public bool IsPumpRunning => _MainPump.IsRunning;
  109. public bool IsTurboPumpRunning => _TurboPump.IsRunning;
  110. public bool IsTurboPumpAtSpeed => _TurboPump.AtSpeed;
  111. public bool HasPumpError => _MainPump.IsError || !_MainPump.IsRunning;
  112. public bool HasTurboPumpError => _TurboPump.IsError || !_TurboPump.IsRunning;
  113. public bool IsCDA_OK => _CDAPressure.Value;
  114. public bool IsFastPumpOpened => _FastPumpValve.Status;
  115. public bool IsSoftPumpOpened => _SoftPumpValve.Status;
  116. public bool IsMfc1ValveOpened => _Mfc1Valve.Status;
  117. public bool IsMfc2ValveOpened => _Mfc2Valve.Status;
  118. public bool IsMfc3ValveOpened => _Mfc3Valve.Status;
  119. public bool IsMfc4ValveOpened => _Mfc4Valve.Status;
  120. public bool IsMfc5ValveOpened => _Mfc5Valve.Status;
  121. public bool IsMfc6ValveOpened => _Mfc6Valve.Status;
  122. public bool IsMfc7ValveOpened => _Mfc7Valve.Status;
  123. public bool IsMfc8ValveOpened => _Mfc8Valve.Status;
  124. // 压力信号
  125. public bool IsATM => _ATM_sw.Value;
  126. public bool IsATMLoadlock => _ATM_Loadlock_sw.Value;
  127. public bool IsVACLoadLock => LoadlockPressure <= 1000;
  128. public bool IsVAC => _VAC_sw.Value;
  129. public bool IsWLK => _WLK_sw.Value;
  130. public bool IsRFGInterlockOn => _RFG_Interlock.Value;
  131. public double ProcessPressure => _pressureController.ProcessGauge.Value;
  132. public override double ChamberPressure => _pressureController.PressureGauge.Value;
  133. public double ForelinePressure => _pressureController.ForelineGauge.Value;
  134. public double TargetPressure => _pressureController.TargetPressure;
  135. public double LoadlockPressure => _pressureController.LoadLockGauge.Value;
  136. public double ESCHePressure => _pressureController.ESCHeGauge.Value;
  137. public float CoolantInletTempFB => _Chiller.CoolantInletTcFeedback;
  138. public float CoolantOutletTempFB => _Chiller.CoolantOutletTcFeedback;
  139. //Loadlock_Arm
  140. public bool IsLoadlockArmRetract => _LoadLockArm.OFFFeedback;
  141. public bool IsLoadlockArmExtend => _LoadLockArm.ONFeedback;
  142. //Loadlock_Arm DO
  143. public bool LoadlockArmRetract => _LoadLockArm.OFFSetPoint;
  144. public bool LoadlockArmExtend => _LoadLockArm.ONSetPoint;
  145. public new ModuleName Module { get; }
  146. public MovementPosition LiftPinPosition
  147. {
  148. get
  149. {
  150. MovementPosition pos = MovementPosition.Unknown;
  151. if (_LiftPin.ONFeedback && !_LiftPin.OFFFeedback)
  152. {
  153. pos = MovementPosition.Up;
  154. }
  155. else if (!_LiftPin.ONFeedback && _LiftPin.OFFFeedback)
  156. {
  157. pos = MovementPosition.Down;
  158. }
  159. return pos;
  160. }
  161. }
  162. public override bool CheckAtm()
  163. {
  164. return _ATM_sw.Value && ChamberPressure > 700000;
  165. }
  166. public bool CheckSlitDoorOpen()
  167. {
  168. return _slitDoor.State == CylinderState.Open;
  169. }
  170. public bool CheckSlitDoorClose()
  171. {
  172. return _slitDoor.State == CylinderState.Close;
  173. }
  174. public bool CheckLiftUp()
  175. {
  176. return _LiftPin.State == CylinderState.Open;
  177. }
  178. public bool CheckLiftDown()
  179. {
  180. return _LiftPin.State == CylinderState.Close;
  181. }
  182. public double TotalGasSetpoint
  183. {
  184. get
  185. {
  186. double sum = 0;
  187. foreach (var gas in _gasLines)
  188. {
  189. sum += gas.FlowSP;
  190. }
  191. return sum;
  192. }
  193. }
  194. public bool HasGasOutOfRange
  195. {
  196. get
  197. {
  198. foreach (var gas in _gasLines)
  199. {
  200. if (!gas.IsOutOfRange)
  201. return false;
  202. }
  203. return true;
  204. }
  205. }
  206. public JetPM(ModuleName mod) : base(mod.ToString())
  207. {
  208. Module = mod;
  209. _Lid = DEVICE.GetDevice<IoLid>($"{Module}.{VenusDevice.Lid}");
  210. _LidLoadlock = DEVICE.GetDevice<IoLid>($"{Module}.{VenusDevice.LidLoadlock}");
  211. _slitDoor = DEVICE.GetDevice<IoCylinder>($"{Module}.{VenusDevice.SlitDoor}");
  212. _LiftPin = DEVICE.GetDevice<IoCylinder>($"{Module}.{VenusDevice.LiftPin}");
  213. _LoadLockArm = DEVICE.GetDevice<IoCylinder>($"{Module}.{VenusDevice.LoadLockArm}");
  214. _PVN21Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVN21}");
  215. _PVN22Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVN22}");
  216. _PV11Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV11}");
  217. _PV12Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV12}");
  218. _PV21Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV21}");
  219. _PV22Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV22}");
  220. _PV31Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV31}");
  221. _PV32Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV32}");
  222. _PV41Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV41}");
  223. _PV42Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV42}");
  224. _N2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveN2}");
  225. _Mfc1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc1}");
  226. _Mfc2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc2}");
  227. _Mfc3Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc2}");
  228. _Mfc4Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc2}");
  229. _Mfc5Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc2}");
  230. _Mfc6Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc2}");
  231. _Mfc7Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc2}");
  232. _Mfc8Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc2}");
  233. _PVHe1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVHe1}");
  234. _PVHe2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVHe2}");
  235. _GasFinalValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveGasFinal}");
  236. _SoftPumpValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveSoftPump}");
  237. _FastPumpValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveFastPump}");
  238. _TurboPumpPumpingValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveTurboPumpPumping}");
  239. _TurboPumpPurgeValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveTurboPumpPurge}");
  240. _GuageValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveGuage}");
  241. _LoadlockVentValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveLoadlockVent}");
  242. _LoadlockPumpingValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveLoadlockPumping}");
  243. _ATM_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorATMSwitch");
  244. _ATM_Loadlock_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorLoadlockATMSwitch");
  245. _N2Pressure_sw = DEVICE.GetDevice<IoSensor>($"{Module}.N2PressureOk");
  246. _VAC_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorVacSwitch");
  247. _WLK_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorWaterLeakOk");
  248. _CDAPressure = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCDAPressureOk");
  249. _RFG_Interlock = DEVICE.GetDevice<IoSensor>($"{Module}.GeneratorInterlock");
  250. _ForelineTC = DEVICE.GetDevice<IoHeater>($"{Module}.ForelineHeater");
  251. _SignalTower = DEVICE.GetDevice<IoSignalTower>($"{Module}.SignalTower");
  252. _CDAPressure = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCDAPressureOk");
  253. _pressureController = DEVICE.GetDevice<IoPressureControl>($"{Module}.{VenusDevice.PressureControl}");
  254. _gasLines = new IoGasStick[8];
  255. for (int index = 0; index < 8; index++)
  256. {
  257. _gasLines[index] = DEVICE.GetDevice<IoGasStick>($"{Module}.GasStick{index + 1}");
  258. }
  259. _gasLineN2 = DEVICE.GetDevice<IoGasStick>($"{Module}.GasStickN2");
  260. _gasLineHe = DEVICE.GetDevice<IoGasStick>($"{Module}.GasStickHe");
  261. _MainPump = DEVICE.GetDevice<PumpBase>($"{Module}.{VenusDevice.MainPump}");
  262. // RS232 Dry pump, SKY
  263. if (SC.GetValue<int>($"{mod}.DryPump.CommunicationType") == (int)CommunicationType.RS232)
  264. {
  265. if (SC.GetValue<int>($"{mod}.DryPump.MFG") == (int)DryPumpMFG.SKY)
  266. {
  267. _MainPump = DEVICE.GetDevice<SkyPump>($"{Module}.{VenusDevice.MainPump}");
  268. }
  269. else if (SC.GetValue<int>($"{mod}.DryPump.MFG") == (int)DryPumpMFG.Edwards)
  270. {
  271. _MainPump = DEVICE.GetDevice<EdwardsPump>($"{Module}.{VenusDevice.MainPump}");
  272. }
  273. }
  274. _ESCHV = DEVICE.GetDevice<ESC5HighVoltage>($"{Module}.{VenusDevice.ESCHV}");
  275. _TurboPump = DEVICE.GetDevice<AdixenTurboPump>($"{Module}.{VenusDevice.TurboPump}");
  276. _pendulumValve = DEVICE.GetDevice<PendulumValve>($"{ Module}.{VenusDevice.PendulumValve}");
  277. if (SC.GetValue<bool>($"{mod}.Chiller.EnableChiller") &&
  278. SC.GetValue<int>($"{mod}.Chiller.CommunicationType") == (int)CommunicationType.RS232 &&
  279. SC.GetValue<int>($"{mod}.Chiller.MFG") == (int)ChillerMFG.SMC)
  280. {
  281. _Chiller = DEVICE.GetDevice<SMCChiller>($"{Module}.{VenusDevice.Chiller}");
  282. }
  283. // RS223 AdTec Generator
  284. if (SC.GetValue<int>($"{mod}.Rf.CommunicationType") == (int)CommunicationType.RS232 &&
  285. SC.GetValue<int>($"{mod}.Rf.MFG") == (int)GeneratorMFG.AdTec)
  286. {
  287. _Generator = DEVICE.GetDevice<AdTecGenerator>($"{Module}.{VenusDevice.Rf}");
  288. }
  289. // Ethernet Comet Generator Bias
  290. if (SC.GetValue<bool>($"{mod}.BiasRf.EnableBiasRF") &&
  291. SC.GetValue<int>($"{mod}.BiasRf.CommunicationType") == (int)CommunicationType.Ethernet &&
  292. SC.GetValue<int>($"{mod}.BiasRf.MFG") == (int)GeneratorMFG.Comet)
  293. {
  294. _GeneratorBias = DEVICE.GetDevice<CometRF>($"{Module}.{VenusDevice.BiasRf}");
  295. }
  296. // RS232 AdTec match
  297. if (SC.GetValue<int>($"{mod}.match.CommunicationType") == (int)CommunicationType.RS232 &&
  298. SC.GetValue<int>($"{mod}.match.MFG") == (int)MatchMFG.AdTec)
  299. {
  300. _Match = DEVICE.GetDevice<AdTecMatch>($"{Module}.{VenusDevice.Match}");
  301. }
  302. }
  303. public void CloseValves()
  304. {
  305. _PVN21Valve.TurnValve(false, out _);
  306. _PVN22Valve.TurnValve(false, out _);
  307. _PV11Valve.TurnValve(false, out _);
  308. _PV12Valve.TurnValve(false, out _);
  309. _PV21Valve.TurnValve(false, out _);
  310. _PV22Valve.TurnValve(false, out _);
  311. _PV31Valve.TurnValve(false, out _);
  312. _PV32Valve.TurnValve(false, out _);
  313. _PV41Valve.TurnValve(false, out _);
  314. _PV42Valve.TurnValve(false, out _);
  315. _PVHe1Valve.TurnValve(false, out _);
  316. _PVHe2Valve.TurnValve(false, out _);
  317. _GasFinalValve.TurnValve(false, out _);
  318. _SoftPumpValve.TurnValve(false, out _);
  319. _FastPumpValve.TurnValve(false, out _);
  320. _TurboPumpPumpingValve.TurnValve(false, out _);
  321. _TurboPumpPurgeValve.TurnValve(false, out _);
  322. _GuageValve.TurnValve(false, out _);
  323. _LoadlockVentValve.TurnValve(false, out _);
  324. _LoadlockPumpingValve.TurnValve(false, out _);
  325. _N2Valve.TurnValve(false, out _);
  326. _FastPumpValve.TurnValve(false, out _);
  327. _Mfc1Valve.TurnValve(false, out _);
  328. _Mfc2Valve.TurnValve(false, out _);
  329. _Mfc3Valve.TurnValve(false, out _);
  330. _Mfc4Valve.TurnValve(false, out _);
  331. _Mfc5Valve.TurnValve(false, out _);
  332. _Mfc6Valve.TurnValve(false, out _);
  333. _Mfc7Valve.TurnValve(false, out _);
  334. _Mfc8Valve.TurnValve(false, out _);
  335. foreach (var stick in _gasLines)
  336. {
  337. stick.Stop();
  338. }
  339. }
  340. public void TurnDryPump(bool on)
  341. {
  342. //_pressureController.StartPump(on);
  343. _MainPump?.SetPumpOnOff(on);
  344. }
  345. public void TurnTurboPump(bool on)
  346. {
  347. _TurboPump?.SetPumpOnOff(on);
  348. }
  349. public void OpenValve(ValveType vlvType, bool on)
  350. {
  351. switch (vlvType)
  352. {
  353. case ValveType.PVN21:
  354. _PVN21Valve.TurnValve(on, out _);
  355. break;
  356. case ValveType.PVN22:
  357. _PVN22Valve.TurnValve(on, out _);
  358. break;
  359. case ValveType.PV11:
  360. _PV11Valve.TurnValve(on, out _);
  361. break;
  362. case ValveType.PV12:
  363. _PV12Valve.TurnValve(on, out _);
  364. break;
  365. case ValveType.PV21:
  366. _PV21Valve.TurnValve(on, out _);
  367. break;
  368. case ValveType.PV22:
  369. _PV22Valve.TurnValve(on, out _);
  370. break;
  371. case ValveType.PV31:
  372. _PV31Valve.TurnValve(on, out _);
  373. break;
  374. case ValveType.PV32:
  375. _PV32Valve.TurnValve(on, out _);
  376. break;
  377. case ValveType.PV41:
  378. _PV41Valve.TurnValve(on, out _);
  379. break;
  380. case ValveType.PV42:
  381. _PV42Valve.TurnValve(on, out _);
  382. break;
  383. case ValveType.N2:
  384. _N2Valve.TurnValve(on, out _);
  385. break;
  386. case ValveType.PVHe1:
  387. _PVHe1Valve.TurnValve(on, out _);
  388. break;
  389. case ValveType.PVHe2:
  390. _PVHe2Valve.TurnValve(on, out _);
  391. break;
  392. case ValveType.GasFinal:
  393. _GasFinalValve.TurnValve(on, out _);
  394. break;
  395. case ValveType.SoftPump:
  396. _SoftPumpValve.TurnValve(on, out _);
  397. break;
  398. case ValveType.FastPump:
  399. _FastPumpValve.TurnValve(on, out _);
  400. break;
  401. case ValveType.TurboPumpPumping:
  402. _TurboPumpPumpingValve.TurnValve(on, out _);
  403. break;
  404. case ValveType.TurboPumpPurge:
  405. _TurboPumpPurgeValve.TurnValve(on, out _);
  406. break;
  407. case ValveType.Guage:
  408. _GuageValve.TurnValve(on, out _);
  409. break;
  410. case ValveType.LoadlockVent:
  411. _LoadlockVentValve.TurnValve(on, out _);
  412. break;
  413. case ValveType.LoadlockPumping:
  414. _LoadlockPumpingValve.TurnValve(on, out _);
  415. break;
  416. case ValveType.Mfc1:
  417. _Mfc1Valve.TurnValve(on, out _);
  418. break;
  419. case ValveType.Mfc2:
  420. _Mfc2Valve.TurnValve(on, out _);
  421. break;
  422. case ValveType.Mfc3:
  423. _Mfc3Valve.TurnValve(on, out _);
  424. break;
  425. case ValveType.Mfc4:
  426. _Mfc4Valve.TurnValve(on, out _);
  427. break;
  428. case ValveType.Mfc5:
  429. _Mfc5Valve.TurnValve(on, out _);
  430. break;
  431. case ValveType.Mfc6:
  432. _Mfc6Valve.TurnValve(on, out _);
  433. break;
  434. case ValveType.Mfc7:
  435. _Mfc7Valve.TurnValve(on, out _);
  436. break;
  437. case ValveType.Mfc8:
  438. _Mfc8Valve.TurnValve(on, out _);
  439. break;
  440. default:
  441. throw new ArgumentOutOfRangeException($"Argument error {vlvType}-{on}");
  442. }
  443. }
  444. public override void Monitor()
  445. {
  446. foreach (var gas in _gasLines)
  447. {
  448. gas.Monitor();
  449. }
  450. }
  451. public void BuzzerBlinking(double time)
  452. {
  453. _SignalTower.BuzzerBlinking(time);
  454. }
  455. public void SwitchOnBuzzerAndRed()
  456. {
  457. _SignalTower.SwitchOnBuzzerAndRed("", null);
  458. }
  459. public override void Home()
  460. {
  461. // 与yp讨论过,PM 初始化不需要
  462. SetLiftPin(MovementPosition.Down, out _);
  463. SetSlitDoor(false, out _);
  464. }
  465. public bool SetLiftPin(MovementPosition dirt, out string reason)
  466. {
  467. reason = string.Empty;
  468. switch (dirt)
  469. {
  470. case MovementPosition.Down:
  471. return _LiftPin.SetCylinder(false, out reason);
  472. case MovementPosition.Up:
  473. return _LiftPin.SetCylinder(true, out reason);
  474. case MovementPosition.Left:
  475. case MovementPosition.Right:
  476. case MovementPosition.Middle:
  477. throw new ArgumentException("Movement argument error");
  478. }
  479. return true;
  480. }
  481. public void SetSlitDoor(bool open, out string reason)
  482. {
  483. reason = string.Empty;
  484. _slitDoor.SetCylinder(open, out reason);
  485. }
  486. public bool RetractWafer()
  487. {
  488. return _LoadLockArm.SetCylinder(false, out _);
  489. }
  490. public bool ExtendWafer()
  491. {
  492. return _LoadLockArm.SetCylinder(true, out _);
  493. }
  494. public bool FlowGas(int gasNum, double val)
  495. {
  496. if (_gasLines.Length <= gasNum)
  497. return false;
  498. _gasLines[gasNum].Flow(val);
  499. return true;
  500. }
  501. public bool StopGas(int gasNum)
  502. {
  503. if (_gasLines.Length <= gasNum)
  504. return false;
  505. _gasLines[gasNum].Stop();
  506. return true;
  507. }
  508. public void StopAllGases()
  509. {
  510. foreach (var line in _gasLines)
  511. {
  512. line.Stop();
  513. }
  514. }
  515. public bool TurnPendulumValve(bool on)
  516. {
  517. return _pendulumValve.TurnValve(on);
  518. }
  519. public bool SetPVPressure(int pressure)
  520. {
  521. return _pendulumValve.SetPressure(pressure);
  522. }
  523. public bool SetPVPostion(int position)
  524. {
  525. return _pendulumValve.SetPosition(position);
  526. }
  527. public void HeatChiller(double value, double offset)
  528. {
  529. _Chiller?.SetChillerTemp((float)value, (float)offset);
  530. _Chiller?.SetChillerOnOff(true);
  531. }
  532. public bool CheckChillerStatus()
  533. {
  534. return _Chiller != null && _Chiller.IsRunning && !_Chiller.IsError;
  535. }
  536. public void SetGeneratorCommunicationMode(int mode)
  537. {
  538. _Generator?.SetCommunicationMode(mode);
  539. }
  540. public bool GeneratorPowerOn(bool on)
  541. {
  542. if (_Generator == null) return false;
  543. if (on && !IsRFGInterlockOn)
  544. {
  545. EV.PostAlarmLog(Module.ToString(), "射频电源 Interlock条件不满足");
  546. return false;
  547. }
  548. return _Generator.SetPowerOnOff(on, out _);
  549. }
  550. public bool GeneratorSetpower(float val)
  551. {
  552. if (_Generator == null) return false;
  553. if (Math.Abs(val) > 0.01)
  554. _Generator.SetPower((ushort)val);
  555. return true;
  556. }
  557. public bool GeneratorBiasPowerOn(bool on)
  558. {
  559. if (_GeneratorBias == null) return false;
  560. if (on && !IsRFGInterlockOn)
  561. {
  562. EV.PostAlarmLog(Module.ToString(), "Bias射频电源 Interlock条件不满足");
  563. return false;
  564. }
  565. return _GeneratorBias.SetPowerOnOff(on, out _);
  566. }
  567. public bool GeneratorBiasSetpower(float val)
  568. {
  569. if (_GeneratorBias == null) return false;
  570. if (Math.Abs(val) > 0.01)
  571. _GeneratorBias.SetPower((ushort)val);
  572. return true;
  573. }
  574. public bool GeneratorBiasSetMatchMode(bool val)
  575. {
  576. if (_GeneratorBias == null) return false;
  577. string reason = string.Empty;
  578. _GeneratorBias.SetMatchingAutoMode(val, out reason);
  579. return true;
  580. }
  581. public bool SetMatchPosition(float c1, float c2)
  582. {
  583. if (_Match == null) return false;
  584. string reason = string.Empty;
  585. _Match.SetMatchPosition(c1, c2, out reason);
  586. return true;
  587. }
  588. public bool SetBiasMatchPosition(float c1, float c2)
  589. {
  590. if (_GeneratorBias == null) return false;
  591. string reason = string.Empty;
  592. _GeneratorBias.SetMatchPosition(c1, c2, out reason);
  593. return true;
  594. }
  595. }
  596. }