JetVenusPM.cs 45 KB

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