JetPM.cs 31 KB

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