Pārlūkot izejas kodu

兼容新旧 Endpoint, 未完成

sangwq 1 gadu atpakaļ
vecāks
revīzija
7b98756c26

+ 1 - 3
Venus/Venus_RT/App.config

@@ -62,9 +62,7 @@
 		</services>
 
 		<client>
-			<!--<endpoint address="net.tcp://localhost:9002/PMService" behaviorConfiguration="EndpointBehavior" binding="netTcpBinding" bindingConfiguration="Aitex_netTcpBinding" contract="ClusterInterface.IPmService" name="Client_IPECVDService" />
-			<endpoint address="net.tcp://localhost:9004/PMService" behaviorConfiguration="EndpointBehavior" binding="netTcpBinding" bindingConfiguration="Aitex_netTcpBinding" contract="ClusterInterface.IPmService" name="Client_IIBEService" />
-			<endpoint address="net.tcp://localhost:9006/PMService" behaviorConfiguration="EndpointBehavior" binding="netTcpBinding" bindingConfiguration="Aitex_netTcpBinding" contract="ClusterInterface.IPmService" name="Client_IICPService" />-->
+			
 			<endpoint address="net.tcp://192.168.10.20:5771/EPDService" behaviorConfiguration="EndpointBehavior" binding="netTcpBinding" bindingConfiguration="Aitex_netTcpBinding" contract="EPInterface.IEPDService" name="Client_IEPDService"/>
 			<endpoint address="net.tcp://192.168.10.20:5773/EPDCallbackService" behaviorConfiguration="EndpointBehavior" binding="netTcpBinding" bindingConfiguration="Aitex_netTcpBinding" contract="EPInterface.IEPDCallbackService" name="Client_IEPDCallbackService" />
 		</client>

+ 2 - 1
Venus/Venus_RT/Config/System.sccfg

@@ -662,7 +662,7 @@
 			<config default="true" name="IsEnabled" nameView="Is Enabled" description="IsEnabled" max="0" min="0" paramter="" tag="" unit="" type="Bool" />
 			<config default="0" name="ChannelNumber" nameView="EPD Channel Number" description="channel number" max="32" min="0" paramter="" tag="" unit="" type="Integer" />
 			<config default="127.0.0.1:1102" name="IPAddress" nameView="IP Address" description="EPD IP、端口设置;default 10.0.0.100:13000" max="" min="" paramter="" tag="" unit="" type="String" />
-
+			<config default="0" name="EPDType" nameView="EPD Type" description="EPD type, 0) by socket, 1) by WCF" max="32" min="0" paramter="" tag="" unit="" type="Integer" />
 		</configs>
 
 	</configs>
@@ -1111,6 +1111,7 @@
 			<config default="true" name="IsEnabled" nameView="Is Enabled" description="IsEnabled" max="0" min="0" paramter="" tag="" unit="" type="Bool" />
 			<config default="0" name="ChannelNumber" nameView="EPD Channel Number"  description="channel number" max="32" min="0" paramter="" tag="" unit="" type="Integer" />
 			<config default="127.0.0.1:1102" name="IPAddress" nameView="IP Address" description="EPD IP、端口设置;default 10.0.0.100:13000" max="" min="" paramter="" tag="" unit="" type="String" />
+			<config default="0" name="EPDType" nameView="EPD Type" description="EPD type, 0) by socket, 1) by WCF" max="32" min="0" paramter="" tag="" unit="" type="Integer" />
 		</configs>
 
 	</configs>

+ 10 - 1
Venus/Venus_RT/Devices/DeviceManager.cs

@@ -5,6 +5,7 @@ using Aitex.Core.Common;
 using Aitex.Core.RT.Device;
 using Aitex.Core.RT.OperationCenter;
 using Aitex.Core.RT.SCCore;
+using Aitex.RT.Device.Custom;
 using MECF.Framework.Common.Equipment;
 using Venus_RT.Modules;
 using Venus_RT.Devices;
@@ -153,7 +154,15 @@ namespace Venus_RT.Instances
             AddCustomModuleDevice(new AdixenTurboPump(mod));
             AddCustomModuleDevice(new PendulumValve(mod));
 
-            AddCustomModuleDevice(new EPDClient(mod));
+            if(SC.GetValue<int>($"{mod}.EPD.EPDType") == 0)
+            {
+                AddCustomModuleDevice(new EPDClient(mod));
+            }
+            else
+            {
+                AddCustomModuleDevice(new EPDDevice (mod));
+            }
+            
             //AddCustomDevice(new JetPM(mod));
 
             switch (jetChamber)

+ 20 - 23
Venus/Venus_RT/Devices/EPD/EPDClient.cs

@@ -16,14 +16,8 @@ using Venus_RT.Devices;
 namespace Venus_RT.Devices.EPD
 {
     
-    class EPDClient : JetEPDBase
+    public class EPDClient : JetEPDBase
     {
-        public enum EDPStatus
-        {
-            Idle,
-            Running,
-            Error,
-        }
 
         private EPDSocketClient _socketClient;
         private string _ip;
@@ -33,13 +27,16 @@ namespace Venus_RT.Devices.EPD
         private bool _isHeartBeatReceived;
         private readonly R_TRIG _epdIdle = new R_TRIG();
 
-        public bool Captured { get; private set; }
+        private bool _captured;
+        public override bool Captured { get { return _captured; }}
 
-        public bool IsEPDConnected { get; private set; }
+        private bool _connected = false;
+        public override bool IsEPDConnected { get { return _connected; } }
 
-        public EDPStatus Status { get; private set; }
-
-        public List<string> CFGFileList { get; private set; }
+        private EDPStatus _status;
+        public override EDPStatus Status { get { return _status; } }
+        private List<string> _cfgFileList;
+        public override List<string> CFGFileList { get { return _cfgFileList; }  }
 
         public new string Module { get; set; }
         public new string Name { get; set; }
@@ -60,8 +57,8 @@ namespace Venus_RT.Devices.EPD
                 _ip = ipaddressValue[0];
                 _port = System.Convert.ToInt32(ipaddressValue[1]);
             }
-           
-            _channel = 0;
+
+            _channel = SC.GetValue<int>($"{Module}.{Name}.ChannelNumber");
 
             _socketClient = new EPDSocketClient();
             _socketClient.OnConnect += OnConnect;
@@ -92,7 +89,7 @@ namespace Venus_RT.Devices.EPD
 
         public override void Terminate()
         {
-            Status = EDPStatus.Idle;
+            _status = EDPStatus.Idle;
             _socketClient.DisconnectEPD();
             _socketClient.Disconnect();
         }
@@ -100,19 +97,19 @@ namespace Venus_RT.Devices.EPD
         public override void RecipeStart(string recipe)
         {
             _socketClient.RecipeStart(_channel, "");
-            Status = EDPStatus.Running;
+            _status = EDPStatus.Running;
         }
 
         public override void RecipeStop()
         {
             _socketClient.RecipeStop(_channel);
-            Status = EDPStatus.Idle;
+            _status = EDPStatus.Idle;
         }
 
         public override void StepStart(string cfgName, int Index)
         {
             _socketClient.Start((byte)_channel, cfgName);
-            Status = EDPStatus.Running;
+            _status = EDPStatus.Running;
         }
 
         public override void StepStop()
@@ -192,7 +189,7 @@ namespace Venus_RT.Devices.EPD
                     break;
                 case EPDCommand.QueryCfgList:
                     if (obj is List<string>)
-                        CFGFileList = (List<string>)obj;
+                        _cfgFileList = (List<string>)obj;
                     break;
                 case EPDCommand.QueryState:
                     if (obj is ushort state && EPDDefine.StateMap.ContainsKey(state))
@@ -202,7 +199,7 @@ namespace Venus_RT.Devices.EPD
                     EPDVersion = obj.ToString();
                     break;
                 case EPDCommand.Connect:
-                    IsEPDConnected = true;
+                    _connected = true;
                     break;
                 case EPDCommand.HeartBeat:
                     _isHeartBeatReceived = true;
@@ -228,18 +225,18 @@ namespace Venus_RT.Devices.EPD
                 case EPDCommand.GetRecipesList:
                     if (obj is List<string> objs)
                     {
-                        CFGFileList = objs.GetRange(3, objs.Count - 3);
+                        _cfgFileList = objs.GetRange(3, objs.Count - 3);
                         SensorStatus = objs[0];
                     }
                     break;
                 case EPDCommand.Event:
                     var lst = obj as List<object>;
                     if (lst[0] is int type && type == 7)
-                        Captured = true;
+                        _captured = true;
                     break;
                 case EPDCommand.AsciiEvent:
                     if (obj.ToString() == "ENDPOINT")
-                        Captured = true;
+                        _captured = true;
                     break;
                 case EPDCommand.QueryChannelCount:
                 case EPDCommand.QueryChannalNames:

+ 17 - 24
Venus/Venus_RT/Devices/EPDs/EPDDevice.cs

@@ -16,6 +16,8 @@ using EPInterface;
 using EPInterface.Data;
 using EPInterface.Datas;
 using Venus_RT.Devices;
+using Venus_Core;
+using MECF.Framework.Common.Equipment;
 
 namespace Aitex.RT.Device.Custom
 {
@@ -33,42 +35,35 @@ namespace Aitex.RT.Device.Custom
 
         private object _lockerTrigger = new object();
 
+        private int _connectionCounter = 0;
+
         private bool _isEnd = false;
+        public override bool Captured { get { return _isEnd; } }
 
-        public bool IsEnd
-        {
-            get
-            {
-                return _isEnd;
-            }
-        }
+        public override bool IsEPDConnected { get { return _triggerConnected.M; } }
 
-        public bool IsConnected
-        {
-            get
-            {
-                return _triggerConnected.M;
-            }
-        }
+        public override EDPStatus Status { get; }
 
-        private int _connectionCounter = 0;
+        public override List<string> CFGFileList { get; }
 
-        public EPDDevice(string module, string name)// :
+        public EPDDevice(ModuleName mod)// :
      //       base(module, name, name, name)
         {
+            Name = VenusDevice.EndPoint.ToString();
+            Module = mod.ToString();
         }
 
         public override bool Initialize()
         {
             _channel = SC.GetValue<int>($"{Module}.{Name}.ChannelNumber");
 
-            DATA.Subscribe($"{Module}.{Name}.IsConnected", ()=> IsConnected);
+            DATA.Subscribe($"{Module}.{Name}.IsConnected", ()=> IsEPDConnected);
             DATA.Subscribe($"{Module}.{Name}.CurrentChannel", () => _channel);
             DATA.Subscribe($"{Module}.{Name}.ChannelStatus", () => _channelStatus);
 
             OP.Subscribe($"{Module}.{Name}.SetConfig", (out string reason, int time, object[] args) => {
  
-                if (!IsConnected)
+                if (!IsEPDConnected)
                 {
                     LOG.Write(eEvent.WARN_ENDPOINT, Module, $"{Module} {Name} not connected, can not set config");
                     reason = $"{Module} {Name} not connected, can not set config";
@@ -93,7 +88,7 @@ namespace Aitex.RT.Device.Custom
 
         public override void RecipeStart(string recipeName)
         {
-            if (!IsConnected)
+            if (!IsEPDConnected)
             {
                 LOG.Write( eEvent.ERR_ENDPOINT, Module, "EPD not connected, call recipe start ignored");
                 return;
@@ -105,7 +100,7 @@ namespace Aitex.RT.Device.Custom
 
         public override void RecipeStop()
         {
-            if (!IsConnected)
+            if (!IsEPDConnected)
             {
                 LOG.Write(eEvent.ERR_ENDPOINT, Module, "EPD not connected, call recipe start ignored");
                 return;
@@ -126,7 +121,7 @@ namespace Aitex.RT.Device.Custom
          */
         public override  void StepStart(string config, int index)
         {
-            if (!IsConnected)
+            if (!IsEPDConnected)
             {
                 LOG.Write(eEvent.ERR_ENDPOINT, Module, "EPD not connected, call step start ignored");
                 return;
@@ -270,7 +265,7 @@ namespace Aitex.RT.Device.Custom
 
         public override void StepStop()
         {
-            if (!IsConnected)
+            if (!IsEPDConnected)
             {
                 LOG.Write(eEvent.ERR_ENDPOINT, Module, "EPD not connected, call step stop ignored");
                 return;
@@ -373,8 +368,6 @@ namespace Aitex.RT.Device.Custom
                     _triggerConnected.RST = true;
                     _triggerNotConnected.RST = true;
                 }
-
-
             }
         }
     }

+ 14 - 0
Venus/Venus_RT/Devices/JetEPDBase.cs

@@ -7,8 +7,22 @@ using Venus_Core;
 
 namespace Venus_RT.Devices
 {
+    public enum EDPStatus
+    {
+        Idle,
+        Running,
+        Error,
+    }
+
     abstract public class JetEPDBase : BaseDevice, IDevice
     {
+        public abstract bool Captured { get; }
+
+        public abstract bool IsEPDConnected { get;  }
+
+        public abstract EDPStatus Status { get;  }
+
+        public abstract List<string> CFGFileList { get; }
         public abstract bool Initialize();
         public abstract void Monitor();
         public abstract void Terminate();

+ 0 - 32
Venus/Venus_RT/Devices/JetKepler2300PM.cs

@@ -96,15 +96,9 @@ namespace Venus_RT.Devices
 
         private readonly IoMfc _heMfc;
 
-        // EndPoint 
-        private readonly EPDClient _epdClient;
 
         private readonly double _foreline_interlock_pressure = 750;
 
-        public override List<string> EPDCfgList => _epdClient?.CFGFileList;
-        public override bool EPDCaptured => _epdClient.Captured;
-        public override bool EPDConnected => _epdClient.IsEPDConnected;
-
 
         // 盖子的状态
         public override bool IsLidClosed => _Lid.OFFFeedback;
@@ -402,7 +396,6 @@ namespace Venus_RT.Devices
                 _BiasMatch = DEVICE.GetDevice<AdTecMatch>($"{Module}.{VenusDevice.BiasMatch}");
             }
 
-            _epdClient = DEVICE.GetDevice<EPDClient>($"{Module}.{VenusDevice.EndPoint}");
             _foreline_interlock_pressure = SC.GetValue<double>($"{Module}.ForelineInterlockPressure");
 
         }
@@ -922,31 +915,6 @@ namespace Venus_RT.Devices
             return true;
         }
 
-
-
-        #region EndPoint
-        public override void EPDRecipeStart(string recipe)
-        {
-            _epdClient.RecipeStart(recipe);
-        }
-
-        public override void EPDRecipeStop()
-        {
-            _epdClient.RecipeStop();
-        }
-
-        public override void EPDStepStart(string cfgName, int step)
-        {
-            _epdClient.StepStart(cfgName, step);
-        }
-
-        public override void EPDStepStop()
-        {
-            _epdClient.StepStop();
-        }
-
-        #endregion
-
         public override void SetBacksideHeFlow(double flow)
         {
             if (_backsideHe == null) return;

+ 25 - 17
Venus/Venus_RT/Devices/JetPMBase.cs

@@ -10,9 +10,6 @@ namespace Venus_RT.Devices
 {
     abstract class JetPMBase : BaseDevice, IDevice
     {
-        public abstract List<string> EPDCfgList { get; }
-        public abstract bool EPDCaptured { get; }
-        public abstract bool EPDConnected { get;}
         // 盖子的状态
         public abstract bool IsLidClosed { get; }
         public abstract bool IsLidLoadlockClosed { get; }
@@ -107,11 +104,18 @@ namespace Venus_RT.Devices
         public abstract bool PendulumValveIsOpen();
 
         public abstract double LoadlockPressure { get; }
-        
+
+        // EndPoint 
+        private readonly JetEPDBase _epdClient;
+        public  List<string> EPDCfgList => _epdClient?.CFGFileList;
+        public  bool EPDCaptured => _epdClient.Captured;
+        public  bool EPDConnected => _epdClient.IsEPDConnected;
+
         public JetPMBase(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);
@@ -128,11 +132,8 @@ namespace Venus_RT.Devices
             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);
@@ -142,13 +143,8 @@ namespace Venus_RT.Devices
             DATA.Subscribe($"{Name}.IsATMLoadlock", () => IsATMLoadlock);
             DATA.Subscribe($"{Name}.IsVACLoadlock", () => IsVACLoadLock);
 
-
-
-
-
             DATA.Subscribe($"{Name}.GetPVPosition", () => GetPVPosition());
 
-       
             DATA.Subscribe($"{Name}.ESCHV.Temp",      () => CoolantOutletTempFB);
             DATA.Subscribe($"{Name}.Chiller.Temp", () => CoolantInletTempFB);
 
@@ -374,13 +370,25 @@ namespace Venus_RT.Devices
 
 
         #region EndPoint
-        public  abstract void EPDRecipeStart(string recipe);
+        public void EPDRecipeStart(string recipe)
+        {
+            _epdClient.RecipeStart(recipe);
+        }
 
-        public abstract void EPDRecipeStop();
+        public void EPDRecipeStop()
+        {
+            _epdClient.RecipeStop();
+        }
 
-        public abstract void EPDStepStart(string cfgName, int step);
+        public void EPDStepStart(string cfgName, int step)
+        {
+            _epdClient.StepStart(cfgName, step);
+        }
 
-        public abstract void EPDStepStop();
+        public void EPDStepStop()
+        {
+            _epdClient.StepStop();
+        }
 
         #endregion
 

+ 1 - 34
Venus/Venus_RT/Devices/JetVenusPM.cs

@@ -100,16 +100,8 @@ namespace Venus_RT.Devices
 
         private readonly IoMfc _heMfc;
 
-        // EndPoint 
-        private readonly EPDClient _epdClient;
-
         private readonly double _foreline_interlock_pressure = 750;
 
-        public override List<string> EPDCfgList => _epdClient?.CFGFileList;
-        public override bool EPDCaptured => _epdClient.Captured;
-        public override bool EPDConnected => _epdClient.IsEPDConnected;
-
-
         // 盖子的状态
         public override bool IsLidClosed => _Lid.OFFFeedback;
         public override bool IsLidLoadlockClosed => _LidLoadlock.OFFFeedback;
@@ -410,7 +402,7 @@ namespace Venus_RT.Devices
                 _BiasMatch = DEVICE.GetDevice<AdTecMatch>($"{Module}.{VenusDevice.BiasMatch}");
             }
 
-            _epdClient = DEVICE.GetDevice<EPDClient>($"{Module}.{VenusDevice.EndPoint}");
+            
             _foreline_interlock_pressure = SC.GetValue<double>($"{Module}.ForelineInterlockPressure");
 
         }
@@ -908,31 +900,6 @@ namespace Venus_RT.Devices
             return true;
         }
 
-
-
-        #region EndPoint
-        public override void EPDRecipeStart(string recipe)
-        {
-            _epdClient.RecipeStart(recipe);
-        }
-
-        public override void EPDRecipeStop()
-        {
-            _epdClient.RecipeStop();
-        }
-
-        public override void EPDStepStart(string cfgName, int step)
-        {
-            _epdClient.StepStart(cfgName, step);
-        }
-
-        public override void EPDStepStop()
-        {
-            _epdClient.StepStop();
-        }
-
-        #endregion
-
         public override void SetBacksideHeFlow(double flow)
         {
             if (_backsideHe == null) return;