JetKepler2200BPM.cs 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134
  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 JetKepler2200BPM : 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 IoMfc _heMfc;
  91. private readonly double _foreline_interlock_pressure = 750;
  92. private Stopwatch _GasRFStopWatch = new Stopwatch();
  93. private bool _GasFlag = false;
  94. // 盖子的状态
  95. public override bool IsLidClosed => _Lid.OFFFeedback;
  96. //public override bool IsLidLoadlockClosed => _LidLoadlock.OFFFeedback;
  97. public override bool IsSlitDoorClosed => !_slitDoor.ONFeedback && _slitDoor.OFFFeedback;
  98. public override bool IsPumpRunning => _MainPump.IsRunning;
  99. public override bool IsTurboPumpRunning => _TurboPump.IsRunning;
  100. public override bool IsTurboPumpAtSpeed => _TurboPump.AtSpeed;
  101. public override float TurboPumpSpeed => _TurboPump.Speed;
  102. public override bool HasPumpError => _MainPump.IsError || !_MainPump.IsRunning;
  103. public override bool HasTurboPumpError => _TurboPump.IsError || !_TurboPump.IsRunning;
  104. public override bool IsCDA_OK => _CDAPressure.Value;
  105. public override bool IsFastPumpOpened => _FastPumpValve.Status;
  106. public override bool IsSoftPumpOpened => _SoftPumpValve.Status;
  107. public override bool IsMfc1ValveOpened => _Mfc1Valve.Status;
  108. public override bool IsMfc2ValveOpened => _Mfc2Valve.Status;
  109. public override bool IsMfc3ValveOpened => _Mfc3Valve.Status;
  110. public override bool IsMfc4ValveOpened => _Mfc4Valve.Status;
  111. public override bool IsMfc5ValveOpened => _Mfc5Valve.Status;
  112. public override bool IsMfc6ValveOpened => _Mfc6Valve.Status;
  113. public override bool IsMfc7ValveOpened => _Mfc7Valve.Status;
  114. public override bool IsMfc8ValveOpened => _Mfc8Valve.Status;
  115. public override bool IsGuageValveOpened => _GuageValve.Status;
  116. // 压力信号
  117. public override bool IsATM => _ATM_sw.Value;
  118. public override bool PVN22ValveIsOpen => _PVN22Valve.Status;
  119. public override bool LiftPinIsDown => false;
  120. public override bool LiftPinIsUp => false;
  121. public override bool IsATMLoadlock => _ATM_Loadlock_sw.Value;
  122. public override bool IsVACLoadLock => LoadlockPressure <= 1000;
  123. public override bool IsVAC => _VAC_sw.Value;
  124. public override bool IsWaterFlowOk => true;
  125. public override bool IsWLK => _WLK_sw.Value;
  126. public override bool IsRFGInterlockOn => _RFG_Interlock.Value;
  127. public override bool PMLidClosed => _PM_Lid_Closed.Value;
  128. public override bool TurboPumpInterlock => _TurboPumpInterlock.Value;
  129. public override bool SourceRFMatchInterlock => _Source_RF_Match_Interlock.Value;
  130. public override bool SlitDoorClosed => _PM_SlitDoor_Closed.Value;
  131. public override double ProcessLowPressure => _pendulumValve.Pressure;
  132. public override double ProcessHighPressure => _pressureController.ProcessHigh.Value;
  133. public override double CalculationPressure
  134. {
  135. get
  136. {
  137. if (ProcessPressure < 2000)
  138. {
  139. return ProcessPressure;
  140. }
  141. else
  142. {
  143. return ChamberPressure;
  144. }
  145. }
  146. }
  147. public override double ProcessPressure => _pendulumValve.Pressure;
  148. public override double ChamberPressure => _pressureController.PressureGauge.Value;
  149. public override double ForelinePressure => _pressureController.ForelineGauge.Value;
  150. public override double TargetPressure => _pressureController.TargetPressure;
  151. public override double LoadlockPressure => 0;
  152. public override double ESCHePressure => 0;
  153. //public override int ESCOutputVoltage => _ESCHV.OutputVoltage;
  154. //public override double ESCPositiveOutputCurrent => _ESCHV.PositiveOutputCurrent;
  155. //public override double ESCNegativeOutputCurrent => _ESCHV.NegativeOutputCurrent;
  156. //public override bool IsHVOn => _ESCHV.IsOn;
  157. public override float CoolantInletTempFB => 0;
  158. public override float CoolantOutletTempFB => 0;
  159. public override bool ChillerIsRunning => false;
  160. //Loadlock_Arm
  161. //public override bool IsLoadlockArmRetract => _LoadLockArm.OFFFeedback;
  162. //public override bool IsLoadlockArmExtend => _LoadLockArm.ONFeedback;
  163. ////Loadlock_Arm DO
  164. //public override bool LoadlockArmRetract => _LoadLockArm.OFFSetPoint;
  165. //public override bool LoadlockArmExtend => _LoadLockArm.ONSetPoint;
  166. public override float ReflectPower => _Generator.ReflectPower;
  167. //public override float BiasReflectPower => _GeneratorBias.ReflectPower;
  168. public override float ForwardPower => _Generator.ForwardPower;
  169. public override bool BackSideHeOutOfRange => _backsideHe.OutOfRange;
  170. public override float RFMatchC1 => _Match != null ? _Match.TunePosition1 : 0;
  171. public override float RFMatchC2 => _Match != null ? _Match.TunePosition2 : 0;
  172. //public override float BiasRFMatchC1 => _BiasMatch != null ? _BiasMatch.TunePosition1 : 0;
  173. //public override float BiasRFMatchC2 => _BiasMatch != null ? _BiasMatch.TunePosition1 : 0;
  174. public override double MFC1FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas1").FeedBack;
  175. public override double MFC2FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas2").FeedBack;
  176. public override double MFC3FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas3").FeedBack;
  177. public override double MFC4FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas4").FeedBack;
  178. public override double MFC5FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas5").FeedBack;
  179. public override double MFC6FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas6").FeedBack;
  180. public new ModuleName Module { get; }
  181. public override MovementPosition LiftPinPosition
  182. {
  183. get
  184. {
  185. MovementPosition pos = MovementPosition.Unknown;
  186. if (_LiftPin == null)
  187. {
  188. return MovementPosition.Down;
  189. }
  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 JetKepler2200BPM(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. _PurgeValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePurge}");
  270. _Mfc1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc1}");
  271. _Mfc2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc2}");
  272. _Mfc3Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc3}");
  273. _Mfc4Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc4}");
  274. _Mfc5Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc5}");
  275. _Mfc6Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc6}");
  276. _Mfc7Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc7}");
  277. _Mfc8Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc8}");
  278. //_PVHe1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVHe1}");
  279. //_PVHe2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVHe2}");
  280. _GasFinalValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveGasFinal}");
  281. _SoftPumpValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveSoftPump}");
  282. _FastPumpValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveFastPump}");
  283. _TurboPumpPumpingValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveTurboPumpPumping}");
  284. _TurboPumpPurgeValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveTurboPumpPurge}");
  285. _GuageValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveGuage}");
  286. _LoadlockVentValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveLoadlockVent}");
  287. _LoadlockPumpingValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveLoadlockPumping}");
  288. //_heMfc = DEVICE.GetDevice<IoMfc>($"{Module}.MfcHe");
  289. _ATM_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorATMSwitch");
  290. _ATM_Loadlock_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorLoadlockATMSwitch");
  291. _N2Pressure_sw = DEVICE.GetDevice<IoSensor>($"{Module}.N2PressureOk");
  292. _VAC_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorVacSwitch");
  293. _Water_Flow = DEVICE.GetDevice<IoSensor>($"{Module}.SensorWaterFlowOk");
  294. _WLK_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorWaterLeakOk");
  295. _CDAPressure = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCDAPressureOk");
  296. _RFG_Interlock = DEVICE.GetDevice<IoSensor>($"{Module}.GeneratorInterlock");
  297. _PM_Lid_Closed = DEVICE.GetDevice<IoSensor>($"{Module}.SensorPMLidClosed");
  298. _Source_RF_Match_Interlock = DEVICE.GetDevice<IoSensor>($"{Module}.RFMatchInterlock");
  299. _PM_SlitDoor_Closed = DEVICE.GetDevice<IoSensor>($"{Module}.SensorSlitDoorClosed");
  300. _TurboPumpInterlock = DEVICE.GetDevice<IoSensor>($"{Module}.TurboPumpInterlock");
  301. _GasBoxDoor = DEVICE.GetDevice<IoSensor>($"{Module}.GasBoxDoorSW");
  302. _GasBoxPressure = DEVICE.GetDevice<IoSensor>($"{Module}.GasBoxPressureSW");
  303. _ForelineTC = DEVICE.GetDevice<IoHeater>($"{Module}.ForelineHeater");
  304. _WallTC = DEVICE.GetDevice<IoHeater>($"{Module}.WallHeater");
  305. //_SignalTower = DEVICE.GetDevice<IoSignalTower>($"{Module}.SignalTower");
  306. _CDAPressure = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCDAPressureOk");
  307. _pressureController = DEVICE.GetDevice<IoPressureControl>($"{Module}.{VenusDevice.PressureControl}");
  308. _gasLines = new IoGasStick[8];
  309. for (int index = 0; index < 8; index++)
  310. {
  311. _gasLines[index] = DEVICE.GetDevice<IoGasStick>($"{Module}.GasStick{index + 1}");
  312. }
  313. _gasLineN2 = DEVICE.GetDevice<IoGasStick>($"{Module}.GasStickN2");
  314. _backsideHe = DEVICE.GetDevice<IoBacksideHe>($"{Module}.BacksideHelium");
  315. _highTemperatureHeater = DEVICE.GetDevice<IoHighTemperatureHeater>($"{Module}.HighTemperatureHeater");
  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 (
  369. SC.GetValue<int>($"{Module}.Match.MFG") == (int)MatchMFG.Revtech)
  370. {
  371. _Match = DEVICE.GetDevice<RevtechMatch>($"{Module}.{VenusDevice.BiasMatch}");
  372. }
  373. _GasRFStopWatch.Stop();
  374. //if (SC.GetValue<bool>($"{Module}.BiasMatch.EnableBiasMatch") &&
  375. // SC.GetValue<int>($"{Module}.BiasMatch.CommunicationType") == (int)CommunicationType.RS232 &&
  376. // SC.GetValue<int>($"{Module}.BiasMatch.MFG") == (int)MatchMFG.AdTec)
  377. //{
  378. // _BiasMatch = DEVICE.GetDevice<AdTecMatch>($"{Module}.{VenusDevice.BiasMatch}");
  379. //}
  380. //else if (SC.GetValue<bool>($"{Module}.BiasMatch.EnableBiasMatch") &&
  381. // SC.GetValue<int>($"{Module}.BiasMatch.MFG") == (int)MatchMFG.Revtech)
  382. //{
  383. // _BiasMatch = DEVICE.GetDevice<RevtechMatch>($"{Module}.{VenusDevice.BiasMatch}");
  384. //}
  385. _foreline_interlock_pressure = SC.GetValue<double>($"{Module}.ForelineInterlockPressure");
  386. DATA.Subscribe($"{Name}.SCR1", () => GetAiValue($"{Module}.AI_CHB_M-HT_SCR1_PWR_OUT"));
  387. DATA.Subscribe($"{Name}.SCR2", () => GetAiValue($"{Module}.AI_CHB_M-HT_SCR2_PWR_OUT"));
  388. }
  389. #endregion
  390. public async override void CloseValves(int? delayTime = null)
  391. {
  392. _PVN21Valve.TurnValve(false, out _);
  393. // _PVN22Valve.TurnValve(false, out _);
  394. _PV11Valve.TurnValve(false, out _);
  395. _PV12Valve.TurnValve(false, out _);
  396. _PV21Valve.TurnValve(false, out _);
  397. _PV22Valve.TurnValve(false, out _);
  398. _PV31Valve.TurnValve(false, out _);
  399. _PV32Valve.TurnValve(false, out _);
  400. _PV41Valve.TurnValve(false, out _);
  401. _PV42Valve.TurnValve(false, out _);
  402. //_PVHe1Valve.TurnValve(false, out _);
  403. //_PVHe2Valve.TurnValve(false, out _);
  404. _SoftPumpValve.TurnValve(false, out _);
  405. _FastPumpValve.TurnValve(false, out _);
  406. _TurboPumpPumpingValve.TurnValve(false, out _);
  407. _TurboPumpPurgeValve.TurnValve(false, out _);
  408. _GuageValve.TurnValve(false, out _);
  409. _N2Valve.TurnValve(false, out _);
  410. _FastPumpValve.TurnValve(false, out _);
  411. _Mfc1Valve.TurnValve(false, out _);
  412. _Mfc2Valve.TurnValve(false, out _);
  413. _Mfc3Valve.TurnValve(false, out _);
  414. _Mfc4Valve.TurnValve(false, out _);
  415. _Mfc5Valve.TurnValve(false, out _);
  416. _Mfc6Valve.TurnValve(false, out _);
  417. _Mfc7Valve.TurnValve(false, out _);
  418. _Mfc8Valve.TurnValve(false, out _);
  419. foreach (var stick in _gasLines)
  420. {
  421. stick.Stop();
  422. }
  423. if (delayTime != null)
  424. {
  425. await Task.Delay((int)delayTime);
  426. }
  427. _GasFinalValve.TurnValve(false, out _);
  428. _PurgeValve.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.Purge:
  478. _PurgeValve.TurnValve(on, out _);
  479. break;
  480. //case ValveType.PVHe1:
  481. // _PVHe1Valve.TurnValve(on, out _);
  482. // break;
  483. //case ValveType.PVHe2:
  484. // _PVHe2Valve.TurnValve(on, out _);
  485. // break;
  486. case ValveType.GasFinal:
  487. _GasFinalValve.TurnValve(on, out _);
  488. break;
  489. case ValveType.SoftPump:
  490. _SoftPumpValve.TurnValve(on, out _);
  491. break;
  492. case ValveType.FastPump:
  493. _FastPumpValve.TurnValve(on, out _);
  494. break;
  495. case ValveType.TurboPumpPumping:
  496. _TurboPumpPumpingValve.TurnValve(on, out _);
  497. break;
  498. case ValveType.TurboPumpPurge:
  499. _TurboPumpPurgeValve.TurnValve(on, out _);
  500. break;
  501. case ValveType.Guage:
  502. _GuageValve.TurnValve(on, out _);
  503. break;
  504. case ValveType.LoadlockVent:
  505. _LoadlockVentValve.TurnValve(on, out _);
  506. break;
  507. case ValveType.LoadlockPumping:
  508. _LoadlockPumpingValve.TurnValve(on, out _);
  509. break;
  510. case ValveType.Mfc1:
  511. _Mfc1Valve.TurnValve(on, out _);
  512. break;
  513. case ValveType.Mfc2:
  514. _Mfc2Valve.TurnValve(on, out _);
  515. break;
  516. case ValveType.Mfc3:
  517. _Mfc3Valve.TurnValve(on, out _);
  518. break;
  519. case ValveType.Mfc4:
  520. _Mfc4Valve.TurnValve(on, out _);
  521. break;
  522. case ValveType.Mfc5:
  523. _Mfc5Valve.TurnValve(on, out _);
  524. break;
  525. case ValveType.Mfc6:
  526. _Mfc6Valve.TurnValve(on, out _);
  527. break;
  528. case ValveType.Mfc7:
  529. _Mfc7Valve.TurnValve(on, out _);
  530. break;
  531. case ValveType.Mfc8:
  532. _Mfc8Valve.TurnValve(on, out _);
  533. break;
  534. //default:
  535. // throw new ArgumentOutOfRangeException($"Argument error {vlvType}-{on}");
  536. }
  537. }
  538. public override void Monitor()
  539. {
  540. foreach (var gas in _gasLines)
  541. {
  542. gas.Monitor();
  543. }
  544. CheckPermanentInterlock();
  545. }
  546. protected override void CheckPermanentInterlock()
  547. {
  548. if (ProcessPressure > 2000 && _GuageValve.SetPoint)
  549. {
  550. _GuageValve.TurnValve(false, out _);
  551. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"Process pressure:{ProcessPressure} exceed 2000 mtorr, Guage Valve (DO-31) closed automaticlly.");
  552. }
  553. }
  554. public override void CheckIdleInterlock()
  555. {
  556. if (ForelinePressure > _foreline_interlock_pressure)
  557. {
  558. if (_TurboPumpPumpingValve.SetPoint || _TurboPumpPurgeValve.SetPoint || _pendulumValve.IsOpen)
  559. {
  560. _pendulumValve.TurnValve(false);
  561. _TurboPumpPurgeValve.TurnValve(false, out _);
  562. _TurboPumpPumpingValve.TurnValve(false, out _);
  563. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"Foreline pressure:{ForelinePressure} exceed {_foreline_interlock_pressure} mtorr, Pendulum valve & PV6 & PV7 closed automaticlly.");
  564. }
  565. }
  566. }
  567. //public override void BuzzerBlinking(double time)
  568. //{
  569. // _SignalTower.BuzzerBlinking(time);
  570. //}
  571. //public override void SwitchOnBuzzerAndRed()
  572. //{
  573. // _SignalTower.SwitchOnBuzzerAndRed("", null);
  574. //}
  575. public override void Home()
  576. {
  577. // 与yp讨论过,PM 初始化不需要
  578. //SetLiftPin(MovementPosition.Down, out _);
  579. //if (_slitDoor.State == CylinderState.Open)
  580. //{
  581. // SetSlitDoor(true, out _);
  582. //}
  583. //else
  584. //{
  585. // SetSlitDoor(false, out _);
  586. //}
  587. //SetSlitDoor(false, out _);
  588. //2023/03/08添加
  589. OpenValve(ValveType.PVN22, true);
  590. }
  591. public override bool SetSlitDoor(bool open, out string reason)
  592. {
  593. if (open)
  594. {
  595. if (RouteManager.IsATMMode)
  596. {
  597. if (!IsATM)
  598. {
  599. reason = $"{Module} is not ATM, can not open slit door";
  600. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  601. return false;
  602. }
  603. if (!IsTMATM)
  604. {
  605. reason = $"LoadLock is not ATM, can not open slit door";
  606. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  607. return false;
  608. }
  609. }
  610. else
  611. {
  612. double maxPressureDifference = SC.GetValue<double>("System.PMTMMaxPressureDifference");
  613. if (Math.Abs(TMPressure - ChamberPressure) > maxPressureDifference)
  614. {
  615. reason = $"{Module} and TM pressure difference exceeds the max limit {maxPressureDifference}, TMPressure:{TMPressure}, {Module}Pressure:{ChamberPressure}";
  616. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  617. return false;
  618. }
  619. }
  620. }
  621. return _slitDoor.SetCylinder(open, out reason);
  622. }
  623. //public override bool RetractWafer()
  624. //{
  625. // return _LoadLockArm.SetCylinder(false, out _);
  626. //}
  627. //public override bool ExtendWafer()
  628. //{
  629. // return _LoadLockArm.SetCylinder(true, out _);
  630. //}
  631. public override bool FlowGas(int gasNum, double val)
  632. {
  633. if (_gasLines.Length <= gasNum)
  634. return false;
  635. //double value = (val / _gasLines[gasNum]._mfc.Scale) * 100;
  636. //double setPoint =Math.Round( value / 8000 * _gasLines[gasNum]._mfc.Scale,2);
  637. _gasLines[gasNum].Flow(val);
  638. return true;
  639. }
  640. public override bool StopGas(int gasNum)
  641. {
  642. if (_gasLines.Length <= gasNum)
  643. return false;
  644. _gasLines[gasNum].Stop();
  645. return true;
  646. }
  647. public override bool FlowN2(double val)
  648. {
  649. _gasLineN2.Flow(val);
  650. return true;
  651. }
  652. public override bool StopN2()
  653. {
  654. _gasLineN2.Stop();
  655. return true;
  656. }
  657. public override void StopAllGases()
  658. {
  659. foreach (var line in _gasLines)
  660. {
  661. line.Stop();
  662. }
  663. }
  664. public override bool TurnPendulumValve(bool on)
  665. {
  666. return _pendulumValve.TurnValve(on);
  667. }
  668. public override bool SetPVPressure(int pressure)
  669. {
  670. return _pendulumValve.SetPressure(pressure);
  671. }
  672. public override bool SetPVPostion(int position)
  673. {
  674. return _pendulumValve.SetPosition(position);
  675. }
  676. public override int GetPVPosition()
  677. {
  678. return _pendulumValve.Position;
  679. }
  680. //public override async void HeatChiller(ChillerType chillerType, double value, double offset)
  681. //{
  682. // _Chiller?.SetChillerTemp((float)value, (float)offset);
  683. // await Task.Delay(1000);
  684. // _Chiller?.SetChillerOnOff(true);
  685. //}
  686. //public override void OnOffChiller(ChillerType chillerType, bool onoff)
  687. //{
  688. // _Chiller?.SetChillerOnOff(onoff);
  689. //}
  690. //public override bool CheckChillerStatus()
  691. //{
  692. // return _Chiller != null /*&& _Chiller.IsRunning*/ && !_Chiller.IsError;
  693. //}
  694. public override void SetGeneratorCommunicationMode(int mode)
  695. {
  696. _Generator?.SetCommunicationMode(mode);
  697. }
  698. public override bool GeneratorPowerOn(bool on)
  699. {
  700. if (_Generator == null) return false;
  701. if (on && !IsRFGInterlockOn)
  702. {
  703. LOG.Write(eEvent.ERR_RF, Module, "射频电源 Interlock条件不满足");
  704. return false;
  705. }
  706. return _Generator.SetPowerOnOff(on, out _);
  707. }
  708. public override bool GeneratorSetpower(float val)
  709. {
  710. if (_Generator == null) return false;
  711. if (Math.Abs(val) > 0.01)
  712. _Generator.SetPower((ushort)val);
  713. return true;
  714. }
  715. //public override bool GeneratorBiasPowerOn(bool on)
  716. //{
  717. // if (_GeneratorBias == null) return false;
  718. // if (on && !IsRFGInterlockOn)
  719. // {
  720. // LOG.Write(eEvent.ERR_RF, Module, "Bias射频电源 Interlock条件不满足");
  721. // return false;
  722. // }
  723. // return _GeneratorBias.SetPowerOnOff(on, out _);
  724. //}
  725. //public override bool GeneratorBiasSetpower(float val)
  726. //{
  727. // if (_GeneratorBias == null) return false;
  728. // if (Math.Abs(val) > 0.01)
  729. // _GeneratorBias.SetPower((ushort)val);
  730. // return true;
  731. //}
  732. //public override bool OnOffSetESCHV(bool val)
  733. //{
  734. // return _ESCHV.SetPowerOnOff(val);
  735. //}
  736. public override bool SetWallTCTemperature(float value)
  737. {
  738. return _WallTC.RampTemp(value);
  739. }
  740. //public override bool GeneratorBiasSetMatchMode(bool val)
  741. //{
  742. // if (_GeneratorBias == null) return false;
  743. // string reason = string.Empty;
  744. // _GeneratorBias.SetMatchingAutoMode(val, out reason);
  745. // return true;
  746. //}
  747. public override bool SetMatchPosition(float c1, float c2)
  748. {
  749. if (_Match == null) return false;
  750. string reason = string.Empty;
  751. _Match.SetMatchPosition(c1, c2, out reason);
  752. return true;
  753. }
  754. public override bool SetMatchWorkMode(MatchWorkMode matchWorkMode)
  755. {
  756. if (_Match == null) return false;
  757. if (matchWorkMode == MatchWorkMode.Auto)
  758. {
  759. return _Match.SetMatchMode(EnumRfMatchTuneMode.Auto, out _);
  760. }
  761. else if (matchWorkMode == MatchWorkMode.Manual)
  762. {
  763. return _Match.SetMatchMode(EnumRfMatchTuneMode.Manual, out _);
  764. }
  765. return false;
  766. }
  767. //public override bool SetBiasMatchPosition(float c1, float c2)
  768. //{
  769. // if (_BiasMatch == null) return false;
  770. // string reason = string.Empty;
  771. // _BiasMatch.SetMatchPosition(c1, c2, out reason);
  772. // return true;
  773. //}
  774. //public override bool SetBiasMatchWorkMode(MatchWorkMode matchWorkMode)
  775. //{
  776. // if (_BiasMatch == null) return false;
  777. // if (matchWorkMode == MatchWorkMode.Auto)
  778. // {
  779. // return _BiasMatch.SetMatchMode(EnumRfMatchTuneMode.Auto, out _);
  780. // }
  781. // else if (matchWorkMode == MatchWorkMode.Manual)
  782. // {
  783. // return _BiasMatch.SetMatchMode(EnumRfMatchTuneMode.Manual, out _);
  784. // }
  785. // return false;
  786. //}
  787. //public override bool SetBiasPulseMode(bool on)
  788. //{
  789. // if (_GeneratorBias == null) return false;
  790. // _GeneratorBias.SetPulseMode(on);
  791. // return true;
  792. //}
  793. //public override bool SetBiasPulseRateFreq(int nFreq)
  794. //{
  795. // if (_GeneratorBias == null) return false;
  796. // _GeneratorBias.SetPulseRateFreq(nFreq);
  797. // return true;
  798. //}
  799. //public override bool SetDiasPulseDutyCycle(int percentage)
  800. //{
  801. // if (_GeneratorBias == null) return false;
  802. // _GeneratorBias.SetPulseDutyCycle(percentage);
  803. // return true;
  804. //}
  805. //public override bool SetESCClampVoltage(int nVoltage)
  806. //{
  807. // if (_ESCHV == null) return false;
  808. // return _ESCHV.SetOutputVoltage(nVoltage);
  809. //}
  810. public override bool CheckGeneratorAndHVInterlock(VenusDevice device)
  811. {
  812. eEvent evt = device == VenusDevice.Rf ? eEvent.ERR_RF : eEvent.ERR_ESC_HV;
  813. if (!PMLidClosed)
  814. {
  815. LOG.Write(evt, Module, $"Cannot Power ON {device} as PM Lid is Open.");
  816. return false;
  817. }
  818. if (!IsVAC)
  819. {
  820. LOG.Write(evt, Module, $"Cannot Power ON {device} as PM is not Vacuum.");
  821. return false;
  822. }
  823. if (!IsWaterFlowOk)
  824. {
  825. LOG.Write(evt, Module, $"Cannot Power ON {device} as Water Flow is OFF.");
  826. return false;
  827. }
  828. if (!IsRFGInterlockOn)
  829. {
  830. LOG.Write(evt, Module, $"Cannot Power ON {device} as Generator Interlock is OFF.");
  831. return false;
  832. }
  833. if (!SlitDoorClosed)
  834. {
  835. LOG.Write(evt, Module, $"Cannot Power ON {device} as Slit Door is open.");
  836. return false;
  837. }
  838. //if ((device == VenusDevice.ESCHV || device == VenusDevice.BiasRf) && WaferManager.Instance.CheckNoWafer(Module, 0))
  839. //{
  840. // LOG.Write(evt, Module, $"Cannot Power ON {device} as {Module} has no wafer");
  841. // return false;
  842. //}
  843. return true;
  844. }
  845. public override bool SetBacksideHeThreshold(int nMin, int nMax)
  846. {
  847. if (_backsideHe == null) return false;
  848. return _backsideHe.SetFlowThreshold(nMin, nMax);
  849. }
  850. public override bool StartControlPressure(int pressureSetpoint, int flowSetpoint)
  851. {
  852. OpenValve(ValveType.Purge, true);
  853. OpenValve(ValveType.N2, true);
  854. OpenValve(ValveType.PVN22, true);
  855. OpenValve(ValveType.GasFinal, false);
  856. OpenValve(ValveType.TurboPumpPumping, true);
  857. TurnPendulumValve(true);
  858. SetPVPressure(pressureSetpoint);
  859. return true;
  860. }
  861. public async override Task<bool> AbortControlPressure()
  862. {
  863. OpenValve(ValveType.N2, false);
  864. OpenValve(ValveType.PVN22, false);
  865. await Task.Delay(1000);
  866. OpenValve(ValveType.Purge, false);
  867. return true;
  868. }
  869. public override bool HighTemperatureHeaterGotoPosition(HighTemperatureHeaterPosition highTemperatureHeaterPosition)
  870. {
  871. return _highTemperatureHeater.GotoPosition(highTemperatureHeaterPosition);
  872. }
  873. public override bool PreparePlace()
  874. {
  875. if (!SetSlitDoor(true, out string reason))
  876. {
  877. LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Open failed:{reason}");
  878. return false;
  879. }
  880. return _highTemperatureHeater.GotoPosition(HighTemperatureHeaterPosition.Position1);
  881. }
  882. public override bool PreparePick()
  883. {
  884. if (!SetSlitDoor(true, out string reason))
  885. {
  886. LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Open failed:{reason}");
  887. return false;
  888. }
  889. return _highTemperatureHeater.GotoPosition(HighTemperatureHeaterPosition.Position1);
  890. }
  891. public override bool PreparePlaceIsOK()
  892. {
  893. return CheckSlitDoorOpen() && _highTemperatureHeater.CurrentPosition == HighTemperatureHeaterPosition.Position1;
  894. }
  895. public override bool PreparePickIsOK()
  896. {
  897. return CheckSlitDoorOpen() && _highTemperatureHeater.CurrentPosition == HighTemperatureHeaterPosition.Position1;
  898. }
  899. public override bool EndPlace()
  900. {
  901. if (!SetSlitDoor(false, out string reason))
  902. {
  903. LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Close failed:{reason}");
  904. return false;
  905. }
  906. if (!_highTemperatureHeater.GotoPosition(HighTemperatureHeaterPosition.Position2))
  907. {
  908. LOG.Write(eEvent.ERR_PM, Module, $"Set High Temperature Heater To Posotion2 failed");
  909. return false;
  910. }
  911. return true;
  912. }
  913. public override bool EndPick()
  914. {
  915. if (!SetSlitDoor(false, out string reason))
  916. {
  917. LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Close failed:{reason}");
  918. return false;
  919. }
  920. return true;
  921. }
  922. public override bool EndPlaceIsOK()
  923. {
  924. return CheckSlitDoorClose() && _highTemperatureHeater.CurrentPosition == HighTemperatureHeaterPosition.Position2;
  925. }
  926. public override bool EndPickIsOK()
  927. {
  928. return CheckSlitDoorClose();
  929. }
  930. public override void RTCloseEvent()
  931. {
  932. if (_Generator.IsPowerOn)
  933. {
  934. GeneratorPowerOn(false);
  935. }
  936. if (PendulumValveIsOpen())
  937. {
  938. TurnPendulumValve(false);
  939. }
  940. }
  941. public override bool RFInterlock(VenusDevice device)
  942. {
  943. eEvent evt = eEvent.ERR_RF;
  944. if (!IsWaterFlowOk)
  945. {
  946. LOG.Write(evt, Module, $"Cannot Power ON {device} as Water Flow is OFF.");
  947. return false;
  948. }
  949. if (!IsRFGInterlockOn)
  950. {
  951. LOG.Write(evt, Module, $"Cannot Power ON {device} as Generator Interlock is OFF.");
  952. return false;
  953. }
  954. if (GasIsOff())
  955. {
  956. LOG.Write(evt, Module, $"Cannot Power ON {device} as Gas is OFF.");
  957. return false;
  958. }
  959. return true;
  960. }
  961. private bool GasIsOff()
  962. {
  963. if (IsMfc1ValveOpened == false && IsMfc2ValveOpened == false && IsMfc3ValveOpened == false && IsMfc4ValveOpened == false && IsMfc5ValveOpened == false && IsMfc6ValveOpened == false && _GasFlag == false)
  964. {
  965. if (_GasRFStopWatch.IsRunning == false)
  966. {
  967. _GasRFStopWatch.Start();
  968. }
  969. if (_GasRFStopWatch.ElapsedMilliseconds > 1000)
  970. {
  971. _GasRFStopWatch.Reset();
  972. _GasFlag = true;
  973. return true;
  974. }
  975. }
  976. else
  977. {
  978. _GasRFStopWatch.Reset();
  979. _GasFlag = false;
  980. }
  981. return false;
  982. }
  983. }
  984. }