mirror of https://github.com/espruino/BangleApps
Merge pull request #3102 from thyttan/recorder
Recorder: 1 second period with 1 decimal placepull/3111/head
commit
05193753de
|
@ -42,3 +42,4 @@
|
|||
0.33: Ensure that a new file is always created if the stuff that's being recorded has changed (fix #3081)
|
||||
0.34: Avoid prompting when creating a new file (#3081)
|
||||
0.35: Handle loading without a settings file (default record setting)
|
||||
0.36: When recording with 1 second periods, log time with one decimal.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"id": "recorder",
|
||||
"name": "Recorder",
|
||||
"shortName": "Recorder",
|
||||
"version": "0.35",
|
||||
"version": "0.36",
|
||||
"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",
|
||||
|
|
|
@ -176,11 +176,11 @@
|
|||
};
|
||||
let getCSVHeaders = activeRecorders => ["Time"].concat(activeRecorders.map(r=>r.fields));
|
||||
|
||||
let writeLog = function() {
|
||||
let writeLog = function(period) {
|
||||
entriesWritten++;
|
||||
WIDGETS["recorder"].draw();
|
||||
try {
|
||||
var fields = [Math.round(getTime())];
|
||||
var fields = [period===1?getTime().toFixed(1):Math.round(getTime())];
|
||||
activeRecorders.forEach(recorder => fields.push.apply(fields,recorder.getValues()));
|
||||
if (storageFile) storageFile.write(fields.join(",")+"\n");
|
||||
} catch(e) {
|
||||
|
@ -222,7 +222,7 @@
|
|||
}
|
||||
// start recording...
|
||||
WIDGETS["recorder"].draw();
|
||||
writeInterval = setInterval(writeLog, settings.period*1000);
|
||||
writeInterval = setInterval(writeLog, settings.period*1000, settings.period);
|
||||
} else {
|
||||
WIDGETS["recorder"].width = 0;
|
||||
storageFile = undefined;
|
||||
|
|
Loading…
Reference in New Issue