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:
@@ -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="K-Line Fault Codes"
|
||||
Title="{DynamicResource Dialog.KlineErrors.Title}"
|
||||
Height="400" Width="600"
|
||||
ResizeMode="CanResize"
|
||||
WindowStartupLocation="CenterOwner">
|
||||
@@ -28,12 +28,12 @@
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Fault codes:" VerticalAlignment="Center" FontSize="14" FontWeight="SemiBold"/>
|
||||
<TextBlock Text="{DynamicResource Dialog.KlineErrors.Header}" VerticalAlignment="Center" FontSize="14" FontWeight="SemiBold"/>
|
||||
|
||||
<Button Grid.Column="1" Content="Read" Margin="0,2,8,2"
|
||||
<Button Grid.Column="1" Content="{DynamicResource Dialog.KlineErrors.Read}" Margin="0,2,8,2"
|
||||
Width="75" Height="24"
|
||||
Command="{Binding ReadErrorsCommand}"/>
|
||||
<Button Grid.Column="2" Content="Clear" Margin="0,2,0,2"
|
||||
<Button Grid.Column="2" Content="{DynamicResource Dialog.KlineErrors.Clear}" Margin="0,2,0,2"
|
||||
Width="75" Height="24"
|
||||
Command="{Binding ClearErrorsCommand}"/>
|
||||
</Grid>
|
||||
@@ -56,7 +56,7 @@
|
||||
<ProgressBar Value="{Binding ProgressPercent, Mode=OneWay}"
|
||||
Minimum="0" Maximum="100"
|
||||
VerticalAlignment="Center" Margin="0,0,10,0"/>
|
||||
<Button Grid.Column="1" Content="Close" Width="80" Height="24"
|
||||
<Button Grid.Column="1" Content="{DynamicResource Common.Close}" Width="80" Height="24"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding CloseCommand}"/>
|
||||
</Grid>
|
||||
|
||||
57
Views/Dialogs/OilPumpConfirmDialog.xaml
Normal file
57
Views/Dialogs/OilPumpConfirmDialog.xaml
Normal file
@@ -0,0 +1,57 @@
|
||||
<Window x:Class="HC_APTBS.Views.Dialogs.OilPumpConfirmDialog"
|
||||
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"
|
||||
Title="{DynamicResource Dialog.OilPump.Title}"
|
||||
Height="220" Width="440"
|
||||
ResizeMode="NoResize"
|
||||
WindowStartupLocation="CenterOwner">
|
||||
|
||||
<Grid Margin="16,12">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="48"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- Warning icon -->
|
||||
<TextBlock Grid.RowSpan="4" Text="⚠"
|
||||
FontSize="36" Foreground="DarkOrange"
|
||||
VerticalAlignment="Top" HorizontalAlignment="Center"
|
||||
Margin="0,4,8,0"/>
|
||||
|
||||
<!-- Title -->
|
||||
<TextBlock Grid.Column="1" Text="{DynamicResource Common.Warning}"
|
||||
FontSize="18" FontWeight="Bold" Foreground="DarkOrange"
|
||||
Margin="0,0,0,8"/>
|
||||
|
||||
<!-- Warning message -->
|
||||
<TextBlock Grid.Row="1" Grid.Column="1" TextWrapping="Wrap"
|
||||
Margin="0,0,0,12"
|
||||
Text="{DynamicResource Dialog.OilPump.Message}"/>
|
||||
|
||||
<!-- Confirmation checkbox -->
|
||||
<CheckBox Grid.Row="2" Grid.Column="1" Margin="0,4"
|
||||
IsChecked="{Binding LeaksChecked}"
|
||||
FontSize="14" FontWeight="SemiBold">
|
||||
<TextBlock Text="{DynamicResource Dialog.OilPump.LeaksChecked}" TextWrapping="Wrap"/>
|
||||
</CheckBox>
|
||||
|
||||
<!-- Buttons -->
|
||||
<StackPanel Grid.Row="4" Grid.Column="1"
|
||||
Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,12,0,0">
|
||||
<Button Content="{DynamicResource Common.Accept}" Width="80" Height="26" Margin="0,0,8,0"
|
||||
Command="{Binding AcceptCommand}"/>
|
||||
<Button Content="{DynamicResource Common.Cancel}" Width="80" Height="26"
|
||||
Command="{Binding CancelCommand}" IsCancel="True"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
20
Views/Dialogs/OilPumpConfirmDialog.xaml.cs
Normal file
20
Views/Dialogs/OilPumpConfirmDialog.xaml.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System.Windows;
|
||||
using HC_APTBS.ViewModels.Dialogs;
|
||||
|
||||
namespace HC_APTBS.Views.Dialogs
|
||||
{
|
||||
/// <summary>
|
||||
/// Confirmation dialog shown before activating the oil pump relay.
|
||||
/// Equivalent to the old <c>WAcceptOilTurnOn</c>.
|
||||
/// </summary>
|
||||
public partial class OilPumpConfirmDialog : Window
|
||||
{
|
||||
/// <summary>Creates the dialog and wires the ViewModel.</summary>
|
||||
public OilPumpConfirmDialog(OilPumpConfirmViewModel vm)
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = vm;
|
||||
vm.RequestClose += Close;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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="Generate Report"
|
||||
Title="{DynamicResource Dialog.Report.Title}"
|
||||
Height="450" Width="800"
|
||||
ResizeMode="NoResize"
|
||||
WindowStartupLocation="CenterOwner">
|
||||
@@ -28,11 +28,11 @@
|
||||
Grid.Column="2" Grid.RowSpan="5" Margin="-3,10,0,0"/>
|
||||
|
||||
<!-- ── Section headers ─────────────────────────────────────────────── -->
|
||||
<TextBlock Text="Client List" FontSize="14" FontWeight="SemiBold"
|
||||
<TextBlock Text="{DynamicResource Dialog.Report.ClientList}" FontSize="14" FontWeight="SemiBold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,10"/>
|
||||
<TextBlock Grid.Column="1" Text="Client Data" FontSize="20" FontWeight="SemiBold"
|
||||
<TextBlock Grid.Column="1" Text="{DynamicResource Dialog.Report.ClientData}" FontSize="20" FontWeight="SemiBold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,10"/>
|
||||
<TextBlock Grid.Column="2" Text="Company Data" FontSize="20" FontWeight="SemiBold"
|
||||
<TextBlock Grid.Column="2" Text="{DynamicResource Dialog.Report.CompanyData}" FontSize="20" FontWeight="SemiBold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,10"/>
|
||||
|
||||
<!-- ── Client list ─────────────────────────────────────────────────── -->
|
||||
@@ -47,17 +47,17 @@
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Content="Name:" VerticalAlignment="Center" FontSize="13"/>
|
||||
<Label Content="{DynamicResource Dialog.Report.Name}" VerticalAlignment="Center" FontSize="13"/>
|
||||
<ComboBox Grid.Column="1" IsEditable="True"
|
||||
ItemsSource="{Binding ClientNames}"
|
||||
Text="{Binding SelectedClientName, UpdateSourceTrigger=PropertyChanged}"
|
||||
VerticalAlignment="Center" FontSize="13" Margin="4,0"/>
|
||||
<Button Grid.Column="2" Content="Save" Width="60" Height="24"
|
||||
<Button Grid.Column="2" Content="{DynamicResource Common.Save}" Width="60" Height="24"
|
||||
Command="{Binding SaveClientCommand}"/>
|
||||
</Grid>
|
||||
|
||||
<!-- ── Client info text ─────────────────────────────────────────────── -->
|
||||
<GroupBox Grid.Column="1" Grid.Row="2" Header="Client information"
|
||||
<GroupBox Grid.Column="1" Grid.Row="2" Header="{DynamicResource Dialog.Report.ClientInfo}"
|
||||
Margin="8,0,8,4" FontSize="13">
|
||||
<TextBox Text="{Binding ClientInfo, UpdateSourceTrigger=PropertyChanged}"
|
||||
TextWrapping="Wrap" AcceptsReturn="True"
|
||||
@@ -65,7 +65,7 @@
|
||||
</GroupBox>
|
||||
|
||||
<!-- ── Observations ─────────────────────────────────────────────────── -->
|
||||
<GroupBox Grid.Column="1" Grid.Row="3" Header="Observations"
|
||||
<GroupBox Grid.Column="1" Grid.Row="3" Header="{DynamicResource Dialog.Report.Observations}"
|
||||
Margin="8,0,8,4" FontSize="13">
|
||||
<TextBox Text="{Binding Observations, UpdateSourceTrigger=PropertyChanged}"
|
||||
TextWrapping="Wrap"
|
||||
@@ -78,7 +78,7 @@
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Content="Operator:" VerticalAlignment="Center" FontSize="13"/>
|
||||
<Label Content="{DynamicResource Dialog.Report.Operator}" VerticalAlignment="Center" FontSize="13"/>
|
||||
<TextBox Grid.Column="1" Text="{Binding OperatorName, UpdateSourceTrigger=PropertyChanged}"
|
||||
VerticalAlignment="Center" FontSize="13" Margin="4,0" Height="24"
|
||||
IsReadOnly="True" Background="#F0F0F0"/>
|
||||
@@ -95,11 +95,11 @@
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Content="Company:" VerticalAlignment="Center" FontSize="13"/>
|
||||
<Label Content="{DynamicResource Dialog.Report.Company}" VerticalAlignment="Center" FontSize="13"/>
|
||||
<TextBox Grid.Column="1" Text="{Binding CompanyName, UpdateSourceTrigger=PropertyChanged}"
|
||||
VerticalAlignment="Center" FontSize="13" Margin="4,0" Height="24"/>
|
||||
</Grid>
|
||||
<GroupBox Grid.Row="1" Header="Company information"
|
||||
<GroupBox Grid.Row="1" Header="{DynamicResource Dialog.Report.CompanyInfo}"
|
||||
Margin="0,4,0,0" FontSize="13">
|
||||
<TextBox Text="{Binding CompanyInfo, UpdateSourceTrigger=PropertyChanged}"
|
||||
TextWrapping="Wrap" AcceptsReturn="True"
|
||||
@@ -109,15 +109,15 @@
|
||||
|
||||
<!-- ── Buttons row ──────────────────────────────────────────────────── -->
|
||||
<Button Grid.Row="4" Grid.Column="0"
|
||||
Content="Delete Client" Padding="6,2" Margin="10,8,0,8"
|
||||
Content="{DynamicResource Dialog.Report.DeleteClient}" Padding="6,2" Margin="10,8,0,8"
|
||||
HorizontalAlignment="Left"
|
||||
Command="{Binding DeleteClientCommand}"/>
|
||||
|
||||
<StackPanel Grid.Row="4" Grid.Column="2"
|
||||
Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,8,10,8">
|
||||
<Button Content="Generate" Width="80" Height="24" Margin="0,0,8,0"
|
||||
<Button Content="{DynamicResource Dialog.Report.Generate}" Width="80" Height="24" Margin="0,0,8,0"
|
||||
Command="{Binding AcceptCommand}"/>
|
||||
<Button Content="Cancel" Width="80" Height="24"
|
||||
<Button Content="{DynamicResource Common.Cancel}" Width="80" Height="24"
|
||||
Command="{Binding CancelCommand}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
63
Views/Dialogs/RpmSafetyWarningDialog.xaml
Normal file
63
Views/Dialogs/RpmSafetyWarningDialog.xaml
Normal file
@@ -0,0 +1,63 @@
|
||||
<Window x:Class="HC_APTBS.Views.Dialogs.RpmSafetyWarningDialog"
|
||||
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"
|
||||
Title="{DynamicResource Dialog.RpmSafety.Title}"
|
||||
Height="260" Width="460"
|
||||
ResizeMode="NoResize"
|
||||
WindowStartupLocation="CenterOwner">
|
||||
|
||||
<Grid Margin="16,12">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="48"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- Warning icon -->
|
||||
<TextBlock Grid.RowSpan="5" Text="⚠"
|
||||
FontSize="36" Foreground="DarkOrange"
|
||||
VerticalAlignment="Top" HorizontalAlignment="Center"
|
||||
Margin="0,4,8,0"/>
|
||||
|
||||
<!-- Title -->
|
||||
<TextBlock Grid.Column="1" Text="{DynamicResource Common.Warning}"
|
||||
FontSize="18" FontWeight="Bold" Foreground="DarkOrange"
|
||||
Margin="0,0,0,8"/>
|
||||
|
||||
<!-- Warning message -->
|
||||
<TextBlock Grid.Row="1" Grid.Column="1" TextWrapping="Wrap"
|
||||
Margin="0,0,0,12"
|
||||
Text="{DynamicResource Dialog.RpmSafety.Message}"/>
|
||||
|
||||
<!-- Option 1: Turn on oil and proceed -->
|
||||
<RadioButton Grid.Row="2" Grid.Column="1" Margin="0,4"
|
||||
GroupName="RpmSafety"
|
||||
IsChecked="{Binding IsOilAndProceedSelected}"
|
||||
Content="{DynamicResource Dialog.RpmSafety.OilAndProceed}"/>
|
||||
|
||||
<!-- Option 2: Proceed without oil -->
|
||||
<RadioButton Grid.Row="3" Grid.Column="1" Margin="0,4"
|
||||
GroupName="RpmSafety"
|
||||
IsChecked="{Binding IsProceedWithoutOilSelected}"
|
||||
Content="{DynamicResource Dialog.RpmSafety.ProceedWithout}"/>
|
||||
|
||||
<!-- Buttons -->
|
||||
<StackPanel Grid.Row="5" Grid.Column="1"
|
||||
Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,12,0,0">
|
||||
<Button Content="{DynamicResource Common.Accept}" Width="80" Height="26" Margin="0,0,8,0"
|
||||
Command="{Binding AcceptCommand}"/>
|
||||
<Button Content="{DynamicResource Common.Cancel}" Width="80" Height="26"
|
||||
Command="{Binding CancelCommand}" IsCancel="True"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
20
Views/Dialogs/RpmSafetyWarningDialog.xaml.cs
Normal file
20
Views/Dialogs/RpmSafetyWarningDialog.xaml.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System.Windows;
|
||||
using HC_APTBS.ViewModels.Dialogs;
|
||||
|
||||
namespace HC_APTBS.Views.Dialogs
|
||||
{
|
||||
/// <summary>
|
||||
/// Safety warning dialog shown when the operator starts the bench motor
|
||||
/// while the oil pump is OFF. Equivalent to the old <c>WCareOnRpmOn</c>.
|
||||
/// </summary>
|
||||
public partial class RpmSafetyWarningDialog : Window
|
||||
{
|
||||
/// <summary>Creates the dialog and wires the ViewModel.</summary>
|
||||
public RpmSafetyWarningDialog(RpmSafetyWarningViewModel vm)
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = vm;
|
||||
vm.RequestClose += Close;
|
||||
}
|
||||
}
|
||||
}
|
||||
333
Views/Dialogs/SettingsDialog.xaml
Normal file
333
Views/Dialogs/SettingsDialog.xaml
Normal file
@@ -0,0 +1,333 @@
|
||||
<Window x:Class="HC_APTBS.Views.Dialogs.SettingsDialog"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Title="{DynamicResource Dialog.Settings.Title}"
|
||||
Height="560" Width="680"
|
||||
ResizeMode="NoResize"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
FontFamily="Ebrima"
|
||||
Background="#FFEDEDED">
|
||||
|
||||
<DockPanel Margin="8">
|
||||
|
||||
<!-- ── Bottom button bar ─────────────────────────────────────────── -->
|
||||
<StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal"
|
||||
HorizontalAlignment="Right" Margin="0,8,0,0">
|
||||
<Button Content="{DynamicResource Common.Accept}" Width="80" Height="26"
|
||||
Margin="0,0,8,0" Command="{Binding AcceptCommand}" IsDefault="True"/>
|
||||
<Button Content="{DynamicResource Common.Cancel}" Width="80" Height="26"
|
||||
Command="{Binding CancelCommand}" IsCancel="True"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- ── Tab control ───────────────────────────────────────────────── -->
|
||||
<TabControl>
|
||||
|
||||
<!-- ══ General ══════════════════════════════════════════════════ -->
|
||||
<TabItem Header="{DynamicResource Dialog.Settings.Tab.General}">
|
||||
<StackPanel Margin="16">
|
||||
<TextBlock Text="{DynamicResource Dialog.Settings.Language}"
|
||||
FontWeight="SemiBold" Margin="0,0,0,4"/>
|
||||
<ComboBox ItemsSource="{Binding AvailableLanguages}"
|
||||
SelectedItem="{Binding SelectedLanguage}"
|
||||
Width="120" HorizontalAlignment="Left"/>
|
||||
|
||||
<TextBlock Text="{DynamicResource Dialog.Settings.DaysKeepLogs}"
|
||||
FontWeight="SemiBold" Margin="0,16,0,4"/>
|
||||
<TextBox Text="{Binding DaysKeepLogs, UpdateSourceTrigger=LostFocus}"
|
||||
Width="80" HorizontalAlignment="Left"/>
|
||||
</StackPanel>
|
||||
</TabItem>
|
||||
|
||||
<!-- ══ Safety ═══════════════════════════════════════════════════ -->
|
||||
<TabItem Header="{DynamicResource Dialog.Settings.Tab.Safety}">
|
||||
<Grid Margin="16">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="120"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource Dialog.Settings.TempMax}"
|
||||
VerticalAlignment="Center" Margin="0,0,12,6"/>
|
||||
<TextBox Grid.Row="0" Grid.Column="1" Text="{Binding TempMax, UpdateSourceTrigger=LostFocus}"
|
||||
Margin="0,0,0,6"/>
|
||||
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Text="{DynamicResource Dialog.Settings.TempMin}"
|
||||
VerticalAlignment="Center" Margin="0,0,12,6"/>
|
||||
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding TempMin, UpdateSourceTrigger=LostFocus}"
|
||||
Margin="0,0,0,6"/>
|
||||
|
||||
<TextBlock Grid.Row="2" Grid.Column="0" Text="{DynamicResource Dialog.Settings.SecurityRpmLimit}"
|
||||
VerticalAlignment="Center" Margin="0,0,12,6"/>
|
||||
<TextBox Grid.Row="2" Grid.Column="1" Text="{Binding SecurityRpmLimit, UpdateSourceTrigger=LostFocus}"
|
||||
Margin="0,0,0,6"/>
|
||||
|
||||
<TextBlock Grid.Row="3" Grid.Column="0" Text="{DynamicResource Dialog.Settings.MaxPressureBar}"
|
||||
VerticalAlignment="Center" Margin="0,0,12,6"/>
|
||||
<TextBox Grid.Row="3" Grid.Column="1" Text="{Binding MaxPressureBar, UpdateSourceTrigger=LostFocus}"
|
||||
Margin="0,0,0,6"/>
|
||||
|
||||
<TextBlock Grid.Row="4" Grid.Column="0" Text="{DynamicResource Dialog.Settings.ToleranceUp}"
|
||||
VerticalAlignment="Center" Margin="0,0,12,6"/>
|
||||
<TextBox Grid.Row="4" Grid.Column="1" Text="{Binding ToleranceUpExtension, UpdateSourceTrigger=LostFocus}"
|
||||
Margin="0,0,0,6"/>
|
||||
|
||||
<TextBlock Grid.Row="5" Grid.Column="0" Text="{DynamicResource Dialog.Settings.TolerancePfp}"
|
||||
VerticalAlignment="Center" Margin="0,0,12,6"/>
|
||||
<TextBox Grid.Row="5" Grid.Column="1" Text="{Binding TolerancePfpExtension, UpdateSourceTrigger=LostFocus}"
|
||||
Margin="0,0,0,6"/>
|
||||
|
||||
<CheckBox Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="2"
|
||||
Content="{DynamicResource Dialog.Settings.IgnoreTin}"
|
||||
IsChecked="{Binding DefaultIgnoreTin}" Margin="0,4,0,0"/>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
|
||||
<!-- ══ PID ══════════════════════════════════════════════════════ -->
|
||||
<TabItem Header="{DynamicResource Dialog.Settings.Tab.Pid}">
|
||||
<Grid Margin="16">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="120"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource Dialog.Settings.PidP}"
|
||||
VerticalAlignment="Center" Margin="0,0,12,6"/>
|
||||
<TextBox Grid.Row="0" Grid.Column="1" Text="{Binding PidP, UpdateSourceTrigger=LostFocus}"
|
||||
Margin="0,0,0,6"/>
|
||||
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Text="{DynamicResource Dialog.Settings.PidI}"
|
||||
VerticalAlignment="Center" Margin="0,0,12,6"/>
|
||||
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding PidI, UpdateSourceTrigger=LostFocus}"
|
||||
Margin="0,0,0,6"/>
|
||||
|
||||
<TextBlock Grid.Row="2" Grid.Column="0" Text="{DynamicResource Dialog.Settings.PidD}"
|
||||
VerticalAlignment="Center" Margin="0,0,12,6"/>
|
||||
<TextBox Grid.Row="2" Grid.Column="1" Text="{Binding PidD, UpdateSourceTrigger=LostFocus}"
|
||||
Margin="0,0,0,6"/>
|
||||
|
||||
<TextBlock Grid.Row="3" Grid.Column="0" Text="{DynamicResource Dialog.Settings.PidLoopMs}"
|
||||
VerticalAlignment="Center" Margin="0,0,12,6"/>
|
||||
<TextBox Grid.Row="3" Grid.Column="1" Text="{Binding PidLoopMs, UpdateSourceTrigger=LostFocus}"
|
||||
Margin="0,0,0,6"/>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
|
||||
<!-- ══ Motor ════════════════════════════════════════════════════ -->
|
||||
<TabItem Header="{DynamicResource Dialog.Settings.Tab.Motor}">
|
||||
<DockPanel Margin="16">
|
||||
<!-- Top: motor parameters -->
|
||||
<Grid DockPanel.Dock="Top">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="120"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource Dialog.Settings.EncoderRes}"
|
||||
VerticalAlignment="Center" Margin="0,0,12,6"/>
|
||||
<TextBox Grid.Row="0" Grid.Column="1" Text="{Binding EncoderResolution, UpdateSourceTrigger=LostFocus}"
|
||||
Margin="0,0,0,6"/>
|
||||
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Text="{DynamicResource Dialog.Settings.VoltMaxRpm}"
|
||||
VerticalAlignment="Center" Margin="0,0,12,6"/>
|
||||
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding VoltageForMaxRpm, UpdateSourceTrigger=LostFocus}"
|
||||
Margin="0,0,0,6"/>
|
||||
|
||||
<TextBlock Grid.Row="2" Grid.Column="0" Text="{DynamicResource Dialog.Settings.MaxRpm}"
|
||||
VerticalAlignment="Center" Margin="0,0,12,6"/>
|
||||
<TextBox Grid.Row="2" Grid.Column="1" Text="{Binding MaxRpm, UpdateSourceTrigger=LostFocus}"
|
||||
Margin="0,0,0,6"/>
|
||||
|
||||
<CheckBox Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2"
|
||||
Content="{DynamicResource Dialog.Settings.RightRelay}"
|
||||
IsChecked="{Binding RightRelayValue}" Margin="0,4,0,0"/>
|
||||
</Grid>
|
||||
|
||||
<!-- RPM-Voltage relation table -->
|
||||
<GroupBox Margin="0,12,0,0">
|
||||
<GroupBox.Header>
|
||||
<TextBlock Text="{DynamicResource Dialog.Settings.Relations}" FontWeight="SemiBold"/>
|
||||
</GroupBox.Header>
|
||||
<DockPanel>
|
||||
<StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" Margin="0,4,0,0">
|
||||
<Button Content="{DynamicResource Dialog.Settings.AddRow}"
|
||||
Command="{Binding AddRelationCommand}"
|
||||
Width="75" Margin="0,0,8,0"/>
|
||||
<Button Content="{DynamicResource Dialog.Settings.RemoveRow}"
|
||||
Command="{Binding RemoveRelationCommand}"
|
||||
CommandParameter="{Binding SelectedItem, ElementName=RelationsGrid}"
|
||||
Width="75"/>
|
||||
</StackPanel>
|
||||
<DataGrid x:Name="RelationsGrid"
|
||||
ItemsSource="{Binding Relations}"
|
||||
AutoGenerateColumns="False"
|
||||
CanUserAddRows="False"
|
||||
CanUserDeleteRows="False"
|
||||
SelectionMode="Single"
|
||||
HeadersVisibility="Column"
|
||||
GridLinesVisibility="Horizontal"
|
||||
MinHeight="120">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTemplateColumn Width="*">
|
||||
<DataGridTemplateColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{DynamicResource Dialog.Settings.RelRpm}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.HeaderTemplate>
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Rpm}" VerticalAlignment="Center" Margin="4,0"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
<DataGridTemplateColumn.CellEditingTemplate>
|
||||
<DataTemplate>
|
||||
<TextBox Text="{Binding Rpm, UpdateSourceTrigger=PropertyChanged}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellEditingTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Width="*">
|
||||
<DataGridTemplateColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{DynamicResource Dialog.Settings.RelVoltage}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.HeaderTemplate>
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Voltage}" VerticalAlignment="Center" Margin="4,0"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
<DataGridTemplateColumn.CellEditingTemplate>
|
||||
<DataTemplate>
|
||||
<TextBox Text="{Binding Voltage, UpdateSourceTrigger=PropertyChanged}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellEditingTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</DockPanel>
|
||||
</GroupBox>
|
||||
</DockPanel>
|
||||
</TabItem>
|
||||
|
||||
<!-- ══ Company ══════════════════════════════════════════════════ -->
|
||||
<TabItem Header="{DynamicResource Dialog.Settings.Tab.Company}">
|
||||
<StackPanel Margin="16">
|
||||
<TextBlock Text="{DynamicResource Dialog.Settings.CompanyName}"
|
||||
FontWeight="SemiBold" Margin="0,0,0,4"/>
|
||||
<TextBox Text="{Binding CompanyName, UpdateSourceTrigger=LostFocus}"/>
|
||||
|
||||
<TextBlock Text="{DynamicResource Dialog.Settings.CompanyInfo}"
|
||||
FontWeight="SemiBold" Margin="0,12,0,4"/>
|
||||
<TextBox Text="{Binding CompanyInfo, UpdateSourceTrigger=LostFocus}"
|
||||
TextWrapping="Wrap" AcceptsReturn="True" Height="80"
|
||||
VerticalScrollBarVisibility="Auto"/>
|
||||
|
||||
<TextBlock Text="{DynamicResource Dialog.Settings.ReportLogo}"
|
||||
FontWeight="SemiBold" Margin="0,12,0,4"/>
|
||||
<DockPanel>
|
||||
<Button DockPanel.Dock="Right" Content="..." Width="30"
|
||||
Margin="4,0,0,0" Command="{Binding BrowseLogoCommand}"/>
|
||||
<TextBox Text="{Binding ReportLogoPath, UpdateSourceTrigger=LostFocus}"
|
||||
IsReadOnly="True" Background="#F0F0F0"/>
|
||||
</DockPanel>
|
||||
</StackPanel>
|
||||
</TabItem>
|
||||
|
||||
<!-- ══ K-Line ═══════════════════════════════════════════════════ -->
|
||||
<TabItem Header="{DynamicResource Dialog.Settings.Tab.KLine}">
|
||||
<StackPanel Margin="16">
|
||||
<TextBlock Text="{DynamicResource Dialog.Settings.KLinePort}"
|
||||
FontWeight="SemiBold" Margin="0,0,0,4"/>
|
||||
<DockPanel>
|
||||
<Button DockPanel.Dock="Right"
|
||||
Content="{DynamicResource Dialog.Settings.RefreshPorts}"
|
||||
Margin="8,0,0,0" Width="80"
|
||||
Command="{Binding RefreshPortsCommand}"/>
|
||||
<ComboBox ItemsSource="{Binding AvailablePorts}"
|
||||
SelectedItem="{Binding SelectedKLinePort}"
|
||||
IsEditable="True"
|
||||
Text="{Binding SelectedKLinePort, UpdateSourceTrigger=LostFocus}"/>
|
||||
</DockPanel>
|
||||
<TextBlock Text="{DynamicResource Dialog.Settings.KLineHint}"
|
||||
FontStyle="Italic" Foreground="Gray" Margin="0,8,0,0"
|
||||
TextWrapping="Wrap"/>
|
||||
</StackPanel>
|
||||
</TabItem>
|
||||
|
||||
<!-- ══ Advanced ═════════════════════════════════════════════════ -->
|
||||
<TabItem Header="{DynamicResource Dialog.Settings.Tab.Advanced}">
|
||||
<Grid Margin="16">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="120"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource Dialog.Settings.RefreshBench}"
|
||||
VerticalAlignment="Center" Margin="0,0,12,6"/>
|
||||
<TextBox Grid.Row="0" Grid.Column="1" Text="{Binding RefreshBenchInterfaceMs, UpdateSourceTrigger=LostFocus}"
|
||||
Margin="0,0,0,6"/>
|
||||
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Text="{DynamicResource Dialog.Settings.RefreshReading}"
|
||||
VerticalAlignment="Center" Margin="0,0,12,6"/>
|
||||
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding RefreshWhileReadingMs, UpdateSourceTrigger=LostFocus}"
|
||||
Margin="0,0,0,6"/>
|
||||
|
||||
<TextBlock Grid.Row="2" Grid.Column="0" Text="{DynamicResource Dialog.Settings.RefreshCanBus}"
|
||||
VerticalAlignment="Center" Margin="0,0,12,6"/>
|
||||
<TextBox Grid.Row="2" Grid.Column="1" Text="{Binding RefreshCanBusReadMs, UpdateSourceTrigger=LostFocus}"
|
||||
Margin="0,0,0,6"/>
|
||||
|
||||
<TextBlock Grid.Row="3" Grid.Column="0" Text="{DynamicResource Dialog.Settings.RefreshPumpReq}"
|
||||
VerticalAlignment="Center" Margin="0,0,12,6"/>
|
||||
<TextBox Grid.Row="3" Grid.Column="1" Text="{Binding RefreshPumpRequestMs, UpdateSourceTrigger=LostFocus}"
|
||||
Margin="0,0,0,6"/>
|
||||
|
||||
<TextBlock Grid.Row="4" Grid.Column="0" Text="{DynamicResource Dialog.Settings.RefreshPumpParams}"
|
||||
VerticalAlignment="Center" Margin="0,0,12,6"/>
|
||||
<TextBox Grid.Row="4" Grid.Column="1" Text="{Binding RefreshPumpParamsMs, UpdateSourceTrigger=LostFocus}"
|
||||
Margin="0,0,0,6"/>
|
||||
|
||||
<TextBlock Grid.Row="5" Grid.Column="0" Text="{DynamicResource Dialog.Settings.BlinkInterval}"
|
||||
VerticalAlignment="Center" Margin="0,0,12,6"/>
|
||||
<TextBox Grid.Row="5" Grid.Column="1" Text="{Binding BlinkIntervalMs, UpdateSourceTrigger=LostFocus}"
|
||||
Margin="0,0,0,6"/>
|
||||
|
||||
<TextBlock Grid.Row="6" Grid.Column="0" Text="{DynamicResource Dialog.Settings.FlasherInterval}"
|
||||
VerticalAlignment="Center" Margin="0,0,12,6"/>
|
||||
<TextBox Grid.Row="6" Grid.Column="1" Text="{Binding FlasherIntervalMs, UpdateSourceTrigger=LostFocus}"
|
||||
Margin="0,0,0,6"/>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
|
||||
</TabControl>
|
||||
</DockPanel>
|
||||
</Window>
|
||||
18
Views/Dialogs/SettingsDialog.xaml.cs
Normal file
18
Views/Dialogs/SettingsDialog.xaml.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System.Windows;
|
||||
using HC_APTBS.ViewModels.Dialogs;
|
||||
|
||||
namespace HC_APTBS.Views.Dialogs
|
||||
{
|
||||
/// <summary>
|
||||
/// Dialog for editing all application settings.
|
||||
/// </summary>
|
||||
public partial class SettingsDialog : Window
|
||||
{
|
||||
public SettingsDialog(SettingsViewModel vm)
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = vm;
|
||||
vm.RequestClose += Close;
|
||||
}
|
||||
}
|
||||
}
|
||||
138
Views/Dialogs/UnlockProgressDialog.xaml
Normal file
138
Views/Dialogs/UnlockProgressDialog.xaml
Normal file
@@ -0,0 +1,138 @@
|
||||
<Window x:Class="HC_APTBS.Views.Dialogs.UnlockProgressDialog"
|
||||
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"
|
||||
Title="{DynamicResource Dialog.Unlock.Title}"
|
||||
Height="360" Width="340"
|
||||
WindowStyle="None" ResizeMode="NoResize"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
Topmost="True"
|
||||
Background="#FF2B2929"
|
||||
MouseLeftButtonDown="OnMouseDrag"
|
||||
Closing="OnWindowClosing">
|
||||
|
||||
<Window.Resources>
|
||||
<BooleanToVisibilityConverter x:Key="BoolToVis"/>
|
||||
</Window.Resources>
|
||||
|
||||
<Grid Margin="16">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="210"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Unlock type label -->
|
||||
<TextBlock Grid.Row="0"
|
||||
Text="{Binding UnlockTypeLabel, Mode=OneWay}"
|
||||
FontSize="14" Foreground="#AAAAAA"
|
||||
HorizontalAlignment="Center" Margin="0,0,0,4"/>
|
||||
|
||||
<!-- Progress ring area -->
|
||||
<Grid Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<!-- Background ring -->
|
||||
<Ellipse Width="200" Height="200"
|
||||
Stroke="#4D4D4D" StrokeThickness="10"
|
||||
Fill="Transparent"/>
|
||||
|
||||
<!-- Content inside ring -->
|
||||
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<TextBlock Text="{DynamicResource Dialog.Unlock.Progress}"
|
||||
FontSize="12" Foreground="#888888"
|
||||
HorizontalAlignment="Center" Margin="0,0,0,4"/>
|
||||
|
||||
<!-- Percentage -->
|
||||
<TextBlock FontSize="60" FontFamily="Courier New"
|
||||
Foreground="White" HorizontalAlignment="Center">
|
||||
<TextBlock.Text>
|
||||
<Binding Path="Progress" Mode="OneWay"
|
||||
StringFormat="{}{0}%"/>
|
||||
</TextBlock.Text>
|
||||
</TextBlock>
|
||||
|
||||
<!-- Elapsed time -->
|
||||
<TextBlock Text="{Binding ElapsedTime, Mode=OneWay}"
|
||||
FontSize="16" FontFamily="Courier New"
|
||||
Foreground="#CCCCCC" HorizontalAlignment="Center"
|
||||
Margin="0,2,0,0"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<!-- Phase text -->
|
||||
<TextBlock Grid.Row="2"
|
||||
Text="{Binding PhaseText, Mode=OneWay}"
|
||||
FontSize="16" Foreground="White"
|
||||
HorizontalAlignment="Center" Margin="0,4,0,6"/>
|
||||
|
||||
<!-- Progress bar -->
|
||||
<ProgressBar Grid.Row="3"
|
||||
Value="{Binding Progress, Mode=OneWay}"
|
||||
Minimum="0" Maximum="100"
|
||||
Height="12" Margin="8,0"
|
||||
Foreground="#00EC00" Background="#3D3D3D"/>
|
||||
|
||||
<!-- Result text — overlays the spacer row so it never displaces buttons -->
|
||||
<TextBlock Grid.Row="4"
|
||||
Text="{Binding ResultText, Mode=OneWay}"
|
||||
FontSize="22" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Visibility="{Binding IsComplete, Converter={StaticResource BoolToVis}}">
|
||||
<TextBlock.Style>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="Foreground" Value="#FF5858"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsSuccess}" Value="True">
|
||||
<Setter Property="Foreground" Value="#00EC00"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</TextBlock.Style>
|
||||
</TextBlock>
|
||||
|
||||
<!-- Buttons -->
|
||||
<StackPanel Grid.Row="5" Orientation="Horizontal"
|
||||
HorizontalAlignment="Center" Margin="0,8,0,0">
|
||||
<!-- Cancel button -->
|
||||
<Button Content="{DynamicResource Common.Cancel}" Width="90" Height="30"
|
||||
Margin="0,0,12,0"
|
||||
Command="{Binding CancelCommand}"
|
||||
Foreground="White" FontWeight="Bold">
|
||||
<Button.Style>
|
||||
<Style TargetType="Button">
|
||||
<Setter Property="Background" Value="#FF5858"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="Background" Value="#4D4D4D"/>
|
||||
<Setter Property="Foreground" Value="#888888"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
</Button>
|
||||
|
||||
<!-- Close button -->
|
||||
<Button Content="{DynamicResource Common.Close}" Width="90" Height="30"
|
||||
Command="{Binding CloseCommand}"
|
||||
Foreground="White" FontWeight="Bold">
|
||||
<Button.Style>
|
||||
<Style TargetType="Button">
|
||||
<Setter Property="Background" Value="#4D4D4D"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsEnabled" Value="True">
|
||||
<Setter Property="Background" Value="#337AB7"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="Foreground" Value="#888888"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
49
Views/Dialogs/UnlockProgressDialog.xaml.cs
Normal file
49
Views/Dialogs/UnlockProgressDialog.xaml.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using System.ComponentModel;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using HC_APTBS.ViewModels.Dialogs;
|
||||
|
||||
namespace HC_APTBS.Views.Dialogs
|
||||
{
|
||||
/// <summary>
|
||||
/// Non-modal window showing immobilizer unlock progress.
|
||||
/// Prevents user-initiated closing until the unlock sequence completes;
|
||||
/// programmatic close via <see cref="ForceClose"/> always succeeds.
|
||||
/// Equivalent to the old <c>WUnlocker</c> window.
|
||||
/// </summary>
|
||||
public partial class UnlockProgressDialog : Window
|
||||
{
|
||||
private bool _forceClose;
|
||||
|
||||
/// <summary>Creates the dialog and wires the ViewModel.</summary>
|
||||
public UnlockProgressDialog(UnlockProgressViewModel vm)
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = vm;
|
||||
vm.RequestClose += ForceClose;
|
||||
}
|
||||
|
||||
/// <summary>Closes the window unconditionally (bypasses the completion guard).</summary>
|
||||
public void ForceClose()
|
||||
{
|
||||
_forceClose = true;
|
||||
Close();
|
||||
}
|
||||
|
||||
/// <summary>Allows dragging the borderless window by clicking anywhere.</summary>
|
||||
private void OnMouseDrag(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (e.ChangedButton == MouseButton.Left)
|
||||
DragMove();
|
||||
}
|
||||
|
||||
/// <summary>Prevents user-initiated closing while the unlock sequence is still running.</summary>
|
||||
private void OnWindowClosing(object? sender, CancelEventArgs e)
|
||||
{
|
||||
if (_forceClose) return;
|
||||
|
||||
if (DataContext is UnlockProgressViewModel vm && !vm.IsComplete)
|
||||
e.Cancel = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- Username -->
|
||||
<Label Content="Username:" VerticalAlignment="Center" HorizontalAlignment="Right"/>
|
||||
<Label Content="{DynamicResource Dialog.UserCheck.Username}" VerticalAlignment="Center" HorizontalAlignment="Right"/>
|
||||
<TextBox Grid.Column="1" Margin="8,4" Height="26" VerticalContentAlignment="Center"
|
||||
Text="{Binding Username, UpdateSourceTrigger=PropertyChanged}"/>
|
||||
|
||||
<!-- Password -->
|
||||
<Label Grid.Row="1" Content="Password:" VerticalAlignment="Center" HorizontalAlignment="Right"/>
|
||||
<Label Grid.Row="1" Content="{DynamicResource Dialog.UserCheck.Password}" VerticalAlignment="Center" HorizontalAlignment="Right"/>
|
||||
<PasswordBox x:Name="PBPassword" Grid.Row="1" Grid.Column="1"
|
||||
Margin="8,4" Height="26" VerticalContentAlignment="Center"
|
||||
PasswordChanged="OnPasswordChanged"/>
|
||||
@@ -34,9 +34,9 @@
|
||||
<!-- Buttons -->
|
||||
<StackPanel Grid.Row="2" Grid.Column="1"
|
||||
Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,12,0,0">
|
||||
<Button Content="Accept" Width="80" Height="26" Margin="0,0,8,0"
|
||||
<Button Content="{DynamicResource Common.Accept}" Width="80" Height="26" Margin="0,0,8,0"
|
||||
Command="{Binding AcceptCommand}" IsDefault="True"/>
|
||||
<Button Content="Cancel" Width="80" Height="26"
|
||||
<Button Content="{DynamicResource Common.Cancel}" Width="80" Height="26"
|
||||
Command="{Binding CancelCommand}" IsCancel="True"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
59
Views/Dialogs/VoltageWarningDialog.xaml
Normal file
59
Views/Dialogs/VoltageWarningDialog.xaml
Normal file
@@ -0,0 +1,59 @@
|
||||
<Window x:Class="HC_APTBS.Views.Dialogs.VoltageWarningDialog"
|
||||
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"
|
||||
Title="{DynamicResource Dialog.Voltage.Title}"
|
||||
Height="200" Width="420"
|
||||
ResizeMode="NoResize"
|
||||
WindowStartupLocation="CenterOwner">
|
||||
|
||||
<Grid Margin="16,12">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="48"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- Voltage icon -->
|
||||
<TextBlock Grid.RowSpan="4" Text="⚡"
|
||||
FontSize="36" Foreground="#D4A017"
|
||||
VerticalAlignment="Top" HorizontalAlignment="Center"
|
||||
Margin="0,4,8,0"/>
|
||||
|
||||
<!-- Title with voltage -->
|
||||
<TextBlock Grid.Column="1" FontSize="18" FontWeight="Bold" Foreground="DarkOrange"
|
||||
Margin="0,0,0,8">
|
||||
<Run Text="VOLTAGE: "/>
|
||||
<Run Text="{Binding Voltage, Mode=OneWay}"/>
|
||||
</TextBlock>
|
||||
|
||||
<!-- Info message -->
|
||||
<TextBlock Grid.Row="1" Grid.Column="1" TextWrapping="Wrap" Margin="0,0,0,4">
|
||||
<Run Text="The selected pump requires "/>
|
||||
<Run Text="{Binding Voltage, Mode=OneWay}" FontWeight="Bold"/>
|
||||
<Run Text=" power supply."/>
|
||||
</TextBlock>
|
||||
|
||||
<!-- Action text -->
|
||||
<TextBlock Grid.Row="2" Grid.Column="1" TextWrapping="Wrap"
|
||||
FontSize="14" FontWeight="Bold" Foreground="DarkRed"
|
||||
Margin="0,4,0,0">
|
||||
<Run Text="SWITCH THE POWER SUPPLY TO "/>
|
||||
<Run Text="{Binding Voltage, Mode=OneWay}"/>
|
||||
</TextBlock>
|
||||
|
||||
<!-- Acknowledge button -->
|
||||
<Button Grid.Row="4" Grid.Column="1"
|
||||
Content="{DynamicResource Common.Ok}" Width="80" Height="26"
|
||||
HorizontalAlignment="Right" Margin="0,12,0,0"
|
||||
Command="{Binding AcknowledgeCommand}" IsDefault="True"/>
|
||||
</Grid>
|
||||
</Window>
|
||||
20
Views/Dialogs/VoltageWarningDialog.xaml.cs
Normal file
20
Views/Dialogs/VoltageWarningDialog.xaml.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System.Windows;
|
||||
using HC_APTBS.ViewModels.Dialogs;
|
||||
|
||||
namespace HC_APTBS.Views.Dialogs
|
||||
{
|
||||
/// <summary>
|
||||
/// Informational dialog warning the operator to switch the power supply
|
||||
/// voltage before testing a pump. Equivalent to the old <c>WAlert27v</c>.
|
||||
/// </summary>
|
||||
public partial class VoltageWarningDialog : Window
|
||||
{
|
||||
/// <summary>Creates the dialog and wires the ViewModel.</summary>
|
||||
public VoltageWarningDialog(VoltageWarningViewModel vm)
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = vm;
|
||||
vm.RequestClose += Close;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,7 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- Header -->
|
||||
<TextBlock Grid.ColumnSpan="3" Text="ADVANCE MONITORING"
|
||||
<TextBlock Grid.ColumnSpan="3" Text="{DynamicResource Angle.Header}"
|
||||
HorizontalAlignment="Center" FontSize="20"
|
||||
FontWeight="Bold" FontStyle="Italic"
|
||||
Foreground="DimGray" Margin="0,0,0,4"/>
|
||||
@@ -32,10 +32,10 @@
|
||||
<Button Content="0" Width="28" Height="28" FontWeight="Bold"
|
||||
VerticalAlignment="Center" Margin="0,0,4,0"
|
||||
Command="{Binding SetPsgZeroCommand}"
|
||||
ToolTip="Set PSG zero reference"/>
|
||||
ToolTip="{DynamicResource Angle.SetPsgZero}"/>
|
||||
<Border Style="{DynamicResource LcdBlue}" Padding="4,0" Width="170">
|
||||
<DockPanel>
|
||||
<TextBlock Text="PSG:" DockPanel.Dock="Left"
|
||||
<TextBlock Text="{DynamicResource Angle.Psg}" DockPanel.Dock="Left"
|
||||
VerticalAlignment="Bottom" Margin="2,0,0,8"
|
||||
FontSize="10" FontWeight="Bold"
|
||||
Foreground="{Binding PsgAngleForeground}"/>
|
||||
@@ -56,10 +56,10 @@
|
||||
<Button Content="0" Width="28" Height="28" FontWeight="Bold"
|
||||
VerticalAlignment="Center" Margin="0,0,4,0"
|
||||
Command="{Binding SetInjZeroCommand}"
|
||||
ToolTip="Set INJ zero reference"/>
|
||||
ToolTip="{DynamicResource Angle.SetInjZero}"/>
|
||||
<Border Style="{DynamicResource LcdBlue}" Padding="4,0" Width="170">
|
||||
<DockPanel>
|
||||
<TextBlock Text="INJ:" DockPanel.Dock="Left"
|
||||
<TextBlock Text="{DynamicResource Angle.Inj}" DockPanel.Dock="Left"
|
||||
VerticalAlignment="Bottom" Margin="2,0,0,8"
|
||||
FontSize="10" FontWeight="Bold"
|
||||
Foreground="{Binding InjAngleForeground}"/>
|
||||
@@ -105,7 +105,7 @@
|
||||
<!-- ABS (manual encoder) -->
|
||||
<Border Style="{DynamicResource LcdBlue}" Height="56" Margin="0,2" Padding="4,0">
|
||||
<DockPanel>
|
||||
<TextBlock Text="ABS º:" DockPanel.Dock="Left"
|
||||
<TextBlock Text="{DynamicResource Angle.AbsDeg}" DockPanel.Dock="Left"
|
||||
VerticalAlignment="Bottom" Margin="4,0,0,8"
|
||||
FontSize="10" FontWeight="Bold" Foreground="#FFEBEBFF"/>
|
||||
<TextBlock Text="{Binding ManualAngleText}"
|
||||
@@ -118,7 +118,7 @@
|
||||
<!-- LOCK angle result -->
|
||||
<Border Style="{DynamicResource LcdBlue}" Height="56" Margin="0,2" Padding="4,0">
|
||||
<DockPanel>
|
||||
<TextBlock Text="LOCK º:" DockPanel.Dock="Left"
|
||||
<TextBlock Text="{DynamicResource Angle.LockDeg}" DockPanel.Dock="Left"
|
||||
VerticalAlignment="Bottom" Margin="4,0,0,8"
|
||||
FontSize="10" FontWeight="Bold" Foreground="#FFEBEBFF"/>
|
||||
<TextBlock Text="{Binding LockAngleDisplay}"
|
||||
|
||||
@@ -20,27 +20,27 @@
|
||||
|
||||
<!-- CAN frame fields -->
|
||||
<WrapPanel Margin="0,0,0,4">
|
||||
<Label Content="CAN-Bus ID (0x)" VerticalAlignment="Bottom" Foreground="Black"/>
|
||||
<Label Content="{DynamicResource BenchParam.CanBusId}" VerticalAlignment="Bottom" Foreground="Black"/>
|
||||
<TextBox Text="{Binding MessageIdHex, UpdateSourceTrigger=LostFocus}"
|
||||
Width="40" VerticalAlignment="Center"
|
||||
Background="#66FFFFFF" BorderBrush="{x:Null}" Height="19"/>
|
||||
|
||||
<Label Content="Byte L" VerticalAlignment="Bottom" Foreground="Black" Margin="8,0,0,0"/>
|
||||
<Label Content="{DynamicResource BenchParam.ByteL}" VerticalAlignment="Bottom" Foreground="Black" Margin="8,0,0,0"/>
|
||||
<TextBox Text="{Binding ByteL, UpdateSourceTrigger=LostFocus}"
|
||||
Width="35" VerticalAlignment="Center"
|
||||
Background="#66FFFFFF" BorderBrush="{x:Null}" Height="19"/>
|
||||
|
||||
<Label Content="Byte H" VerticalAlignment="Bottom" Foreground="Black" Margin="8,0,0,0"/>
|
||||
<Label Content="{DynamicResource BenchParam.ByteH}" VerticalAlignment="Bottom" Foreground="Black" Margin="8,0,0,0"/>
|
||||
<TextBox Text="{Binding ByteH, UpdateSourceTrigger=LostFocus}"
|
||||
Width="35" VerticalAlignment="Center"
|
||||
Background="#66FFFFFF" BorderBrush="{x:Null}" Height="19"/>
|
||||
|
||||
<Label Content="Filter α" VerticalAlignment="Bottom" Foreground="Black" Margin="8,0,0,0"/>
|
||||
<Label Content="{DynamicResource BenchParam.FilterAlpha}" VerticalAlignment="Bottom" Foreground="Black" Margin="8,0,0,0"/>
|
||||
<TextBox Text="{Binding Alpha, UpdateSourceTrigger=LostFocus}"
|
||||
Width="40" VerticalAlignment="Center"
|
||||
Background="#66FFFFFF" BorderBrush="{x:Null}" Height="19"/>
|
||||
|
||||
<CheckBox Content="Enable formula" IsChecked="{Binding FormulaEnabled}"
|
||||
<CheckBox Content="{DynamicResource BenchParam.EnableFormula}" IsChecked="{Binding FormulaEnabled}"
|
||||
VerticalAlignment="Center" Foreground="Black" Margin="12,0,0,0"/>
|
||||
</WrapPanel>
|
||||
|
||||
|
||||
@@ -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"
|
||||
d:DesignHeight="150" d:DesignWidth="800" MaxHeight="150">
|
||||
d:DesignHeight="150" d:DesignWidth="460" MaxHeight="150">
|
||||
|
||||
<UserControl.Resources>
|
||||
<Style x:Key="LcdGreen" TargetType="Border">
|
||||
@@ -29,18 +29,18 @@
|
||||
</Style>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid Margin="50,0">
|
||||
<Grid Margin="16,8">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="75"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="120"/>
|
||||
<ColumnDefinition Width="450"/>
|
||||
<ColumnDefinition Width="144" MinWidth="60"/>
|
||||
<ColumnDefinition MinWidth="200"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- LEFT: version picker + read/write buttons -->
|
||||
<ComboBox Margin="5" VerticalAlignment="Bottom"
|
||||
<ComboBox Margin="4" VerticalAlignment="Bottom"
|
||||
SelectedIndex="{Binding VersionIndex}">
|
||||
<ComboBoxItem Content="V1"/>
|
||||
<ComboBoxItem Content="V2"/>
|
||||
@@ -48,40 +48,51 @@
|
||||
<ComboBoxItem Content="V4"/>
|
||||
</ComboBox>
|
||||
|
||||
<Grid Grid.Row="1">
|
||||
<Grid Grid.Row="1" Margin="4">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="4"/>
|
||||
<ColumnDefinition/>
|
||||
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Content="READ" Margin="2"
|
||||
<Button Content="{DynamicResource Dfi.Read}"
|
||||
Command="{Binding ReadDfiCommand}"
|
||||
FontSize="12" FontWeight="Bold" Padding="4"/>
|
||||
<Button Grid.Column="1" Content="WRITE" Margin="2"
|
||||
<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="150,5">
|
||||
<Grid Grid.Row="0" Grid.Column="1" Margin="4">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto" MinWidth="200"/>
|
||||
<ColumnDefinition MinWidth="100"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border Grid.ColumnSpan="2" Style="{StaticResource LcdGreen}"/>
|
||||
<Border Grid.ColumnSpan="2" BorderThickness="1" BorderBrush="Black" SnapsToDevicePixels="True"/>
|
||||
<TextBlock Text="DFI:"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Bottom"
|
||||
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"/>
|
||||
<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="AUTO"
|
||||
Grid.Row="0" Grid.Column="1"
|
||||
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"/>
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Text="FBKW - Advance Control" HorizontalAlignment="Center"
|
||||
<TextBlock Text="{DynamicResource PumpCtrl.Fbkw}" HorizontalAlignment="Center"
|
||||
FontSize="13" Foreground="Black" Margin="0,0,0,2"/>
|
||||
|
||||
<DockPanel Grid.Row="1" Margin="4,0,4,2">
|
||||
@@ -45,7 +45,7 @@
|
||||
Width="28" Height="28" Margin="0,0,4,0"
|
||||
Background="Transparent" BorderBrush="Transparent"
|
||||
Content="..." FontWeight="Bold" FontSize="14"
|
||||
ToolTip="Min / Step / Max"/>
|
||||
ToolTip="{DynamicResource PumpCtrl.MinStepMax}"/>
|
||||
<!-- Numeric text box -->
|
||||
<TextBox DockPanel.Dock="Right" Width="50" Height="28" Margin="4,0,0,0"
|
||||
TextAlignment="Center" VerticalContentAlignment="Center"
|
||||
@@ -68,17 +68,17 @@
|
||||
<StackPanel HorizontalAlignment="Center">
|
||||
<TextBox Text="{Binding FbkwMin, UpdateSourceTrigger=PropertyChanged}"
|
||||
Style="{StaticResource SettingsTextBox}"/>
|
||||
<TextBlock Text="Min" Style="{StaticResource SettingsLabel}" HorizontalAlignment="Center"/>
|
||||
<TextBlock Text="{DynamicResource PumpCtrl.Min}" Style="{StaticResource SettingsLabel}" HorizontalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
<StackPanel HorizontalAlignment="Center">
|
||||
<TextBox Text="{Binding FbkwStep, UpdateSourceTrigger=PropertyChanged}"
|
||||
Style="{StaticResource SettingsTextBox}"/>
|
||||
<TextBlock Text="Step" Style="{StaticResource SettingsLabel}" HorizontalAlignment="Center"/>
|
||||
<TextBlock Text="{DynamicResource PumpCtrl.Step}" Style="{StaticResource SettingsLabel}" HorizontalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
<StackPanel HorizontalAlignment="Center">
|
||||
<TextBox Text="{Binding FbkwMax, UpdateSourceTrigger=PropertyChanged}"
|
||||
Style="{StaticResource SettingsTextBox}"/>
|
||||
<TextBlock Text="Max" Style="{StaticResource SettingsLabel}" HorizontalAlignment="Center"/>
|
||||
<TextBlock Text="{DynamicResource PumpCtrl.Max}" Style="{StaticResource SettingsLabel}" HorizontalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</UniformGrid>
|
||||
</Border>
|
||||
@@ -92,7 +92,7 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Text="ME - Quantity Control" HorizontalAlignment="Center"
|
||||
<TextBlock Text="{DynamicResource PumpCtrl.Me}" HorizontalAlignment="Center"
|
||||
FontSize="13" Foreground="Black" Margin="0,0,0,2"/>
|
||||
|
||||
<DockPanel Grid.Row="1" Margin="4,0,4,2">
|
||||
@@ -100,7 +100,7 @@
|
||||
Width="28" Height="28" Margin="0,0,4,0"
|
||||
Background="Transparent" BorderBrush="Transparent"
|
||||
Content="..." FontWeight="Bold" FontSize="14"
|
||||
ToolTip="Min / Step / Max"/>
|
||||
ToolTip="{DynamicResource PumpCtrl.MinStepMax}"/>
|
||||
<TextBox DockPanel.Dock="Right" Width="50" Height="28" Margin="4,0,0,0"
|
||||
TextAlignment="Center" VerticalContentAlignment="Center"
|
||||
FontWeight="Bold" FontSize="13"
|
||||
@@ -120,17 +120,17 @@
|
||||
<StackPanel HorizontalAlignment="Center">
|
||||
<TextBox Text="{Binding MeMin, UpdateSourceTrigger=PropertyChanged}"
|
||||
Style="{StaticResource SettingsTextBox}"/>
|
||||
<TextBlock Text="Min" Style="{StaticResource SettingsLabel}" HorizontalAlignment="Center"/>
|
||||
<TextBlock Text="{DynamicResource PumpCtrl.Min}" Style="{StaticResource SettingsLabel}" HorizontalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
<StackPanel HorizontalAlignment="Center">
|
||||
<TextBox Text="{Binding MeStep, UpdateSourceTrigger=PropertyChanged}"
|
||||
Style="{StaticResource SettingsTextBox}"/>
|
||||
<TextBlock Text="Step" Style="{StaticResource SettingsLabel}" HorizontalAlignment="Center"/>
|
||||
<TextBlock Text="{DynamicResource PumpCtrl.Step}" Style="{StaticResource SettingsLabel}" HorizontalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
<StackPanel HorizontalAlignment="Center">
|
||||
<TextBox Text="{Binding MeMax, UpdateSourceTrigger=PropertyChanged}"
|
||||
Style="{StaticResource SettingsTextBox}"/>
|
||||
<TextBlock Text="Max" Style="{StaticResource SettingsLabel}" HorizontalAlignment="Center"/>
|
||||
<TextBlock Text="{DynamicResource PumpCtrl.Max}" Style="{StaticResource SettingsLabel}" HorizontalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</UniformGrid>
|
||||
</Border>
|
||||
@@ -145,7 +145,7 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Text="ME - Pre-inj Quantity" HorizontalAlignment="Center"
|
||||
<TextBlock Text="{DynamicResource PumpCtrl.PreInj}" HorizontalAlignment="Center"
|
||||
FontSize="13" Foreground="Black" Margin="0,0,0,2"/>
|
||||
|
||||
<DockPanel Grid.Row="1" Margin="4,0,4,2">
|
||||
@@ -153,7 +153,7 @@
|
||||
Width="28" Height="28" Margin="0,0,4,0"
|
||||
Background="Transparent" BorderBrush="Transparent"
|
||||
Content="..." FontWeight="Bold" FontSize="14"
|
||||
ToolTip="Min / Step / Max"/>
|
||||
ToolTip="{DynamicResource PumpCtrl.MinStepMax}"/>
|
||||
<TextBox DockPanel.Dock="Right" Width="50" Height="28" Margin="4,0,0,0"
|
||||
TextAlignment="Center" VerticalContentAlignment="Center"
|
||||
FontWeight="Bold" FontSize="13"
|
||||
@@ -173,17 +173,17 @@
|
||||
<StackPanel HorizontalAlignment="Center">
|
||||
<TextBox Text="{Binding PreInMin, UpdateSourceTrigger=PropertyChanged}"
|
||||
Style="{StaticResource SettingsTextBox}"/>
|
||||
<TextBlock Text="Min" Style="{StaticResource SettingsLabel}" HorizontalAlignment="Center"/>
|
||||
<TextBlock Text="{DynamicResource PumpCtrl.Min}" Style="{StaticResource SettingsLabel}" HorizontalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
<StackPanel HorizontalAlignment="Center">
|
||||
<TextBox Text="{Binding PreInStep, UpdateSourceTrigger=PropertyChanged}"
|
||||
Style="{StaticResource SettingsTextBox}"/>
|
||||
<TextBlock Text="Step" Style="{StaticResource SettingsLabel}" HorizontalAlignment="Center"/>
|
||||
<TextBlock Text="{DynamicResource PumpCtrl.Step}" Style="{StaticResource SettingsLabel}" HorizontalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
<StackPanel HorizontalAlignment="Center">
|
||||
<TextBox Text="{Binding PreInMax, UpdateSourceTrigger=PropertyChanged}"
|
||||
Style="{StaticResource SettingsTextBox}"/>
|
||||
<TextBlock Text="Max" Style="{StaticResource SettingsLabel}" HorizontalAlignment="Center"/>
|
||||
<TextBlock Text="{DynamicResource PumpCtrl.Max}" Style="{StaticResource SettingsLabel}" HorizontalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</UniformGrid>
|
||||
</Border>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Pump:" VerticalAlignment="Center" Margin="0,0,8,0" FontSize="14"/>
|
||||
<TextBlock Text="{DynamicResource PumpId.Label}" VerticalAlignment="Center" Margin="0,0,8,0" FontSize="14"/>
|
||||
<ComboBox Grid.Column="1"
|
||||
ItemsSource="{Binding PumpIds}"
|
||||
SelectedItem="{Binding SelectedPumpId}"
|
||||
@@ -36,43 +36,43 @@
|
||||
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="DFI:" FontSize="12" Margin="0,0,4,0" Foreground="Gray" Width="90"/>
|
||||
<TextBlock Text="{DynamicResource PumpId.Dfi}" FontSize="12" Margin="0,0,4,0" Foreground="Gray" Width="90"/>
|
||||
<TextBlock Text="{Binding KlineDfi}" FontSize="12" FontFamily="Consolas"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Pump ID:" FontSize="12" Margin="0,0,4,0" Foreground="Gray" Width="90"/>
|
||||
<TextBlock Text="{DynamicResource PumpId.PumpId}" FontSize="12" Margin="0,0,4,0" Foreground="Gray" Width="90"/>
|
||||
<TextBlock Text="{Binding KlinePumpId}" FontSize="12" FontFamily="Consolas"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Serial No:" FontSize="12" Margin="0,0,4,0" Foreground="Gray" Width="90"/>
|
||||
<TextBlock Text="{DynamicResource PumpId.SerialNo}" FontSize="12" Margin="0,0,4,0" Foreground="Gray" Width="90"/>
|
||||
<TextBlock Text="{Binding KlineSerialNumber}" FontSize="12" FontFamily="Consolas"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Model Ref:" FontSize="12" Margin="0,0,4,0" Foreground="Gray" Width="90"/>
|
||||
<TextBlock Text="{DynamicResource PumpId.ModelRef}" FontSize="12" Margin="0,0,4,0" Foreground="Gray" Width="90"/>
|
||||
<TextBlock Text="{Binding KlineModelRef}" FontSize="12" FontFamily="Consolas"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Data Record:" FontSize="12" Margin="0,0,4,0" Foreground="Gray" Width="90"/>
|
||||
<TextBlock Text="{DynamicResource PumpId.DataRecord}" FontSize="12" Margin="0,0,4,0" Foreground="Gray" Width="90"/>
|
||||
<TextBlock Text="{Binding KlineDataRecord}" FontSize="12" FontFamily="Consolas"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Pump Ctrl:" FontSize="12" Margin="0,0,4,0" Foreground="Gray" Width="90"/>
|
||||
<TextBlock Text="{DynamicResource PumpId.PumpCtrl}" FontSize="12" Margin="0,0,4,0" Foreground="Gray" Width="90"/>
|
||||
<TextBlock Text="{Binding KlinePumpControl}" FontSize="12" FontFamily="Consolas"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Model Index:" FontSize="12" Margin="0,0,4,0" Foreground="Gray" Width="90"/>
|
||||
<TextBlock Text="{DynamicResource PumpId.ModelIndex}" FontSize="12" Margin="0,0,4,0" Foreground="Gray" Width="90"/>
|
||||
<TextBlock Text="{Binding KlineModelIndex}" FontSize="12" FontFamily="Consolas"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="SW Ver 1:" FontSize="12" Margin="0,0,4,0" Foreground="Gray" Width="90"/>
|
||||
<TextBlock Text="{DynamicResource PumpId.SwVer1}" FontSize="12" Margin="0,0,4,0" Foreground="Gray" Width="90"/>
|
||||
<TextBlock Text="{Binding KlineSwVersion1}" FontSize="12" FontFamily="Consolas"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="SW Ver 2:" FontSize="12" Margin="0,0,4,0" Foreground="Gray" Width="90"/>
|
||||
<TextBlock Text="{DynamicResource PumpId.SwVer2}" FontSize="12" Margin="0,0,4,0" Foreground="Gray" Width="90"/>
|
||||
<TextBlock Text="{Binding KlineSwVersion2}" FontSize="12" FontFamily="Consolas"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Errors:" FontSize="12" Margin="0,0,4,0" Foreground="Gray" Width="90"/>
|
||||
<TextBlock Text="{DynamicResource PumpId.Errors}" FontSize="12" Margin="0,0,4,0" Foreground="Gray" Width="90"/>
|
||||
<TextBlock Text="{Binding KlineErrors}" FontSize="12" FontFamily="Consolas" Foreground="DarkRed"/>
|
||||
</StackPanel>
|
||||
<!-- ConnectError row: auto-collapses when empty via DataTrigger -->
|
||||
@@ -86,15 +86,15 @@
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</StackPanel.Style>
|
||||
<TextBlock Text="Error:" FontSize="12" Margin="0,0,4,0" Foreground="Gray" Width="90"/>
|
||||
<TextBlock Text="{DynamicResource PumpId.Error}" FontSize="12" Margin="0,0,4,0" Foreground="Gray" Width="90"/>
|
||||
<TextBlock Text="{Binding KlineConnectError}" FontSize="12" FontFamily="Consolas" Foreground="Red"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Column="1" VerticalAlignment="Center" Margin="6,0,0,0">
|
||||
<Button Content="Read K-Line" Width="90" Margin="0,2"
|
||||
<Button Content="{DynamicResource PumpId.ReadKLine}" Width="90" Margin="0,2"
|
||||
Command="{Binding ReadKlineCommand}"/>
|
||||
<Button Content="Disconnect" Width="90" Margin="0,2"
|
||||
<Button Content="{DynamicResource PumpId.Disconnect}" Width="90" Margin="0,2"
|
||||
Command="{Binding DisconnectKLineCommand}"/>
|
||||
<!-- Progress bar shown during K-Line read -->
|
||||
<ProgressBar Value="{Binding ProgressPercent, Mode=OneWay}"
|
||||
|
||||
@@ -72,12 +72,12 @@
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Phase" FontSize="10" FontWeight="Bold" Margin="3,0" Foreground="Gray"/>
|
||||
<TextBlock Text="Parameter" FontSize="10" FontWeight="Bold" Margin="3,0" Foreground="Gray" Grid.Column="1"/>
|
||||
<TextBlock Text="Target" FontSize="10" FontWeight="Bold" Margin="3,0" Foreground="Gray" Grid.Column="2"/>
|
||||
<TextBlock Text="Tol ±" FontSize="10" FontWeight="Bold" Margin="3,0" Foreground="Gray" Grid.Column="3"/>
|
||||
<TextBlock Text="Average" FontSize="10" FontWeight="Bold" Margin="3,0" Foreground="Gray" Grid.Column="4"/>
|
||||
<TextBlock Text="Result" FontSize="10" FontWeight="Bold" Margin="3,0" Foreground="Gray" Grid.Column="5"/>
|
||||
<TextBlock Text="{DynamicResource Result.Phase}" FontSize="10" FontWeight="Bold" Margin="3,0" Foreground="Gray"/>
|
||||
<TextBlock Text="{DynamicResource Result.Parameter}" FontSize="10" FontWeight="Bold" Margin="3,0" Foreground="Gray" Grid.Column="1"/>
|
||||
<TextBlock Text="{DynamicResource Result.Target}" FontSize="10" FontWeight="Bold" Margin="3,0" Foreground="Gray" Grid.Column="2"/>
|
||||
<TextBlock Text="{DynamicResource Result.Tolerance}" FontSize="10" FontWeight="Bold" Margin="3,0" Foreground="Gray" Grid.Column="3"/>
|
||||
<TextBlock Text="{DynamicResource Result.Average}" FontSize="10" FontWeight="Bold" Margin="3,0" Foreground="Gray" Grid.Column="4"/>
|
||||
<TextBlock Text="{DynamicResource Result.ResultHeader}" FontSize="10" FontWeight="Bold" Margin="3,0" Foreground="Gray" Grid.Column="5"/>
|
||||
</Grid>
|
||||
|
||||
<!-- Result rows -->
|
||||
|
||||
@@ -168,7 +168,7 @@
|
||||
Margin="16,0,0,0"/>
|
||||
|
||||
<!-- Critical indicator -->
|
||||
<TextBlock Text="Critical" FontSize="9"
|
||||
<TextBlock Text="{DynamicResource Test.Critical}" FontSize="9"
|
||||
Foreground="#E65100" FontWeight="Bold"
|
||||
HorizontalAlignment="Center"
|
||||
Visibility="{Binding IsCritical, Converter={StaticResource BoolToVis}}"/>
|
||||
@@ -178,13 +178,13 @@
|
||||
Margin="0,3,0,0">
|
||||
<!-- Ready values -->
|
||||
<StackPanel Visibility="{Binding ReadyValues.Count, FallbackValue=Collapsed}">
|
||||
<TextBlock Text="Required:" FontSize="9" Foreground="#666"
|
||||
<TextBlock Text="{DynamicResource Test.Required}" FontSize="9" Foreground="#666"
|
||||
FontWeight="SemiBold" Margin="0,1,0,0"/>
|
||||
<ItemsControl ItemsSource="{Binding ReadyValues}"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Send values -->
|
||||
<TextBlock Text="Test:" FontSize="9" Foreground="#666"
|
||||
<TextBlock Text="{DynamicResource Test.TestLabel}" FontSize="9" Foreground="#666"
|
||||
FontWeight="SemiBold" Margin="0,2,0,0"/>
|
||||
<ItemsControl ItemsSource="{Binding OperationValues}"/>
|
||||
</StackPanel>
|
||||
@@ -265,17 +265,17 @@
|
||||
<StackPanel Grid.Column="2" Orientation="Horizontal"
|
||||
VerticalAlignment="Center" Margin="16,0,0,0">
|
||||
<TextBlock FontSize="10" Foreground="DimGray">
|
||||
<Run Text="Cond: "/>
|
||||
<Run Text="{DynamicResource Test.Condition}"/>
|
||||
<Run Text="{Binding ConditioningTimeSec, Mode=OneWay}"/>
|
||||
<Run Text="s"/>
|
||||
</TextBlock>
|
||||
<TextBlock FontSize="10" Foreground="DimGray" Margin="10,0,0,0">
|
||||
<Run Text="Meas: "/>
|
||||
<Run Text="{DynamicResource Test.Measurement}"/>
|
||||
<Run Text="{Binding MeasurementTimeSec, Mode=OneWay}"/>
|
||||
<Run Text="s"/>
|
||||
</TextBlock>
|
||||
<TextBlock FontSize="10" Foreground="DimGray" Margin="10,0,0,0">
|
||||
<Run Text="M/s: "/>
|
||||
<Run Text="{DynamicResource Test.MeasPerSec}"/>
|
||||
<Run Text="{Binding MeasurementsPerSecond, StringFormat=F1, Mode=OneWay}"/>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
@@ -323,17 +323,17 @@
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Content="▶ START TEST" FontSize="15" FontWeight="Bold"
|
||||
<Button Content="{DynamicResource Test.StartTest}" FontSize="15" FontWeight="Bold"
|
||||
Height="44" Margin="0,0,4,0"
|
||||
Command="{Binding DataContext.StartTestCommand,
|
||||
RelativeSource={RelativeSource AncestorType=Window}}"
|
||||
Foreground="DarkGreen"/>
|
||||
<Button Grid.Column="1" Content="■ STOP" FontSize="15" FontWeight="Bold"
|
||||
<Button Grid.Column="1" Content="{DynamicResource Test.Stop}" FontSize="15" FontWeight="Bold"
|
||||
Height="44" Margin="4,0"
|
||||
Command="{Binding DataContext.StopTestCommand,
|
||||
RelativeSource={RelativeSource AncestorType=Window}}"
|
||||
Foreground="DarkRed"/>
|
||||
<Button Grid.Column="2" Content="📄 Report" FontSize="13"
|
||||
<Button Grid.Column="2" Content="{DynamicResource Test.Report}" FontSize="13"
|
||||
Height="44" Margin="4,0,0,0"
|
||||
Command="{Binding DataContext.GenerateReportCommand,
|
||||
RelativeSource={RelativeSource AncestorType=Window}}"/>
|
||||
@@ -353,14 +353,14 @@
|
||||
<!-- Show values toggle -->
|
||||
<CheckBox IsChecked="{Binding ShowOperationValues}"
|
||||
VerticalAlignment="Center">
|
||||
<TextBlock Text="Show values" FontSize="12"/>
|
||||
<TextBlock Text="{DynamicResource Test.ShowValues}" FontSize="12"/>
|
||||
</CheckBox>
|
||||
|
||||
<!-- Check all button -->
|
||||
<Button Grid.Column="1" Margin="12,0,0,0"
|
||||
Command="{Binding ToggleCheckAllCommand}"
|
||||
Padding="6,2" ToolTip="Enable/disable all phases">
|
||||
<TextBlock Text="Check All" FontSize="11"/>
|
||||
<TextBlock Text="{DynamicResource Test.CheckAll}" FontSize="11"/>
|
||||
</Button>
|
||||
|
||||
<!-- Remaining time -->
|
||||
@@ -368,7 +368,7 @@
|
||||
Foreground="DimGray" FontSize="12" Margin="0,0,4,0">
|
||||
<Run Text="~"/>
|
||||
<Run Text="{Binding RemainingSeconds, Mode=OneWay}"/>
|
||||
<Run Text="s remaining"/>
|
||||
<Run Text="{DynamicResource Test.SecondsRemaining}"/>
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
Reference in New Issue
Block a user