Config system fixes: - Implement SavePump() — full XML serialization with insert/update by pump ID - Add CanBusParameter.ToPumpXml() for legacy P1-P6 pump param format - Fix LastRotationDirection never loaded in LoadSettings() - Add SaveAlarms() to ConfigurationService and IConfigurationService - Remove dead fields AppSettings.Clients and AppSettings.PumpIds PDF report redesign: - Professional layout with charts, verdict badges, and tolerance bands - Add ReportChartRenderer (SVG) and ReportTheme styling constants - Embed default_logo.png as fallback report logo Documentation: - Add gap analysis docs (config validation, ford unlock, missing features) - Update CLAUDE.md architecture, known gaps, and debt tracking Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
107 lines
4.3 KiB
C#
107 lines
4.3 KiB
C#
using SkiaSharp;
|
|
|
|
namespace HC_APTBS.Services.Impl
|
|
{
|
|
/// <summary>
|
|
/// Centralised visual constants for the PDF test report.
|
|
/// All colours, font sizes, spacing, and chart dimensions live here
|
|
/// so the report look-and-feel can be adjusted in one place.
|
|
/// </summary>
|
|
internal static class ReportTheme
|
|
{
|
|
// ── Colour palette (hex strings for QuestPDF, SKColor for charts) ─────
|
|
|
|
/// <summary>Dark navy for section header bars.</summary>
|
|
public const string HeaderNavy = "#1B2A4A";
|
|
|
|
/// <summary>Secondary grey for sub-headers and muted text.</summary>
|
|
public const string HeaderGrey = "#4A4A4A";
|
|
|
|
/// <summary>Accent blue for highlights.</summary>
|
|
public const string AccentBlue = "#2E5090";
|
|
|
|
/// <summary>Pass result — dark green text.</summary>
|
|
public const string PassGreen = "#2E7D32";
|
|
|
|
/// <summary>Pass result — light green background.</summary>
|
|
public const string PassGreenLight = "#E8F5E9";
|
|
|
|
/// <summary>Fail result — dark red text.</summary>
|
|
public const string FailRed = "#C62828";
|
|
|
|
/// <summary>Fail result — light red background.</summary>
|
|
public const string FailRedLight = "#FFEBEE";
|
|
|
|
/// <summary>Alternating table row stripe.</summary>
|
|
public const string TableAltRow = "#F5F7FA";
|
|
|
|
/// <summary>Thin divider lines.</summary>
|
|
public const string DividerLine = "#BDBDBD";
|
|
|
|
/// <summary>Error/warning row background.</summary>
|
|
public const string WarningBg = "#FFF3E0";
|
|
|
|
/// <summary>Error/warning text.</summary>
|
|
public const string WarningText = "#E65100";
|
|
|
|
// ── Chart-specific SKColors ───────────────────────────────────────────
|
|
|
|
/// <summary>Semi-transparent blue tolerance band.</summary>
|
|
public static readonly SKColor ToleranceBand = new(46, 80, 144, 50);
|
|
|
|
/// <summary>Amber dashed target line.</summary>
|
|
public static readonly SKColor TargetLine = new(255, 111, 0);
|
|
|
|
/// <summary>Blue data polyline.</summary>
|
|
public static readonly SKColor SampleLine = new(21, 101, 192);
|
|
|
|
/// <summary>Light grey chart gridlines and border.</summary>
|
|
public static readonly SKColor ChartGrid = new(224, 224, 224);
|
|
|
|
/// <summary>Chart background.</summary>
|
|
public static readonly SKColor ChartBackground = SKColors.White;
|
|
|
|
/// <summary>Green average line (pass).</summary>
|
|
public static readonly SKColor AvgPassLine = new(46, 125, 50);
|
|
|
|
/// <summary>Red average line (fail).</summary>
|
|
public static readonly SKColor AvgFailLine = new(198, 40, 40);
|
|
|
|
/// <summary>Chart axis label colour.</summary>
|
|
public static readonly SKColor AxisLabel = new(97, 97, 97);
|
|
|
|
// ── Font sizes (points) ───────────────────────────────────────────────
|
|
|
|
/// <summary>Report title.</summary>
|
|
public const float TitleSize = 16f;
|
|
|
|
/// <summary>Section header text (e.g. "PUMP IDENTIFICATION").</summary>
|
|
public const float SectionHeaderSize = 11f;
|
|
|
|
/// <summary>Body / table cell text.</summary>
|
|
public const float BodySize = 9f;
|
|
|
|
/// <summary>Small captions and chart labels.</summary>
|
|
public const float CaptionSize = 7f;
|
|
|
|
/// <summary>Footer text.</summary>
|
|
public const float FooterSize = 7f;
|
|
|
|
// ── Spacing (points) ─────────────────────────────────────────────────
|
|
|
|
/// <summary>Gap between major sections.</summary>
|
|
public const float SectionGap = 10f;
|
|
|
|
/// <summary>Gap between sub-sections (e.g. chart caption).</summary>
|
|
public const float SubsectionGap = 6f;
|
|
|
|
/// <summary>Table cell padding.</summary>
|
|
public const float CellPad = 3f;
|
|
|
|
// ── Chart dimensions (points) ─────────────────────────────────────────
|
|
|
|
/// <summary>Chart render height inside the PDF.</summary>
|
|
public const float ChartHeight = 160f;
|
|
}
|
|
}
|