gpsrec 0.17: Disable recording if storage is full (fix #574)
parent
83b88e0d80
commit
15be69ba0b
|
|
@ -363,7 +363,7 @@
|
||||||
{ "id": "gpsrec",
|
{ "id": "gpsrec",
|
||||||
"name": "GPS Recorder",
|
"name": "GPS Recorder",
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
"version":"0.16",
|
"version":"0.17",
|
||||||
"interface": "interface.html",
|
"interface": "interface.html",
|
||||||
"description": "Application that allows you to record a GPS track. Can run in background",
|
"description": "Application that allows you to record a GPS track. Can run in background",
|
||||||
"tags": "tool,outdoors,gps,widget",
|
"tags": "tool,outdoors,gps,widget",
|
||||||
|
|
|
||||||
|
|
@ -18,3 +18,4 @@
|
||||||
0.14: Now use the openstmap lib for map plotting
|
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.15: Add plotTrack method to allow current track to be plotted on a map (#395)
|
||||||
0.16: Add gpsrec app to Settings menu
|
0.16: Add gpsrec app to Settings menu
|
||||||
|
0.17: Disable recording if storage is full (fix #574)
|
||||||
|
|
|
||||||
|
|
@ -29,12 +29,21 @@
|
||||||
periodCtr--;
|
periodCtr--;
|
||||||
if (periodCtr<=0) {
|
if (periodCtr<=0) {
|
||||||
periodCtr = settings.period;
|
periodCtr = settings.period;
|
||||||
if (gpsTrack) gpsTrack.write([
|
try {
|
||||||
fix.time.getTime(),
|
if (gpsTrack) gpsTrack.write([
|
||||||
fix.lat.toFixed(6),
|
fix.time.getTime(),
|
||||||
fix.lon.toFixed(6),
|
fix.lat.toFixed(6),
|
||||||
fix.alt
|
fix.lon.toFixed(6),
|
||||||
].join(",")+"\n");
|
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