Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
30 changes: 27 additions & 3 deletions html/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,39 @@ <h3>Modem<br></h3>
<div class="container pt-1 pl-0">
<button id="save-button" type="button" onclick="saveModemConfig()" class="btn btn-primary">Save Modem Config</button>
</div>
<div class="container pt-5 pl-0">
<h3>Thermal Recorder<br></h3>
</div>
<div class="row">
<div class="col-xs-8">
<div class="table-responsive">
<table class="table">
<tbody>
<tr>
<td>Use low power mode</td>
<td><input type="checkbox" id="input-low-power-mode"></td>
</tr>
<tr>
<td>Instant classify</td>
<td><input type="checkbox" id="input-instant-classify"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>

<div class="container pt-1 pl-0">
<button id="save-button" type="button" onclick="saveThermalRecorderConfig()" class="btn btn-primary">Save Thermal Recorder Config</button>
</div>

<div class="container pt-5 pl-0">
<h3>Thermal Motion<br></h3>
</div>

<div class="row">
<div class="col-xs-8">
<div class="table-responsive">
<table class="table">
<table class="table" id="thermal-recorder-options">
<tbody>
<tr>
<td>Do tracking on PI</td>
Expand Down Expand Up @@ -112,7 +136,7 @@ <h3>Thermal Motion<br></h3>
</div>

<div class="container pt-1 pl-0">
<button id="save-button" type="button" onclick="saveThermalMotionConfig()" class="btn btn-primary">Save ThermalMotion Config</button>
<button id="save-button" type="button" onclick="saveThermalMotionConfig()" class="btn btn-primary">Save Thermal Motion Config</button>
</div>

<div class="container pt-5 pl-0">
Expand Down
2 changes: 1 addition & 1 deletion static/js/audiorecording.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
20 changes: 20 additions & 0 deletions static/js/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down
16 changes: 3 additions & 13 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -30,6 +20,6 @@
"./api/*.ts"
],
"exclude": [
"node_modules",
"node_modules"
]
}
Loading