Files
HC_APTBS/Views/UserControls/PumpIdentificationPanelView.xaml
LucianoDev 0280a2fad1 feat: page-based navigation shell + Tests page wizard
Replace the monolithic MainWindow with a SelectedPage-driven shell
(Dashboard / Pump / Bench / Tests / Results / Settings). The Tests
page gets the Plan -> Preconditions -> Running -> Done wizard from
ui-structure.md \u00a74, backed by a 7-item precondition gate and
shared sub-views (PhaseCardView / TestSectionView / GraphicIndicatorView)
extracted from the now-deleted monolithic TestPanelView.

New VMs / views:
- Tests wizard: TestPreconditions, PhaseCard, GraphicIndicator,
  TestSection, TestPlan, TestRunning, TestDone
- Dashboard panels: DashboardConnection, DashboardReadings,
  DashboardAlarms, InterlockBanner, ResultHistory
- Pump / bench panels: PumpIdentificationPanel, PumpLiveData,
  UnlockPanel, BenchDriveControl, BenchReadings, RelayBank,
  TemperatureControl, DtcList, AuthGate
- Dialogs: generic ConfirmDialog, UserManageDialog, UserPromptDialog

Supporting changes:
- IsOilPumpOn exposed on MainViewModel for precondition evaluation
- RequiresAuth added to TestDefinition (XML round-trip)
- BipStatusDefinition + CompletedTestRun models
- ~35 new Test.* localization keys (en + es)
- Settings moved from modal dialog to full page
- Pause / Retry / Skip stubs in TestRunningView; full spec in
  docs/gap-test-running-controls.md for follow-up implementation
- docs/ui-structure.md captures the wizard design

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-18 13:11:34 +02:00

166 lines
9.4 KiB
XML

<UserControl x:Class="HC_APTBS.Views.UserControls.PumpIdentificationPanelView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="360" d:DesignWidth="700">
<!--
Pump-page variant of PumpIdentificationView (spec §3.a Identification).
Reuses PumpIdentificationViewModel. Presents the ECU info panel
in a larger, two-column format suitable for the Pump page.
-->
<UserControl.Resources>
<BooleanToVisibilityConverter x:Key="BoolToVis"/>
<Style x:Key="IdLabel" TargetType="TextBlock">
<Setter Property="FontSize" Value="12"/>
<Setter Property="Foreground" Value="#555"/>
<Setter Property="Width" Value="110"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
<Style x:Key="IdValue" TargetType="TextBlock">
<Setter Property="FontSize" Value="13"/>
<Setter Property="FontFamily" Value="Consolas"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="TextTrimming" Value="CharacterEllipsis"/>
</Style>
</UserControl.Resources>
<Border Background="#FAFAFA" BorderBrush="#DDD" BorderThickness="1"
CornerRadius="4" Padding="12" Margin="6">
<StackPanel>
<!-- ── Section title ────────────────────────────────────────── -->
<TextBlock Text="{DynamicResource PumpSub.Identification}"
FontSize="15" FontWeight="SemiBold" Foreground="#333"
Margin="0,0,0,8"/>
<!-- ── Pump selector row ────────────────────────────────────── -->
<Grid Margin="0,0,0,10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="110"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0"
Text="{DynamicResource PumpId.Label}"
VerticalAlignment="Center" FontSize="13"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding PumpIds}"
SelectedItem="{Binding SelectedPumpId}"
FontSize="18" Margin="0,0,12,0"
VerticalContentAlignment="Center"/>
<TextBlock Grid.Column="2"
Text="{Binding CurrentPump.Model}"
FontSize="13" Foreground="#888"
VerticalAlignment="Center"/>
</Grid>
<!-- ── Action row: Read + Disconnect + progress ─────────────── -->
<Grid Margin="0,0,0,10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button Grid.Column="0"
Content="{DynamicResource PumpId.ReadKLine}"
Command="{Binding ReadKlineCommand}"
MinWidth="130" Height="34" FontWeight="Bold"
Margin="0,0,8,0"/>
<Button Grid.Column="1"
Content="{DynamicResource PumpId.Disconnect}"
Command="{Binding DisconnectKLineCommand}"
MinWidth="110" Height="34"
Margin="0,0,12,0"/>
<StackPanel Grid.Column="2"
Orientation="Vertical"
VerticalAlignment="Center"
Visibility="{Binding IsReading, Converter={StaticResource BoolToVis}}">
<TextBlock Text="{Binding ProgressMessage}"
FontSize="11" Foreground="#666"
TextTrimming="CharacterEllipsis"/>
<ProgressBar Value="{Binding ProgressPercent, Mode=OneWay}"
Minimum="0" Maximum="100" Height="8" Margin="0,2,0,0"/>
</StackPanel>
</Grid>
<!-- ── Two-column ECU info grid ─────────────────────────────── -->
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="16"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<!-- Left column -->
<StackPanel Grid.Column="0">
<StackPanel Orientation="Horizontal" Margin="0,2">
<TextBlock Text="{DynamicResource PumpId.PumpId}" Style="{StaticResource IdLabel}"/>
<TextBlock Text="{Binding KlinePumpId}" Style="{StaticResource IdValue}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,2">
<TextBlock Text="{DynamicResource PumpId.SerialNo}" Style="{StaticResource IdLabel}"/>
<TextBlock Text="{Binding KlineSerialNumber}" Style="{StaticResource IdValue}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,2">
<TextBlock Text="{DynamicResource PumpId.ModelRef}" Style="{StaticResource IdLabel}"/>
<TextBlock Text="{Binding KlineModelRef}" Style="{StaticResource IdValue}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,2">
<TextBlock Text="{DynamicResource PumpId.ModelIndex}" Style="{StaticResource IdLabel}"/>
<TextBlock Text="{Binding KlineModelIndex}" Style="{StaticResource IdValue}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,2">
<TextBlock Text="{DynamicResource PumpId.DataRecord}" Style="{StaticResource IdLabel}"/>
<TextBlock Text="{Binding KlineDataRecord}" Style="{StaticResource IdValue}"/>
</StackPanel>
</StackPanel>
<!-- Right column -->
<StackPanel Grid.Column="2">
<StackPanel Orientation="Horizontal" Margin="0,2">
<TextBlock Text="{DynamicResource PumpId.SwVer1}" Style="{StaticResource IdLabel}"/>
<TextBlock Text="{Binding KlineSwVersion1}" Style="{StaticResource IdValue}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,2">
<TextBlock Text="{DynamicResource PumpId.SwVer2}" Style="{StaticResource IdLabel}"/>
<TextBlock Text="{Binding KlineSwVersion2}" Style="{StaticResource IdValue}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,2">
<TextBlock Text="{DynamicResource PumpId.PumpCtrl}" Style="{StaticResource IdLabel}"/>
<TextBlock Text="{Binding KlinePumpControl}" Style="{StaticResource IdValue}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,2">
<TextBlock Text="{DynamicResource PumpId.Dfi}" Style="{StaticResource IdLabel}"/>
<TextBlock Text="{Binding KlineDfi}" Style="{StaticResource IdValue}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,2">
<TextBlock Text="{DynamicResource PumpId.Errors}" Style="{StaticResource IdLabel}"/>
<TextBlock Text="{Binding KlineErrors}" Style="{StaticResource IdValue}" Foreground="DarkRed"/>
</StackPanel>
</StackPanel>
</Grid>
<!-- ── Connection error footer (auto-collapses) ─────────────── -->
<Border Background="#FDECEA" BorderBrush="#D62828" BorderThickness="1"
CornerRadius="3" Padding="8,4" Margin="0,10,0,0">
<Border.Style>
<Style TargetType="Border">
<Style.Triggers>
<DataTrigger Binding="{Binding KlineConnectError}" Value="">
<Setter Property="Visibility" Value="Collapsed"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
<TextBlock Text="{Binding KlineConnectError}"
FontSize="12" FontFamily="Consolas" Foreground="#B22222"
TextWrapping="Wrap"/>
</Border>
</StackPanel>
</Border>
</UserControl>