Browse Source

RF Match.

sangwq 2 years ago
parent
commit
75710d35d8

+ 4 - 4
Venus/Venus_RT/Devices/AdTecRF.cs

@@ -191,9 +191,9 @@ namespace Venus_RT.Devices
 
         // --------------------------Constructor-----------------------
         //
-        public AdTecGenerator(ModuleName mod) : base(mod.ToString(), VenusDevice.Rf.ToString())
+        public AdTecGenerator(ModuleName mod, VenusDevice device) : base(mod.ToString(), device.ToString())
         {
-            var portNum = SC.GetStringValue($"{mod}.Rf.Port");
+            var portNum = SC.GetStringValue(device == VenusDevice.Rf ? $"{mod}.Rf.Port" : $"{mod}.BiasRf.Port");
             this.Status = GeneratorStatus.Unknown;
 
             _serial = new AsyncSerialPort(portNum, 9600, 8, System.IO.Ports.Parity.None, System.IO.Ports.StopBits.One, "\r\r");
@@ -687,9 +687,9 @@ namespace Venus_RT.Devices
 
         // --------------------------Constructor-----------------------
         //
-        public AdTecMatch(ModuleName mod) : base(mod.ToString(), VenusDevice.Match.ToString())
+        public AdTecMatch(ModuleName mod, VenusDevice device) : base(mod.ToString(), device.ToString())
         {
-            var portNum = SC.GetStringValue($"{mod}.match.Port");
+            var portNum = SC.GetStringValue(device == VenusDevice.Match ? $"{mod}.match.Port" : $"{mod}.BiasMatch.Port");
 
             _serial = new AsyncSerialPort(portNum, 9600, 8);
 

+ 20 - 6
Venus/Venus_RT/Devices/DeviceManager.cs

@@ -49,15 +49,22 @@ namespace Venus_RT.Instances
             if (SC.GetValue<int>($"{mod}.Rf.CommunicationType") == (int)CommunicationType.RS232 &&
                 SC.GetValue<int>($"{mod}.Rf.MFG") == (int)GeneratorMFG.AdTec)
             {
-                AddCustomModuleDevice(new AdTecGenerator(mod));
+                AddCustomModuleDevice(new AdTecGenerator(mod, Venus_Core.VenusDevice.Rf));
             }
 
-            if (SC.GetValue<bool>($"{mod}.BiasRf.EnableBiasRF") &&
-                SC.GetValue<int>($"{mod}.BiasRf.CommunicationType") == (int)CommunicationType.Ethernet &&
-                SC.GetValue<int>($"{mod}.BiasRf.MFG") == (int)GeneratorMFG.Comet)
+            if (SC.GetValue<bool>($"{mod}.BiasRf.EnableBiasRF"))
             {
-                AddCustomModuleDevice(new CometRF(mod, SC.GetStringValue($"{mod}.BiasRf.IPAddress")));
+                if(SC.GetValue<int>($"{mod}.BiasRf.CommunicationType") == (int)CommunicationType.Ethernet &&
+                SC.GetValue<int>($"{mod}.BiasRf.MFG") == (int)GeneratorMFG.Comet)
+                {
+                    AddCustomModuleDevice(new CometRF(mod, SC.GetStringValue($"{mod}.BiasRf.IPAddress")));
+                }
+                else if(SC.GetValue<int>($"{mod}.BiasRf.MFG") == (int)GeneratorMFG.AdTec)
+                {
+                    AddCustomModuleDevice(new AdTecGenerator(mod, Venus_Core.VenusDevice.BiasRf));
+                }
             }
+                
 
             if (SC.GetValue<bool>($"{mod}.Chiller.EnableChiller") &&
                 SC.GetValue<int>($"{mod}.Chiller.CommunicationType") == (int)CommunicationType.RS232)
@@ -76,7 +83,14 @@ namespace Venus_RT.Instances
                 SC.GetValue<int>($"{mod}.match.CommunicationType") == (int)CommunicationType.RS232 &&
                 SC.GetValue<int>($"{mod}.match.MFG") == (int)MatchMFG.AdTec)
             {
-                AddCustomModuleDevice(new AdTecMatch(mod));
+                AddCustomModuleDevice(new AdTecMatch(mod, Venus_Core.VenusDevice.Match));
+            }
+
+            if (SC.GetValue<bool>($"{mod}.BiasMatch.EnableBiasMatch") &&
+                SC.GetValue<int>($"{mod}.BiasMatch.CommunicationType") == (int)CommunicationType.RS232 &&
+                SC.GetValue<int>($"{mod}.BiasMatch.MFG") == (int)MatchMFG.AdTec)
+            {
+                AddCustomModuleDevice(new AdTecMatch(mod, Venus_Core.VenusDevice.BiasMatch));
             }
 
             if (SC.GetValue<int>($"{mod}.DryPump.CommunicationType") == (int)CommunicationType.RS232)

+ 1 - 1
Venus/Venus_RT/Devices/IODevices/IoMfc.cs

@@ -557,7 +557,7 @@ namespace Venus_RT.Devices.IODevices
 
         private void Ramping()
         {
-            if (_bMfcAlarm)
+            if (_bRamping)
             {
                 if (rampTimer.IsTimeout() || rampTime == 0)
                 {

+ 21 - 6
Venus/Venus_RT/Devices/JetPM.cs

@@ -112,6 +112,7 @@ namespace Venus_RT.Devices
         private readonly RfPowerBase _Generator;//srf=>AdTecGenerator
         private readonly RfPowerBase _GeneratorBias;//brf=>CometRF
         private readonly RfMatchBase _Match;
+        private readonly RfMatchBase _BiasMatch;
 
         private readonly IoSignalTower _SignalTower;
 
@@ -378,11 +379,17 @@ namespace Venus_RT.Devices
             }
 
             // Ethernet Comet Generator Bias
-            if (SC.GetValue<bool>($"{mod}.BiasRf.EnableBiasRF") &&
-                SC.GetValue<int>($"{mod}.BiasRf.CommunicationType") == (int)CommunicationType.Ethernet &&
-                SC.GetValue<int>($"{mod}.BiasRf.MFG") == (int)GeneratorMFG.Comet)
+            if (SC.GetValue<bool>($"{mod}.BiasRf.EnableBiasRF"))
             {
-                _GeneratorBias = DEVICE.GetDevice<CometRF>($"{Module}.{VenusDevice.BiasRf}");
+                if (SC.GetValue<int>($"{mod}.BiasRf.CommunicationType") == (int)CommunicationType.Ethernet &&
+                    SC.GetValue<int>($"{mod}.BiasRf.MFG") == (int)GeneratorMFG.Comet)
+                {
+                    _GeneratorBias = DEVICE.GetDevice<CometRF>($"{Module}.{VenusDevice.BiasRf}");
+                }
+                else if (SC.GetValue<int>($"{mod}.BiasRf.MFG") == (int)GeneratorMFG.AdTec)
+                {
+                    _GeneratorBias = DEVICE.GetDevice<AdTecGenerator>($"{Module}.{VenusDevice.BiasRf}");
+                }
             }
 
             // RS232 AdTec match
@@ -392,6 +399,14 @@ namespace Venus_RT.Devices
                 _Match = DEVICE.GetDevice<AdTecMatch>($"{Module}.{VenusDevice.Match}");
             }
 
+            // Bias Match
+            if (SC.GetValue<bool>($"{mod}.BiasMatch.EnableBiasMatch") &&
+                SC.GetValue<int>($"{mod}.BiasMatch.CommunicationType") == (int)CommunicationType.RS232 &&
+                SC.GetValue<int>($"{mod}.BiasMatch.MFG") == (int)MatchMFG.AdTec)
+            {
+                _BiasMatch = DEVICE.GetDevice<AdTecMatch>($"{Module}.{VenusDevice.BiasMatch}");
+            }
+
             _epdClient = DEVICE.GetDevice<EPDClient>($"{Module}.{VenusDevice.EndPoint}");
 
             DATA.Subscribe($"{Name}.ForelinePressure", () => ForelinePressure);
@@ -845,9 +860,9 @@ namespace Venus_RT.Devices
 
         public bool SetBiasMatchPosition(float c1, float c2)
         {
-            if (_GeneratorBias == null) return false;
+            if (_BiasMatch == null) return false;
             string reason = string.Empty;
-            _GeneratorBias.SetMatchPosition(c1, c2, out reason);
+            _BiasMatch.SetMatchPosition(c1, c2, out reason);
             return true;
         }
 

+ 2 - 2
Venus/Venus_RT/Devices/PlasmaController.cs

@@ -78,8 +78,8 @@ namespace Venus_RT.Devices
         //
         public PlasmaController(ModuleName mod)
         {
-            _Generator = new AdTecGenerator(mod);
-            _Match = new AdTecMatch(mod);
+            _Generator = new AdTecGenerator(mod, Venus_Core.VenusDevice.Rf);
+            _Match = new AdTecMatch(mod, Venus_Core.VenusDevice.Match);
         }
 
         public bool Initialize()