hondavert-dev/lib/core/models/sensor_defs.dart
metatroncubeswdev e9b1c0f8fd Fuel pump flag, confirmed ECT/IAT/BAT offsets, persisted ECU type
Work that was previously only in the local working tree:
- Rename fuelCut -> fuelPump (SW2 bit2, active-low, live-confirmed)
- ECT/IAT/BAT moved to live-confirmed offsets 33/34/36
- S300 template-frame detection with hold-last-good logic
- Persist ECU type in SharedPreferences; drop per-connect protocol dialog
- Official-protocol probe and DTC clear on the debug/DTC screens
- Sanity clamp for multi-byte fields; scrollable vertical dashboard
- docs/HANDOFF.md

Includes temporary [DBG]/[KDBG] prints, removed in the next commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 21:02:05 -04:00

68 lines
2.6 KiB
Dart

import 'sensor_def.dart';
import 'flag_def.dart';
/// Master list of all analog sensor definitions.
const List<SensorDef> sensorDefs = [
SensorDef(id: 'rpm', displayName: 'RPM', unit: 'revs', min: 0, max: 9000),
SensorDef(id: 'vss', displayName: 'Speed', unit: 'km/h', min: 0, max: 280),
SensorDef(
id: 'map',
displayName: 'Manifold pressure',
unit: 'kPa',
min: 0,
max: 300),
SensorDef(
id: 'tps', displayName: 'Throttle pedal', unit: '%', min: 0, max: 100),
SensorDef(
id: 'inj', displayName: 'Injector duration', unit: 'ms', min: 0, max: 20),
SensorDef(
id: 'ign', displayName: 'Timing advance', unit: 'deg', min: -20, max: 60),
SensorDef(
id: 'ect', displayName: 'Coolant temp', unit: '°C', min: -40, max: 150),
SensorDef(
id: 'iat',
displayName: 'Intake air temp',
unit: '°C',
min: -40,
max: 150),
SensorDef(
id: 'bat', displayName: 'Battery voltage', unit: 'V', min: 0, max: 20),
SensorDef(id: 'o2', displayName: 'O2 sensor', unit: 'V', min: 0, max: 1.5),
SensorDef(id: 'gear', displayName: 'Gear', unit: '—', min: 1, max: 6),
SensorDef(id: 'eth', displayName: 'Ethanol', unit: '%', min: 0, max: 100),
SensorDef(
id: 'pa', displayName: 'Baro pressure', unit: 'kPa', min: 0, max: 120),
SensorDef(id: 'afr', displayName: 'AFR', unit: 'λ', min: 0.5, max: 2.0),
SensorDef(
id: 'strim', displayName: 'Short trim', unit: '%', min: -30, max: 30),
SensorDef(
id: 'ltrim', displayName: 'Long trim', unit: '%', min: -30, max: 30),
SensorDef(
id: 'ain0', displayName: 'Analog input 0', unit: 'V', min: 0, max: 5),
SensorDef(
id: 'ain1', displayName: 'Analog input 1', unit: 'V', min: 0, max: 5),
SensorDef(
id: 'ain2', displayName: 'Analog input 2', unit: 'V', min: 0, max: 5),
SensorDef(
id: 'ain3', displayName: 'Analog input 3', unit: 'V', min: 0, max: 5),
SensorDef(
id: 'ain4', displayName: 'Analog input 4', unit: 'V', min: 0, max: 5),
SensorDef(
id: 'ain5', displayName: 'Analog input 5', unit: 'V', min: 0, max: 5),
SensorDef(
id: 'ain6', displayName: 'Analog input 6', unit: 'V', min: 0, max: 5),
SensorDef(
id: 'ain7', displayName: 'Analog input 7', unit: 'V', min: 0, max: 5),
];
/// Master list of boolean flag sensors.
const List<FlagDef> flagDefs = [
FlagDef(id: 'mil', displayName: 'MIL'),
FlagDef(id: 'fuelpump', displayName: 'Fuel Pump'),
FlagDef(id: 'fanout', displayName: 'FAN Out'),
FlagDef(id: 'vtec', displayName: 'VTEC'),
FlagDef(id: 'knock', displayName: 'Knock'),
FlagDef(id: 'revlimit', displayName: 'Rev Limit'),
FlagDef(id: 'launch', displayName: 'Launch'),
];