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>
52 lines
2.3 KiB
C#
52 lines
2.3 KiB
C#
using CommunityToolkit.Mvvm.ComponentModel;
|
|
using CommunityToolkit.Mvvm.Input;
|
|
|
|
namespace HC_APTBS.ViewModels.Dialogs
|
|
{
|
|
/// <summary>
|
|
/// ViewModel for the oil pump confirmation dialog shown before activating
|
|
/// the oil pump relay. The operator must confirm that oil level and
|
|
/// connections have been checked.
|
|
/// Equivalent to the old <c>WAcceptOilTurnOn</c> dialog.
|
|
/// </summary>
|
|
public sealed partial class OilPumpConfirmViewModel : ObservableObject
|
|
{
|
|
// ── Dialog result ─────────────────────────────────────────────────────────
|
|
|
|
/// <summary>True if the operator confirmed and accepted.</summary>
|
|
public bool Accepted { get; private set; }
|
|
|
|
// ── Checkbox ──────────────────────────────────────────────────────────────
|
|
|
|
/// <summary>True when the "I have checked for leaks" checkbox is ticked.</summary>
|
|
[ObservableProperty]
|
|
[NotifyCanExecuteChangedFor(nameof(AcceptCommand))]
|
|
private bool _leaksChecked;
|
|
|
|
// ── Commands ──────────────────────────────────────────────────────────────
|
|
|
|
/// <summary>Confirms the oil pump activation and closes the dialog.</summary>
|
|
[RelayCommand(CanExecute = nameof(CanAccept))]
|
|
private void Accept()
|
|
{
|
|
Accepted = true;
|
|
RequestClose?.Invoke();
|
|
}
|
|
|
|
private bool CanAccept() => LeaksChecked;
|
|
|
|
/// <summary>Cancels the oil pump activation and closes the dialog.</summary>
|
|
[RelayCommand]
|
|
private void Cancel()
|
|
{
|
|
Accepted = false;
|
|
RequestClose?.Invoke();
|
|
}
|
|
|
|
// ── Events ────────────────────────────────────────────────────────────────
|
|
|
|
/// <summary>Raised when the dialog should close itself.</summary>
|
|
public event System.Action? RequestClose;
|
|
}
|
|
}
|