Before this fix, StartUnlockIfRequired was called immediately after
registering the pump's CAN parameters, before any frames had been
decoded. The TestUnlock parameter's zero-initialised Value was
interpreted as "unlocked" for Type 1 pumps, causing Phase 1 to be
skipped and UnlockCompleted(true) to fire falsely.
Changes:
- ICanService: add IsPumpAlive property (volatile-backed in PcanAdapter)
- PcanAdapter: implement IsPumpAlive; mark _pumpAlive/_benchAlive volatile
for safe cross-thread reads
- MainViewModel: replace direct StartUnlockIfRequired call with a
fire-and-forget WaitForPumpCanThenUnlockAsync that waits for
PumpLivenessChanged(true) + 250 ms grace, then invokes unlock on the
UI thread; cancellation on pump change or CAN disconnect via
_pumpLivenessCts
- UnlockService.UnlockAsync: skip Phase 2 state-machine when observer
seed already reports unlocked (senders still run to prevent re-lock)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Replace LCD-style readings with a 3×2 KPI tile grid (Fluent card surfaces, 52pt values)
- Add persistent top connection strip with horizontal chips + pump name badge
- Add elapsed test timer (DispatcherTimer, mm:ss) to Test Summary card
- Restyle Test Summary and Active Alarms with Fluent brushes/iconography
- Add Devices column (CAN / K-Line / Bench tiles) between KPI grid and test/alarms
- Enumerates attached PCAN USB channels via PCAN_ATTACHED_CHANNELS API
- Enumerates FTDI K-Line adapters via existing FtdiInterface helpers
- Click to connect/disconnect; confirmation dialog when session active or test running
- Hover tint: blue = will connect, red = will disconnect; Bench row is read-only stub
- Extend ICanService with SelectedChannel + EnumerateAttachedChannels()
- Expose IKwpService.ConnectedPort for active session device tracking
- Add DeviceRow button style with MultiDataTrigger hover colour logic
- Add 30+ new localization keys (ES + EN) for KPI labels, devices, confirmations
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Restore the full bench control panel from the old source with MVVM architecture:
- Two-column left panel layout: bench info displays (RPM with target/voltage,
temps, pressures, Q-flow, pump live values) and user commands (direction
toggle, start/stop with RPM popup and quick-select buttons, oil pump toggle,
turn downcounter with CAN send)
- PID RPM ramp controller (BenchPidController) with bumpless startup,
anti-windup, and derivative-on-measurement for smooth motor speed transitions
- Real-time flowmeter charts (LiveChartsCore) for Q-Delivery and Q-Over
with tolerance band overlays
- Bench/pump CAN liveness detection in PcanAdapter (receive-only IDs)
- K-Line connection status indicator (placeholder)
- Periodic relay bitmask sender (~21ms) and ElectronicMsg keepalive start
on CAN connect, pump sender starts immediately on pump load
Fix critical CAN message ID bug: default bench XML values were incorrectly
converted from old source (decimal-notation hex parsed as actual hex digits,
e.g. "10" -> "A" instead of keeping "10" which parses as 0x10). Corrected
all IDs to match hardware: 0x10, 0x11, 0x13, 0x14, 0x15, 0x50, 0x51, 0x55.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>