From e18dbd12813431c09715f673ac883526dd35f6c0 Mon Sep 17 00:00:00 2001 From: Andrew Koenig Date: Mon, 16 Dec 2024 22:48:23 -0600 Subject: [PATCH 1/3] Move telem/scan plot/map to HTML details method --- auto_rx/autorx/templates/index.html | 139 ++++++++++------------------ 1 file changed, 49 insertions(+), 90 deletions(-) diff --git a/auto_rx/autorx/templates/index.html b/auto_rx/autorx/templates/index.html index dda5b1f9..beb1bc74 100644 --- a/auto_rx/autorx/templates/index.html +++ b/auto_rx/autorx/templates/index.html @@ -213,7 +213,7 @@ scan_chart_latest_timestamp = data.timestamp; // Do not update the scan plot if the tab is hidden, or we have the scan plot hidden. - if( (document.visibilityState == "hidden") || (document.getElementById("showscanbutton").checked == false) ){ + if( (document.visibilityState == "hidden") || (document.getElementById("scanid").hasAttribute("open") == false) ){ return; } else { redraw_scan_chart(data); @@ -224,7 +224,7 @@ }); document.addEventListener("visibilitychange", () => { - if (document.visibilityState === "visible" && document.getElementById("showscanbutton").checked) { + if (document.visibilityState === "visible" && document.getElementById("scanid").hasAttribute("open")) { redraw_scan_chart(); } }); @@ -311,19 +311,18 @@ }); // Check if user has preffered map visiblity. - if (getCookie('map') == 'false') { - document.getElementById("showmapbutton").checked = false; - document.getElementById("mapid").style.display = "none"; + if (getCookie('map') == 'true') { + document.getElementById("mapid_details").setAttribute("open", true) ; } else { - document.getElementById("showmapbutton").checked = true; + document.getElementById("mapid_details").removeAttribute("open") ; + document.getElementById("mapid").style.display = "none"; } // Check if user has preffered table visiblity. - if (getCookie('table') == 'false') { - document.getElementById("showtablebutton").checked = false; - document.getElementById("tableid").style.display = "none"; + if (getCookie('table') == 'true') { + document.getElementById("tableid").setAttribute("open", true) ; } else { - document.getElementById("showtablebutton").checked = true; + document.getElementById("tableid").removeAttribute("open") ; } // Check if user has preffered follow latest sonde selection. @@ -360,11 +359,9 @@ // Check if user has preffered scan chart visiblity. if (getCookie('scan') == 'true') { - document.getElementById("showscanbutton").checked = true; - document.getElementById("scanid").style.display = "block"; + document.getElementById("scanid").setAttribute("open", true) ; } else { - document.getElementById("showscanbutton").checked = false; - document.getElementById("scanid").style.display = "none"; + document.getElementById("scanid").removeAttribute("open") ; } // Check if user has dark mode set. @@ -464,6 +461,31 @@ mymap.invalidateSize(); }) + $("#tableid").on("toggle", function() { + mymap.invalidateSize(); + setCookie("table", $("#tableid").prop("open"), 365); + }) + + $("#scanid").on("toggle", function() { + mymap.invalidateSize(); + setCookie("scan", $("#scanid").prop("open"), 365); + if ($("#scanid").prop("open")) { + redraw_scan_chart(); + scan_chart_obj.flush(); + } + }) + + $("#mapid_details").on("toggle", function() { + mymap.invalidateSize(); + setCookie("map", $("#mapid_details").prop("open"), 365); + if ($("#mapid_details").prop("open")) { + document.getElementById("mapid").style.display = "block"; + mymap.invalidateSize(); + } else { + document.getElementById("mapid").style.display = "none"; + } + }) + // Create Tabulator table. table = new Tabulator("#telem_table", { index:"realid", @@ -1265,7 +1287,7 @@ myDiv.scrollTop = 0; if ((window.innerWidth/window.innerHeight) > 1) { // 350px wide on desktop. x.style.display = "none"; - if (getCookie('map') == true || document.getElementById("showmapbutton").checked == true) { + if (getCookie('map') == true) { y.style.display = "block"; } document.getElementById("mySidenav").style.width = "350px"; @@ -1282,7 +1304,7 @@ } } else { x.style.display = "none"; - if (getCookie('map') == true || document.getElementById("showmapbutton").checked == true) { + if (getCookie('map') == true) { y.style.display = "block"; } document.getElementById("mySidenav").style.width = 0; @@ -1297,7 +1319,7 @@ var y = document.getElementById('mapid'); if (document.getElementById("mySettings").style.width == "0px" || document.getElementById("mySettings").style.width == 0) { if ((window.innerWidth/window.innerHeight) > 1) { // 350px wide on desktop. - if (getCookie('map') == true || document.getElementById("showmapbutton").checked == true) { + if (getCookie('map') == true) { y.style.display = "block"; } document.getElementById("mySettings").style.width = "350px"; @@ -1313,7 +1335,7 @@ document.getElementById("mySettings").style.borderRadius = "0px"; } } else { - if (getCookie('map') == true || document.getElementById("showmapbutton").checked == true) { + if (getCookie('map') == true) { y.style.display = "block"; } document.getElementById("mySettings").style.width = 0; @@ -1332,33 +1354,6 @@ } } - // Show/hide map on button press and update cookies. - function showMap(element) { - if (element.checked == false) { - document.getElementById("mapid").style.display = "none"; - setCookie("map", 'false', 365); - } else { - document.getElementById("mapid").style.display = "block"; - setCookie("map", 'true', 365); - mymap.invalidateSize(); - } - } - - // Show/hide scan chart on button press and update cookies. - function showScan(element) { - if (element.checked == false) { - document.getElementById("scanid").style.display = "none"; - setCookie("scan", 'false', 365); - mymap.invalidateSize(); - } else { - document.getElementById("scanid").style.display = "block"; - setCookie("scan", 'true', 365); - mymap.invalidateSize(); - redraw_scan_chart(); - scan_chart_obj.flush(); - } - } - // Enable/disable auto follow on button press and update cookies. function autoFollow(element) { if (element.checked == false) { @@ -1368,17 +1363,6 @@ } } - // Show/hide table on button press and update cookies. - function showTable(element) { - if (element.checked == false) { - document.getElementById("tableid").style.display = "none"; - setCookie("table", 'false', 365); - } else { - document.getElementById("tableid").style.display = "block"; - setCookie("table", 'true', 365); - } - } - // Set given cookie name and value. function setCookie(name,value) { localStorage.setItem(name, value); @@ -1493,36 +1477,6 @@

-

Show Table

-   -
- -
-
-
-

Show Scan Plot

-   -
- -
-
-
-

Show Map

-   -
- -
-
-

Dark Mode

 
@@ -1638,14 +1592,19 @@

Historical View

Tasking: -
+
+ Telemetry
-
-
+ +
+ Scan Plot
No scan data yet...
-
+
+
+ Map +
From 316ed765b8f3ce9a261bc29767b23594f540368e Mon Sep 17 00:00:00 2001 From: Andrew Koenig Date: Mon, 16 Dec 2024 23:00:19 -0600 Subject: [PATCH 2/3] Bump to beta1 --- auto_rx/autorx/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auto_rx/autorx/__init__.py b/auto_rx/autorx/__init__.py index 2d24179d..963f0be9 100644 --- a/auto_rx/autorx/__init__.py +++ b/auto_rx/autorx/__init__.py @@ -12,7 +12,7 @@ # MINOR - New sonde type support, other fairly big changes that may result in telemetry or config file incompatability issus. # PATCH - Small changes, or minor feature additions. -__version__ = "1.8.0" +__version__ = "1.8.1-beta1" # Global Variables From 146668253a2306ff1e5515d5b7bd4e585bb556f6 Mon Sep 17 00:00:00 2001 From: Andrew Koenig Date: Thu, 19 Dec 2024 20:30:37 +0000 Subject: [PATCH 3/3] Added mapid_details conditional --- auto_rx/autorx/templates/index.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/auto_rx/autorx/templates/index.html b/auto_rx/autorx/templates/index.html index beb1bc74..198c708e 100644 --- a/auto_rx/autorx/templates/index.html +++ b/auto_rx/autorx/templates/index.html @@ -1287,7 +1287,7 @@ myDiv.scrollTop = 0; if ((window.innerWidth/window.innerHeight) > 1) { // 350px wide on desktop. x.style.display = "none"; - if (getCookie('map') == true) { + if (getCookie('map') == true || document.getElementById("mapid_details").hasAttribute("open")) { y.style.display = "block"; } document.getElementById("mySidenav").style.width = "350px"; @@ -1304,7 +1304,7 @@ } } else { x.style.display = "none"; - if (getCookie('map') == true) { + if (getCookie('map') == true || document.getElementById("mapid_details").hasAttribute("open")) { y.style.display = "block"; } document.getElementById("mySidenav").style.width = 0; @@ -1319,7 +1319,7 @@ var y = document.getElementById('mapid'); if (document.getElementById("mySettings").style.width == "0px" || document.getElementById("mySettings").style.width == 0) { if ((window.innerWidth/window.innerHeight) > 1) { // 350px wide on desktop. - if (getCookie('map') == true) { + if (getCookie('map') == true || document.getElementById("mapid_details").hasAttribute("open")) { y.style.display = "block"; } document.getElementById("mySettings").style.width = "350px"; @@ -1335,7 +1335,7 @@ document.getElementById("mySettings").style.borderRadius = "0px"; } } else { - if (getCookie('map') == true) { + if (getCookie('map') == true || document.getElementById("mapid_details").hasAttribute("open")) { y.style.display = "block"; } document.getElementById("mySettings").style.width = 0;