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>
116 lines
5.5 KiB
XML
116 lines
5.5 KiB
XML
<UserControl x:Class="HC_APTBS.Views.UserControls.DfiManageView"
|
|
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"
|
|
mc:Ignorable="d"
|
|
d:DesignHeight="150" d:DesignWidth="460" MaxHeight="150">
|
|
|
|
<UserControl.Resources>
|
|
<Style x:Key="LcdGreen" TargetType="Border">
|
|
<Setter Property="BorderThickness" Value="3"/>
|
|
<Setter Property="SnapsToDevicePixels" Value="True"/>
|
|
<Setter Property="BorderBrush">
|
|
<Setter.Value>
|
|
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
|
<GradientStop Color="DarkSlateGray" Offset="0"/>
|
|
<GradientStop Color="LawnGreen" Offset="1"/>
|
|
</LinearGradientBrush>
|
|
</Setter.Value>
|
|
</Setter>
|
|
<Setter Property="Background">
|
|
<Setter.Value>
|
|
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
|
<GradientStop Color="LawnGreen" Offset="0"/>
|
|
<GradientStop Color="#57B000" Offset="1.5"/>
|
|
</LinearGradientBrush>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
</UserControl.Resources>
|
|
|
|
<Grid Margin="16,8">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="75"/>
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="144" MinWidth="60"/>
|
|
<ColumnDefinition MinWidth="200"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<!-- LEFT: version picker + read/write buttons -->
|
|
<ComboBox Margin="4" VerticalAlignment="Bottom"
|
|
SelectedIndex="{Binding VersionIndex}">
|
|
<ComboBoxItem Content="V1"/>
|
|
<ComboBoxItem Content="V2"/>
|
|
<ComboBoxItem Content="V3"/>
|
|
<ComboBoxItem Content="V4"/>
|
|
</ComboBox>
|
|
|
|
<Grid Grid.Row="1" Margin="4">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition/>
|
|
<ColumnDefinition Width="4"/>
|
|
<ColumnDefinition/>
|
|
|
|
</Grid.ColumnDefinitions>
|
|
<Button Content="{DynamicResource Dfi.Read}"
|
|
Command="{Binding ReadDfiCommand}"
|
|
FontSize="12" FontWeight="Bold" Padding="4"/>
|
|
<Button Grid.Column="2" Content="{DynamicResource Dfi.Write}"
|
|
Command="{Binding WriteDfiCommand}"
|
|
FontSize="12" FontWeight="Bold" Padding="4"/>
|
|
</Grid>
|
|
|
|
<!-- TOP RIGHT: DFI value LCD + auto checkbox -->
|
|
<Grid Grid.Row="0" Grid.Column="1" Margin="4">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" MinWidth="200"/>
|
|
<ColumnDefinition MinWidth="100"/>
|
|
</Grid.ColumnDefinitions>
|
|
<Border Grid.ColumnSpan="1" Style="{StaticResource LcdGreen}" Margin="0,0,12,0" >
|
|
<Grid Grid.Row="1" >
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition/>
|
|
<ColumnDefinition/>
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock Text="{DynamicResource Dfi.Label}"
|
|
HorizontalAlignment="Center" VerticalAlignment="Center"
|
|
Foreground="Black" FontSize="18" FontFamily="Consolas"/>
|
|
<TextBlock Text="{Binding CurrentDfi, StringFormat=F2, Mode=OneWay}"
|
|
Grid.Column="1"
|
|
HorizontalAlignment="Center" VerticalAlignment="Center"
|
|
FontSize="26" FontWeight="Bold" Foreground="Black"/>
|
|
</Grid>
|
|
</Border>
|
|
<Border Grid.ColumnSpan="1" BorderThickness="1" BorderBrush="Black" Margin="0,0,12,0" SnapsToDevicePixels="True"/>
|
|
|
|
</Grid>
|
|
|
|
<!-- AUTO checkbox — sits outside the column pair; placed in Column=1 outside normal layout -->
|
|
<CheckBox IsChecked="{Binding IsAutoMode}"
|
|
Content="{DynamicResource Dfi.Auto}"
|
|
Grid.Row="0" Grid.Column="1"
|
|
Height="Auto"
|
|
HorizontalAlignment="Right" VerticalAlignment="Center"
|
|
Margin="0,0,10,0"
|
|
Foreground="Black" FontSize="20"/>
|
|
|
|
<!-- BOTTOM RIGHT: slider with range labels + current value -->
|
|
<Grid Grid.Row="1" Grid.Column="1">
|
|
<Slider Value="{Binding SliderRaw}"
|
|
Minimum="-145" Maximum="145"
|
|
TickFrequency="5" SmallChange="5" LargeChange="5"
|
|
IsSnapToTickEnabled="True" TickPlacement="BottomRight"
|
|
Margin="10,0" VerticalAlignment="Center"
|
|
Foreground="Black"/>
|
|
<TextBlock Text="-1.45" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="10,0,0,0" Foreground="DimGray"/>
|
|
<TextBlock Text="+1.45" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,10,0" Foreground="DimGray"/>
|
|
<TextBlock Text="{Binding SliderDfiValue, StringFormat=F2, Mode=OneWay}"
|
|
HorizontalAlignment="Center" VerticalAlignment="Bottom"
|
|
Margin="0,0,0,4" FontSize="20" Foreground="Black"/>
|
|
</Grid>
|
|
</Grid>
|
|
</UserControl>
|