| Do tracking on PI |
@@ -112,7 +136,7 @@ Thermal Motion
-
+
diff --git a/static/js/audiorecording.ts b/static/js/audiorecording.ts
index dccee39..006b1ea 100644
--- a/static/js/audiorecording.ts
+++ b/static/js/audiorecording.ts
@@ -26,7 +26,7 @@ class AudioState {
}
startPolling() {
this.clearInterval();
- this.intervalId = setInterval(getAudioStatus, 1000);
+ this.intervalId = window.setInterval(getAudioStatus, 1000);
}
}
const audioState = new AudioState(null, null);
diff --git a/static/js/config.js b/static/js/config.js
index dfb7dfd..03576c9 100644
--- a/static/js/config.js
+++ b/static/js/config.js
@@ -36,6 +36,10 @@ async function loadConfig() {
document.querySelector("#input-connection-timeout").value = formatDuration(data.values.modemd.ConnectionTimeout);
// Set values for thermal motion
+ document.querySelector("#input-instant-classify").checked = data.values.thermalRecorder.InstantClassify;
+ document.querySelector("#input-low-power-mode").checked = data.values.thermalRecorder.UseLowPowerMode;
+ updateThermalMotionState();
+
document.querySelector("#input-do-tracking").checked = data.values.thermalMotion.DoTracking;
document.querySelector("#input-run-classifier").checked = data.values.thermalMotion.RunClassifier;
document.querySelector("#input-tracking-events").checked = data.values.thermalMotion.TrackingEvents;
@@ -94,6 +98,22 @@ async function saveModemConfig() {
await saveConfig("modemd", data);
}
+function updateThermalMotionState() {
+ const lowPower = document.querySelector("#input-low-power-mode").checked;
+ document.querySelector("#input-instant-classify").disabled = !lowPower;
+ const thermalMotionInputs = document.querySelector("#thermal-recorder-options").querySelectorAll(
+ "#input-do-tracking, #input-run-classifier, #input-tracking-events"
+ );
+ thermalMotionInputs.forEach((el) => (el.disabled = lowPower));
+}
+
+async function saveThermalRecorderConfig(){
+ const data = { "instant-classify": document.querySelector("#input-instant-classify").checked,
+ "use-low-power-mode":document.querySelector("#input-low-power-mode").checked
+ }
+ await saveConfig("thermal-recorder",data);
+}
+
async function saveThermalMotionConfig() {
const data = {
"do-tracking": document.querySelector("#input-do-tracking").checked,
diff --git a/tsconfig.json b/tsconfig.json
index 69a3974..b23fa0b 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -2,22 +2,12 @@
"compilerOptions": {
"target": "esnext",
"module": "esnext",
+ "moduleResolution": "bundler",
"allowJs": true,
"strict": true,
- "importHelpers": true,
- "moduleResolution": "node",
- "experimentalDecorators": true,
- "esModuleInterop": true,
- "allowSyntheticDefaultImports": true,
"sourceMap": true,
- "baseUrl": ".",
"rootDir": ".",
-
- "paths": {
- "@/*": [
- "src/*"
- ]
- },
+ "types": ["jquery"],
"lib": [
"esnext",
"dom",
@@ -30,6 +20,6 @@
"./api/*.ts"
],
"exclude": [
- "node_modules",
+ "node_modules"
]
}