Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.6.1 Release #764

Merged
merged 15 commits into from
Apr 1, 2023
Merged
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 auto_rx/autorx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.6.0"
__version__ = "1.6.1"


# Global Variables
Expand Down
5 changes: 4 additions & 1 deletion auto_rx/autorx/log_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def log_filename_to_stats(filename, quicklook=False):
_output["max_range"] = int(max(_output["first"]["range_km"],_output["last"]["range_km"]))
_output["last_range"] = int(_output["last"]["range_km"])
_output["min_height"] = int(_output["last"]["alt"])
_output["freq"] = _quick["first"]["freq"]
except Exception as e:
logging.error(f"Could not quicklook file {filename}: {str(e)}")

Expand Down Expand Up @@ -132,6 +133,7 @@ def log_quick_look(filename):
_first_lat = float(_fields[3])
_first_lon = float(_fields[4])
_first_alt = float(_fields[5])
_first_freq = float(_fields[13])
_pos_info = position_info(
(
autorx.config.global_config["station_lat"],
Expand All @@ -148,6 +150,7 @@ def log_quick_look(filename):
"range_km": _pos_info["straight_distance"] / 1000.0,
"bearing": _pos_info["bearing"],
"elevation": _pos_info["elevation"],
"freq": _first_freq,
}
except Exception as e:
# Couldn't read the first line, so likely no data.
Expand Down Expand Up @@ -417,7 +420,7 @@ def calculate_skewt_data(

_temp = temperature[i]

if humidity[i] >= 0.0:
if humidity[i] > 0.0:
_rh = humidity[i]

_dp = (
Expand Down
38 changes: 36 additions & 2 deletions auto_rx/autorx/static/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,23 @@ a {
flex-direction: column;
}

.skewt {
height: 100%;
width: 0;
position: fixed;
z-index: 1;
top: 0;
right: 0;
background-color: #111;
overflow: hidden;
transition: 0.5s;
padding-top: 20px;
text-align: centre;
flex: auto;
display: flex;
flex-direction: column;
}

.settings form {
margin-left: 35px;
color: white;
Expand Down Expand Up @@ -243,20 +260,37 @@ table {
color: white;
}

#myBtn {
.skewt .closebtn3 {
position: absolute;
top: 6px;
left: 16px;
font-size: 36px;
text-decoration: none;
color: black;
}

#myBtn1 {
cursor: pointer;
position: absolute;
right: 16px;
}

#historyBtn {
#myBtn2 {
cursor: pointer;
position: absolute;
right: 6vh;
right: calc(4vh + 24px);
color: white;
}

#myBtn3 {
cursor: pointer;
position: absolute;
right: 6vh;
right: calc(8vh + 36px);
color: white;
}

.switch {
position: relative;
display: inline-block;
Expand Down
42 changes: 42 additions & 0 deletions auto_rx/autorx/static/js/scan_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ var scan_chart_spectra;
var scan_chart_peaks;
var scan_chart_threshold;
var scan_chart_obj;
var scan_chart_latest_timestamp;
var scan_chart_last_drawn = "none";

function setup_scan_chart(){
scan_chart_spectra = {
Expand Down Expand Up @@ -64,4 +66,44 @@ function setup_scan_chart(){
},
point:{r:10}
});
}

function redraw_scan_chart(){
// Plot the updated data.
if(scan_chart_last_drawn === scan_chart_latest_timestamp){
// No need to re-draw.
//console.log("No need to re-draw.");
return;
}
scan_chart_obj.load(scan_chart_spectra);
scan_chart_obj.load(scan_chart_peaks);
scan_chart_obj.load(scan_chart_threshold);

scan_chart_last_drawn = scan_chart_latest_timestamp;

//console.log("Scan plot redraw - " + scan_chart_latest_timestamp);

// Run dark mode check again to solve render issues.
var z = getCookie('dark');
if (z == 'true') {
changeTheme(true);
} else if (z == 'false') {
changeTheme(false);
} else if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
changeTheme(true);
} else {
changeTheme(false);
}

// Show the latest scan time.
if (getCookie('UTC') == 'false') {
temp_date = scan_chart_latest_timestamp;
temp_date = temp_date.slice(0, -3);
temp_date += "Z";
var date = new Date(temp_date);
var date_converted = date.toLocaleString(window.navigator.language,{hourCycle:'h23', year:"numeric", month:"2-digit", day:'2-digit', hour:'2-digit',minute:'2-digit', second:'2-digit'});
$('#scan_results').html('<b>Latest Scan:</b> ' + date_converted);
} else {
$('#scan_results').html('<b>Latest Scan:</b> ' + (scan_chart_latest_timestamp.slice(0, -3) + 'Z').replace("T", " ").replace("Z", "").slice(0, -4) + ' UTC');
}
}
3 changes: 2 additions & 1 deletion auto_rx/autorx/static/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,5 @@ function calculate_lookangles(a, b) {
'range': distance,
'bearing': str_bearing
};
}
}

Loading