feat: developer tools page, auto-test orchestrator, BIP display, tests redesign
Bundles several feature streams that have been iterating on the working tree: - Developer Tools page (Debug-only via DEVELOPER_TOOLS symbol): hosts the identification card, manual KWP write + transaction log, ROM/EEPROM dump card with progress banner and completion message, persisted custom-commands library, persisted EEPROM passwords library. New service primitives: IKwpService.SendRawCustomAsync / ReadEepromAsync / ReadRomEepromAsync. Persistence mirrors the Clients XML pattern in two new files (custom_commands.xml, eeprom_passwords.xml). - Auto-test orchestrator (IAutoTestOrchestrator + AutoTestState): linear K-Line read -> unlock -> bench-on -> test sequence with snackbar UI and progress dialog VM, gated on dashboard alarms. - BIP-STATUS display: BipDisplayViewModel + BipDisplayView, RAM read at 0x0106 via IKwpService.ReadBipStatusAsync; status definitions in BipStatusDefinition. - Tests page redesign: TestSectionCard + PhaseTileView replacing the old TestPlanView/TestRunningView/TestDoneView/TestPreconditionsView/ TestSectionView controls and their VMs. - Pump command sliders: Fluent thick-track style with overhang thumb, click-anywhere-and-drag, mouse-wheel adjustment. - Window startup: app.manifest declares PerMonitorV2 DPI awareness, MainWindow installs a WM_GETMINMAXINFO hook in OnSourceInitialized and maximizes there (after the hook is in place) so the app fits the work area exactly on any display configuration. - Misc: PercentToPixelsConverter, seed_aliases.py one-shot pump-alias importer, tools/Import-BipStatus.ps1, kline_eeprom_spec.md and dump-functions reference docs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -136,11 +136,66 @@ namespace HC_APTBS.Services
|
||||
|
||||
/// <summary>
|
||||
/// Attempts a fast immobilizer unlock by sending a KWP custom command
|
||||
/// over an existing K-Line session. Returns <see langword="true"/> if the
|
||||
/// command was acknowledged (pump already unlocked), <see langword="false"/>
|
||||
/// if it was rejected or no session is active.
|
||||
/// over an existing K-Line session. The RAM address byte written by the
|
||||
/// command is selected by <paramref name="unlockType"/>: <c>1</c> → <c>0xA8</c>,
|
||||
/// <c>2</c> → <c>0xE8</c>. Any other value is rejected and returns
|
||||
/// <see langword="false"/>.
|
||||
/// </summary>
|
||||
Task<bool> TryFastUnlockAsync();
|
||||
/// <param name="unlockType">Pump unlock variant (1 or 2).</param>
|
||||
/// <returns>
|
||||
/// <see langword="true"/> when the command was acknowledged,
|
||||
/// <see langword="false"/> on NAK, no active session, or unsupported type.
|
||||
/// </returns>
|
||||
Task<bool> TryFastUnlockAsync(int unlockType);
|
||||
|
||||
// ── Raw custom KWP packet (developer use) ─────────────────────────────────
|
||||
|
||||
/// <summary>
|
||||
/// Sends a raw KWP1281 custom packet over the persistent K-Line session and
|
||||
/// returns the bytes of every response packet. The supplied <paramref name="payload"/>
|
||||
/// is the title byte plus body — framing (length + counter + end byte) is added
|
||||
/// by the lower-level transport.
|
||||
///
|
||||
/// <para>Returns an empty list when no session is active or the send fails.
|
||||
/// Used by the Developer Tools page; never called from production paths.</para>
|
||||
/// </summary>
|
||||
/// <param name="payload">Packet bytes excluding length/counter/end framing.</param>
|
||||
/// <param name="ct">Cancellation token.</param>
|
||||
/// <returns>Each response packet's full byte sequence (length…end inclusive).</returns>
|
||||
Task<IReadOnlyList<byte[]>> SendRawCustomAsync(byte[] payload, CancellationToken ct = default);
|
||||
|
||||
/// <summary>
|
||||
/// Reads <paramref name="count"/> bytes from EEPROM starting at <paramref name="address"/>
|
||||
/// over the persistent K-Line session (KWP <c>ReadEeprom</c> command 0x19).
|
||||
/// Returns an empty list when no session is active or the ECU returns NAK.
|
||||
/// Used by the Developer Tools page's dumper; max 13 bytes per call.
|
||||
/// </summary>
|
||||
Task<IReadOnlyList<byte>> ReadEepromAsync(ushort address, byte count, CancellationToken ct = default);
|
||||
|
||||
/// <summary>
|
||||
/// Reads <paramref name="count"/> bytes from ROM/EEPROM starting at <paramref name="address"/>
|
||||
/// over the persistent K-Line session (KWP <c>ReadRomEeprom</c> command 0x03).
|
||||
/// Valid range 0x0000–0x9FFF. Returns an empty list when no session is active or
|
||||
/// the ECU returns NAK. Used by the Developer Tools page's dumper; max 13 bytes per call.
|
||||
/// </summary>
|
||||
Task<IReadOnlyList<byte>> ReadRomEepromAsync(ushort address, byte count, CancellationToken ct = default);
|
||||
|
||||
// ── BIP status ────────────────────────────────────────────────────────────
|
||||
|
||||
/// <summary>
|
||||
/// Reads the 16-bit BIP status word from ECU RAM address <c>0x0106</c>
|
||||
/// (<c>ADR-S_BIP_HW_UW</c>) over the persistent K-Line session.
|
||||
/// Returns <see langword="null"/> when no session is active or if the read fails.
|
||||
/// </summary>
|
||||
/// <param name="ct">Cancellation token.</param>
|
||||
Task<ushort?> ReadBipStatusAsync(CancellationToken ct = default);
|
||||
|
||||
/// <summary>
|
||||
/// Raised after a successful <see cref="ReadBipStatusAsync"/> call with the
|
||||
/// raw 16-bit BIP status word. Fires on a background thread;
|
||||
/// consumers must marshal to the UI thread.
|
||||
/// </summary>
|
||||
event Action<ushort>? BipStatusRead;
|
||||
|
||||
// ── Power cycle callbacks ─────────────────────────────────────────────────
|
||||
|
||||
|
||||
Reference in New Issue
Block a user