diff --git a/enervent-ctrl-go/static/html/index.html b/enervent-ctrl-go/static/html/index.html index 2913a27..656211c 100644 --- a/enervent-ctrl-go/static/html/index.html +++ b/enervent-ctrl-go/static/html/index.html @@ -2,15 +2,16 @@ - Enervent Pingvin Kotilämpö - +
Holding register values at Holding register values at
+ Include reserved
AddressValueSymbolDescription
- \ No newline at end of file + + diff --git a/enervent-ctrl-go/static/html/js/tabledata.js b/enervent-ctrl-go/static/html/js/tabledata.js index 1342481..e64f73e 100644 --- a/enervent-ctrl-go/static/html/js/tabledata.js +++ b/enervent-ctrl-go/static/html/js/tabledata.js @@ -30,7 +30,9 @@ function coils(data) { td.appendChild(value) tablerow.appendChild(td) } - + if (data[n].reserved) { + tablerow.className = "reserved" + } datatable.appendChild(tablerow) } } else { @@ -61,7 +63,9 @@ function registers(data) { td.appendChild(value) tablerow.appendChild(td) } - + if (data[n].reserved) { + tablerow.className = "reserved" + } datatable.appendChild(tablerow) } console.log(`${timeStamp()} Done.`) @@ -120,3 +124,19 @@ function getData() { // There's no need to update exactly every 5 seconds, the skew is fine setTimeout(getData, 5*1000); } + +// Show or hide rows for "reserved" values when clicking the checkbox +incl_res = document.getElementById("incl_res") +incl_res.addEventListener("change", (event) => { + reservedRows = document.getElementsByClassName("reserved") + if (event.currentTarget.checked) { + for (i=0; i