diff --git a/go.mod b/go.mod index d66e110..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 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 5962409..009a71d 100644 --- a/html/config.html +++ b/html/config.html @@ -75,15 +75,39 @@

Modem

+
+

Thermal Recorder

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

Thermal Motion

-
- +
@@ -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" ] }
Do tracking on PI