JetKepler2200APM.cs 43 KB

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