JetVenusDEPM.cs 50 KB

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