feat: redesign UI with Taffy desktop theme
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 252 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 220 KiB |
@@ -12,6 +12,8 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Resource Include="Assets\taffy-avatar.jpg" />
|
||||||
|
<Resource Include="Assets\taffy-visual.jpg" />
|
||||||
<Content Include="Native\x86\ControlCAN.dll">
|
<Content Include="Native\x86\ControlCAN.dll">
|
||||||
<Link>ControlCAN.dll</Link>
|
<Link>ControlCAN.dll</Link>
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
|||||||
+280
-91
@@ -1,100 +1,289 @@
|
|||||||
<Window x:Class="BmsMonitor.App.MainWindow"
|
<Window x:Class="BmsMonitor.App.MainWindow"
|
||||||
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"
|
||||||
Title="BMS Monitor - CANTest驱动版 v0.2" Height="780" Width="1240" MinHeight="650" MinWidth="1000"
|
Title="TAFFY BMS Monitor" Height="820" Width="1280" MinHeight="680" MinWidth="1080"
|
||||||
Background="#0B1220" Foreground="#E8EEF7" Closing="Window_Closing">
|
Background="#F3F2F6" Foreground="#2D2933" Closing="Window_Closing"
|
||||||
|
FontFamily="Microsoft YaHei UI">
|
||||||
<Window.Resources>
|
<Window.Resources>
|
||||||
<Style TargetType="Button"><Setter Property="Padding" Value="18,8"/><Setter Property="Margin" Value="6,0"/><Setter Property="Background" Value="#2563EB"/><Setter Property="Foreground" Value="White"/><Setter Property="BorderThickness" Value="0"/></Style>
|
<SolidColorBrush x:Key="Pink" Color="#E8589C"/>
|
||||||
<Style TargetType="ComboBox"><Setter Property="Padding" Value="8,5"/><Setter Property="MinWidth" Value="90"/><Setter Property="Margin" Value="6,0"/></Style>
|
<SolidColorBrush x:Key="PinkSoft" Color="#C63D82"/>
|
||||||
<Style x:Key="Card" TargetType="Border"><Setter Property="Background" Value="#121D2F"/><Setter Property="CornerRadius" Value="8"/><Setter Property="Padding" Value="18"/><Setter Property="Margin" Value="6"/></Style>
|
<SolidColorBrush x:Key="Purple" Color="#7653A6"/>
|
||||||
<Style x:Key="Value" TargetType="TextBlock"><Setter Property="FontSize" Value="27"/><Setter Property="FontWeight" Value="SemiBold"/><Setter Property="Foreground" Value="#60A5FA"/><Setter Property="Margin" Value="0,8,0,0"/></Style>
|
<SolidColorBrush x:Key="TextPrimary" Color="#2D2933"/>
|
||||||
|
<SolidColorBrush x:Key="TextSecondary" Color="#6F6878"/>
|
||||||
|
<SolidColorBrush x:Key="Panel" Color="#FFFFFFFF"/>
|
||||||
|
<SolidColorBrush x:Key="PanelLight" Color="#FFF8F4FA"/>
|
||||||
|
<SolidColorBrush x:Key="Stroke" Color="#FFD8D3DD"/>
|
||||||
|
|
||||||
|
<Style TargetType="Button">
|
||||||
|
<Setter Property="Foreground" Value="White"/>
|
||||||
|
<Setter Property="Background" Value="#E8589C"/>
|
||||||
|
<Setter Property="BorderThickness" Value="0"/>
|
||||||
|
<Setter Property="Padding" Value="16,7"/>
|
||||||
|
<Setter Property="Margin" Value="5,0"/>
|
||||||
|
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||||
|
<Setter Property="Cursor" Value="Hand"/>
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="Button">
|
||||||
|
<Border x:Name="ButtonBorder" Background="{TemplateBinding Background}" CornerRadius="4" Padding="{TemplateBinding Padding}">
|
||||||
|
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||||
|
</Border>
|
||||||
|
<ControlTemplate.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True"><Setter TargetName="ButtonBorder" Property="Opacity" Value="0.86"/></Trigger>
|
||||||
|
<Trigger Property="IsPressed" Value="True"><Setter TargetName="ButtonBorder" Property="Opacity" Value="0.68"/></Trigger>
|
||||||
|
</ControlTemplate.Triggers>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style TargetType="ComboBox">
|
||||||
|
<Setter Property="MinWidth" Value="105"/>
|
||||||
|
<Setter Property="Height" Value="32"/>
|
||||||
|
<Setter Property="Margin" Value="7,0"/>
|
||||||
|
<Setter Property="Padding" Value="9,4"/>
|
||||||
|
<Setter Property="Background" Value="White"/>
|
||||||
|
<Setter Property="Foreground" Value="#2D2933"/>
|
||||||
|
<Setter Property="BorderBrush" Value="#FFCBC5D2"/>
|
||||||
|
<Setter Property="BorderThickness" Value="1"/>
|
||||||
|
</Style>
|
||||||
|
<Style TargetType="ComboBoxItem">
|
||||||
|
<Setter Property="Background" Value="White"/>
|
||||||
|
<Setter Property="Foreground" Value="#2D2933"/>
|
||||||
|
<Setter Property="Padding" Value="10,7"/>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="Card" TargetType="Border">
|
||||||
|
<Setter Property="Background" Value="{StaticResource Panel}"/>
|
||||||
|
<Setter Property="BorderBrush" Value="{StaticResource Stroke}"/>
|
||||||
|
<Setter Property="BorderThickness" Value="1"/>
|
||||||
|
<Setter Property="CornerRadius" Value="5"/>
|
||||||
|
<Setter Property="Padding" Value="13"/>
|
||||||
|
<Setter Property="Margin" Value="4"/>
|
||||||
|
</Style>
|
||||||
|
<Style x:Key="Value" TargetType="TextBlock">
|
||||||
|
<Setter Property="FontSize" Value="24"/>
|
||||||
|
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||||
|
<Setter Property="Foreground" Value="#B52E72"/>
|
||||||
|
<Setter Property="Margin" Value="0,5,0,0"/>
|
||||||
|
</Style>
|
||||||
|
<Style x:Key="CardLabel" TargetType="TextBlock">
|
||||||
|
<Setter Property="Foreground" Value="{StaticResource TextSecondary}"/>
|
||||||
|
<Setter Property="FontSize" Value="13"/>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style TargetType="TabControl">
|
||||||
|
<Setter Property="Background" Value="Transparent"/>
|
||||||
|
<Setter Property="BorderThickness" Value="0"/>
|
||||||
|
</Style>
|
||||||
|
<Style TargetType="TabItem">
|
||||||
|
<Setter Property="Foreground" Value="{StaticResource TextSecondary}"/>
|
||||||
|
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||||
|
<Setter Property="Padding" Value="17,8"/>
|
||||||
|
<Setter Property="Margin" Value="0,0,2,6"/>
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="TabItem">
|
||||||
|
<Border x:Name="TabBorder" Background="#FFE8E5EC" BorderBrush="#FFD3CED8" BorderThickness="1" CornerRadius="4,4,0,0" Padding="{TemplateBinding Padding}">
|
||||||
|
<ContentPresenter ContentSource="Header" HorizontalAlignment="Center"/>
|
||||||
|
</Border>
|
||||||
|
<ControlTemplate.Triggers>
|
||||||
|
<Trigger Property="IsSelected" Value="True">
|
||||||
|
<Setter TargetName="TabBorder" Property="Background" Value="#FFE8589C"/>
|
||||||
|
<Setter Property="Foreground" Value="White"/>
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True"><Setter TargetName="TabBorder" Property="Opacity" Value="0.84"/></Trigger>
|
||||||
|
</ControlTemplate.Triggers>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
<Style TargetType="DataGrid">
|
||||||
|
<Setter Property="Background" Value="White"/>
|
||||||
|
<Setter Property="Foreground" Value="#2D2933"/>
|
||||||
|
<Setter Property="BorderBrush" Value="{StaticResource Stroke}"/>
|
||||||
|
<Setter Property="BorderThickness" Value="1"/>
|
||||||
|
<Setter Property="RowBackground" Value="White"/>
|
||||||
|
<Setter Property="AlternatingRowBackground" Value="#FFF8F4FA"/>
|
||||||
|
<Setter Property="HorizontalGridLinesBrush" Value="#FFE4E0E7"/>
|
||||||
|
<Setter Property="VerticalGridLinesBrush" Value="Transparent"/>
|
||||||
|
<Setter Property="RowHeight" Value="34"/>
|
||||||
|
<Setter Property="HeadersVisibility" Value="Column"/>
|
||||||
|
</Style>
|
||||||
|
<Style TargetType="DataGridColumnHeader">
|
||||||
|
<Setter Property="Background" Value="#FFECE8EF"/>
|
||||||
|
<Setter Property="Foreground" Value="#6D3B62"/>
|
||||||
|
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||||
|
<Setter Property="Padding" Value="10,9"/>
|
||||||
|
<Setter Property="BorderThickness" Value="0"/>
|
||||||
|
</Style>
|
||||||
|
<Style TargetType="DataGridCell">
|
||||||
|
<Setter Property="BorderThickness" Value="0"/>
|
||||||
|
<Setter Property="Padding" Value="8,5"/>
|
||||||
|
<Setter Property="Foreground" Value="#2D2933"/>
|
||||||
|
</Style>
|
||||||
</Window.Resources>
|
</Window.Resources>
|
||||||
<Grid Margin="18">
|
|
||||||
<Grid.RowDefinitions><RowDefinition Height="Auto"/><RowDefinition Height="*"/><RowDefinition Height="Auto"/></Grid.RowDefinitions>
|
<Grid Background="#F3F2F6">
|
||||||
<Border Grid.Row="0" Background="#121D2F" CornerRadius="8" Padding="14" Margin="0,0,0,12">
|
<Grid Margin="14">
|
||||||
<DockPanel>
|
<Grid.RowDefinitions>
|
||||||
<StackPanel DockPanel.Dock="Left" Orientation="Horizontal" VerticalAlignment="Center">
|
<RowDefinition Height="Auto"/>
|
||||||
<TextBlock Text="BMS Monitor" FontSize="22" FontWeight="Bold" Margin="0,0,24,0"/>
|
<RowDefinition Height="*"/>
|
||||||
<TextBlock Text="设备" VerticalAlignment="Center"/><ComboBox x:Name="DeviceCombo" SelectedIndex="0"><ComboBoxItem Content="ZLG USBCAN #0"/></ComboBox>
|
<RowDefinition Height="Auto"/>
|
||||||
<TextBlock Text="通道" VerticalAlignment="Center" Margin="12,0,0,0"/><ComboBox x:Name="ChannelCombo" SelectedIndex="0"><ComboBoxItem Content="CAN1"/><ComboBoxItem Content="CAN2"/></ComboBox>
|
</Grid.RowDefinitions>
|
||||||
<TextBlock Text="波特率" VerticalAlignment="Center" Margin="12,0,0,0"/>
|
|
||||||
<ComboBox x:Name="BaudRateCombo" SelectedIndex="0">
|
<Border Grid.Row="0" CornerRadius="6" Padding="12" Margin="0,0,0,9" BorderBrush="#FFE7A4C5" BorderThickness="1" ClipToBounds="True">
|
||||||
<ComboBoxItem Content="250 kbit/s" Tag="250"/>
|
<Border.Background>
|
||||||
<ComboBoxItem Content="500 kbit/s" Tag="500"/>
|
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
|
||||||
</ComboBox>
|
<GradientStop Color="#FFF8DDEA" Offset="0"/>
|
||||||
<TextBlock Text="只读" Foreground="#94A3B8" VerticalAlignment="Center" Margin="8,0,14,0"/>
|
<GradientStop Color="#FFF2C4DD" Offset="0.48"/>
|
||||||
</StackPanel>
|
<GradientStop Color="#FFE5D4F3" Offset="1"/>
|
||||||
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal" HorizontalAlignment="Right"><Button x:Name="ConnectButton" Content="连接" Click="ConnectButton_Click"/><Button Content="清空报文" Background="#334155" Click="ClearButton_Click"/></StackPanel>
|
</LinearGradientBrush>
|
||||||
</DockPanel>
|
</Border.Background>
|
||||||
</Border>
|
<Grid>
|
||||||
<TabControl Grid.Row="1" Background="#0B1220" BorderThickness="0">
|
<Grid.ColumnDefinitions><ColumnDefinition Width="Auto"/><ColumnDefinition Width="Auto"/><ColumnDefinition Width="*"/><ColumnDefinition Width="Auto"/></Grid.ColumnDefinitions>
|
||||||
<TabItem Header="实时监控"><ScrollViewer VerticalScrollBarVisibility="Auto"><StackPanel Margin="0,12">
|
<Image Grid.Column="2" Grid.ColumnSpan="2" Source="Assets/taffy-visual.jpg" Width="420" Stretch="UniformToFill" HorizontalAlignment="Right" Opacity="0.16" Margin="0,-80,-12,-80"/>
|
||||||
<UniformGrid Columns="3">
|
<Ellipse Grid.Column="0" Width="54" Height="54" Stroke="#FFFFFFFF" StrokeThickness="3" Margin="0,0,12,0">
|
||||||
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="总电压" Foreground="#94A3B8"/><TextBlock x:Name="PackVoltageText" Text="--.- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
<Ellipse.Fill><ImageBrush ImageSource="Assets/taffy-avatar.jpg" Stretch="UniformToFill"/></Ellipse.Fill>
|
||||||
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="SOC" Foreground="#94A3B8"/><TextBlock x:Name="SocText" Text="-- %" Style="{StaticResource Value}"/></StackPanel></Border>
|
</Ellipse>
|
||||||
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="工作状态" Foreground="#94A3B8"/><TextBlock x:Name="BmsStateText" Text="等待报文" Style="{StaticResource Value}"/></StackPanel></Border>
|
<StackPanel Grid.Column="1" VerticalAlignment="Center" Margin="0,0,22,0">
|
||||||
</UniformGrid>
|
<StackPanel Orientation="Horizontal">
|
||||||
<UniformGrid Columns="5">
|
<TextBlock Text="BMS Monitor" FontSize="21" FontWeight="Bold" Foreground="#6C3556"/>
|
||||||
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="最高单体" Foreground="#94A3B8"/><TextBlock x:Name="MaxCellText" Text="-.--- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
<Border Background="#FFE8589C" CornerRadius="3" Padding="7,2" Margin="8,1,0,0"><TextBlock Text="TAFFY" FontSize="10" FontWeight="Bold" Foreground="White"/></Border>
|
||||||
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="最低单体" Foreground="#94A3B8"/><TextBlock x:Name="MinCellText" Text="-.--- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
|
||||||
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="最高温度" Foreground="#94A3B8"/><TextBlock x:Name="MaxTempText" Text="-- °C" Style="{StaticResource Value}"/></StackPanel></Border>
|
|
||||||
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="最低温度" Foreground="#94A3B8"/><TextBlock x:Name="MinTempText" Text="-- °C" Style="{StaticResource Value}"/></StackPanel></Border>
|
|
||||||
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="低压电池" Foreground="#94A3B8"/><TextBlock x:Name="LowBatteryText" Text="--.- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
|
||||||
</UniformGrid>
|
|
||||||
<Border Style="{StaticResource Card}" Margin="6,16,6,6"><StackPanel><TextBlock Text="当前故障" FontSize="16" FontWeight="SemiBold"/><TextBlock x:Name="FaultText" Text="等待数据" Foreground="#FCA5A5" FontSize="18" Margin="0,12,0,0" TextWrapping="Wrap"/></StackPanel></Border>
|
|
||||||
</StackPanel></ScrollViewer></TabItem>
|
|
||||||
<TabItem Header="电流 I">
|
|
||||||
<Grid Margin="24">
|
|
||||||
<Border Style="{StaticResource Card}" Width="420" Height="220" HorizontalAlignment="Center" VerticalAlignment="Center">
|
|
||||||
<StackPanel VerticalAlignment="Center">
|
|
||||||
<TextBlock Text="总电流 I" Foreground="#94A3B8" FontSize="20" HorizontalAlignment="Center"/>
|
|
||||||
<TextBlock x:Name="PackCurrentText" Text="--.- A" Foreground="#60A5FA" FontSize="64" FontWeight="SemiBold" Margin="0,18,0,0" HorizontalAlignment="Center"/>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
<TextBlock Text="♡ 永雏塔菲主题 · 电池状态看板 ✦" FontSize="12" Foreground="#A24476" Margin="0,3,0,0"/>
|
||||||
</Grid>
|
|
||||||
</TabItem>
|
|
||||||
<TabItem Header="电芯与温度">
|
|
||||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
|
||||||
<StackPanel Margin="6,12">
|
|
||||||
<TextBlock Text="16 路电芯电压" FontSize="18" FontWeight="SemiBold" Margin="6,0,6,6"/>
|
|
||||||
<UniformGrid Columns="4">
|
|
||||||
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="电芯 01" Foreground="#94A3B8"/><TextBlock x:Name="Cell01Text" Text="-- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
|
||||||
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="电芯 02" Foreground="#94A3B8"/><TextBlock x:Name="Cell02Text" Text="-- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
|
||||||
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="电芯 03" Foreground="#94A3B8"/><TextBlock x:Name="Cell03Text" Text="-- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
|
||||||
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="电芯 04" Foreground="#94A3B8"/><TextBlock x:Name="Cell04Text" Text="-- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
|
||||||
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="电芯 05" Foreground="#94A3B8"/><TextBlock x:Name="Cell05Text" Text="-- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
|
||||||
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="电芯 06" Foreground="#94A3B8"/><TextBlock x:Name="Cell06Text" Text="-- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
|
||||||
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="电芯 07" Foreground="#94A3B8"/><TextBlock x:Name="Cell07Text" Text="-- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
|
||||||
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="电芯 08" Foreground="#94A3B8"/><TextBlock x:Name="Cell08Text" Text="-- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
|
||||||
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="电芯 09" Foreground="#94A3B8"/><TextBlock x:Name="Cell09Text" Text="-- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
|
||||||
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="电芯 10" Foreground="#94A3B8"/><TextBlock x:Name="Cell10Text" Text="-- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
|
||||||
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="电芯 11" Foreground="#94A3B8"/><TextBlock x:Name="Cell11Text" Text="-- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
|
||||||
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="电芯 12" Foreground="#94A3B8"/><TextBlock x:Name="Cell12Text" Text="-- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
|
||||||
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="电芯 13" Foreground="#94A3B8"/><TextBlock x:Name="Cell13Text" Text="-- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
|
||||||
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="电芯 14" Foreground="#94A3B8"/><TextBlock x:Name="Cell14Text" Text="-- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
|
||||||
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="电芯 15" Foreground="#94A3B8"/><TextBlock x:Name="Cell15Text" Text="-- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
|
||||||
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="电芯 16" Foreground="#94A3B8"/><TextBlock x:Name="Cell16Text" Text="-- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
|
||||||
</UniformGrid>
|
|
||||||
<TextBlock Text="10 路温度采集" FontSize="18" FontWeight="SemiBold" Margin="6,18,6,6"/>
|
|
||||||
<UniformGrid Columns="5">
|
|
||||||
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="温采 01" Foreground="#94A3B8"/><TextBlock x:Name="Temp01Text" Text="-- °C" Style="{StaticResource Value}"/></StackPanel></Border>
|
|
||||||
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="温采 02" Foreground="#94A3B8"/><TextBlock x:Name="Temp02Text" Text="-- °C" Style="{StaticResource Value}"/></StackPanel></Border>
|
|
||||||
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="温采 03" Foreground="#94A3B8"/><TextBlock x:Name="Temp03Text" Text="-- °C" Style="{StaticResource Value}"/></StackPanel></Border>
|
|
||||||
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="温采 04" Foreground="#94A3B8"/><TextBlock x:Name="Temp04Text" Text="-- °C" Style="{StaticResource Value}"/></StackPanel></Border>
|
|
||||||
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="温采 05" Foreground="#94A3B8"/><TextBlock x:Name="Temp05Text" Text="-- °C" Style="{StaticResource Value}"/></StackPanel></Border>
|
|
||||||
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="温采 06" Foreground="#94A3B8"/><TextBlock x:Name="Temp06Text" Text="-- °C" Style="{StaticResource Value}"/></StackPanel></Border>
|
|
||||||
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="温采 07" Foreground="#94A3B8"/><TextBlock x:Name="Temp07Text" Text="-- °C" Style="{StaticResource Value}"/></StackPanel></Border>
|
|
||||||
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="温采 08" Foreground="#94A3B8"/><TextBlock x:Name="Temp08Text" Text="-- °C" Style="{StaticResource Value}"/></StackPanel></Border>
|
|
||||||
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="温采 09" Foreground="#94A3B8"/><TextBlock x:Name="Temp09Text" Text="-- °C" Style="{StaticResource Value}"/></StackPanel></Border>
|
|
||||||
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="温采 10" Foreground="#94A3B8"/><TextBlock x:Name="Temp10Text" Text="-- °C" Style="{StaticResource Value}"/></StackPanel></Border>
|
|
||||||
</UniformGrid>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</ScrollViewer>
|
<StackPanel Grid.Column="2" Orientation="Horizontal" VerticalAlignment="Center">
|
||||||
</TabItem>
|
<TextBlock Text="设备" VerticalAlignment="Center" Foreground="#5D5365"/>
|
||||||
<TabItem Header="CAN 报文"><DataGrid x:Name="FrameGrid" Margin="0,12,0,0" IsReadOnly="True" AutoGenerateColumns="False" Background="#121D2F" Foreground="#E8EEF7" RowBackground="#121D2F" AlternatingRowBackground="#17243A" GridLinesVisibility="Horizontal" HeadersVisibility="Column" CanUserAddRows="False">
|
<ComboBox x:Name="DeviceCombo" SelectedIndex="0"><ComboBoxItem Content="ZLG USBCAN #0"/></ComboBox>
|
||||||
<DataGrid.Columns><DataGridTextColumn Header="时间" Binding="{Binding Timestamp, StringFormat=HH:mm:ss.fff}" Width="150"/><DataGridTextColumn Header="ID" Binding="{Binding IdText}" Width="120"/><DataGridTextColumn Header="类型" Binding="{Binding FrameType}" Width="100"/><DataGridTextColumn Header="DLC" Binding="{Binding Dlc}" Width="70"/><DataGridTextColumn Header="数据" Binding="{Binding DataText}" Width="*"/></DataGrid.Columns>
|
<TextBlock Text="通道" VerticalAlignment="Center" Foreground="#5D5365" Margin="7,0,0,0"/>
|
||||||
</DataGrid></TabItem>
|
<ComboBox x:Name="ChannelCombo" SelectedIndex="0"><ComboBoxItem Content="CAN1"/><ComboBoxItem Content="CAN2"/></ComboBox>
|
||||||
</TabControl>
|
<TextBlock Text="波特率" VerticalAlignment="Center" Foreground="#5D5365" Margin="7,0,0,0"/>
|
||||||
<DockPanel Grid.Row="2" Margin="4,10,4,0"><Ellipse x:Name="StatusDot" Width="10" Height="10" Fill="#64748B" Margin="0,0,8,0"/><TextBlock x:Name="StatusText" Text="未连接" Foreground="#94A3B8"/><TextBlock x:Name="CounterText" Text="接收 0 帧" Foreground="#94A3B8" HorizontalAlignment="Right"/></DockPanel>
|
<ComboBox x:Name="BaudRateCombo" SelectedIndex="0">
|
||||||
|
<ComboBoxItem Content="250 kbit/s" Tag="250"/>
|
||||||
|
<ComboBoxItem Content="500 kbit/s" Tag="500"/>
|
||||||
|
</ComboBox>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Grid.Column="3" Orientation="Horizontal" VerticalAlignment="Center">
|
||||||
|
<Button x:Name="ConnectButton" Content="连接设备" Click="ConnectButton_Click"/>
|
||||||
|
<Button Content="清空报文" Background="#8A718F" Click="ClearButton_Click"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
|
||||||
|
<TabControl Grid.Row="1">
|
||||||
|
<TabItem Header="♡ 概览">
|
||||||
|
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||||
|
<StackPanel Margin="0,2,0,10">
|
||||||
|
<Border Height="88" CornerRadius="5" BorderBrush="#FFE4B5D0" BorderThickness="1" Margin="4,0,4,5" ClipToBounds="True">
|
||||||
|
<Grid>
|
||||||
|
<Image Source="Assets/taffy-visual.jpg" Stretch="UniformToFill" Opacity="0.42"/>
|
||||||
|
<Rectangle><Rectangle.Fill><LinearGradientBrush StartPoint="0,0" EndPoint="1,0"><GradientStop Color="#FFFDF6FA" Offset="0"/><GradientStop Color="#F5FDF6FA" Offset="0.45"/><GradientStop Color="#30FFFFFF" Offset="1"/></LinearGradientBrush></Rectangle.Fill></Rectangle>
|
||||||
|
<StackPanel VerticalAlignment="Center" Margin="20,0">
|
||||||
|
<TextBlock Text="TAFFY BATTERY STATUS" FontSize="18" FontWeight="Bold" Foreground="#753A61"/>
|
||||||
|
<TextBlock Text="✦ 连接 CAN 后,塔菲会在这里陪你看电池状态喵 ♡" FontSize="13" Foreground="#A24D7D" Margin="0,5,0,0"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
<UniformGrid Columns="3">
|
||||||
|
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="总电压" Style="{StaticResource CardLabel}"/><TextBlock x:Name="PackVoltageText" Text="--.- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
||||||
|
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="SOC" Style="{StaticResource CardLabel}"/><TextBlock x:Name="SocText" Text="-- %" Style="{StaticResource Value}"/></StackPanel></Border>
|
||||||
|
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="工作状态" Style="{StaticResource CardLabel}"/><TextBlock x:Name="BmsStateText" Text="等待报文" Style="{StaticResource Value}"/></StackPanel></Border>
|
||||||
|
</UniformGrid>
|
||||||
|
<UniformGrid Columns="5">
|
||||||
|
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="最高单体" Style="{StaticResource CardLabel}"/><TextBlock x:Name="MaxCellText" Text="-.--- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
||||||
|
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="最低单体" Style="{StaticResource CardLabel}"/><TextBlock x:Name="MinCellText" Text="-.--- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
||||||
|
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="最高温度" Style="{StaticResource CardLabel}"/><TextBlock x:Name="MaxTempText" Text="-- °C" Style="{StaticResource Value}"/></StackPanel></Border>
|
||||||
|
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="最低温度" Style="{StaticResource CardLabel}"/><TextBlock x:Name="MinTempText" Text="-- °C" Style="{StaticResource Value}"/></StackPanel></Border>
|
||||||
|
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="低压电池" Style="{StaticResource CardLabel}"/><TextBlock x:Name="LowBatteryText" Text="--.- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
||||||
|
</UniformGrid>
|
||||||
|
<Border Style="{StaticResource Card}" Margin="6,14,6,6">
|
||||||
|
<Grid><Grid.ColumnDefinitions><ColumnDefinition Width="Auto"/><ColumnDefinition Width="*"/></Grid.ColumnDefinitions>
|
||||||
|
<Border Width="6" Background="#FFFF72B6" CornerRadius="3" Margin="0,0,14,0"/>
|
||||||
|
<StackPanel Grid.Column="1"><TextBlock Text="当前故障" FontSize="15" FontWeight="SemiBold"/><TextBlock x:Name="FaultText" Text="等待数据" Foreground="#C83E78" FontSize="18" Margin="0,9,0,0" TextWrapping="Wrap"/></StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
</StackPanel>
|
||||||
|
</ScrollViewer>
|
||||||
|
</TabItem>
|
||||||
|
|
||||||
|
<TabItem Header="⚡ 电流 I">
|
||||||
|
<Grid Margin="24">
|
||||||
|
<Border Style="{StaticResource Card}" Width="500" Height="270" HorizontalAlignment="Center" VerticalAlignment="Center" BorderBrush="#99FF72B6" BorderThickness="2">
|
||||||
|
<Grid>
|
||||||
|
<Ellipse Width="220" Height="220" Opacity="0.12"><Ellipse.Fill><RadialGradientBrush><GradientStop Color="#FFFF72B6" Offset="0"/><GradientStop Color="Transparent" Offset="1"/></RadialGradientBrush></Ellipse.Fill></Ellipse>
|
||||||
|
<StackPanel VerticalAlignment="Center">
|
||||||
|
<TextBlock Text="CURRENT / 总电流 I" Foreground="{StaticResource TextSecondary}" FontSize="16" HorizontalAlignment="Center"/>
|
||||||
|
<TextBlock x:Name="PackCurrentText" Text="--.- A" Foreground="{StaticResource PinkSoft}" FontSize="68" FontWeight="Bold" Margin="0,15,0,0" HorizontalAlignment="Center"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
</Grid>
|
||||||
|
</TabItem>
|
||||||
|
|
||||||
|
<TabItem Header="✦ 电芯与温度">
|
||||||
|
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||||
|
<StackPanel Margin="0,2,0,12">
|
||||||
|
<TextBlock Text="CELL VOLTAGE · 16 路电芯" FontSize="17" FontWeight="SemiBold" Foreground="{StaticResource PinkSoft}" Margin="6,5,6,6"/>
|
||||||
|
<UniformGrid Columns="4">
|
||||||
|
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="电芯 01" Style="{StaticResource CardLabel}"/><TextBlock x:Name="Cell01Text" Text="-- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
||||||
|
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="电芯 02" Style="{StaticResource CardLabel}"/><TextBlock x:Name="Cell02Text" Text="-- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
||||||
|
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="电芯 03" Style="{StaticResource CardLabel}"/><TextBlock x:Name="Cell03Text" Text="-- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
||||||
|
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="电芯 04" Style="{StaticResource CardLabel}"/><TextBlock x:Name="Cell04Text" Text="-- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
||||||
|
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="电芯 05" Style="{StaticResource CardLabel}"/><TextBlock x:Name="Cell05Text" Text="-- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
||||||
|
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="电芯 06" Style="{StaticResource CardLabel}"/><TextBlock x:Name="Cell06Text" Text="-- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
||||||
|
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="电芯 07" Style="{StaticResource CardLabel}"/><TextBlock x:Name="Cell07Text" Text="-- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
||||||
|
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="电芯 08" Style="{StaticResource CardLabel}"/><TextBlock x:Name="Cell08Text" Text="-- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
||||||
|
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="电芯 09" Style="{StaticResource CardLabel}"/><TextBlock x:Name="Cell09Text" Text="-- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
||||||
|
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="电芯 10" Style="{StaticResource CardLabel}"/><TextBlock x:Name="Cell10Text" Text="-- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
||||||
|
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="电芯 11" Style="{StaticResource CardLabel}"/><TextBlock x:Name="Cell11Text" Text="-- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
||||||
|
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="电芯 12" Style="{StaticResource CardLabel}"/><TextBlock x:Name="Cell12Text" Text="-- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
||||||
|
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="电芯 13" Style="{StaticResource CardLabel}"/><TextBlock x:Name="Cell13Text" Text="-- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
||||||
|
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="电芯 14" Style="{StaticResource CardLabel}"/><TextBlock x:Name="Cell14Text" Text="-- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
||||||
|
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="电芯 15" Style="{StaticResource CardLabel}"/><TextBlock x:Name="Cell15Text" Text="-- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
||||||
|
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="电芯 16" Style="{StaticResource CardLabel}"/><TextBlock x:Name="Cell16Text" Text="-- V" Style="{StaticResource Value}"/></StackPanel></Border>
|
||||||
|
</UniformGrid>
|
||||||
|
<TextBlock Text="TEMPERATURE · 10 路温采" FontSize="17" FontWeight="SemiBold" Foreground="{StaticResource Purple}" Margin="6,20,6,6"/>
|
||||||
|
<UniformGrid Columns="5">
|
||||||
|
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="温采 01" Style="{StaticResource CardLabel}"/><TextBlock x:Name="Temp01Text" Text="-- °C" Style="{StaticResource Value}"/></StackPanel></Border>
|
||||||
|
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="温采 02" Style="{StaticResource CardLabel}"/><TextBlock x:Name="Temp02Text" Text="-- °C" Style="{StaticResource Value}"/></StackPanel></Border>
|
||||||
|
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="温采 03" Style="{StaticResource CardLabel}"/><TextBlock x:Name="Temp03Text" Text="-- °C" Style="{StaticResource Value}"/></StackPanel></Border>
|
||||||
|
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="温采 04" Style="{StaticResource CardLabel}"/><TextBlock x:Name="Temp04Text" Text="-- °C" Style="{StaticResource Value}"/></StackPanel></Border>
|
||||||
|
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="温采 05" Style="{StaticResource CardLabel}"/><TextBlock x:Name="Temp05Text" Text="-- °C" Style="{StaticResource Value}"/></StackPanel></Border>
|
||||||
|
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="温采 06" Style="{StaticResource CardLabel}"/><TextBlock x:Name="Temp06Text" Text="-- °C" Style="{StaticResource Value}"/></StackPanel></Border>
|
||||||
|
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="温采 07" Style="{StaticResource CardLabel}"/><TextBlock x:Name="Temp07Text" Text="-- °C" Style="{StaticResource Value}"/></StackPanel></Border>
|
||||||
|
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="温采 08" Style="{StaticResource CardLabel}"/><TextBlock x:Name="Temp08Text" Text="-- °C" Style="{StaticResource Value}"/></StackPanel></Border>
|
||||||
|
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="温采 09" Style="{StaticResource CardLabel}"/><TextBlock x:Name="Temp09Text" Text="-- °C" Style="{StaticResource Value}"/></StackPanel></Border>
|
||||||
|
<Border Style="{StaticResource Card}"><StackPanel><TextBlock Text="温采 10" Style="{StaticResource CardLabel}"/><TextBlock x:Name="Temp10Text" Text="-- °C" Style="{StaticResource Value}"/></StackPanel></Border>
|
||||||
|
</UniformGrid>
|
||||||
|
</StackPanel>
|
||||||
|
</ScrollViewer>
|
||||||
|
</TabItem>
|
||||||
|
|
||||||
|
<TabItem Header="▦ CAN 报文">
|
||||||
|
<Border Style="{StaticResource Card}" Padding="0" Margin="0,2,0,10">
|
||||||
|
<DataGrid x:Name="FrameGrid" IsReadOnly="True" AutoGenerateColumns="False" CanUserAddRows="False" GridLinesVisibility="Horizontal">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="时间" Binding="{Binding Timestamp, StringFormat=HH:mm:ss.fff}" Width="150"/>
|
||||||
|
<DataGridTextColumn Header="ID" Binding="{Binding IdText}" Width="120"/>
|
||||||
|
<DataGridTextColumn Header="类型" Binding="{Binding FrameType}" Width="100"/>
|
||||||
|
<DataGridTextColumn Header="DLC" Binding="{Binding Dlc}" Width="70"/>
|
||||||
|
<DataGridTextColumn Header="数据" Binding="{Binding DataText}" Width="*"/>
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</DataGrid>
|
||||||
|
</Border>
|
||||||
|
</TabItem>
|
||||||
|
</TabControl>
|
||||||
|
|
||||||
|
<Border Grid.Row="2" Background="#FFFDF7FA" BorderBrush="{StaticResource Stroke}" BorderThickness="1" CornerRadius="5" Padding="12,9" Margin="0,8,0,0">
|
||||||
|
<Grid>
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<Ellipse x:Name="StatusDot" Width="10" Height="10" Fill="#FF806D87" Margin="0,0,9,0" VerticalAlignment="Center"/>
|
||||||
|
<TextBlock x:Name="StatusText" Text="未连接" Foreground="{StaticResource TextSecondary}" VerticalAlignment="Center"/>
|
||||||
|
</StackPanel>
|
||||||
|
<TextBlock x:Name="CounterText" Text="接收 0 帧" Foreground="{StaticResource PinkSoft}" HorizontalAlignment="Right" VerticalAlignment="Center"/>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
|
|||||||
@@ -139,6 +139,10 @@ CAN 通信层
|
|||||||
|
|
||||||
采用 x86 构建是为了匹配当前使用的 32 位 `ControlCAN.dll`。
|
采用 x86 构建是为了匹配当前使用的 32 位 `ControlCAN.dll`。
|
||||||
|
|
||||||
|
## 界面主题
|
||||||
|
|
||||||
|
界面采用 CrystalDiskInfo 式的紧凑信息布局,并融入永雏塔菲的粉紫配色、头像、主题视觉与桃心/星星状态元素。主题图片取自[永雏塔菲的哔哩哔哩官方空间](https://space.bilibili.com/1265680561)。
|
||||||
|
|
||||||
## 使用
|
## 使用
|
||||||
|
|
||||||
1. 安装 CAN 盒厂商驱动。
|
1. 安装 CAN 盒厂商驱动。
|
||||||
|
|||||||
Reference in New Issue
Block a user