| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400 | 
							- using Aitex.Core.Common.DeviceData;
 
- using Aitex.Core.RT.Device;
 
- using Aitex.Core.RT.Device.Unit;
 
- using Aitex.Core.RT.Log;
 
- using Aitex.Core.RT.OperationCenter;
 
- using Aitex.Core.RT.SCCore;
 
- using Aitex.Core.UI.Control;
 
- using Aitex.Core.Util;
 
- using Aitex.Core.RT.Fsm;
 
- using MECF.Framework.Common.Device.Bases;
 
- using MECF.Framework.Common.Equipment;
 
- using MECF.Framework.Common.SubstrateTrackings;
 
- using System;
 
- using System.Collections.Generic;
 
- using System.Diagnostics;
 
- using System.Linq;
 
- using System.Text;
 
- using System.Threading.Tasks;
 
- using Venus_Core;
 
- using Venus_RT.Devices.IODevices;
 
- using Venus_RT.Modules;
 
- using IoMfc = Venus_RT.Devices.IODevices.IoMfc;
 
- namespace Venus_RT.Devices
 
- {
 
-     class JetVenusSEPM : JetPMBase
 
-     {
 
-         #region io变量定义
 
-         private readonly IoLid _Lid;
 
-         //private readonly IoCylinder _slitDoor;
 
-         private readonly IoCylinder _LiftPin;
 
-         private readonly IoValve _PVN21Valve;
 
-         private readonly IoValve _PVN22Valve;
 
-         private readonly IoValve _PV11Valve;
 
-         private readonly IoValve _PV12Valve;
 
-         private readonly IoValve _PV21Valve;
 
-         private readonly IoValve _PV22Valve;
 
-         private readonly IoValve _PV31Valve;
 
-         private readonly IoValve _PV32Valve;
 
-         private readonly IoValve _PV41Valve;
 
-         private readonly IoValve _PV42Valve;
 
-         private readonly IoValve _PV51Valve;//新增
 
-         private readonly IoValve _PV52Valve;//新增
 
-         private readonly IoValve _PV61Valve;//新增
 
-         private readonly IoValve _PV62Valve;//新增
 
-         private readonly IoValve _PV71Valve;//新增
 
-         private readonly IoValve _PV72Valve;//新增
 
-         private readonly IoValve _PV81Valve;//新增
 
-         private readonly IoValve _PV82Valve;//新增
 
-         private readonly IoValve _PV91Valve;//新增
 
-         private readonly IoValve _PV92Valve;//新增
 
-         private readonly IoValve _PVA1Valve;//新增
 
-         private readonly IoValve _PVA2Valve;//新增
 
-         private readonly IoValve _PVB1Valve;//新增
 
-         private readonly IoValve _PVB2Valve;//新增
 
-         private readonly IoValve _PVC1Valve;//新增
 
-         private readonly IoValve _PVC2Valve;//新增
 
-         private readonly IoValve _PV14Valve;//新增
 
-         private readonly IoValve _N2Valve;
 
-         private readonly IoValve _Mfc1Valve;
 
-         private readonly IoValve _Mfc2Valve;
 
-         private readonly IoValve _Mfc3Valve;
 
-         private readonly IoValve _Mfc4Valve;
 
-         private readonly IoValve _Mfc5Valve;
 
-         private readonly IoValve _Mfc6Valve;
 
-         private readonly IoValve _Mfc7Valve;
 
-         private readonly IoValve _Mfc8Valve;
 
-         private readonly IoValve _Mfc9Valve; //新增
 
-         private readonly IoValve _Mfc10Valve;//新增
 
-         private readonly IoValve _Mfc11Valve;//新增 空的
 
-         private readonly IoValve _Mfc12Valve;//新增
 
-         private readonly IoValve _PVHe1Valve;
 
-         private readonly IoValve _PVHe2Valve;
 
-         private readonly IoValve _GasFinalValve;
 
-         private readonly IoValve _SoftPumpValve;
 
-         private readonly IoValve _FastPumpValve;
 
-         private readonly IoValve _TurboPumpPumpingValve;
 
-         private readonly IoValve _TurboPumpPurgeValve;
 
-         private readonly IoValve _GuageValve;
 
-         private readonly IoValve _PVHe3Valve;
 
-         private readonly IoValve _HeISOValve;
 
-         private readonly IoValve _MainPurgeValve;//新增
 
-         private readonly IoValve _SecondPurgeValve;//新增
 
-         private readonly IoSensor _ATM_sw;
 
-         private readonly IoSensor _CDAPressure;
 
-         private readonly IoSensor _N2Pressure_sw;
 
-         private readonly IoSensor _VAC_sw;
 
-         private readonly IoSensor _WLK_sw;
 
-         private readonly IoSensor _Water_Flow;
 
-         private readonly IoSensor _RFG_Interlock;
 
-         private readonly IoSensor _PM_Lid_Closed;
 
-         private readonly IoSensor _Source_RF_Fan;
 
-         private readonly IoSensor _TurboPumpInterlock;
 
-         private readonly IoSensor _GasBoxDoor;
 
-         private readonly IoSensor _GasBoxPressure;
 
-         private readonly PumpBase _MainPump;
 
-         private readonly ESC5HighVoltage _ESCHV;
 
-         private readonly AdixenTurboPump _TurboPump;
 
-         private readonly PendulumValve _pendulumValve;
 
-         private readonly ChillerBase _Chiller;
 
-         private readonly RfPowerBase _Generator;//srf=>AdTecGenerator
 
-         private readonly RfPowerBase _GeneratorBias;//brf=>CometRF
 
-         private readonly RfMatchBase _Match;
 
-         private readonly RfMatchBase _BiasMatch;
 
-         private readonly IoHeater _ForelineTC;
 
-         private readonly IoHeater _WallTC;
 
-         private readonly IoPressureControl _pressureController;
 
-         private readonly IoGasStick[] _gasLines;
 
-         private readonly IoGasStick _gasLineN2;
 
-         private readonly IoBacksideHe _backsideHe;
 
-         //private readonly IoMfc _heMfc;
 
-         private readonly double _foreline_interlock_pressure = 750;
 
-         private readonly Dictionary<ValveType, IoValve> Valve2IO;
 
-         public override double MFC1FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas1").FeedBack;
 
-         public override double MFC2FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas2").FeedBack;
 
-         public override double MFC3FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas3").FeedBack;
 
-         public override double MFC4FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas4").FeedBack;
 
-         public override double MFC5FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas5").FeedBack;
 
-         public override double MFC6FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas6").FeedBack;
 
-         public override double MFC7FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas7").FeedBack;
 
-         public override double MFC8FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas8").FeedBack;
 
-         public override double MFC9FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas9").FeedBack;
 
-         public override double MFC10FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas10").FeedBack;
 
-         public override double MFC11FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas11").FeedBack;
 
-         public override double MFC12FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas12").FeedBack;
 
-         public override double HeliumFeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcHe").FeedBack;
 
-         public override float ReflectPower => _Generator.ReflectPower;
 
-         public override float BiasReflectPower => _GeneratorBias.ReflectPower;
 
-         public override float ForwardPower => _Generator.ForwardPower;
 
-         public override float BiasForwardPower => _GeneratorBias.ForwardPower;
 
-         public override float PendulumPressure => _pendulumValve.Pressure;
 
-         public override float PendulumPosition => _pendulumValve.Position;
 
-         //public override float WallTemperature => _WallTC.ControlTcFeedback;
 
-         //public override float ESCTemperature => _Chiller.CoolantOutletTcFeedback;
 
-         #endregion
 
-         #region 构造函数
 
-         public JetVenusSEPM(ModuleName moduleName) : base(moduleName)
 
-         {
 
-             Module = moduleName;
 
-             _Lid = DEVICE.GetDevice<IoLid>($"{Module}.{VenusDevice.Lid}");
 
-             _LiftPin = DEVICE.GetDevice<IoCylinder>($"{Module}.{VenusDevice.LiftPin}");
 
-             _PVN21Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVN21}");
 
-             _PVN22Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVN22}");
 
-             _PV11Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV11}");
 
-             _PV12Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV12}");
 
-             _PV21Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV21}");
 
-             _PV22Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV22}");
 
-             _PV31Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV31}");
 
-             _PV32Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV32}");
 
-             _PV41Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV41}");
 
-             _PV42Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV42}");
 
-             _PV51Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV51}");
 
-             _PV52Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV52}");
 
-             _PV61Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV61}");
 
-             _PV62Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV62}");
 
-             _PV71Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV71}");
 
-             _PV72Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV72}");
 
-             _PV81Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV81}");
 
-             _PV82Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV82}");
 
-             _PV91Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV91}");
 
-             _PV92Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV92}");
 
-             _PVA1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVA1}");
 
-             _PVA2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVA2}");
 
-             _PVB1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVB1}");
 
-             _PVB2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVB2}");
 
-             _PVC1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVC1}");
 
-             _PVC2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVC2}");
 
-             _PV14Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV14}");
 
-             _N2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveN2}");
 
-             _Mfc1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc1}");
 
-             _Mfc2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc2}");
 
-             _Mfc3Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc3}");
 
-             _Mfc4Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc4}");
 
-             _Mfc5Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc5}");
 
-             _Mfc6Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc6}");
 
-             _Mfc7Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc7}");
 
-             _Mfc8Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc8}");
 
-             _Mfc9Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc9}");
 
-             _Mfc10Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc10}");
 
-             _Mfc11Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc11}");
 
-             _Mfc12Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc12}");
 
-             _PVHe1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVHe1}");
 
-             _PVHe2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVHe2}");
 
-             _GasFinalValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveGasFinal}");
 
-             _SoftPumpValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveSoftPump}");
 
-             _FastPumpValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveFastPump}");
 
-             _TurboPumpPumpingValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveTurboPumpPumping}");
 
-             _TurboPumpPurgeValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveTurboPumpPurge}");
 
-             _GuageValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveGuage}");
 
-             _PVHe3Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVHe3}");
 
-             _HeISOValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveHeISO}");
 
-             _MainPurgeValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMainPurge}");
 
-             _SecondPurgeValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveSecondPurge}");
 
-             _ATM_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorATMSwitch");
 
-             _N2Pressure_sw = DEVICE.GetDevice<IoSensor>($"{Module}.N2PressureOk");
 
-             _VAC_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorVacSwitch");
 
-             _Water_Flow = DEVICE.GetDevice<IoSensor>($"{Module}.SensorWaterFlowOk");
 
-             _WLK_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorWaterLeakOk");
 
-             _CDAPressure = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCDAPressureOk");
 
-             _RFG_Interlock = DEVICE.GetDevice<IoSensor>($"{Module}.GeneratorInterlock");
 
-             _PM_Lid_Closed = DEVICE.GetDevice<IoSensor>($"{Module}.SensorPMLidClosed");
 
-             _Source_RF_Fan = DEVICE.GetDevice<IoSensor>($"{Module}.SensorSourceRFFan");
 
-             _TurboPumpInterlock = DEVICE.GetDevice<IoSensor>($"{Module}.TurboPumpInterlock");
 
-             _GasBoxDoor = DEVICE.GetDevice<IoSensor>($"{Module}.GasBoxDoorSW");
 
-             _GasBoxPressure = DEVICE.GetDevice<IoSensor>($"{Module}.GasBoxPressureSW");
 
-             _ForelineTC = DEVICE.GetDevice<IoHeater>($"{Module}.ForelineHeater");
 
-             _WallTC = DEVICE.GetDevice<IoHeater>($"{Module}.WallHeater");
 
-             _CDAPressure = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCDAPressureOk");
 
-             _pressureController = DEVICE.GetDevice<IoPressureControl>($"{Module}.{VenusDevice.PressureControl}");
 
-             _gasLines = new IoGasStick[12];
 
-             for (int index = 0; index < 12; index++)
 
-             {
 
-                 _gasLines[index] = DEVICE.GetDevice<IoGasStick>($"{Module}.GasStick{index + 1}");
 
-             }
 
-             _gasLineN2 = DEVICE.GetDevice<IoGasStick>($"{Module}.GasStickN2");
 
-             _backsideHe = DEVICE.GetDevice<IoBacksideHe>($"{Module}.BacksideHelium");
 
-             _MainPump = DEVICE.GetDevice<PumpBase>($"{Module}.{VenusDevice.MainPump}");
 
-             // RS232 Dry pump, SKY
 
-             if (SC.GetValue<int>($"{Module}.DryPump.CommunicationType") == (int)CommunicationType.RS232)
 
-             {
 
-                 if (SC.GetValue<int>($"{Module}.DryPump.MFG") == (int)DryPumpMFG.SKY)
 
-                 {
 
-                     _MainPump = DEVICE.GetDevice<SkyPump>($"{Module}.{VenusDevice.MainPump}");
 
-                 }
 
-                 else if (SC.GetValue<int>($"{Module}.DryPump.MFG") == (int)DryPumpMFG.Edwards)
 
-                 {
 
-                     _MainPump = DEVICE.GetDevice<EdwardsPump>($"{Module}.{VenusDevice.MainPump}");
 
-                 }
 
-             }
 
-             _ESCHV = DEVICE.GetDevice<ESC5HighVoltage>($"{Module}.{VenusDevice.ESCHV}");
 
-             _TurboPump = DEVICE.GetDevice<AdixenTurboPump>($"{Module}.{VenusDevice.TurboPump}");
 
-             _pendulumValve = DEVICE.GetDevice<PendulumValve>($"{Module}.{VenusDevice.PendulumValve}");
 
-             if (SC.GetValue<bool>($"{Module}.Chiller.EnableChiller") &&
 
-                 SC.GetValue<int>($"{Module}.Chiller.CommunicationType") == (int)CommunicationType.RS232)
 
-             {
 
-                 if (SC.GetValue<int>($"{Module}.Chiller.MFG") == (int)ChillerMFG.SMC)
 
-                 {
 
-                     _Chiller = DEVICE.GetDevice<SMCChiller>($"{Module}.{VenusDevice.Chiller}");
 
-                 }
 
-                 else if (SC.GetValue<int>($"{Module}.Chiller.MFG") == (int)ChillerMFG.AIRSYS)
 
-                 {
 
-                     _Chiller = DEVICE.GetDevice<AIRSYSChiller>($"{Module}.{VenusDevice.Chiller}");
 
-                 }
 
-             }
 
-             if (SC.GetValue<bool>($"{Module}.Chiller.EnableChiller") &&
 
-                 SC.GetValue<int>($"{Module}.Chiller.CommunicationType") == (int)CommunicationType.RS485 &&
 
-                 SC.GetValue<bool>($"{Module}.Chiller.ShareCOM"))
 
-             {
 
-                 if (SC.GetValue<int>($"{Module}.Chiller.MFG") == (int)ChillerMFG.SMC)
 
-                 {
 
-                     _Chiller = DEVICE.GetDevice<SMCShareChiller>($"{Module}.{VenusDevice.Chiller}");
 
-                 }
 
-                 else if (SC.GetValue<int>($"{Module}.Chiller.MFG") == (int)ChillerMFG.AIRSYS)
 
-                 {
 
-                     _Chiller = DEVICE.GetDevice<AIRSYSChiller>($"{Module}.{VenusDevice.Chiller}");
 
-                 }
 
-             }
 
-             // RS232 AdTec Generator
 
-             if (SC.GetValue<int>($"{Module}.Rf.CommunicationType") == (int)CommunicationType.RS232 &&
 
-                 SC.GetValue<int>($"{Module}.Rf.MFG") == (int)GeneratorMFG.AdTec)
 
-             {
 
-                 _Generator = DEVICE.GetDevice<AdTecGenerator>($"{Module}.{VenusDevice.Rf}");
 
-             }
 
-             // Ethernet Comet Generator Bias
 
-             if (SC.GetValue<bool>($"{Module}.BiasRf.EnableBiasRF"))
 
-             {
 
-                 if (SC.GetValue<int>($"{Module}.BiasRf.CommunicationType") == (int)CommunicationType.Ethernet &&
 
-                     SC.GetValue<int>($"{Module}.BiasRf.MFG") == (int)GeneratorMFG.Comet)
 
-                 {
 
-                     _GeneratorBias = DEVICE.GetDevice<CometRF>($"{Module}.{VenusDevice.BiasRf}");
 
-                 }
 
-                 else if (SC.GetValue<int>($"{Module}.BiasRf.MFG") == (int)GeneratorMFG.AdTec)
 
-                 {
 
-                     _GeneratorBias = DEVICE.GetDevice<AdTecGenerator>($"{Module}.{VenusDevice.BiasRf}");
 
-                 }
 
-             }
 
-             // RS232 AdTec match
 
-             if (SC.GetValue<int>($"{Module}.Match.CommunicationType") == (int)CommunicationType.RS232 &&
 
-                 SC.GetValue<int>($"{Module}.Match.MFG") == (int)MatchMFG.AdTec)
 
-             {
 
-                 _Match = DEVICE.GetDevice<AdTecMatch>($"{Module}.{VenusDevice.Match}");
 
-             }
 
-             // Bias Match
 
-             if (SC.GetValue<bool>($"{Module}.BiasMatch.EnableBiasMatch") &&
 
-                 SC.GetValue<int>($"{Module}.BiasMatch.CommunicationType") == (int)CommunicationType.RS232 &&
 
-                 SC.GetValue<int>($"{Module}.BiasMatch.MFG") == (int)MatchMFG.AdTec)
 
-             {
 
-                 _BiasMatch = DEVICE.GetDevice<AdTecMatch>($"{Module}.{VenusDevice.BiasMatch}");
 
-             }
 
-             _foreline_interlock_pressure = SC.GetValue<double>($"{Module}.ForelineInterlockPressure");
 
-             Valve2IO = new Dictionary<ValveType, IoValve>()
 
-             {
 
-                 { ValveType.PVN21, _PVN21Valve },
 
-                 { ValveType.PVN22, _PVN22Valve },
 
-                 { ValveType.PV11,  _PV11Valve  },
 
-                 { ValveType.PV12,  _PV12Valve  },
 
-                 { ValveType.PV21,  _PV21Valve  },
 
-                 { ValveType.PV22,  _PV22Valve  },
 
-                 { ValveType.PV31,  _PV31Valve  },
 
-                 { ValveType.PV32,  _PV32Valve  },
 
-                 { ValveType.PV41,  _PV41Valve  },
 
-                 { ValveType.PV42,  _PV42Valve  },
 
-                 { ValveType.PV51,  _PV51Valve  },
 
-                 { ValveType.PV52,  _PV52Valve  },
 
-                 { ValveType.PV61,  _PV61Valve  },
 
-                 { ValveType.PV62,  _PV62Valve  },
 
-                 { ValveType.PV71,  _PV71Valve  },
 
-                 { ValveType.PV72,  _PV72Valve  },
 
-                 { ValveType.PV81,  _PV81Valve  },
 
-                 { ValveType.PV82,  _PV82Valve  },
 
-                 { ValveType.PV91,  _PV91Valve  },
 
-                 { ValveType.PV92,  _PV92Valve  },
 
-                 { ValveType.PVA1,  _PVA1Valve  },
 
-                 { ValveType.PVA2,  _PVA2Valve  },
 
-                 { ValveType.PVB1,  _PVB1Valve  },
 
-                 { ValveType.PVB2,  _PVB2Valve  },
 
-                 { ValveType.PVC1,  _PVC1Valve  },
 
-                 { ValveType.PVC2,  _PVC2Valve  },
 
-                 { ValveType.N2,    _N2Valve    },
 
-                 { ValveType.Mfc1,  _Mfc1Valve  },
 
-                 { ValveType.Mfc2,  _Mfc2Valve  },
 
-                 { ValveType.Mfc3,  _Mfc3Valve  },
 
-                 { ValveType.Mfc4,  _Mfc4Valve  },
 
-                 { ValveType.Mfc5,  _Mfc5Valve  },
 
-                 { ValveType.Mfc6,  _Mfc6Valve  },
 
-                 { ValveType.Mfc7,  _Mfc7Valve  },
 
-                 { ValveType.Mfc8,  _Mfc8Valve  },
 
-                 { ValveType.Mfc9,  _Mfc9Valve  },
 
-                 { ValveType.Mfc10, _Mfc10Valve },
 
-                 { ValveType.Mfc11, _Mfc11Valve },
 
-                 { ValveType.Mfc12, _Mfc12Valve },
 
-                 { ValveType.PVHe1, _PVHe1Valve },
 
-                 { ValveType.PVHe3, _PVHe3Valve },
 
-                 { ValveType.PVHe2, _PVHe2Valve },
 
-                 { ValveType.GasFinal,  _GasFinalValve},
 
-                 { ValveType.SoftPump,  _SoftPumpValve},
 
-                 { ValveType.FastPump,  _FastPumpValve},
 
-                 { ValveType.TurboPumpPumping,  _TurboPumpPumpingValve},
 
-                 { ValveType.TurboPumpPurge,  _TurboPumpPurgeValve},
 
-                 { ValveType.Guage,  _GuageValve},
 
-                 { ValveType.HeISO,  _HeISOValve},
 
-                 { ValveType.MainPurge,  _MainPurgeValve},
 
-                 { ValveType.SecondPurge,  _SecondPurgeValve},
 
-                 { ValveType.PV14,  _PV14Valve},
 
-             };
 
-             SensorWithAlarm();
 
-             //_ESCHV.SetDownRampTime(5);
 
-         }
 
-         #endregion
 
-         #region 暴露变量
 
-         public override bool IsLidClosed => _Lid.OFFFeedback;
 
-         public override bool IsSlitDoorClosed
 
-         {
 
-             get
 
-             {
 
-                 if (Singleton<RouteManager>.Instance.seTM != null)
 
-                 {
 
-                     switch (Module)
 
-                     {
 
-                         case ModuleName.PMA:
 
-                             return Singleton<RouteManager>.Instance.seTM.IsPMASlitDoorClosed;
 
-                         case ModuleName.PMB:
 
-                             return Singleton<RouteManager>.Instance.seTM.IsPMBSlitDoorClosed;
 
-                         case ModuleName.PMC:
 
-                             return Singleton<RouteManager>.Instance.seTM.IsPMCSlitDoorClosed;
 
-                         default:
 
-                             return false;
 
-                     }
 
-                 }
 
-                 else
 
-                     return false;
 
-             }
 
-         }
 
-         public bool IsSlitDoorOpen
 
-         {
 
-             get
 
-             {
 
-                 if (Singleton<RouteManager>.Instance.seTM != null)
 
-                 {
 
-                     switch (Module)
 
-                     {
 
-                         case ModuleName.PMA:
 
-                             return Singleton<RouteManager>.Instance.seTM.IsPMASlitDoorOpen;
 
-                         case ModuleName.PMB:
 
-                             return Singleton<RouteManager>.Instance.seTM.IsPMBSlitDoorOpen;
 
-                         case ModuleName.PMC:
 
-                             return Singleton<RouteManager>.Instance.seTM.IsPMCSlitDoorOpen;
 
-                         default:
 
-                             return false;
 
-                     }
 
-                 }
 
-                 else
 
-                     return false;
 
-             }
 
-         }
 
-         public override bool IsPumpRunning => _MainPump.IsRunning;
 
-         public override bool IsISOOpen => _TurboPumpPumpingValve.Status;
 
-         public override bool IsTurboPumpRunning => _TurboPump.IsRunning;
 
-         public override bool IsPenVOpen => _pendulumValve.IsOpen;
 
-         public override bool IsTurboPumpAtSpeed => _TurboPump.AtSpeed;
 
-         public override float TurboPumpSpeed => _TurboPump.Speed;
 
-         public override bool HasPumpError => _MainPump.IsError || !_MainPump.IsRunning;
 
-         public override bool HasTurboPumpError => _TurboPump.IsError || !_TurboPump.IsRunning;
 
-         public override bool IsCDA_OK => _CDAPressure.Value;
 
-         public override bool IsFastPumpOpened => _FastPumpValve.Status;
 
-         public override bool IsSoftPumpOpened => _SoftPumpValve.Status;
 
-         public override bool IsMfc1ValveOpened => _Mfc1Valve.Status;
 
-         public override bool IsMfc2ValveOpened => _Mfc2Valve.Status;
 
-         public override bool IsMfc3ValveOpened => _Mfc3Valve.Status;
 
-         public override bool IsMfc4ValveOpened => _Mfc4Valve.Status;
 
-         public override bool IsMfc5ValveOpened => _Mfc5Valve.Status;
 
-         public override bool IsMfc6ValveOpened => _Mfc6Valve.Status;
 
-         public override bool IsMfc7ValveOpened => _Mfc7Valve.Status;
 
-         public override bool IsMfc8ValveOpened => _Mfc8Valve.Status;
 
-         public bool IsMfc9ValveOpened => _Mfc9Valve.Status;
 
-         public bool IsMfc10ValveOpened => _Mfc10Valve.Status;
 
-         public bool IsMfc11ValveOpened => _Mfc11Valve.Status;
 
-         public bool IsMfc12ValveOpened => _Mfc12Valve.Status;
 
-         public override bool IsGuageValveOpened => _GuageValve.Status;
 
-         public override bool IsATM => _ATM_sw.Value;
 
-         public override bool PVN22ValveIsOpen => _PVN22Valve.Status;
 
-         public override bool LiftPinIsDown => _LiftPin.OFFFeedback;
 
-         public override bool LiftPinIsUp => _LiftPin.ONFeedback;
 
-         public override bool IsVAC => _VAC_sw.Value;
 
-         //public override bool IsWaterFlowOk => _Water_Flow.Value;
 
-         public override bool IsWaterFlowOk => false;
 
-         public override bool IsWLK => _WLK_sw.Value;
 
-         public override bool IsRFGInterlockOn => _RFG_Interlock.Value;
 
-         public override bool PMLidClosed => _PM_Lid_Closed.Value;
 
-         public override bool TurboPumpInterlock => _TurboPumpInterlock.Value;
 
-         public override bool SourceRFFanInterlock => _Source_RF_Fan.Value;
 
-         public override bool SlitDoorClosed
 
-         {
 
-             get
 
-             {
 
-                 switch (Module)
 
-                 {
 
-                     case ModuleName.PMA:
 
-                         return Singleton<RouteManager>.Instance.seTM.IsPMASlitDoorClosed;
 
-                     case ModuleName.PMB:
 
-                         return Singleton<RouteManager>.Instance.seTM.IsPMBSlitDoorClosed;
 
-                     case ModuleName.PMC:
 
-                         return Singleton<RouteManager>.Instance.seTM.IsPMCSlitDoorClosed;
 
-                     default:
 
-                         return true;
 
-                 }
 
-             }
 
-         }
 
-         //public override double ProcessLowPressure => _pressureController.ProcessLow.Value;
 
-         //public override double ProcessHighPressure => _pressureController.ProcessHigh.Value;
 
-         public override double ChamberPressure => _pressureController.PressureGauge.Value;
 
-         public override double ProcessPressure => _pendulumValve.Pressure >= 95 ? 95 : _pendulumValve.Pressure;
 
-         //public override double ChamberPressure => _pendulumValve.Pressure;
 
-         public override double ForelinePressure => _pressureController.ForelineGauge.Value;
 
-         public override double TargetPressure => _pressureController.TargetPressure;
 
-         public override double ESCHePressure => _pressureController.ESCHeGauge.Value;
 
-         public override int ESCOutputVoltage => _ESCHV.OutputVoltage;
 
-         public override double ESCPositiveOutputCurrent => _ESCHV.PositiveOutputCurrent;
 
-         public override double ESCNegativeOutputCurrent => _ESCHV.NegativeOutputCurrent;
 
-         public override bool IsHVOn => _ESCHV.IsOn;
 
-         public override float CoolantInletTempFB
 
-         {
 
-             get
 
-             {
 
-                 switch (SC.GetValue<int>($"{Module}.Chiller.CommunicationType"))
 
-                 {
 
-                     case (int)CommunicationType.RS232:
 
-                         return _Chiller.CoolantInletTcFeedback;
 
-                     case (int)CommunicationType.RS485:
 
-                         return _Chiller.Temperature;
 
-                     default:
 
-                         return 0;
 
-                 }
 
-             }
 
-         }
 
-         public override float CoolantOutletTempFB => _Chiller.CoolantOutletTcFeedback;
 
-         public override bool ChillerIsRunning => _Chiller.IsRunning;
 
-         public override bool BackSideHeOutOfRange => _backsideHe.OutOfRange;
 
-         public override MovementPosition LiftPinPosition
 
-         {
 
-             get
 
-             {
 
-                 MovementPosition pos = MovementPosition.Unknown;
 
-                 if (_LiftPin.ONFeedback && !_LiftPin.OFFFeedback)
 
-                 {
 
-                     pos = MovementPosition.Up;
 
-                 }
 
-                 else if (!_LiftPin.ONFeedback && _LiftPin.OFFFeedback)
 
-                 {
 
-                     pos = MovementPosition.Down;
 
-                 }
 
-                 return pos;
 
-             }
 
-         }
 
-         public override double TotalGasSetpoint
 
-         {
 
-             get
 
-             {
 
-                 double sum = 0;
 
-                 foreach (var gas in _gasLines)
 
-                 {
 
-                     sum += gas.FlowSP;
 
-                 }
 
-                 return sum;
 
-             }
 
-         }
 
-         public override bool HasGasOutOfRange
 
-         {
 
-             get
 
-             {
 
-                 foreach (var gas in _gasLines)
 
-                 {
 
-                     if (!gas.IsOutOfRange)
 
-                         return false;
 
-                 }
 
-                 return true;
 
-             }
 
-         }
 
-         public override bool IsLidLoadlockClosed
 
-         {
 
-             get
 
-             {
 
-                 //LOG.Write(eEvent.ERR_PM,Module,"VenusSE PM is not exist Loadlock!");
 
-                 return false;
 
-             }
 
-         }
 
-         public override bool IsATMLoadlock
 
-         {
 
-             get
 
-             {
 
-                 //LOG.Write(eEvent.ERR_PM, Module, "VenusSE PM is not exist Loadlock!");
 
-                 return false;
 
-             }
 
-         }
 
-         public override bool IsVACLoadLock
 
-         {
 
-             get
 
-             {
 
-                 //LOG.Write(eEvent.ERR_PM, Module, "VenusSE PM is not exist Loadlock!");
 
-                 return false;
 
-             }
 
-         }
 
-         public override bool IsLoadlockArmRetract
 
-         {
 
-             get
 
-             {
 
-                 //LOG.Write(eEvent.ERR_PM, Module, "VenusSE PM is not exist Loadlock!");
 
-                 return false;
 
-             }
 
-         }
 
-         public override bool IsLoadlockArmExtend
 
-         {
 
-             get
 
-             {
 
-                 //LOG.Write(eEvent.ERR_PM, Module, "VenusSE PM is not exist Loadlock!");
 
-                 return false;
 
-             }
 
-         }
 
-         public override bool LoadlockArmRetract
 
-         {
 
-             get
 
-             {
 
-                 //LOG.Write(eEvent.ERR_PM, Module, "VenusSE PM is not exist Loadlock!");
 
-                 return false;
 
-             }
 
-         }
 
-         public override bool LoadlockArmExtend
 
-         {
 
-             get
 
-             {
 
-                 //LOG.Write(eEvent.ERR_PM, Module, "VenusSE PM is not exist Loadlock!");
 
-                 return false;
 
-             }
 
-         }
 
-         public override float RFMatchC1 => _Match != null ? _Match.TunePosition1 : 0;
 
-         public override float RFMatchC2 => _Match != null ? _Match.TunePosition1 : 0;
 
-         public override float BiasRFMatchC1 => _BiasMatch != null ? _BiasMatch.TunePosition1 : 0;
 
-         public override float BiasRFMatchC2 => _BiasMatch != null ? _BiasMatch.TunePosition1 : 0;
 
-         public override double LoadlockPressure
 
-         {
 
-             get
 
-             {
 
-                 //LOG.Write(eEvent.ERR_PM, Module, "VenusSE PM is not exist Loadlock!");
 
-                 return -100;
 
-             }
 
-         }
 
-         public override void BuzzerBlinking(double time)
 
-         {
 
-             LOG.Write(eEvent.ERR_PM, Module, "VenusSE PM is not exist SignalTower!");
 
-         }
 
-         #endregion
 
-         #region 公共方法
 
-         public override bool CheckAtm()
 
-         {
 
-             //检查是否是ATM模式
 
-             return _ATM_sw.Value && ChamberPressure > 700000;
 
-         }
 
-         public override bool CheckChillerStatus()
 
-         {
 
-             return _Chiller != null /*&& _Chiller.IsRunning*/ && !_Chiller.IsError;
 
-         }
 
-         public override bool CheckGeneratorAndHVInterlock(VenusDevice device)
 
-         {
 
-             eEvent evt = device == VenusDevice.Rf ? eEvent.ERR_RF : eEvent.ERR_ESC_HV;
 
-             if (!PMLidClosed)
 
-             {
 
-                 LOG.Write(evt, Module, $"Cannot Power ON {device} as PM Lid is Open.");
 
-                 return false;
 
-             }
 
-             if (!IsVAC)
 
-             {
 
-                 LOG.Write(evt, Module, $"Cannot Power ON {device} as PM is not Vacuum.");
 
-                 return false;
 
-             }
 
-             //if (!IsWaterFlowOk)
 
-             //{
 
-             //    LOG.Write(evt, Module, $"Cannot Power ON {device} as Water Flow is OFF.");
 
-             //    return false;
 
-             //}
 
-             if (!IsRFGInterlockOn)
 
-             {
 
-                 LOG.Write(evt, Module, $"Cannot Power ON {device} as Generator Interlock is OFF.");
 
-                 return false;
 
-             }
 
-             //2024-02-05 15:15:56 TPS 朱永吉温海波确认已经去掉该interlock
 
-             //if (!SourceRFFanInterlock)
 
-             //{
 
-             //    LOG.Write(evt, Module, $"Cannot Power ON {device} as Source RF Fan is OFF.");
 
-             //    return false;
 
-             //}
 
-             if (!SlitDoorClosed)
 
-             {
 
-                 LOG.Write(evt, Module, $"Cannot Power ON {device} as Slit Door is open.");
 
-                 return false;
 
-             }
 
-             if ((device == VenusDevice.ESCHV || device == VenusDevice.BiasRf) && WaferManager.Instance.CheckNoWafer(Module, 0))
 
-             {
 
-                 LOG.Write(evt, Module, $"Cannot Power ON {device} as {Module} has no wafer");
 
-                 return false;
 
-             }
 
-             return true;
 
-         }
 
-         public override void CheckIdleInterlock()
 
-         {
 
-             if (ForelinePressure > _foreline_interlock_pressure)
 
-             {
 
-                 if (_TurboPumpPumpingValve.SetPoint || _TurboPumpPurgeValve.SetPoint || _pendulumValve.IsOpen)
 
-                 {
 
-                     _pendulumValve.TurnValve(false);
 
-                     _TurboPumpPurgeValve.TurnValve(false, out _);
 
-                     _TurboPumpPumpingValve.TurnValve(false, out _);
 
-                     LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"Foreline pressure:{ForelinePressure} exceed {_foreline_interlock_pressure} mtorr, Pendulum valve & PV6 & PV7 closed automaticlly.");
 
-                 }
 
-             }
 
-         }
 
-         public override bool CheckLiftDown()
 
-         {
 
-             return _LiftPin.State == CylinderState.Close;
 
-         }
 
-         public override bool CheckLiftUp()
 
-         {
 
-             return _LiftPin.State == CylinderState.Open;
 
-         }
 
-         public override bool CheckSlitDoorClose()
 
-         => IsSlitDoorClosed;
 
-         public override bool CheckSlitDoorOpen()
 
-         => IsSlitDoorOpen;
 
-         public override void CloseValves(int? delayTime = null)
 
-         {
 
-             _PVN21Valve.TurnValve(false, out _);
 
-             //_PVN22Valve.TurnValve(false, out _);
 
-             _PV11Valve.TurnValve(false, out _);
 
-             _PV12Valve.TurnValve(false, out _);
 
-             _PV21Valve.TurnValve(false, out _);
 
-             _PV22Valve.TurnValve(false, out _);
 
-             _PV31Valve.TurnValve(false, out _);
 
-             _PV32Valve.TurnValve(false, out _);
 
-             _PV41Valve.TurnValve(false, out _);
 
-             _PV42Valve.TurnValve(false, out _);
 
-             _PVHe1Valve.TurnValve(false, out _);
 
-             _PVHe2Valve.TurnValve(false, out _);
 
-             _GasFinalValve.TurnValve(false, out _);
 
-             _SoftPumpValve.TurnValve(false, out _);
 
-             _FastPumpValve.TurnValve(false, out _);
 
-             //_TurboPumpPumpingValve.TurnValve(false, out _);
 
-             //_TurboPumpPurgeValve.TurnValve(false, out _);
 
-             _GuageValve.TurnValve(false, out _);
 
-             _N2Valve.TurnValve(false, out _);
 
-             _FastPumpValve.TurnValve(false, out _);
 
-             _PVHe3Valve.TurnValve(false, out _);
 
-             _HeISOValve.TurnValve(false, out _);
 
-             _MainPurgeValve.TurnValve(false, out _);
 
-             _SecondPurgeValve.TurnValve(false, out _);
 
-             //新增
 
-             _Mfc1Valve.TurnValve(false, out _);
 
-             _Mfc2Valve.TurnValve(false, out _);
 
-             _Mfc3Valve.TurnValve(false, out _);
 
-             _Mfc4Valve.TurnValve(false, out _);
 
-             _Mfc5Valve.TurnValve(false, out _);
 
-             _Mfc6Valve.TurnValve(false, out _);
 
-             _Mfc7Valve.TurnValve(false, out _);
 
-             _Mfc8Valve.TurnValve(false, out _);
 
-             _Mfc9Valve.TurnValve(false, out _);
 
-             _Mfc10Valve.TurnValve(false, out _);
 
-             _Mfc11Valve.TurnValve(false, out _);
 
-             _Mfc12Valve.TurnValve(false, out _);
 
-             _PV51Valve.TurnValve(false, out _);
 
-             _PV52Valve.TurnValve(false, out _);
 
-             _PV61Valve.TurnValve(false, out _);
 
-             _PV62Valve.TurnValve(false, out _);
 
-             _PV71Valve.TurnValve(false, out _);
 
-             _PV72Valve.TurnValve(false, out _);
 
-             _PV81Valve.TurnValve(false, out _);
 
-             _PV82Valve.TurnValve(false, out _);
 
-             _PV91Valve.TurnValve(false, out _);
 
-             _PV92Valve.TurnValve(false, out _);
 
-             _PVA1Valve.TurnValve(false, out _);
 
-             _PVA2Valve.TurnValve(false, out _);
 
-             _PVB1Valve.TurnValve(false, out _);
 
-             _PVB2Valve.TurnValve(false, out _);
 
-             _PVC1Valve.TurnValve(false, out _);
 
-             _PVC2Valve.TurnValve(false, out _);
 
-             _PVN22Valve.TurnValve(false, out _);
 
-             foreach (var stick in _gasLines)
 
-             {
 
-                 stick.Stop();
 
-             }
 
-         }
 
-         public override bool ExtendWafer()
 
-         {
 
-             throw new NotImplementedException();
 
-         }
 
-         public override bool FlowGas(int gasNum, double val)
 
-         {
 
-             if (_gasLines.Length <= gasNum)
 
-                 return false;
 
-             _gasLines[gasNum].Flow(val);
 
-             return true;
 
-         }
 
-         public override bool FlowN2(double val)
 
-         {
 
-             _gasLineN2.Flow(val);
 
-             return true;
 
-         }
 
-         public override void RTCloseEvent()
 
-         {
 
-             if (_Generator.IsPowerOn)
 
-             {
 
-                 GeneratorPowerOn(false);
 
-             }
 
-             if (_GeneratorBias.IsPowerOn)
 
-             {
 
-                 GeneratorBiasPowerOn(false);
 
-             }
 
-             if (PendulumValveIsOpen())
 
-             {
 
-                 TurnPendulumValve(false);
 
-             }
 
-         }
 
-         public override bool GeneratorBiasPowerOn(bool on)
 
-         {
 
-             if (_GeneratorBias == null) return false;
 
-             if (on && !IsRFGInterlockOn)
 
-             {
 
-                 LOG.Write(eEvent.ERR_RF, Module, "Bias射频电源 Interlock条件不满足");
 
-                 return false;
 
-             }
 
-             return _GeneratorBias.SetPowerOnOff(on, out _);
 
-         }
 
-         public override bool GeneratorBiasSetMatchMode(bool val)
 
-         {
 
-             if (_GeneratorBias == null) return false;
 
-             string reason = string.Empty;
 
-             _GeneratorBias.SetMatchingAutoMode(val, out reason);
 
-             return true;
 
-         }
 
-         public override bool SetMatchWorkMode(MatchWorkMode matchWorkMode)
 
-         {
 
-             if (_Match == null) return false;
 
-             if (matchWorkMode == MatchWorkMode.Auto)
 
-             {
 
-                 return _Match.SetMatchMode(EnumRfMatchTuneMode.Auto, out _);
 
-             }
 
-             else
 
-             {
 
-                 return _Match.SetMatchMode(EnumRfMatchTuneMode.Manual, out _);
 
-             }
 
-         }
 
-         public override bool SetBiasMatchWorkMode(MatchWorkMode matchWorkMode)
 
-         {
 
-             if (_BiasMatch == null) return false;
 
-             if (matchWorkMode == MatchWorkMode.Auto)
 
-             {
 
-                 return _BiasMatch.SetMatchMode(EnumRfMatchTuneMode.Auto, out _);
 
-             }
 
-             else if (matchWorkMode == MatchWorkMode.Manual)
 
-             {
 
-                 return _BiasMatch.SetMatchMode(EnumRfMatchTuneMode.Manual, out _);
 
-             }
 
-             return false;
 
-         }
 
-         public override bool GeneratorBiasSetpower(float val)
 
-         {
 
-             if (_GeneratorBias == null) return false;
 
-             if (Math.Abs(val) > 0.01)
 
-                 _GeneratorBias.SetPower((ushort)val);
 
-             return true;
 
-         }
 
-         public override bool GeneratorPowerOn(bool on)
 
-         {
 
-             if (_Generator == null) return false;
 
-             if (on && !IsRFGInterlockOn)
 
-             {
 
-                 LOG.Write(eEvent.ERR_RF, Module, "射频电源 Interlock条件不满足");
 
-                 return false;
 
-             }
 
-             return _Generator.SetPowerOnOff(on, out _);
 
-         }
 
-         public override bool GeneratorSetpower(float val)
 
-         {
 
-             if (_Generator == null) return false;
 
-             if (Math.Abs(val) > 0.01)
 
-                 _Generator.SetPower((ushort)val);
 
-             return true;
 
-         }
 
-         public override float GetPVPosition()
 
-         {
 
-             return _pendulumValve.Position;
 
-         }
 
-         public override async void HeatChiller(ChillerType chillerType, double value, double offset)
 
-         {
 
-             _Chiller?.SetChillerTemp((float)value, (float)offset);
 
-             await Task.Delay(1000);
 
-             _Chiller?.SetChillerOnOff(true);
 
-         }
 
-         public override void Home()
 
-         {
 
-             SetLiftPin(MovementPosition.Down, out _);
 
-             //转交TM
 
-             if (!IsSlitDoorClosed)
 
-             {
 
-                 SetSlitDoor(true, out _);
 
-             }
 
-             else
 
-             {
 
-                 SetSlitDoor(false, out _);
 
-             }
 
-             //SetSlitDoor(false, out _);
 
-             OpenValve(ValveType.PVN22, false);
 
-             _Generator?.ReConnect();
 
-             _Match?.ReConnect();
 
-             _MainPump?.ReConnect();
 
-             _TurboPump?.ReConnect();
 
-             _pendulumValve?.ReConnect();
 
-         }
 
-         public override void OnOffChiller(ChillerType chillerType, bool onoff)
 
-         => _Chiller?.SetChillerOnOff(onoff);
 
-         public override bool OnOffSetESCHV(bool on)
 
-         => _ESCHV.SetPowerOnOff(on);
 
-         public override void OpenValve(ValveType vlvType, bool on)
 
-         {
 
-             if (Valve2IO.ContainsKey(vlvType))
 
-             {
 
-                 if (vlvType == ValveType.TurboPumpPurge && on)
 
-                 {
 
-                     if (!IsISOOpen)
 
-                     {
 
-                         LOG.Write(eEvent.WARN_DEFAULT_WARN, Module, $"Chamber TurboPumpPumping valve is not open, can not turn on TurboPumpPurge valve.");
 
-                         return;
 
-                     }
 
-                 }
 
-                 else if (vlvType == ValveType.TurboPumpPumping && !on)
 
-                 {
 
-                     if (IsTurboPumpRunning)
 
-                     {
 
-                         if (IsPenVOpen)
 
-                         {
 
-                             LOG.Write(eEvent.WARN_DEFAULT_WARN, Module, $"Chamber TurboPump is open but Pendulum Valve is open, can not turn off TurboPumpPumping valve.");
 
-                             return;
 
-                         }
 
-                     }
 
-                 }
 
-                 if (vlvType == ValveType.TurboPumpPurge && !_TurboPumpPumpingValve.Status && on)
 
-                 {
 
-                     LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"cannot open Turbo Pump Purge, cause Turbo Pump Valve not open");
 
-                     return;
 
-                 }
 
-                 if (vlvType == ValveType.TurboPumpPumping && on)
 
-                 {
 
-                     if (!_MainPump.IsRunning)
 
-                     {
 
-                         LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"cannot open Turbo Pump Pump, cause Dry Pump Valve is not open");
 
-                         return;
 
-                     }
 
-                     if (ForelinePressure > SC.GetValue<int>($"{Module}.TurboPumpPumpingValveMinForelinePressure"))
 
-                     {
 
-                         LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"cannot open Turbo Pump Pump, cause forelinePressure:{ForelinePressure}");
 
-                         return;
 
-                     }
 
-                 }
 
-                 Valve2IO[vlvType].TurnValve(on, out _);
 
-                 LOG.Write(eEvent.EV_DEVICE_INFO, Module, $"{(on ? "打开" : "关闭")} 阀 {vlvType.ToString()}");
 
-             }
 
-             else
 
-             {
 
-                 throw new ArgumentOutOfRangeException($"Argument error {vlvType}-{on}");
 
-             }
 
-         }
 
-         public async override void AbortControlPressure()
 
-         {
 
-             OpenValve(ValveType.PVN22, false);
 
-             OpenValve(ValveType.N2, false);
 
-             await Task.Delay(2000);
 
-             OpenValve(ValveType.GasFinal, false);
 
-             OpenValve(ValveType.PV14, false);
 
-             TurnPendulumValve(false);
 
-             //return true;
 
-         }
 
-         public override bool PendulumValveIsOpen()
 
-         {
 
-             return _pendulumValve.IsOpen;
 
-         }
 
-         public override bool RetractWafer()
 
-         {
 
-             throw new NotImplementedException();
 
-         }
 
-         public override void SetBacksideHeFlow(double flow)
 
-         {
 
-             if (_backsideHe == null) return;
 
-             _backsideHe.Flow(flow);
 
-         }
 
-         public override bool SetBacksideHePressure(float mTorr)
 
-         {
 
-             if (_backsideHe == null) return false;
 
-             return _backsideHe.SetBacksideHelium(mTorr);
 
-         }
 
-         public override bool SetBacksideHeThreshold(float nMin, float nMax)
 
-         {
 
-             if (_backsideHe == null) return false;
 
-             return _backsideHe.SetFlowThreshold(nMin, nMax);
 
-         }
 
-         public override bool SetBiasMatchPosition(float c1, float c2)
 
-         {
 
-             if (_BiasMatch == null) return false;
 
-             string reason = string.Empty;
 
-             _BiasMatch.SetMatchPosition(c1, c2, out reason);
 
-             return true;
 
-         }
 
-         public override bool SetBiasPulseMode(bool on)
 
-         {
 
-             if (_GeneratorBias == null) return false;
 
-             _GeneratorBias.SetPulseMode(on);
 
-             return true;
 
-         }
 
-         public override bool SetBiasPulseRateFreq(int nFreq)
 
-         {
 
-             if (_GeneratorBias == null) return false;
 
-             _GeneratorBias.SetPulseRateFreq(nFreq);
 
-             return true;
 
-         }
 
-         public override bool SetDiasPulseDutyCycle(int percentage)
 
-         {
 
-             if (_GeneratorBias == null) return false;
 
-             _GeneratorBias.SetPulseDutyCycle(percentage);
 
-             return true;
 
-         }
 
-         public override bool SetESCClampVoltage(int nVoltage)
 
-         {
 
-             if (_ESCHV == null) return false;
 
-             return _ESCHV.SetOutputVoltage(nVoltage);
 
-         }
 
-         public override void SetGeneratorCommunicationMode(int mode)
 
-         => _Generator?.SetCommunicationMode(mode);
 
-         public override bool SetLiftPin(MovementPosition dirt, out string reason)
 
-         {
 
-             reason = string.Empty;
 
-             switch (dirt)
 
-             {
 
-                 case MovementPosition.Down:
 
-                     return _LiftPin.SetCylinder(false, out reason);
 
-                 case MovementPosition.Up:
 
-                     return _LiftPin.SetCylinder(true, out reason);
 
-                 case MovementPosition.Left:
 
-                 case MovementPosition.Right:
 
-                 case MovementPosition.Middle:
 
-                     throw new ArgumentException("Movement argument error");
 
-             }
 
-             return true;
 
-         }
 
-         public override bool SetMatchPosition(float c1, float c2)
 
-         {
 
-             if (_Match == null) return false;
 
-             string reason = string.Empty;
 
-             _Match.SetMatchPosition(c1, c2, out reason);
 
-             return true;
 
-         }
 
-         public override bool SetPVPostion(float position)
 
-         => _pendulumValve.SetPosition(position);
 
-         public override bool SetPVPressure(float pressure)
 
-         => _pendulumValve.SetPressure(pressure);
 
-         public override bool SetSlitDoor(bool open, out string reason)
 
-         {
 
-             reason = string.Empty;
 
-             // 泓浒TM将提供开关门的interlock
 
-             OP.DoOperation($"{ModuleName.SETM}.SetSlitDoor", Module, open);
 
-             return true;
 
-         }
 
-         public override bool SetWallTCTemperature(float value)
 
-         => _WallTC.RampTemp(value);
 
-         public override void StopAllGases()
 
-         {
 
-             foreach (var line in _gasLines)
 
-             {
 
-                 line.Stop();
 
-             }
 
-         }
 
-         public override bool StopGas(int gasNum)
 
-         {
 
-             if (_gasLines.Length <= gasNum)
 
-                 return false;
 
-             _gasLines[gasNum].Stop();
 
-             return true;
 
-         }
 
-         public override bool StopN2()
 
-         {
 
-             _gasLineN2.Stop();
 
-             return true;
 
-         }
 
-         public override void SwitchOnBuzzerAndRed()
 
-         {
 
-             throw new NotImplementedException();
 
-         }
 
-         public override void TurnDryPump(bool on)
 
-         => _MainPump?.SetPumpOnOff(on);
 
-         public override bool TurnPendulumValve(bool on)
 
-         => _pendulumValve.TurnValve(on);
 
-         public override void TurnTurboPump(bool on)
 
-         {
 
-             _TurboPump?.SetPumpOnOff(on);
 
-         }
 
-         public override bool PreparePlace()
 
-         {
 
-             if (!SetSlitDoor(true, out string reason))
 
-             {
 
-                 LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Open failed:{reason}");
 
-                 return false;
 
-             }
 
-             if (!SetLiftPin(MovementPosition.Down, out reason))
 
-             {
 
-                 LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin down failed:{reason}");
 
-                 return false;
 
-             }
 
-             return true;
 
-         }
 
-         public override bool PreparePick()
 
-         {
 
-             if (!SetSlitDoor(true, out string reason))
 
-             {
 
-                 LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Open failed:{reason}");
 
-                 return false;
 
-             }
 
-             if (!SetLiftPin(MovementPosition.Up, out reason))
 
-             {
 
-                 LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin Up failed:{reason}");
 
-                 return false;
 
-             }
 
-             return true;
 
-         }
 
-         public override bool PreparePlaceIsOK()
 
-         {
 
-             return CheckSlitDoorOpen() && LiftPinIsDown;
 
-         }
 
-         public override bool PreparePickIsOK()
 
-         {
 
-             return CheckSlitDoorOpen() && LiftPinIsUp;
 
-         }
 
-         public override bool EndPlace()
 
-         {
 
-             if (!SetLiftPin(MovementPosition.Down, out string reason))
 
-             {
 
-                 LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin Down failed:{reason}");
 
-                 return false;
 
-             }
 
-             if (!SetSlitDoor(false, out reason))
 
-             {
 
-                 LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Close failed:{reason}");
 
-                 return false;
 
-             }
 
-             return true;
 
-         }
 
-         public override bool EndPick()
 
-         {
 
-             if (!SetSlitDoor(false, out string reason))
 
-             {
 
-                 LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Close failed:{reason}");
 
-                 return false;
 
-             }
 
-             return true;
 
-         }
 
-         public override bool EndPlaceIsOK()
 
-         {
 
-             return CheckSlitDoorClose() && LiftPinIsDown;
 
-         }
 
-         public override bool EndPickIsOK()
 
-         {
 
-             return CheckSlitDoorClose();
 
-         }
 
-         private Stopwatch _closedelay = new Stopwatch();
 
-         public override void Monitor()
 
-         {
 
-             bool _isAllGasOff = true;
 
-             foreach (var gas in _gasLines)
 
-             {
 
-                 gas.Monitor();
 
-                 if (gas._mfc.FeedBack > 0)
 
-                     _isAllGasOff = false;
 
-             }
 
-             CheckPermanentInterlock();
 
-             //2024-02-20 17:11:16 朱永吉确认所有气不流后关闭rf 任意一管打开都不关闭
 
-             if (!_Generator.IsPowerOn && !_GeneratorBias.IsPowerOn && _closedelay.IsRunning)
 
-             {
 
-                 LOG.Write(eEvent.EV_DEVICE_INFO, Module, $"Turn On RF use:{_closedelay.ElapsedMilliseconds} ms");
 
-                 _closedelay.Stop();
 
-             }
 
-             if (_isAllGasOff && !_closedelay.IsRunning && (_Generator.IsPowerOn || _GeneratorBias.IsPowerOn))
 
-             {
 
-                 _closedelay.Start();
 
-                 GasRFInterlock();
 
-             }
 
-         }
 
-         #endregion
 
-         private void GasRFInterlock()
 
-         {
 
-             if (_Generator.IsPowerOn)
 
-             {
 
-                 LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"ALL Gas are not flowing. Source RF will Power Off");
 
-                 GeneratorPowerOn(false);
 
-             }
 
-             if (_GeneratorBias.IsPowerOn)
 
-             {
 
-                 LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"ALL Gas are not flowing. Bias RF will Power Off");
 
-                 GeneratorBiasPowerOn(false);
 
-             }
 
-         }
 
-         protected override void CheckPermanentInterlock()
 
-         {
 
-             if (ChamberPressure >= 98 && _GuageValve.SetPoint)
 
-             {
 
-                 _GuageValve.TurnValve(false, out _);
 
-                 LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"Process pressure:{ChamberPressure} exceed 98 mtorr, Guage Valve (DO-31) closed automaticlly.");
 
-             }
 
-             if (ChamberPressure < 98 && !_GuageValve.SetPoint)
 
-             {
 
-                 _GuageValve.TurnValve(true, out _);
 
-                 LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"Process pressure:{ChamberPressure} less than 98 mtorr, Guage Valve (DO-31) open automaticlly.");
 
-             }
 
-         }
 
-         public override bool StartControlPressure(int pressureSetpoint, int flowSetpoint)
 
-         {
 
-             OpenValve(ValveType.TurboPumpPumping, true);
 
-             if (_TurboPumpPumpingValve.Status)
 
-             {
 
-                 TurnPendulumValve(true);
 
-                 SetPVPressure(pressureSetpoint);
 
-                 OpenValve(ValveType.PV14, true);
 
-                 OpenValve(ValveType.GasFinal, false);
 
-                 OpenValve(ValveType.PVN22, true);
 
-                 return true;
 
-             }
 
-             else
 
-             {
 
-                 LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"cannot control pressure,cause Turbo Pump Pumping Valve is Close");
 
-                 return true;
 
-             }
 
-         }
 
-         private void ALARM_Notify()
 
-         {
 
-             Singleton<RouteManager>.Instance.GetPM(Module).PostMsg(FSM_MSG.ALARM);
 
-         }
 
-         private void SensorWithAlarm()
 
-         {
 
-             _WLK_sw.WarningAction += ALARM_Notify;
 
-             _PM_Lid_Closed.WarningAction += ALARM_Notify;
 
-             _RFG_Interlock.WarningAction += ALARM_Notify;
 
-             _TurboPumpInterlock.WarningAction += ALARM_Notify;
 
-             _GasBoxDoor.WarningAction += ALARM_Notify;
 
-             _GasBoxPressure.WarningAction += ALARM_Notify;
 
-         }
 
-         public override void PMInError()
 
-         {
 
-             CloseValves();
 
-             GeneratorPowerOn(false);
 
-             GeneratorBiasPowerOn(false);
 
-             OpenValve(ValveType.TurboPumpPumping, true);
 
-             OpenValve(ValveType.TurboPumpPurge, true);
 
-             _pendulumValve.SetPosition(1000);
 
-             OnOffSetESCHV(false);
 
-         }
 
-     }
 
- }
 
 
  |