feat: implement SavePump/SaveAlarms, fix config round-trip bugs, redesign PDF reports

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>
This commit is contained in:
2026-04-15 15:21:22 +02:00
parent 4891eb6812
commit c617854c09
15 changed files with 1495 additions and 141 deletions

View File

@@ -225,6 +225,40 @@ namespace HC_APTBS.Models
return double.Parse(value.Replace(',', '.'), CultureInfo.InvariantCulture);
}
/// <summary>
/// Serialises this parameter to an XML element using the pump-param format
/// (<c>busid</c>, <c>p1p6</c>, <c>send</c>, <c>disableparams</c>).
/// Used when persisting pump definitions to <c>pumps.xml</c>.
/// </summary>
public XElement ToPumpXml()
{
var elm = new XElement(Name,
new XAttribute("busid", MessageId.ToString("X")),
new XAttribute("byteh", ByteH),
new XAttribute("bytel", ByteL),
new XAttribute("type", Type));
if (!IsReceive)
elm.Add(new XAttribute("send", "true"));
if (Alpha != 1.0)
elm.Add(new XAttribute("filter", Alpha.ToString(CultureInfo.InvariantCulture)));
if (DisableCalibration)
{
elm.Add(new XAttribute("disableparams", "true"));
}
else
{
elm.Add(new XAttribute("p1", P1.ToString(CultureInfo.InvariantCulture)));
elm.Add(new XAttribute("p2", P2.ToString(CultureInfo.InvariantCulture)));
elm.Add(new XAttribute("p3", P3.ToString(CultureInfo.InvariantCulture)));
elm.Add(new XAttribute("p4", P4.ToString(CultureInfo.InvariantCulture)));
elm.Add(new XAttribute("p5", P5.ToString(CultureInfo.InvariantCulture)));
elm.Add(new XAttribute("p6", P6.ToString(CultureInfo.InvariantCulture)));
}
return elm;
}
/// <summary>Serialises this parameter to an XML element for persistence in bench.xml.</summary>
public XElement ToXml()
{