JetPM.cs 30 KB

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