Merge pull request #3102 from thyttan/recorder

Recorder: 1 second period with 1 decimal place
pull/3111/head
Rob Pilling 2023-11-22 07:53:54 +00:00 committed by GitHub
commit 05193753de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

View File

@ -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.

View File

@ -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",

View File

@ -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;