JetVenusDEPM.cs 50 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301
  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. _GeneratorBias.SetPower((ushort)val);
  782. return true;
  783. }
  784. public override bool GeneratorPowerOn(bool on)
  785. {
  786. if (_Generator == null) return false;
  787. if (on && !IsRFGInterlockOn)
  788. {
  789. LOG.Write(eEvent.ERR_RF, Module, "射频电源 Interlock条件不满足");
  790. return false;
  791. }
  792. return _Generator.SetPowerOnOff(on, out _);
  793. }
  794. public override bool GeneratorSetpower(float val)
  795. {
  796. if (_Generator == null) return false;
  797. if (Math.Abs(val) > 0.01)
  798. _Generator.SetPower((ushort)val);
  799. return true;
  800. }
  801. public override bool MagnetSetpower(float val)
  802. {
  803. if (_Magnet == null) return false;
  804. if (Math.Abs(val) >= 0)
  805. _Magnet.SetMagnetPower(val);
  806. return true;
  807. }
  808. public override float GetPVPosition()
  809. {
  810. return _pendulumValve.Position;
  811. }
  812. public override async void HeatChiller(ChillerType chillerType, double value, double offset)
  813. {
  814. _Chiller?.SetChillerTemp((float)value, (float)offset);
  815. await Task.Delay(1000);
  816. _Chiller?.SetChillerOnOff(true);
  817. }
  818. public override void Home()
  819. {
  820. SetLiftPin(MovementPosition.Down, out _);
  821. //转交TM
  822. if (!IsSlitDoorClosed)
  823. {
  824. SetSlitDoor(true, out _);
  825. }
  826. else
  827. {
  828. SetSlitDoor(false, out _);
  829. }
  830. if (_linerDoor.State == CylinderState.Open)
  831. {
  832. SetLinerDoor(true, out _);
  833. }
  834. else
  835. {
  836. SetLinerDoor(false, out _);
  837. }
  838. SetLinerDoor(false, out _);
  839. //SetSlitDoor(false, out _);
  840. OpenValve(ValveType.PVN22, false);
  841. _MainPump?.ReConnect();
  842. _TurboPump?.ReConnect();
  843. _pendulumValve?.ReConnect();
  844. _GeneratorBias.Reset();
  845. _GeneratorBias.ReConnect();
  846. }
  847. public override void OnOffChiller(ChillerType chillerType, bool onoff)
  848. => _Chiller?.SetChillerOnOff(onoff);
  849. public override bool OnOffSetESCHV(bool on)
  850. => _ESCHV.SetPowerOnOff(on);
  851. public override void OpenValve(ValveType vlvType, bool on)
  852. {
  853. if (vlvType != ValveType.SoftPump)
  854. {
  855. if (Valve2IO.ContainsKey(vlvType))
  856. {
  857. Valve2IO[vlvType].TurnValve(on, out _);
  858. LOG.Write(eEvent.EV_DEVICE_INFO, Module, $"{(on ? "打开" : "关闭")} 阀 {vlvType.ToString()}");
  859. }
  860. else
  861. {
  862. throw new ArgumentOutOfRangeException($"Argument error {vlvType}-{on}");
  863. }
  864. }
  865. }
  866. public override bool PendulumValveIsOpen()
  867. {
  868. return _pendulumValve.IsOpen;
  869. }
  870. public override bool RetractWafer()
  871. {
  872. throw new NotImplementedException();
  873. }
  874. public override void SetBacksideHeFlow(double flow)
  875. {
  876. if (_backsideHe == null) return;
  877. _backsideHe.Flow(flow);
  878. }
  879. public override bool SetBacksideHePressure(float mTorr)
  880. {
  881. if (_backsideHe == null) return false;
  882. return _backsideHe.SetBacksideHelium(mTorr);
  883. }
  884. public override bool SetBacksideHeThreshold(float nMin, float nMax)
  885. {
  886. if (_backsideHe == null) return false;
  887. return _backsideHe.SetFlowThreshold(nMin, nMax);
  888. }
  889. public override bool SetBiasMatchPosition(float c1, float c2)
  890. {
  891. if (_BiasMatch == null) return false;
  892. string reason = string.Empty;
  893. _BiasMatch.SetMatchPosition(c1, c2, out reason);
  894. return true;
  895. }
  896. public override bool SetBiasPulseMode(bool on)
  897. {
  898. if (_GeneratorBias == null) return false;
  899. _GeneratorBias.SetPulseMode(on);
  900. return true;
  901. }
  902. public override bool SetBiasPulseRateFreq(int nFreq)
  903. {
  904. if (_GeneratorBias == null) return false;
  905. _GeneratorBias.SetPulseRateFreq(nFreq);
  906. return true;
  907. }
  908. public override bool SetDiasPulseDutyCycle(int percentage)
  909. {
  910. if (_GeneratorBias == null) return false;
  911. _GeneratorBias.SetPulseDutyCycle(percentage);
  912. return true;
  913. }
  914. public override bool SetESCClampVoltage(int nVoltage)
  915. {
  916. if (_ESCHV == null) return false;
  917. return _ESCHV.SetOutputVoltage(nVoltage);
  918. }
  919. public override void SetGeneratorCommunicationMode(int mode)
  920. => _Generator?.SetCommunicationMode(mode);
  921. public override bool SetLiftPin(MovementPosition dirt, out string reason)
  922. {
  923. reason = string.Empty;
  924. switch (dirt)
  925. {
  926. case MovementPosition.Down:
  927. return _LiftPin.SetCylinder(false, out reason);
  928. case MovementPosition.Up:
  929. return _LiftPin.SetCylinder(true, out reason);
  930. case MovementPosition.Left:
  931. case MovementPosition.Right:
  932. case MovementPosition.Middle:
  933. throw new ArgumentException("Movement argument error");
  934. }
  935. return true;
  936. }
  937. public override bool SetMatchPosition(float c1, float c2)
  938. {
  939. if (_Match == null) return false;
  940. string reason = string.Empty;
  941. _Match.SetMatchPosition(c1, c2, out reason);
  942. return true;
  943. }
  944. public override bool SetPVPostion(float position)
  945. => _pendulumValve.SetPosition(position);
  946. public override bool SetPVPressure(float pressure)
  947. => _pendulumValve.SetPressure(pressure);
  948. public override bool SetSlitDoor(bool open, out string reason)
  949. {
  950. reason = string.Empty;
  951. OP.DoOperation($"{ModuleName.SETM}.SetSlitDoor", Module, open);
  952. return true;
  953. }
  954. public override bool SetLinerDoor(bool open, out string reason)
  955. {
  956. if (open)
  957. {
  958. if (RouteManager.IsATMMode)
  959. {
  960. if (!IsATM)
  961. {
  962. reason = $"{Module} is not ATM, can not open slit door";
  963. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  964. return false;
  965. }
  966. }
  967. //else
  968. //{
  969. // double maxPressureDifference = SC.GetValue<double>("System.PMTMMaxPressureDifference");
  970. // if (Math.Abs(TMPressure - ChamberPressure) > maxPressureDifference)
  971. // {
  972. // reason = $"{Module} and TM pressure difference exceeds the max limit {maxPressureDifference}, TMPressure:{TMPressure}, {Module}Pressure:{ChamberPressure}";
  973. // LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  974. // return false;
  975. // }
  976. //}
  977. }
  978. return _linerDoor.SetCylinder(open, out reason);
  979. }
  980. public override bool SetWallTCTemperature(float value)
  981. => _WallTC.RampTemp(value);
  982. public override void StopAllGases()
  983. {
  984. foreach (var line in _gasLines)
  985. {
  986. line.Stop();
  987. }
  988. }
  989. public override bool StopGas(int gasNum)
  990. {
  991. if (_gasLines.Length <= gasNum)
  992. return false;
  993. _gasLines[gasNum].Stop();
  994. return true;
  995. }
  996. public override bool StopN2()
  997. {
  998. _gasLineN2.Stop();
  999. return true;
  1000. }
  1001. public override void SwitchOnBuzzerAndRed()
  1002. {
  1003. throw new NotImplementedException();
  1004. }
  1005. public override void TurnDryPump(bool on)
  1006. => _MainPump?.SetPumpOnOff(on);
  1007. public override bool TurnPendulumValve(bool on)
  1008. => _pendulumValve.TurnValve(on);
  1009. public override void TurnTurboPump(bool on)
  1010. {
  1011. _TurboPump?.SetPumpOnOff(on);
  1012. }
  1013. public override bool PreparePlace()
  1014. {
  1015. if (!SetSlitDoor(true, out string reason))
  1016. {
  1017. LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Open failed:{reason}");
  1018. return false;
  1019. }
  1020. //
  1021. if (!SetLinerDoor(true, out reason))
  1022. {
  1023. LOG.Write(eEvent.ERR_PM, Module, $"Set Liner Door Open failed:{reason}");
  1024. return false;
  1025. }
  1026. if (!SetLiftPin(MovementPosition.Down, out reason))
  1027. {
  1028. LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin down failed:{reason}");
  1029. return false;
  1030. }
  1031. return true;
  1032. }
  1033. public override bool PreparePick()
  1034. {
  1035. if (!SetSlitDoor(true, out string reason))
  1036. {
  1037. LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Open failed:{reason}");
  1038. return false;
  1039. }
  1040. if (!SetLinerDoor(true, out reason))
  1041. {
  1042. LOG.Write(eEvent.ERR_PM, Module, $"Set Liner Door Open failed:{reason}");
  1043. return false;
  1044. }
  1045. if (!SetLiftPin(MovementPosition.Up, out reason))
  1046. {
  1047. LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin Up failed:{reason}");
  1048. return false;
  1049. }
  1050. return true;
  1051. }
  1052. public override bool PreparePlaceIsOK()
  1053. {
  1054. return CheckSlitDoorOpen() && LiftPinIsDown && CheckLinerDoorOpen();
  1055. }
  1056. public override bool PreparePickIsOK()
  1057. {
  1058. return CheckSlitDoorOpen() && LiftPinIsUp && CheckLinerDoorOpen();
  1059. }
  1060. public override bool EndPlace()
  1061. {
  1062. if (!SetLiftPin(MovementPosition.Down, out string reason))
  1063. {
  1064. LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin Down failed:{reason}");
  1065. return false;
  1066. }
  1067. if (!SetSlitDoor(false, out reason))
  1068. {
  1069. LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Close failed:{reason}");
  1070. return false;
  1071. }
  1072. if (!SetLinerDoor(false, out reason))
  1073. {
  1074. LOG.Write(eEvent.ERR_PM, Module, $"Set Liner Door Close failed:{reason}");
  1075. return false;
  1076. }
  1077. return true;
  1078. }
  1079. public override bool EndPick()
  1080. {
  1081. if (!SetSlitDoor(false, out string reason))
  1082. {
  1083. LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Close failed:{reason}");
  1084. return false;
  1085. }
  1086. return true;
  1087. }
  1088. public override bool EndPlaceIsOK()
  1089. {
  1090. return CheckSlitDoorClose() && LiftPinIsDown;
  1091. }
  1092. public override bool EndPickIsOK()
  1093. {
  1094. return CheckSlitDoorClose();
  1095. }
  1096. #endregion
  1097. protected override void CheckPermanentInterlock()
  1098. {
  1099. if (ProcessPressure > 950 && _GuageValve.SetPoint)
  1100. {
  1101. _GuageValve.TurnValve(false, out _);
  1102. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"Process pressure:{ProcessPressure} exceed 950 mtorr, Guage Valve (DO-31) closed automaticlly.");
  1103. }
  1104. if (ProcessPressure < 950 && !_GuageValve.SetPoint)
  1105. {
  1106. _GuageValve.TurnValve(true, out _);
  1107. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"Process pressure:{ProcessPressure} exceed 950 mtorr, Guage Valve (DO-31) closed automaticlly.");
  1108. }
  1109. }
  1110. public override void PMInError()
  1111. {
  1112. CloseValves();
  1113. GeneratorPowerOn(false);
  1114. GeneratorBiasPowerOn(false);
  1115. OpenValve(ValveType.TurboPumpPumping, true);
  1116. OpenValve(ValveType.TurboPumpPurge, true);
  1117. OnOffSetESCHV(false);
  1118. }
  1119. }
  1120. }