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

67 lines
2.0 KiB
Dart

import 'package:flutter/material.dart';
import '../../../../core/protocol/sensor_state.dart';
class FlagPill extends StatelessWidget {
final String label;
final bool active;
final Color color;
const FlagPill({
super.key,
required this.label,
required this.active,
required this.color,
});
@override
Widget build(BuildContext context) {
return AnimatedContainer(
duration: const Duration(milliseconds: 100),
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
decoration: BoxDecoration(
color: active ? color.withAlpha(40) : const Color(0xFF1A1A1A),
borderRadius: BorderRadius.circular(20),
border: Border.all(
color: active ? color : Colors.white12,
width: 1.5,
),
),
child: Text(
label,
style: TextStyle(
color: active ? color : Colors.grey,
fontSize: 11,
fontWeight: active ? FontWeight.bold : FontWeight.normal,
letterSpacing: 1,
),
),
);
}
}
/// Row of all flag pills derived from a SensorState.
class FlagRow extends StatelessWidget {
final SensorState state;
final Color accentColor;
const FlagRow({super.key, required this.state, required this.accentColor});
@override
Widget build(BuildContext context) {
return Wrap(
spacing: 6,
runSpacing: 6,
alignment: WrapAlignment.center,
children: [
FlagPill(label: 'MIL', active: state.mil, color: Colors.amber),
FlagPill(label: 'VTEC', active: state.vtec, color: Colors.blue),
FlagPill(label: 'KNOCK', active: state.knock, color: Colors.red),
FlagPill(label: 'FUEL PUMP', active: state.fuelPump, color: Colors.cyan),
FlagPill(label: 'REV LIM', active: state.revLimit, color: Colors.orange),
FlagPill(label: 'FAN', active: state.fanOut, color: Colors.green),
FlagPill(label: 'LAUNCH', active: state.launch, color: Colors.purple),
],
);
}
}