feat: redesign bench calibration (factor/offset), add Ttank/P2 displays, fix sensor calibration

- Replace P1-P6 rational transfer function with factor/offset model for bench params
- Add explicit rx/tx direction flags in bench XML configuration
- Add T.Tank (BenchTemp) and P2 (AnalogSensor2) to temperature/pressure display
- Apply SensorConfiguration calibration to pressure channels, fix empty sensors.xml fallback
- Add live value labels to flowmeter charts
- Hide pump live values and PSG encoder standalone label
- Add K-Line connection state model, improve KWP service and status displays
- Restructure .claude/skills into subdirectory format

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-14 21:25:30 +02:00
parent 4964806de1
commit 4891eb6812
20 changed files with 881 additions and 185 deletions

View File

@@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using HC_APTBS.Models;
namespace HC_APTBS.Services
{
@@ -11,6 +12,31 @@ namespace HC_APTBS.Services
/// </summary>
public interface IKwpService
{
// ── Session lifecycle ─────────────────────────────────────────────────────
/// <summary>Current state of the persistent K-Line session.</summary>
KLineConnectionState KLineState { get; }
/// <summary>
/// Raised whenever the K-Line session state transitions.
/// Fires on a background thread; consumers must marshal to the UI thread.
/// </summary>
event Action<KLineConnectionState>? KLineStateChanged;
/// <summary>
/// Opens a persistent K-Line session: performs 5-baud slow-init,
/// reads ECU info, then starts a background keep-alive loop (~1 s interval).
/// </summary>
/// <param name="port">FTDI serial number or COM port identifier.</param>
/// <param name="ct">Cancellation token.</param>
Task ConnectAsync(string port, CancellationToken ct = default);
/// <summary>
/// Stops the keep-alive loop, sends EndCommunication to the ECU,
/// and disposes the FTDI interface.
/// </summary>
void Disconnect();
// ── Progress reporting ────────────────────────────────────────────────────
/// <summary>
@@ -84,6 +110,22 @@ namespace HC_APTBS.Services
/// </summary>
string? DetectKLinePort();
// ── Mid-read notifications ────────────────────────────────────────────
/// <summary>
/// Raised during <see cref="ReadAllInfoAsync"/> as soon as the pump identifier
/// string has been read from ROM, before the full read completes.
/// Fires on a background thread; consumers must marshal to the UI thread.
/// </summary>
event Action<string>? PumpIdentified;
/// <summary>
/// Raised during <see cref="ReadAllInfoAsync"/> when the DFI calibration
/// value has been read from EEPROM. Parameter is the DFI angle in degrees.
/// Fires on a background thread; consumers must marshal to the UI thread.
/// </summary>
event Action<double>? DfiRead;
// ── Power cycle callbacks ─────────────────────────────────────────────────
/// <summary>