gpsrec 0.17: Disable recording if storage is full (fix #574)
parent
83b88e0d80
commit
15be69ba0b
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -29,12 +29,21 @@
|
|||
periodCtr--;
|
||||
if (periodCtr<=0) {
|
||||
periodCtr = settings.period;
|
||||
if (gpsTrack) gpsTrack.write([
|
||||
fix.time.getTime(),
|
||||
fix.lat.toFixed(6),
|
||||
fix.lon.toFixed(6),
|
||||
fix.alt
|
||||
].join(",")+"\n");
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue