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.2 KiB
C#
61 lines
2.2 KiB
C#
using System.Collections.Generic;
|
|
|
|
namespace HC_APTBS.Models
|
|
{
|
|
/// <summary>
|
|
/// Describes how a multi-bit status word returned by the pump ECU should be
|
|
/// displayed in the UI. Each <see cref="PumpStatusDefinition"/> maps to one
|
|
/// CAN status parameter and contains a set of bit-field <see cref="StatusBit"/>
|
|
/// definitions.
|
|
/// </summary>
|
|
public class PumpStatusDefinition
|
|
{
|
|
/// <summary>Numeric identifier of this status word.</summary>
|
|
public int Id { get; set; }
|
|
|
|
/// <summary>Display label for the status word group.</summary>
|
|
public string Name { get; set; } = "-";
|
|
|
|
/// <summary>Bit-field definitions within this status word.</summary>
|
|
public List<StatusBit> Bits { get; set; } = new();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Defines the meaning of a single bit (or bit-group) within a pump status word.
|
|
/// </summary>
|
|
public class StatusBit
|
|
{
|
|
/// <summary>Bit position (0-based) within the status word.</summary>
|
|
public int Bit { get; set; }
|
|
|
|
/// <summary>When false, this bit position is ignored in the display.</summary>
|
|
public bool Enabled { get; set; } = true;
|
|
|
|
/// <summary>Possible states and their display colours.</summary>
|
|
public List<StatusBitValue> Values { get; set; } = new();
|
|
}
|
|
|
|
/// <summary>
|
|
/// A single state value for a <see cref="StatusBit"/>: a numeric state code
|
|
/// mapped to a display colour and human-readable description.
|
|
/// </summary>
|
|
public class StatusBitValue
|
|
{
|
|
/// <summary>Numeric state (0 or 1 for single-bit fields).</summary>
|
|
public int State { get; set; }
|
|
|
|
/// <summary>HTML hex colour used to paint the indicator (e.g. "26C200" for green).</summary>
|
|
public string Color { get; set; } = "26C200";
|
|
|
|
/// <summary>Human-readable description of this state.</summary>
|
|
public string Description { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Reaction code applied when the owning status bit enters this state during
|
|
/// a test phase:
|
|
/// 0 = none, 1 = abort (emergency stop), 2 = warning, 3 = log-only.
|
|
/// </summary>
|
|
public int Reaction { get; set; } = 0;
|
|
}
|
|
}
|