Newer
Older
Correlator / Correlator / Views / MainWindow.xaml
<Window
    x:Class="Correlator.Views.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
    xmlns:cvt="clr-namespace:Correlator.Converter"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:hc="https://handyorg.github.io/handycontrol"
    xmlns:input="clr-namespace:System.Windows.Input;assembly=PresentationCore"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:vm="clr-namespace:Correlator.ViewModels"
    x:Name="TargetWindow"
    Title="相关仪"
    MinWidth="1366"
    MinHeight="768"
    d:DataContext="{d:DesignInstance Type=vm:MainWindowViewModel}"
    d:DesignHeight="1080"
    d:DesignWidth="1920"
    Background="#EBECF0"
    WindowStartupLocation="CenterScreen"
    WindowState="Maximized"
    WindowStyle="None"
    mc:Ignorable="d">

    <b:Interaction.Triggers>
        <b:EventTrigger EventName="Loaded">
            <b:InvokeCommandAction Command="{Binding WindowLoadedCommand}" CommandParameter="{Binding ElementName=TargetWindow}" />
        </b:EventTrigger>
    </b:Interaction.Triggers>

    <Window.Resources>
        <cvt:BatteryColorConverter x:Key="BatteryConverter" />
        <cvt:SignalIntensityConverter x:Key="SignalImageConverter" />
        <cvt:VisibilityConverter x:Key="VisibilityConverter" />
        <cvt:PipeLineValueConverter x:Key="PipeLineValueConverter" />
        <cvt:FrequencyRangeConverter x:Key="FrequencyRangeConverter" />
    </Window.Resources>

    <DockPanel LastChildFill="True">
        <!--  顶部功能区  -->
        <Grid Height="60" DockPanel.Dock="Top">
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <StackPanel Grid.Column="0" Orientation="Horizontal">
                <Button
                    Height="40"
                    Margin="15,0"
                    Command="{Binding CloseWindowCommand}">
                    <Button.Template>
                        <ControlTemplate TargetType="{x:Type Button}">
                            <Border
                                Name="PART_Background"
                                BorderBrush="{TemplateBinding Control.BorderBrush}"
                                BorderThickness="0"
                                CornerRadius="20">
                                <Border.Background>
                                    <SolidColorBrush Color="White" />
                                </Border.Background>
                                <ContentPresenter
                                    HorizontalAlignment="Center"
                                    VerticalAlignment="Center"
                                    Content="{TemplateBinding ContentControl.Content}" />
                            </Border>
                            <ControlTemplate.Triggers>
                                <Trigger Property="UIElement.IsMouseOver" Value="True">
                                    <Setter Property="Opacity" Value="0.5" />
                                </Trigger>
                                <Trigger Property="ButtonBase.IsPressed" Value="True">
                                    <Setter Property="Opacity" Value="0.5" />
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Button.Template>

                    <StackPanel Margin="8,5" Orientation="Horizontal">
                        <Border
                            Width="30"
                            Height="30"
                            Background="{StaticResource DarkPrimaryBrush}"
                            CornerRadius="15">
                            <TextBlock
                                HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                FontFamily="/Correlator;component/Fonts/#iconfont"
                                FontSize="20"
                                Foreground="White"
                                Text="&#xe6f1;" />
                        </Border>

                        <TextBlock
                            Margin="10,0"
                            VerticalAlignment="Center"
                            FontSize="16"
                            Text="退出" />
                    </StackPanel>
                </Button>

                <Button Height="40" Command="{Binding OpenImageFileCommand}">
                    <Button.Template>
                        <ControlTemplate TargetType="{x:Type Button}">
                            <Border
                                Name="PART_Background"
                                BorderBrush="{TemplateBinding Control.BorderBrush}"
                                BorderThickness="0"
                                CornerRadius="20">
                                <Border.Background>
                                    <SolidColorBrush Color="White" />
                                </Border.Background>
                                <ContentPresenter
                                    HorizontalAlignment="Center"
                                    VerticalAlignment="Center"
                                    Content="{TemplateBinding ContentControl.Content}" />
                            </Border>
                            <ControlTemplate.Triggers>
                                <Trigger Property="UIElement.IsMouseOver" Value="True">
                                    <Setter Property="Opacity" Value="0.5" />
                                </Trigger>
                                <Trigger Property="ButtonBase.IsPressed" Value="True">
                                    <Setter Property="Opacity" Value="0.5" />
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Button.Template>

                    <StackPanel Margin="8,5" Orientation="Horizontal">
                        <Border
                            Width="30"
                            Height="30"
                            Background="{StaticResource DarkPrimaryBrush}"
                            CornerRadius="15">
                            <TextBlock
                                HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                FontFamily="/Correlator;component/Fonts/#iconfont"
                                FontSize="20"
                                Foreground="White"
                                Text="&#xe6d5;" />
                        </Border>

                        <TextBlock
                            Margin="10,0"
                            VerticalAlignment="Center"
                            FontSize="16"
                            Text="图片" />
                    </StackPanel>
                </Button>

                <Button
                    Height="40"
                    Margin="15,0"
                    Command="{Binding OpenAudioFileCommand}">
                    <Button.Template>
                        <ControlTemplate TargetType="{x:Type Button}">
                            <Border
                                Name="PART_Background"
                                BorderBrush="{TemplateBinding Control.BorderBrush}"
                                BorderThickness="0"
                                CornerRadius="20">
                                <Border.Background>
                                    <SolidColorBrush Color="White" />
                                </Border.Background>
                                <ContentPresenter
                                    HorizontalAlignment="Center"
                                    VerticalAlignment="Center"
                                    Content="{TemplateBinding ContentControl.Content}" />
                            </Border>
                            <ControlTemplate.Triggers>
                                <Trigger Property="UIElement.IsMouseOver" Value="True">
                                    <Setter Property="Opacity" Value="0.5" />
                                </Trigger>
                                <Trigger Property="ButtonBase.IsPressed" Value="True">
                                    <Setter Property="Opacity" Value="0.5" />
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Button.Template>

                    <StackPanel Margin="8,5" Orientation="Horizontal">
                        <Border
                            Width="30"
                            Height="30"
                            Background="{StaticResource DarkPrimaryBrush}"
                            CornerRadius="15">
                            <TextBlock
                                HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                FontFamily="/Correlator;component/Fonts/#iconfont"
                                FontSize="20"
                                Foreground="White"
                                Text="&#xe6a9;" />
                        </Border>

                        <TextBlock
                            Margin="10,0"
                            VerticalAlignment="Center"
                            FontSize="16"
                            Text="音频" />
                    </StackPanel>
                </Button>

                <Button Height="40" Command="{Binding OpenListenAudioCommand}">
                    <Button.Template>
                        <ControlTemplate TargetType="{x:Type Button}">
                            <Border
                                Name="PART_Background"
                                BorderBrush="{TemplateBinding Control.BorderBrush}"
                                BorderThickness="0"
                                CornerRadius="20">
                                <Border.Background>
                                    <SolidColorBrush Color="White" />
                                </Border.Background>
                                <ContentPresenter
                                    HorizontalAlignment="Center"
                                    VerticalAlignment="Center"
                                    Content="{TemplateBinding ContentControl.Content}" />
                            </Border>
                            <ControlTemplate.Triggers>
                                <Trigger Property="UIElement.IsMouseOver" Value="True">
                                    <Setter Property="Opacity" Value="0.5" />
                                </Trigger>
                                <Trigger Property="ButtonBase.IsPressed" Value="True">
                                    <Setter Property="Opacity" Value="0.5" />
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Button.Template>

                    <StackPanel Margin="8,5" Orientation="Horizontal">
                        <Border
                            Width="30"
                            Height="30"
                            Background="{StaticResource DarkPrimaryBrush}"
                            CornerRadius="15">
                            <TextBlock
                                HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                FontFamily="/Correlator;component/Fonts/#iconfont"
                                FontSize="20"
                                Foreground="White"
                                Text="&#xe689;" />
                        </Border>

                        <TextBlock
                            Margin="10,0"
                            VerticalAlignment="Center"
                            FontSize="16"
                            Text="听音" />
                    </StackPanel>
                </Button>

                <Button
                    Height="40"
                    Margin="15,0,0,0"
                    Command="{Binding SoundSettingsCommand}">
                    <Button.Template>
                        <ControlTemplate TargetType="{x:Type Button}">
                            <Border
                                Name="PART_Background"
                                BorderBrush="{TemplateBinding Control.BorderBrush}"
                                BorderThickness="0"
                                CornerRadius="20">
                                <Border.Background>
                                    <SolidColorBrush Color="White" />
                                </Border.Background>
                                <ContentPresenter
                                    HorizontalAlignment="Center"
                                    VerticalAlignment="Center"
                                    Content="{TemplateBinding ContentControl.Content}" />
                            </Border>
                            <ControlTemplate.Triggers>
                                <Trigger Property="UIElement.IsMouseOver" Value="True">
                                    <Setter Property="Opacity" Value="0.5" />
                                </Trigger>
                                <Trigger Property="ButtonBase.IsPressed" Value="True">
                                    <Setter Property="Opacity" Value="0.5" />
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Button.Template>

                    <StackPanel Margin="8,5" Orientation="Horizontal">
                        <Border
                            Width="30"
                            Height="30"
                            Background="{StaticResource DarkPrimaryBrush}"
                            CornerRadius="15">
                            <TextBlock
                                HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                FontFamily="/Correlator;component/Fonts/#iconfont"
                                FontSize="20"
                                Foreground="White"
                                Text="&#xe6ce;" />
                        </Border>

                        <TextBlock
                            Margin="10,0"
                            VerticalAlignment="Center"
                            FontSize="16"
                            Text="声速设置" />
                    </StackPanel>
                </Button>

                <Button
                    Height="40"
                    Margin="15,0,0,0"
                    Command="{Binding ImportDataCommand}">
                    <Button.Template>
                        <ControlTemplate TargetType="{x:Type Button}">
                            <Border
                                Name="PART_Background"
                                BorderBrush="{TemplateBinding Control.BorderBrush}"
                                BorderThickness="0"
                                CornerRadius="20">
                                <Border.Background>
                                    <SolidColorBrush Color="White" />
                                </Border.Background>
                                <ContentPresenter
                                    HorizontalAlignment="Center"
                                    VerticalAlignment="Center"
                                    Content="{TemplateBinding ContentControl.Content}" />
                            </Border>
                            <ControlTemplate.Triggers>
                                <Trigger Property="UIElement.IsMouseOver" Value="True">
                                    <Setter Property="Opacity" Value="0.5" />
                                </Trigger>
                                <Trigger Property="ButtonBase.IsPressed" Value="True">
                                    <Setter Property="Opacity" Value="0.5" />
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Button.Template>

                    <StackPanel Margin="8,5" Orientation="Horizontal">
                        <Border
                            Width="30"
                            Height="30"
                            Background="{StaticResource DarkPrimaryBrush}"
                            CornerRadius="15">
                            <TextBlock
                                HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                FontFamily="/Correlator;component/Fonts/#iconfont"
                                FontSize="20"
                                Foreground="White"
                                Text="&#xe6cf;" />
                        </Border>

                        <TextBlock
                            Margin="10,0"
                            VerticalAlignment="Center"
                            FontSize="16"
                            Text="导入数据" />
                    </StackPanel>
                </Button>

                <Button Height="40" Margin="15,0,0,0">
                    <Button.Template>
                        <ControlTemplate TargetType="{x:Type Button}">
                            <Border
                                Name="PART_Background"
                                BorderBrush="{TemplateBinding Control.BorderBrush}"
                                BorderThickness="0"
                                CornerRadius="20">
                                <Border.Background>
                                    <SolidColorBrush Color="White" />
                                </Border.Background>
                                <ContentPresenter
                                    HorizontalAlignment="Center"
                                    VerticalAlignment="Center"
                                    Content="{TemplateBinding ContentControl.Content}" />
                            </Border>
                            <ControlTemplate.Triggers>
                                <Trigger Property="UIElement.IsMouseOver" Value="True">
                                    <Setter Property="Opacity" Value="0.5" />
                                </Trigger>
                                <Trigger Property="ButtonBase.IsPressed" Value="True">
                                    <Setter Property="Opacity" Value="0.5" />
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Button.Template>

                    <StackPanel Margin="8,5" Orientation="Horizontal">
                        <Border
                            Width="30"
                            Height="30"
                            Background="{StaticResource DarkPrimaryBrush}"
                            CornerRadius="15">
                            <TextBlock
                                HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                FontFamily="/Correlator;component/Fonts/#iconfont"
                                FontSize="20"
                                Foreground="White"
                                Text="&#xe604;" />
                        </Border>

                        <CheckBox
                            x:Name="ShowCrossLineCheckBox"
                            Margin="10,0"
                            VerticalAlignment="Center"
                            Content="十字准线"
                            FontSize="16" />
                    </StackPanel>
                </Button>
            </StackPanel>

            <TextBlock
                Grid.Column="1"
                Margin="10,0"
                VerticalAlignment="Center"
                FontSize="22"
                Foreground="{StaticResource MainThemeColor}"
                Text="{Binding CurrentTime}" />
        </Grid>

        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="350" />
            </Grid.ColumnDefinitions>

            <!--  左侧展示区  -->
            <Grid Grid.Column="0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>

                <!--  计算结果柱状图展示区  -->
                <Border
                    Grid.Row="0"
                    Margin="10,0,10,10"
                    Background="White"
                    BorderBrush="LightGray"
                    BorderThickness="1">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>

                        <Image
                            Grid.Column="0"
                            Width="38"
                            Height="82"
                            Margin="10,0,10,10"
                            VerticalAlignment="Bottom"
                            Source="{Binding RedTransmitterSignalIntensity, ConverterParameter=0, Converter={StaticResource SignalImageConverter}}" />

                        <WpfPlot x:Name="ScottplotView" Grid.Column="1" />

                        <Image
                            Grid.Column="2"
                            Width="38"
                            Height="82"
                            Margin="10,0,10,10"
                            VerticalAlignment="Bottom"
                            Source="{Binding BlueTransmitterSignalIntensity, ConverterParameter=1, Converter={StaticResource SignalImageConverter}}" />
                    </Grid>
                </Border>

                <!--  计算结果数据展示区  -->
                <Grid Grid.Row="1">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>

                    <Border
                        Grid.Column="0"
                        Margin="10,0,10,10"
                        BorderBrush="LightGray"
                        BorderThickness="1">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="40" />
                                <RowDefinition Height="40" />
                                <RowDefinition Height="40" />
                                <RowDefinition Height="40" />
                            </Grid.RowDefinitions>
                            <DockPanel Grid.Row="0" Margin="10,0">
                                <TextBlock
                                    VerticalAlignment="Center"
                                    FontFamily="/Correlator;component/Fonts/#iconfont"
                                    FontSize="24"
                                    Foreground="{StaticResource MainThemeColor}"
                                    Text="&#xe661;" />
                                <TextBlock
                                    Margin="10,0,0,0"
                                    VerticalAlignment="Center"
                                    FontSize="18"
                                    Foreground="{StaticResource MainThemeColor}"
                                    Text="计算结果" />
                            </DockPanel>
                            <DockPanel Grid.Row="1" VerticalAlignment="Center">
                                <TextBlock
                                    Width="80"
                                    Margin="45,0,0,0"
                                    FontSize="18"
                                    Foreground="{StaticResource MainThemeColor}"
                                    Text="干扰频段" />
                                <TextBlock
                                    Margin="0,0,10,0"
                                    FontSize="18"
                                    Foreground="{StaticResource MainThemeColor}">
                                    <TextBlock.Text>
                                        <MultiBinding Converter="{StaticResource FrequencyRangeConverter}">
                                            <Binding ElementName="LowFrequencyTextBox" Path="Text" />
                                            <Binding ElementName="HighFrequencyTextBox" Path="Text" />
                                        </MultiBinding>
                                    </TextBlock.Text>
                                </TextBlock>
                            </DockPanel>
                            <DockPanel Grid.Row="2" VerticalAlignment="Center">
                                <TextBlock
                                    Width="80"
                                    Margin="45,0,0,0"
                                    FontSize="18"
                                    Foreground="{StaticResource MainThemeColor}"
                                    Text="信噪比" />
                                <TextBlock
                                    Margin="0,0,10,0"
                                    FontSize="18"
                                    Foreground="{StaticResource MainThemeColor}"
                                    Text="{Binding Snr}" />
                            </DockPanel>
                            <DockPanel Grid.Row="3" VerticalAlignment="Center">
                                <TextBlock
                                    Width="80"
                                    Margin="45,0,0,0"
                                    FontSize="18"
                                    Foreground="{StaticResource MainThemeColor}"
                                    Text="过滤器" />
                                <TextBlock
                                    Margin="0,0,10,0"
                                    FontSize="18"
                                    Foreground="{StaticResource MainThemeColor}"
                                    Text="{Binding FilterValue}" />
                            </DockPanel>
                        </Grid>
                    </Border>

                    <Grid Grid.Column="1">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition />
                        </Grid.RowDefinitions>

                        <!--  计时以及发射机状态展示区  -->
                        <Border
                            Grid.Row="0"
                            Margin="0,0,10,10"
                            BorderBrush="LightGray"
                            BorderThickness="1">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="1" />
                                    <RowDefinition Height="Auto" />
                                </Grid.RowDefinitions>

                                <Grid Grid.Row="0" Height="40">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*" />
                                        <ColumnDefinition Width="Auto" />
                                    </Grid.ColumnDefinitions>
                                    <StackPanel
                                        Grid.Column="0"
                                        Margin="10,0"
                                        HorizontalAlignment="Left"
                                        VerticalAlignment="Center"
                                        Orientation="Horizontal">
                                        <TextBlock
                                            FontFamily="/Correlator;component/Fonts/#iconfont"
                                            FontSize="24"
                                            Foreground="{StaticResource MainThemeColor}"
                                            Text="&#xe69e;" />
                                        <TextBlock
                                            Margin="10,2,0,0"
                                            FontSize="18"
                                            Foreground="{StaticResource MainThemeColor}">
                                            <TextBlock.Text>
                                                <MultiBinding Converter="{StaticResource PipeLineValueConverter}">
                                                    <Binding ElementName="PipeNameComboBox" Path="Text" />
                                                    <Binding ElementName="PipeDiameterTextBox" Path="Text" />
                                                    <Binding ElementName="PipeLengthTextBox" Path="Text" />
                                                </MultiBinding>
                                            </TextBlock.Text>
                                        </TextBlock>
                                    </StackPanel>

                                    <StackPanel
                                        Grid.Column="1"
                                        Margin="10,0"
                                        HorizontalAlignment="Right"
                                        VerticalAlignment="Center"
                                        Orientation="Horizontal">
                                        <TextBlock
                                            FontFamily="/Correlator;component/Fonts/#iconfont"
                                            FontSize="24"
                                            Foreground="{StaticResource MainThemeColor}"
                                            Text="&#xe604;" />
                                        <TextBlock
                                            Margin="10,0,0,0"
                                            FontSize="18"
                                            Foreground="{StaticResource MainThemeColor}"
                                            Text="声速:" />
                                        <TextBlock
                                            FontSize="18"
                                            Foreground="{StaticResource MainThemeColor}"
                                            Text="{Binding SoundSpeed, StringFormat={}{0}m/s}" />
                                    </StackPanel>
                                </Grid>

                                <Grid Grid.Row="1" Background="LightGray" />

                                <Grid Grid.Row="2">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="*" />
                                        <ColumnDefinition Width="Auto" />
                                    </Grid.ColumnDefinitions>

                                    <StackPanel
                                        Grid.Column="0"
                                        Margin="10"
                                        HorizontalAlignment="Left"
                                        Orientation="Vertical">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition />
                                                <ColumnDefinition />
                                                <ColumnDefinition />
                                            </Grid.ColumnDefinitions>

                                            <Image
                                                Grid.Column="0"
                                                Width="50"
                                                Height="57"
                                                Source="{Binding RedTransmitterState, ConverterParameter=2, Converter={StaticResource SignalImageConverter}}" />

                                            <Grid Grid.Column="1">
                                                <Grid.RowDefinitions>
                                                    <RowDefinition />
                                                    <RowDefinition />
                                                </Grid.RowDefinitions>

                                                <TextBlock
                                                    Grid.Row="0"
                                                    Margin="10,0,0,0"
                                                    FontSize="28"
                                                    Foreground="{StaticResource MainThemeColor}"
                                                    Text="{Binding RedTransmitterDistance, StringFormat=\{0\}m}" />

                                                <StackPanel
                                                    Grid.Row="1"
                                                    Margin="10,5"
                                                    Orientation="Horizontal">
                                                    <Border
                                                        Width="50"
                                                        Height="20"
                                                        BorderBrush="#545454"
                                                        BorderThickness="1"
                                                        CornerRadius="2">
                                                        <ProgressBar
                                                            Margin="1"
                                                            VerticalAlignment="Center"
                                                            Background="Transparent"
                                                            Foreground="{Binding RedTransmitterBattery, Converter={StaticResource BatteryConverter}}"
                                                            Value="{Binding RedTransmitterBattery}" />
                                                    </Border>
                                                    <Border
                                                        Width="2"
                                                        Height="10"
                                                        BorderBrush="#545454"
                                                        BorderThickness="1" />
                                                </StackPanel>
                                            </Grid>

                                            <StackPanel
                                                Grid.Column="2"
                                                Margin="10,0"
                                                VerticalAlignment="Center"
                                                Orientation="Vertical">
                                                <Border
                                                    Width="100"
                                                    Background="{StaticResource MainThemeColor}"
                                                    CornerRadius="3">
                                                    <TextBlock
                                                        Margin="0,5"
                                                        Foreground="White"
                                                        Text="噪声值"
                                                        TextAlignment="Center" />
                                                </Border>

                                                <TextBlock
                                                    HorizontalAlignment="Center"
                                                    FontFamily="{StaticResource DigitalFont}"
                                                    FontSize="35"
                                                    Foreground="{StaticResource MainThemeColor}"
                                                    Text="{Binding CorrelatorData.LeftNoiseSumValue, StringFormat={}{0:F2}}" />
                                            </StackPanel>
                                        </Grid>

                                        <TextBlock
                                            Foreground="Red"
                                            Text="传感器故障"
                                            Visibility="{Binding RedTransmitterState, ConverterParameter=0, Converter={StaticResource VisibilityConverter}}" />
                                    </StackPanel>

                                    <TextBlock
                                        Grid.Column="1"
                                        HorizontalAlignment="Center"
                                        VerticalAlignment="Center"
                                        FontFamily="{StaticResource DigitalFont}"
                                        FontSize="80"
                                        Foreground="{StaticResource MainThemeColor}"
                                        Text="{Binding ElapseTime, StringFormat={}{0}}" />

                                    <StackPanel
                                        Grid.Column="2"
                                        Margin="10"
                                        HorizontalAlignment="Right"
                                        Orientation="Vertical">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition />
                                                <ColumnDefinition />
                                                <ColumnDefinition />
                                            </Grid.ColumnDefinitions>

                                            <StackPanel
                                                Grid.Column="0"
                                                Margin="10,0"
                                                VerticalAlignment="Center"
                                                Orientation="Vertical">
                                                <Border
                                                    Width="100"
                                                    Background="{StaticResource MainThemeColor}"
                                                    CornerRadius="3">
                                                    <TextBlock
                                                        Margin="0,5"
                                                        Foreground="White"
                                                        Text="噪声值"
                                                        TextAlignment="Center" />
                                                </Border>

                                                <TextBlock
                                                    HorizontalAlignment="Center"
                                                    FontFamily="{StaticResource DigitalFont}"
                                                    FontSize="35"
                                                    Foreground="{StaticResource MainThemeColor}"
                                                    Text="{Binding CorrelatorData.RightNoiseSumValue, StringFormat={}{0:F2}}" />
                                            </StackPanel>

                                            <Grid Grid.Column="1">
                                                <Grid.RowDefinitions>
                                                    <RowDefinition />
                                                    <RowDefinition />
                                                </Grid.RowDefinitions>

                                                <TextBlock
                                                    Grid.Row="0"
                                                    Margin="0,0,10,0"
                                                    HorizontalAlignment="Right"
                                                    FontSize="28"
                                                    Foreground="{StaticResource MainThemeColor}"
                                                    Text="{Binding BlueTransmitterDistance, StringFormat=\{0\}m}" />

                                                <StackPanel
                                                    Grid.Row="1"
                                                    Margin="10,5"
                                                    HorizontalAlignment="Right"
                                                    Orientation="Horizontal">
                                                    <Border
                                                        Width="2"
                                                        Height="10"
                                                        BorderBrush="#545454"
                                                        BorderThickness="1" />
                                                    <Border
                                                        Width="50"
                                                        Height="20"
                                                        BorderBrush="#545454"
                                                        BorderThickness="1"
                                                        CornerRadius="2">
                                                        <ProgressBar
                                                            Margin="1"
                                                            VerticalAlignment="Center"
                                                            Background="Transparent"
                                                            Foreground="{Binding BlueTransmitterBattery, Converter={StaticResource BatteryConverter}}"
                                                            Value="{Binding BlueTransmitterBattery}" />
                                                    </Border>
                                                </StackPanel>
                                            </Grid>

                                            <Image
                                                Grid.Column="2"
                                                Width="50"
                                                Height="57"
                                                Source="{Binding BlueTransmitterState, ConverterParameter=3, Converter={StaticResource SignalImageConverter}}" />
                                        </Grid>

                                        <TextBlock
                                            HorizontalAlignment="Right"
                                            Foreground="Red"
                                            Text="传感器故障"
                                            Visibility="{Binding BlueTransmitterState, ConverterParameter=0, Converter={StaticResource VisibilityConverter}}" />
                                    </StackPanel>
                                </Grid>
                            </Grid>
                        </Border>

                        <!--  设备状态展示区  -->
                        <Border
                            Grid.Row="1"
                            Margin="0,0,10,10"
                            BorderBrush="LightGray"
                            BorderThickness="1">
                            <Grid Height="40">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition />
                                    <ColumnDefinition />
                                    <ColumnDefinition />
                                </Grid.ColumnDefinitions>
                                <StackPanel
                                    Grid.Column="0"
                                    Margin="10,0"
                                    VerticalAlignment="Center"
                                    Orientation="Horizontal">
                                    <TextBlock
                                        FontSize="18"
                                        Foreground="{StaticResource MainThemeColor}"
                                        Text="版本号:" />

                                    <TextBlock
                                        FontSize="18"
                                        Foreground="{StaticResource MainThemeColor}"
                                        Text="{Binding ApplicationVersion}" />
                                </StackPanel>

                                <TextBlock
                                    Grid.Column="1"
                                    HorizontalAlignment="Center"
                                    VerticalAlignment="Center"
                                    FontSize="18"
                                    Foreground="{StaticResource MainThemeColor}"
                                    Text="中国航天科工二院二〇三所" />

                                <Button
                                    Grid.Column="2"
                                    Height="40"
                                    HorizontalAlignment="Right"
                                    Command="{Binding OpenNumericKeypadCommand}"
                                    FontFamily="/Correlator;component/Fonts/#iconfont"
                                    Foreground="{StaticResource MainThemeColor}">
                                    <StackPanel VerticalAlignment="Center" Orientation="Horizontal">
                                        <TextBlock
                                            Margin="0,0,7,0"
                                            FontFamily="/Correlator;component/Fonts/#iconfont"
                                            FontSize="24"
                                            Foreground="{StaticResource MainThemeColor}"
                                            Text="&#xe69b;" />

                                        <TextBlock
                                            VerticalAlignment="Center"
                                            FontSize="18"
                                            Foreground="{StaticResource MainThemeColor}"
                                            Text="数字键盘" />
                                    </StackPanel>
                                </Button>
                            </Grid>
                        </Border>
                    </Grid>
                </Grid>
            </Grid>

            <!--  右侧功能区  -->
            <Grid Grid.Column="1">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>

                <!--  材料配置功能区  -->
                <Border
                    Grid.Row="0"
                    Margin="0,0,10,0"
                    BorderBrush="LightGray"
                    BorderThickness="1">
                    <Grid Margin="0,0,0,10">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="40" />
                            <RowDefinition Height="40" />
                            <RowDefinition Height="40" />
                            <RowDefinition Height="40" />
                            <RowDefinition Height="40" />
                            <RowDefinition Height="40" />
                        </Grid.RowDefinitions>
                        <DockPanel Grid.Row="0" VerticalAlignment="Center">
                            <TextBlock
                                Margin="10,0"
                                FontFamily="/Correlator;component/Fonts/#iconfont"
                                FontSize="24"
                                Foreground="{StaticResource MainThemeColor}"
                                Text="&#xe69e;" />
                            <TextBlock
                                FontSize="18"
                                Foreground="{StaticResource MainThemeColor}"
                                Text="管道材料" />
                        </DockPanel>

                        <ComboBox
                            x:Name="PipeNameComboBox"
                            Grid.Row="1"
                            Margin="45,0,10,0"
                            FontSize="18"
                            IsEnabled="{Binding ElementName=StartButton, Path=IsEnabled}"
                            ItemsSource="{Binding PipeMaterialsArray}"
                            SelectedItem="{Binding MaterialName}">
                            <b:Interaction.Triggers>
                                <b:EventTrigger EventName="SelectionChanged">
                                    <b:InvokeCommandAction Command="{Binding PipeItemSelectedCommand}" CommandParameter="{Binding ElementName=PipeNameComboBox}" />
                                </b:EventTrigger>
                            </b:Interaction.Triggers>
                        </ComboBox>

                        <DockPanel Grid.Row="2" VerticalAlignment="Center">
                            <TextBlock
                                Margin="10,0"
                                FontFamily="/Correlator;component/Fonts/#iconfont"
                                FontSize="24"
                                Foreground="{StaticResource MainThemeColor}"
                                Text="&#xe6cc;" />
                            <TextBlock
                                FontSize="18"
                                Foreground="{StaticResource MainThemeColor}"
                                Text="管道直径" />
                        </DockPanel>

                        <hc:TextBox
                            x:Name="PipeDiameterTextBox"
                            Grid.Row="3"
                            Height="40"
                            Margin="45,0,10,0"
                            hc:InfoElement.Placeholder="请输入管道直径,单位:mm"
                            input:InputMethod.IsInputMethodEnabled="False"
                            FontSize="18"
                            IsEnabled="{Binding ElementName=StartButton, Path=IsEnabled}"
                            MaxLength="3"
                            ShowClearButton="True"
                            Text="{Binding PipeDiameter}" />

                        <DockPanel Grid.Row="4" VerticalAlignment="Center">
                            <TextBlock
                                Margin="10,0"
                                FontFamily="/Correlator;component/Fonts/#iconfont"
                                FontSize="24"
                                Foreground="{StaticResource MainThemeColor}"
                                Text="&#xe6cd;" />
                            <TextBlock
                                FontSize="18"
                                Foreground="{StaticResource MainThemeColor}"
                                Text="管道长度" />
                        </DockPanel>

                        <hc:TextBox
                            x:Name="PipeLengthTextBox"
                            Grid.Row="5"
                            Height="40"
                            Margin="45,0,10,0"
                            hc:InfoElement.Placeholder="请输入管道长度,单位:m"
                            input:InputMethod.IsInputMethodEnabled="False"
                            FontSize="18"
                            IsEnabled="{Binding ElementName=StartButton, Path=IsEnabled}"
                            MaxLength="3"
                            ShowClearButton="True"
                            Text="{Binding PipeLength}" />
                    </Grid>
                </Border>

                <!--  工作模式功能区  -->
                <Border
                    Grid.Row="1"
                    Margin="0,10,10,0"
                    BorderBrush="LightGray"
                    BorderThickness="1">
                    <Grid Margin="0,0,0,10">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="40" />
                            <RowDefinition />
                        </Grid.RowDefinitions>
                        <DockPanel Grid.Row="0" VerticalAlignment="Center">
                            <TextBlock
                                Margin="10,0"
                                FontFamily="/Correlator;component/Fonts/#iconfont"
                                FontSize="24"
                                Foreground="{StaticResource MainThemeColor}"
                                Text="&#xe69d;" />
                            <TextBlock
                                FontSize="18"
                                Foreground="{StaticResource MainThemeColor}"
                                Text="工作模式" />
                        </DockPanel>

                        <Grid Grid.Row="1" Margin="35,5,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition />
                                <ColumnDefinition />
                            </Grid.ColumnDefinitions>

                            <RadioButton
                                x:Name="AccelerationRadioButton"
                                Grid.Column="0"
                                Margin="0,0,5,0"
                                Content="加速度计模式"
                                GroupName="WorkModeGroup"
                                IsChecked="True"
                                IsEnabled="{Binding ElementName=StartButton, Path=IsEnabled}"
                                Style="{StaticResource RadioButtonStyle}" />

                            <RadioButton
                                x:Name="HydrophonesRadioButton"
                                Grid.Column="1"
                                Margin="5,0,0,0"
                                Content="水听器模式"
                                GroupName="WorkModeGroup"
                                IsEnabled="{Binding ElementName=StartButton, Path=IsEnabled}"
                                Style="{StaticResource RadioButtonStyle}" />
                        </Grid>
                    </Grid>
                </Border>

                <!--  干扰频段功能区  -->
                <Border
                    Grid.Row="2"
                    Margin="0,10,10,10"
                    BorderBrush="LightGray"
                    BorderThickness="1">
                    <Grid Margin="0,0,0,10">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="40" />
                            <RowDefinition />
                        </Grid.RowDefinitions>
                        <DockPanel Grid.Row="0" VerticalAlignment="Center">
                            <TextBlock
                                Margin="10,0"
                                FontFamily="/Correlator;component/Fonts/#iconfont"
                                FontSize="24"
                                Foreground="{StaticResource MainThemeColor}"
                                Text="&#xe719;" />
                            <TextBlock
                                FontSize="18"
                                Foreground="{StaticResource MainThemeColor}"
                                Text="干扰频段区间" />
                            <TextBlock
                                FontSize="18"
                                Foreground="DarkGray"
                                Text="{Binding FrequencyInterval, StringFormat=(\{0\})}" />
                        </DockPanel>

                        <Grid
                            Grid.Row="1"
                            Margin="0,5,0,0"
                            HorizontalAlignment="Center">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <hc:TextBox
                                x:Name="LowFrequencyTextBox"
                                Grid.Column="0"
                                Width="125"
                                Margin="45,0,0,0"
                                hc:InfoElement.Placeholder="单位:Hz"
                                input:InputMethod.IsInputMethodEnabled="False"
                                FontSize="18"
                                IsEnabled="{Binding ElementName=StartButton, Path=IsEnabled}"
                                MaxLength="3"
                                ShowClearButton="True"
                                Text="{Binding LowFrequency}" />

                            <TextBlock
                                Grid.Column="1"
                                Margin="10,0"
                                VerticalAlignment="Center"
                                FontSize="22"
                                Foreground="{StaticResource MainThemeColor}"
                                Text="~" />

                            <hc:TextBox
                                x:Name="HighFrequencyTextBox"
                                Grid.Column="2"
                                Width="125"
                                Margin="0,0,10,0"
                                hc:InfoElement.Placeholder="单位:Hz"
                                input:InputMethod.IsInputMethodEnabled="False"
                                FontSize="18"
                                IsEnabled="{Binding ElementName=StartButton, Path=IsEnabled}"
                                MaxLength="4"
                                ShowClearButton="True"
                                Text="{Binding HighFrequency}" />
                        </Grid>
                    </Grid>
                </Border>

                <!--  按键功能区  -->
                <Border
                    Grid.Row="3"
                    Margin="0,0,10,0"
                    BorderBrush="LightGray"
                    BorderThickness="1">
                    <Grid Margin="0,10">
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition />
                        </Grid.RowDefinitions>

                        <Grid.ColumnDefinitions>
                            <ColumnDefinition />
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>

                        <Button
                            Grid.Row="0"
                            Grid.Column="0"
                            Margin="0,0,5,5"
                            HorizontalAlignment="Right"
                            hc:BorderElement.CornerRadius="22"
                            Command="{Binding SaveAudioCommand}"
                            Content="保存"
                            Style="{StaticResource FunctionButtonStyle}" />
                        <Button
                            Grid.Row="0"
                            Grid.Column="1"
                            Margin="5,0,0,5"
                            HorizontalAlignment="Left"
                            hc:BorderElement.CornerRadius="22"
                            Command="{Binding ResetParamCommand}"
                            Content="复位"
                            Style="{StaticResource FunctionButtonStyle}" />
                        <Button
                            Grid.Row="1"
                            Grid.Column="0"
                            Margin="0,5,5,0"
                            HorizontalAlignment="Right"
                            hc:BorderElement.CornerRadius="22"
                            Command="{Binding SnapShotCommand}"
                            Content="快照"
                            Style="{StaticResource FunctionButtonStyle}" />
                        <Button
                            x:Name="StartButton"
                            Grid.Row="1"
                            Grid.Column="1"
                            Margin="5,5,0,0"
                            HorizontalAlignment="Left"
                            hc:BorderElement.CornerRadius="22"
                            Command="{Binding StartCollectDataCommand}"
                            Content="开始"
                            IsEnabled="{Binding StartButtonEnabled}"
                            Style="{StaticResource FunctionButtonStyle}" />
                    </Grid>
                </Border>

                <!--  设备状态展示区  -->
                <Border
                    Grid.Row="4"
                    Margin="0,10,10,10"
                    BorderBrush="LightGray"
                    BorderThickness="1">
                    <Grid Margin="0,0,0,10">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="40" />
                            <RowDefinition Height="40" />
                        </Grid.RowDefinitions>
                        <DockPanel Grid.Row="0" VerticalAlignment="Center">
                            <TextBlock
                                Margin="10,0"
                                FontFamily="/Correlator;component/Fonts/#iconfont"
                                FontSize="24"
                                Foreground="{StaticResource MainThemeColor}"
                                Text="&#xe665;" />
                            <TextBlock
                                FontSize="18"
                                Foreground="{StaticResource MainThemeColor}"
                                Text="设备状态" />
                        </DockPanel>

                        <Grid
                            Grid.Row="1"
                            Height="40"
                            Margin="45,0,10,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition />
                                <ColumnDefinition />
                            </Grid.ColumnDefinitions>

                            <DockPanel Grid.Column="0">
                                <TextBlock
                                    VerticalAlignment="Center"
                                    FontSize="18"
                                    Foreground="{StaticResource MainThemeColor}"
                                    Text="电脑电量:" />

                                <StackPanel Orientation="Horizontal">
                                    <Border
                                        Width="50"
                                        Height="20"
                                        BorderBrush="#545454"
                                        BorderThickness="1"
                                        CornerRadius="2">
                                        <ProgressBar
                                            Margin="1"
                                            VerticalAlignment="Center"
                                            Background="Transparent"
                                            Foreground="{Binding ComputerBattery, Converter={StaticResource BatteryConverter}}"
                                            Value="{Binding ComputerBattery}" />
                                    </Border>
                                    <Border
                                        Width="2"
                                        Height="10"
                                        BorderBrush="#545454"
                                        BorderThickness="1" />
                                </StackPanel>
                            </DockPanel>

                            <DockPanel Grid.Column="1" HorizontalAlignment="Right">
                                <TextBlock
                                    VerticalAlignment="Center"
                                    FontSize="18"
                                    Foreground="{StaticResource MainThemeColor}"
                                    Text="串口状态:" />

                                <Ellipse
                                    Width="20"
                                    Height="20"
                                    HorizontalAlignment="Left"
                                    Fill="{Binding ConnectColorBrush}" />
                            </DockPanel>
                        </Grid>
                    </Grid>
                </Border>
            </Grid>
        </Grid>
    </DockPanel>
</Window>