Files
HC_APTBS/Views/UserControls/AngleDisplayView.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

135 lines
7.6 KiB
XML

<UserControl x:Class="HC_APTBS.Views.UserControls.AngleDisplayView"
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"
mc:Ignorable="d"
d:DesignHeight="200" d:DesignWidth="500">
<Border Margin="0,4">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<!-- Header -->
<TextBlock Grid.ColumnSpan="3" Text="{DynamicResource Angle.Header}"
HorizontalAlignment="Center" FontSize="20"
FontWeight="Bold" FontStyle="Italic"
Foreground="DimGray" Margin="0,0,0,4"/>
<!-- ── Column 0: PSG + INJ encoder readouts ── -->
<StackPanel Grid.Row="1" Grid.Column="0">
<!-- PSG row -->
<StackPanel Orientation="Horizontal" Height="56" Margin="0,2">
<Button Content="0" Width="28" Height="28" FontWeight="Bold"
VerticalAlignment="Center" Margin="0,0,4,0"
Command="{Binding SetPsgZeroCommand}"
ToolTip="{DynamicResource Angle.SetPsgZero}"/>
<Border Style="{DynamicResource LcdBlue}" Padding="4,0" Width="170">
<DockPanel>
<TextBlock Text="{DynamicResource Angle.Psg}" DockPanel.Dock="Left"
VerticalAlignment="Bottom" Margin="2,0,0,8"
FontSize="10" FontWeight="Bold"
Foreground="{Binding PsgAngleForeground}"/>
<TextBlock Text="{Binding PsgEncoderAngle}" DockPanel.Dock="Right"
VerticalAlignment="Top" HorizontalAlignment="Right"
Margin="0,6,4,0" FontSize="12"
Foreground="LightGray" FontFamily="Consolas"/>
<TextBlock Text="{Binding PsgRelativeAngle}"
HorizontalAlignment="Center" VerticalAlignment="Center"
FontSize="30" FontWeight="Bold" FontFamily="Consolas"
Foreground="{Binding PsgAngleForeground}"/>
</DockPanel>
</Border>
</StackPanel>
<!-- INJ row -->
<StackPanel Orientation="Horizontal" Height="56" Margin="0,2">
<Button Content="0" Width="28" Height="28" FontWeight="Bold"
VerticalAlignment="Center" Margin="0,0,4,0"
Command="{Binding SetInjZeroCommand}"
ToolTip="{DynamicResource Angle.SetInjZero}"/>
<Border Style="{DynamicResource LcdBlue}" Padding="4,0" Width="170">
<DockPanel>
<TextBlock Text="{DynamicResource Angle.Inj}" DockPanel.Dock="Left"
VerticalAlignment="Bottom" Margin="2,0,0,8"
FontSize="10" FontWeight="Bold"
Foreground="{Binding InjAngleForeground}"/>
<TextBlock Text="{Binding InjEncoderAngle}" DockPanel.Dock="Right"
VerticalAlignment="Top" HorizontalAlignment="Right"
Margin="0,6,4,0" FontSize="12"
Foreground="LightGray" FontFamily="Consolas"/>
<TextBlock Text="{Binding InjRelativeAngle}"
HorizontalAlignment="Center" VerticalAlignment="Center"
FontSize="30" FontWeight="Bold" FontFamily="Consolas"
Foreground="{Binding InjAngleForeground}"/>
</DockPanel>
</Border>
</StackPanel>
</StackPanel>
<!-- ── Column 1: Delta angle input ── -->
<StackPanel Grid.Row="1" Grid.Column="1" VerticalAlignment="Bottom"
Margin="8,0" Height="60">
<TextBlock Text="Δº" FontSize="16" FontWeight="Bold"
HorizontalAlignment="Center" Margin="0,0,0,2"/>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="+" FontSize="14" VerticalAlignment="Center"
Margin="0,0,4,0"/>
<TextBox Grid.Column="1"
Text="{Binding LockAngleDeltaInput, UpdateSourceTrigger=PropertyChanged}"
FontSize="14" FontFamily="Consolas" Height="28"
VerticalContentAlignment="Center" HorizontalContentAlignment="Center"
Padding="4,2"/>
<TextBlock Grid.Column="2" Text="=" FontSize="14"
VerticalAlignment="Center" Margin="4,0,0,0"/>
</Grid>
</StackPanel>
<!-- ── Column 2: Manual (ABS) + Lock angle displays ── -->
<StackPanel Grid.Row="1" Grid.Column="2" Margin="4,0,0,0">
<!-- ABS (manual encoder) -->
<Border Style="{DynamicResource LcdBlue}" Height="56" Margin="0,2" Padding="4,0">
<DockPanel>
<TextBlock Text="{DynamicResource Angle.AbsDeg}" DockPanel.Dock="Left"
VerticalAlignment="Bottom" Margin="4,0,0,8"
FontSize="10" FontWeight="Bold" Foreground="#FFEBEBFF"/>
<TextBlock Text="{Binding ManualAngleText}"
HorizontalAlignment="Center" VerticalAlignment="Center"
FontSize="32" FontWeight="Bold" FontFamily="Consolas"
Foreground="#FFEBEBFF"/>
</DockPanel>
</Border>
<!-- LOCK angle result -->
<Border Style="{DynamicResource LcdBlue}" Height="56" Margin="0,2" Padding="4,0">
<DockPanel>
<TextBlock Text="{DynamicResource Angle.LockDeg}" DockPanel.Dock="Left"
VerticalAlignment="Bottom" Margin="4,0,0,8"
FontSize="10" FontWeight="Bold" Foreground="#FFEBEBFF"/>
<TextBlock Text="{Binding LockAngleDisplay}"
HorizontalAlignment="Center" VerticalAlignment="Center"
FontSize="32" FontWeight="Bold" FontFamily="Consolas"
Foreground="{Binding LockAngleForeground}"/>
</DockPanel>
</Border>
</StackPanel>
</Grid>
</Border>
</UserControl>