JetVenusDEPM.cs 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287
  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.AdTec)
  265. {
  266. _BiasMatch = DEVICE.GetDevice<AdTecMatch>($"{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 => _pressureController.ProcessGauge.Value;
  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 => 1.0;
  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 BuzzerBlinking(double time)
  530. {
  531. LOG.Write(eEvent.ERR_PM, Module, "VenusSE PM is not exist SignalTower!");
  532. }
  533. #endregion
  534. #region 公共方法
  535. public override bool CheckAtm()
  536. {
  537. //检查是否是ATM模式
  538. return _ATM_sw.Value && ChamberPressure > 700000;
  539. }
  540. public override void RTCloseEvent()
  541. {
  542. if (_GeneratorBias.IsPowerOn)
  543. {
  544. GeneratorBiasPowerOn(false);
  545. }
  546. if (PendulumValveIsOpen())
  547. {
  548. TurnPendulumValve(false);
  549. }
  550. }
  551. public override bool CheckChillerStatus()
  552. {
  553. return _Chiller != null /*&& _Chiller.IsRunning*/ && !_Chiller.IsError;
  554. }
  555. public override bool CheckGeneratorAndHVInterlock(VenusDevice device)
  556. {
  557. eEvent evt = device == VenusDevice.Rf ? eEvent.ERR_RF : eEvent.ERR_ESC_HV;
  558. if (!PMLidClosed)
  559. {
  560. LOG.Write(evt, Module, $"Cannot Power ON {device} as PM Lid is Open.");
  561. return false;
  562. }
  563. if (!IsVAC)
  564. {
  565. LOG.Write(evt, Module, $"Cannot Power ON {device} as PM is not Vacuum.");
  566. return false;
  567. }
  568. //if (!IsWaterFlowOk)
  569. //{
  570. // LOG.Write(evt, Module, $"Cannot Power ON {device} as Water Flow is OFF.");
  571. // return false;
  572. //}
  573. if (!IsRFGInterlockOn)
  574. {
  575. LOG.Write(evt, Module, $"Cannot Power ON {device} as Generator Interlock is OFF.");
  576. return false;
  577. }
  578. //if (!SourceRFFanInterlock)
  579. //{
  580. // LOG.Write(evt, Module, $"Cannot Power ON {device} as Source RF Fan is OFF.");
  581. // return false;
  582. //}
  583. if (!SlitDoorClosed)
  584. {
  585. LOG.Write(evt, Module, $"Cannot Power ON {device} as Slit Door is open.");
  586. return false;
  587. }
  588. if (!LinerDoorClosed)
  589. {
  590. LOG.Write(evt, Module, $"Cannot Power ON {device} as Liner Door is open.");
  591. return false;
  592. }
  593. if ((device == VenusDevice.ESCHV || device == VenusDevice.BiasRf) && WaferManager.Instance.CheckNoWafer(Module, 0))
  594. {
  595. LOG.Write(evt, Module, $"Cannot Power ON {device} as {Module} has no wafer");
  596. return false;
  597. }
  598. return true;
  599. }
  600. public override bool SetBiasMatchWorkMode(MatchWorkMode matchWorkMode)
  601. {
  602. if (_BiasMatch == null) return false;
  603. if (matchWorkMode == MatchWorkMode.Auto)
  604. {
  605. return _BiasMatch.SetMatchMode(EnumRfMatchTuneMode.Auto, out _);
  606. }
  607. else if (matchWorkMode == MatchWorkMode.Manual)
  608. {
  609. return _BiasMatch.SetMatchMode(EnumRfMatchTuneMode.Manual, out _);
  610. }
  611. return false;
  612. }
  613. public override bool StartControlPressure(int pressureSetpoint, int flowSetpoint)
  614. {
  615. OpenValve(ValveType.TurboPumpPumping, true);
  616. if (_TurboPumpPumpingValve.Status)
  617. {
  618. OpenValve(ValveType.Purge, true);
  619. OpenValve(ValveType.GasFinal, false);
  620. OpenValve(ValveType.N2, true);
  621. OpenValve(ValveType.PVN22, true);
  622. //FlowGas(12, flowSetpoint);
  623. TurnPendulumValve(true);
  624. SetPVPressure(pressureSetpoint);
  625. return true;
  626. }
  627. else
  628. {
  629. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"cannot control pressure,cause Turbo Pump Pumping Valve is Close");
  630. return true;
  631. }
  632. }
  633. public async override Task<bool> AbortControlPressure()
  634. {
  635. OpenValve(ValveType.PVN22, false);
  636. OpenValve(ValveType.N2, false);
  637. await Task.Delay(2000);
  638. OpenValve(ValveType.GasFinal, false);
  639. OpenValve(ValveType.Purge, false);
  640. return true;
  641. }
  642. public override void CheckIdleInterlock()
  643. {
  644. if (ForelinePressure > _foreline_interlock_pressure)
  645. {
  646. if (_TurboPumpPumpingValve.SetPoint || _TurboPumpPurgeValve.SetPoint || _pendulumValve.IsOpen)
  647. {
  648. _pendulumValve.TurnValve(false);
  649. _TurboPumpPurgeValve.TurnValve(false, out _);
  650. _TurboPumpPumpingValve.TurnValve(false, out _);
  651. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"Foreline pressure:{ForelinePressure} exceed {_foreline_interlock_pressure} mtorr, Pendulum valve & PV6 & PV7 closed automaticlly.");
  652. }
  653. }
  654. }
  655. public override bool CheckLiftDown()
  656. {
  657. return _LiftPin.State == CylinderState.Close;
  658. }
  659. public override bool CheckLiftUp()
  660. {
  661. return _LiftPin.State == CylinderState.Open;
  662. }
  663. public override bool CheckLinerDoorOpen()
  664. {
  665. return _linerDoor.State == CylinderState.Open;
  666. }
  667. public override bool CheckLinerDoorClose()
  668. {
  669. return _linerDoor.State == CylinderState.Close;
  670. }
  671. public override bool CheckSlitDoorClose()
  672. => IsSlitDoorClosed && IsLinerDoorClosed;
  673. public override bool CheckSlitDoorOpen()
  674. => !IsSlitDoorClosed && !IsLinerDoorClosed;
  675. public override void CloseValves(int? delayTime = null)
  676. {
  677. _PVN21Valve.TurnValve(false, out _);
  678. //_PVN22Valve.TurnValve(false, out _);
  679. _PV11Valve.TurnValve(false, out _);
  680. _PV12Valve.TurnValve(false, out _);
  681. _PV21Valve.TurnValve(false, out _);
  682. _PV22Valve.TurnValve(false, out _);
  683. _PV31Valve.TurnValve(false, out _);
  684. _PV32Valve.TurnValve(false, out _);
  685. _PV41Valve.TurnValve(false, out _);
  686. _PV42Valve.TurnValve(false, out _);
  687. _PVHe1Valve.TurnValve(false, out _);
  688. _PVHe2Valve.TurnValve(false, out _);
  689. _GasFinalValve.TurnValve(false, out _);
  690. //_SoftPumpValve.TurnValve(false, out _);
  691. _FastPumpValve.TurnValve(false, out _);
  692. _TurboPumpPumpingValve.TurnValve(false, out _);
  693. _TurboPumpPurgeValve.TurnValve(false, out _);
  694. _GuageValve.TurnValve(false, out _);
  695. _PurgeValve.TurnValve(false, out _);
  696. _N2Valve.TurnValve(false, out _);
  697. _FastPumpValve.TurnValve(false, out _);
  698. _PVHe3Valve.TurnValve(false, out _);
  699. _HeISOValve.TurnValve(false, out _);
  700. _MainPurgeValve.TurnValve(false, out _);
  701. _SecondPurgeValve.TurnValve(false, out _);
  702. //新增
  703. _Mfc1Valve.TurnValve(false, out _);
  704. _Mfc2Valve.TurnValve(false, out _);
  705. _Mfc3Valve.TurnValve(false, out _);
  706. _Mfc4Valve.TurnValve(false, out _);
  707. _Mfc5Valve.TurnValve(false, out _);
  708. _Mfc6Valve.TurnValve(false, out _);
  709. _Mfc7Valve.TurnValve(false, out _);
  710. _Mfc8Valve.TurnValve(false, out _);
  711. _Mfc9Valve.TurnValve(false, out _);
  712. _Mfc10Valve.TurnValve(false, out _);
  713. _Mfc11Valve.TurnValve(false, out _);
  714. _Mfc12Valve.TurnValve(false, out _);
  715. _PV51Valve.TurnValve(false, out _);
  716. _PV52Valve.TurnValve(false, out _);
  717. _PV61Valve.TurnValve(false, out _);
  718. _PV62Valve.TurnValve(false, out _);
  719. _PV71Valve.TurnValve(false, out _);
  720. _PV72Valve.TurnValve(false, out _);
  721. _PV81Valve.TurnValve(false, out _);
  722. _PV82Valve.TurnValve(false, out _);
  723. _PV91Valve.TurnValve(false, out _);
  724. _PV92Valve.TurnValve(false, out _);
  725. _PVA1Valve.TurnValve(false, out _);
  726. _PVA2Valve.TurnValve(false, out _);
  727. _PVB1Valve.TurnValve(false, out _);
  728. _PVB2Valve.TurnValve(false, out _);
  729. _PVC1Valve.TurnValve(false, out _);
  730. _PVC2Valve.TurnValve(false, out _);
  731. foreach (var stick in _gasLines)
  732. {
  733. stick.Stop();
  734. }
  735. }
  736. public override bool ExtendWafer()
  737. {
  738. throw new NotImplementedException();
  739. }
  740. public override bool FlowGas(int gasNum, double val)
  741. {
  742. if (_gasLines.Length <= gasNum)
  743. return false;
  744. _gasLines[gasNum].Flow(val);
  745. return true;
  746. }
  747. public override bool FlowN2(double val)
  748. {
  749. _gasLineN2.Flow(val);
  750. return true;
  751. }
  752. public override bool GeneratorBiasPowerOn(bool on)
  753. {
  754. if (_GeneratorBias == null) return false;
  755. if (on && !IsRFGInterlockOn)
  756. {
  757. LOG.Write(eEvent.ERR_RF, Module, "Bias射频电源 Interlock条件不满足");
  758. return false;
  759. }
  760. return _GeneratorBias.SetPowerOnOff(on, out _);
  761. }
  762. //public override bool MagnetPowerOn(bool on)
  763. //{
  764. // if (_Magnet == null) return false;
  765. // return _Magnet.SetMagnetOnOff(on, out _);
  766. //}
  767. public override bool GeneratorBiasSetMatchMode(bool val)
  768. {
  769. if (_GeneratorBias == null) return false;
  770. string reason = string.Empty;
  771. _GeneratorBias.SetMatchingAutoMode(val, out reason);
  772. return true;
  773. }
  774. public override bool GeneratorBiasSetpower(float val)
  775. {
  776. if (_GeneratorBias == null) return false;
  777. if (Math.Abs(val) > 0.01)
  778. _GeneratorBias.SetPower((ushort)val);
  779. return true;
  780. }
  781. public override bool GeneratorPowerOn(bool on)
  782. {
  783. if (_Generator == null) return false;
  784. if (on && !IsRFGInterlockOn)
  785. {
  786. LOG.Write(eEvent.ERR_RF, Module, "射频电源 Interlock条件不满足");
  787. return false;
  788. }
  789. return _Generator.SetPowerOnOff(on, out _);
  790. }
  791. public override bool GeneratorSetpower(float val)
  792. {
  793. if (_Generator == null) return false;
  794. if (Math.Abs(val) > 0.01)
  795. _Generator.SetPower((ushort)val);
  796. return true;
  797. }
  798. public override bool MagnetSetpower(float val)
  799. {
  800. if (_Magnet == null) return false;
  801. if (Math.Abs(val) >= 0)
  802. _Magnet.SetMagnetPower(val);
  803. return true;
  804. }
  805. public override float GetPVPosition()
  806. {
  807. return _pendulumValve.Position;
  808. }
  809. public override async void HeatChiller(ChillerType chillerType, double value, double offset)
  810. {
  811. _Chiller?.SetChillerTemp((float)value, (float)offset);
  812. await Task.Delay(1000);
  813. _Chiller?.SetChillerOnOff(true);
  814. }
  815. public override void Home()
  816. {
  817. SetLiftPin(MovementPosition.Down, out _);
  818. //转交TM
  819. if (!IsSlitDoorClosed)
  820. {
  821. SetSlitDoor(true, out _);
  822. }
  823. else
  824. {
  825. SetSlitDoor(false, out _);
  826. }
  827. if (_linerDoor.State == CylinderState.Open)
  828. {
  829. SetLinerDoor(true, out _);
  830. }
  831. else
  832. {
  833. SetLinerDoor(false, out _);
  834. }
  835. SetLinerDoor(false, out _);
  836. //SetSlitDoor(false, out _);
  837. OpenValve(ValveType.PVN22, false);
  838. }
  839. public override void OnOffChiller(ChillerType chillerType, bool onoff)
  840. => _Chiller?.SetChillerOnOff(onoff);
  841. public override bool OnOffSetESCHV(bool on)
  842. => _ESCHV.SetPowerOnOff(on);
  843. public override void OpenValve(ValveType vlvType, bool on)
  844. {
  845. if (vlvType != ValveType.SoftPump)
  846. {
  847. if (Valve2IO.ContainsKey(vlvType))
  848. {
  849. Valve2IO[vlvType].TurnValve(on, out _);
  850. LOG.Write(eEvent.EV_DEVICE_INFO, Module, $"{(on ? "打开" : "关闭")} 阀 {vlvType.ToString()}");
  851. }
  852. else
  853. {
  854. throw new ArgumentOutOfRangeException($"Argument error {vlvType}-{on}");
  855. }
  856. }
  857. }
  858. public override bool PendulumValveIsOpen()
  859. {
  860. return _pendulumValve.IsOpen;
  861. }
  862. public override bool RetractWafer()
  863. {
  864. throw new NotImplementedException();
  865. }
  866. public override void SetBacksideHeFlow(double flow)
  867. {
  868. if (_backsideHe == null) return;
  869. _backsideHe.Flow(flow);
  870. }
  871. public override bool SetBacksideHePressure(float mTorr)
  872. {
  873. if (_backsideHe == null) return false;
  874. return _backsideHe.SetBacksideHelium(mTorr);
  875. }
  876. public override bool SetBacksideHeThreshold(float nMin, float nMax)
  877. {
  878. if (_backsideHe == null) return false;
  879. return _backsideHe.SetFlowThreshold(nMin, nMax);
  880. }
  881. public override bool SetBiasMatchPosition(float c1, float c2)
  882. {
  883. if (_BiasMatch == null) return false;
  884. string reason = string.Empty;
  885. _BiasMatch.SetMatchPosition(c1, c2, out reason);
  886. return true;
  887. }
  888. public override bool SetBiasPulseMode(bool on)
  889. {
  890. if (_GeneratorBias == null) return false;
  891. _GeneratorBias.SetPulseMode(on);
  892. return true;
  893. }
  894. public override bool SetBiasPulseRateFreq(int nFreq)
  895. {
  896. if (_GeneratorBias == null) return false;
  897. _GeneratorBias.SetPulseRateFreq(nFreq);
  898. return true;
  899. }
  900. public override bool SetDiasPulseDutyCycle(int percentage)
  901. {
  902. if (_GeneratorBias == null) return false;
  903. _GeneratorBias.SetPulseDutyCycle(percentage);
  904. return true;
  905. }
  906. public override bool SetESCClampVoltage(int nVoltage)
  907. {
  908. if (_ESCHV == null) return false;
  909. return _ESCHV.SetOutputVoltage(nVoltage);
  910. }
  911. public override void SetGeneratorCommunicationMode(int mode)
  912. => _Generator?.SetCommunicationMode(mode);
  913. public override bool SetLiftPin(MovementPosition dirt, out string reason)
  914. {
  915. reason = string.Empty;
  916. switch (dirt)
  917. {
  918. case MovementPosition.Down:
  919. return _LiftPin.SetCylinder(false, out reason);
  920. case MovementPosition.Up:
  921. return _LiftPin.SetCylinder(true, out reason);
  922. case MovementPosition.Left:
  923. case MovementPosition.Right:
  924. case MovementPosition.Middle:
  925. throw new ArgumentException("Movement argument error");
  926. }
  927. return true;
  928. }
  929. public override bool SetMatchPosition(float c1, float c2)
  930. {
  931. if (_Match == null) return false;
  932. string reason = string.Empty;
  933. _Match.SetMatchPosition(c1, c2, out reason);
  934. return true;
  935. }
  936. public override bool SetPVPostion(float position)
  937. => _pendulumValve.SetPosition(position);
  938. public override bool SetPVPressure(float pressure)
  939. => _pendulumValve.SetPressure(pressure);
  940. public override bool SetSlitDoor(bool open, out string reason)
  941. {
  942. reason = string.Empty;
  943. OP.DoOperation($"{ModuleName.SETM}.SetSlitDoor", Module, open);
  944. return true;
  945. }
  946. public override bool SetLinerDoor(bool open, out string reason)
  947. {
  948. if (open)
  949. {
  950. if (RouteManager.IsATMMode)
  951. {
  952. if (!IsATM)
  953. {
  954. reason = $"{Module} is not ATM, can not open slit door";
  955. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  956. return false;
  957. }
  958. }
  959. //else
  960. //{
  961. // double maxPressureDifference = SC.GetValue<double>("System.PMTMMaxPressureDifference");
  962. // if (Math.Abs(TMPressure - ChamberPressure) > maxPressureDifference)
  963. // {
  964. // reason = $"{Module} and TM pressure difference exceeds the max limit {maxPressureDifference}, TMPressure:{TMPressure}, {Module}Pressure:{ChamberPressure}";
  965. // LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  966. // return false;
  967. // }
  968. //}
  969. }
  970. return _linerDoor.SetCylinder(open, out reason);
  971. }
  972. public override bool SetWallTCTemperature(float value)
  973. => _WallTC.RampTemp(value);
  974. public override void StopAllGases()
  975. {
  976. foreach (var line in _gasLines)
  977. {
  978. line.Stop();
  979. }
  980. }
  981. public override bool StopGas(int gasNum)
  982. {
  983. if (_gasLines.Length <= gasNum)
  984. return false;
  985. _gasLines[gasNum].Stop();
  986. return true;
  987. }
  988. public override bool StopN2()
  989. {
  990. _gasLineN2.Stop();
  991. return true;
  992. }
  993. public override void SwitchOnBuzzerAndRed()
  994. {
  995. throw new NotImplementedException();
  996. }
  997. public override void TurnDryPump(bool on)
  998. => _MainPump?.SetPumpOnOff(on);
  999. public override bool TurnPendulumValve(bool on)
  1000. => _pendulumValve.TurnValve(on);
  1001. public override void TurnTurboPump(bool on)
  1002. {
  1003. _TurboPump?.SetPumpOnOff(on);
  1004. }
  1005. public override bool PreparePlace()
  1006. {
  1007. if (!SetSlitDoor(true, out string reason))
  1008. {
  1009. LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Open failed:{reason}");
  1010. return false;
  1011. }
  1012. //
  1013. if (!SetLinerDoor(true, out reason))
  1014. {
  1015. LOG.Write(eEvent.ERR_PM, Module, $"Set Liner Door Open failed:{reason}");
  1016. return false;
  1017. }
  1018. if (!SetLiftPin(MovementPosition.Down, out reason))
  1019. {
  1020. LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin down failed:{reason}");
  1021. return false;
  1022. }
  1023. return true;
  1024. }
  1025. public override bool PreparePick()
  1026. {
  1027. if (!SetSlitDoor(true, out string reason))
  1028. {
  1029. LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Open failed:{reason}");
  1030. return false;
  1031. }
  1032. if (!SetLinerDoor(true, out reason))
  1033. {
  1034. LOG.Write(eEvent.ERR_PM, Module, $"Set Liner Door Open failed:{reason}");
  1035. return false;
  1036. }
  1037. if (!SetLiftPin(MovementPosition.Up, out reason))
  1038. {
  1039. LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin Up failed:{reason}");
  1040. return false;
  1041. }
  1042. return true;
  1043. }
  1044. public override bool PreparePlaceIsOK()
  1045. {
  1046. return CheckSlitDoorOpen() && LiftPinIsDown && CheckLinerDoorOpen();
  1047. }
  1048. public override bool PreparePickIsOK()
  1049. {
  1050. return CheckSlitDoorOpen() && LiftPinIsUp && CheckLinerDoorOpen();
  1051. }
  1052. public override bool EndPlace()
  1053. {
  1054. if (!SetLiftPin(MovementPosition.Down, out string reason))
  1055. {
  1056. LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin Down failed:{reason}");
  1057. return false;
  1058. }
  1059. if (!SetSlitDoor(false, out reason))
  1060. {
  1061. LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Close failed:{reason}");
  1062. return false;
  1063. }
  1064. if (!SetLinerDoor(false, out reason))
  1065. {
  1066. LOG.Write(eEvent.ERR_PM, Module, $"Set Liner Door Close failed:{reason}");
  1067. return false;
  1068. }
  1069. return true;
  1070. }
  1071. public override bool EndPick()
  1072. {
  1073. if (!SetSlitDoor(false, out string reason))
  1074. {
  1075. LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Close failed:{reason}");
  1076. return false;
  1077. }
  1078. return true;
  1079. }
  1080. public override bool EndPlaceIsOK()
  1081. {
  1082. return CheckSlitDoorClose() && LiftPinIsDown;
  1083. }
  1084. public override bool EndPickIsOK()
  1085. {
  1086. return CheckSlitDoorClose();
  1087. }
  1088. #endregion
  1089. protected override void CheckPermanentInterlock()
  1090. {
  1091. if (ProcessPressure > 100 && _GuageValve.SetPoint)
  1092. {
  1093. _GuageValve.TurnValve(false, out _);
  1094. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"Process pressure:{ProcessPressure} exceed 100 mtorr, Guage Valve (DO-31) closed automaticlly.");
  1095. }
  1096. }
  1097. public override void PMInError()
  1098. {
  1099. CloseValves();
  1100. GeneratorPowerOn(false);
  1101. GeneratorBiasPowerOn(false);
  1102. OpenValve(ValveType.TurboPumpPumping, true);
  1103. OpenValve(ValveType.TurboPumpPurge, true);
  1104. OnOffSetESCHV(false);
  1105. }
  1106. }
  1107. }