| | |
| | | <UserControl x:Class="Util.SB.ManualDebug" |
| | | <UserControl x:Class="Util.ManualDebug.ManualDebug" |
| | | xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| | | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| | | xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| | | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| | | xmlns:local="clr-namespace:Util.SB" |
| | | xmlns:local="clr-namespace:Util.ManualDebug" |
| | | xmlns:dp="clr-namespace:HMI.UI.DpUtil;assembly=HMI.UI" |
| | | mc:Ignorable="d" |
| | | x:Name="self" |
| | | MinHeight="400" MinWidth="500"> |
| | |
| | | </UserControl.Resources> |
| | | |
| | | <Grid> |
| | | <Grid.RowDefinitions> |
| | | <RowDefinition/> |
| | | <RowDefinition Height="Auto"/> |
| | | </Grid.RowDefinitions> |
| | | <Grid Margin="10"> |
| | | <Grid.RowDefinitions> |
| | | <RowDefinition Height="Auto"/> |
| | | <RowDefinition Height="5"/> |
| | | <RowDefinition Height="*"/> |
| | | <RowDefinition Height="5"/> |
| | | <RowDefinition Height="*"/> |
| | | </Grid.RowDefinitions> |
| | | <WindowsFormsHost x:Name="host" Visibility="Collapsed"></WindowsFormsHost> |
| | | <Grid.ColumnDefinitions> |
| | | <ColumnDefinition Width="Auto"/> |
| | | <ColumnDefinition/> |
| | | </Grid.ColumnDefinitions> |
| | | |
| | | <!-- 按钮和状态区域 --> |
| | | <Border Grid.Row="0" Background="{StaticResource TsPanelBrush}" |
| | | <Grid x:Name="CellSelectBorder"> |
| | | <Grid.RowDefinitions> |
| | | <RowDefinition/> |
| | | <RowDefinition/> |
| | | </Grid.RowDefinitions> |
| | | |
| | | <Border Background="{StaticResource TsPanelBrush}" Margin="0,0,10,5" |
| | | BorderBrush="{StaticResource BorderBrush}" |
| | | BorderThickness="1" CornerRadius="4" Padding="15"> |
| | | <StackPanel> |
| | | <TextBlock Text="穴位选择" FontSize="14" FontWeight="SemiBold" |
| | | Foreground="{StaticResource PrimaryBrush}" Margin="0,0,0,15"/> |
| | | |
| | | <UniformGrid IsEnabled="False" x:Name="CellGrid" dp:UniformGridHelper.InnerBorder="1" Columns="1" |
| | | dp:UniformGridHelper.InnerBorderBrush="{StaticResource BorderBrush}"> |
| | | |
| | | </UniformGrid> |
| | | </StackPanel> |
| | | </Border> |
| | | |
| | | <Border Grid.Row="1" Background="{StaticResource TsPanelBrush}" Margin="0,5,10,0" |
| | | BorderBrush="{StaticResource BorderBrush}" |
| | | BorderThickness="1" CornerRadius="4" Padding="15"> |
| | | <StackPanel> |
| | | <TextBlock Text="穴位测试结果" FontSize="14" FontWeight="SemiBold" |
| | | Foreground="{StaticResource PrimaryBrush}" Margin="0,0,0,15"/> |
| | | |
| | | <UniformGrid IsEnabled="False" x:Name="CellResultGrid" Columns="1" dp:UniformGridHelper.InnerBorder="1" |
| | | dp:UniformGridHelper.InnerBorderBrush="{StaticResource BorderBrush}"> |
| | | |
| | | </UniformGrid> |
| | | </StackPanel> |
| | | </Border> |
| | | </Grid> |
| | | |
| | | <Grid Grid.Column="1"> |
| | | <Grid.RowDefinitions> |
| | | <RowDefinition Height="Auto"/> |
| | | <RowDefinition Height="5"/> |
| | | <RowDefinition Height="*"/> |
| | | <RowDefinition Height="5"/> |
| | | <RowDefinition Height="*"/> |
| | | </Grid.RowDefinitions> |
| | | <WindowsFormsHost x:Name="host" Visibility="Collapsed"></WindowsFormsHost> |
| | | |
| | | <!-- 按钮和状态区域 --> |
| | | <Border Grid.Row="0" Background="{StaticResource TsPanelBrush}" |
| | | BorderBrush="{StaticResource BorderBrush}" |
| | | BorderThickness="1" CornerRadius="4" Padding="15"> |
| | | <StackPanel> |
| | | <TextBlock Text="手动调试控制" FontSize="14" FontWeight="SemiBold" |
| | | <StackPanel> |
| | | <TextBlock Text="手动调试控制" FontSize="14" FontWeight="SemiBold" |
| | | Foreground="{StaticResource PrimaryBrush}" Margin="0,0,0,15"/> |
| | | |
| | | <WrapPanel x:Name="btnPanel"> |
| | | <WrapPanel x:Name="btnPanel"> |
| | | |
| | | </WrapPanel> |
| | | </StackPanel> |
| | | </Border> |
| | | </WrapPanel> |
| | | </StackPanel> |
| | | </Border> |
| | | |
| | | <!-- 分隔条1 --> |
| | | <GridSplitter Grid.Row="1" Height="5" HorizontalAlignment="Stretch" |
| | | <!-- 分隔条1 --> |
| | | <GridSplitter Grid.Row="1" Height="5" HorizontalAlignment="Stretch" |
| | | Background="Transparent" Cursor="SizeNS"/> |
| | | |
| | | <!-- TX/RX 数据区域 --> |
| | | <Border Grid.Row="2" Background="{StaticResource TsPanelBrush}" |
| | | <!-- TX/RX 数据区域 --> |
| | | <Border Grid.Row="2" Background="{StaticResource TsPanelBrush}" |
| | | BorderBrush="{StaticResource BorderBrush}" |
| | | BorderThickness="1" CornerRadius="4" Padding="10"> |
| | | <Grid> |
| | | <Grid.RowDefinitions> |
| | | <RowDefinition Height="Auto"/> |
| | | <RowDefinition Height="*"/> |
| | | </Grid.RowDefinitions> |
| | | <Grid> |
| | | <Grid.RowDefinitions> |
| | | <RowDefinition Height="Auto"/> |
| | | <RowDefinition Height="*"/> |
| | | </Grid.RowDefinitions> |
| | | |
| | | <StackPanel Orientation="Horizontal" Grid.Row="0" Margin="0,0,0,10"> |
| | | <TextBlock Text="测试数据" FontSize="14" FontWeight="SemiBold" |
| | | <StackPanel Orientation="Horizontal" Grid.Row="0" Margin="0,0,0,10"> |
| | | <TextBlock Text="测试数据" FontSize="14" FontWeight="SemiBold" |
| | | Foreground="{StaticResource PrimaryBrush}" VerticalAlignment="Center"/> |
| | | <Button Content="清空" Style="{StaticResource ActionButtonStyle}" |
| | | <Button Content="清空" Style="{StaticResource ActionButtonStyle}" |
| | | Margin="15,0,0,0" Click="OnClearClick"/> |
| | | </StackPanel> |
| | | </StackPanel> |
| | | |
| | | <DataGrid x:Name="DataGridComm" Grid.Row="1" |
| | | <DataGrid x:Name="DataGridComm" Grid.Row="1" |
| | | ItemsSource="{Binding TestData,ElementName=self}"> |
| | | <DataGrid.Columns> |
| | | <DataGridTextColumn Header="测试项" Binding="{Binding Name}" Width="120" IsReadOnly="True"/> |
| | | <DataGridTextColumn Header="收" Binding="{Binding Receive}" Width="*" IsReadOnly="True"/> |
| | | <DataGridTextColumn Header="发" Binding="{Binding Send}" Width="*" IsReadOnly="True"/> |
| | | <DataGridTextColumn Header="单位" Binding="{Binding Unit}" Width="60" IsReadOnly="True"/> |
| | | <DataGridTextColumn Header="上限" Binding="{Binding UpperLimit}" Width="80" IsReadOnly="True"/> |
| | | <DataGridTextColumn Header="下限" Binding="{Binding LowerLimit}" Width="80" IsReadOnly="True"/> |
| | | <DataGridTextColumn Header="结果" Binding="{Binding Result}" Width="70" IsReadOnly="True"/> |
| | | <DataGridTextColumn Header="时间" Binding="{Binding Time}" Width="90" IsReadOnly="True"/> |
| | | </DataGrid.Columns> |
| | | <DataGrid.RowStyle> |
| | | <Style TargetType="DataGridRow"> |
| | | <Style.Triggers> |
| | | <DataTrigger Value="True"> |
| | | <DataTrigger.Binding> |
| | | <MultiBinding Converter="{x:Static local:ResultFailedConverter.Instance}"> |
| | | <Binding Path="Result"/> |
| | | </MultiBinding> |
| | | </DataTrigger.Binding> |
| | | <Setter Property="Background" Value="#FFE0E0"/> |
| | | <Setter Property="Foreground" Value="#C53030"/> |
| | | </DataTrigger> |
| | | </Style.Triggers> |
| | | </Style> |
| | | </DataGrid.RowStyle> |
| | | </DataGrid> |
| | | </Grid> |
| | | </Border> |
| | | <DataGrid.Columns> |
| | | <DataGridTextColumn Header="测试项" Binding="{Binding Name}" Width="120" IsReadOnly="True"/> |
| | | <DataGridTextColumn Header="收" Binding="{Binding Receive}" Width="*" IsReadOnly="True"/> |
| | | <DataGridTextColumn Header="发" Binding="{Binding Send}" Width="*" IsReadOnly="True"/> |
| | | <DataGridTextColumn Header="单位" Binding="{Binding Unit}" Width="60" IsReadOnly="True"/> |
| | | <DataGridTextColumn Header="上限" Binding="{Binding UpperLimit}" Width="80" IsReadOnly="True"/> |
| | | <DataGridTextColumn Header="下限" Binding="{Binding LowerLimit}" Width="80" IsReadOnly="True"/> |
| | | <DataGridTextColumn Header="结果" Binding="{Binding Result}" Width="70" IsReadOnly="True"/> |
| | | <DataGridTextColumn Header="时间" Binding="{Binding Time}" Width="90" IsReadOnly="True"/> |
| | | </DataGrid.Columns> |
| | | <DataGrid.RowStyle> |
| | | <Style TargetType="DataGridRow"> |
| | | <Style.Triggers> |
| | | <DataTrigger Value="True"> |
| | | <DataTrigger.Binding> |
| | | <MultiBinding Converter="{x:Static local:ResultFailedConverter.Instance}"> |
| | | <Binding Path="Result"/> |
| | | </MultiBinding> |
| | | </DataTrigger.Binding> |
| | | <Setter Property="Background" Value="#FFE0E0"/> |
| | | <Setter Property="Foreground" Value="#C53030"/> |
| | | </DataTrigger> |
| | | </Style.Triggers> |
| | | </Style> |
| | | </DataGrid.RowStyle> |
| | | </DataGrid> |
| | | </Grid> |
| | | </Border> |
| | | |
| | | <!-- 分隔条2 --> |
| | | <GridSplitter Grid.Row="3" Height="5" HorizontalAlignment="Stretch" |
| | | <!-- 分隔条2 --> |
| | | <GridSplitter Grid.Row="3" Height="5" HorizontalAlignment="Stretch" |
| | | Background="Transparent" Cursor="SizeNS"/> |
| | | |
| | | <!-- 日志区域 --> |
| | | <Border Grid.Row="4" Background="{StaticResource TsPanelBrush}" |
| | | <!-- 日志区域 --> |
| | | <Border Grid.Row="4" Background="{StaticResource TsPanelBrush}" |
| | | BorderBrush="{StaticResource BorderBrush}" |
| | | BorderThickness="1" CornerRadius="4" Padding="10"> |
| | | <Grid> |
| | | <Grid.RowDefinitions> |
| | | <RowDefinition Height="Auto"/> |
| | | <RowDefinition Height="*"/> |
| | | </Grid.RowDefinitions> |
| | | <Grid> |
| | | <Grid.RowDefinitions> |
| | | <RowDefinition Height="Auto"/> |
| | | <RowDefinition Height="*"/> |
| | | </Grid.RowDefinitions> |
| | | |
| | | <StackPanel Orientation="Horizontal" Grid.Row="0" Margin="0,0,0,8"> |
| | | <TextBlock Text="日志" FontSize="14" FontWeight="SemiBold" |
| | | <StackPanel Orientation="Horizontal" Grid.Row="0" Margin="0,0,0,8"> |
| | | <TextBlock Text="日志" FontSize="14" FontWeight="SemiBold" |
| | | Foreground="{StaticResource PrimaryBrush}" VerticalAlignment="Center"/> |
| | | <Button Content="清空日志" Style="{StaticResource ActionButtonStyle}" |
| | | <Button Content="清空日志" Style="{StaticResource ActionButtonStyle}" |
| | | Margin="15,0,0,0" Click="OnClearLogClick"/> |
| | | </StackPanel> |
| | | </StackPanel> |
| | | |
| | | <RichTextBox x:Name="LogRichTextBox" Grid.Row="1" |
| | | <RichTextBox x:Name="LogRichTextBox" Grid.Row="1" |
| | | IsReadOnly="True" |
| | | VerticalScrollBarVisibility="Auto" |
| | | FontFamily="Consolas" |
| | |
| | | BorderThickness="1" |
| | | BorderBrush="Black" |
| | | Padding="4"/> |
| | | </Grid> |
| | | </Grid> |
| | | </Border> |
| | | </Grid> |
| | | <Border Background="#AAFFFFFF" Grid.ColumnSpan="2" x:Name="mask"> |
| | | <TextBlock Text="初始化中..." |
| | | FontSize="16" FontWeight="Bold" Foreground="{StaticResource PrimaryBrush}" HorizontalAlignment="Center" VerticalAlignment="Center"/> |
| | | </Border> |
| | | </Grid> |
| | | <Border Background="#AAFFFFFF" x:Name="mask"> |
| | | <TextBlock Text="初始化中..." |
| | | FontSize="16" FontWeight="Bold" Foreground="{StaticResource PrimaryBrush}" HorizontalAlignment="Center" VerticalAlignment="Center"/> |
| | | </Border> |
| | | |
| | | <StatusBar FontSize="14" Grid.Row="1"> |
| | | <StatusBar.ItemsPanel> |
| | | <ItemsPanelTemplate> |
| | | <DockPanel LastChildFill="False"/> |
| | | </ItemsPanelTemplate> |
| | | </StatusBar.ItemsPanel> |
| | | |
| | | <StatusBarItem DockPanel.Dock="Left"> |
| | | <StackPanel Orientation="Horizontal" dp:StackPanelHelper.ChildSpace="8"> |
| | | <StackPanel Orientation="Horizontal"> |
| | | <Ellipse Width="10" Height="10"> |
| | | <Ellipse.Style> |
| | | <Style TargetType="Ellipse"> |
| | | <Setter Property="Fill" Value="LightGray"/> |
| | | <Style.Triggers> |
| | | <DataTrigger Binding="{Binding TcpServerStatus,ElementName=self}" Value="ERROR"> |
| | | <Setter Property="Fill" Value="Red"/> |
| | | </DataTrigger> |
| | | <DataTrigger Binding="{Binding TcpServerStatus,ElementName=self}" Value="RUNNING"> |
| | | <Setter Property="Fill" Value="Green"/> |
| | | </DataTrigger> |
| | | </Style.Triggers> |
| | | </Style> |
| | | </Ellipse.Style> |
| | | </Ellipse> |
| | | <TextBlock Text="{Binding TcpServerInfo,ElementName=self}"/> |
| | | <Button Padding="0" Margin="0" BorderThickness="0" Click="Button_Click">🔄</Button> |
| | | </StackPanel> |
| | | </StackPanel> |
| | | </StatusBarItem> |
| | | </StatusBar> |
| | | </Grid> |
| | | </UserControl> |