diff --git a/App.xaml b/App.xaml index 8ea1286..3a364b7 100644 --- a/App.xaml +++ b/App.xaml @@ -3,5 +3,10 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:HC_APTBS"> + + + + + diff --git a/App.xaml.cs b/App.xaml.cs index aff240e..d2f826c 100644 --- a/App.xaml.cs +++ b/App.xaml.cs @@ -69,6 +69,7 @@ public partial class App : Application services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); + services.AddSingleton(); // ── ViewModels ──────────────────────────────────────────────────────── services.AddSingleton(); diff --git a/CLAUDE.md b/CLAUDE.md index 691efc8..16d723c 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -83,11 +83,14 @@ ViewModels/ — [ObservableProperty] / [RelayCommand], no UI lo FlowmeterChartViewModel.cs — Real-time flowmeter charts AngleDisplayViewModel.cs — Encoder angle monitoring (PSG, INJ, Manual, Lock Angle) StatusDisplayViewModel.cs — Pump status word display - Dialogs/ — KlineErrors, Progress, Report, UserCheck ViewModels + Dialogs/ — KlineErrors, OilPumpConfirm, Progress, Report, RpmSafetyWarning, + Settings, UnlockProgress, UserCheck, VoltageWarning ViewModels Views/ MainWindow.xaml — Root UI (multi-panel layout) - Dialogs/ — KlineErrorsDialog, ProgressDialog, ReportDialog, UserCheckDialog + Dialogs/ — KlineErrorsDialog, OilPumpConfirmDialog, ProgressDialog, + ReportDialog, RpmSafetyWarningDialog, SettingsDialog, + UnlockProgressDialog, UserCheckDialog, VoltageWarningDialog UserControls/ — AngleDisplay, BenchParamConfig, DfiManage, FlowmeterChart, PumpControl, PumpIdentification, ResultDisplay, StatusDisplay, TestDisplay, TestPanel @@ -147,14 +150,11 @@ See `docs/` guidelines for full specs. Priority: CRITICAL > HIGH > MEDIUM > LOW. **HIGH — Missing safety features:** - No QOver zero-flow safety check (old: emergency stop if QOver==0 while RPM>300 + oil pump on) -- No safety dialogs: 27V warning, oil pump confirmation, RPM warning - Alarm bit collection during tests not wired up (`PhaseDefinition.RecordErrorBit` never called) - No per-sample real-time UI callback during measurement (old fired per-sample events for live charts) - Pump parameters (ME/FBKW/PreIn) not zeroed between test phases **HIGH — Missing features:** -- Ford unlock progress UI (service exists, no View — old had WUnlocker.xaml with visual ring + progress bar) -- No localization system (old had Spanish/English resource dictionaries with runtime switching) - No encryption (old encrypted user passwords with AES-256 + pump data with Rijndael; new stores plaintext) - No KlineIDs auto-mapping (old remembered K-Line ID → pump ID associations) diff --git a/MainWindow.xaml b/MainWindow.xaml index 32cf193..d51d82f 100644 --- a/MainWindow.xaml +++ b/MainWindow.xaml @@ -7,7 +7,7 @@ xmlns:uc="clr-namespace:HC_APTBS.Views.UserControls" xmlns:models="clr-namespace:HC_APTBS.Models" mc:Ignorable="d" - Title="HC_APTBS — Herlic Test Bench" + Title="{DynamicResource App.Title}" Height="1080" Width="1920" WindowState="Maximized" WindowStartupLocation="CenterScreen" @@ -68,7 +68,8 @@ - + + @@ -105,7 +106,7 @@ - + @@ -126,7 +127,7 @@ - @@ -139,7 +140,7 @@ - @@ -153,7 +154,7 @@ - @@ -167,7 +168,7 @@ - @@ -184,7 +185,7 @@ - @@ -192,9 +193,9 @@ - + + + + + + diff --git a/Views/Dialogs/UnlockProgressDialog.xaml.cs b/Views/Dialogs/UnlockProgressDialog.xaml.cs new file mode 100644 index 0000000..eb7c181 --- /dev/null +++ b/Views/Dialogs/UnlockProgressDialog.xaml.cs @@ -0,0 +1,49 @@ +using System.ComponentModel; +using System.Windows; +using System.Windows.Input; +using HC_APTBS.ViewModels.Dialogs; + +namespace HC_APTBS.Views.Dialogs +{ + /// + /// Non-modal window showing immobilizer unlock progress. + /// Prevents user-initiated closing until the unlock sequence completes; + /// programmatic close via always succeeds. + /// Equivalent to the old WUnlocker window. + /// + public partial class UnlockProgressDialog : Window + { + private bool _forceClose; + + /// Creates the dialog and wires the ViewModel. + public UnlockProgressDialog(UnlockProgressViewModel vm) + { + InitializeComponent(); + DataContext = vm; + vm.RequestClose += ForceClose; + } + + /// Closes the window unconditionally (bypasses the completion guard). + public void ForceClose() + { + _forceClose = true; + Close(); + } + + /// Allows dragging the borderless window by clicking anywhere. + private void OnMouseDrag(object sender, MouseButtonEventArgs e) + { + if (e.ChangedButton == MouseButton.Left) + DragMove(); + } + + /// Prevents user-initiated closing while the unlock sequence is still running. + private void OnWindowClosing(object? sender, CancelEventArgs e) + { + if (_forceClose) return; + + if (DataContext is UnlockProgressViewModel vm && !vm.IsComplete) + e.Cancel = true; + } + } +} diff --git a/Views/Dialogs/UserCheckDialog.xaml b/Views/Dialogs/UserCheckDialog.xaml index 7de5b68..aa1a6ea 100644 --- a/Views/Dialogs/UserCheckDialog.xaml +++ b/Views/Dialogs/UserCheckDialog.xaml @@ -4,7 +4,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" - Title="User Authentication" + Title="{DynamicResource Dialog.UserCheck.Title}" Height="170" Width="420" ResizeMode="NoResize" WindowStartupLocation="CenterOwner"> @@ -21,12 +21,12 @@ -