diff --git a/apps/recorder/ChangeLog b/apps/recorder/ChangeLog index 33986f219..6a17dc603 100644 --- a/apps/recorder/ChangeLog +++ b/apps/recorder/ChangeLog @@ -55,4 +55,6 @@ 0.43: Fix interaction on clocks without widgets 0.44: List tracks in reverse chronological order. 0.45: Move recorder from widget into library - Improve recorder ClockInfo icons \ No newline at end of file + 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) \ No newline at end of file diff --git a/apps/recorder/app.js b/apps/recorder/app.js index 6d672cd85..795eb905f 100644 --- a/apps/recorder/app.js +++ b/apps/recorder/app.js @@ -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; diff --git a/apps/recorder/lib.js b/apps/recorder/lib.js index 9f477e9ec..01838fe38 100644 --- a/apps/recorder/lib.js +++ b/apps/recorder/lib.js @@ -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", diff --git a/apps/recorder/metadata.json b/apps/recorder/metadata.json index 5a7ded5d4..364fb4f54 100644 --- a/apps/recorder/metadata.json +++ b/apps/recorder/metadata.json @@ -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",