Files
HC_APTBS/docs/gap-pump-data-migration.md
LucianoDev c617854c09 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>
2026-04-15 15:21:22 +02:00

7.5 KiB

Gap: Pump Data Migration (Old CFG/TXT → New XML)

Overview

The old system had 32 CFG files (Bosch PSG format), 117 test plan TXT files, and reference data files that were processed by HerlicScripts/Program.cs into an encrypted data.herlic pump database. The new system uses pumps.xml (plain XML). This document maps every old data field to its new equivalent and identifies what cannot be migrated.

Source Files

  • old_source/HerlicScripts/CFGs/*.CFG — 32 pump config files
  • old_source/HerlicScripts/TestPlansLargos/*.txt — 117 test plan files
  • old_source/HerlicScripts/AngulosDeBloqueo.txt — Lock angle reference (114 entries)
  • old_source/HerlicScripts/AvanceInyeccion.txt — Injection advance CAN data
  • old_source/HerlicScripts/ListadoBombas.txt — Master pump database (108 pumps)
  • old_source/HerlicScripts/PreDatos.txt / PosDatos.txt — XML header/footer templates
  • old_source/HerlicScripts/Program.cs — Migration tool source

CFG Families

Family CFGs Description KENNUNG
Type 1 T06102, T062xx (21 files) PSG2/5-Opel 0
Type 2 T15xxx, T31804 (7 files) PSG5-PI with pre-injection 2 or 10
Type 3 T18xxx (3 files) PSG5-PI-Ford 6
Type 4 T06301 (1 file) PSG5-FIEONA 1

Field Mapping: CFG → pumps.xml

Fully Migrated (present in new PumpDefinition model)

CFG Field New Model Property Notes
ID-SEND1 ParametersByName[me/FBKW/mepi].MessageId TX message ID
ID-EMPF1 ParametersByName[Status].MessageId RX status ID
ID-EMPF2 ParametersByName[RPM/Temp].MessageId RX diagnostics ID
ID-EMPF3 ParametersByName[Empf3].MessageId RX self-test ID
CAN-MESOLL P1-P6 CanBusParameter.P1-P6 Fuel quantity formula
CAN-FB-KW P1-P6 CanBusParameter.P1-P6 FBKW injection angle
CAN-KW-N P1-P6 CanBusParameter.P1-P6 RPM formula
CAN-THYBR P1-P6 CanBusParameter.P1-P6 Temperature formula
CAN-BAUDRATE PumpDefinition.CanBaudrate 500 or 250 kBaud
Lock angles PumpDefinition.LockAngle From AngulosDeBloqueo.txt
Rotation direction PumpDefinition.Rotation left/right
Pre-injection flag PumpDefinition.HasPreInjection Type 2/3 pumps
Unlock type PumpDefinition.UnlockType 0/1/2
Test plans PumpDefinition.Tests From test plan TXT files

Partially Migrated (structure exists but data incomplete)

CFG Field New Model Gap
CAN-STATUS* bit definitions PumpStatusDefinition in status.xml Only display info (bit, state, color, description) migrated. Missing: reaction codes (0=none, 1=abort, 2=warning, 3=log), special function codes, special parameters
CAN-PSGTEST* self-test bits PumpStatusDefinition Same gap as above — no reaction/function codes
CAN-MESOLL-PI / CAN-PHIAD-PI CanBusParameter for mepi Formula exists but only if pump HasPreInjection

NOT Migrated (no equivalent in new model)

CFG Field Purpose Impact
PAS-EPROM-LES EPROM read password (4 bytes + scope) KWP passwords now handled in KwpService code, not per-pump config. Currently only 3 hardcoded password versions (V1/V2/V3-V4). If a pump needs a different password, it can't be configured.
PAS-EEPROM-LES/SCHREIB EEPROM read/write passwords Same as above
PAS-RAM-SCHREIB RAM write password Same
CAN-PASSWORT-EWS EWS immobilizer password Always 0xFFFF in all CFGs (unused in practice)
BIP-STATUS* Needle-motion detection (8 definitions with HEX pattern matching) Entirely absent. Pre-injection pumps use BIP to verify injection timing.
EMPFINDLICHKEIT Flow regulator sensitivity (dAD, measurement time, tolerance, max sensitivity, regulator current) Not stored per-pump. Bench-level config only.
EMPFINDLICHKEIT-2 Flow regulator part 2 (dFM-Empf, Fehl-zul, Messzeit) Same
ADR-MV-SCHALTZEIT Solenoid valve switching time RAM address Diagnostic addresses not per-pump
ADR-F_TK_TE_W Temperature compensation switch address Same
ADR-TK_AT_W Dynamic temp compensation switch Same
ADR-SV-SOLL / ADR-SV-IST SV actuator target/actual addresses Same
ADR-TO_MV_600_HE MV pre-control value address Same
ADR-MV-T-ABGLEICH* MV time adjustment addresses Same
ADR-S_BIP_HW_UW BIP status address Same
ADR-ID-EMPF2-SENDEN EMPF2 auto-send control address Same
ADR-REL-CAN-SRC CAN source relative address Same
ADR-LERN-VERF Learning procedure switch Same
ADR-RESET PSG auto-reset address Same
BASISADR EEPROM base address table Same
CAN-BUS-KENNUNG Protocol variant code (0/1/2/6/10) Derived implicitly from CAN IDs and UnlockType
PHI-LUECKE-SYNCH Sync pulse angle offset Not stored
ATS-SERVICE Ford service CAN ID Not stored separately
KW_SIM_UMSCHALTUNG SV control/regulation switching debounce Not stored
MSG-KONFIGURATION Message config byte Not stored
WTSS formulas (N-NW, MESOLL, PHIAD, FB-NW, FB-KW, PHI1, FB-MASS, THYBR-OFFSET) Secondary scaling for WTSS transfer Not stored

Status Bit Reaction Codes — Impact Assessment

The old CFGs defined per-bit reaction behavior:

  • Reaction 0: No action (display only)
  • Reaction 1: Abort test immediately
  • Reaction 2: Show warning, continue
  • Reaction 3: Log only

The new PumpStatusDefinition stores only display info (description + color). There is no mechanism to:

  • Abort a test when a specific status bit asserts
  • Show a warning for specific bits during test execution
  • Differentiate between critical and informational bits per pump model

Recommendation: Add a Reaction property (int, 0-3) to StatusBitValue in PumpStatusDefinition.cs. Wire it into BenchService test execution to check active status bits against their reaction codes per phase.

BIP-STATUS — Impact Assessment

BIP (Brennraumindikator-Prüfung / combustion indicator test) is a per-cylinder needle-motion detection system used on pre-injection VP44 pumps. The old system defined 6-7 BIP status conditions with HEX pattern matching (e.g., "BIP detected OK", "No BIP in capture window", "BIP deviation too large").

Impact: Without BIP status monitoring, pre-injection pump testing lacks validation that the injection nozzle is actually opening correctly. This is a diagnostic gap for Type 2 (T15xxx) and Type 3 (T18xxx) pumps.

Recommendation: Add a BipStatusDefinition model class and integrate BIP pattern matching into the test execution flow for pre-injection pumps.

Test Plan TXT Format

Each test plan file follows this structure:

[TestName] [TestType] [nPhases] [ConditioningTime] [MeasurementTime] [MeasurementsPerSec]
[PhaseName] [RPM] [me] [FBKW] [ME_PI] [T-In] [QOver] [Tolerance_me] [Tolerance_FBKW] ...

108 pump IDs have corresponding test plan files. These should already be in pumps.xml if the old Program.cs migration was run. Verify coverage by comparing pump IDs in pumps.xml against ListadoBombas.txt.

Migration Tool Approach

If re-migration is needed:

  1. Port the parsing logic from old_source/HerlicScripts/Program.cs into a standalone console app
  2. Read each CFG file using the pipe-delimited parser (GetParamCFG)
  3. Read test plans from TXT files
  4. Read lock angles from AngulosDeBloqueo.txt
  5. Generate pumps.xml and status.xml in the new schema
  6. Run once, commit the generated files, do not ship the migration tool