gpsrec 0.17: Disable recording if storage is full (fix #574)

master
Gordon Williams 2021-02-02 10:10:18 +00:00
parent 83b88e0d80
commit 15be69ba0b
3 changed files with 17 additions and 7 deletions

View File

@ -363,7 +363,7 @@
{ "id": "gpsrec",
"name": "GPS Recorder",
"icon": "app.png",
"version":"0.16",
"version":"0.17",
"interface": "interface.html",
"description": "Application that allows you to record a GPS track. Can run in background",
"tags": "tool,outdoors,gps,widget",

View File

@ -18,3 +18,4 @@
0.14: Now use the openstmap lib for map plotting
0.15: Add plotTrack method to allow current track to be plotted on a map (#395)
0.16: Add gpsrec app to Settings menu
0.17: Disable recording if storage is full (fix #574)

View File

@ -29,12 +29,21 @@
periodCtr--;
if (periodCtr<=0) {
periodCtr = settings.period;
try {
if (gpsTrack) gpsTrack.write([
fix.time.getTime(),
fix.lat.toFixed(6),
fix.lon.toFixed(6),
fix.alt
].join(",")+"\n");
} catch(e) {
// If storage.write caused an error, disable
// GPS recording so we don't keep getting errors!
console.log("gpsrec: write error", e);
settings.recording = false;
require("Storage").write("gpsrec.json", settings);
reload();
}
}
}
}