Files
HC_APTBS/Views/UserControls/ResultDisplayView.xaml
LucianoDev 37d099cdbd feat: add Ford VP44 unlock progress dialog, K-Line fast unlock, localization, safety dialogs, and settings
Unlock progress UI:
- UnlockProgressDialog with dark-themed progress ring, phase indicator, elapsed
  time, and cancel/close buttons (non-modal, draggable borderless window)
- UnlockProgressViewModel with event-driven progress tracking via IUnlockService
- Triggers on pump selection (manual or K-Line auto-detect), not test start

UnlockService rewrite:
- Persistent CAN senders that outlive the unlock sequence (StopSenders on pump change)
- Concurrent K-Line fast unlock: awaits session Connected, sends RAM timer shortcut
  ({02 88 02 03 A8 01 00}), verifies via CAN TestUnlock before skipping wait
- Fix Type 1 verification (Value == 0 means unlocked, was inverted)

K-Line fast unlock support:
- IKwpService.TryFastUnlockAsync / KwpService implementation

Additional features:
- ILocalizationService with ES/EN resource dictionaries and runtime switching
- Safety dialogs: VoltageWarning, OilPumpConfirm, RpmSafetyWarning
- SettingsDialog for app configuration
- BenchService enhancements, ConfigurationService improvements, PDF report updates
- All UI strings localized via DynamicResource

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-16 13:22:48 +02:00

126 lines
7.1 KiB
XML

<UserControl x:Class="HC_APTBS.Views.UserControls.ResultDisplayView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:conv="clr-namespace:HC_APTBS.Converters"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="700">
<UserControl.Resources>
<conv:BoolToPassFailBrushConverter x:Key="PassFailBrush"/>
<BooleanToVisibilityConverter x:Key="BoolToVis"/>
<!-- Overall result banner style -->
<Style x:Key="OverallBannerStyle" TargetType="Border">
<Setter Property="Padding" Value="6,3"/>
<Setter Property="Margin" Value="0,0,0,4"/>
<Style.Triggers>
<DataTrigger Binding="{Binding OverallPassed}" Value="True">
<Setter Property="Background" Value="#C8E6C9"/>
</DataTrigger>
<DataTrigger Binding="{Binding OverallPassed}" Value="False">
<Setter Property="Background" Value="#FFCDD2"/>
</DataTrigger>
</Style.Triggers>
</Style>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<!-- Test name + overall result banner -->
<Border Style="{StaticResource OverallBannerStyle}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding TestName}"
FontSize="13" FontWeight="Bold" VerticalAlignment="Center"/>
<TextBlock Grid.Column="1" Margin="0,0,4,0"
FontSize="13" FontWeight="Bold" VerticalAlignment="Center">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Style.Triggers>
<DataTrigger Binding="{Binding OverallPassed}" Value="True">
<Setter Property="Text" Value="PASS"/>
<Setter Property="Foreground" Value="#2E7D32"/>
</DataTrigger>
<DataTrigger Binding="{Binding OverallPassed}" Value="False">
<Setter Property="Text" Value="FAIL"/>
<Setter Property="Foreground" Value="#B71C1C"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</Grid>
</Border>
<!-- Column headers -->
<Grid Grid.Row="1" Margin="0,0,0,2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{DynamicResource Result.Phase}" FontSize="10" FontWeight="Bold" Margin="3,0" Foreground="Gray"/>
<TextBlock Text="{DynamicResource Result.Parameter}" FontSize="10" FontWeight="Bold" Margin="3,0" Foreground="Gray" Grid.Column="1"/>
<TextBlock Text="{DynamicResource Result.Target}" FontSize="10" FontWeight="Bold" Margin="3,0" Foreground="Gray" Grid.Column="2"/>
<TextBlock Text="{DynamicResource Result.Tolerance}" FontSize="10" FontWeight="Bold" Margin="3,0" Foreground="Gray" Grid.Column="3"/>
<TextBlock Text="{DynamicResource Result.Average}" FontSize="10" FontWeight="Bold" Margin="3,0" Foreground="Gray" Grid.Column="4"/>
<TextBlock Text="{DynamicResource Result.ResultHeader}" FontSize="10" FontWeight="Bold" Margin="3,0" Foreground="Gray" Grid.Column="5"/>
</Grid>
<!-- Result rows -->
<ScrollViewer Grid.Row="2" VerticalScrollBarVisibility="Auto">
<ItemsControl ItemsSource="{Binding Results}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border Background="{Binding Passed, Converter={StaticResource PassFailBrush}}"
Margin="0,1" Padding="3,2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding PhaseName}" FontSize="11" Margin="3,0"/>
<TextBlock Text="{Binding ParameterName}" FontSize="11" Margin="3,0" Grid.Column="1"/>
<TextBlock Text="{Binding Target, StringFormat=F2}" FontSize="11" Margin="3,0" Grid.Column="2"/>
<TextBlock Text="{Binding Tolerance, StringFormat=F2}" FontSize="11" Margin="3,0" Grid.Column="3"/>
<TextBlock Text="{Binding Average, StringFormat=F2}" FontSize="11" Margin="3,0" Grid.Column="4"/>
<TextBlock Text="{Binding ResultLabel}" FontSize="11" FontWeight="Bold" Margin="3,0" Grid.Column="5">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Style.Triggers>
<DataTrigger Binding="{Binding Passed}" Value="True">
<Setter Property="Foreground" Value="#2E7D32"/>
</DataTrigger>
<DataTrigger Binding="{Binding Passed}" Value="False">
<Setter Property="Foreground" Value="#B71C1C"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</Grid>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Grid>
</UserControl>