Bundles several feature streams that have been iterating on the working tree: - Developer Tools page (Debug-only via DEVELOPER_TOOLS symbol): hosts the identification card, manual KWP write + transaction log, ROM/EEPROM dump card with progress banner and completion message, persisted custom-commands library, persisted EEPROM passwords library. New service primitives: IKwpService.SendRawCustomAsync / ReadEepromAsync / ReadRomEepromAsync. Persistence mirrors the Clients XML pattern in two new files (custom_commands.xml, eeprom_passwords.xml). - Auto-test orchestrator (IAutoTestOrchestrator + AutoTestState): linear K-Line read -> unlock -> bench-on -> test sequence with snackbar UI and progress dialog VM, gated on dashboard alarms. - BIP-STATUS display: BipDisplayViewModel + BipDisplayView, RAM read at 0x0106 via IKwpService.ReadBipStatusAsync; status definitions in BipStatusDefinition. - Tests page redesign: TestSectionCard + PhaseTileView replacing the old TestPlanView/TestRunningView/TestDoneView/TestPreconditionsView/ TestSectionView controls and their VMs. - Pump command sliders: Fluent thick-track style with overhang thumb, click-anywhere-and-drag, mouse-wheel adjustment. - Window startup: app.manifest declares PerMonitorV2 DPI awareness, MainWindow installs a WM_GETMINMAXINFO hook in OnSourceInitialized and maximizes there (after the hook is in place) so the app fits the work area exactly on any display configuration. - Misc: PercentToPixelsConverter, seed_aliases.py one-shot pump-alias importer, tools/Import-BipStatus.ps1, kline_eeprom_spec.md and dump-functions reference docs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
163 lines
11 KiB
XML
163 lines
11 KiB
XML
<UserControl x:Class="HC_APTBS.Views.UserControls.PumpTopStripView"
|
|
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"
|
|
xmlns:models="clr-namespace:HC_APTBS.Models"
|
|
mc:Ignorable="d"
|
|
d:DesignHeight="52" d:DesignWidth="1100">
|
|
|
|
<!-- DataContext = PumpPageViewModel. Binds via Root.* and Identification.* -->
|
|
<Border Background="{DynamicResource CardBackgroundFillColorDefaultBrush}"
|
|
BorderBrush="{DynamicResource CardStrokeColorDefaultBrush}"
|
|
BorderThickness="1" CornerRadius="8"
|
|
Padding="14,10" Margin="0,0,0,8">
|
|
<DockPanel LastChildFill="False">
|
|
|
|
<!-- ── Right side: CAN chip + K-Line chip ────────────────────── -->
|
|
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal" VerticalAlignment="Center">
|
|
|
|
<!-- CAN chip -->
|
|
<Border Style="{StaticResource ConnChip}">
|
|
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
|
<ui:SymbolIcon Symbol="PlugConnected24" FontSize="15"
|
|
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
|
|
Margin="0,0,6,0"/>
|
|
<TextBlock Text="{DynamicResource Pump.TopStrip.Can}" FontSize="12"
|
|
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
|
VerticalAlignment="Center" Margin="0,0,10,0"/>
|
|
<Ellipse>
|
|
<Ellipse.Style>
|
|
<Style TargetType="Ellipse" BasedOn="{StaticResource StatusDot}">
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding Root.IsCanConnected}" Value="True">
|
|
<Setter Property="Fill" Value="{DynamicResource SystemFillColorSuccessBrush}"/>
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Ellipse.Style>
|
|
</Ellipse>
|
|
<TextBlock FontSize="11" FontWeight="SemiBold" VerticalAlignment="Center">
|
|
<TextBlock.Style>
|
|
<Style TargetType="TextBlock">
|
|
<Setter Property="Text" Value="{DynamicResource Dashboard.StateOffline}"/>
|
|
<Setter Property="Foreground" Value="{DynamicResource TextFillColorTertiaryBrush}"/>
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding Root.IsCanConnected}" Value="True">
|
|
<Setter Property="Text" Value="{DynamicResource Dashboard.StateOnline}"/>
|
|
<Setter Property="Foreground" Value="{DynamicResource SystemFillColorSuccessBrush}"/>
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</TextBlock.Style>
|
|
</TextBlock>
|
|
</StackPanel>
|
|
</Border>
|
|
|
|
<!-- K-Line chip — 3-state: Connected / Closed / Failed -->
|
|
<Border Margin="0,0,0,0">
|
|
<Border.Style>
|
|
<Style TargetType="Border" BasedOn="{StaticResource ConnChip}">
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding Root.KLineState}"
|
|
Value="{x:Static models:KLineConnectionState.Failed}">
|
|
<Setter Property="Background" Value="{DynamicResource SystemFillColorCautionBackgroundBrush}"/>
|
|
<Setter Property="BorderBrush" Value="{DynamicResource SystemFillColorCautionBrush}"/>
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Border.Style>
|
|
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
|
<ui:SymbolIcon Symbol="UsbPlug24" FontSize="15"
|
|
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
|
|
Margin="0,0,6,0"/>
|
|
<TextBlock Text="{DynamicResource Pump.TopStrip.KLine}" FontSize="12"
|
|
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
|
VerticalAlignment="Center" Margin="0,0,10,0"/>
|
|
<Ellipse>
|
|
<Ellipse.Style>
|
|
<Style TargetType="Ellipse" BasedOn="{StaticResource StatusDot}">
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding Root.KLineState}"
|
|
Value="{x:Static models:KLineConnectionState.Connected}">
|
|
<Setter Property="Fill" Value="{DynamicResource SystemFillColorSuccessBrush}"/>
|
|
</DataTrigger>
|
|
<DataTrigger Binding="{Binding Root.KLineState}"
|
|
Value="{x:Static models:KLineConnectionState.Failed}">
|
|
<Setter Property="Fill" Value="{DynamicResource SystemFillColorCautionBrush}"/>
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Ellipse.Style>
|
|
</Ellipse>
|
|
<TextBlock FontSize="11" FontWeight="SemiBold" VerticalAlignment="Center">
|
|
<TextBlock.Style>
|
|
<Style TargetType="TextBlock">
|
|
<Setter Property="Text" Value="{DynamicResource Dashboard.StateClosed}"/>
|
|
<Setter Property="Foreground" Value="{DynamicResource TextFillColorTertiaryBrush}"/>
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding Root.KLineState}"
|
|
Value="{x:Static models:KLineConnectionState.Connected}">
|
|
<Setter Property="Text" Value="{DynamicResource Dashboard.StateOpen}"/>
|
|
<Setter Property="Foreground" Value="{DynamicResource SystemFillColorSuccessBrush}"/>
|
|
</DataTrigger>
|
|
<DataTrigger Binding="{Binding Root.KLineState}"
|
|
Value="{x:Static models:KLineConnectionState.Failed}">
|
|
<Setter Property="Text" Value="{DynamicResource Dashboard.StateFailed}"/>
|
|
<Setter Property="Foreground" Value="{DynamicResource SystemFillColorCautionBrush}"/>
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</TextBlock.Style>
|
|
</TextBlock>
|
|
</StackPanel>
|
|
</Border>
|
|
</StackPanel>
|
|
|
|
<!-- ── Left side: Pump selector + Brand/Model label ─────────── -->
|
|
<StackPanel DockPanel.Dock="Left" Orientation="Horizontal" VerticalAlignment="Center">
|
|
<!-- Pump ID label -->
|
|
<TextBlock Text="{DynamicResource PumpId.Label}"
|
|
FontSize="12"
|
|
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
|
|
VerticalAlignment="Center" Margin="0,0,8,0"/>
|
|
|
|
<!-- Pump selector ComboBox -->
|
|
<ComboBox ItemsSource="{Binding Identification.PumpIds}"
|
|
SelectedItem="{Binding Identification.SelectedPumpId}"
|
|
MinWidth="200" FontSize="13" Height="36"
|
|
VerticalContentAlignment="Center"/>
|
|
|
|
<!-- Model / Brand badge -->
|
|
<Border Background="{DynamicResource ControlFillColorSecondaryBrush}"
|
|
BorderBrush="{DynamicResource ControlStrokeColorDefaultBrush}"
|
|
BorderThickness="1" CornerRadius="10" Padding="10,4" Margin="10,0,0,0">
|
|
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
|
<TextBlock Text="{DynamicResource Pump.TopStrip.Brand}"
|
|
FontSize="11"
|
|
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
|
|
Margin="0,0,4,0"/>
|
|
<TextBlock FontSize="13" FontWeight="SemiBold"
|
|
Foreground="{DynamicResource TextFillColorPrimaryBrush}">
|
|
<TextBlock.Style>
|
|
<Style TargetType="TextBlock">
|
|
<Setter Property="Text" Value="{Binding Identification.CurrentPump.Model}"/>
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding Identification.CurrentPump}" Value="{x:Null}">
|
|
<Setter Property="Text" Value="{DynamicResource Pump.TopStrip.NoPump}"/>
|
|
<Setter Property="FontStyle" Value="Italic"/>
|
|
<Setter Property="Foreground" Value="{DynamicResource TextFillColorTertiaryBrush}"/>
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</TextBlock.Style>
|
|
</TextBlock>
|
|
</StackPanel>
|
|
</Border>
|
|
</StackPanel>
|
|
|
|
</DockPanel>
|
|
</Border>
|
|
</UserControl>
|