JetVenusPM.cs 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182
  1. using Aitex.Core.Common.DeviceData;
  2. using Aitex.Core.RT.Device;
  3. using Aitex.Core.RT.Device.Unit;
  4. using Aitex.Core.RT.SCCore;
  5. using Aitex.Core.RT.Log;
  6. using Aitex.Core.Util;
  7. using MECF.Framework.Common.Device.Bases;
  8. using MECF.Framework.Common.Equipment;
  9. using System;
  10. using System.Collections.Generic;
  11. using Venus_Core;
  12. using Venus_RT.Devices.IODevices;
  13. using Venus_RT.Devices.EPD;
  14. using MECF.Framework.Common.SubstrateTrackings;
  15. using IoMfc = Venus_RT.Devices.IODevices.IoMfc;
  16. using System.Threading.Tasks;
  17. using Aitex.Core.RT.DataCenter;
  18. using Venus_RT.Modules;
  19. using System.Windows.Media;
  20. using System.Diagnostics;
  21. namespace Venus_RT.Devices
  22. {
  23. class JetVenusPM : JetPMBase
  24. {
  25. private readonly IoLid _Lid;
  26. private readonly IoLid _LidLoadlock;
  27. private readonly IoCylinder _slitDoor;
  28. private readonly IoCylinder _LiftPin;
  29. private readonly IoCylinder _LoadLockArm;
  30. private readonly IoValve _PVN21Valve;
  31. private readonly IoValve _PVN22Valve;
  32. private readonly IoValve _PV11Valve;
  33. private readonly IoValve _PV12Valve;
  34. private readonly IoValve _PV21Valve;
  35. private readonly IoValve _PV22Valve;
  36. private readonly IoValve _PV31Valve;
  37. private readonly IoValve _PV32Valve;
  38. private readonly IoValve _PV41Valve;
  39. private readonly IoValve _PV42Valve;
  40. private readonly IoValve _N2Valve;
  41. private readonly IoValve _Mfc1Valve;
  42. private readonly IoValve _Mfc2Valve;
  43. private readonly IoValve _Mfc3Valve;
  44. private readonly IoValve _Mfc4Valve;
  45. private readonly IoValve _Mfc5Valve;
  46. private readonly IoValve _Mfc6Valve;
  47. private readonly IoValve _Mfc7Valve;
  48. private readonly IoValve _Mfc8Valve;
  49. private readonly IoValve _PVHe1Valve;
  50. private readonly IoValve _PVHe2Valve;
  51. private readonly IoValve _GasFinalValve;
  52. private readonly IoValve _SoftPumpValve;
  53. private readonly IoValve _FastPumpValve;
  54. private readonly IoValve _TurboPumpPumpingValve;
  55. private readonly IoValve _TurboPumpPurgeValve;
  56. private readonly IoValve _GuageValve;
  57. private readonly IoValve _LoadlockVentValve;
  58. private readonly IoValve _LoadlockPumpingValve;
  59. private readonly IoValve _PVHe3Valve;
  60. private readonly IoValve _HeISOValve;
  61. private readonly IoSensor _ATM_sw;
  62. private readonly IoSensor _CDAPressure;
  63. private readonly IoSensor _ATM_Loadlock_sw;
  64. private readonly IoSensor _N2Pressure_sw;
  65. private readonly IoSensor _VAC_sw;
  66. private readonly IoSensor _WLK_sw;
  67. private readonly IoSensor _Water_Flow;
  68. private readonly IoSensor _RFG_Interlock;
  69. private readonly IoSensor _PM_Lid_Closed;
  70. private readonly IoSensor _Source_RF_Fan;
  71. private readonly IoSensor _PM_SlitDoor_Closed;
  72. private readonly IoSensor _TurboPumpInterlock;
  73. private readonly IoSensor _GasBoxDoor;
  74. private readonly IoSensor _GasBoxPressure;
  75. private readonly PumpBase _MainPump;
  76. private readonly ESC5HighVoltage _ESCHV;
  77. private readonly AdixenTurboPump _TurboPump;
  78. private readonly PendulumValve _pendulumValve;
  79. private readonly ChillerBase _Chiller;
  80. private readonly RfPowerBase _Generator;//srf=>AdTecGenerator
  81. private readonly RfPowerBase _GeneratorBias;//brf=>CometRF
  82. private readonly RfMatchBase _Match;
  83. private readonly RfMatchBase _BiasMatch;
  84. private readonly IoSignalTower _SignalTower;
  85. private readonly IoHeater _ForelineTC;
  86. private readonly IoHeater _WallTC;
  87. private readonly IoPressureControl _pressureController;
  88. private readonly IoGasStick[] _gasLines;
  89. private readonly IoGasStick _gasLineN2;
  90. private readonly IoBacksideHe _backsideHe;
  91. private readonly IoMfc _heMfc;
  92. private readonly double _foreline_interlock_pressure = 750;
  93. private Stopwatch _GasRFStopWatch = new Stopwatch();
  94. private bool _GasFlag = false;
  95. // 盖子的状态
  96. public override bool IsLidClosed => _Lid.OFFFeedback;
  97. public override bool IsLidLoadlockClosed => _LidLoadlock.OFFFeedback;
  98. public override bool IsSlitDoorClosed => !_slitDoor.ONFeedback && _slitDoor.OFFFeedback;
  99. public override bool IsPumpRunning => _MainPump.IsRunning;
  100. public override bool IsTurboPumpRunning => _TurboPump.IsRunning;
  101. public override bool IsTurboPumpAtSpeed => _TurboPump.AtSpeed;
  102. public override float TurboPumpSpeed => _TurboPump.Speed;
  103. public override bool HasPumpError => _MainPump.IsError || !_MainPump.IsRunning;
  104. public override bool HasTurboPumpError => _TurboPump.IsError || !_TurboPump.IsRunning;
  105. public override bool IsCDA_OK => _CDAPressure.Value;
  106. public override bool IsFastPumpOpened => _FastPumpValve.Status;
  107. public override bool IsSoftPumpOpened => _SoftPumpValve.Status;
  108. public override bool IsMfc1ValveOpened => _Mfc1Valve.Status;
  109. public override bool IsMfc2ValveOpened => _Mfc2Valve.Status;
  110. public override bool IsMfc3ValveOpened => _Mfc3Valve.Status;
  111. public override bool IsMfc4ValveOpened => _Mfc4Valve.Status;
  112. public override bool IsMfc5ValveOpened => _Mfc5Valve.Status;
  113. public override bool IsMfc6ValveOpened => _Mfc6Valve.Status;
  114. public override bool IsMfc7ValveOpened => _Mfc7Valve.Status;
  115. public override bool IsMfc8ValveOpened => _Mfc8Valve.Status;
  116. public override bool IsGuageValveOpened => _GuageValve.Status;
  117. // 压力信号
  118. public override bool IsATM => _ATM_sw.Value;
  119. public override bool PVN22ValveIsOpen => _PVN22Valve.Status;
  120. public override bool LiftPinIsDown => _LiftPin.OFFFeedback;
  121. public override bool LiftPinIsUp => _LiftPin.ONFeedback;
  122. public override bool IsATMLoadlock => _ATM_Loadlock_sw.Value;
  123. public override bool IsVACLoadLock => LoadlockPressure <= 1000;
  124. public override bool IsVAC => _VAC_sw.Value;
  125. public override bool IsWaterFlowOk => _Water_Flow.Value;
  126. public override bool IsWLK => _WLK_sw.Value;
  127. public override bool IsRFGInterlockOn => _RFG_Interlock.Value;
  128. public override bool PMLidClosed => _PM_Lid_Closed.Value;
  129. public override bool TurboPumpInterlock => _TurboPumpInterlock.Value;
  130. public override bool SourceRFFanInterlock => _Source_RF_Fan.Value;
  131. public override bool SlitDoorClosed => _PM_SlitDoor_Closed.Value;
  132. //public override double ProcessLowPressure => _pressureController.ProcessLow.Value;
  133. //public override double ProcessHighPressure => _pressureController.ProcessHigh.Value;
  134. public override double CalculationPressure
  135. {
  136. get
  137. {
  138. if (ProcessPressure < 100)
  139. {
  140. return ProcessPressure;
  141. }
  142. else
  143. {
  144. return ChamberPressure;
  145. }
  146. }
  147. }
  148. public override double ProcessPressure => _pressureController.ProcessGauge.Value;
  149. public override double ChamberPressure => _pressureController.PressureGauge.Value;
  150. public override double ForelinePressure => _pressureController.ForelineGauge.Value;
  151. public override double TargetPressure => _pressureController.TargetPressure;
  152. public override double LoadlockPressure => _pressureController.LoadLockGauge.Value;
  153. public override double ESCHePressure => _pressureController.ESCHeGauge.Value;
  154. public override int ESCOutputVoltage => _ESCHV.OutputVoltage;
  155. public override double ESCPositiveOutputCurrent => _ESCHV.PositiveOutputCurrent;
  156. public override double ESCNegativeOutputCurrent => _ESCHV.NegativeOutputCurrent;
  157. public override bool IsHVOn => _ESCHV.IsOn;
  158. public override float CoolantInletTempFB => _Chiller.CoolantInletTcFeedback;
  159. public override float CoolantOutletTempFB => _Chiller.CoolantOutletTcFeedback;
  160. public override bool ChillerIsRunning => _Chiller.IsRunning;
  161. //Loadlock_Arm
  162. public override bool IsLoadlockArmRetract => _LoadLockArm.OFFFeedback;
  163. public override bool IsLoadlockArmExtend => _LoadLockArm.ONFeedback;
  164. //Loadlock_Arm DO
  165. public override bool LoadlockArmRetract => _LoadLockArm.OFFSetPoint;
  166. public override bool LoadlockArmExtend => _LoadLockArm.ONSetPoint;
  167. public override float ReflectPower => _Generator.ReflectPower;
  168. public override float BiasReflectPower => _GeneratorBias.ReflectPower;
  169. public override float ForwardPower => _Generator.ForwardPower;
  170. public override float BiasForwardPower => _GeneratorBias.ForwardPower;
  171. public override bool BackSideHeOutOfRange => _backsideHe.OutOfRange;
  172. public override float RFMatchC1 => _Match != null ? _Match.TunePosition1 : 0;
  173. public override float RFMatchC2 => _Match != null ? _Match.TunePosition2 : 0;
  174. public override float BiasRFMatchC1 => _BiasMatch != null ? _BiasMatch.TunePosition1 : 0;
  175. public override float BiasRFMatchC2 => _BiasMatch != null ? _BiasMatch.TunePosition1 : 0;
  176. public override double MFC1FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas1").FeedBack;
  177. public override double MFC2FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas2").FeedBack;
  178. public override double MFC3FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas3").FeedBack;
  179. public override double MFC4FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas4").FeedBack;
  180. public override double MFC5FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas5").FeedBack;
  181. public override double MFC6FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas6").FeedBack;
  182. public override double MFC7FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas7").FeedBack;
  183. public override double MFC8FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas8").FeedBack;
  184. public new ModuleName Module { get; }
  185. public override MovementPosition LiftPinPosition
  186. {
  187. get
  188. {
  189. MovementPosition pos = MovementPosition.Unknown;
  190. if (_LiftPin.ONFeedback && !_LiftPin.OFFFeedback)
  191. {
  192. pos = MovementPosition.Up;
  193. }
  194. else if (!_LiftPin.ONFeedback && _LiftPin.OFFFeedback)
  195. {
  196. pos = MovementPosition.Down;
  197. }
  198. return pos;
  199. }
  200. }
  201. public override bool CheckAtm()
  202. {
  203. return _ATM_sw.Value && ChamberPressure > 700000;
  204. }
  205. public override bool CheckSlitDoorOpen()
  206. {
  207. return _slitDoor.State == CylinderState.Open;
  208. }
  209. public override bool CheckSlitDoorClose()
  210. {
  211. return _slitDoor.State == CylinderState.Close;
  212. }
  213. public override bool CheckLiftUp()
  214. {
  215. return _LiftPin.State == CylinderState.Open;
  216. }
  217. public override bool CheckLiftDown()
  218. {
  219. return _LiftPin.State == CylinderState.Close;
  220. }
  221. public override double TotalGasSetpoint
  222. {
  223. get
  224. {
  225. double sum = 0;
  226. foreach (var gas in _gasLines)
  227. {
  228. sum += gas.FlowSP;
  229. }
  230. return sum;
  231. }
  232. }
  233. public override bool HasGasOutOfRange
  234. {
  235. get
  236. {
  237. foreach (var gas in _gasLines)
  238. {
  239. if (!gas.IsOutOfRange)
  240. return false;
  241. }
  242. return true;
  243. }
  244. }
  245. public override bool PendulumValveIsOpen()
  246. {
  247. return _pendulumValve.IsOpen;
  248. }
  249. #region 构造函数
  250. public JetVenusPM(ModuleName moduleName) : base(moduleName)
  251. {
  252. Module = moduleName;
  253. _Lid = DEVICE.GetDevice<IoLid>($"{Module}.{VenusDevice.Lid}");
  254. _LidLoadlock = DEVICE.GetDevice<IoLid>($"{Module}.{VenusDevice.LidLoadlock}");
  255. _slitDoor = DEVICE.GetDevice<IoCylinder>($"{Module}.{VenusDevice.SlitDoor}");
  256. _LiftPin = DEVICE.GetDevice<IoCylinder>($"{Module}.{VenusDevice.LiftPin}");
  257. _LoadLockArm = DEVICE.GetDevice<IoCylinder>($"{Module}.{VenusDevice.LoadLockArm}");
  258. _PVN21Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVN21}");
  259. _PVN22Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVN22}");
  260. _PV11Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV11}");
  261. _PV12Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV12}");
  262. _PV21Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV21}");
  263. _PV22Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV22}");
  264. _PV31Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV31}");
  265. _PV32Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV32}");
  266. _PV41Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV41}");
  267. _PV42Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV42}");
  268. _N2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveN2}");
  269. _Mfc1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc1}");
  270. _Mfc2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc2}");
  271. _Mfc3Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc3}");
  272. _Mfc4Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc4}");
  273. _Mfc5Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc5}");
  274. _Mfc6Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc6}");
  275. _Mfc7Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc7}");
  276. _Mfc8Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc8}");
  277. _PVHe1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVHe1}");
  278. _PVHe2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVHe2}");
  279. _GasFinalValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveGasFinal}");
  280. _SoftPumpValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveSoftPump}");
  281. _FastPumpValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveFastPump}");
  282. _TurboPumpPumpingValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveTurboPumpPumping}");
  283. _TurboPumpPurgeValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveTurboPumpPurge}");
  284. _GuageValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveGuage}");
  285. _LoadlockVentValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveLoadlockVent}");
  286. _LoadlockPumpingValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveLoadlockPumping}");
  287. _PVHe3Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVHe3}");
  288. _HeISOValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveHeISO}");
  289. _heMfc = DEVICE.GetDevice<IoMfc>($"{Module}.MfcHe");
  290. _ATM_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorATMSwitch");
  291. _ATM_Loadlock_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorLoadlockATMSwitch");
  292. _N2Pressure_sw = DEVICE.GetDevice<IoSensor>($"{Module}.N2PressureOk");
  293. _VAC_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorVacSwitch");
  294. _Water_Flow = DEVICE.GetDevice<IoSensor>($"{Module}.SensorWaterFlowOk");
  295. _WLK_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorWaterLeakOk");
  296. _CDAPressure = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCDAPressureOk");
  297. _RFG_Interlock = DEVICE.GetDevice<IoSensor>($"{Module}.GeneratorInterlock");
  298. _PM_Lid_Closed = DEVICE.GetDevice<IoSensor>($"{Module}.SensorPMLidClosed");
  299. _Source_RF_Fan = DEVICE.GetDevice<IoSensor>($"{Module}.SensorSourceRFFan");
  300. _PM_SlitDoor_Closed = DEVICE.GetDevice<IoSensor>($"{Module}.SensorSlitDoorClosed");
  301. _TurboPumpInterlock = DEVICE.GetDevice<IoSensor>($"{Module}.TurboPumpInterlock");
  302. _GasBoxDoor = DEVICE.GetDevice<IoSensor>($"{Module}.GasBoxDoorSW");
  303. _GasBoxPressure = DEVICE.GetDevice<IoSensor>($"{Module}.GasBoxPressureSW");
  304. _ForelineTC = DEVICE.GetDevice<IoHeater>($"{Module}.ForelineHeater");
  305. _WallTC = DEVICE.GetDevice<IoHeater>($"{Module}.WallHeater");
  306. _SignalTower = DEVICE.GetDevice<IoSignalTower>($"{Module}.SignalTower");
  307. _CDAPressure = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCDAPressureOk");
  308. _pressureController = DEVICE.GetDevice<IoPressureControl>($"{Module}.{VenusDevice.PressureControl}");
  309. _gasLines = new IoGasStick[8];
  310. for (int index = 0; index < 8; index++)
  311. {
  312. _gasLines[index] = DEVICE.GetDevice<IoGasStick>($"{Module}.GasStick{index + 1}");
  313. }
  314. _gasLineN2 = DEVICE.GetDevice<IoGasStick>($"{Module}.GasStickN2");
  315. _backsideHe = DEVICE.GetDevice<IoBacksideHe>($"{Module}.BacksideHelium");
  316. _MainPump = DEVICE.GetDevice<PumpBase>($"{Module}.{VenusDevice.MainPump}");
  317. // RS232 Dry pump, SKY
  318. if (SC.GetValue<int>($"{Module}.DryPump.CommunicationType") == (int)CommunicationType.RS232)
  319. {
  320. if (SC.GetValue<int>($"{Module}.DryPump.MFG") == (int)DryPumpMFG.SKY)
  321. {
  322. _MainPump = DEVICE.GetDevice<SkyPump>($"{Module}.{VenusDevice.MainPump}");
  323. }
  324. else if (SC.GetValue<int>($"{Module}.DryPump.MFG") == (int)DryPumpMFG.Edwards)
  325. {
  326. _MainPump = DEVICE.GetDevice<EdwardsPump>($"{Module}.{VenusDevice.MainPump}");
  327. }
  328. }
  329. _ESCHV = DEVICE.GetDevice<ESC5HighVoltage>($"{Module}.{VenusDevice.ESCHV}");
  330. _TurboPump = DEVICE.GetDevice<AdixenTurboPump>($"{Module}.{VenusDevice.TurboPump}");
  331. _pendulumValve = DEVICE.GetDevice<PendulumValve>($"{Module}.{VenusDevice.PendulumValve}");
  332. if (SC.GetValue<bool>($"{Module}.Chiller.EnableChiller") &&
  333. SC.GetValue<int>($"{Module}.Chiller.CommunicationType") == (int)CommunicationType.RS232)
  334. {
  335. if (SC.GetValue<int>($"{Module}.Chiller.MFG") == (int)ChillerMFG.SMC)
  336. {
  337. _Chiller = DEVICE.GetDevice<SMCChiller>($"{Module}.{VenusDevice.Chiller}");
  338. }
  339. else if (SC.GetValue<int>($"{Module}.Chiller.MFG") == (int)ChillerMFG.AIRSYS)
  340. {
  341. _Chiller = DEVICE.GetDevice<AIRSYSChiller>($"{Module}.{VenusDevice.Chiller}");
  342. }
  343. }
  344. // RS223 AdTec Generator
  345. if (SC.GetValue<int>($"{Module}.Rf.CommunicationType") == (int)CommunicationType.RS232 &&
  346. SC.GetValue<int>($"{Module}.Rf.MFG") == (int)GeneratorMFG.AdTec)
  347. {
  348. _Generator = DEVICE.GetDevice<AdTecGenerator>($"{Module}.{VenusDevice.Rf}");
  349. }
  350. // Ethernet Comet Generator Bias
  351. if (SC.GetValue<bool>($"{Module}.BiasRf.EnableBiasRF"))
  352. {
  353. if (SC.GetValue<int>($"{Module}.BiasRf.CommunicationType") == (int)CommunicationType.Ethernet &&
  354. SC.GetValue<int>($"{Module}.BiasRf.MFG") == (int)GeneratorMFG.Comet)
  355. {
  356. _GeneratorBias = DEVICE.GetDevice<CometRF>($"{Module}.{VenusDevice.BiasRf}");
  357. }
  358. else if (SC.GetValue<int>($"{Module}.BiasRf.MFG") == (int)GeneratorMFG.AdTec)
  359. {
  360. _GeneratorBias = DEVICE.GetDevice<AdTecGenerator>($"{Module}.{VenusDevice.BiasRf}");
  361. }
  362. }
  363. if (SC.GetValue<int>($"{Module}.Match.CommunicationType") == (int)CommunicationType.RS232 &&
  364. SC.GetValue<int>($"{Module}.Match.MFG") == (int)MatchMFG.AdTec)
  365. {
  366. _Match = DEVICE.GetDevice<AdTecMatch>($"{Module}.{VenusDevice.Match}");
  367. }
  368. else if (SC.GetValue<int>($"{Module}.Match.CommunicationType") == (int)CommunicationType.Ethernet &&
  369. SC.GetValue<int>($"{Module}.Match.MFG") == (int)MatchMFG.Revtech)
  370. {
  371. _Match = DEVICE.GetDevice<RevtechMatch>($"{Module}.{VenusDevice.BiasMatch}");
  372. }
  373. if (SC.GetValue<bool>($"{Module}.BiasMatch.EnableBiasMatch") &&
  374. SC.GetValue<int>($"{Module}.BiasMatch.CommunicationType") == (int)CommunicationType.RS232 &&
  375. SC.GetValue<int>($"{Module}.BiasMatch.MFG") == (int)MatchMFG.AdTec)
  376. {
  377. _BiasMatch = DEVICE.GetDevice<AdTecMatch>($"{Module}.{VenusDevice.BiasMatch}");
  378. }
  379. else if (SC.GetValue<bool>($"{Module}.BiasMatch.EnableBiasMatch") &&
  380. SC.GetValue<int>($"{Module}.BiasMatch.MFG") == (int)MatchMFG.Revtech)
  381. {
  382. _BiasMatch = DEVICE.GetDevice<RevtechMatch>($"{Module}.{VenusDevice.BiasMatch}");
  383. }
  384. _foreline_interlock_pressure = SC.GetValue<double>($"{Module}.ForelineInterlockPressure");
  385. }
  386. #endregion
  387. public async override void CloseValves(int? delayTime = null)
  388. {
  389. _PVN21Valve.TurnValve(false, out _);
  390. // _PVN22Valve.TurnValve(false, out _);
  391. _PV11Valve.TurnValve(false, out _);
  392. _PV12Valve.TurnValve(false, out _);
  393. _PV21Valve.TurnValve(false, out _);
  394. _PV22Valve.TurnValve(false, out _);
  395. _PV31Valve.TurnValve(false, out _);
  396. _PV32Valve.TurnValve(false, out _);
  397. _PV41Valve.TurnValve(false, out _);
  398. _PV42Valve.TurnValve(false, out _);
  399. _PVHe1Valve.TurnValve(false, out _);
  400. _PVHe2Valve.TurnValve(false, out _);
  401. _SoftPumpValve.TurnValve(false, out _);
  402. _FastPumpValve.TurnValve(false, out _);
  403. _TurboPumpPumpingValve.TurnValve(false, out _);
  404. _TurboPumpPurgeValve.TurnValve(false, out _);
  405. _GuageValve.TurnValve(false, out _);
  406. _LoadlockVentValve.TurnValve(false, out _);
  407. _LoadlockPumpingValve.TurnValve(false, out _);
  408. _N2Valve.TurnValve(false, out _);
  409. _FastPumpValve.TurnValve(false, out _);
  410. _Mfc1Valve.TurnValve(false, out _);
  411. _Mfc2Valve.TurnValve(false, out _);
  412. _Mfc3Valve.TurnValve(false, out _);
  413. _Mfc4Valve.TurnValve(false, out _);
  414. _Mfc5Valve.TurnValve(false, out _);
  415. _Mfc6Valve.TurnValve(false, out _);
  416. _Mfc7Valve.TurnValve(false, out _);
  417. _Mfc8Valve.TurnValve(false, out _);
  418. _PVHe3Valve.TurnValve(false, out _);
  419. _HeISOValve.TurnValve(false, out _);
  420. foreach (var stick in _gasLines)
  421. {
  422. stick.Stop();
  423. }
  424. if (delayTime != null)
  425. {
  426. await Task.Delay((int)delayTime);
  427. }
  428. _GasFinalValve.TurnValve(false, out _);
  429. }
  430. public override void TurnDryPump(bool on)
  431. {
  432. //_pressureController.StartPump(on);
  433. _MainPump?.SetPumpOnOff(on);
  434. }
  435. public override void TurnTurboPump(bool on)
  436. {
  437. _TurboPump?.SetPumpOnOff(on);
  438. }
  439. public override void OpenValve(ValveType vlvType, bool on)
  440. {
  441. switch (vlvType)
  442. {
  443. case ValveType.PVN21:
  444. _PVN21Valve.TurnValve(on, out _);
  445. break;
  446. case ValveType.PVN22:
  447. _PVN22Valve.TurnValve(on, out _);
  448. LOG.Write(eEvent.EV_DEVICE_INFO, Module, $"{(on ? "打开" : "关闭")} 阀 {vlvType.ToString()}");
  449. break;
  450. case ValveType.PV11:
  451. _PV11Valve.TurnValve(on, out _);
  452. break;
  453. case ValveType.PV12:
  454. _PV12Valve.TurnValve(on, out _);
  455. break;
  456. case ValveType.PV21:
  457. _PV21Valve.TurnValve(on, out _);
  458. break;
  459. case ValveType.PV22:
  460. _PV22Valve.TurnValve(on, out _);
  461. break;
  462. case ValveType.PV31:
  463. _PV31Valve.TurnValve(on, out _);
  464. break;
  465. case ValveType.PV32:
  466. _PV32Valve.TurnValve(on, out _);
  467. break;
  468. case ValveType.PV41:
  469. _PV41Valve.TurnValve(on, out _);
  470. break;
  471. case ValveType.PV42:
  472. _PV42Valve.TurnValve(on, out _);
  473. break;
  474. case ValveType.N2:
  475. _N2Valve.TurnValve(on, out _);
  476. break;
  477. case ValveType.PVHe1:
  478. _PVHe1Valve.TurnValve(on, out _);
  479. break;
  480. case ValveType.PVHe2:
  481. _PVHe2Valve.TurnValve(on, out _);
  482. break;
  483. case ValveType.GasFinal:
  484. _GasFinalValve.TurnValve(on, out _);
  485. break;
  486. case ValveType.SoftPump:
  487. _SoftPumpValve.TurnValve(on, out _);
  488. break;
  489. case ValveType.FastPump:
  490. _FastPumpValve.TurnValve(on, out _);
  491. break;
  492. case ValveType.TurboPumpPumping:
  493. _TurboPumpPumpingValve.TurnValve(on, out _);
  494. break;
  495. case ValveType.TurboPumpPurge:
  496. _TurboPumpPurgeValve.TurnValve(on, out _);
  497. break;
  498. case ValveType.Guage:
  499. _GuageValve.TurnValve(on, out _);
  500. break;
  501. case ValveType.LoadlockVent:
  502. _LoadlockVentValve.TurnValve(on, out _);
  503. break;
  504. case ValveType.LoadlockPumping:
  505. _LoadlockPumpingValve.TurnValve(on, out _);
  506. break;
  507. case ValveType.Mfc1:
  508. _Mfc1Valve.TurnValve(on, out _);
  509. break;
  510. case ValveType.Mfc2:
  511. _Mfc2Valve.TurnValve(on, out _);
  512. break;
  513. case ValveType.Mfc3:
  514. _Mfc3Valve.TurnValve(on, out _);
  515. break;
  516. case ValveType.Mfc4:
  517. _Mfc4Valve.TurnValve(on, out _);
  518. break;
  519. case ValveType.Mfc5:
  520. _Mfc5Valve.TurnValve(on, out _);
  521. break;
  522. case ValveType.Mfc6:
  523. _Mfc6Valve.TurnValve(on, out _);
  524. break;
  525. case ValveType.Mfc7:
  526. _Mfc7Valve.TurnValve(on, out _);
  527. break;
  528. case ValveType.Mfc8:
  529. _Mfc8Valve.TurnValve(on, out _);
  530. break;
  531. case ValveType.PVHe3:
  532. _PVHe3Valve.TurnValve(on, out _);
  533. break;
  534. case ValveType.HeISO:
  535. _HeISOValve.TurnValve(on, out _);
  536. break;
  537. default:
  538. throw new ArgumentOutOfRangeException($"Argument error {vlvType}-{on}");
  539. }
  540. }
  541. public override void Monitor()
  542. {
  543. foreach (var gas in _gasLines)
  544. {
  545. gas.Monitor();
  546. }
  547. CheckPermanentInterlock();
  548. }
  549. protected override void CheckPermanentInterlock()
  550. {
  551. if (ProcessPressure > 100 && _GuageValve.SetPoint)
  552. {
  553. _GuageValve.TurnValve(false, out _);
  554. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, $"Process pressure:{ProcessPressure} exceed 100 mtorr, Guage Valve (DO-31) closed automaticlly.");
  555. }
  556. }
  557. public override void CheckIdleInterlock()
  558. {
  559. if (ForelinePressure > _foreline_interlock_pressure)
  560. {
  561. if (_TurboPumpPumpingValve.SetPoint || _TurboPumpPurgeValve.SetPoint || _pendulumValve.IsOpen)
  562. {
  563. _pendulumValve.TurnValve(false);
  564. _TurboPumpPurgeValve.TurnValve(false, out _);
  565. _TurboPumpPumpingValve.TurnValve(false, out _);
  566. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, $"Foreline pressure:{ForelinePressure} exceed {_foreline_interlock_pressure} mtorr, Pendulum valve & PV6 & PV7 closed automaticlly.");
  567. }
  568. }
  569. }
  570. public override void BuzzerBlinking(double time)
  571. {
  572. _SignalTower.BuzzerBlinking(time);
  573. }
  574. public override void SwitchOnBuzzerAndRed()
  575. {
  576. _SignalTower.SwitchOnBuzzerAndRed("", null);
  577. }
  578. public override void Home()
  579. {
  580. // 与yp讨论过,PM 初始化不需要
  581. SetLiftPin(MovementPosition.Down, out _);
  582. if (_slitDoor.State == CylinderState.Open)
  583. {
  584. SetSlitDoor(true, out _);
  585. }
  586. else
  587. {
  588. SetSlitDoor(false, out _);
  589. }
  590. SetSlitDoor(false, out _);
  591. //2023/03/08添加
  592. OpenValve(ValveType.PVN22, true);
  593. //2023/04/25临时添加
  594. //RetractWafer();
  595. }
  596. public override bool SetLiftPin(MovementPosition dirt, out string reason)
  597. {
  598. reason = string.Empty;
  599. switch (dirt)
  600. {
  601. case MovementPosition.Down:
  602. return _LiftPin.SetCylinder(false, out reason);
  603. case MovementPosition.Up:
  604. return _LiftPin.SetCylinder(true, out reason);
  605. case MovementPosition.Left:
  606. case MovementPosition.Right:
  607. case MovementPosition.Middle:
  608. throw new ArgumentException("Movement argument error");
  609. }
  610. return true;
  611. }
  612. public override bool SetSlitDoor(bool open, out string reason)
  613. {
  614. //2023/09/05 Venus无TM,暂时注释
  615. //if (open)
  616. //{
  617. // if (RouteManager.IsATMMode)
  618. // {
  619. // if (!IsATM)
  620. // {
  621. // reason = $"{Module} is not ATM, can not open slit door";
  622. // LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  623. // return false;
  624. // }
  625. // if (!IsTMATM)
  626. // {
  627. // reason = $"LoadLock is not ATM, can not open slit door";
  628. // LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  629. // return false;
  630. // }
  631. // }
  632. // else
  633. // {
  634. // double maxPressureDifference = SC.GetValue<double>("System.PMTMMaxPressureDifference");
  635. // if (Math.Abs(TMPressure - ChamberPressure) > maxPressureDifference)
  636. // {
  637. // reason = $"{Module} and TM pressure difference exceeds the max limit {maxPressureDifference}, TMPressure:{TMPressure}, {Module}Pressure:{ChamberPressure}";
  638. // LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  639. // return false;
  640. // }
  641. // }
  642. //}
  643. return _slitDoor.SetCylinder(open, out reason);
  644. }
  645. public override bool RetractWafer()
  646. {
  647. return _LoadLockArm.SetCylinder(false, out _);
  648. }
  649. public override bool ExtendWafer()
  650. {
  651. return _LoadLockArm.SetCylinder(true, out _);
  652. }
  653. public override bool FlowGas(int gasNum, double val)
  654. {
  655. if (_gasLines.Length <= gasNum)
  656. return false;
  657. _gasLines[gasNum].Flow(val);
  658. return true;
  659. }
  660. public override bool StopGas(int gasNum)
  661. {
  662. if (_gasLines.Length <= gasNum)
  663. return false;
  664. _gasLines[gasNum].Stop();
  665. return true;
  666. }
  667. public override bool FlowN2(double val)
  668. {
  669. _gasLineN2.Flow(val);
  670. return true;
  671. }
  672. public override bool StopN2()
  673. {
  674. _gasLineN2.Stop();
  675. return true;
  676. }
  677. public override void StopAllGases()
  678. {
  679. foreach (var line in _gasLines)
  680. {
  681. line.Stop();
  682. }
  683. }
  684. public override bool TurnPendulumValve(bool on)
  685. {
  686. return _pendulumValve.TurnValve(on);
  687. }
  688. public override bool SetPVPressure(float pressure)
  689. {
  690. return _pendulumValve.SetPressure(pressure);
  691. }
  692. public override bool SetPVPostion(int position)
  693. {
  694. return _pendulumValve.SetPosition(position);
  695. }
  696. public override int GetPVPosition()
  697. {
  698. return _pendulumValve.Position;
  699. }
  700. public override async void HeatChiller(ChillerType chillerType, double value, double offset)
  701. {
  702. //_Chiller?.SetChillerTemp((float)value, (float)offset);
  703. //await Task.Delay(1000);
  704. //_Chiller?.SetChillerOnOff(true);
  705. if (!ChillerIsRunning)
  706. {
  707. _Chiller?.SetChillerOnOff(true);
  708. await Task.Delay(1000);
  709. }
  710. _Chiller?.SetChillerTemp((float)value, (float)offset);
  711. }
  712. public override void OnOffChiller(ChillerType chillerType, bool onoff)
  713. {
  714. _Chiller?.SetChillerOnOff(onoff);
  715. }
  716. public override bool CheckChillerStatus()
  717. {
  718. return _Chiller != null /*&& _Chiller.IsRunning*/ && !_Chiller.IsError;
  719. }
  720. public override void SetGeneratorCommunicationMode(int mode)
  721. {
  722. _Generator?.SetCommunicationMode(mode);
  723. }
  724. public override bool GeneratorPowerOn(bool on)
  725. {
  726. if (_Generator == null) return false;
  727. if (on && !IsRFGInterlockOn)
  728. {
  729. LOG.Write(eEvent.ERR_RF, Module, "射频电源 Interlock条件不满足");
  730. return false;
  731. }
  732. return _Generator.SetPowerOnOff(on, out _);
  733. }
  734. public override bool GeneratorSetpower(float val)
  735. {
  736. if (_Generator == null) return false;
  737. if (Math.Abs(val) > 0.01)
  738. _Generator.SetPower((ushort)val);
  739. return true;
  740. }
  741. public override bool GeneratorBiasPowerOn(bool on)
  742. {
  743. if (_GeneratorBias == null) return false;
  744. if (on && !IsRFGInterlockOn)
  745. {
  746. LOG.Write(eEvent.ERR_RF, Module, "Bias射频电源 Interlock条件不满足");
  747. return false;
  748. }
  749. return _GeneratorBias.SetPowerOnOff(on, out _);
  750. }
  751. public override bool GeneratorBiasSetpower(float val)
  752. {
  753. if (_GeneratorBias == null) return false;
  754. if (Math.Abs(val) > 0.01)
  755. _GeneratorBias.SetPower((ushort)val);
  756. return true;
  757. }
  758. public override bool OnOffSetESCHV(bool val)
  759. {
  760. _ESCHV?.SetPowerOnOff(val);
  761. return true;
  762. }
  763. public override bool SetWallTCTemperature(float value)
  764. {
  765. return _WallTC.RampTemp(value);
  766. }
  767. public override bool GeneratorBiasSetMatchMode(bool val)
  768. {
  769. if (_GeneratorBias == null) return false;
  770. string reason = string.Empty;
  771. _GeneratorBias.SetMatchingAutoMode(val, out reason);
  772. return true;
  773. }
  774. public override bool SetMatchPosition(float c1, float c2)
  775. {
  776. if (_Match == null) return false;
  777. string reason = string.Empty;
  778. _Match.SetMatchPosition(c1, c2, out reason);
  779. return true;
  780. }
  781. public override bool SetBiasMatchPosition(float c1, float c2)
  782. {
  783. if (_BiasMatch == null) return false;
  784. string reason = string.Empty;
  785. _BiasMatch.SetMatchPosition(c1, c2, out reason);
  786. return true;
  787. }
  788. public override bool SetMatchWorkMode(MatchWorkMode matchWorkMode)
  789. {
  790. if (_Match == null) return false;
  791. if (matchWorkMode == MatchWorkMode.Auto)
  792. {
  793. return _Match.SetMatchMode(EnumRfMatchTuneMode.Auto, out _);
  794. }
  795. else
  796. {
  797. return _Match.SetMatchMode(EnumRfMatchTuneMode.Manual, out _);
  798. }
  799. }
  800. public override bool SetBiasMatchWorkMode(MatchWorkMode matchWorkMode)
  801. {
  802. if (_BiasMatch == null) return false;
  803. if (matchWorkMode == MatchWorkMode.Auto)
  804. {
  805. return _BiasMatch.SetMatchMode(EnumRfMatchTuneMode.Auto, out _);
  806. }
  807. else
  808. {
  809. return _BiasMatch.SetMatchMode(EnumRfMatchTuneMode.Manual, out _);
  810. }
  811. }
  812. public override bool SetBiasPulseMode(bool on)
  813. {
  814. if (_GeneratorBias == null) return false;
  815. _GeneratorBias.SetPulseMode(on);
  816. return true;
  817. }
  818. public override bool SetBiasPulseRateFreq(int nFreq)
  819. {
  820. if (_GeneratorBias == null) return false;
  821. _GeneratorBias.SetPulseRateFreq(nFreq);
  822. return true;
  823. }
  824. public override bool SetDiasPulseDutyCycle(int percentage)
  825. {
  826. if (_GeneratorBias == null) return false;
  827. _GeneratorBias.SetPulseDutyCycle(percentage);
  828. return true;
  829. }
  830. public override bool SetESCClampVoltage(int nVoltage)
  831. {
  832. if (_ESCHV == null) return false;
  833. return _ESCHV.SetOutputVoltage(nVoltage);
  834. }
  835. public override bool CheckGeneratorAndHVInterlock(VenusDevice device)
  836. {
  837. eEvent evt = device == VenusDevice.Rf ? eEvent.ERR_RF : eEvent.ERR_ESC_HV;
  838. if (!PMLidClosed)
  839. {
  840. LOG.Write(evt, Module, $"Cannot Power ON {device} as PM Lid is Open.");
  841. return false;
  842. }
  843. if (!IsVAC)
  844. {
  845. LOG.Write(evt, Module, $"Cannot Power ON {device} as PM is not Vacuum.");
  846. return false;
  847. }
  848. if (!IsWaterFlowOk)
  849. {
  850. LOG.Write(evt, Module, $"Cannot Power ON {device} as Water Flow is OFF.");
  851. return false;
  852. }
  853. if (!IsRFGInterlockOn)
  854. {
  855. LOG.Write(evt, Module, $"Cannot Power ON {device} as Generator Interlock is OFF.");
  856. return false;
  857. }
  858. if (!SourceRFFanInterlock)
  859. {
  860. LOG.Write(evt, Module, $"Cannot Power ON {device} as Source RF Fan is OFF.");
  861. return false;
  862. }
  863. if (!SlitDoorClosed)
  864. {
  865. LOG.Write(evt, Module, $"Cannot Power ON {device} as Slit Door is open.");
  866. return false;
  867. }
  868. if ((device == VenusDevice.ESCHV || device == VenusDevice.BiasRf) && WaferManager.Instance.CheckNoWafer(Module, 0))
  869. {
  870. LOG.Write(evt, Module, $"Cannot Power ON {device} as {Module} has no wafer");
  871. return false;
  872. }
  873. return true;
  874. }
  875. public override void SetBacksideHeFlow(double flow)
  876. {
  877. if (_backsideHe == null) return;
  878. _backsideHe.Flow(flow);
  879. }
  880. public override bool SetBacksideHePressure(float mTorr)
  881. {
  882. if (_backsideHe == null) return false;
  883. return _backsideHe.SetBacksideHelium(mTorr);
  884. }
  885. public override bool SetBacksideHeThreshold(int nMin, int nMax)
  886. {
  887. if (_backsideHe == null) return false;
  888. return _backsideHe.SetFlowThreshold(nMin, nMax);
  889. }
  890. public override bool PreparePlace()
  891. {
  892. if (!SetSlitDoor(true, out string reason))
  893. {
  894. LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Open failed:{reason}");
  895. return false;
  896. }
  897. if (!SetLiftPin(MovementPosition.Down, out reason))
  898. {
  899. LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin down failed:{reason}");
  900. return false;
  901. }
  902. return true;
  903. }
  904. public override bool PreparePick()
  905. {
  906. if (!SetSlitDoor(true, out string reason))
  907. {
  908. LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Open failed:{reason}");
  909. return false;
  910. }
  911. if (!SetLiftPin(MovementPosition.Up, out reason))
  912. {
  913. LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin Up failed:{reason}");
  914. return false;
  915. }
  916. return true;
  917. }
  918. public override bool PreparePlaceIsOK()
  919. {
  920. return CheckSlitDoorOpen() && LiftPinIsDown;
  921. }
  922. public override bool PreparePickIsOK()
  923. {
  924. return CheckSlitDoorOpen() && LiftPinIsUp;
  925. }
  926. public override bool EndPlace()
  927. {
  928. if (!SetLiftPin(MovementPosition.Down, out string reason))
  929. {
  930. LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin Down failed:{reason}");
  931. return false;
  932. }
  933. if (!SetSlitDoor(false, out reason))
  934. {
  935. LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Close failed:{reason}");
  936. return false;
  937. }
  938. return true;
  939. }
  940. public override bool EndPick()
  941. {
  942. if (!SetSlitDoor(false, out string reason))
  943. {
  944. LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Close failed:{reason}");
  945. return false;
  946. }
  947. return true;
  948. }
  949. public override bool EndPlaceIsOK()
  950. {
  951. return CheckSlitDoorClose() && LiftPinIsDown;
  952. }
  953. public override bool EndPickIsOK()
  954. {
  955. return CheckSlitDoorClose();
  956. }
  957. public override void RTCloseEvent()
  958. {
  959. if (_Generator.IsPowerOn)
  960. {
  961. GeneratorPowerOn(false);
  962. }
  963. if (_GeneratorBias.IsPowerOn)
  964. {
  965. GeneratorBiasPowerOn(false);
  966. }
  967. if (PendulumValveIsOpen())
  968. {
  969. TurnPendulumValve(false);
  970. }
  971. }
  972. public override bool RFInterlock(VenusDevice device)
  973. {
  974. eEvent evt = eEvent.ERR_RF;
  975. if (!IsWaterFlowOk)
  976. {
  977. LOG.Write(evt, Module, $"Cannot Power ON {device} as Water Flow is OFF.");
  978. return false;
  979. }
  980. if (!IsRFGInterlockOn)
  981. {
  982. LOG.Write(evt, Module, $"Cannot Power ON {device} as Generator Interlock is OFF.");
  983. return false;
  984. }
  985. if (!SourceRFFanInterlock)
  986. {
  987. LOG.Write(evt, Module, $"Cannot Power ON {device} as Source RF Fan is OFF.");
  988. return false;
  989. }
  990. if (GasIsOff())
  991. {
  992. LOG.Write(evt, Module, $"Cannot Power ON {device} as Gas is OFF.");
  993. return false;
  994. }
  995. return true;
  996. }
  997. private bool GasIsOff()
  998. {
  999. if (IsMfc1ValveOpened == false && IsMfc2ValveOpened == false && IsMfc3ValveOpened == false && IsMfc4ValveOpened == false && IsMfc5ValveOpened == false && IsMfc6ValveOpened == false && IsMfc7ValveOpened == false && IsMfc8ValveOpened == false)
  1000. {
  1001. if (_GasRFStopWatch.IsRunning == false)
  1002. {
  1003. _GasRFStopWatch.Start();
  1004. }
  1005. if (_GasRFStopWatch.ElapsedMilliseconds > 1000)
  1006. {
  1007. _GasRFStopWatch.Reset();
  1008. _GasFlag = true;
  1009. return true;
  1010. }
  1011. }
  1012. else
  1013. {
  1014. _GasRFStopWatch.Reset();
  1015. _GasFlag = false;
  1016. }
  1017. return false;
  1018. }
  1019. }
  1020. }