chr
2025-03-03 7b903bb86375e9df24a725288d1c876b8d2b0e61
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<UserControl x:Class="Plugin.TestResult_WPF.DataTable"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Plugin.TestResult_WPF"
             mc:Ignorable="d"
             Background="#FFF"
             BorderBrush="Black"
             BorderThickness="1"
             x:Name="control"
             Loaded="UserControl_Loaded"
             d:DesignHeight="450" d:DesignWidth="800">
    <UserControl.Resources>
        <local:FontSizeConverter x:Key="FontSizeConverter"/>
    </UserControl.Resources>
    <Grid x:Name="grid">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="8.5*"/>
            <RowDefinition Height="1.5*"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Grid x:Name="infoGrid" Grid.Row="0"
             Background="LightBlue">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Label Grid.Row="0" Grid.Column="0" Grid.RowSpan="1" FontSize="20" FontWeight="Bold" 
                   Padding="0,0,20,0"
                   BorderThickness="0,0,0,1"
                   BorderBrush="Black"
                   VerticalContentAlignment="Center" Background="Transparent" Content="{Binding title}"/>
            <local:InfoTable x:Name="infoTable" Grid.Row="0" Grid.Column="1"
               FontSize="{Binding ActualWidth,RelativeSource={RelativeSource AncestorType=UserControl}, 
            Converter={StaticResource FontSizeConverter}, ConverterParameter='15,940'}" 
                             ></local:InfoTable>
        </Grid>
 
        <UniformGrid x:Name="mainGrid" Grid.Row="1" Columns="6" local:GridProperties.ShowBorder="True"
                     local:GridProperties.InnerBorderIgnore="All">
        </UniformGrid>
 
        <!--<local:Chart Grid.Row="2" x:Name="chart" BorderThickness="0,1,0,1" BorderBrush="Black" 
                      MouseDoubleClick="chart_MouseDoubleClick"/>-->
 
        <StatusBar Grid.Row="3">
            <StatusBar.ItemsPanel>
                <ItemsPanelTemplate>
                    <DockPanel/>
                </ItemsPanelTemplate>
            </StatusBar.ItemsPanel>
            <StatusBarItem DockPanel.Dock="Right">
                <StackPanel Orientation="Horizontal">
                    <Ellipse Width="10" Height="10">
                        <Ellipse.Style>
                            <Style TargetType="Ellipse">
                                <Setter Property="Fill" Value="Gray"/>
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding TcpServerStatus,ElementName=control}" Value="ERROR">
                                        <Setter Property="Fill" Value="Red"/>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding TcpServerStatus,ElementName=control}" Value="RUNNING">
                                        <Setter Property="Fill" Value="Green"/>
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Ellipse.Style>
                    </Ellipse>
                    <TextBlock Text="{Binding TcpServerInfo}"/>
                    <Button Padding="0" Margin="0" BorderThickness="0" Click="Button_Click">🔄</Button>
                </StackPanel>
            </StatusBarItem>
 
            <StatusBarItem >
                <TextBox IsReadOnly="True" Background="Transparent" BorderThickness="0" Text="{Binding statusText}"/>
            </StatusBarItem>
        </StatusBar>
 
        <Button Grid.Row="4" Margin="0" Click="SetStationGlobal_Click" BorderThickness="0,1,0,0">启动</Button>
    </Grid>
</UserControl>