JetVenusDEPM.cs 48 KB

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