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>
114 lines
5.7 KiB
XML
114 lines
5.7 KiB
XML
<UserControl x:Class="HC_APTBS.Views.UserControls.UnlockPanelView"
|
|
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="380" d:DesignWidth="700">
|
|
<!--
|
|
Pump page §3.e Unlock inline view. DataContext = UnlockProgressViewModel
|
|
(exposed from MainViewModel.CurrentUnlockVm). Hidden by the parent when
|
|
the selected pump does not require unlock or the VM is null.
|
|
-->
|
|
<UserControl.Resources>
|
|
<BooleanToVisibilityConverter x:Key="BoolToVis"/>
|
|
</UserControl.Resources>
|
|
|
|
<Border Background="#2B2929" BorderBrush="#111" BorderThickness="1"
|
|
CornerRadius="4" Padding="18" Margin="6">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/> <!-- title -->
|
|
<RowDefinition Height="Auto"/> <!-- type label -->
|
|
<RowDefinition Height="210"/> <!-- ring -->
|
|
<RowDefinition Height="Auto"/> <!-- phase text -->
|
|
<RowDefinition Height="Auto"/> <!-- progress bar -->
|
|
<RowDefinition Height="Auto"/> <!-- result -->
|
|
<RowDefinition Height="Auto"/> <!-- buttons -->
|
|
</Grid.RowDefinitions>
|
|
|
|
<TextBlock Grid.Row="0"
|
|
Text="{DynamicResource PumpSub.Unlock}"
|
|
FontSize="15" FontWeight="SemiBold" Foreground="#EEE"
|
|
HorizontalAlignment="Center" Margin="0,0,0,4"/>
|
|
|
|
<TextBlock Grid.Row="1"
|
|
Text="{Binding UnlockTypeLabel, Mode=OneWay}"
|
|
FontSize="13" Foreground="#AAA"
|
|
HorizontalAlignment="Center" Margin="0,0,0,6"/>
|
|
|
|
<!-- Progress ring -->
|
|
<Grid Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Center">
|
|
<Ellipse Width="200" Height="200"
|
|
Stroke="#4D4D4D" StrokeThickness="10"
|
|
Fill="Transparent"/>
|
|
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
|
<TextBlock Text="{DynamicResource Dialog.Unlock.Progress}"
|
|
FontSize="12" Foreground="#888"
|
|
HorizontalAlignment="Center" Margin="0,0,0,4"/>
|
|
<TextBlock FontSize="60" FontFamily="Courier New"
|
|
Foreground="White" HorizontalAlignment="Center">
|
|
<TextBlock.Text>
|
|
<Binding Path="Progress" Mode="OneWay"
|
|
StringFormat="{}{0}%"/>
|
|
</TextBlock.Text>
|
|
</TextBlock>
|
|
<TextBlock Text="{Binding ElapsedTime, Mode=OneWay}"
|
|
FontSize="16" FontFamily="Courier New"
|
|
Foreground="#CCC" HorizontalAlignment="Center"
|
|
Margin="0,2,0,0"/>
|
|
</StackPanel>
|
|
</Grid>
|
|
|
|
<TextBlock Grid.Row="3"
|
|
Text="{Binding PhaseText, Mode=OneWay}"
|
|
FontSize="16" Foreground="White"
|
|
HorizontalAlignment="Center" Margin="0,6"/>
|
|
|
|
<ProgressBar Grid.Row="4"
|
|
Value="{Binding Progress, Mode=OneWay}"
|
|
Minimum="0" Maximum="100"
|
|
Height="12" Margin="12,0"
|
|
Foreground="#00EC00" Background="#3D3D3D"/>
|
|
|
|
<TextBlock Grid.Row="5"
|
|
Text="{Binding ResultText, Mode=OneWay}"
|
|
FontSize="22" FontWeight="Bold"
|
|
HorizontalAlignment="Center" Margin="0,10,0,0"
|
|
Visibility="{Binding IsComplete, Converter={StaticResource BoolToVis}}">
|
|
<TextBlock.Style>
|
|
<Style TargetType="TextBlock">
|
|
<Setter Property="Foreground" Value="#FF5858"/>
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding IsSuccess}" Value="True">
|
|
<Setter Property="Foreground" Value="#00EC00"/>
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</TextBlock.Style>
|
|
</TextBlock>
|
|
|
|
<!-- Only the cancel button is exposed inline; the panel cannot be "closed" here -->
|
|
<StackPanel Grid.Row="6" Orientation="Horizontal"
|
|
HorizontalAlignment="Center" Margin="0,14,0,0">
|
|
<Button Content="{DynamicResource Common.Cancel}"
|
|
Command="{Binding CancelCommand}"
|
|
Width="110" Height="30"
|
|
Foreground="White" FontWeight="Bold">
|
|
<Button.Style>
|
|
<Style TargetType="Button">
|
|
<Setter Property="Background" Value="#FF5858"/>
|
|
<Style.Triggers>
|
|
<Trigger Property="IsEnabled" Value="False">
|
|
<Setter Property="Background" Value="#4D4D4D"/>
|
|
<Setter Property="Foreground" Value="#888"/>
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Button.Style>
|
|
</Button>
|
|
</StackPanel>
|
|
</Grid>
|
|
</Border>
|
|
</UserControl>
|