recorder 0.46: Ensure altitude graph draws properly (or any graph using the last column of CSV data)

Lower accuracy of barometer data to ~1cm (saves about 15b/record)
master
Gordon Williams 2025-06-19 10:47:01 +01:00
parent 14fca983fc
commit eb594038ba
4 changed files with 12 additions and 10 deletions

View File

@ -56,3 +56,5 @@
0.44: List tracks in reverse chronological order.
0.45: Move recorder from widget into library
Improve recorder ClockInfo icons
0.46: Ensure altitude graph draws properly (or any graph using the last column of CSV data)
Lower accuracy of barometer data to ~1cm (saves about 15b/record)

View File

@ -333,14 +333,14 @@ function plotGraph(info, style) { "ram"
var factor = 1; // multiplier used for values when graphing
var timeIdx = info.fields.indexOf("Time");
if (l!==undefined) {
c = l.split(",");
c = l.trim().split(",");
strt = c[timeIdx];
}
if (style=="Heartrate") {
title = /*LANG*/"Heartrate (bpm)";
var hrmIdx = info.fields.indexOf("Heartrate");
while(l!==undefined) {
c=l.split(",");l = f.readLine(f);
c=l.trim().split(",");l = f.readLine(f);
if (c[hrmIdx]=="") continue;
i = Math.round(80*(c[timeIdx] - strt)/dur);
infn[i]+=+c[hrmIdx];
@ -351,7 +351,7 @@ function plotGraph(info, style) { "ram"
var altIdx = info.fields.indexOf("Barometer Altitude");
if (altIdx<0) altIdx = info.fields.indexOf("Altitude");
while(l!==undefined) {
c=l.split(",");l = f.readLine(f);
c=l.trim().split(",");l = f.readLine(f);
if (c[altIdx]=="") continue;
i = Math.round(80*(c[timeIdx] - strt)/dur);
infn[i]+=+c[altIdx];
@ -368,14 +368,14 @@ function plotGraph(info, style) { "ram"
var lonIdx = info.fields.indexOf("Longitude");
// skip until we find our first data
while(l!==undefined && c[latIdx]=="") {
c = l.split(",");
c = l.trim().split(",");
l = f.readLine(f);
}
// now iterate
var p,lp = Bangle.project({lat:c[1],lon:c[2]});
var t,dx,dy,d,lt = c[timeIdx];
while(l!==undefined) {
c=l.split(",");
c=l.trim().split(",");
l = f.readLine(f);
if (c[latIdx] == "") {
continue;

View File

@ -120,9 +120,9 @@ exports.getRecorders = function() {
recorders['baro'] = function() {
var temp="",press="",alt="";
function onPress(c) {
temp=c.temperature;
press=c.pressure;
alt=c.altitude;
temp=c.temperature.toFixed(1);
press=c.pressure.toFixed(2);
alt=c.altitude.toFixed(2);
}
return {
name : "Baro",

View File

@ -2,7 +2,7 @@
"id": "recorder",
"name": "Recorder",
"shortName": "Recorder",
"version": "0.45",
"version": "0.46",
"description": "Record GPS position, heart rate and more in the background, then download to your PC.",
"icon": "app.png",
"tags": "tool,outdoors,gps,widget,clkinfo",