JetVenusDEPM.cs 48 KB

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