JetVenusDEPM.cs 52 KB

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