Files
HC_APTBS/Views/Pages/BenchPage.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

67 lines
3.5 KiB
XML

<UserControl x:Class="HC_APTBS.Views.Pages.BenchPage"
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:uc="clr-namespace:HC_APTBS.Views.UserControls"
mc:Ignorable="d"
d:DesignHeight="900" d:DesignWidth="1280">
<!--
Bench page — HMI-style manual hardware operation.
DataContext = BenchPageViewModel.
Three zones:
A. Live readings (LCD panel + encoder angles)
B. Live plots (Q flows + pressure traces)
C. Controls (drive, temperature, relay bank)
Interlock banner spans the page above zone contents when triggered.
-->
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
<Grid Margin="6">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/> <!-- interlock banner -->
<RowDefinition Height="*"/> <!-- main content -->
</Grid.RowDefinitions>
<!-- Interlock banner: hidden unless InterlockBannerViewModel raises a condition -->
<uc:InterlockBannerView Grid.Row="0" DataContext="{Binding Interlock}"/>
<!-- Main content: 3 columns -->
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="400"/> <!-- Zone A: readings + angles -->
<ColumnDefinition Width="*"/> <!-- Zone B: live plots -->
<ColumnDefinition Width="210"/> <!-- Zone C: controls -->
</Grid.ColumnDefinitions>
<!-- ── Zone A: readings + encoder angles ──────────────────── -->
<StackPanel Grid.Column="0" Margin="0,0,6,0">
<uc:BenchReadingsView/>
<uc:AngleDisplayView DataContext="{Binding AngleDisplay}"
Margin="0,6,0,0"/>
</StackPanel>
<!-- ── Zone B: live plots (flows + pressure) ──────────────── -->
<StackPanel Grid.Column="1" Margin="0,0,6,0">
<uc:FlowmeterChartView DataContext="{Binding FlowmeterChart.Delivery}"/>
<uc:FlowmeterChartView DataContext="{Binding FlowmeterChart.Over}"
Margin="0,4,0,0"/>
<uc:FlowmeterChartView DataContext="{Binding PressureTrace.P1}"
Margin="0,4,0,0"/>
<uc:FlowmeterChartView DataContext="{Binding PressureTrace.P2}"
Margin="0,4,0,0"/>
</StackPanel>
<!-- ── Zone C: stacked control panels ─────────────────────── -->
<StackPanel Grid.Column="2">
<uc:BenchDriveControlView/>
<uc:TemperatureControlView DataContext="{Binding TempControl}"
Margin="0,10,0,0"/>
<uc:RelayBankView DataContext="{Binding RelayBank}"
Margin="0,10,0,0"/>
</StackPanel>
</Grid>
</Grid>
</ScrollViewer>
</UserControl>