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>
159 lines
8.4 KiB
XML
159 lines
8.4 KiB
XML
<UserControl x:Class="HC_APTBS.Views.UserControls.DashboardConnectionView"
|
|
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"
|
|
xmlns:models="clr-namespace:HC_APTBS.Models"
|
|
mc:Ignorable="d"
|
|
d:DesignHeight="160" d:DesignWidth="220">
|
|
<!--
|
|
Connection status block for the Dashboard.
|
|
DataContext is DashboardPageViewModel; pills read from Root.X.
|
|
Pill uses the shared ConnIndicator style. Gray = offline, green = live, red = K-Line failed.
|
|
-->
|
|
<StackPanel>
|
|
<TextBlock Text="{DynamicResource Dashboard.Connections}"
|
|
FontSize="13" FontWeight="SemiBold" Foreground="#333"
|
|
Margin="0,0,0,6"/>
|
|
|
|
<!-- CAN bus -->
|
|
<Grid Margin="0,2">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="80"/>
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock Text="{DynamicResource Dashboard.Conn.Can}" VerticalAlignment="Center" FontSize="12"/>
|
|
<Border Grid.Column="1" MinWidth="72" Height="22">
|
|
<Border.Style>
|
|
<Style TargetType="Border" BasedOn="{StaticResource ConnIndicator}">
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding Root.IsCanConnected}" Value="True">
|
|
<Setter Property="Background" Value="#26C200"/>
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Border.Style>
|
|
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center"
|
|
FontSize="10" FontWeight="SemiBold" Foreground="White"
|
|
Text="{DynamicResource Dashboard.StateOnline}">
|
|
<TextBlock.Style>
|
|
<Style TargetType="TextBlock">
|
|
<Setter Property="Text" Value="{DynamicResource Dashboard.StateOffline}"/>
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding Root.IsCanConnected}" Value="True">
|
|
<Setter Property="Text" Value="{DynamicResource Dashboard.StateOnline}"/>
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</TextBlock.Style>
|
|
</TextBlock>
|
|
</Border>
|
|
</Grid>
|
|
|
|
<!-- Bench liveness -->
|
|
<Grid Margin="0,2">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="80"/>
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock Text="{DynamicResource Dashboard.Conn.Bench}" VerticalAlignment="Center" FontSize="12"/>
|
|
<Border Grid.Column="1" MinWidth="72" Height="22">
|
|
<Border.Style>
|
|
<Style TargetType="Border" BasedOn="{StaticResource ConnIndicator}">
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding Root.IsBenchConnected}" Value="True">
|
|
<Setter Property="Background" Value="#26C200"/>
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Border.Style>
|
|
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center"
|
|
FontSize="10" FontWeight="SemiBold" Foreground="White">
|
|
<TextBlock.Style>
|
|
<Style TargetType="TextBlock">
|
|
<Setter Property="Text" Value="{DynamicResource Dashboard.StateOffline}"/>
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding Root.IsBenchConnected}" Value="True">
|
|
<Setter Property="Text" Value="{DynamicResource Dashboard.StateOnline}"/>
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</TextBlock.Style>
|
|
</TextBlock>
|
|
</Border>
|
|
</Grid>
|
|
|
|
<!-- Pump liveness -->
|
|
<Grid Margin="0,2">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="80"/>
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock Text="{DynamicResource Dashboard.Conn.Pump}" VerticalAlignment="Center" FontSize="12"/>
|
|
<Border Grid.Column="1" MinWidth="72" Height="22">
|
|
<Border.Style>
|
|
<Style TargetType="Border" BasedOn="{StaticResource ConnIndicator}">
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding Root.IsPumpConnected}" Value="True">
|
|
<Setter Property="Background" Value="#26C200"/>
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Border.Style>
|
|
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center"
|
|
FontSize="10" FontWeight="SemiBold" Foreground="White">
|
|
<TextBlock.Style>
|
|
<Style TargetType="TextBlock">
|
|
<Setter Property="Text" Value="{DynamicResource Dashboard.StateOffline}"/>
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding Root.IsPumpConnected}" Value="True">
|
|
<Setter Property="Text" Value="{DynamicResource Dashboard.StateOnline}"/>
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</TextBlock.Style>
|
|
</TextBlock>
|
|
</Border>
|
|
</Grid>
|
|
|
|
<!-- K-Line session -->
|
|
<Grid Margin="0,2">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="80"/>
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock Text="{DynamicResource Dashboard.Conn.KLine}" VerticalAlignment="Center" FontSize="12"/>
|
|
<Border Grid.Column="1" MinWidth="72" Height="22">
|
|
<Border.Style>
|
|
<Style TargetType="Border" BasedOn="{StaticResource ConnIndicator}">
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding Root.KLineState}" Value="{x:Static models:KLineConnectionState.Connected}">
|
|
<Setter Property="Background" Value="#26C200"/>
|
|
</DataTrigger>
|
|
<DataTrigger Binding="{Binding Root.KLineState}" Value="{x:Static models:KLineConnectionState.Failed}">
|
|
<Setter Property="Background" Value="#FF3333"/>
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Border.Style>
|
|
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center"
|
|
FontSize="10" FontWeight="SemiBold" Foreground="White">
|
|
<TextBlock.Style>
|
|
<Style TargetType="TextBlock">
|
|
<Setter Property="Text" Value="{DynamicResource Dashboard.StateClosed}"/>
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding Root.KLineState}" Value="{x:Static models:KLineConnectionState.Connected}">
|
|
<Setter Property="Text" Value="{DynamicResource Dashboard.StateOpen}"/>
|
|
</DataTrigger>
|
|
<DataTrigger Binding="{Binding Root.KLineState}" Value="{x:Static models:KLineConnectionState.Failed}">
|
|
<Setter Property="Text" Value="{DynamicResource Dashboard.StateFailed}"/>
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</TextBlock.Style>
|
|
</TextBlock>
|
|
</Border>
|
|
</Grid>
|
|
</StackPanel>
|
|
</UserControl>
|