Files
HC_APTBS/ViewModels/PressureTraceChartViewModel.cs
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

39 lines
1.2 KiB
C#

using SkiaSharp;
namespace HC_APTBS.ViewModels
{
/// <summary>
/// Container ViewModel holding two real-time pressure traces:
/// one for P1 (bench oil pressure) and one for P2 (analogue sensor 2).
/// Reuses <see cref="SingleFlowChartViewModel"/> — the chart primitive is
/// identical, only the series colours and titles differ.
/// </summary>
public sealed class PressureTraceChartViewModel
{
/// <summary>Chart for P1 (red line).</summary>
public SingleFlowChartViewModel P1 { get; }
= new("P1 (bar)", new SKColor(0xD6, 0x28, 0x28));
/// <summary>Chart for P2 (cyan line).</summary>
public SingleFlowChartViewModel P2 { get; }
= new("P2 (bar)", new SKColor(0x00, 0xB4, 0xD8));
/// <summary>
/// Appends a sample pair to both traces.
/// Must be called on the UI thread.
/// </summary>
public void AddSamples(double p1, double p2)
{
P1.AddValue(p1);
P2.AddValue(p2);
}
/// <summary>Clears both traces.</summary>
public void Clear()
{
P1.Clear();
P2.Clear();
}
}
}