sensortools - Add setting for log

pull/2812/head
Martin Boonk 2023-05-28 22:13:30 +02:00
parent 560e39b900
commit d884e21a8e
3 changed files with 8 additions and 0 deletions

View File

@ -1,5 +1,6 @@
{ {
"enabled": false, "enabled": false,
"log": false,
"mag": { "mag": {
"enabled": false, "enabled": false,
"mode": "emulate", "mode": "emulate",

View File

@ -5,6 +5,7 @@ exports.enable = () => {
); );
let log = function(text, param) { let log = function(text, param) {
if (!settings.log) return;
let logline = new Date().toISOString() + " - " + "Sensortools - " + text; let logline = new Date().toISOString() + " - " + "Sensortools - " + text;
if (param) logline += ": " + JSON.stringify(param); if (param) logline += ": " + JSON.stringify(param);
print(logline); print(logline);

View File

@ -88,6 +88,12 @@
writeSettings("enabled",v); writeSettings("enabled",v);
}, },
}, },
'Log': {
value: !!settings.log,
onchange: v => {
writeSettings("log",v);
},
},
'GPS': ()=>{showSubMenu("GPS","gps",["nop", "staticfix", "nofix", "changingfix", "route", "routeFuzzy"],[]);}, 'GPS': ()=>{showSubMenu("GPS","gps",["nop", "staticfix", "nofix", "changingfix", "route", "routeFuzzy"],[]);},
'Compass': ()=>{showSubMenu("Compass","mag",["nop", "static", "rotate"],[]);}, 'Compass': ()=>{showSubMenu("Compass","mag",["nop", "static", "rotate"],[]);},
'HRM': ()=>{showSubMenu("HRM","hrm",["nop", "static"],["bpmtrippled"],["sin"]);} 'HRM': ()=>{showSubMenu("HRM","hrm",["nop", "static"],["bpmtrippled"],["sin"]);}