feat: simulated odometer in trip replay + trip list (continuous across trips)

- Pi route_points: emit per-point odometer (raw OBD value or baseline+prior+within-trip distance)
- Pi get_trip_route: SELECT ODOMETER, compute prior-trips distance + baseline
- Pi list_trips: fallback now starts from baseline (was 0)
- Server get_trip_route: per-point odometer (raw or simulated) with haversine accumulation
- Server list_trips: odo_start/end from baseline + cumulative (was hardcoded None)
- history.js: Odometer line in replay scrubber below speed
- Both history templates: trip-replay-odometer element
This commit is contained in:
Mathieu Moran
2026-08-12 16:59:00 -04:00
parent cfd9d03e81
commit 0d5aea5947
6 changed files with 114 additions and 29 deletions
+6
View File
@@ -128,6 +128,12 @@
st.marker.setLatLng([p.latitude, p.longitude]);
scrubber.value = i; replayTime.textContent = fT(p.datetime);
replaySpeed.textContent = (p.speed_source === "obd" ? "OBD" : "GPS") + ": " + fS(p.speed);
var odoEl = document.getElementById("trip-replay-odometer");
if (odoEl) {
odoEl.textContent = (p.odometer != null)
? "Odometer: " + p.odometer.toFixed(0).replace(/\B(?=(\d{3})+(?!\d))/g, " ") + " km"
: "";
}
schedLoc(p.latitude, p.longitude);
}
function initTL(pts) {