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>
40 lines
1.5 KiB
C#
40 lines
1.5 KiB
C#
using System;
|
|
|
|
namespace HC_APTBS.Services
|
|
{
|
|
/// <summary>
|
|
/// Provides runtime language switching and localised string retrieval.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// XAML bindings use <c>{DynamicResource Key}</c> which update automatically
|
|
/// when the merged <see cref="System.Windows.ResourceDictionary"/> is swapped.
|
|
/// C# code uses <see cref="GetString"/> for the same keys.
|
|
/// </remarks>
|
|
public interface ILocalizationService
|
|
{
|
|
/// <summary>Current language code — <c>"ESP"</c> or <c>"ENG"</c>.</summary>
|
|
string CurrentLanguage { get; }
|
|
|
|
/// <summary>
|
|
/// Switches the active UI language by swapping the merged resource dictionary
|
|
/// and persisting the choice to <c>config.xml</c>.
|
|
/// Must be called from the UI thread.
|
|
/// </summary>
|
|
/// <param name="languageCode"><c>"ESP"</c> for Spanish or <c>"ENG"</c> for English.</param>
|
|
void SetLanguage(string languageCode);
|
|
|
|
/// <summary>
|
|
/// Retrieves a localised string by resource key.
|
|
/// Returns the key itself when no matching resource is found (fail-visible).
|
|
/// </summary>
|
|
/// <param name="key">Resource key defined in <c>Resources/Strings.*.xaml</c>.</param>
|
|
string GetString(string key);
|
|
|
|
/// <summary>
|
|
/// Raised after the active language dictionary has been swapped.
|
|
/// ViewModels subscribe to refresh any cached localised strings.
|
|
/// </summary>
|
|
event Action? LanguageChanged;
|
|
}
|
|
}
|