JetVenusPM.cs 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208
  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;
  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. else if (SC.GetValue<int>($"{Module}.BiasRf.MFG") == (int)GeneratorMFG.Truplasma_Ethercat)
  363. {
  364. _GeneratorBias = DEVICE.GetDevice<TruPlasmaRF_Ethercat>($"{Module}.{VenusDevice.BiasRf}");
  365. }
  366. }
  367. if (SC.GetValue<int>($"{Module}.Match.CommunicationType") == (int)CommunicationType.RS232 &&
  368. SC.GetValue<int>($"{Module}.Match.MFG") == (int)MatchMFG.AdTec)
  369. {
  370. _Match = DEVICE.GetDevice<AdTecMatch>($"{Module}.{VenusDevice.Match}");
  371. }
  372. else if (SC.GetValue<int>($"{Module}.Match.CommunicationType") == (int)CommunicationType.Ethernet &&
  373. SC.GetValue<int>($"{Module}.Match.MFG") == (int)MatchMFG.Revtech)
  374. {
  375. _Match = DEVICE.GetDevice<RevtechMatch>($"{Module}.{VenusDevice.BiasMatch}");
  376. }
  377. if (SC.GetValue<bool>($"{Module}.BiasMatch.EnableBiasMatch") &&
  378. SC.GetValue<int>($"{Module}.BiasMatch.CommunicationType") == (int)CommunicationType.RS232 &&
  379. SC.GetValue<int>($"{Module}.BiasMatch.MFG") == (int)MatchMFG.AdTec)
  380. {
  381. _BiasMatch = DEVICE.GetDevice<AdTecMatch>($"{Module}.{VenusDevice.BiasMatch}");
  382. }
  383. else if (SC.GetValue<bool>($"{Module}.BiasMatch.EnableBiasMatch") &&
  384. SC.GetValue<int>($"{Module}.BiasMatch.MFG") == (int)MatchMFG.Revtech)
  385. {
  386. _BiasMatch = DEVICE.GetDevice<RevtechMatch>($"{Module}.{VenusDevice.BiasMatch}");
  387. }
  388. else if (SC.GetValue<bool>($"{Module}.BiasMatch.EnableBiasMatch") &&
  389. SC.GetValue<int>($"{Module}.BiasMatch.MFG") == (int)MatchMFG.Lz_Ethercat)
  390. {
  391. _BiasMatch = DEVICE.GetDevice<LzMatch_Ethercat>($"{Module}.{VenusDevice.BiasMatch}");
  392. }
  393. _foreline_interlock_pressure = SC.GetValue<double>($"{Module}.ForelineInterlockPressure");
  394. DATA.Subscribe($"{Name}.ESCHV.Voltage", () => _ESCHV.OutputVoltage);
  395. }
  396. #endregion
  397. public async override void CloseValves(int? delayTime = null)
  398. {
  399. _PVN21Valve.TurnValve(false, out _);
  400. // _PVN22Valve.TurnValve(false, out _);
  401. _PV11Valve.TurnValve(false, out _);
  402. _PV12Valve.TurnValve(false, out _);
  403. _PV21Valve.TurnValve(false, out _);
  404. _PV22Valve.TurnValve(false, out _);
  405. _PV31Valve.TurnValve(false, out _);
  406. _PV32Valve.TurnValve(false, out _);
  407. _PV41Valve.TurnValve(false, out _);
  408. _PV42Valve.TurnValve(false, out _);
  409. _PVHe1Valve.TurnValve(false, out _);
  410. _PVHe2Valve.TurnValve(false, out _);
  411. _SoftPumpValve.TurnValve(false, out _);
  412. _FastPumpValve.TurnValve(false, out _);
  413. _TurboPumpPumpingValve.TurnValve(false, out _);
  414. _TurboPumpPurgeValve.TurnValve(false, out _);
  415. _GuageValve.TurnValve(false, out _);
  416. _LoadlockVentValve.TurnValve(false, out _);
  417. _LoadlockPumpingValve.TurnValve(false, out _);
  418. _N2Valve.TurnValve(false, out _);
  419. _FastPumpValve.TurnValve(false, out _);
  420. _Mfc1Valve.TurnValve(false, out _);
  421. _Mfc2Valve.TurnValve(false, out _);
  422. _Mfc3Valve.TurnValve(false, out _);
  423. _Mfc4Valve.TurnValve(false, out _);
  424. _Mfc5Valve.TurnValve(false, out _);
  425. _Mfc6Valve.TurnValve(false, out _);
  426. _Mfc7Valve.TurnValve(false, out _);
  427. _Mfc8Valve.TurnValve(false, out _);
  428. _PVHe3Valve.TurnValve(false, out _);
  429. _HeISOValve.TurnValve(false, out _);
  430. foreach (var stick in _gasLines)
  431. {
  432. stick.Stop();
  433. }
  434. if (delayTime != null)
  435. {
  436. await Task.Delay((int)delayTime);
  437. }
  438. _GasFinalValve.TurnValve(false, out _);
  439. }
  440. public override void TurnDryPump(bool on)
  441. {
  442. //_pressureController.StartPump(on);
  443. _MainPump?.SetPumpOnOff(on);
  444. }
  445. public override void TurnTurboPump(bool on)
  446. {
  447. _TurboPump?.SetPumpOnOff(on);
  448. }
  449. public override void OpenValve(ValveType vlvType, bool on)
  450. {
  451. switch (vlvType)
  452. {
  453. case ValveType.PVN21:
  454. _PVN21Valve.TurnValve(on, out _);
  455. break;
  456. case ValveType.PVN22:
  457. _PVN22Valve.TurnValve(on, out _);
  458. LOG.Write(eEvent.EV_DEVICE_INFO, Module, $"{(on ? "打开" : "关闭")} 阀 {vlvType.ToString()}");
  459. break;
  460. case ValveType.PV11:
  461. _PV11Valve.TurnValve(on, out _);
  462. break;
  463. case ValveType.PV12:
  464. _PV12Valve.TurnValve(on, out _);
  465. break;
  466. case ValveType.PV21:
  467. _PV21Valve.TurnValve(on, out _);
  468. break;
  469. case ValveType.PV22:
  470. _PV22Valve.TurnValve(on, out _);
  471. break;
  472. case ValveType.PV31:
  473. _PV31Valve.TurnValve(on, out _);
  474. break;
  475. case ValveType.PV32:
  476. _PV32Valve.TurnValve(on, out _);
  477. break;
  478. case ValveType.PV41:
  479. _PV41Valve.TurnValve(on, out _);
  480. break;
  481. case ValveType.PV42:
  482. _PV42Valve.TurnValve(on, out _);
  483. break;
  484. case ValveType.N2:
  485. _N2Valve.TurnValve(on, out _);
  486. break;
  487. case ValveType.PVHe1:
  488. _PVHe1Valve.TurnValve(on, out _);
  489. break;
  490. case ValveType.PVHe2:
  491. _PVHe2Valve.TurnValve(on, out _);
  492. break;
  493. case ValveType.GasFinal:
  494. _GasFinalValve.TurnValve(on, out _);
  495. break;
  496. case ValveType.SoftPump:
  497. _SoftPumpValve.TurnValve(on, out _);
  498. break;
  499. case ValveType.FastPump:
  500. _FastPumpValve.TurnValve(on, out _);
  501. break;
  502. case ValveType.TurboPumpPumping:
  503. _TurboPumpPumpingValve.TurnValve(on, out _);
  504. break;
  505. case ValveType.TurboPumpPurge:
  506. _TurboPumpPurgeValve.TurnValve(on, out _);
  507. break;
  508. case ValveType.Guage:
  509. _GuageValve.TurnValve(on, out _);
  510. break;
  511. case ValveType.LoadlockVent:
  512. _LoadlockVentValve.TurnValve(on, out _);
  513. break;
  514. case ValveType.LoadlockPumping:
  515. _LoadlockPumpingValve.TurnValve(on, out _);
  516. break;
  517. case ValveType.Mfc1:
  518. _Mfc1Valve.TurnValve(on, out _);
  519. break;
  520. case ValveType.Mfc2:
  521. _Mfc2Valve.TurnValve(on, out _);
  522. break;
  523. case ValveType.Mfc3:
  524. _Mfc3Valve.TurnValve(on, out _);
  525. break;
  526. case ValveType.Mfc4:
  527. _Mfc4Valve.TurnValve(on, out _);
  528. break;
  529. case ValveType.Mfc5:
  530. _Mfc5Valve.TurnValve(on, out _);
  531. break;
  532. case ValveType.Mfc6:
  533. _Mfc6Valve.TurnValve(on, out _);
  534. break;
  535. case ValveType.Mfc7:
  536. _Mfc7Valve.TurnValve(on, out _);
  537. break;
  538. case ValveType.Mfc8:
  539. _Mfc8Valve.TurnValve(on, out _);
  540. break;
  541. case ValveType.PVHe3:
  542. _PVHe3Valve.TurnValve(on, out _);
  543. break;
  544. case ValveType.HeISO:
  545. _HeISOValve.TurnValve(on, out _);
  546. break;
  547. default:
  548. throw new ArgumentOutOfRangeException($"Argument error {vlvType}-{on}");
  549. }
  550. }
  551. public override void Monitor()
  552. {
  553. foreach (var gas in _gasLines)
  554. {
  555. gas.Monitor();
  556. }
  557. CheckPermanentInterlock();
  558. }
  559. protected override void CheckPermanentInterlock()
  560. {
  561. if (ProcessPressure >= 100 && _GuageValve.SetPoint)
  562. {
  563. _GuageValve.TurnValve(false, out _);
  564. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"Process pressure:{ProcessPressure} exceed 100 mtorr, Guage Valve (DO-31) closed automaticlly.");
  565. }
  566. }
  567. public override void CheckIdleInterlock()
  568. {
  569. if (ForelinePressure > _foreline_interlock_pressure)
  570. {
  571. if (_TurboPumpPumpingValve.SetPoint || _TurboPumpPurgeValve.SetPoint || _pendulumValve.IsOpen)
  572. {
  573. _pendulumValve.TurnValve(false);
  574. _TurboPumpPurgeValve.TurnValve(false, out _);
  575. _TurboPumpPumpingValve.TurnValve(false, out _);
  576. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, $"Foreline pressure:{ForelinePressure} exceed {_foreline_interlock_pressure} mtorr, Pendulum valve & PV6 & PV7 closed automaticlly.");
  577. }
  578. }
  579. }
  580. public override void BuzzerBlinking(double time)
  581. {
  582. _SignalTower.BuzzerBlinking(time);
  583. }
  584. public override void SwitchOnBuzzerAndRed()
  585. {
  586. _SignalTower.SwitchOnBuzzerAndRed("", null);
  587. }
  588. public override void Home()
  589. {
  590. // 与yp讨论过,PM 初始化不需要
  591. SetLiftPin(MovementPosition.Down, out _);
  592. if (_slitDoor.State == CylinderState.Open)
  593. {
  594. SetSlitDoor(true, out _);
  595. }
  596. else
  597. {
  598. SetSlitDoor(false, out _);
  599. }
  600. SetSlitDoor(false, out _);
  601. //2023/03/08添加
  602. OpenValve(ValveType.PVN22, true);
  603. //2023/04/25临时添加
  604. //RetractWafer();
  605. }
  606. public override bool SetLiftPin(MovementPosition dirt, out string reason)
  607. {
  608. reason = string.Empty;
  609. switch (dirt)
  610. {
  611. case MovementPosition.Down:
  612. return _LiftPin.SetCylinder(false, out reason);
  613. case MovementPosition.Up:
  614. return _LiftPin.SetCylinder(true, out reason);
  615. case MovementPosition.Left:
  616. case MovementPosition.Right:
  617. case MovementPosition.Middle:
  618. throw new ArgumentException("Movement argument error");
  619. }
  620. return true;
  621. }
  622. public override bool SetSlitDoor(bool open, out string reason)
  623. {
  624. //2023/09/05 Venus无TM,暂时注释
  625. //if (open)
  626. //{
  627. // if (RouteManager.IsATMMode)
  628. // {
  629. // if (!IsATM)
  630. // {
  631. // reason = $"{Module} is not ATM, can not open slit door";
  632. // LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  633. // return false;
  634. // }
  635. // if (!IsTMATM)
  636. // {
  637. // reason = $"LoadLock is not ATM, can not open slit door";
  638. // LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  639. // return false;
  640. // }
  641. // }
  642. // else
  643. // {
  644. // double maxPressureDifference = SC.GetValue<double>("System.PMTMMaxPressureDifference");
  645. // if (Math.Abs(TMPressure - ChamberPressure) > maxPressureDifference)
  646. // {
  647. // reason = $"{Module} and TM pressure difference exceeds the max limit {maxPressureDifference}, TMPressure:{TMPressure}, {Module}Pressure:{ChamberPressure}";
  648. // LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  649. // return false;
  650. // }
  651. // }
  652. //}
  653. return _slitDoor.SetCylinder(open, out reason);
  654. }
  655. public override bool RetractWafer()
  656. {
  657. return _LoadLockArm.SetCylinder(false, out _);
  658. }
  659. public override bool ExtendWafer()
  660. {
  661. return _LoadLockArm.SetCylinder(true, out _);
  662. }
  663. public override bool FlowGas(int gasNum, double val)
  664. {
  665. if (_gasLines.Length <= gasNum)
  666. return false;
  667. _gasLines[gasNum].Flow(val);
  668. return true;
  669. }
  670. public override bool StopGas(int gasNum)
  671. {
  672. if (_gasLines.Length <= gasNum)
  673. return false;
  674. _gasLines[gasNum].Stop();
  675. return true;
  676. }
  677. public override bool FlowN2(double val)
  678. {
  679. _gasLineN2.Flow(val);
  680. return true;
  681. }
  682. public override bool StopN2()
  683. {
  684. _gasLineN2.Stop();
  685. return true;
  686. }
  687. public override void StopAllGases()
  688. {
  689. foreach (var line in _gasLines)
  690. {
  691. line.Stop();
  692. }
  693. }
  694. public override bool TurnPendulumValve(bool on)
  695. {
  696. return _pendulumValve.TurnValve(on);
  697. }
  698. public override bool SetPVPressure(float pressure)
  699. {
  700. return _pendulumValve.SetPressure(pressure);
  701. }
  702. public override bool SetPVPostion(int position)
  703. {
  704. return _pendulumValve.SetPosition(position);
  705. }
  706. public override int GetPVPosition()
  707. {
  708. return _pendulumValve.Position;
  709. }
  710. public override async void HeatChiller(ChillerType chillerType, double value, double offset)
  711. {
  712. //_Chiller?.SetChillerTemp((float)value, (float)offset);
  713. //await Task.Delay(1000);
  714. //_Chiller?.SetChillerOnOff(true);
  715. if (!ChillerIsRunning)
  716. {
  717. _Chiller?.SetChillerOnOff(true);
  718. await Task.Delay(1000);
  719. }
  720. _Chiller?.SetChillerTemp((float)value, (float)offset);
  721. }
  722. public override void OnOffChiller(ChillerType chillerType, bool onoff)
  723. {
  724. _Chiller?.SetChillerOnOff(onoff);
  725. }
  726. public override bool CheckChillerStatus()
  727. {
  728. return _Chiller != null /*&& _Chiller.IsRunning*/ && !_Chiller.IsError;
  729. }
  730. public override void SetGeneratorCommunicationMode(int mode)
  731. {
  732. _Generator?.SetCommunicationMode(mode);
  733. }
  734. public override bool GeneratorPowerOn(bool on)
  735. {
  736. if (_Generator == null) return false;
  737. if (on == _Generator.IsPowerOn)
  738. {
  739. string operation = on ? "Open" : "Close";
  740. LOG.Write(eEvent.WARN_RF, Module, $" RF 已经 {operation},不可重复{operation}");
  741. return true;
  742. }
  743. if (on && !IsRFGInterlockOn)
  744. {
  745. LOG.Write(eEvent.ERR_RF, Module, "射频电源 Interlock条件不满足");
  746. return false;
  747. }
  748. return _Generator.SetPowerOnOff(on, out _);
  749. }
  750. public override bool GeneratorSetpower(float val)
  751. {
  752. if (_Generator == null) return false;
  753. if (Math.Abs(val) > 0.01)
  754. _Generator.SetPower((ushort)val);
  755. return true;
  756. }
  757. public override bool GeneratorBiasPowerOn(bool on)
  758. {
  759. if (_GeneratorBias == null) return false;
  760. if (on == _GeneratorBias.IsPowerOn)
  761. {
  762. string operation = on ? "Open" : "Close";
  763. LOG.Write(eEvent.WARN_RF, Module, $"Bias RF 已经 {operation},不可重复{operation}");
  764. return true;
  765. }
  766. if (on && !IsRFGInterlockOn)
  767. {
  768. LOG.Write(eEvent.ERR_RF, Module, "Bias RF Interlock条件不满足");
  769. return false;
  770. }
  771. return _GeneratorBias.SetPowerOnOff(on, out _);
  772. }
  773. public override bool GeneratorBiasSetpower(float val)
  774. {
  775. if (_GeneratorBias == null) return false;
  776. if (Math.Abs(val) > 0.01)
  777. _GeneratorBias.SetPower((ushort)val);
  778. return true;
  779. }
  780. public override bool OnOffSetESCHV(bool val)
  781. {
  782. _ESCHV?.SetPowerOnOff(val);
  783. return true;
  784. }
  785. public override bool SetWallTCTemperature(float value)
  786. {
  787. return _WallTC.RampTemp(value);
  788. }
  789. public override bool GeneratorBiasSetMatchMode(bool val)
  790. {
  791. if (_GeneratorBias == null) return false;
  792. string reason = string.Empty;
  793. _GeneratorBias.SetMatchingAutoMode(val, out reason);
  794. return true;
  795. }
  796. public override bool SetMatchPosition(float c1, float c2)
  797. {
  798. if (_Match == null) return false;
  799. string reason = string.Empty;
  800. _Match.SetMatchPosition(c1, c2, out reason);
  801. return true;
  802. }
  803. public override bool SetBiasMatchPosition(float c1, float c2)
  804. {
  805. if (_BiasMatch == null) return false;
  806. string reason = string.Empty;
  807. _BiasMatch.SetMatchPosition(c1, c2, out reason);
  808. return true;
  809. }
  810. public override bool SetMatchWorkMode(MatchWorkMode matchWorkMode)
  811. {
  812. if (_Match == null) return false;
  813. if (matchWorkMode == MatchWorkMode.Auto)
  814. {
  815. return _Match.SetMatchMode(EnumRfMatchTuneMode.Auto, out _);
  816. }
  817. else
  818. {
  819. return _Match.SetMatchMode(EnumRfMatchTuneMode.Manual, out _);
  820. }
  821. }
  822. public override bool SetBiasMatchWorkMode(MatchWorkMode matchWorkMode)
  823. {
  824. if (_BiasMatch == null) return false;
  825. if (matchWorkMode == MatchWorkMode.Auto)
  826. {
  827. return _BiasMatch.SetMatchMode(EnumRfMatchTuneMode.Auto, out _);
  828. }
  829. else if (matchWorkMode == MatchWorkMode.Manual)
  830. {
  831. return _BiasMatch.SetMatchMode(EnumRfMatchTuneMode.Manual, out _);
  832. }
  833. return false;
  834. }
  835. public override bool SetBiasPulseMode(bool on)
  836. {
  837. if (_GeneratorBias == null) return false;
  838. _GeneratorBias.SetPulseMode(on);
  839. return true;
  840. }
  841. public override bool SetBiasPulseRateFreq(int nFreq)
  842. {
  843. if (_GeneratorBias == null) return false;
  844. _GeneratorBias.SetPulseRateFreq(nFreq);
  845. return true;
  846. }
  847. public override bool SetDiasPulseDutyCycle(int percentage)
  848. {
  849. if (_GeneratorBias == null) return false;
  850. _GeneratorBias.SetPulseDutyCycle(percentage);
  851. return true;
  852. }
  853. public override bool SetESCClampVoltage(int nVoltage)
  854. {
  855. if (_ESCHV == null) return false;
  856. return _ESCHV.SetOutputVoltage(nVoltage);
  857. }
  858. public override bool CheckGeneratorAndHVInterlock(VenusDevice device)
  859. {
  860. eEvent evt = device == VenusDevice.Rf ? eEvent.ERR_RF : eEvent.ERR_ESC_HV;
  861. if (!PMLidClosed)
  862. {
  863. LOG.Write(evt, Module, $"Cannot Power ON {device} as PM Lid is Open.");
  864. return false;
  865. }
  866. if (!IsVAC)
  867. {
  868. LOG.Write(evt, Module, $"Cannot Power ON {device} as PM is not Vacuum.");
  869. return false;
  870. }
  871. if (!IsWaterFlowOk)
  872. {
  873. LOG.Write(evt, Module, $"Cannot Power ON {device} as Water Flow is OFF.");
  874. return false;
  875. }
  876. if (!IsRFGInterlockOn)
  877. {
  878. LOG.Write(evt, Module, $"Cannot Power ON {device} as Generator Interlock is OFF.");
  879. return false;
  880. }
  881. if (!SourceRFFanInterlock)
  882. {
  883. LOG.Write(evt, Module, $"Cannot Power ON {device} as Source RF Fan is OFF.");
  884. return false;
  885. }
  886. if (!SlitDoorClosed)
  887. {
  888. LOG.Write(evt, Module, $"Cannot Power ON {device} as Slit Door is open.");
  889. return false;
  890. }
  891. if ((device == VenusDevice.ESCHV || device == VenusDevice.BiasRf) && WaferManager.Instance.CheckNoWafer(Module, 0))
  892. {
  893. LOG.Write(evt, Module, $"Cannot Power ON {device} as {Module} has no wafer");
  894. return false;
  895. }
  896. return true;
  897. }
  898. public override void SetBacksideHeFlow(double flow)
  899. {
  900. if (_backsideHe == null) return;
  901. _backsideHe.Flow(flow);
  902. }
  903. public override bool SetBacksideHePressure(float mTorr)
  904. {
  905. if (_backsideHe == null) return false;
  906. return _backsideHe.SetBacksideHelium(mTorr);
  907. }
  908. public override bool SetBacksideHeThreshold(int nMin, int nMax)
  909. {
  910. if (_backsideHe == null) return false;
  911. return _backsideHe.SetFlowThreshold(nMin, nMax);
  912. }
  913. public override bool PreparePlace()
  914. {
  915. if (!SetSlitDoor(true, out string reason))
  916. {
  917. LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Open failed:{reason}");
  918. return false;
  919. }
  920. if (!SetLiftPin(MovementPosition.Down, out reason))
  921. {
  922. LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin down failed:{reason}");
  923. return false;
  924. }
  925. return true;
  926. }
  927. public override bool PreparePick()
  928. {
  929. if (!SetSlitDoor(true, out string reason))
  930. {
  931. LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Open failed:{reason}");
  932. return false;
  933. }
  934. if (!SetLiftPin(MovementPosition.Up, out reason))
  935. {
  936. LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin Up failed:{reason}");
  937. return false;
  938. }
  939. return true;
  940. }
  941. public override bool PreparePlaceIsOK()
  942. {
  943. return CheckSlitDoorOpen() && LiftPinIsDown;
  944. }
  945. public override bool PreparePickIsOK()
  946. {
  947. return CheckSlitDoorOpen() && LiftPinIsUp;
  948. }
  949. public override bool EndPlace()
  950. {
  951. if (!SetLiftPin(MovementPosition.Down, out string reason))
  952. {
  953. LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin Down failed:{reason}");
  954. return false;
  955. }
  956. if (!SetSlitDoor(false, out reason))
  957. {
  958. LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Close failed:{reason}");
  959. return false;
  960. }
  961. return true;
  962. }
  963. public override bool EndPick()
  964. {
  965. if (!SetSlitDoor(false, out string reason))
  966. {
  967. LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Close failed:{reason}");
  968. return false;
  969. }
  970. return true;
  971. }
  972. public override bool EndPlaceIsOK()
  973. {
  974. return CheckSlitDoorClose() && LiftPinIsDown;
  975. }
  976. public override bool EndPickIsOK()
  977. {
  978. return CheckSlitDoorClose();
  979. }
  980. public override void RTCloseEvent()
  981. {
  982. if (_Generator.IsPowerOn)
  983. {
  984. GeneratorPowerOn(false);
  985. }
  986. if (_GeneratorBias.IsPowerOn)
  987. {
  988. GeneratorBiasPowerOn(false);
  989. }
  990. if (PendulumValveIsOpen())
  991. {
  992. TurnPendulumValve(false);
  993. }
  994. }
  995. public override bool RFInterlock(VenusDevice device)
  996. {
  997. eEvent evt = eEvent.ERR_RF;
  998. if (!IsWaterFlowOk)
  999. {
  1000. LOG.Write(evt, Module, $"Cannot Power ON {device} as Water Flow is OFF.");
  1001. return false;
  1002. }
  1003. if (!IsRFGInterlockOn)
  1004. {
  1005. LOG.Write(evt, Module, $"Cannot Power ON {device} as Generator Interlock is OFF.");
  1006. return false;
  1007. }
  1008. if (!SourceRFFanInterlock)
  1009. {
  1010. LOG.Write(evt, Module, $"Cannot Power ON {device} as Source RF Fan is OFF.");
  1011. return false;
  1012. }
  1013. if (GasIsOff())
  1014. {
  1015. LOG.Write(evt, Module, $"Cannot Power ON {device} as Gas is OFF.");
  1016. return false;
  1017. }
  1018. return true;
  1019. }
  1020. private bool GasIsOff()
  1021. {
  1022. if (IsMfc1ValveOpened == false && IsMfc2ValveOpened == false && IsMfc3ValveOpened == false && IsMfc4ValveOpened == false && IsMfc5ValveOpened == false && IsMfc6ValveOpened == false && IsMfc7ValveOpened == false && IsMfc8ValveOpened == false)
  1023. {
  1024. if (_GasRFStopWatch.IsRunning == false)
  1025. {
  1026. _GasRFStopWatch.Start();
  1027. }
  1028. if (_GasRFStopWatch.ElapsedMilliseconds > 1000)
  1029. {
  1030. _GasRFStopWatch.Reset();
  1031. _GasFlag = true;
  1032. return true;
  1033. }
  1034. }
  1035. else
  1036. {
  1037. _GasRFStopWatch.Reset();
  1038. _GasFlag = false;
  1039. }
  1040. return false;
  1041. }
  1042. }
  1043. }