From 78e11182e4407e3aa493926e2bc0914f08c5ad8a Mon Sep 17 00:00:00 2001 From: gferraro Date: Fri, 17 Apr 2026 16:51:08 +1200 Subject: [PATCH 1/7] add options for medium power --- go.mod | 1 + html/config.html | 28 ++++++++++++++++++++++++++-- static/js/config.js | 19 +++++++++++++++++++ 3 files changed, 46 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index d66e110..c732e6d 100644 --- a/go.mod +++ b/go.mod @@ -65,3 +65,4 @@ require ( ) replace periph.io/x/periph => github.com/TheCacophonyProject/periph v2.1.1-0.20200615222341-6834cd5be8c1+incompatible +replace github.com/TheCacophonyProject/go-config => /home/gp/cacophony/go-config \ No newline at end of file diff --git a/html/config.html b/html/config.html index 5962409..09bc82c 100644 --- a/html/config.html +++ b/html/config.html @@ -75,11 +75,35 @@

Modem

+
+

Thermal Recorder

+
+
+
+
+ + + + + + + + + + + +
Use low power mode
Instant classify
+
+
+
+ +
+ +

Thermal Motion

-
@@ -112,7 +136,7 @@

Thermal Motion

- +
diff --git a/static/js/config.js b/static/js/config.js index dfb7dfd..62b7193 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,21 @@ async function saveModemConfig() { await saveConfig("modemd", data); } +function updateThermalMotionState() { + const disabled = document.querySelector("#input-low-power-mode").checked; + const thermalMotionInputs = document.querySelectorAll( + "#input-do-tracking, #input-run-classifier, #input-tracking-events, #input-postprocess, #input-postprocess-events" + ); + thermalMotionInputs.forEach((el) => (el.disabled = disabled)); +} + +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, From a4ec1557289d0f7017fa8a99303d0a0e676c4bae Mon Sep 17 00:00:00 2001 From: gferraro Date: Fri, 17 Apr 2026 17:52:41 +1200 Subject: [PATCH 2/7] add go-config --- go.mod | 3 +-- go.sum | 4 ++-- html/config.html | 2 +- static/js/config.js | 5 +++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index c732e6d..40a4d12 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/TheCacophonyProject/audiobait/v3 v3.0.1 github.com/TheCacophonyProject/event-reporter/v3 v3.11.0 github.com/TheCacophonyProject/go-api v1.2.2 - github.com/TheCacophonyProject/go-config v1.29.0 + github.com/TheCacophonyProject/go-config v1.31.0 github.com/TheCacophonyProject/go-cptv v0.0.0-20211109233846-8c32a5d161f7 github.com/TheCacophonyProject/lepton3 v0.0.0-20211005194419-22311c15d6ee github.com/TheCacophonyProject/rtc-utils v1.2.0 @@ -65,4 +65,3 @@ require ( ) replace periph.io/x/periph => github.com/TheCacophonyProject/periph v2.1.1-0.20200615222341-6834cd5be8c1+incompatible -replace github.com/TheCacophonyProject/go-config => /home/gp/cacophony/go-config \ No newline at end of file diff --git a/go.sum b/go.sum index 68204cf..37f24ec 100644 --- a/go.sum +++ b/go.sum @@ -17,8 +17,8 @@ github.com/TheCacophonyProject/go-config v0.0.0-20190922224052-7c2a21bc6b88/go.m github.com/TheCacophonyProject/go-config v0.0.0-20190927054511-c93578ae648a/go.mod h1:QCgT+KCrz1CmLVpeeOMl5L8/X1QvWwpsLzR7afTmEJc= github.com/TheCacophonyProject/go-config v1.4.0/go.mod h1:oARW/N3eJbcewCqB+Jc7TBwuODawwYgpo56UO6yBdKU= github.com/TheCacophonyProject/go-config v1.6.4/go.mod h1:eDQfBjmTDh/l+2QLBgsotmJFd/1x/7w4SwwBUxMM86w= -github.com/TheCacophonyProject/go-config v1.29.0 h1:fO+v9jgVQBR9MHee0CLpaSFwQRFVyushjO4CNmKOcag= -github.com/TheCacophonyProject/go-config v1.29.0/go.mod h1:+9Z/iu1atKlfwfbbyfpUHaDz9quCgo/BvCianA+zSAs= +github.com/TheCacophonyProject/go-config v1.31.0 h1:0MU6NJS37NKBZ17YlIBfg5/ZMcsjfOg5J9hKeNRszYg= +github.com/TheCacophonyProject/go-config v1.31.0/go.mod h1:+9Z/iu1atKlfwfbbyfpUHaDz9quCgo/BvCianA+zSAs= github.com/TheCacophonyProject/go-cptv v0.0.0-20200116020937-858bd8b71512/go.mod h1:8H6Aaft5549sIWxcsuCIL2o60/TQkoF93fVoSTpgZb8= github.com/TheCacophonyProject/go-cptv v0.0.0-20200616224711-fc633122087a/go.mod h1:Vg73Ezn4kr8qDNP9LNgjki9qgi+5T/0Uc9oDyflaYUY= github.com/TheCacophonyProject/go-cptv v0.0.0-20200818214604-bd5d4aa36043/go.mod h1:wG4/P/TsGtk33uBClYPjRlSbcdQrIASXutOUV8LMn2o= diff --git a/html/config.html b/html/config.html index 09bc82c..0fb675a 100644 --- a/html/config.html +++ b/html/config.html @@ -85,7 +85,7 @@

Thermal Recorder

Use low power mode - + Instant classify diff --git a/static/js/config.js b/static/js/config.js index 62b7193..73679cd 100644 --- a/static/js/config.js +++ b/static/js/config.js @@ -99,11 +99,12 @@ async function saveModemConfig() { } function updateThermalMotionState() { - const disabled = document.querySelector("#input-low-power-mode").checked; + const lowPower = document.querySelector("#input-low-power-mode").checked; + document.querySelector("#input-instant-classify").disabled = !lowPower; const thermalMotionInputs = document.querySelectorAll( "#input-do-tracking, #input-run-classifier, #input-tracking-events, #input-postprocess, #input-postprocess-events" ); - thermalMotionInputs.forEach((el) => (el.disabled = disabled)); + thermalMotionInputs.forEach((el) => (el.disabled = lowPower)); } async function saveThermalRecorderConfig(){ From 20aa98110bd6927590336efb0367cbcfcf76d291 Mon Sep 17 00:00:00 2001 From: gferraro Date: Fri, 17 Apr 2026 17:57:21 +1200 Subject: [PATCH 3/7] added ignore --- tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index 69a3974..62d3bb8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,7 +12,7 @@ "sourceMap": true, "baseUrl": ".", "rootDir": ".", - + "ignoreDeprecations": "6.0", "paths": { "@/*": [ "src/*" From 75536354c3f0ac1d37c6fdab601c87e057ff875d Mon Sep 17 00:00:00 2001 From: gferraro Date: Mon, 20 Apr 2026 09:34:28 +1200 Subject: [PATCH 4/7] fix type script error --- static/js/audiorecording.ts | 2 +- tsconfig.json | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) 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/tsconfig.json b/tsconfig.json index 62d3bb8..4b254f2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,7 +12,6 @@ "sourceMap": true, "baseUrl": ".", "rootDir": ".", - "ignoreDeprecations": "6.0", "paths": { "@/*": [ "src/*" From 95067599e93fff44b045e6893fe9de6768970ba8 Mon Sep 17 00:00:00 2001 From: gferraro Date: Mon, 20 Apr 2026 09:37:11 +1200 Subject: [PATCH 5/7] add jquery types --- tsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/tsconfig.json b/tsconfig.json index 4b254f2..3eb6228 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,6 +17,7 @@ "src/*" ] }, + "types": ["jquery"], "lib": [ "esnext", "dom", From 8ea08bb72dba2f3ae92c5cce5ab46d81d3713bba Mon Sep 17 00:00:00 2001 From: gferraro Date: Mon, 20 Apr 2026 09:52:35 +1200 Subject: [PATCH 6/7] tidy up ts file --- tsconfig.json | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index 3eb6228..b23fa0b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,21 +2,11 @@ "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", @@ -30,6 +20,6 @@ "./api/*.ts" ], "exclude": [ - "node_modules", + "node_modules" ] } From 24fcbdc83491c3428da01b3e08ba3d25cb7ba020 Mon Sep 17 00:00:00 2001 From: gferraro Date: Mon, 20 Apr 2026 10:13:23 +1200 Subject: [PATCH 7/7] correct disabling logic --- html/config.html | 2 +- static/js/config.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/html/config.html b/html/config.html index 0fb675a..009a71d 100644 --- a/html/config.html +++ b/html/config.html @@ -107,7 +107,7 @@

Thermal Motion

- +
diff --git a/static/js/config.js b/static/js/config.js index 73679cd..03576c9 100644 --- a/static/js/config.js +++ b/static/js/config.js @@ -101,8 +101,8 @@ async function saveModemConfig() { function updateThermalMotionState() { const lowPower = document.querySelector("#input-low-power-mode").checked; document.querySelector("#input-instant-classify").disabled = !lowPower; - const thermalMotionInputs = document.querySelectorAll( - "#input-do-tracking, #input-run-classifier, #input-tracking-events, #input-postprocess, #input-postprocess-events" + const thermalMotionInputs = document.querySelector("#thermal-recorder-options").querySelectorAll( + "#input-do-tracking, #input-run-classifier, #input-tracking-events" ); thermalMotionInputs.forEach((el) => (el.disabled = lowPower)); }
Do tracking on PI