Commit 09b0eda4 by Corey Koval

Added auto-refresh

parent c1cf0ef6
......@@ -16,6 +16,7 @@ Click the power button to enable/disable.
- Black is enabled, red is disabled.
- If you lose connectivity to a receiver, that particular receiver will be disabled.
Click the power button to try to reconnect.
- Map refreshes every 5 seconds. Change `refreshrate` at the top of `static/receiver_configurator.js` to change the refresh rate.
## Dependencies:
- Python >= 3.6
......
// Update Map ever 5 seconds
var refreshrate = 5000;
var autoRefresh = setInterval(function () { updateParams(); }, refreshrate);
// *************************************************
// * Gets Rx data from backend
// *************************************************
......@@ -56,6 +60,7 @@ function editReceivers(rx_json, id) {
var editButton = document.getElementById(id + "-edit");
var isMobileCheck = document.getElementById("mobilerx_toggle_" + id);
if (editButton.checked) {
clearInterval(autoRefresh);
let isMobile = "";
if (receivers[id].mobile) isMobile = "checked";
document.getElementById(id + "-editicon").innerHTML = "save";
......@@ -77,6 +82,7 @@ function editReceivers(rx_json, id) {
// }
// }
} else {
autoRefresh = setInterval(function () { updateParams(); }, refreshrate);
isMobileCheck = document.getElementById("mobilerx_toggle_" + id);
if (isMobileCheck.checked) {
receivers[id].mobile = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment