Charts - Add faint background grid (0.75px, #E0E0E0) to all live charts; matches PDF report style - Show min/max tolerance bands on P1/P2 pressure charts during test runs (previously only Q-Delivery/Q-Over) - Broaden BenchService.ToleranceUpdated to fire for every phase receive; UI routes by name - Clear P1/P2 traces on PhaseChanged alongside Delivery/Over CAN - Normalize QDelivery flow rate to 1000 RPM reference before IIR filter so RPM spikes are low-pass filtered with flow-rate transients (matches old_source behavior) Pump page - Reorder columns: identification left, commands center, live data right - PreIn control always visible; disabled when pump lacks pre-injection (rename IsPreInVisible -> IsPreInAvailable) - Swap value/label order in command cards - Remove redundant KlineErrors row from identification card Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
230 lines
14 KiB
XML
230 lines
14 KiB
XML
<UserControl x:Class="HC_APTBS.Views.UserControls.PumpCommandsCard"
|
|
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"
|
|
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
|
mc:Ignorable="d"
|
|
d:DesignHeight="460" d:DesignWidth="260"
|
|
IsEnabled="{Binding IsEnabled}">
|
|
|
|
<!-- DataContext = PumpControlViewModel (via {Binding PumpControl}) -->
|
|
<UserControl.Resources>
|
|
<Style x:Key="SettingsTextBox" TargetType="TextBox">
|
|
<Setter Property="Width" Value="44"/>
|
|
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
|
<Setter Property="VerticalAlignment" Value="Top"/>
|
|
<Setter Property="FontSize" Value="13"/>
|
|
</Style>
|
|
|
|
<Style x:Key="SettingsLabel" TargetType="TextBlock">
|
|
<Setter Property="VerticalAlignment" Value="Bottom"/>
|
|
<Setter Property="FontSize" Value="11"/>
|
|
<Setter Property="Foreground" Value="White"/>
|
|
<Setter Property="Margin" Value="0,2,0,0"/>
|
|
<Setter Property="HorizontalAlignment" Value="Center"/>
|
|
</Style>
|
|
</UserControl.Resources>
|
|
|
|
<Border Style="{StaticResource PumpCard}">
|
|
<DockPanel LastChildFill="True">
|
|
|
|
<!-- ── Card header ───────────────────────────────────────────── -->
|
|
<DockPanel DockPanel.Dock="Top" Margin="0,0,0,12">
|
|
<ui:SymbolIcon DockPanel.Dock="Left" Symbol="ArrowTrendingLines24" FontSize="16"
|
|
Foreground="{DynamicResource AccentTextFillColorPrimaryBrush}"
|
|
Margin="0,0,8,0" VerticalAlignment="Center"/>
|
|
<TextBlock Text="{DynamicResource Pump.Commands.Title}"
|
|
Style="{StaticResource PumpCardHeader}" Margin="0"/>
|
|
</DockPanel>
|
|
|
|
<!-- ── Slider columns ────────────────────────────────────────── -->
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="*"/>
|
|
<!-- PreIn: collapses when not applicable -->
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<!-- ── FBKW ────────────────────────────────────────────── -->
|
|
<StackPanel Grid.Column="0" HorizontalAlignment="Center">
|
|
<!-- Settings toggle -->
|
|
<ToggleButton x:Name="FbkwToggle"
|
|
Width="28" Height="22"
|
|
HorizontalAlignment="Center"
|
|
Background="Transparent" BorderBrush="Transparent"
|
|
Content="..." FontWeight="Bold" FontSize="13"
|
|
ToolTip="{DynamicResource PumpCtrl.MinStepMax}"/>
|
|
|
|
<!-- Max label -->
|
|
<TextBlock Text="{Binding FbkwMax, StringFormat=F1}"
|
|
Style="{StaticResource PumpCommandLabel}"
|
|
Margin="0,4,0,2"/>
|
|
|
|
<!-- Vertical slider -->
|
|
<Slider Orientation="Vertical"
|
|
Minimum="{Binding FbkwMin}" Maximum="{Binding FbkwMax}"
|
|
Value="{Binding FbkwValue}"
|
|
TickFrequency="{Binding FbkwStep}"
|
|
TickPlacement="TopLeft"
|
|
IsSnapToTickEnabled="True"
|
|
AutoToolTipPrecision="2"
|
|
Height="240" Width="32"
|
|
HorizontalAlignment="Center"
|
|
Focusable="False"/>
|
|
|
|
<!-- Min label -->
|
|
<TextBlock Text="{Binding FbkwMin, StringFormat=F1}"
|
|
Style="{StaticResource PumpCommandLabel}"
|
|
Margin="0,2,0,6"/>
|
|
|
|
<!-- Parameter name (above current value) -->
|
|
<TextBlock Text="{DynamicResource Pump.Commands.Fbkw}"
|
|
Style="{StaticResource PumpCommandLabel}"
|
|
Margin="0,0,0,2"/>
|
|
|
|
<!-- Editable value box -->
|
|
<TextBox Text="{Binding FbkwValue, UpdateSourceTrigger=PropertyChanged, StringFormat=F2}"
|
|
Style="{StaticResource PumpCommandValue}"/>
|
|
|
|
<!-- Settings popup -->
|
|
<Popup IsOpen="{Binding IsChecked, ElementName=FbkwToggle}"
|
|
StaysOpen="False" Placement="Bottom" AllowsTransparency="True">
|
|
<Border Background="#BB000000" Padding="8,6" CornerRadius="3">
|
|
<UniformGrid Columns="3" Width="180">
|
|
<StackPanel HorizontalAlignment="Center">
|
|
<TextBox Text="{Binding FbkwMin, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource SettingsTextBox}"/>
|
|
<TextBlock Text="{DynamicResource PumpCtrl.Min}" Style="{StaticResource SettingsLabel}"/>
|
|
</StackPanel>
|
|
<StackPanel HorizontalAlignment="Center">
|
|
<TextBox Text="{Binding FbkwStep, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource SettingsTextBox}"/>
|
|
<TextBlock Text="{DynamicResource PumpCtrl.Step}" Style="{StaticResource SettingsLabel}"/>
|
|
</StackPanel>
|
|
<StackPanel HorizontalAlignment="Center">
|
|
<TextBox Text="{Binding FbkwMax, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource SettingsTextBox}"/>
|
|
<TextBlock Text="{DynamicResource PumpCtrl.Max}" Style="{StaticResource SettingsLabel}"/>
|
|
</StackPanel>
|
|
</UniformGrid>
|
|
</Border>
|
|
</Popup>
|
|
</StackPanel>
|
|
|
|
<!-- ── ME ──────────────────────────────────────────────── -->
|
|
<StackPanel Grid.Column="1" HorizontalAlignment="Center">
|
|
<ToggleButton x:Name="MeToggle"
|
|
Width="28" Height="22"
|
|
HorizontalAlignment="Center"
|
|
Background="Transparent" BorderBrush="Transparent"
|
|
Content="..." FontWeight="Bold" FontSize="13"
|
|
ToolTip="{DynamicResource PumpCtrl.MinStepMax}"/>
|
|
|
|
<TextBlock Text="{Binding MeMax, StringFormat=F1}"
|
|
Style="{StaticResource PumpCommandLabel}"
|
|
Margin="0,4,0,2"/>
|
|
|
|
<Slider Orientation="Vertical"
|
|
Minimum="{Binding MeMin}" Maximum="{Binding MeMax}"
|
|
Value="{Binding MeValue}"
|
|
TickFrequency="{Binding MeStep}"
|
|
TickPlacement="TopLeft"
|
|
IsSnapToTickEnabled="False"
|
|
AutoToolTipPrecision="2"
|
|
Height="240" Width="32"
|
|
HorizontalAlignment="Center"
|
|
Focusable="False"/>
|
|
|
|
<TextBlock Text="{Binding MeMin, StringFormat=F1}"
|
|
Style="{StaticResource PumpCommandLabel}"
|
|
Margin="0,2,0,6"/>
|
|
|
|
<TextBlock Text="{DynamicResource Pump.Commands.Me}"
|
|
Style="{StaticResource PumpCommandLabel}"
|
|
Margin="0,0,0,2"/>
|
|
|
|
<TextBox Text="{Binding MeValue, UpdateSourceTrigger=PropertyChanged, StringFormat=F2}"
|
|
Style="{StaticResource PumpCommandValue}"/>
|
|
|
|
<Popup IsOpen="{Binding IsChecked, ElementName=MeToggle}"
|
|
StaysOpen="False" Placement="Bottom" AllowsTransparency="True">
|
|
<Border Background="#BB000000" Padding="8,6" CornerRadius="3">
|
|
<UniformGrid Columns="3" Width="180">
|
|
<StackPanel HorizontalAlignment="Center">
|
|
<TextBox Text="{Binding MeMin, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource SettingsTextBox}"/>
|
|
<TextBlock Text="{DynamicResource PumpCtrl.Min}" Style="{StaticResource SettingsLabel}"/>
|
|
</StackPanel>
|
|
<StackPanel HorizontalAlignment="Center">
|
|
<TextBox Text="{Binding MeStep, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource SettingsTextBox}"/>
|
|
<TextBlock Text="{DynamicResource PumpCtrl.Step}" Style="{StaticResource SettingsLabel}"/>
|
|
</StackPanel>
|
|
<StackPanel HorizontalAlignment="Center">
|
|
<TextBox Text="{Binding MeMax, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource SettingsTextBox}"/>
|
|
<TextBlock Text="{DynamicResource PumpCtrl.Max}" Style="{StaticResource SettingsLabel}"/>
|
|
</StackPanel>
|
|
</UniformGrid>
|
|
</Border>
|
|
</Popup>
|
|
</StackPanel>
|
|
|
|
<!-- ── PreIn (always visible; disabled when pump lacks pre-injection) ── -->
|
|
<StackPanel Grid.Column="2" HorizontalAlignment="Center"
|
|
IsEnabled="{Binding IsPreInAvailable}">
|
|
<ToggleButton x:Name="PreInToggle"
|
|
Width="28" Height="22"
|
|
HorizontalAlignment="Center"
|
|
Background="Transparent" BorderBrush="Transparent"
|
|
Content="..." FontWeight="Bold" FontSize="13"
|
|
ToolTip="{DynamicResource PumpCtrl.MinStepMax}"/>
|
|
|
|
<TextBlock Text="{Binding PreInMax, StringFormat=F1}"
|
|
Style="{StaticResource PumpCommandLabel}"
|
|
Margin="0,4,0,2"/>
|
|
|
|
<Slider Orientation="Vertical"
|
|
Minimum="{Binding PreInMin}" Maximum="{Binding PreInMax}"
|
|
Value="{Binding PreInValue}"
|
|
TickFrequency="{Binding PreInStep}"
|
|
TickPlacement="TopLeft"
|
|
IsSnapToTickEnabled="True"
|
|
AutoToolTipPrecision="2"
|
|
Height="240" Width="32"
|
|
HorizontalAlignment="Center"
|
|
Focusable="False"/>
|
|
|
|
<TextBlock Text="{Binding PreInMin, StringFormat=F1}"
|
|
Style="{StaticResource PumpCommandLabel}"
|
|
Margin="0,2,0,6"/>
|
|
|
|
<TextBlock Text="{DynamicResource Pump.Commands.PreIn}"
|
|
Style="{StaticResource PumpCommandLabel}"
|
|
Margin="0,0,0,2"/>
|
|
|
|
<TextBox Text="{Binding PreInValue, UpdateSourceTrigger=PropertyChanged, StringFormat=F2}"
|
|
Style="{StaticResource PumpCommandValue}"/>
|
|
|
|
<Popup IsOpen="{Binding IsChecked, ElementName=PreInToggle}"
|
|
StaysOpen="False" Placement="Bottom" AllowsTransparency="True">
|
|
<Border Background="#BB000000" Padding="8,6" CornerRadius="3">
|
|
<UniformGrid Columns="3" Width="180">
|
|
<StackPanel HorizontalAlignment="Center">
|
|
<TextBox Text="{Binding PreInMin, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource SettingsTextBox}"/>
|
|
<TextBlock Text="{DynamicResource PumpCtrl.Min}" Style="{StaticResource SettingsLabel}"/>
|
|
</StackPanel>
|
|
<StackPanel HorizontalAlignment="Center">
|
|
<TextBox Text="{Binding PreInStep, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource SettingsTextBox}"/>
|
|
<TextBlock Text="{DynamicResource PumpCtrl.Step}" Style="{StaticResource SettingsLabel}"/>
|
|
</StackPanel>
|
|
<StackPanel HorizontalAlignment="Center">
|
|
<TextBox Text="{Binding PreInMax, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource SettingsTextBox}"/>
|
|
<TextBlock Text="{DynamicResource PumpCtrl.Max}" Style="{StaticResource SettingsLabel}"/>
|
|
</StackPanel>
|
|
</UniformGrid>
|
|
</Border>
|
|
</Popup>
|
|
</StackPanel>
|
|
|
|
</Grid>
|
|
</DockPanel>
|
|
</Border>
|
|
</UserControl>
|