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>
This commit is contained in:
2026-04-16 13:22:48 +02:00
parent c617854c09
commit 37d099cdbd
55 changed files with 3207 additions and 379 deletions

View File

@@ -4,6 +4,8 @@ using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using HC_APTBS.Models;
using HC_APTBS.Services;
using HC_APTBS.ViewModels.Dialogs;
using HC_APTBS.Views.Dialogs;
namespace HC_APTBS.ViewModels
{
@@ -86,6 +88,22 @@ namespace HC_APTBS.ViewModels
partial void OnIsOilPumpOnChanged(bool value)
{
// Show confirmation dialog when turning oil pump ON (WAcceptOilTurnOn equivalent).
if (value)
{
var vm = new OilPumpConfirmViewModel();
var dlg = new OilPumpConfirmDialog(vm) { Owner = Application.Current.MainWindow };
dlg.ShowDialog();
if (!vm.Accepted)
{
// Revert without re-triggering this handler.
_isOilPumpOn = false;
OnPropertyChanged(nameof(IsOilPumpOn));
return;
}
}
_bench.SetRelay(RelayNames.OilPump, value);
}
@@ -100,22 +118,31 @@ namespace HC_APTBS.ViewModels
/// <summary>
/// Starts the bench motor at the RPM specified in <see cref="RpmInputText"/>.
/// Warns the operator if the oil pump is off.
/// Shows a safety warning dialog if the oil pump is off.
/// </summary>
[RelayCommand]
private void StartBench()
{
if (!int.TryParse(RpmInputText, out int rpm) || rpm <= 0) return;
// Safety warning if oil pump is not running.
// Safety warning if oil pump is not running (WCareOnRpmOn equivalent).
if (!IsOilPumpOn)
{
var result = MessageBox.Show(
"Oil pump is OFF. Start bench without oil circulation?",
"Oil Pump Warning",
MessageBoxButton.YesNo,
MessageBoxImage.Warning);
if (result != MessageBoxResult.Yes) return;
var vm = new RpmSafetyWarningViewModel();
var dlg = new RpmSafetyWarningDialog(vm) { Owner = Application.Current.MainWindow };
dlg.ShowDialog();
switch (vm.Result)
{
case RpmSafetyResult.Cancel:
return;
case RpmSafetyResult.ProceedWithOil:
IsOilPumpOn = true;
break;
case RpmSafetyResult.ProceedWithoutOil:
// Operator accepted the risk.
break;
}
}
// Ensure direction relays are set.