| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400 | 
							- using Aitex.Core.RT.DataCenter;
 
- using Aitex.Core.RT.Device;
 
- using Aitex.Core.RT.OperationCenter;
 
- using Aitex.Core.Util;
 
- using MECF.Framework.Common.Equipment;
 
- using System;
 
- using System.Collections.Generic;
 
- using System.Linq;
 
- using System.Text;
 
- using System.Threading.Tasks;
 
- using Venus_Core;
 
- using Venus_RT.Modules;
 
- namespace Venus_RT.Devices
 
- {
 
-     /// <summary>
 
-     /// 变量及类型说明
 
-     /// bool类型变量 Is开头代表DI 其余代表DO
 
-     /// double类型变量 代表AI AO
 
-     /// </summary>
 
-     abstract class JetVenusSEPMBase : BaseDevice, IDevice
 
-     {
 
-         #region DI DO
 
-         public abstract bool IsLidClosed { get; }
 
-         public abstract bool IsSlitDoorClosed { get; }
 
-         public abstract bool IsPumpRunning { get; }
 
-         public abstract bool IsTurboPumpRunning { get; } 
 
-         public abstract bool IsTurboPumpAtSpeed { get; }
 
-         public abstract float TurboPumpSpeed { get; }
 
-         public abstract bool HasPumpError { get; }
 
-         public abstract bool HasTurboPumpError { get; }
 
-         public abstract bool IsCDA_OK { get; }
 
-         public abstract bool IsFastPumpOpened { get; }
 
-         public abstract bool IsSoftPumpOpened { get; }
 
-         public abstract bool IsMfc1ValveOpened { get; }
 
-         public abstract bool IsMfc2ValveOpened { get; }
 
-         public abstract bool IsMfc3ValveOpened { get; }
 
-         public abstract bool IsMfc4ValveOpened { get; }
 
-         public abstract bool IsMfc5ValveOpened { get; }
 
-         public abstract bool IsMfc6ValveOpened { get; }
 
-         public abstract bool IsMfc7ValveOpened { get; }
 
-         public abstract bool IsMfc8ValveOpened { get; }
 
-         public abstract bool IsMfc9ValveOpened { get; }
 
-         public abstract bool IsMfc10ValveOpened { get; }
 
-         public abstract bool IsMfc11ValveOpened { get; }
 
-         public abstract bool IsMfc12ValveOpened { get; }
 
-         public abstract bool IsGuageValveOpened { get; }
 
-         public abstract bool IsATM { get; }
 
-         public abstract bool PVN22ValveIsOpen { get; }
 
-         public abstract bool LiftPinIsDown { get; }
 
-         public abstract bool LiftPinIsUp { get; }
 
-         public abstract bool IsVAC { get; }
 
-         public abstract bool IsWaterFlowOk { get; }
 
-         public abstract bool IsWLK { get; }
 
-         public abstract bool IsRFGInterlockOn { get; }
 
-         public abstract bool PMLidClosed { get; }
 
-         public abstract bool TurboPumpInterlock { get; }
 
-         public abstract bool SourceRFFanInterlock { get; }
 
-         public abstract bool SlitDoorClosed { get; } //PM slite door closed
 
-         #endregion
 
-         #region AI AO
 
-         //AI AO
 
-         public abstract double ProcessLowPressure { get; }
 
-         public abstract double ProcessHighPressure { get; }
 
-         public abstract double ProcessPressure { get; }
 
-         public abstract double ChamberPressure { get; }
 
-         public abstract double ForelinePressure { get; }
 
-         public abstract double TargetPressure { get; }
 
-         public abstract double ESCHePressure { get; }
 
-         public abstract int ESCOutputVoltage { get; }
 
-         public abstract double ESCPositiveOutputCurrent { get; }//R+
 
-         public abstract double ESCNegativeOutputCurrent { get; }//R-
 
-         public abstract bool IsHVOn { get; }
 
-         public abstract float CoolantInletTempFB { get; }
 
-         public abstract float CoolantOutletTempFB { get; }
 
-         public abstract bool ChillerIsRunning { get; }
 
-         public abstract float ReflectPower { get; }
 
-         public abstract float BiasReflectPower { get; }
 
-         #endregion
 
-         public abstract bool BackSideHeOutOfRange { get; }
 
-         public new ModuleName Module;
 
-         public abstract MovementPosition LiftPinPosition { get; }
 
-         public abstract bool CheckAtm();
 
-         public abstract bool CheckSlitDoorOpen();
 
-         public abstract bool CheckSlitDoorClose();
 
-         public abstract bool CheckLiftUp();
 
-         public abstract bool CheckLiftDown();
 
-         public abstract double TotalGasSetpoint { get; }
 
-         public abstract bool HasGasOutOfRange { get; }
 
-         public abstract bool PendulumValveIsOpen();
 
-         public double TMPressure { get { return Singleton<RouteManager>.Instance.TM.TMPressure; } }
 
-         public bool IsTMATM { get { return Singleton<RouteManager>.Instance.TM.IsTMATM; } }
 
-         public bool IsTMVAC { get { return Singleton<RouteManager>.Instance.TM.IsTMVac; } }
 
-         // EndPoint 
 
-         private readonly JetEPDBase _epdClient;
 
-         public List<string> EPDCfgList => _epdClient?.CFGFileList;
 
-         public bool EPDCaptured => _epdClient.Captured;
 
-         public bool EPDConnected => _epdClient.IsEPDConnected;
 
-         public JetVenusSEPMBase(ModuleName module) : base(module.ToString(), module.ToString(), module.ToString(), module.ToString()) 
 
-         {
 
-             Module = module;
 
-             _epdClient = DEVICE.GetDevice<JetEPDBase>($"{Module}.{VenusDevice.EndPoint}");
 
-             DATA.Subscribe($"{Name}.ForelinePressure", () => ForelinePressure);
 
-             DATA.Subscribe($"{Name}.ProcessHighPressure", () => ProcessHighPressure);
 
-             DATA.Subscribe($"{Name}.ProcessLowPressure", () => ProcessLowPressure);
 
-             DATA.Subscribe($"{Name}.ESCHePressure", () => ESCHePressure);
 
-             DATA.Subscribe($"{Name}.IsATM", () => IsATM);
 
-             DATA.Subscribe($"{Name}.IsVAC", () => IsVAC);
 
-             DATA.Subscribe($"{Name}.LiftPinIsUp", () => LiftPinIsUp);
 
-             DATA.Subscribe($"{Name}.LiftPinIsDown", () => LiftPinIsDown);
 
-             DATA.Subscribe($"{Name}.PumpIsRunning", () => IsPumpRunning);
 
-             DATA.Subscribe($"{Name}.TurboPumpIsRunning", () => IsTurboPumpRunning);
 
-             DATA.Subscribe($"{Name}.IsSlitDoorClosed", () => IsSlitDoorClosed);
 
-             DATA.Subscribe($"{Name}.IsLidClosed", () => IsLidClosed);
 
-             DATA.Subscribe($"{Name}.TurboPumpRotationalSpeed", () => TurboPumpSpeed);
 
-             DATA.Subscribe($"{Name}.IsWaterFlowOk", () => IsWaterFlowOk);
 
-             DATA.Subscribe($"{Name}.IsWLK", () => IsWLK);
 
-             DATA.Subscribe($"{Name}.IsCDA_OK", () => IsCDA_OK);
 
-             DATA.Subscribe($"{Name}.SourceRFFanInterlock", () => SourceRFFanInterlock);
 
-             DATA.Subscribe($"{Name}.IsTurboPumpInterlock", () => TurboPumpInterlock);
 
-             DATA.Subscribe($"{Name}.GetPVPosition", () => GetPVPosition());
 
-             DATA.Subscribe($"{Name}.ESCHV.Temp", () => CoolantOutletTempFB);
 
-             DATA.Subscribe($"{Name}.Chiller.Temp", () => CoolantInletTempFB);
 
-             DATA.Subscribe($"{Name}.Chiller.IsOn", () => ChillerIsRunning);
 
-             DATA.Subscribe($"{Name}.IsTurboPumpAtSpeed", () => IsTurboPumpAtSpeed);
 
-             DATA.Subscribe($"{Name}.EPDCfgList", () => EPDCfgList);
 
-             OP.Subscribe($"{Module}.SetLiftPin", (cmd, args) => {
 
-                 if ((bool)args[0] == true)
 
-                 {
 
-                     return SetLiftPin(MovementPosition.Up, out _);
 
-                 }
 
-                 else
 
-                 {
 
-                     return SetLiftPin(MovementPosition.Down, out _);
 
-                 }
 
-             });
 
-             OP.Subscribe($"{Module}.SetSRf", (cmd, args) =>
 
-             {
 
-                 var ison = (bool)args[1];
 
-                 if (ison == true)
 
-                 {
 
-                     GeneratorPowerOn(true);
 
-                     GeneratorSetpower((float)args[0]);
 
-                 }
 
-                 else
 
-                 {
 
-                     GeneratorPowerOn(false);
 
-                 }
 
-                 return true;
 
-             });
 
-             OP.Subscribe($"{Module}.SetBRf", (cmd, args) => {
 
-                 var ison = (bool)args[1];
 
-                 if (ison == true)
 
-                 {
 
-                     GeneratorBiasPowerOn(true);
 
-                     GeneratorBiasSetpower((float)args[0]);
 
-                 }
 
-                 else
 
-                 {
 
-                     GeneratorBiasPowerOn(false);
 
-                 }
 
-                 return true;
 
-             });
 
-             OP.Subscribe($"{Module}.SetESCHVIsOn", (cmd, args) => {
 
-                 OnOffSetESCHV((bool)args[0]);
 
-                 return true;
 
-             });
 
-             OP.Subscribe($"{Module}.SetESCHV", (cmd, args) => {
 
-                 SetESCClampVoltage((int)args[0]);
 
-                 return true;
 
-             });
 
-             OP.Subscribe($"{Module}.SetPVPostion", (cmd, args) => {
 
-                 SetPVPostion((int)args[0]);
 
-                 return true;
 
-             });
 
-             OP.Subscribe($"{Module}.SetPVPressure", (cmd, args) => {
 
-                 SetPVPressure((int)args[0]);
 
-                 return true;
 
-             });
 
-             OP.Subscribe($"{Module}.ClosePump", (cmd, args) => {
 
-                 TurnDryPump(false);
 
-                 return true;
 
-             });
 
-             OP.Subscribe($"{Module}.ControlValve", (cmd, args) => {
 
-                 OpenValve((ValveType)((int)args[0]), (bool)args[1]);
 
-                 return true;
 
-             });
 
-             OP.Subscribe($"{Module}.TurnPendulumValve", (cmd, args) => {
 
-                 TurnPendulumValve((bool)args[0]);
 
-                 return true;
 
-             });
 
-             OP.Subscribe($"{Module}.HeatChiller", (cmd, args) => {
 
-                 var chillerType = (ChillerType)Enum.Parse(typeof(ChillerType), args[0].ToString());
 
-                 HeatChiller(chillerType, (float)args[1], (float)args[2]);
 
-                 return true;
 
-             });
 
-             OP.Subscribe($"{Module}.OnOffChiller", (cmd, args) => {
 
-                 var chillerType = (ChillerType)Enum.Parse(typeof(ChillerType), args[0].ToString());
 
-                 OnOffChiller(chillerType, (bool)args[1]);
 
-                 return true;
 
-             });
 
-             OP.Subscribe($"{Module}.WallChiller", (cmd, args) => {
 
-                 float value;
 
-                 float.TryParse(args[0].ToString(), out value);
 
-                 SetWallTCTemperature(value);
 
-                 return true;
 
-             });
 
-             OP.Subscribe($"{Module}.SetBacksideHeFlow", (cmd, args) => {
 
-                 double value;
 
-                 double.TryParse(args[0].ToString(), out value);
 
-                 SetBacksideHeFlow(value);
 
-                 return true;
 
-             });
 
-             OP.Subscribe($"{Module}.SetBacksideHePressure", (cmd, args) =>
 
-             {
 
-                 float value;
 
-                 float.TryParse(args[0].ToString(), out value);
 
-                 SetBacksideHePressure(value);
 
-                 return true;
 
-             });
 
-             OP.Subscribe($"{Module}.EndPoint.SearchCfg", (cmd, args) =>
 
-             {
 
-                 _epdClient?.QueryConfigList();
 
-                 return true;
 
-             });
 
-         }
 
-         public virtual void Monitor()
 
-         {
 
-         }
 
-         public virtual bool Initialize()
 
-         {
 
-             return true;
 
-         }
 
-         public virtual void Terminate()
 
-         {
 
-         }
 
-         public virtual void Reset()
 
-         {
 
-         }
 
-         public abstract void CloseValves();
 
-         public abstract void TurnDryPump(bool on);
 
-         public abstract void TurnTurboPump(bool on);
 
-         public abstract void OpenValve(ValveType vlvType, bool on);
 
-         public abstract bool OnOffSetESCHV(bool on);
 
-         public abstract bool SetWallTCTemperature(float value);
 
-         protected abstract void CheckPermanentInterlock();
 
-         public abstract void CheckIdleInterlock();
 
-         public abstract void Home();
 
-         public abstract bool SetLiftPin(MovementPosition dirt, out string reason);
 
-         public abstract bool FlowGas(int gasNum, double val);
 
-         public abstract bool StopGas(int gasNum);
 
-         public abstract bool FlowN2(double val);
 
-         public abstract bool StopN2();
 
-         public abstract void StopAllGases();
 
-         public abstract bool TurnPendulumValve(bool on);
 
-         public abstract bool SetPVPressure(int pressure);
 
-         public abstract bool SetPVPostion(int position);
 
-         public abstract int GetPVPosition();
 
-         public abstract void HeatChiller(ChillerType chillerType, double value, double offset);
 
-         public abstract void OnOffChiller(ChillerType chillerType, bool onoff);
 
-         public abstract bool CheckChillerStatus();
 
-         public abstract void SetGeneratorCommunicationMode(int mode);
 
-         public abstract bool GeneratorPowerOn(bool on);
 
-         public abstract bool GeneratorSetpower(float val);
 
-         public abstract bool GeneratorBiasPowerOn(bool on);
 
-         public abstract bool GeneratorBiasSetpower(float val);
 
-         public abstract bool GeneratorBiasSetMatchMode(bool val);
 
-         public abstract bool SetMatchPosition(float c1, float c2);
 
-         public abstract bool SetBiasMatchPosition(float c1, float c2);
 
-         public abstract bool SetBiasPulseMode(bool on);
 
-         public abstract bool SetBiasPulseRateFreq(int nFreq);
 
-         public abstract bool SetDiasPulseDutyCycle(int percentage);
 
-         public abstract bool SetESCClampVoltage(int nVoltage);
 
-         public abstract bool CheckGeneratorAndHVInterlock(VenusDevice device);
 
-         #region EndPoint
 
-         public void EPDRecipeStart(string recipe)
 
-         {
 
-             _epdClient.RecipeStart(recipe);
 
-         }
 
-         public void EPDRecipeStop()
 
-         {
 
-             _epdClient.RecipeStop();
 
-         }
 
-         public void EPDStepStart(string cfgName, int step)
 
-         {
 
-             _epdClient.StepStart(cfgName, step);
 
-         }
 
-         public void EPDStepStop()
 
-         {
 
-             _epdClient.StepStop();
 
-         }
 
-         #endregion
 
-         public abstract void SetBacksideHeFlow(double flow);
 
-         public abstract bool SetBacksideHePressure(float mTorr);
 
-         public abstract bool SetBacksideHeThreshold(int nMin, int nMax);
 
-     }
 
- }
 
 
  |