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>
61 lines
2.7 KiB
C#
61 lines
2.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
namespace HC_APTBS.Models
|
|
{
|
|
/// <summary>
|
|
/// Immutable snapshot of a completed test session captured at the moment
|
|
/// <see cref="Services.IBenchService.TestFinished"/> fires. Lives only for the
|
|
/// lifetime of the current app session — there is no cross-session storage.
|
|
///
|
|
/// <para>The <see cref="PumpSnapshot"/> is a deep copy of the pump's metadata and
|
|
/// <see cref="TestDefinition"/> list (including per-parameter results) so that
|
|
/// re-running a test on the same pump does not mutate prior history entries.
|
|
/// It can be handed directly to <see cref="Services.IPdfService.GenerateReport"/>
|
|
/// to reproduce the exact PDF for this run.</para>
|
|
/// </summary>
|
|
public sealed class CompletedTestRun
|
|
{
|
|
/// <summary>Unique identifier for the run — used as the key for per-entry delete.</summary>
|
|
public Guid Id { get; init; } = Guid.NewGuid();
|
|
|
|
/// <summary>Wall-clock time the <c>TestFinished</c> event fired.</summary>
|
|
public DateTime CompletedAt { get; init; }
|
|
|
|
/// <summary>Pump model string copied from the source pump at capture time.</summary>
|
|
public string PumpModel { get; init; } = string.Empty;
|
|
|
|
/// <summary>Pump serial number copied from the source pump at capture time.</summary>
|
|
public string PumpSerial { get; init; } = string.Empty;
|
|
|
|
/// <summary>True when every evaluated parameter in every enabled phase passed.</summary>
|
|
public bool OverallPassed { get; init; }
|
|
|
|
/// <summary>True when the run ended via abort / stop instead of normal completion.</summary>
|
|
public bool Interrupted { get; init; }
|
|
|
|
/// <summary>
|
|
/// Deep-cloned pump containing metadata + deep-cloned <see cref="TestDefinition"/>
|
|
/// list with results. Safe to hand directly to <see cref="Services.IPdfService"/>.
|
|
/// </summary>
|
|
public PumpDefinition PumpSnapshot { get; init; } = null!;
|
|
|
|
/// <summary>
|
|
/// Operator observations edited on the Results page. Mutable after capture,
|
|
/// persisted back from the <see cref="ViewModels.Dialogs.ReportViewModel"/>
|
|
/// when the operator exports a PDF.
|
|
/// </summary>
|
|
public string Observations { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Space-separated list of test names in the snapshot (e.g. "WL · UP · PFP"),
|
|
/// shown as a secondary label in the history list.
|
|
/// </summary>
|
|
public string TestNames =>
|
|
PumpSnapshot?.Tests != null && PumpSnapshot.Tests.Count > 0
|
|
? string.Join(" \u00B7 ", PumpSnapshot.Tests.Select(t => t.Name))
|
|
: string.Empty;
|
|
}
|
|
}
|