sdr profile selection frontend

This commit is contained in:
Jakob Ketterl
2019-05-10 16:14:16 +02:00
parent 1cf4a879f7
commit 7427fa3608
6 changed files with 118 additions and 23 deletions

View File

@ -1208,6 +1208,12 @@ function on_ws_recv(evt)
var server_cpu_usage = json.value;
progressbar_set(e("openwebrx-bar-server-cpu"),server_cpu_usage/100,"Server CPU [" + server_cpu_usage + "%]",server_cpu_usage>85);
break;
case "profiles":
var listbox = e("openwebrx-sdr-profiles-listbox");
listbox.innerHTML = json.value.map(function(profile){
return '<option value="' + profile.id + '">' + profile.name + "</option>";
}).join("");
break;
default:
console.warn('received message of unknown type: ' + json.type);
}
@ -2749,3 +2755,8 @@ function secondary_demod_waterfall_set_zoom(low_cut, high_cut)
secondary_demod_canvases.map((x)=>{$(x).css("left",secondary_demod_canvas_left+"px").css("width",secondary_demod_canvas_width+"px");});
secondary_demod_update_channel_freq_from_event();
}
function sdr_profile_changed() {
value = $('#openwebrx-sdr-profiles-listbox').val();
ws.send(JSON.stringify({ type:"selectprofile", params:{ profile:value }}));
}