Files
HC_APTBS/Views/UserControls/TestSectionCard.xaml
LucianoDev 827b811b39 feat: developer tools page, auto-test orchestrator, BIP display, tests redesign
Bundles several feature streams that have been iterating on the working tree:

- Developer Tools page (Debug-only via DEVELOPER_TOOLS symbol): hosts the
  identification card, manual KWP write + transaction log, ROM/EEPROM dump
  card with progress banner and completion message, persisted custom-commands
  library, persisted EEPROM passwords library. New service primitives:
  IKwpService.SendRawCustomAsync / ReadEepromAsync / ReadRomEepromAsync.
  Persistence mirrors the Clients XML pattern in two new files
  (custom_commands.xml, eeprom_passwords.xml).
- Auto-test orchestrator (IAutoTestOrchestrator + AutoTestState): linear
  K-Line read -> unlock -> bench-on -> test sequence with snackbar UI and
  progress dialog VM, gated on dashboard alarms.
- BIP-STATUS display: BipDisplayViewModel + BipDisplayView, RAM read at
  0x0106 via IKwpService.ReadBipStatusAsync; status definitions in
  BipStatusDefinition.
- Tests page redesign: TestSectionCard + PhaseTileView replacing the old
  TestPlanView/TestRunningView/TestDoneView/TestPreconditionsView/
  TestSectionView controls and their VMs.
- Pump command sliders: Fluent thick-track style with overhang thumb,
  click-anywhere-and-drag, mouse-wheel adjustment.
- Window startup: app.manifest declares PerMonitorV2 DPI awareness,
  MainWindow installs a WM_GETMINMAXINFO hook in OnSourceInitialized and
  maximizes there (after the hook is in place) so the app fits the work
  area exactly on any display configuration.
- Misc: PercentToPixelsConverter, seed_aliases.py one-shot pump-alias
  importer, tools/Import-BipStatus.ps1, kline_eeprom_spec.md and
  dump-functions reference docs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-07 13:59:50 +02:00

125 lines
6.2 KiB
XML

<UserControl x:Class="HC_APTBS.Views.UserControls.TestSectionCard"
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:ui="http://schemas.lepo.co/wpfui/2022/xaml"
xmlns:uc="clr-namespace:HC_APTBS.Views.UserControls"
xmlns:vm="clr-namespace:HC_APTBS.ViewModels"
mc:Ignorable="d"
x:Name="Root"
Width="Auto"
d:DataContext="{d:DesignInstance Type=vm:TestSectionViewModel, IsDesignTimeCreatable=False}">
<!--
Fluent card representing one test type (WL, DFI, F, SVME, UP, PFP).
DataContext: TestSectionViewModel. Compact="true" renders phase tiles as
chips (idle planning view); Compact="false" renders them with full vertical
live-bar indicators (while a test is running).
-->
<UserControl.Resources>
<DataTemplate DataType="{x:Type vm:PhaseCardViewModel}">
<uc:PhaseTileView Compact="{Binding Compact,
RelativeSource={RelativeSource AncestorType=uc:TestSectionCard}}"/>
</DataTemplate>
</UserControl.Resources>
<Border Padding="10" Margin="4" Cursor="Hand">
<Border.InputBindings>
<MouseBinding Gesture="LeftClick"
Command="{Binding ToggleAllPhasesCommand}"/>
</Border.InputBindings>
<Border.Style>
<Style TargetType="Border" BasedOn="{StaticResource PumpCard}">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{DynamicResource CardBackgroundFillColorSecondaryBrush}"/>
<Setter Property="BorderBrush" Value="{DynamicResource AccentControlElevationBorderBrush}"/>
</Trigger>
<DataTrigger Binding="{Binding IsActiveTest}" Value="True">
<Setter Property="BorderBrush" Value="#F9A825"/>
<Setter Property="BorderThickness" Value="2"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- Header row -->
<Grid Margin="0,0,0,6">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<ui:SymbolIcon Grid.Column="0"
Symbol="{Binding IconSymbol}"
FontSize="18"
Foreground="{DynamicResource AccentTextFillColorPrimaryBrush}"
VerticalAlignment="Center"
Margin="0,0,8,0"/>
<StackPanel Grid.Column="1" VerticalAlignment="Center">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding TestName}"
FontSize="15" FontWeight="SemiBold"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"/>
<TextBlock Text="{Binding Description}"
FontSize="11" FontStyle="Italic"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Margin="8,0,0,0" VerticalAlignment="Bottom"/>
</StackPanel>
</StackPanel>
<!-- Metadata pills -->
<StackPanel Grid.Column="2" Orientation="Horizontal" Margin="0,0,0,6">
<Border Style="{StaticResource TestMetaPill}">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{DynamicResource Test.Plan.MetaCond}"
Style="{StaticResource TestMetaPillText}"/>
<TextBlock Style="{StaticResource TestMetaPillText}" Margin="3,0,0,0">
<Run Text="{Binding ConditioningTimeSec, Mode=OneWay}"/><Run Text="s"/>
</TextBlock>
</StackPanel>
</Border>
<Border Style="{StaticResource TestMetaPill}">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{DynamicResource Test.Plan.MetaMeas}"
Style="{StaticResource TestMetaPillText}"/>
<TextBlock Style="{StaticResource TestMetaPillText}" Margin="3,0,0,0">
<Run Text="{Binding MeasurementTimeSec, Mode=OneWay}"/><Run Text="s"/>
</TextBlock>
</StackPanel>
</Border>
<Border Style="{StaticResource TestMetaPill}">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{DynamicResource Test.Plan.MetaMps}"
Style="{StaticResource TestMetaPillText}"/>
<TextBlock Style="{StaticResource TestMetaPillText}" Margin="3,0,0,0"
Text="{Binding MeasurementsPerSecond, StringFormat=F1, Mode=OneWay}"/>
</StackPanel>
</Border>
</StackPanel>
</Grid>
<!-- Phase tiles (wrap horizontally inside the card) -->
<ItemsControl Grid.Row="2" ItemsSource="{Binding Phases}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
</Grid>
</Border>
</UserControl>