浏览代码

合并代码

lixiang 2 年之前
父节点
当前提交
d56749cbf3

+ 83 - 5
Venus/Venus_MainPages/ViewModels/OverViewModel.cs

@@ -10,6 +10,7 @@ using System.Windows.Threading;
 using Venus_Core;
 using Venus_MainPages.Views;
 using System.Linq;
+using System.Threading;
 
 namespace Venus_MainPages.ViewModels
 {
@@ -59,6 +60,11 @@ namespace Venus_MainPages.ViewModels
         private float m_SRFFwdPowerSetpoint;
         private float m_BRFFwdPowerSetpoint;
 
+        private float m_SRFMatchC1;
+        private float m_SRFMatchC2;
+        private float m_BRFMatchC1;
+        private float m_BRFMatchC2;
+
 
 
 
@@ -358,7 +364,27 @@ namespace Venus_MainPages.ViewModels
             get { return m_HVIsOn; }
             set { SetProperty(ref m_HVIsOn, value); }
         }
-        
+        public float SRFMatchC1
+        {
+            get { return m_SRFMatchC1; }
+            set { SetProperty(ref m_SRFMatchC1, value); }
+        }
+        public float SRFMatchC2
+        {
+            get { return m_SRFMatchC2; }
+            set { SetProperty(ref m_SRFMatchC2, value); }
+        }
+
+        public float BRFMatchC1
+        {
+            get { return m_BRFMatchC1; }
+            set { SetProperty(ref m_BRFMatchC1, value); }
+        }
+        public float BRFMatchC2
+        {
+            get { return m_BRFMatchC2; }
+            set { SetProperty(ref m_BRFMatchC2, value); }
+        }
         #endregion
 
         #region 命令
@@ -436,7 +462,9 @@ namespace Venus_MainPages.ViewModels
         public DelegateCommand HVSetCommand =>
             _HVSetCommand ?? (_HVSetCommand = new DelegateCommand(OnHVSet));
 
-        
+        private DelegateCommand<object> _SetMatchModeCommand;
+        public DelegateCommand<object> SetMatchModeCommand =>
+            _SetMatchModeCommand ?? (_SetMatchModeCommand = new DelegateCommand<object>(OnSetMatchMode));
         #endregion
 
         #region 构造函数
@@ -607,12 +635,38 @@ namespace Venus_MainPages.ViewModels
 
         private void OnSetSRf()
         {
+            if (SRFIsOn == true)
+            {
+                InvokeClient.Instance.Service.DoOperation($"{ModuleName}.SetSRf", SRFFwdPowerSetpoint, false);
+
+            }
+            else
+            {
+                InvokeClient.Instance.Service.DoOperation($"{ModuleName}.{VenusDevice.Match}.{AITRfOperation.SetMatchPositionC1}", SRFMatchC1);
+                InvokeClient.Instance.Service.DoOperation($"{ModuleName}.{VenusDevice.Match}.{AITRfOperation.SetMatchPositionC2}", SRFMatchC2);
+                Thread.Sleep(100);
+                InvokeClient.Instance.Service.DoOperation($"{ModuleName}.SetSRf", SRFFwdPowerSetpoint, true);
+
+            }
+
+
 
-            InvokeClient.Instance.Service.DoOperation($"{ModuleName}.SetSRf", SRFFwdPowerSetpoint, !SRFIsOn);
         }
         private void OnSetBRf()
         {
-            InvokeClient.Instance.Service.DoOperation($"{ModuleName}.SetBRf", BRFFwdPowerSetpoint, !BRFIsOn);
+            if (BRFIsOn == true)
+            {
+                InvokeClient.Instance.Service.DoOperation($"{ModuleName}.SetBRf", BRFFwdPowerSetpoint, false);
+
+            }
+            else
+            {
+                InvokeClient.Instance.Service.DoOperation($"{ModuleName}.{VenusDevice.BiasMatch}.{AITRfOperation.SetMatchPositionC1}", BRFMatchC1);
+                InvokeClient.Instance.Service.DoOperation($"{ModuleName}.{VenusDevice.BiasMatch}.{AITRfOperation.SetMatchPositionC2}", BRFMatchC2);
+                Thread.Sleep(100);
+                InvokeClient.Instance.Service.DoOperation($"{ModuleName}.SetBRf", BRFFwdPowerSetpoint, true);
+            }
+            
         }
 
         private void OnPMAbort()
@@ -640,7 +694,6 @@ namespace Venus_MainPages.ViewModels
             InvokeClient.Instance.Service.DoOperation($"{ModuleName}.MfcGas6.SetPoint", MfcGas6Setpoint);
             InvokeClient.Instance.Service.DoOperation($"{ModuleName}.MfcGas7.SetPoint", MfcGas7Setpoint);
             InvokeClient.Instance.Service.DoOperation($"{ModuleName}.MfcGas8.SetPoint", MfcGas8Setpoint);
-            //InvokeClient
         }
 
         private void OnHV()
@@ -653,6 +706,25 @@ namespace Venus_MainPages.ViewModels
             InvokeClient.Instance.Service.DoOperation($"{ModuleName}.SetESCHV", ESCVoltage);
 
         }
+
+        private void OnSetMatchMode(object obj)
+        {
+            switch (obj.ToString())
+            {
+                case "SRFManual":
+                    InvokeClient.Instance.Service.DoOperation($"{ModuleName}.{VenusDevice.Match.ToString()}.{AITRfOperation.SetMatchProcessMode}", EnumRfMatchTuneMode.Manual.ToString());
+                    break;
+                case "SRFAuto":
+                    InvokeClient.Instance.Service.DoOperation($"{ModuleName}.{VenusDevice.Match.ToString()}.{AITRfOperation.SetMatchProcessMode}", EnumRfMatchTuneMode.Auto.ToString());
+                    break;
+                case "BRFManual":
+                    InvokeClient.Instance.Service.DoOperation($"{ModuleName}.{VenusDevice.BiasMatch.ToString()}.{AITRfOperation.SetMatchProcessMode}", EnumRfMatchTuneMode.Manual.ToString());
+                    break;
+                case "BRFAuto":
+                    InvokeClient.Instance.Service.DoOperation($"{ModuleName}.{VenusDevice.BiasMatch.ToString()}.{AITRfOperation.SetMatchProcessMode}", EnumRfMatchTuneMode.Auto.ToString());
+                    break;
+            }
+        }
         #endregion
 
         #region 私有方法
@@ -803,6 +875,12 @@ namespace Venus_MainPages.ViewModels
             m_RtDataKeys.Add($"{ModuleName}.BRfForwardPowerFeedBack");
             m_RtDataKeys.Add($"{ModuleName}.BRfReflectPower");
 
+            m_RtDataKeys.Add($"{ModuleName}.{VenusDevice.Match}.C1");
+            m_RtDataKeys.Add($"{ModuleName}.{VenusDevice.Match}.C2");
+            m_RtDataKeys.Add($"{ModuleName}.{VenusDevice.Match}.WorkMode");
+            m_RtDataKeys.Add($"{ModuleName}.{VenusDevice.BiasMatch}.C1");
+            m_RtDataKeys.Add($"{ModuleName}.{VenusDevice.BiasMatch}.C2");
+            m_RtDataKeys.Add($"{ModuleName}.{VenusDevice.BiasMatch}.WorkMode");
 
             m_RtDataKeys.Add($"{ModuleName}.TurboPumpRotationalSpeed");
 

+ 31 - 20
Venus/Venus_MainPages/Views/OverView.xaml

@@ -29,6 +29,9 @@
         <converters:BoolToColor x:Key="boolToColor"/>
         <converters:BoolToColor2 x:Key="boolToColor2"/>
         <converters:BoolToBool x:Key="BoolToBool"/>
+        <converters:IntToBoolConverter x:Key="converters:IntToBoolConverter"/>
+        <converters:IntToBoolConverter2 x:Key="converters:IntToBoolConverter2"/>
+
     </UserControl.Resources>
     <Canvas >
 
@@ -208,19 +211,19 @@
         <ctrls:Pipe2    Canvas.Left="1144" Canvas.Top="120" HorizontalAlignment="Left" VerticalAlignment="Top"  />
 
 
-        <Ellipse Width="20" Height="20" Fill="{Binding SRFIsOn,Converter={StaticResource boolToColor}}"  Canvas.Left="500" Canvas.Top="300"/>
-        <Button Height="20"  Content="SRFM Man/Aut" Canvas.Left="530" Canvas.Top="300" Command="{Binding SetSRfCommand}"  Background="Gray"/>
+        <!--<Ellipse Width="20" Height="20" Fill="{Binding SRFIsOn,Converter={StaticResource boolToColor}}"  Canvas.Left="500" Canvas.Top="300"/>
+        <Button Height="20"  Content="SRFM Man/Aut" Canvas.Left="530" Canvas.Top="300" Command="{Binding SetSRfCommand}"  Background="Gray"/>-->
         
-        <Ellipse Width="20" Height="20" Fill="{Binding SRFIsOn,Converter={StaticResource boolToColor}}"  Canvas.Left="500" Canvas.Top="325"/>
-        <Button Height="20" Width="100" Content="SRF ON/OFF" Canvas.Left="530" Canvas.Top="325" Command="{Binding SetSRfCommand}"  Background="Gray"/>
+        <Ellipse Width="20" Height="20" Fill="{Binding SRFIsOn,Converter={StaticResource boolToColor}}"  Canvas.Left="500" Canvas.Top="305"/>
+        <Button Height="20" Width="100" Content="SRF ON/OFF" Canvas.Left="530" Canvas.Top="305" Command="{Binding SetSRfCommand}"  Background="Gray"/>
 
-        <Ellipse Width="20" Height="20" Fill="{Binding BRFIsOn,Converter={StaticResource boolToColor}}"  Canvas.Left="650" Canvas.Top="300"/>
-        <Button Height="20" Width="100" Content="SRFM Man/Aut" Canvas.Left="680" Canvas.Top="300" Command="{Binding SetBRfCommand}"  Background="Gray"/>
+        <!--<Ellipse Width="20" Height="20" Fill="{Binding BRFIsOn,Converter={StaticResource boolToColor}}"  Canvas.Left="650" Canvas.Top="300"/>
+        <Button Height="20" Width="100" Content="SRFM Man/Aut" Canvas.Left="680" Canvas.Top="300" Command="{Binding SetBRfCommand}"  Background="Gray"/>-->
         
-        <Ellipse Width="20" Height="20" Fill="{Binding BRFIsOn,Converter={StaticResource boolToColor}}"  Canvas.Left="650" Canvas.Top="325"/>
-        <Button Height="20" Width="100" Content="BRF ON/OFF" Canvas.Left="680" Canvas.Top="325" Command="{Binding SetBRfCommand}"  Background="Gray"/>
+        <Ellipse Width="20" Height="20" Fill="{Binding BRFIsOn,Converter={StaticResource boolToColor}}"  Canvas.Left="650" Canvas.Top="305"/>
+        <Button Height="20" Width="100" Content="BRF ON/OFF" Canvas.Left="680" Canvas.Top="305" Command="{Binding SetBRfCommand}"  Background="Gray"/>
         <!--<Ellipse Width="20" Height="20" Fill="{Binding GasIsOn,Converter={StaticResource boolToColor}}"  Canvas.Left="500" Canvas.Top="590"/>-->
-        <Button Width="100" Content="Gas SetPoint" Canvas.Left="400" Canvas.Top="650" Background="Gray" Command="{Binding GasSetPointCommand}"/>
+        <Button Width="100" Content="Gas SetPoint" Canvas.Left="390" Canvas.Top="650" Background="Gray" Command="{Binding GasSetPointCommand}"/>
         <Button Height="20"  Content="HV SetPoint" Canvas.Left="1290" Canvas.Top="316" Command="{Binding HVSetCommand}"  Background="Gray"/>
         <Ellipse Width="20" Height="20" Fill="{Binding HVIsOn,Converter={StaticResource boolToColor}}"  Canvas.Left="1380" Canvas.Top="316"/>
         <Button Height="20" Width="100" Content="HV ON/OFF" Canvas.Left="1410" Canvas.Top="316" Command="{Binding HVCommand}" CommandParameter="True" Background="Gray"/>
@@ -617,7 +620,7 @@
 
         </Grid>
 
-        <Grid Width="300" Height="290"  Canvas.Left="500" Canvas.Top="352" Background="#E8E8E8"  unity:GridOptions.ShowBorder="True">
+        <Grid Width="300" Height="290"  Canvas.Left="500" Canvas.Top="332" Background="#E8E8E8"  unity:GridOptions.ShowBorder="True">
             <Grid.RowDefinitions>
                 <RowDefinition/>
                 <RowDefinition/>
@@ -637,7 +640,12 @@
                 <ColumnDefinition Width="*"/>
 
             </Grid.ColumnDefinitions>
-            <TextBlock  Text="SRF" Grid.ColumnSpan="3" FontSize="15" VerticalAlignment="Center"  HorizontalAlignment="Center"/>
+            <TextBlock  Text="SRF Match Mode"  FontSize="15" VerticalAlignment="Center"  HorizontalAlignment="Center"/>
+            <StackPanel Grid.Column="1" Grid.ColumnSpan="2" Orientation="Horizontal">
+                <RadioButton  Content="Manual" VerticalContentAlignment="Center" Command="{Binding SetMatchModeCommand}" CommandParameter="SRFManual" IsChecked="{Binding RtDataValues[PMA.Match.WorkMode],Converter={StaticResource converters:IntToBoolConverter},Mode=OneWay}"/>
+                <RadioButton  Content="Auto"   VerticalContentAlignment="Center" Command="{Binding SetMatchModeCommand}" CommandParameter="SRFAuto" Margin="10,0,0,0" IsChecked="{Binding RtDataValues[PMA.Match.WorkMode],Converter={StaticResource converters:IntToBoolConverter2},Mode=OneWay}"/>
+            </StackPanel>
+            
 
             <TextBlock Grid.Row="1" Text="SRF Fwd Power(W)"     FontSize="15" VerticalAlignment="Center" HorizontalAlignment="Left" Padding="10,0,0,0"/>
             <TextBlock Grid.Row="2" Text="SRF Ref Power(W)"      FontSize="15" VerticalAlignment="Center" HorizontalAlignment="Left" Padding="10,0,0,0"/>
@@ -646,17 +654,20 @@
 
             <TextBox   Grid.Row="1" Grid.Column="1" Width="Auto" Height="Auto" Text="{Binding SRFFwdPowerSetpoint}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"    BorderThickness="0" />
             <TextBlock Grid.Row="2" Grid.Column="1" Width="Auto" Height="Auto" Text="{Binding RtDataValues[PMA.SRfReflectPower],StringFormat='F1'}"  Background="#E8E8E8" TextBlock.TextAlignment="Center" VerticalAlignment="Center" Block.TextAlignment="Center" Grid.ColumnSpan="2"/>
-            <TextBox   Grid.Row="3" Grid.Column="1" Width="Auto" Height="Auto" Text="0.0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"    BorderThickness="0" />
-            <TextBox   Grid.Row="4" Grid.Column="1" Width="Auto" Height="Auto" Text="0.0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"    BorderThickness="0" />
+            <TextBox   Grid.Row="3" Grid.Column="1" Width="Auto" Height="Auto" Text="{Binding SRFMatchC1}"  HorizontalContentAlignment="Center" VerticalContentAlignment="Center"    BorderThickness="0" />
+            <TextBox   Grid.Row="4" Grid.Column="1" Width="Auto" Height="Auto" Text="{Binding SRFMatchC2}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"    BorderThickness="0" />
 
             <TextBlock Grid.Row="1" Grid.Column="2" Width="Auto" Height="Auto" Text="{Binding RtDataValues[PMA.SRfForwardPowerFeedBack],StringFormat='F1'}"  Background="#E8E8E8" TextBlock.TextAlignment="Center" VerticalAlignment="Center" Block.TextAlignment="Center"/>
             <!--<TextBlock Grid.Row="2" Grid.Column="2" Width="Auto" Height="Auto" Text="0.0"  Background="#E8E8E8" TextBlock.TextAlignment="Center" VerticalAlignment="Center" Block.TextAlignment="Center"/>-->
-            <TextBlock Grid.Row="3" Grid.Column="2" Width="Auto" Height="Auto" Text="0.0"  Background="#E8E8E8" TextBlock.TextAlignment="Center" VerticalAlignment="Center" Block.TextAlignment="Center"/>
-            <TextBlock Grid.Row="4" Grid.Column="2" Width="Auto" Height="Auto" Text="{Binding RtDataValues[PMA.BRfForwardPowerFeedBack],StringFormat='F1'}"  Background="#E8E8E8" TextBlock.TextAlignment="Center" VerticalAlignment="Center" Block.TextAlignment="Center"/>
-            
-            <TextBlock  Text="BRF" Grid.Row="5" Grid.ColumnSpan="3" FontSize="15" VerticalAlignment="Center"  HorizontalAlignment="Center"/>
-           
+            <TextBlock Grid.Row="3" Grid.Column="2" Width="Auto" Height="Auto" Text="{Binding RtDataValues[PMA.Match.C1],StringFormat='F1'}" Background="#E8E8E8" TextBlock.TextAlignment="Center" VerticalAlignment="Center" Block.TextAlignment="Center"/>
+            <TextBlock Grid.Row="4" Grid.Column="2" Width="Auto" Height="Auto" Text="{Binding RtDataValues[PMA.Match.C2],StringFormat='F1'}"  Background="#E8E8E8" TextBlock.TextAlignment="Center" VerticalAlignment="Center" Block.TextAlignment="Center"/>
             
+            <TextBlock  Text="BRF Match Mode" Grid.Row="5" FontSize="15" VerticalAlignment="Center"  HorizontalAlignment="Center"/>
+            <StackPanel Grid.Row="5" Grid.Column="1" Grid.ColumnSpan="2" Orientation="Horizontal">
+                <RadioButton  Content="Manual" VerticalContentAlignment="Center" Command="{Binding SetMatchModeCommand}" CommandParameter="BRFManual" IsChecked="{Binding RtDataValues[PMA.BiasMatch.WorkMode]}"/>
+                <RadioButton  Content="Auto"   VerticalContentAlignment="Center" Command="{Binding SetMatchModeCommand}" CommandParameter="BRFAuto" Margin="10,0,0,0" IsChecked="{Binding RtDataValues[PMA.BiasMatch.WorkMode]}"/>
+            </StackPanel>
+
             <TextBlock Grid.Row="6" Text="BRF Fwd Power(W)" FontSize="15" VerticalAlignment="Center" HorizontalAlignment="Left" Padding="10,0,0,0"/>
             <TextBlock Grid.Row="7" Text="BRF Ref Power(W)" FontSize="15" VerticalAlignment="Center" HorizontalAlignment="Left" Padding="10,0,0,0"/>
             <TextBlock Grid.Row="8" Text="BRF Match C1(%)" FontSize="15" VerticalAlignment="Center" HorizontalAlignment="Left" Padding="10,0,0,0"/>
@@ -672,8 +683,8 @@
 
             <TextBlock Grid.Row="6" Grid.Column="2" Width="Auto" Height="Auto" Text="{Binding RtDataValues[PMA.BRfForwardPowerFeedBack],StringFormat='F1'}"  Background="#E8E8E8" TextBlock.TextAlignment="Center" VerticalAlignment="Center" Block.TextAlignment="Center"/>
             <TextBlock Grid.Row="7" Grid.Column="1" Width="Auto" Height="Auto" Text="{Binding RtDataValues[PMA.BRfReflectPower],StringFormat='F1'}"  Background="#E8E8E8" TextBlock.TextAlignment="Center" VerticalAlignment="Center" Block.TextAlignment="Center" Grid.ColumnSpan="2"/>
-
-            <TextBlock Grid.Row="9" Grid.Column="2" Width="Auto" Height="Auto" Text="0.0"  Background="#E8E8E8" TextBlock.TextAlignment="Center" VerticalAlignment="Center" Block.TextAlignment="Center"/>
+            <TextBlock Grid.Row="8" Grid.Column="2" Width="Auto" Height="Auto" Text="{Binding RtDataValues[PMA.BiasMatch.C1],StringFormat='F1'}"  Background="#E8E8E8" TextBlock.TextAlignment="Center" VerticalAlignment="Center" Block.TextAlignment="Center"/>
+            <TextBlock Grid.Row="9" Grid.Column="2" Width="Auto" Height="Auto" Text="{Binding RtDataValues[PMA.BiasMatch.C2],StringFormat='F1'}"  Background="#E8E8E8" TextBlock.TextAlignment="Center" VerticalAlignment="Center" Block.TextAlignment="Center"/>
             <TextBlock Grid.Row="10" Grid.Column="2" Width="Auto" Height="Auto" Text="0.0"  Background="#E8E8E8" TextBlock.TextAlignment="Center" VerticalAlignment="Center" Block.TextAlignment="Center"/>
 
         </Grid>

+ 1 - 0
Venus/Venus_RT/Devices/AdTecRF.cs

@@ -723,6 +723,7 @@ namespace Venus_RT.Devices
 
             DATA.Subscribe($"{Module}.{Name}.C1", () => C1);
             DATA.Subscribe($"{Module}.{Name}.C2", () => C2);
+            DATA.Subscribe($"{Module}.{Name}.WorkMode", () => (int)WorkMode);
 
             OP.Subscribe($"{Module}.{Name}.SetC1", (func, args) =>
             {

+ 31 - 0
Venus/Venus_Themes/Converters/IntToBoolConverter.cs

@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+
+namespace Venus_Themes.Converters
+{
+    public  class IntToBoolConverter : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+
+            if ((int)value == 1)
+            {
+                return true;
+            }
+            else 
+            {
+                return false;
+            }
+
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+            return null;
+        }
+    }
+}

+ 30 - 0
Venus/Venus_Themes/Converters/IntToBoolConverter2.cs

@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+
+namespace Venus_Themes.Converters
+{
+    public class IntToBoolConverter2 : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+
+            if ((int)value == 2)
+            {
+                return true;
+            }
+            else
+            {
+                return false;
+            }
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+            return null;
+        }
+    }
+}

+ 2 - 0
Venus/Venus_Themes/Venus_Themes.csproj

@@ -74,6 +74,8 @@
     <Compile Include="Converters\Float2String.cs" />
     <Compile Include="Converters\FOUPStatusConverter.cs" />
     <Compile Include="Converters\IntPlusConverter.cs" />
+    <Compile Include="Converters\IntToBoolConverter.cs" />
+    <Compile Include="Converters\IntToBoolConverter2.cs" />
     <Compile Include="Converters\IntToIsEnableConverter.cs" />
     <Compile Include="Converters\Null2Bool.cs" />
     <Compile Include="Converters\String2Double.cs" />