更新style
This commit is contained in:
@@ -3,12 +3,11 @@
|
|||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
Title="CSI-H238M Precision Friction Tester" Height="800" Width="1024"
|
Title="CSI-H238M Precision Friction Tester" Height="800" Width="1024"
|
||||||
Background="#F0F3F5">
|
Background="#F0F3F5">
|
||||||
|
|
||||||
<Window.Resources>
|
<Window.Resources>
|
||||||
<Style x:Key="NavButtonStyle" TargetType="RadioButton">
|
<Style x:Key="NavButtonStyle" TargetType="RadioButton">
|
||||||
<Setter Property="Width" Value="100"/>
|
<Setter Property="Width" Value="100"/>
|
||||||
<Setter Property="Height" Value="100"/>
|
<Setter Property="Height" Value="100"/>
|
||||||
<Setter Property="Margin" Value="0,5"/>
|
<Setter Property="Margin" Value="0"/>
|
||||||
<Setter Property="Background" Value="Transparent"/>
|
<Setter Property="Background" Value="Transparent"/>
|
||||||
<Setter Property="Foreground" Value="#7F8C8D"/>
|
<Setter Property="Foreground" Value="#7F8C8D"/>
|
||||||
<Setter Property="BorderThickness" Value="0"/>
|
<Setter Property="BorderThickness" Value="0"/>
|
||||||
@@ -36,93 +35,84 @@
|
|||||||
</Setter>
|
</Setter>
|
||||||
</Style>
|
</Style>
|
||||||
</Window.Resources>
|
</Window.Resources>
|
||||||
|
|
||||||
<Grid>
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="60"/>
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="100"/>
|
<ColumnDefinition Width="100"/>
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
<Border Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Background="#2C3E50">
|
||||||
<Border Grid.Column="0" Background="#2C3E50">
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<TextBlock Grid.Column="0" Text="{Binding Lang.AppTitle}" Foreground="White" FontSize="18" FontWeight="Bold" VerticalAlignment="Center" Margin="15,0,0,0" HorizontalAlignment="Left"/>
|
||||||
|
<StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,20,0">
|
||||||
|
<Button Content="{Binding Lang.LanguageButton}" Command="{Binding SwitchLanguageCommand}" Width="60" Height="30" Margin="0,0,15,0" Background="#34495E" Foreground="White" BorderThickness="0" Cursor="Hand" FontSize="12"/>
|
||||||
|
<TextBlock Text="{Binding CurrentDateTime, StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}" Foreground="#BDC3C7" VerticalAlignment="Center" FontSize="12"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
<Border Grid.Row="1" Grid.Column="0" Background="#2C3E50">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<Border Height="60" Background="#34495E">
|
|
||||||
<Ellipse Width="40" Height="40" Fill="#27AE60"/>
|
|
||||||
</Border>
|
|
||||||
<RadioButton x:Name="NavTest" Content="{Binding Lang.NavTest}" Tag="" Style="{StaticResource NavButtonStyle}" IsChecked="True" Checked="NavButton_Checked"/>
|
<RadioButton x:Name="NavTest" Content="{Binding Lang.NavTest}" Tag="" Style="{StaticResource NavButtonStyle}" IsChecked="True" Checked="NavButton_Checked"/>
|
||||||
<RadioButton x:Name="NavHistory" Content="{Binding Lang.NavHistory}" Tag="" Style="{StaticResource NavButtonStyle}" Checked="NavButton_Checked"/>
|
<RadioButton x:Name="NavHistory" Content="{Binding Lang.NavHistory}" Tag="" Style="{StaticResource NavButtonStyle}" Checked="NavButton_Checked"/>
|
||||||
<RadioButton x:Name="NavSettings" Content="{Binding Lang.NavSettings}" Tag="" Style="{StaticResource NavButtonStyle}" Checked="NavButton_Checked"/>
|
<RadioButton x:Name="NavSettings" Content="{Binding Lang.NavSettings}" Tag="" Style="{StaticResource NavButtonStyle}" Checked="NavButton_Checked"/>
|
||||||
<RadioButton x:Name="NavCalibration" Content="{Binding Lang.NavCalibration}" Tag="" Style="{StaticResource NavButtonStyle}" Checked="NavButton_Checked"/>
|
<RadioButton x:Name="NavCalibration" Content="{Binding Lang.NavCalibration}" Tag="" Style="{StaticResource NavButtonStyle}" Checked="NavButton_Checked"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
|
<ContentControl Grid.Row="1" Grid.Column="1" x:Name="ContentArea" Margin="10"/>
|
||||||
<Grid Grid.Column="1">
|
<StatusBar Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Background="White" Padding="10,5">
|
||||||
<Grid.RowDefinitions>
|
<StatusBarItem>
|
||||||
<RowDefinition Height="60"/>
|
<StackPanel Orientation="Horizontal">
|
||||||
<RowDefinition Height="*"/>
|
<TextBlock Text="{Binding Lang.Status}" Foreground="#7F8C8D" Margin="0,0,5,0"/>
|
||||||
<RowDefinition Height="Auto"/>
|
<TextBlock Text="{Binding StatusMessage}" Foreground="#2C3E50" FontWeight="Bold"/>
|
||||||
</Grid.RowDefinitions>
|
</StackPanel>
|
||||||
|
</StatusBarItem>
|
||||||
<Border Grid.Row="0" Background="#2C3E50" Padding="15,0">
|
<Separator/>
|
||||||
<DockPanel>
|
<StatusBarItem>
|
||||||
<StackPanel Orientation="Horizontal" DockPanel.Dock="Left" VerticalAlignment="Center">
|
<StackPanel Orientation="Horizontal">
|
||||||
<TextBlock Text="{Binding Lang.AppTitle}" Foreground="White" FontSize="16" FontWeight="Bold"/>
|
<Ellipse Width="8" Height="8" Margin="0,0,5,0">
|
||||||
</StackPanel>
|
<Ellipse.Style>
|
||||||
<StackPanel Orientation="Horizontal" DockPanel.Dock="Right" HorizontalAlignment="Right" VerticalAlignment="Center">
|
<Style TargetType="Ellipse">
|
||||||
<Button Content="{Binding Lang.LanguageButton}" Command="{Binding SwitchLanguageCommand}" Width="60" Height="30" Margin="0,0,15,0" Background="#34495E" Foreground="White" BorderThickness="0" Cursor="Hand" FontSize="12"/>
|
<Setter Property="Fill" Value="#E74C3C"/>
|
||||||
<TextBlock Text="{Binding CurrentDateTime, StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}" Foreground="#BDC3C7" VerticalAlignment="Center" FontSize="12"/>
|
<Style.Triggers>
|
||||||
</StackPanel>
|
<DataTrigger Binding="{Binding IsConnected}" Value="True">
|
||||||
</DockPanel>
|
<Setter Property="Fill" Value="#27AE60"/>
|
||||||
</Border>
|
</DataTrigger>
|
||||||
|
</Style.Triggers>
|
||||||
<ContentControl Grid.Row="1" x:Name="ContentArea" Margin="10"/>
|
</Style>
|
||||||
|
</Ellipse.Style>
|
||||||
<StatusBar Grid.Row="2" Background="White" Padding="10,5">
|
</Ellipse>
|
||||||
<StatusBarItem>
|
<TextBlock>
|
||||||
<StackPanel Orientation="Horizontal">
|
<TextBlock.Style>
|
||||||
<TextBlock Text="{Binding Lang.Status}" Foreground="#7F8C8D" Margin="0,0,5,0"/>
|
<Style TargetType="TextBlock">
|
||||||
<TextBlock Text="{Binding StatusMessage}" Foreground="#2C3E50" FontWeight="Bold"/>
|
<Setter Property="Text" Value="{Binding Lang.NotConnected}"/>
|
||||||
</StackPanel>
|
<Setter Property="Foreground" Value="#E74C3C"/>
|
||||||
</StatusBarItem>
|
<Style.Triggers>
|
||||||
<Separator/>
|
<DataTrigger Binding="{Binding IsConnected}" Value="True">
|
||||||
<StatusBarItem>
|
<Setter Property="Text" Value="{Binding Lang.Connected}"/>
|
||||||
<StackPanel Orientation="Horizontal">
|
<Setter Property="Foreground" Value="#27AE60"/>
|
||||||
<Ellipse Width="8" Height="8" Margin="0,0,5,0">
|
</DataTrigger>
|
||||||
<Ellipse.Style>
|
<DataTrigger Binding="{Binding IsConnecting}" Value="True">
|
||||||
<Style TargetType="Ellipse">
|
<Setter Property="Text" Value="{Binding Lang.Connecting}"/>
|
||||||
<Setter Property="Fill" Value="#E74C3C"/>
|
<Setter Property="Foreground" Value="#F39C12"/>
|
||||||
<Style.Triggers>
|
</DataTrigger>
|
||||||
<DataTrigger Binding="{Binding IsConnected}" Value="True">
|
</Style.Triggers>
|
||||||
<Setter Property="Fill" Value="#27AE60"/>
|
</Style>
|
||||||
</DataTrigger>
|
</TextBlock.Style>
|
||||||
</Style.Triggers>
|
</TextBlock>
|
||||||
</Style>
|
</StackPanel>
|
||||||
</Ellipse.Style>
|
</StatusBarItem>
|
||||||
</Ellipse>
|
<Separator/>
|
||||||
<TextBlock>
|
<StatusBarItem>
|
||||||
<TextBlock.Style>
|
<TextBlock Text="{Binding CommunicationMode}" Foreground="#7F8C8D" FontSize="11"/>
|
||||||
<Style TargetType="TextBlock">
|
</StatusBarItem>
|
||||||
<Setter Property="Text" Value="{Binding Lang.NotConnected}"/>
|
</StatusBar>
|
||||||
<Setter Property="Foreground" Value="#E74C3C"/>
|
|
||||||
<Style.Triggers>
|
|
||||||
<DataTrigger Binding="{Binding IsConnected}" Value="True">
|
|
||||||
<Setter Property="Text" Value="{Binding Lang.Connected}"/>
|
|
||||||
<Setter Property="Foreground" Value="#27AE60"/>
|
|
||||||
</DataTrigger>
|
|
||||||
<DataTrigger Binding="{Binding IsConnecting}" Value="True">
|
|
||||||
<Setter Property="Text" Value="{Binding Lang.Connecting}"/>
|
|
||||||
<Setter Property="Foreground" Value="#F39C12"/>
|
|
||||||
</DataTrigger>
|
|
||||||
</Style.Triggers>
|
|
||||||
</Style>
|
|
||||||
</TextBlock.Style>
|
|
||||||
</TextBlock>
|
|
||||||
</StackPanel>
|
|
||||||
</StatusBarItem>
|
|
||||||
<Separator/>
|
|
||||||
<StatusBarItem>
|
|
||||||
<TextBlock Text="{Binding CommunicationMode}" Foreground="#7F8C8D" FontSize="11"/>
|
|
||||||
</StatusBarItem>
|
|
||||||
</StatusBar>
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
|
|||||||
@@ -2,10 +2,9 @@
|
|||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:scottplot="clr-namespace:ScottPlot.WPF;assembly=ScottPlot.WPF"
|
xmlns:scottplot="clr-namespace:ScottPlot.WPF;assembly=ScottPlot.WPF"
|
||||||
Background="Transparent">
|
Background="#F0F3F5">
|
||||||
|
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<!-- 卡片样式 -->
|
|
||||||
<Style x:Key="CardStyle" TargetType="Border">
|
<Style x:Key="CardStyle" TargetType="Border">
|
||||||
<Setter Property="Background" Value="White"/>
|
<Setter Property="Background" Value="White"/>
|
||||||
<Setter Property="CornerRadius" Value="8"/>
|
<Setter Property="CornerRadius" Value="8"/>
|
||||||
@@ -18,195 +17,187 @@
|
|||||||
</Setter>
|
</Setter>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<!-- 数字显示样式 -->
|
<Style x:Key="IndustrialButtonStyle" TargetType="Button">
|
||||||
<Style x:Key="DigitalDisplay" TargetType="TextBlock">
|
<Setter Property="FontSize" Value="18"/>
|
||||||
<Setter Property="FontSize" Value="42"/>
|
|
||||||
<Setter Property="FontWeight" Value="Bold"/>
|
<Setter Property="FontWeight" Value="Bold"/>
|
||||||
<Setter Property="Foreground" Value="#2C3E50"/>
|
<Setter Property="Foreground" Value="White"/>
|
||||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
<Setter Property="BorderThickness" Value="0"/>
|
||||||
|
<Setter Property="Cursor" Value="Hand"/>
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="Button">
|
||||||
|
<Border Background="{TemplateBinding Background}" CornerRadius="8">
|
||||||
|
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||||
|
</Border>
|
||||||
|
<ControlTemplate.Triggers>
|
||||||
|
<Trigger Property="IsPressed" Value="True">
|
||||||
|
<Setter Property="RenderTransform">
|
||||||
|
<Setter.Value>
|
||||||
|
<ScaleTransform ScaleX="0.95" ScaleY="0.95"/>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Trigger>
|
||||||
|
</ControlTemplate.Triggers>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="DigitalDisplayStyle" TargetType="TextBlock">
|
||||||
|
<Setter Property="FontFamily" Value="Consolas"/>
|
||||||
|
<Setter Property="FontSize" Value="48"/>
|
||||||
|
<Setter Property="FontWeight" Value="Bold"/>
|
||||||
|
<Setter Property="Foreground" Value="#00FF00"/>
|
||||||
|
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||||
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<SolidColorBrush x:Key="PrimaryBrush" Color="#2C3E50"/>
|
|
||||||
<SolidColorBrush x:Key="AccentBrush" Color="#3498DB"/>
|
|
||||||
<SolidColorBrush x:Key="SuccessBrush" Color="#27AE60"/>
|
|
||||||
<SolidColorBrush x:Key="DangerBrush" Color="#E74C3C"/>
|
|
||||||
<SolidColorBrush x:Key="WarningBrush" Color="#F39C12"/>
|
|
||||||
<SolidColorBrush x:Key="GrayBrush" Color="#7F8C8D"/>
|
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
|
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<ColumnDefinition Width="*"/>
|
<RowDefinition Height="*"/>
|
||||||
<!-- 左侧:图表 -->
|
<RowDefinition Height="100"/>
|
||||||
<ColumnDefinition Width="320"/>
|
</Grid.RowDefinitions>
|
||||||
<!-- 右侧:控制和结果 -->
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
|
|
||||||
<!-- 左侧:图表区域 -->
|
<Grid Grid.Row="0">
|
||||||
<Border Grid.Column="0" Style="{StaticResource CardStyle}">
|
<Grid.ColumnDefinitions>
|
||||||
<Grid>
|
<ColumnDefinition Width="*"/>
|
||||||
<Grid.RowDefinitions>
|
<ColumnDefinition Width="300"/>
|
||||||
<RowDefinition Height="Auto"/>
|
</Grid.ColumnDefinitions>
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
<RowDefinition Height="Auto"/>
|
<!-- 中间:图表区域(最大化) -->
|
||||||
<RowDefinition Height="*"/>
|
<Border Grid.Column="0" Style="{StaticResource CardStyle}">
|
||||||
</Grid.RowDefinitions>
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
<TextBlock Grid.Row="0" Text="{Binding Lang.FrictionCurve}" FontWeight="Bold" Margin="0,0,0,10" Foreground="{StaticResource GrayBrush}" FontSize="16"/>
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
<!-- 试验列表 -->
|
</Grid.RowDefinitions>
|
||||||
<Border Grid.Row="1" Background="#F8F9FA" CornerRadius="4" Padding="10" Margin="0,0,0,10">
|
|
||||||
|
<StackPanel Grid.Row="0" Orientation="Horizontal" Margin="0,0,0,10">
|
||||||
|
<TextBlock Text="{Binding Lang.FrictionCurve}" FontWeight="Bold" FontSize="16" Foreground="#2C3E50" VerticalAlignment="Center"/>
|
||||||
|
<CheckBox Content="{Binding Lang.ShowAllCurves}" IsChecked="{Binding ShowAllCurves}" Margin="20,0,0,0" FontSize="12" VerticalAlignment="Center"/>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<scottplot:WpfPlot Grid.Row="1" x:Name="FrictionPlot"/>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
|
||||||
|
<!-- 右侧:工业仪表盘风格数据区 -->
|
||||||
|
<ScrollViewer Grid.Column="1" VerticalScrollBarVisibility="Auto">
|
||||||
|
<StackPanel>
|
||||||
|
<!-- 实时力值监控 - 工业仪表盘风格 -->
|
||||||
|
<Border Style="{StaticResource CardStyle}" Background="#0A192F">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<TextBlock Text="{Binding Lang.TestList}" FontWeight="Bold" FontSize="12" Margin="0,0,0,5" Foreground="{StaticResource GrayBrush}"/>
|
<TextBlock Text="{Binding Lang.Force}" FontSize="14" Foreground="#BDC3C7" HorizontalAlignment="Center" Margin="0,0,0,5"/>
|
||||||
<ListBox ItemsSource="{Binding TestRecords}" SelectedItem="{Binding LatestResult}"
|
<Border Background="#000000" CornerRadius="4" Padding="10" Margin="0,5">
|
||||||
Background="Transparent" BorderThickness="0" MaxHeight="100">
|
<Viewbox Height="60">
|
||||||
|
<TextBlock Text="{Binding CurrentForce, StringFormat={}{0:F4}}" Style="{StaticResource DigitalDisplayStyle}"/>
|
||||||
|
</Viewbox>
|
||||||
|
</Border>
|
||||||
|
<TextBlock Text="N" FontSize="12" Foreground="#7F8C8D" HorizontalAlignment="Center"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
|
||||||
|
<!-- 实时位移监控 -->
|
||||||
|
<Border Style="{StaticResource CardStyle}" Background="#0A192F">
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="{Binding Lang.Displacement}" FontSize="14" Foreground="#BDC3C7" HorizontalAlignment="Center" Margin="0,0,0,5"/>
|
||||||
|
<Border Background="#000000" CornerRadius="4" Padding="10" Margin="0,5">
|
||||||
|
<Viewbox Height="50">
|
||||||
|
<TextBlock Text="{Binding CurrentDisp, StringFormat={}{0:F2}}" Style="{StaticResource DigitalDisplayStyle}"/>
|
||||||
|
</Viewbox>
|
||||||
|
</Border>
|
||||||
|
<TextBlock Text="mm" FontSize="12" Foreground="#7F8C8D" HorizontalAlignment="Center"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
|
||||||
|
<!-- 测试结果 - 摩擦系数模式 -->
|
||||||
|
<Border Style="{StaticResource CardStyle}">
|
||||||
|
<StackPanel>
|
||||||
|
<StackPanel.Style>
|
||||||
|
<Style TargetType="StackPanel">
|
||||||
|
<Setter Property="Visibility" Value="Visible"/>
|
||||||
|
<Style.Triggers>
|
||||||
|
<DataTrigger Binding="{Binding Parameters.Standard}" Value="GB/T 2792">
|
||||||
|
<Setter Property="Visibility" Value="Collapsed"/>
|
||||||
|
</DataTrigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</StackPanel.Style>
|
||||||
|
|
||||||
|
<TextBlock Text="{Binding Lang.TestResults}" FontWeight="Bold" FontSize="14" Foreground="#2C3E50" Margin="0,0,0,10"/>
|
||||||
|
|
||||||
|
<TextBlock Text="{Binding Lang.StaticCOF}" FontSize="11" Foreground="#7F8C8D"/>
|
||||||
|
<TextBlock Text="{Binding LatestResult.StaticCOF, StringFormat={}{0:F4}, FallbackValue=--}" FontSize="32" FontWeight="Bold" Foreground="#F39C12" HorizontalAlignment="Center"/>
|
||||||
|
|
||||||
|
<Separator Margin="0,10"/>
|
||||||
|
|
||||||
|
<TextBlock Text="{Binding Lang.KineticCOF}" FontSize="11" Foreground="#7F8C8D"/>
|
||||||
|
<TextBlock Text="{Binding LatestResult.KineticCOF, StringFormat={}{0:F4}, FallbackValue=--}" FontSize="32" FontWeight="Bold" Foreground="#F39C12" HorizontalAlignment="Center"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
|
||||||
|
<!-- 测试结果 - 剥离强度模式 -->
|
||||||
|
<Border Style="{StaticResource CardStyle}">
|
||||||
|
<StackPanel>
|
||||||
|
<StackPanel.Style>
|
||||||
|
<Style TargetType="StackPanel">
|
||||||
|
<Setter Property="Visibility" Value="Collapsed"/>
|
||||||
|
<Style.Triggers>
|
||||||
|
<DataTrigger Binding="{Binding Parameters.Standard}" Value="GB/T 2792">
|
||||||
|
<Setter Property="Visibility" Value="Visible"/>
|
||||||
|
</DataTrigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</StackPanel.Style>
|
||||||
|
|
||||||
|
<TextBlock Text="{Binding Lang.TestResults}" FontWeight="Bold" FontSize="14" Foreground="#2C3E50" Margin="0,0,0,10"/>
|
||||||
|
|
||||||
|
<TextBlock Text="{Binding Lang.PeelStrength}" FontSize="11" Foreground="#7F8C8D"/>
|
||||||
|
<TextBlock Text="{Binding LatestResult.PeelStrength_N_25mm, StringFormat={}{0:F3}, FallbackValue=--}" FontSize="32" FontWeight="Bold" Foreground="#27AE60" HorizontalAlignment="Center"/>
|
||||||
|
|
||||||
|
<Separator Margin="0,10"/>
|
||||||
|
|
||||||
|
<TextBlock Text="{Binding Lang.AvgPeelForce}" FontSize="11" Foreground="#7F8C8D"/>
|
||||||
|
<TextBlock Text="{Binding LatestResult.AvgKineticForce, StringFormat={}{0:F3}, FallbackValue=--}" FontSize="28" FontWeight="Bold" Foreground="#3498DB" HorizontalAlignment="Center"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
|
||||||
|
<!-- 试验列表 -->
|
||||||
|
<Border Style="{StaticResource CardStyle}">
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="{Binding Lang.TestList}" FontWeight="Bold" FontSize="12" Foreground="#7F8C8D" Margin="0,0,0,5"/>
|
||||||
|
<ListBox ItemsSource="{Binding TestRecords}" SelectedItem="{Binding LatestResult}" Background="Transparent" BorderThickness="0" MaxHeight="120">
|
||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<StackPanel Orientation="Horizontal" Margin="0,2">
|
<StackPanel Orientation="Horizontal" Margin="0,2">
|
||||||
<CheckBox IsChecked="{Binding IsVisible}" VerticalAlignment="Center" Margin="0,0,5,0"/>
|
<CheckBox IsChecked="{Binding IsVisible}" VerticalAlignment="Center" Margin="0,0,5,0"/>
|
||||||
<TextBlock Text="{Binding SampleNumber}" FontWeight="Bold" VerticalAlignment="Center" FontSize="12"/>
|
<TextBlock Text="{Binding SampleNumber}" FontWeight="Bold" VerticalAlignment="Center" FontSize="11"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ListBox.ItemTemplate>
|
</ListBox.ItemTemplate>
|
||||||
</ListBox>
|
</ListBox>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
|
</StackPanel>
|
||||||
<!-- 显示全部曲线勾选框 -->
|
</ScrollViewer>
|
||||||
<CheckBox Grid.Row="2" Content="{Binding Lang.ShowAllCurves}" IsChecked="{Binding ShowAllCurves}"
|
</Grid>
|
||||||
Margin="0,0,0,10" FontSize="12"/>
|
|
||||||
|
<!-- 底部:工业控制栏 -->
|
||||||
<!-- ScottPlot 实时曲线 -->
|
<Border Grid.Row="1" Background="#2C3E50" Padding="10">
|
||||||
<scottplot:WpfPlot Grid.Row="3" x:Name="FrictionPlot" />
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
<ColumnDefinition Width="200"/>
|
||||||
|
<ColumnDefinition Width="200"/>
|
||||||
|
<ColumnDefinition Width="200"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<Button Grid.Column="1" Content="{Binding Lang.StartTest}" Command="{Binding StartCommand}" Height="70" Background="#27AE60" Style="{StaticResource IndustrialButtonStyle}" Margin="5"/>
|
||||||
|
<Button Grid.Column="2" Content="{Binding Lang.Stop}" Command="{Binding StopCommand}" Height="70" Background="#E94560" Style="{StaticResource IndustrialButtonStyle}" Margin="5"/>
|
||||||
|
<Button Grid.Column="3" Content="{Binding Lang.ResetSystem}" Command="{Binding ResetCommand}" Height="70" Background="#3498DB" Style="{StaticResource IndustrialButtonStyle}" Margin="5"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<!-- 右侧:控制和结果 -->
|
|
||||||
<ScrollViewer Grid.Column="1" VerticalScrollBarVisibility="Auto">
|
|
||||||
<StackPanel>
|
|
||||||
<!-- 实时监控 -->
|
|
||||||
<Border Style="{StaticResource CardStyle}">
|
|
||||||
<StackPanel>
|
|
||||||
<TextBlock Text="{Binding Lang.RealTimeMonitor}" FontWeight="Bold" Margin="0,0,0,10" Foreground="{StaticResource GrayBrush}"/>
|
|
||||||
<TextBlock Text="{Binding Lang.Force}" FontSize="12" HorizontalAlignment="Center"/>
|
|
||||||
<TextBlock Text="{Binding CurrentForce, StringFormat={}{0:F4}}" Style="{StaticResource DigitalDisplay}" Foreground="{StaticResource DangerBrush}" FontSize="36"/>
|
|
||||||
<Separator Margin="0,10"/>
|
|
||||||
<TextBlock Text="{Binding Lang.Displacement}" FontSize="12" HorizontalAlignment="Center"/>
|
|
||||||
<TextBlock Text="{Binding CurrentDisp, StringFormat={}{0:F2}}" Style="{StaticResource DigitalDisplay}" FontSize="28"/>
|
|
||||||
</StackPanel>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- 测试控制 -->
|
|
||||||
<Border Style="{StaticResource CardStyle}">
|
|
||||||
<StackPanel>
|
|
||||||
<TextBlock Text="{Binding Lang.TestControl}" FontWeight="Bold" Margin="0,0,0,10" Foreground="{StaticResource GrayBrush}"/>
|
|
||||||
|
|
||||||
<Button Content="{Binding Lang.StartTest}" Command="{Binding StartCommand}" Height="80" Foreground="White" FontWeight="Bold" Margin="0,5" FontSize="18">
|
|
||||||
<Button.Style>
|
|
||||||
<Style TargetType="Button">
|
|
||||||
<Setter Property="Background" Value="{StaticResource SuccessBrush}"/>
|
|
||||||
<Setter Property="BorderThickness" Value="0"/>
|
|
||||||
<Setter Property="Cursor" Value="Hand"/>
|
|
||||||
</Style>
|
|
||||||
</Button.Style>
|
|
||||||
</Button>
|
|
||||||
<Button Content="{Binding Lang.Stop}" Command="{Binding StopCommand}" Height="60" Foreground="White" Margin="0,5" FontSize="16">
|
|
||||||
<Button.Style>
|
|
||||||
<Style TargetType="Button">
|
|
||||||
<Setter Property="Background" Value="{StaticResource DangerBrush}"/>
|
|
||||||
<Setter Property="BorderThickness" Value="0"/>
|
|
||||||
<Setter Property="Cursor" Value="Hand"/>
|
|
||||||
</Style>
|
|
||||||
</Button.Style>
|
|
||||||
</Button>
|
|
||||||
<Button Content="{Binding Lang.ResetSystem}" Command="{Binding ResetCommand}" Height="50" Foreground="White" Margin="0,5" FontSize="14">
|
|
||||||
<Button.Style>
|
|
||||||
<Style TargetType="Button">
|
|
||||||
<Setter Property="Background" Value="{StaticResource AccentBrush}"/>
|
|
||||||
<Setter Property="BorderThickness" Value="0"/>
|
|
||||||
<Setter Property="Cursor" Value="Hand"/>
|
|
||||||
</Style>
|
|
||||||
</Button.Style>
|
|
||||||
</Button>
|
|
||||||
</StackPanel>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- 测试结果 -->
|
|
||||||
<Border Style="{StaticResource CardStyle}">
|
|
||||||
<StackPanel>
|
|
||||||
<TextBlock Text="{Binding Lang.TestResults}" FontWeight="Bold" Margin="0,0,0,10" Foreground="{StaticResource GrayBrush}"/>
|
|
||||||
|
|
||||||
<!-- 摩擦系数模式 -->
|
|
||||||
<StackPanel x:Name="FrictionResultsPanel">
|
|
||||||
<StackPanel.Style>
|
|
||||||
<Style TargetType="StackPanel">
|
|
||||||
<Setter Property="Visibility" Value="Visible"/>
|
|
||||||
<Style.Triggers>
|
|
||||||
<DataTrigger Binding="{Binding Parameters.Standard}" Value="GB/T 2792">
|
|
||||||
<Setter Property="Visibility" Value="Collapsed"/>
|
|
||||||
</DataTrigger>
|
|
||||||
</Style.Triggers>
|
|
||||||
</Style>
|
|
||||||
</StackPanel.Style>
|
|
||||||
|
|
||||||
<TextBlock Text="{Binding Lang.StaticCOF}" FontSize="11"/>
|
|
||||||
<TextBlock Text="{Binding LatestResult.StaticCOF, StringFormat={}{0:F4}, FallbackValue=--}" FontSize="24" FontWeight="Bold" Foreground="{StaticResource WarningBrush}"/>
|
|
||||||
<Separator Margin="0,8"/>
|
|
||||||
<TextBlock Text="{Binding Lang.KineticCOF}" FontSize="11"/>
|
|
||||||
<TextBlock Text="{Binding LatestResult.KineticCOF, StringFormat={}{0:F4}, FallbackValue=--}" FontSize="24" FontWeight="Bold" Foreground="{StaticResource WarningBrush}"/>
|
|
||||||
<Separator Margin="0,8"/>
|
|
||||||
<TextBlock Text="{Binding Lang.MaxForce}" FontSize="11"/>
|
|
||||||
<TextBlock Text="{Binding LatestResult.MaxForce, StringFormat={}{0:F3}, FallbackValue=--}" FontSize="18" FontWeight="Bold"/>
|
|
||||||
</StackPanel>
|
|
||||||
|
|
||||||
<!-- 剥离强度模式 -->
|
|
||||||
<StackPanel x:Name="PeelResultsPanel">
|
|
||||||
<StackPanel.Style>
|
|
||||||
<Style TargetType="StackPanel">
|
|
||||||
<Setter Property="Visibility" Value="Collapsed"/>
|
|
||||||
<Style.Triggers>
|
|
||||||
<DataTrigger Binding="{Binding Parameters.Standard}" Value="GB/T 2792">
|
|
||||||
<Setter Property="Visibility" Value="Visible"/>
|
|
||||||
</DataTrigger>
|
|
||||||
</Style.Triggers>
|
|
||||||
</Style>
|
|
||||||
</StackPanel.Style>
|
|
||||||
|
|
||||||
<TextBlock Text="{Binding Lang.PeelStrength}" FontSize="11"/>
|
|
||||||
<TextBlock Text="{Binding LatestResult.PeelStrength_N_25mm, StringFormat={}{0:F3}, FallbackValue=--}" FontSize="24" FontWeight="Bold" Foreground="{StaticResource SuccessBrush}"/>
|
|
||||||
<Separator Margin="0,8"/>
|
|
||||||
<TextBlock Text="{Binding Lang.AvgPeelForce}" FontSize="11"/>
|
|
||||||
<TextBlock Text="{Binding LatestResult.AvgKineticForce, StringFormat={}{0:F3}, FallbackValue=--}" FontSize="24" FontWeight="Bold" Foreground="{StaticResource AccentBrush}"/>
|
|
||||||
<Separator Margin="0,8"/>
|
|
||||||
<TextBlock Text="{Binding Lang.MaxForce}" FontSize="11"/>
|
|
||||||
<TextBlock Text="{Binding LatestResult.MaxForce, StringFormat={}{0:F3}, FallbackValue=--}" FontSize="18" FontWeight="Bold"/>
|
|
||||||
</StackPanel>
|
|
||||||
</StackPanel>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- 快速结果预览 -->
|
|
||||||
<Border Style="{StaticResource CardStyle}">
|
|
||||||
<StackPanel>
|
|
||||||
<TextBlock Text="{Binding Lang.CurrentTest}" FontWeight="Bold" Margin="0,0,0,10" Foreground="{StaticResource GrayBrush}"/>
|
|
||||||
<Grid>
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
<ColumnDefinition Width="*"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
|
|
||||||
<TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding Lang.DataPoints}" Margin="0,5" FontSize="11"/>
|
|
||||||
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding DataPointsCount, FallbackValue=0}" FontWeight="Bold" Margin="5,5" HorizontalAlignment="Right" FontSize="11"/>
|
|
||||||
|
|
||||||
<TextBlock Grid.Row="1" Grid.Column="0" Text="{Binding Lang.TestTime}" Margin="0,5" FontSize="11"/>
|
|
||||||
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding LatestResult.TestDateTime, StringFormat={}{0:HH:mm:ss}, FallbackValue=--}" FontWeight="Bold" Margin="5,5" HorizontalAlignment="Right" FontSize="11"/>
|
|
||||||
</Grid>
|
|
||||||
</StackPanel>
|
|
||||||
</Border>
|
|
||||||
</StackPanel>
|
|
||||||
</ScrollViewer>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
Reference in New Issue
Block a user