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
29 changes: 29 additions & 0 deletions auto_rx/autorx/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ def read_auto_rx_config(filename, no_sdr_test=False):
"web_control": False,
# "web_password": "none", # Commented out to ensure warning message is shown
#'kml_refresh_rate': 10,
# Heywhatsthat settings,
"hwt_terrain_url": "https://www.heywhatsthat.com/bin/profile-0904.cgi?src=sondehub&curvature=1&axes=1&los=1&greatcircle=1&metric=1&refraction=&exaggeration=",
"hwt_lat": 0.0,
"hwt_lon": 0.0,
"hwt_alt": 0.0,

# Advanced Parameters
"search_step": 800,
"snr_threshold": 10,
Expand Down Expand Up @@ -396,6 +402,29 @@ def read_auto_rx_config(filename, no_sdr_test=False):
auto_rx_config["web_port"] = config.getint("web", "web_port")
auto_rx_config["web_archive_age"] = config.getint("web", "archive_age")

# Heywhatsthat settings.
if config.has_section("heywhatsthat"):
if config.has_option("heywhatsthat", "terrain_url"):
auto_rx_config["hwt_terrain_url"] = config.get("heywhatsthat", "terrain_url")
auto_rx_config["hwt_lat"] = config.getfloat("heywhatsthat", "hwt_lat")
auto_rx_config["hwt_lon"] = config.getfloat("heywhatsthat", "hwt_lon")
auto_rx_config["hwt_alt"] = config.getfloat("heywhatsthat", "hwt_alt")
if auto_rx_config["hwt_lat"] > 90.0 or auto_rx_config["hwt_lat"] < -90.0:
logging.critical("Config - Invalid HWT Latitude! (Outside +/- 90 degrees!)")
return None

if auto_rx_config["hwt_lon"] > 180.0 or auto_rx_config["hwt_lon"] < -180.0:
logging.critical("Config - Invalid HWT Longitude! (Outside +/- 180 degrees!)")
return None
else:
logging.warning(
"Config - Did not find heywhatsthat options, using defaults"
)
auto_rx_config["hwt_lat"] = auto_rx_config["station_lat"];
auto_rx_config["hwt_lon"] = auto_rx_config["station_lon"];
auto_rx_config["hwt_alt"] = auto_rx_config["station_alt"];

# Save audio/iq settings.
auto_rx_config["save_detection_audio"] = config.getboolean(
"debugging", "save_detection_audio"
)
Expand Down
1 change: 1 addition & 0 deletions auto_rx/autorx/static/css/autorx.css
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
.icon-cog:before { content: '\e802'; } /* '' */
.icon-angle-down:before { content: '\f107'; } /* '' */
.icon-history:before { content: '\f1da'; } /* '' */
.icon-mountain:before { content: '\1f3d4'; }

.sdrinfo-element {
display: inline-block;
Expand Down
8 changes: 8 additions & 0 deletions auto_rx/autorx/static/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,14 @@ table {
color: white;
}

#myBtn4 {
cursor: pointer;
position: absolute;
right: 6vh;
right: calc(12vh + 48px);
color: white;
}

.switch {
position: relative;
display: inline-block;
Expand Down
Binary file added auto_rx/autorx/static/img/heywhatsthat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
112 changes: 111 additions & 1 deletion auto_rx/autorx/templates/historical.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@

var sonde_list_width = 1;

var _hwt_profile_url = "";

$( document ).ready(function() {

shown = [];
Expand All @@ -63,6 +65,9 @@
}
});

_hwt_profile_url = autorx_config.hwt_terrain_url;
_hwt_profile_url += "&width=550&height=400";

$.ajax({
// Get list of sonde.
url: "get_log_list",
Expand Down Expand Up @@ -174,6 +179,7 @@
$("#hidesonde-map").prop('disabled', true);
$("#showsonde-skew").prop('disabled', true);
$("#hidesonde-skew").prop('disabled', true);
$("#showsonde-profile").prop('disabled', true);
$("#download-logs").prop('disabled', true);
$("#generate-kml").prop('disabled', true);
}
Expand All @@ -188,6 +194,7 @@
$("#hidesonde-map").prop('disabled', false);
$("#showsonde-skew").prop('disabled', false);
$("#hidesonde-skew").prop('disabled', false);
$("#showsonde-profile").prop('disabled', false);
$("#download-logs").prop('disabled', false);
$("#generate-kml").prop('disabled', false);
}
Expand Down Expand Up @@ -936,6 +943,67 @@
showSkewT();
});

function showProfile (firstlast) {
selectedrows = table.getSelectedData();
if (selectedrows.length > 0) {
document.getElementById("profile_img").src="";
$("#profile-buttons").css('visibility', 'visible');
this_row = selectedrows[selectedrows.length-1];

_heading = "Terrain Profile Plot<br>" + this_row['serial'];
_heading += " " + this_row[firstlast]['datetime'];
if (firstlast == "last") {
_heading += "<br>Last seen";
} else {
_heading += "<br>First seen";
}
_heading += " Bearing: " + this_row[firstlast]['bearing'];
_heading += "&deg;";
$('#profile-header').html(_heading);

_hwt = _hwt_profile_url;
_hwt += "&pt0=";
_hwt += autorx_config.hwt_lat + ",";
_hwt += autorx_config.hwt_lon + ",";
_hwt += "8b6914,";
_hwt += autorx_config.hwt_alt;
_hwt += ",9906ff";

_hwt += "&pt1=";
_hwt += this_row[firstlast]['lat'] + ",";
_hwt += this_row[firstlast]['lon'] + ",";
_hwt += ",";
_hwt += this_row[firstlast]['alt'] + ",";
_hwt += "&freq=";
_hwt += this_row['freq'];
document.getElementById("profile_img").src=_hwt;

if (document.getElementById("myProfile").style.width == "0px" || document.getElementById("myProfile").style.width == 0) {
if ((window.innerWidth/window.innerHeight) > 1) {
document.getElementById("myProfile").style.width = "100vh";
} else {
document.getElementById("myProfile").style.width = "100%";
}
}
} else {
enableMenu();
}
enableMenu();
}

$("#showsonde-profile").click(function(){
disableMenu();
showProfile('last');
});
$("#first-profile").click(function(){
disableMenu();
showProfile('first');
});
$("#last-profile").click(function(){
disableMenu();
showProfile('last');
});

function downloadLogs() {
// Download a set of log files.
selectedrows = table.getSelectedData();
Expand Down Expand Up @@ -1114,6 +1182,7 @@
$('#myBtn1').css('color', 'black')
$('#myBtn2').css('color', 'black')
$('#myBtn3').css('color', 'black')
$('#myBtn4').css('color', 'black')
$('#scanid').css('color', 'black')
$('.c3-axis-y').css('fill', 'black')
$('.c3-axis-x').css('fill', 'black')
Expand Down Expand Up @@ -1146,6 +1215,7 @@
$('#myBtn1').css('color', 'white')
$('#myBtn2').css('color', 'white')
$('#myBtn3').css('color', 'white')
$('#myBtn4').css('color', 'white')
$('#scanid').css('color', 'white')
$('.c3-axis-y').css('fill', 'white')
$('.c3-axis-x').css('fill', 'white')
Expand Down Expand Up @@ -1434,6 +1504,30 @@
}
}

// Function to open/close right HeyWhatsThat profile along with adjusting other elements so they render correctly.
function changeProfile() {
var y = document.getElementById('mapid');
if (document.getElementById("myProfile").style.width == "0px" || document.getElementById("myProfile").style.width == 0) {
if ((window.innerWidth/window.innerHeight) > 1) { // 350px wide on desktop.
y.style.display = "block";
document.getElementById("myProfile").style.width = "100vh";
document.getElementById("main").style.marginRight = "100vh";
document.getElementById("myProfile").style.borderRadius = "25px 0px 0px 25px";
mymap.invalidateSize();
} else { // Fullsize on mobile.
y.style.display = "none";
document.getElementById("myProfile").style.width = "100%";
document.getElementById("main").style.marginRight = "0";
document.getElementById("myProfile").style.borderRadius = "0px";
}
} else {
y.style.display = "block";
document.getElementById("myProfile").style.width = 0;
document.getElementById("main").style.marginRight = 0;
mymap.invalidateSize();
}
}

// Function to open/close right settings menu along with adjusting other elements so they render correctly.
function changeSettings() {
var y = document.getElementById('mapid');
Expand Down Expand Up @@ -1503,6 +1597,7 @@ <h2>Sonde List</h2>
<button id="showsonde-launches" style="margin:3px auto">Plot First RX</button>
<button id="showsonde-coverage" style="margin:3px auto">Plot Coverage</button>
<button id="showsonde-skew" style="margin:3px auto">Plot Skew-T</button>
<button id="showsonde-profile" style="margin:3px auto">Plot Terrain</button>
<button id="download-logs" style="margin:3px auto">Download Logs</button>
<button id="generate-kml" style="margin:3px auto">Generate KML</button>
</div>
Expand All @@ -1511,7 +1606,7 @@ <h2>Sonde List</h2>
<div id="sonde-list-table" style="height:100%"></div>
</div>

<!-- Wrapper for settings sidebar -->
<!-- Wrapper for SkewT sidebar -->
<div id="mySkewT" class="skewt">
<a href="javascript:void(0)" class="closebtn3" id="closebtn3" onclick="changeSkewT()">&#10006;</a>
<h2 id="skewt-header" style="width:100%;text-align:center;">Skew-T Plot</h2>
Expand All @@ -1531,6 +1626,20 @@ <h2 id="skewt-header" style="width:100%;text-align:center;">Skew-T Plot</h2>
<div id="skewt-footer"></div>
</div>

<!-- Wrapper for HeyWhatsThat Profile sidebar -->
<div id="myProfile" class="skewt">
<a href="javascript:void(0)" class="closebtn3" id="closebtn4" onclick="changeProfile()">&#10006;</a>
<h2 id="profile-header" style="width:100%;text-align:center;">Terrain Profile Plot</h2>
<div id="profile_div" style="width:90%;margin:3px auto">
<img id="profile_img" />
</div>
<span id="profile-buttons", style="width:100%;text-align:center;visibility:hidden;vertical-align:middle;">
<button id="first-profile" style="margin:3px auto;vertical-align:middle;">First RX</button>
<button id="last-profile" style="margin:3px auto;vertical-align:middle;">Last RX</button>
</span>
<div id="profile-footer" style="text-align:center;">Profile image is Copyright 2025 Michael Kosowsky. All rights reserved.<br>Used with permission. For more information <a href="http://www.heywhatsthat.com/">Click Here</a></div>
</div>

<!-- Wrapper for settings sidebar -->
<div id="mySettings" class="settings">
<a href="javascript:void(0)" class="closebtn2" id="closebt2" onclick="changeSettings()">&#10006;</a>
Expand Down Expand Up @@ -1572,6 +1681,7 @@ <h2 style="display:inline; vertical-align:middle; margin-left: 35px; margin-bott
<i id="myBtn1" onclick="changeSettings()" class="icon-cog" style="font-size:4vh;font-size:calc(var(--vh, 1vh) * 4);"></i>
<a href="." id="myBtn2"><i class="icon-home" style="font-size:4vh;font-size:calc(var(--vh, 1vh) * 4);"></i></a>
<i id="myBtn3" onclick="changeSkewT()" class="icon-chart-line" style="font-size:4vh;font-size:calc(var(--vh, 1vh) * 4);"></i>
<i id="myBtn4" onclick="changeProfile()" class="icon-mountain" style="font-size:3.5vh;font-size:calc(var(--vh, 1vh) * 3.5);"></i>
</div>
</div>
</body>
Expand Down
Loading