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>
95 lines
5.2 KiB
XML
95 lines
5.2 KiB
XML
<UserControl x:Class="HC_APTBS.Views.UserControls.DtcListView"
|
|
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 §3.b DTC list. DataContext = DtcListViewModel.
|
|
Moves the fault-code surface out of the one-shot KlineErrorsDialog
|
|
into a proper sub-section with read / clear actions and a row list.
|
|
-->
|
|
<UserControl.Resources>
|
|
<BooleanToVisibilityConverter x:Key="BoolToVis"/>
|
|
</UserControl.Resources>
|
|
|
|
<Border Background="#FAFAFA" BorderBrush="#DDD" BorderThickness="1"
|
|
CornerRadius="4" Padding="12" Margin="6">
|
|
<DockPanel>
|
|
|
|
<!-- ── Header row: title + actions ─────────────────────────── -->
|
|
<Grid DockPanel.Dock="Top" Margin="0,0,0,8">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock Text="{DynamicResource PumpSub.Dtcs}"
|
|
FontSize="15" FontWeight="SemiBold" Foreground="#333"
|
|
VerticalAlignment="Center"/>
|
|
<StackPanel Grid.Column="1" Orientation="Horizontal">
|
|
<Button Content="{DynamicResource Dtc.Read}"
|
|
Command="{Binding ReadCommand}"
|
|
MinWidth="90" Height="28" Margin="0,0,6,0"
|
|
FontWeight="Bold"/>
|
|
<Button Content="{DynamicResource Dtc.Clear}"
|
|
Command="{Binding ClearCommand}"
|
|
MinWidth="90" Height="28"/>
|
|
</StackPanel>
|
|
</Grid>
|
|
|
|
<!-- ── Status line ─────────────────────────────────────────── -->
|
|
<TextBlock DockPanel.Dock="Top"
|
|
Text="{Binding StatusText}"
|
|
Foreground="#666" FontSize="11" Margin="0,0,0,6"/>
|
|
|
|
<!-- ── Busy indicator ──────────────────────────────────────── -->
|
|
<ProgressBar DockPanel.Dock="Top"
|
|
IsIndeterminate="True" Height="3" Margin="0,0,0,6"
|
|
Visibility="{Binding IsBusy, Converter={StaticResource BoolToVis}}"/>
|
|
|
|
<!-- ── "No faults" banner ──────────────────────────────────── -->
|
|
<Border DockPanel.Dock="Top"
|
|
Background="#26C200" CornerRadius="3" Padding="10,6"
|
|
HorizontalAlignment="Left"
|
|
Visibility="{Binding IsClear, Converter={StaticResource BoolToVis}}">
|
|
<TextBlock Text="{DynamicResource Dtc.NoFaults}"
|
|
Foreground="White" FontWeight="Bold" FontSize="12"/>
|
|
</Border>
|
|
|
|
<!-- ── DTC rows ────────────────────────────────────────────── -->
|
|
<ListBox ItemsSource="{Binding Codes}"
|
|
BorderThickness="0" Background="Transparent">
|
|
<ListBox.ItemContainerStyle>
|
|
<Style TargetType="ListBoxItem">
|
|
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
|
<Setter Property="Padding" Value="0"/>
|
|
</Style>
|
|
</ListBox.ItemContainerStyle>
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate>
|
|
<Border Background="#FDECEA" BorderBrush="#D62828"
|
|
BorderThickness="0,0,0,1" Padding="8,6" Margin="0,2">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="110"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock Text="{Binding Code}"
|
|
FontFamily="Consolas" FontWeight="Bold"
|
|
FontSize="13" Foreground="#B22222"
|
|
VerticalAlignment="Center"/>
|
|
<TextBlock Grid.Column="1"
|
|
Text="{Binding Description}"
|
|
FontSize="12" Foreground="#333"
|
|
TextWrapping="Wrap"
|
|
VerticalAlignment="Center"/>
|
|
</Grid>
|
|
</Border>
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
</ListBox>
|
|
</DockPanel>
|
|
</Border>
|
|
</UserControl>
|