JetPM.cs 44 KB

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