Skip to content

Commit

Permalink
Merge pull request #3102 from thyttan/recorder
Browse files Browse the repository at this point in the history
Recorder: 1 second period with 1 decimal place
  • Loading branch information
bobrippling authored Nov 22, 2023
2 parents 862ca36 + c82fead commit 0519375
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions apps/recorder/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 1 addition & 1 deletion apps/recorder/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions apps/recorder/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 0519375

Please sign in to comment.