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>
This commit is contained in:
@@ -22,8 +22,8 @@
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Interlock banner — hidden unless an interlock condition is active -->
|
||||
<uc:InterlockBannerView Grid.Row="0" DataContext="{Binding Interlock}"
|
||||
Margin="0,0,0,8"/>
|
||||
<uc:InterlockBannerView Grid.Row="0" DataContext="{Binding Interlock}" Height="66"
|
||||
Margin="0,0,0,0"/>
|
||||
|
||||
<!-- Three-column body -->
|
||||
<Grid Grid.Row="1">
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- ── Row 0: Connection strip ─────────────────────────────────────── -->
|
||||
<uc:DashboardConnectionView Grid.Row="0"/>
|
||||
<uc:DashboardConnectionView Grid.Row="0" Height="66"/>
|
||||
|
||||
<!-- ── Row 1: KPI grid (left) + devices column (centre) + test/alarms (right) -->
|
||||
<Grid Grid.Row="1" Margin="0,0,0,8">
|
||||
@@ -36,13 +36,13 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- KPI readings grid -->
|
||||
<uc:DashboardReadingsView Grid.Column="0" Margin="0,0,4,0"/>
|
||||
<uc:DashboardReadingsView Grid.Column="0" Margin="0,0,0,0"/>
|
||||
|
||||
<!-- Devices column: CAN / K-Line / Bench device tiles -->
|
||||
<uc:DashboardDevicesView Grid.Column="1" Margin="4,0,4,0"/>
|
||||
<uc:DashboardDevicesView Grid.Column="1" Margin="4"/>
|
||||
|
||||
<!-- Right column: test summary + alarms -->
|
||||
<Grid Grid.Column="2" Margin="4,0,0,0">
|
||||
<Grid Grid.Column="2" Margin="4">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
@@ -315,18 +315,38 @@
|
||||
</ui:Button.Icon>
|
||||
</ui:Button>
|
||||
|
||||
<!-- Start Test -->
|
||||
<!-- Connect & Auto Test — transforms into Cancel while running -->
|
||||
<ui:Button DockPanel.Dock="Left"
|
||||
Appearance="Primary"
|
||||
Content="{DynamicResource Dashboard.Action.StartTest}"
|
||||
Command="{Binding Root.StartTestCommand}"
|
||||
MinWidth="160" Height="46"
|
||||
MinWidth="200" Height="46"
|
||||
Margin="0,0,8,0"
|
||||
ToolTipService.ShowOnDisabled="True"
|
||||
ToolTip="{DynamicResource Dashboard.Action.StartTest.Tip}">
|
||||
<ui:Button.Icon>
|
||||
<ui:SymbolIcon Symbol="PlayCircle24"/>
|
||||
</ui:Button.Icon>
|
||||
ToolTipService.ShowOnDisabled="True">
|
||||
<ui:Button.Style>
|
||||
<Style TargetType="ui:Button" BasedOn="{StaticResource {x:Type ui:Button}}">
|
||||
<!-- Default (idle): Connect & Auto Test -->
|
||||
<Setter Property="Appearance" Value="Primary"/>
|
||||
<Setter Property="Content" Value="{DynamicResource Dashboard.Action.AutoTest}"/>
|
||||
<Setter Property="Command" Value="{Binding Root.ConnectAndAutoTestCommand}"/>
|
||||
<Setter Property="ToolTip" Value="{DynamicResource Dashboard.Action.AutoTest.Tip}"/>
|
||||
<Setter Property="Icon">
|
||||
<Setter.Value>
|
||||
<ui:SymbolIcon Symbol="Play24"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<!-- Running: swap to Cancel appearance -->
|
||||
<DataTrigger Binding="{Binding Root.IsAutoTestActive}" Value="True">
|
||||
<Setter Property="Appearance" Value="Caution"/>
|
||||
<Setter Property="Content" Value="{DynamicResource Common.Cancel}"/>
|
||||
<Setter Property="Command" Value="{Binding Root.CancelAutoTestCommand}"/>
|
||||
<Setter Property="Icon">
|
||||
<Setter.Value>
|
||||
<ui:SymbolIcon Symbol="DismissCircle24"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</ui:Button.Style>
|
||||
</ui:Button>
|
||||
|
||||
<!-- Stop -->
|
||||
|
||||
420
Views/Pages/DeveloperPage.xaml
Normal file
420
Views/Pages/DeveloperPage.xaml
Normal file
@@ -0,0 +1,420 @@
|
||||
<UserControl x:Class="HC_APTBS.Views.Pages.DeveloperPage"
|
||||
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.Pages"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="900" d:DesignWidth="1400"
|
||||
d:DataContext="{d:DesignInstance vm:DeveloperPageViewModel, IsDesignTimeCreatable=False}">
|
||||
<!--
|
||||
Developer Tools page — raw KWP/K-Line workbench. Compiled into Debug builds
|
||||
only via the DEVELOPER_TOOLS symbol; the page files are removed from Release
|
||||
builds in HC_APTBS.csproj.
|
||||
|
||||
Layout:
|
||||
Col 0 (1*, 4 stacked cards): Identification, Dump, Custom commands, EEPROM passwords
|
||||
Col 1 (1.5*): Manual hex write + transaction log (full height)
|
||||
-->
|
||||
<UserControl.Resources>
|
||||
<BooleanToVisibilityConverter x:Key="BoolToVis"/>
|
||||
|
||||
<Style x:Key="DevSectionHeader" TargetType="TextBlock">
|
||||
<Setter Property="FontFamily" Value="{DynamicResource ContentControlThemeFontFamily}"/>
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextFillColorPrimaryBrush}"/>
|
||||
<Setter Property="Margin" Value="0,0,0,8"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="DevFieldLabel" TargetType="TextBlock">
|
||||
<Setter Property="FontSize" Value="12"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextFillColorSecondaryBrush}"/>
|
||||
<Setter Property="Margin" Value="0,0,0,2"/>
|
||||
</Style>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid Margin="12">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*" MinWidth="320"/>
|
||||
<ColumnDefinition Width="1.5*" MinWidth="380"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- ── Big "DUMP IN PROGRESS" banner — only for dumps > 0x0A00 bytes ── -->
|
||||
<Border Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
|
||||
Margin="0,0,0,12" Padding="20,14" CornerRadius="8"
|
||||
Background="{DynamicResource AccentFillColorDefaultBrush}"
|
||||
DataContext="{Binding Dump}"
|
||||
Visibility="{Binding IsLargeDumpInProgress, Converter={StaticResource BoolToVis}}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<ui:SymbolIcon Grid.Column="0" Grid.RowSpan="2"
|
||||
Symbol="ArrowDownload24" FontSize="34"
|
||||
Foreground="{DynamicResource TextOnAccentFillColorPrimaryBrush}"
|
||||
VerticalAlignment="Center" Margin="0,0,16,0"/>
|
||||
|
||||
<StackPanel Grid.Column="1" Grid.Row="0" Margin="0,0,0,4">
|
||||
<TextBlock Text="DUMP IN PROGRESS"
|
||||
FontSize="22" FontWeight="SemiBold"
|
||||
Foreground="{DynamicResource TextOnAccentFillColorPrimaryBrush}"/>
|
||||
<TextBlock FontSize="13"
|
||||
Foreground="{DynamicResource TextOnAccentFillColorSecondaryBrush}">
|
||||
<Run Text="Reading "/>
|
||||
<Run Text="{Binding Region}"/>
|
||||
<Run Text=" — "/>
|
||||
<Run Text="{Binding TotalBytes}"/>
|
||||
<Run Text=" bytes total. Current address "/>
|
||||
<Run Text="0x"/>
|
||||
<Run Text="{Binding CurrentAddress, StringFormat=X4, Mode=OneWay}"/>
|
||||
<Run Text="."/>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Column="2" Grid.Row="0" VerticalAlignment="Center">
|
||||
<TextBlock HorizontalAlignment="Right"
|
||||
FontSize="26" FontWeight="SemiBold"
|
||||
Foreground="{DynamicResource TextOnAccentFillColorPrimaryBrush}">
|
||||
<Run Text="{Binding BytesCollected, Mode=OneWay}"/>
|
||||
<Run Text=" / "/>
|
||||
<Run Text="{Binding TotalBytes, Mode=OneWay}"/>
|
||||
</TextBlock>
|
||||
<TextBlock HorizontalAlignment="Right" FontSize="11"
|
||||
Foreground="{DynamicResource TextOnAccentFillColorSecondaryBrush}"
|
||||
Text="bytes"/>
|
||||
</StackPanel>
|
||||
|
||||
<ProgressBar Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="1"
|
||||
Value="{Binding Progress, Mode=OneWay}" Maximum="1"
|
||||
Height="10"
|
||||
Margin="0,8,0,0"
|
||||
Background="{DynamicResource AccentFillColorSecondaryBrush}"
|
||||
Foreground="{DynamicResource TextOnAccentFillColorPrimaryBrush}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- ── Left column: stacked tool cards ──────────────────────────────── -->
|
||||
<Grid Grid.Row="1" Grid.Column="0" Margin="0,0,6,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Identification card — reuse the existing UserControl, bound to the singleton VM -->
|
||||
<uc:PumpIdentificationCard Grid.Row="0"
|
||||
DataContext="{Binding Identification}"
|
||||
Margin="0,0,0,8"/>
|
||||
|
||||
<!-- ── Dump card ────────────────────────────────────────────────── -->
|
||||
<Border Grid.Row="1" Style="{StaticResource PumpCard}" Margin="0,0,0,8"
|
||||
DataContext="{Binding Dump}">
|
||||
<StackPanel>
|
||||
<DockPanel Margin="0,0,0,8">
|
||||
<ui:SymbolIcon DockPanel.Dock="Left" Symbol="ArrowDownload24" FontSize="16"
|
||||
Foreground="{DynamicResource AccentTextFillColorPrimaryBrush}"
|
||||
Margin="0,0,8,0" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="ROM / EEPROM dump" Style="{StaticResource DevSectionHeader}" Margin="0"/>
|
||||
</DockPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,8">
|
||||
<RadioButton GroupName="DumpRegion" Content="ROM"
|
||||
IsChecked="{Binding IsRomSelected, Mode=TwoWay}"
|
||||
Margin="0,0,16,0"/>
|
||||
<RadioButton GroupName="DumpRegion" Content="EEPROM"
|
||||
IsChecked="{Binding IsEepromSelected, Mode=TwoWay}"/>
|
||||
</StackPanel>
|
||||
|
||||
<Grid Margin="0,0,0,8">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Grid.Column="0" Margin="0,0,4,0">
|
||||
<TextBlock Text="Start (hex)" Style="{StaticResource DevFieldLabel}"/>
|
||||
<ui:TextBox Text="{Binding StartAddressHex, UpdateSourceTrigger=PropertyChanged}"
|
||||
FontFamily="Consolas, 'Courier New'"/>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="1" Margin="4,0,0,0">
|
||||
<TextBlock Text="End (hex)" Style="{StaticResource DevFieldLabel}"/>
|
||||
<ui:TextBox Text="{Binding EndAddressHex, UpdateSourceTrigger=PropertyChanged}"
|
||||
FontFamily="Consolas, 'Courier New'"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<DockPanel Margin="0,0,0,4">
|
||||
<ui:Button DockPanel.Dock="Right"
|
||||
Appearance="Primary"
|
||||
Content="Dump"
|
||||
Icon="{ui:SymbolIcon ArrowDownload24}"
|
||||
Command="{Binding DumpCommand}"/>
|
||||
<ProgressBar Value="{Binding Progress}" Maximum="1" Height="6"
|
||||
VerticalAlignment="Center" Margin="0,0,8,0"/>
|
||||
</DockPanel>
|
||||
|
||||
<TextBlock Text="{Binding StatusText}" FontSize="11"
|
||||
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
|
||||
TextWrapping="Wrap"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- ── Custom commands library card ─────────────────────────────── -->
|
||||
<Border Grid.Row="2" Style="{StaticResource PumpCard}" Margin="0,0,0,8"
|
||||
DataContext="{Binding Commands}">
|
||||
<DockPanel>
|
||||
<DockPanel DockPanel.Dock="Top" Margin="0,0,0,8">
|
||||
<ui:SymbolIcon DockPanel.Dock="Left" Symbol="BookmarkMultiple24" FontSize="16"
|
||||
Foreground="{DynamicResource AccentTextFillColorPrimaryBrush}"
|
||||
Margin="0,0,8,0" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="Saved commands" Style="{StaticResource DevSectionHeader}" Margin="0"/>
|
||||
</DockPanel>
|
||||
|
||||
<Grid DockPanel.Dock="Bottom" Margin="0,8,0,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:TextBox Grid.Column="0"
|
||||
Text="{Binding NewName, UpdateSourceTrigger=PropertyChanged}"
|
||||
PlaceholderText="Name to save current as…"/>
|
||||
<ui:Button Grid.Column="1" Margin="6,0,0,0"
|
||||
Content="Save current" Icon="{ui:SymbolIcon Save24}"
|
||||
Command="{Binding SaveCurrentCommand}"/>
|
||||
<ui:Button Grid.Column="2" Margin="6,0,0,0"
|
||||
Appearance="Primary"
|
||||
Content="Send" Icon="{ui:SymbolIcon Send24}"
|
||||
Command="{Binding SendSelectedCommand}"/>
|
||||
<ui:Button Grid.Column="3" Margin="6,0,0,0"
|
||||
Content="Delete" Icon="{ui:SymbolIcon Delete24}"
|
||||
Command="{Binding DeleteSelectedCommand}"/>
|
||||
</Grid>
|
||||
|
||||
<ListView ItemsSource="{Binding Items}"
|
||||
SelectedItem="{Binding Selected, Mode=TwoWay}"
|
||||
FontFamily="Consolas, 'Courier New'" FontSize="12">
|
||||
<ListView.View>
|
||||
<GridView>
|
||||
<GridViewColumn Header="Name" Width="120"
|
||||
DisplayMemberBinding="{Binding Name}"/>
|
||||
<GridViewColumn Header="Hex" Width="220"
|
||||
DisplayMemberBinding="{Binding HexBytes}"/>
|
||||
</GridView>
|
||||
</ListView.View>
|
||||
</ListView>
|
||||
</DockPanel>
|
||||
</Border>
|
||||
|
||||
<!-- ── EEPROM passwords library card ────────────────────────────── -->
|
||||
<Border Grid.Row="3" Style="{StaticResource PumpCard}"
|
||||
DataContext="{Binding Passwords}">
|
||||
<DockPanel>
|
||||
<DockPanel DockPanel.Dock="Top" Margin="0,0,0,8">
|
||||
<ui:SymbolIcon DockPanel.Dock="Left" Symbol="Key24" FontSize="16"
|
||||
Foreground="{DynamicResource AccentTextFillColorPrimaryBrush}"
|
||||
Margin="0,0,8,0" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="EEPROM passwords" Style="{StaticResource DevSectionHeader}" Margin="0"/>
|
||||
</DockPanel>
|
||||
|
||||
<!-- "Add new" inline editor -->
|
||||
<Grid DockPanel.Dock="Bottom" Margin="0,8,0,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="60"/>
|
||||
<ColumnDefinition Width="80"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:TextBox Grid.Column="0"
|
||||
Text="{Binding NewName, UpdateSourceTrigger=PropertyChanged}"
|
||||
PlaceholderText="Name (e.g. 'Bosch v2 Z3')"/>
|
||||
<ui:TextBox Grid.Column="1" Margin="6,0,0,0"
|
||||
Text="{Binding NewZoneHex, UpdateSourceTrigger=PropertyChanged}"
|
||||
PlaceholderText="Zone"
|
||||
FontFamily="Consolas, 'Courier New'"/>
|
||||
<ui:TextBox Grid.Column="2" Margin="6,0,0,0"
|
||||
Text="{Binding NewKeyHex, UpdateSourceTrigger=PropertyChanged}"
|
||||
PlaceholderText="Key"
|
||||
FontFamily="Consolas, 'Courier New'"/>
|
||||
<ui:Button Grid.Column="3" Margin="6,0,0,0"
|
||||
Content="Add" Icon="{ui:SymbolIcon Add24}"
|
||||
Command="{Binding AddCommand}"/>
|
||||
<ui:Button Grid.Column="4" Margin="6,0,0,0"
|
||||
Appearance="Primary"
|
||||
Content="Apply" Icon="{ui:SymbolIcon LockOpen24}"
|
||||
Command="{Binding ApplySelectedCommand}"/>
|
||||
<ui:Button Grid.Column="5" Margin="6,0,0,0"
|
||||
Content="Delete" Icon="{ui:SymbolIcon Delete24}"
|
||||
Command="{Binding DeleteSelectedCommand}"/>
|
||||
</Grid>
|
||||
|
||||
<ListView ItemsSource="{Binding Items}"
|
||||
SelectedItem="{Binding Selected, Mode=TwoWay}"
|
||||
FontFamily="Consolas, 'Courier New'" FontSize="12">
|
||||
<ListView.View>
|
||||
<GridView>
|
||||
<GridViewColumn Header="Name" Width="160"
|
||||
DisplayMemberBinding="{Binding Name}"/>
|
||||
<GridViewColumn Header="Zone" Width="60">
|
||||
<GridViewColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Zone, StringFormat=X2}"/>
|
||||
</DataTemplate>
|
||||
</GridViewColumn.CellTemplate>
|
||||
</GridViewColumn>
|
||||
<GridViewColumn Header="Key" Width="80">
|
||||
<GridViewColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Key, StringFormat=X4}"/>
|
||||
</DataTemplate>
|
||||
</GridViewColumn.CellTemplate>
|
||||
</GridViewColumn>
|
||||
</GridView>
|
||||
</ListView.View>
|
||||
</ListView>
|
||||
</DockPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
<!-- ── Right column: manual hex write + transaction log ─────────────── -->
|
||||
<Border Grid.Row="1" Grid.Column="1" Style="{StaticResource PumpCard}" Margin="6,0,0,0">
|
||||
<DockPanel>
|
||||
<!-- Header -->
|
||||
<DockPanel DockPanel.Dock="Top" Margin="0,0,0,8">
|
||||
<ui:SymbolIcon DockPanel.Dock="Left" Symbol="WrenchScrewdriver24" FontSize="18"
|
||||
Foreground="{DynamicResource AccentTextFillColorPrimaryBrush}"
|
||||
VerticalAlignment="Center" Margin="0,0,8,0"/>
|
||||
<StackPanel>
|
||||
<TextBlock Text="Manual KWP write"
|
||||
Style="{StaticResource DevSectionHeader}" Margin="0"/>
|
||||
<TextBlock Text="Type raw bytes, send over the active K-Line session, watch the wire."
|
||||
FontSize="11"
|
||||
Foreground="{DynamicResource TextFillColorSecondaryBrush}"/>
|
||||
</StackPanel>
|
||||
</DockPanel>
|
||||
|
||||
<!-- Session status banner -->
|
||||
<Border DockPanel.Dock="Top" Margin="0,0,0,8" Padding="10,6" CornerRadius="4"
|
||||
BorderThickness="1"
|
||||
BorderBrush="{DynamicResource ControlStrokeColorDefaultBrush}">
|
||||
<Border.Style>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="Background" Value="{DynamicResource SystemFillColorCautionBackgroundBrush}"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsSessionOpen}" Value="True">
|
||||
<Setter Property="Background" Value="{DynamicResource SystemFillColorSuccessBackgroundBrush}"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ui:SymbolIcon FontSize="14" Margin="0,0,6,0" VerticalAlignment="Center">
|
||||
<ui:SymbolIcon.Style>
|
||||
<Style TargetType="ui:SymbolIcon">
|
||||
<Setter Property="Symbol" Value="PlugDisconnected20"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsSessionOpen}" Value="True">
|
||||
<Setter Property="Symbol" Value="PlugConnected20"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</ui:SymbolIcon.Style>
|
||||
</ui:SymbolIcon>
|
||||
<TextBlock VerticalAlignment="Center" FontSize="12">
|
||||
<TextBlock.Style>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="Text" Value="K-Line session not connected — open one from the identification card on the left."/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsSessionOpen}" Value="True">
|
||||
<Setter Property="Text" Value="K-Line session is open."/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</TextBlock.Style>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- Input row -->
|
||||
<Grid DockPanel.Dock="Top" Margin="0,0,0,8">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:TextBox Grid.Column="0"
|
||||
Text="{Binding HexInput, UpdateSourceTrigger=PropertyChanged}"
|
||||
PlaceholderText="Hex bytes — e.g. 18 00 03 FF FF"
|
||||
FontFamily="Consolas, 'Courier New'"
|
||||
FontSize="13"
|
||||
Padding="10,8"/>
|
||||
<ui:Button Grid.Column="1" Margin="8,0,0,0"
|
||||
Appearance="Primary"
|
||||
Content="Send"
|
||||
Icon="{ui:SymbolIcon Send24}"
|
||||
Command="{Binding SendCommand}"/>
|
||||
<ui:Button Grid.Column="2" Margin="8,0,0,0"
|
||||
Appearance="Secondary"
|
||||
Content="Clear log"
|
||||
Icon="{ui:SymbolIcon Eraser24}"
|
||||
Command="{Binding ClearLogCommand}"/>
|
||||
</Grid>
|
||||
|
||||
<!-- Status -->
|
||||
<TextBlock DockPanel.Dock="Top" Margin="2,0,0,6"
|
||||
Text="{Binding StatusText}"
|
||||
FontSize="12"
|
||||
Foreground="{DynamicResource TextFillColorSecondaryBrush}"/>
|
||||
|
||||
<!-- Log -->
|
||||
<Border Background="{DynamicResource ControlSolidFillColorDefaultBrush}"
|
||||
BorderBrush="{DynamicResource CardStrokeColorDefaultBrush}"
|
||||
BorderThickness="1" CornerRadius="6">
|
||||
<ScrollViewer x:Name="LogScroller" VerticalScrollBarVisibility="Auto" Padding="8">
|
||||
<ItemsControl ItemsSource="{Binding Log}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Display}"
|
||||
FontFamily="Consolas, 'Courier New'"
|
||||
FontSize="12"
|
||||
Padding="2,1">
|
||||
<TextBlock.Style>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextFillColorPrimaryBrush}"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding Direction}" Value="Tx">
|
||||
<Setter Property="Foreground" Value="{DynamicResource AccentTextFillColorPrimaryBrush}"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding Direction}" Value="Info">
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextFillColorSecondaryBrush}"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</TextBlock.Style>
|
||||
</TextBlock>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
</DockPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
39
Views/Pages/DeveloperPage.xaml.cs
Normal file
39
Views/Pages/DeveloperPage.xaml.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System.Collections.Specialized;
|
||||
using System.Windows.Controls;
|
||||
using HC_APTBS.ViewModels.Pages;
|
||||
|
||||
namespace HC_APTBS.Views.Pages
|
||||
{
|
||||
/// <summary>
|
||||
/// Code-behind for the Developer Tools page. Auto-scrolls the log to the
|
||||
/// bottom when entries are appended so the latest TX/RX is always visible.
|
||||
/// Compiled into Debug builds only — see <c>HC_APTBS.csproj</c>.
|
||||
/// </summary>
|
||||
public partial class DeveloperPage : UserControl
|
||||
{
|
||||
private DeveloperPageViewModel? _vm;
|
||||
|
||||
public DeveloperPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContextChanged += OnDataContextChanged;
|
||||
}
|
||||
|
||||
private void OnDataContextChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (_vm is { } old)
|
||||
((INotifyCollectionChanged)old.Log).CollectionChanged -= OnLogChanged;
|
||||
|
||||
_vm = DataContext as DeveloperPageViewModel;
|
||||
|
||||
if (_vm is not null)
|
||||
((INotifyCollectionChanged)_vm.Log).CollectionChanged += OnLogChanged;
|
||||
}
|
||||
|
||||
private void OnLogChanged(object? sender, NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
if (e.Action == NotifyCollectionChangedAction.Add)
|
||||
Dispatcher.BeginInvoke(() => LogScroller.ScrollToBottom());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,7 @@
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- ── Top status strip ─────────────────────────────────────────────── -->
|
||||
<uc:PumpTopStripView Grid.Row="0"/>
|
||||
<uc:PumpTopStripView Grid.Row="0" Height="66"/>
|
||||
|
||||
<!-- ── Body: 3-column card layout ───────────────────────────────────── -->
|
||||
<Grid Grid.Row="1">
|
||||
@@ -53,7 +53,7 @@
|
||||
<!-- Col 2: Identification (Auto) + DTCs (*) -->
|
||||
<Grid Grid.Column="0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource Dialog.Settings.TempMax}"
|
||||
@@ -97,6 +98,10 @@
|
||||
<CheckBox Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="2"
|
||||
Content="{DynamicResource Dialog.Settings.IgnoreTin}"
|
||||
IsChecked="{Binding DefaultIgnoreTin}" Margin="0,4,0,0"/>
|
||||
|
||||
<CheckBox Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="2"
|
||||
Content="{DynamicResource Dialog.Settings.AutoTestSkipsOilPumpConfirm}"
|
||||
IsChecked="{Binding AutoTestSkipsOilPumpConfirm}" Margin="0,4,0,0"/>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
|
||||
@@ -298,6 +303,7 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource Dialog.Settings.RefreshBench}"
|
||||
@@ -334,6 +340,11 @@
|
||||
VerticalAlignment="Center" Margin="0,0,12,6"/>
|
||||
<TextBox Grid.Row="6" Grid.Column="1" Text="{Binding FlasherIntervalMs, UpdateSourceTrigger=LostFocus}"
|
||||
Margin="0,0,0,6"/>
|
||||
|
||||
<TextBlock Grid.Row="7" Grid.Column="0" Text="{DynamicResource Dialog.Settings.RpmChartUpdateHz}"
|
||||
VerticalAlignment="Center" Margin="0,0,12,6"/>
|
||||
<TextBox Grid.Row="7" Grid.Column="1" Text="{Binding RpmChartUpdateHz, UpdateSourceTrigger=LostFocus}"
|
||||
Margin="0,0,0,6"/>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
|
||||
|
||||
@@ -3,201 +3,364 @@
|
||||
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:models="clr-namespace:HC_APTBS.Models"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
xmlns:uc="clr-namespace:HC_APTBS.Views.UserControls"
|
||||
xmlns:vm="clr-namespace:HC_APTBS.ViewModels"
|
||||
xmlns:vmp="clr-namespace:HC_APTBS.ViewModels.Pages"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="800" d:DesignWidth="1000"
|
||||
d:DesignHeight="860" d:DesignWidth="1740"
|
||||
d:DataContext="{d:DesignInstance Type=vmp:TestsPageViewModel, IsDesignTimeCreatable=False}">
|
||||
<!--
|
||||
Plan → Preconditions → Running → Done wizard (ui-structure.md §4).
|
||||
DataContext: TestsPageViewModel.
|
||||
Top row: 4-pill stepper. Middle: ContentControl routing CurrentStateVm
|
||||
through typed DataTemplates. Bottom: wizard footer with Back / Next.
|
||||
Single-page Tests view.
|
||||
Row 0: status bar — headline + blocker text + phase progress when running.
|
||||
Row 1: section cards (always visible) with full live-bar indicators so
|
||||
phase state is readable at rest and during a run.
|
||||
Row 2: action bar — toolbar (Check all) + primary action (Start / Abort /
|
||||
Report + Clear).
|
||||
Overlay: PASSED / FAILED snackbar pinned to the bottom-right.
|
||||
-->
|
||||
<UserControl.Resources>
|
||||
<!-- Step → View mappings -->
|
||||
<DataTemplate DataType="{x:Type vmp:PlanStateViewModel}">
|
||||
<uc:TestPlanView DataContext="{Binding TestPanel}"/>
|
||||
</DataTemplate>
|
||||
<BooleanToVisibilityConverter x:Key="BoolToVis"/>
|
||||
|
||||
<DataTemplate DataType="{x:Type vm:TestPreconditionsViewModel}">
|
||||
<uc:TestPreconditionsView/>
|
||||
<DataTemplate DataType="{x:Type vm:TestSectionViewModel}">
|
||||
<uc:TestSectionCard Width="430" Compact="False"/>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate DataType="{x:Type vmp:RunningStateViewModel}">
|
||||
<uc:TestRunningView DataContext="{Binding TestPanel}"/>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate DataType="{x:Type vmp:TestsPageViewModel}">
|
||||
<uc:TestDoneView/>
|
||||
</DataTemplate>
|
||||
|
||||
<!-- Stepper pill style -->
|
||||
<Style x:Key="StepPillStyle" TargetType="Border">
|
||||
<Setter Property="CornerRadius" Value="12"/>
|
||||
<Setter Property="Padding" Value="14,4"/>
|
||||
<Setter Property="Margin" Value="0,0,6,0"/>
|
||||
<Setter Property="Background" Value="#ECEFF1"/>
|
||||
<Setter Property="BorderBrush" Value="#CFD8DC"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
</Style>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Margin="12">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Wizard stepper -->
|
||||
<Border Background="White" BorderBrush="#DDD" BorderThickness="0,0,0,1" Padding="10,8">
|
||||
<ItemsControl>
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Horizontal"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<!-- ── Status bar ─────────────────────────────────────────────── -->
|
||||
<Border Style="{StaticResource PumpCard}" Margin="4,0,4,6" Padding="14,10" Height="66">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Border Style="{StaticResource StepPillStyle}">
|
||||
<Border.Resources>
|
||||
<Style TargetType="Border" BasedOn="{StaticResource StepPillStyle}">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding CurrentState}"
|
||||
Value="{x:Static models:TestFlowState.Plan}">
|
||||
<Setter Property="Background" Value="#1565C0"/>
|
||||
<Setter Property="BorderBrush" Value="#0D47A1"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Resources>
|
||||
<TextBlock Text="{DynamicResource Test.Wizard.Plan}" FontSize="12">
|
||||
<TextBlock.Style>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="Foreground" Value="#455A64"/>
|
||||
<!-- State glyph -->
|
||||
<Border Grid.Column="0" Width="14" Height="14" CornerRadius="7"
|
||||
VerticalAlignment="Center" Margin="0,0,10,0">
|
||||
<Border.Style>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="Background" Value="#BBB"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding CurrentState}"
|
||||
Value="{x:Static models:TestFlowState.Plan}">
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||
<DataTrigger Binding="{Binding AllPreconditionsPassed}" Value="True">
|
||||
<Setter Property="Background" Value="#26C200"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding IsTestRunning}" Value="True">
|
||||
<Setter Property="Background" Value="#F9A825"/>
|
||||
</DataTrigger>
|
||||
<MultiDataTrigger>
|
||||
<MultiDataTrigger.Conditions>
|
||||
<Condition Binding="{Binding HasCompletedResults}" Value="True"/>
|
||||
<Condition Binding="{Binding IsTestRunning}" Value="False"/>
|
||||
<Condition Binding="{Binding LastRunPassed}" Value="True"/>
|
||||
</MultiDataTrigger.Conditions>
|
||||
<Setter Property="Background" Value="#2E7D32"/>
|
||||
</MultiDataTrigger>
|
||||
<MultiDataTrigger>
|
||||
<MultiDataTrigger.Conditions>
|
||||
<Condition Binding="{Binding HasCompletedResults}" Value="True"/>
|
||||
<Condition Binding="{Binding IsTestRunning}" Value="False"/>
|
||||
<Condition Binding="{Binding LastRunPassed}" Value="False"/>
|
||||
</MultiDataTrigger.Conditions>
|
||||
<Setter Property="Background" Value="#B71C1C"/>
|
||||
</MultiDataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</TextBlock.Style>
|
||||
</TextBlock>
|
||||
</Border>
|
||||
</Border.Style>
|
||||
</Border>
|
||||
|
||||
<Border Style="{StaticResource StepPillStyle}">
|
||||
<Border.Resources>
|
||||
<Style TargetType="Border" BasedOn="{StaticResource StepPillStyle}">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding CurrentState}"
|
||||
Value="{x:Static models:TestFlowState.Preconditions}">
|
||||
<Setter Property="Background" Value="#1565C0"/>
|
||||
<Setter Property="BorderBrush" Value="#0D47A1"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Resources>
|
||||
<TextBlock Text="{DynamicResource Test.Wizard.Preconditions}" FontSize="12">
|
||||
<TextBlock.Style>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="Foreground" Value="#455A64"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding CurrentState}"
|
||||
Value="{x:Static models:TestFlowState.Preconditions}">
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</TextBlock.Style>
|
||||
</TextBlock>
|
||||
</Border>
|
||||
<!-- Headline + blocker -->
|
||||
<StackPanel Grid.Column="1" VerticalAlignment="Center">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="{Binding StatusHeadline}"
|
||||
FontSize="15" FontWeight="SemiBold"
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}"/>
|
||||
<TextBlock Text="{Binding TestPanel.CurrentPhaseName}"
|
||||
FontSize="13"
|
||||
Foreground="{DynamicResource AccentTextFillColorPrimaryBrush}"
|
||||
Margin="10,0,0,0"
|
||||
Visibility="{Binding IsTestRunning, Converter={StaticResource BoolToVis}}"/>
|
||||
<TextBlock Text="{Binding TestPanel.SectionLabel}"
|
||||
FontSize="11" FontStyle="Italic"
|
||||
Foreground="{DynamicResource TextFillColorTertiaryBrush}"
|
||||
Margin="8,0,0,0" VerticalAlignment="Center"
|
||||
Visibility="{Binding IsTestRunning, Converter={StaticResource BoolToVis}}"/>
|
||||
</StackPanel>
|
||||
<TextBlock Text="{Binding BlockingReason}"
|
||||
FontSize="11"
|
||||
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
|
||||
Margin="0,2,0,0">
|
||||
<TextBlock.Style>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="Visibility" Value="Visible"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding AllPreconditionsPassed}" Value="True">
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding IsTestRunning}" Value="True">
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding HasCompletedResults}" Value="True">
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</TextBlock.Style>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
|
||||
<Border Style="{StaticResource StepPillStyle}">
|
||||
<Border.Resources>
|
||||
<Style TargetType="Border" BasedOn="{StaticResource StepPillStyle}">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding CurrentState}"
|
||||
Value="{x:Static models:TestFlowState.Running}">
|
||||
<Setter Property="Background" Value="#1565C0"/>
|
||||
<Setter Property="BorderBrush" Value="#0D47A1"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Resources>
|
||||
<TextBlock Text="{DynamicResource Test.Wizard.Running}" FontSize="12">
|
||||
<TextBlock.Style>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="Foreground" Value="#455A64"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding CurrentState}"
|
||||
Value="{x:Static models:TestFlowState.Running}">
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</TextBlock.Style>
|
||||
</TextBlock>
|
||||
</Border>
|
||||
<!-- Right pills: estimated time / countdown -->
|
||||
<StackPanel Grid.Column="2" Orientation="Horizontal" VerticalAlignment="Center">
|
||||
<!-- Running: phase remaining / total -->
|
||||
<StackPanel Orientation="Horizontal"
|
||||
Visibility="{Binding IsTestRunning, Converter={StaticResource BoolToVis}}">
|
||||
<TextBlock FontFamily="Consolas" FontSize="20" FontWeight="SemiBold"
|
||||
Foreground="{DynamicResource AccentTextFillColorPrimaryBrush}"
|
||||
VerticalAlignment="Center">
|
||||
<Run Text="{Binding TestPanel.PhaseRemainingSeconds, Mode=OneWay}"/>
|
||||
</TextBlock>
|
||||
<TextBlock Text="s" FontSize="12"
|
||||
Foreground="{DynamicResource AccentTextFillColorPrimaryBrush}"
|
||||
VerticalAlignment="Bottom" Margin="2,0,8,3"/>
|
||||
<TextBlock FontSize="11"
|
||||
Foreground="{DynamicResource TextFillColorTertiaryBrush}"
|
||||
VerticalAlignment="Bottom" Margin="0,0,0,3">
|
||||
<Run Text="/ "/>
|
||||
<Run Text="{Binding TestPanel.PhaseTotalSeconds, Mode=OneWay}"/>
|
||||
<Run Text="s"/>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
|
||||
<Border Style="{StaticResource StepPillStyle}">
|
||||
<Border.Resources>
|
||||
<Style TargetType="Border" BasedOn="{StaticResource StepPillStyle}">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding CurrentState}"
|
||||
Value="{x:Static models:TestFlowState.Done}">
|
||||
<Setter Property="Background" Value="#1565C0"/>
|
||||
<Setter Property="BorderBrush" Value="#0D47A1"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Resources>
|
||||
<TextBlock Text="{DynamicResource Test.Wizard.Done}" FontSize="12">
|
||||
<TextBlock.Style>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="Foreground" Value="#455A64"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding CurrentState}"
|
||||
Value="{x:Static models:TestFlowState.Done}">
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</TextBlock.Style>
|
||||
</TextBlock>
|
||||
</Border>
|
||||
</ItemsControl>
|
||||
</Border>
|
||||
<!-- Idle: estimated total time -->
|
||||
<Border Padding="10,4" CornerRadius="12">
|
||||
<Border.Style>
|
||||
<Style TargetType="Border" BasedOn="{StaticResource TestMetaPill}">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsTestRunning}" Value="True">
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ui:SymbolIcon Symbol="Timer24" FontSize="14"
|
||||
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBlock Style="{StaticResource TestMetaPillText}" Margin="6,0,0,0"
|
||||
FontSize="12" FontFamily="Consolas">
|
||||
<Run Text="~"/>
|
||||
<Run Text="{Binding TestPanel.RemainingSeconds, Mode=OneWay}"/>
|
||||
<Run Text=" s"/>
|
||||
</TextBlock>
|
||||
<TextBlock Style="{StaticResource TestMetaPillText}" Margin="6,0,0,0"
|
||||
Text="{DynamicResource Test.Plan.Remaining}"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Current step body -->
|
||||
<ContentControl Grid.Row="1" Content="{Binding CurrentStateVm}"/>
|
||||
<!-- Phase progress bar (only while running) -->
|
||||
<ProgressBar Grid.Row="1" Grid.ColumnSpan="3"
|
||||
Minimum="0" Maximum="1"
|
||||
Value="{Binding TestPanel.PhaseProgress, Mode=OneWay}"
|
||||
Height="4" Margin="0,8,0,0"
|
||||
BorderThickness="0"
|
||||
Visibility="{Binding IsTestRunning, Converter={StaticResource BoolToVis}}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- Wizard footer: Back / Next -->
|
||||
<Border Grid.Row="2" Padding="10,8"
|
||||
Background="White" BorderBrush="#DDD" BorderThickness="0,1,0,0">
|
||||
<!-- ── Section cards (always visible) ─────────────────────────── -->
|
||||
<ScrollViewer Grid.Row="1"
|
||||
Margin="0,0,0,8"
|
||||
HorizontalScrollBarVisibility="Disabled"
|
||||
VerticalScrollBarVisibility="Disabled">
|
||||
<ItemsControl ItemsSource="{Binding TestPanel.Tests}"
|
||||
Margin="4,0,4,0">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel Orientation="Horizontal"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
|
||||
<!-- ── Action bar ─────────────────────────────────────────────── -->
|
||||
<Border Grid.Row="2" Style="{StaticResource PumpCard}" Margin="4,6,4,0" Padding="12,8">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- Left toolbar: Check-all toggle -->
|
||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
||||
<ui:Button Command="{Binding TestPanel.ToggleCheckAllCommand}"
|
||||
Content="{DynamicResource Test.CheckAll}"
|
||||
Appearance="Secondary"
|
||||
Padding="12,5" FontSize="12"
|
||||
ToolTip="{DynamicResource Test.Plan.EnableAll}">
|
||||
<ui:Button.Icon><ui:SymbolIcon Symbol="SelectAllOn24"/></ui:Button.Icon>
|
||||
<ui:Button.Style>
|
||||
<Style TargetType="ui:Button" BasedOn="{StaticResource {x:Type ui:Button}}">
|
||||
<Setter Property="IsEnabled" Value="True"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsTestRunning}" Value="True">
|
||||
<Setter Property="IsEnabled" Value="False"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</ui:Button.Style>
|
||||
</ui:Button>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Right action cluster — switches by state -->
|
||||
<StackPanel Grid.Column="2" Orientation="Horizontal">
|
||||
|
||||
<!-- Idle: Start -->
|
||||
<ui:Button Command="{Binding StartTestCommand}"
|
||||
Content="{DynamicResource Test.StartTest}"
|
||||
Appearance="Primary"
|
||||
Padding="18,6" FontSize="14" FontWeight="SemiBold">
|
||||
<ui:Button.Icon><ui:SymbolIcon Symbol="Play24"/></ui:Button.Icon>
|
||||
<ui:Button.Style>
|
||||
<Style TargetType="ui:Button" BasedOn="{StaticResource {x:Type ui:Button}}">
|
||||
<Setter Property="Visibility" Value="Visible"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsTestRunning}" Value="True">
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding HasCompletedResults}" Value="True">
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</ui:Button.Style>
|
||||
</ui:Button>
|
||||
|
||||
<!-- Running: Abort -->
|
||||
<ui:Button Command="{Binding AbortCommand}"
|
||||
Content="{DynamicResource Test.Running.Abort}"
|
||||
Appearance="Danger"
|
||||
Padding="18,6" FontSize="14" FontWeight="SemiBold"
|
||||
Visibility="{Binding IsTestRunning, Converter={StaticResource BoolToVis}}">
|
||||
<ui:Button.Icon><ui:SymbolIcon Symbol="Stop24"/></ui:Button.Icon>
|
||||
</ui:Button>
|
||||
|
||||
<!-- Done: Report + Clear -->
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<StackPanel.Style>
|
||||
<Style TargetType="StackPanel">
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
<Style.Triggers>
|
||||
<MultiDataTrigger>
|
||||
<MultiDataTrigger.Conditions>
|
||||
<Condition Binding="{Binding HasCompletedResults}" Value="True"/>
|
||||
<Condition Binding="{Binding IsTestRunning}" Value="False"/>
|
||||
</MultiDataTrigger.Conditions>
|
||||
<Setter Property="Visibility" Value="Visible"/>
|
||||
</MultiDataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</StackPanel.Style>
|
||||
|
||||
<ui:Button Command="{Binding ClearTestDataCommand}"
|
||||
Content="{DynamicResource Test.Done.ClearData}"
|
||||
Appearance="Secondary"
|
||||
Padding="14,6" FontSize="12" Margin="0,0,8,0">
|
||||
<ui:Button.Icon><ui:SymbolIcon Symbol="Delete24"/></ui:Button.Icon>
|
||||
</ui:Button>
|
||||
<ui:Button Command="{Binding Root.GenerateReportCommand}"
|
||||
Content="{DynamicResource Test.Report}"
|
||||
Appearance="Primary"
|
||||
Padding="18,6" FontSize="14" FontWeight="SemiBold">
|
||||
<ui:Button.Icon><ui:SymbolIcon Symbol="DocumentPdf24"/></ui:Button.Icon>
|
||||
</ui:Button>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
<!-- ── Done snackbar overlay (auto-dismiss) ─────────────────────── -->
|
||||
<Border HorizontalAlignment="Right" VerticalAlignment="Bottom"
|
||||
Margin="0,0,24,24"
|
||||
CornerRadius="6"
|
||||
Padding="14,10"
|
||||
BorderThickness="1"
|
||||
Visibility="{Binding ShowDoneSnackbar, Converter={StaticResource BoolToVis}}">
|
||||
<Border.Style>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="Background" Value="#FFCDD2"/>
|
||||
<Setter Property="BorderBrush" Value="#B71C1C"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding LastRunPassed}" Value="True">
|
||||
<Setter Property="Background" Value="#C8E6C9"/>
|
||||
<Setter Property="BorderBrush" Value="#2E7D32"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Grid.Column="0"
|
||||
Content="{DynamicResource Test.Wizard.Back}"
|
||||
Command="{Binding BackCommand}"
|
||||
Padding="16,6" FontSize="12"/>
|
||||
<ui:SymbolIcon Grid.Column="0" FontSize="20"
|
||||
VerticalAlignment="Center" Margin="0,0,10,0">
|
||||
<ui:SymbolIcon.Style>
|
||||
<Style TargetType="ui:SymbolIcon">
|
||||
<Setter Property="Symbol" Value="ErrorCircle24"/>
|
||||
<Setter Property="Foreground" Value="#B71C1C"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding LastRunPassed}" Value="True">
|
||||
<Setter Property="Symbol" Value="CheckmarkCircle24"/>
|
||||
<Setter Property="Foreground" Value="#2E7D32"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</ui:SymbolIcon.Style>
|
||||
</ui:SymbolIcon>
|
||||
|
||||
<Button Grid.Column="2"
|
||||
Content="{DynamicResource Test.Wizard.Next}"
|
||||
Command="{Binding NextCommand}"
|
||||
Padding="16,6" FontSize="12"
|
||||
FontWeight="SemiBold"/>
|
||||
<TextBlock Grid.Column="1"
|
||||
FontSize="14" FontWeight="SemiBold"
|
||||
VerticalAlignment="Center">
|
||||
<TextBlock.Style>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="Text" Value="{DynamicResource Test.Done.Failed}"/>
|
||||
<Setter Property="Foreground" Value="#B71C1C"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding LastRunPassed}" Value="True">
|
||||
<Setter Property="Text" Value="{DynamicResource Test.Done.Passed}"/>
|
||||
<Setter Property="Foreground" Value="#2E7D32"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</TextBlock.Style>
|
||||
</TextBlock>
|
||||
|
||||
<ui:Button Grid.Column="2"
|
||||
Command="{Binding DismissSnackbarCommand}"
|
||||
Appearance="Transparent"
|
||||
Padding="6,2" Margin="12,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
ToolTip="{DynamicResource Test.Abort.Cancel}">
|
||||
<ui:Button.Icon><ui:SymbolIcon Symbol="Dismiss24"/></ui:Button.Icon>
|
||||
</ui:Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
Reference in New Issue
Block a user