JetVenusSEPM.cs 47 KB

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