kopia lustrzana https://github.com/projecthorus/radiosonde_auto_rx
Merge pull request #786 from darksidelemm/testing
Change SDR task list on web interface to block sections.pull/787/head
commit
72c98eda17
|
@ -12,7 +12,7 @@ from queue import Queue
|
|||
# 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.2-beta5"
|
||||
__version__ = "1.6.2-beta6"
|
||||
|
||||
|
||||
# Global Variables
|
||||
|
|
|
@ -60,3 +60,18 @@
|
|||
.icon-cog:before { content: '\e802'; } /* '' */
|
||||
.icon-angle-down:before { content: '\f107'; } /* '' */
|
||||
.icon-history:before { content: '\f1da'; } /* '' */
|
||||
|
||||
|
||||
#task_status {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 2px;
|
||||
}
|
||||
|
||||
.sdrinfo-element {
|
||||
margin: 0px 4px;
|
||||
padding: 4px;
|
||||
|
||||
border: 2px solid rgb(135, 135, 135);
|
||||
border-radius: 1px;
|
||||
}
|
|
@ -10,8 +10,14 @@ function update_task_list(){
|
|||
added_decoders = false;
|
||||
|
||||
for (_task in data){
|
||||
// Append the current task to the task list text.
|
||||
task_info += "SDR #" + _task + ": " + data[_task]["task"] + " ";
|
||||
// Append the current task to the task list.
|
||||
if(_task.includes("SPY")){
|
||||
task_detail = _task + " - "
|
||||
}else{
|
||||
task_detail = "SDR:" + _task + " - "
|
||||
}
|
||||
|
||||
|
||||
if(data[_task]["freq"] > 0.0){
|
||||
$('#stop-frequency-select')
|
||||
.append($("<option></option>")
|
||||
|
@ -19,7 +25,22 @@ function update_task_list(){
|
|||
.text( (parseFloat( data[_task]["freq"] )/1e6).toFixed(3)));
|
||||
|
||||
added_decoders = true;
|
||||
|
||||
task_detail += (parseFloat( data[_task]["freq"] )/1e6).toFixed(3);
|
||||
|
||||
if (data[_task].hasOwnProperty("type")){
|
||||
task_detail += " " + data[_task]["type"];
|
||||
}
|
||||
|
||||
} else {
|
||||
if(data[_task]["task"] == "Scanning"){
|
||||
task_detail += "Scan";
|
||||
} else {
|
||||
task_detail += "Idle";
|
||||
}
|
||||
}
|
||||
|
||||
task_info += "<div class='sdrinfo-element'>" + task_detail + "</div>"
|
||||
}
|
||||
|
||||
if(added_decoders == false){
|
||||
|
@ -30,7 +51,7 @@ function update_task_list(){
|
|||
}
|
||||
|
||||
// Update page with latest task.
|
||||
$('#task_status').text(task_info);
|
||||
$('#task_status').html(task_info);
|
||||
|
||||
setTimeout(resume_web_controls,2000);
|
||||
});
|
||||
|
|
|
@ -1611,7 +1611,7 @@
|
|||
</div>
|
||||
<span style="font-size:2vh;font-size:calc(var(--vh, 1vh) * 2);" id="footertext"></span>
|
||||
<p style="font-size:2vh;font-size:calc(var(--vh, 1vh) * 2);">Station: <span id="station_callsign">???</span></p>
|
||||
<p style="font-size:2vh;font-size:calc(var(--vh, 1vh) * 2);">Current Task: <span id="task_status">???</span></p>
|
||||
<p style="font-size:2vh;font-size:calc(var(--vh, 1vh) * 2);">Tasking: <span id="task_status"></span></p>
|
||||
<div id="tableid">
|
||||
<div id="telem_table"></div>
|
||||
</div>
|
||||
|
|
|
@ -21,6 +21,7 @@ import autorx.scan
|
|||
from autorx.geometry import GenericTrack
|
||||
from autorx.utils import check_autorx_versions
|
||||
from autorx.log_files import list_log_files, read_log_by_serial, zip_log_files
|
||||
from autorx.decode import SondeDecoder
|
||||
from queue import Queue
|
||||
from threading import Thread
|
||||
import flask
|
||||
|
@ -105,6 +106,7 @@ def flask_get_version():
|
|||
def flask_get_task_list():
|
||||
""" Return the current list of active SDRs, and their active task names """
|
||||
|
||||
|
||||
# Read in the task list, index by SDR ID.
|
||||
_task_list = {}
|
||||
for _task in autorx.task_list.keys():
|
||||
|
@ -124,9 +126,16 @@ def flask_get_task_list():
|
|||
"task": "Decoding (%.3f MHz)" % (_task_list[str(_sdr)] / 1e6),
|
||||
"freq": _task_list[str(_sdr)],
|
||||
}
|
||||
|
||||
except:
|
||||
_sdr_list[str(_sdr)] = {"task": "Decoding (?? MHz)", "freq": 0}
|
||||
|
||||
# Try and add on sonde type.
|
||||
try:
|
||||
_sdr_list[str(_sdr)]['type'] = autorx.task_list[_task_list[str(_sdr)]]['task'].sonde_type
|
||||
except:
|
||||
pass
|
||||
|
||||
# Convert the task list to a JSON blob, and return.
|
||||
return json.dumps(_sdr_list)
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue