fix demodulator buttons

This commit is contained in:
Jakob Ketterl 2019-05-14 23:36:37 +02:00
parent 9812d38eee
commit 5e67f036b4
1 changed files with 21 additions and 23 deletions

View File

@ -2526,29 +2526,27 @@ function progressbar_set(obj,val,text,over)
function demodulator_buttons_update() function demodulator_buttons_update()
{ {
$(".openwebrx-demodulator-button").removeClass("highlighted"); $(".openwebrx-demodulator-button").removeClass("highlighted");
if(secondary_demod) $("#openwebrx-button-dig").addClass("highlighted"); if(secondary_demod) {
else switch(demodulators[0].subtype) $("#openwebrx-button-dig").addClass("highlighted");
{ } else switch(demodulators[0].subtype) {
case "nfm": case "lsb":
$("#openwebrx-button-nfm").addClass("highlighted"); case "usb":
break; case "cw":
case "am": if(demodulators[0].high_cut-demodulators[0].low_cut<300)
$("#openwebrx-button-am").addClass("highlighted"); $("#openwebrx-button-cw").addClass("highlighted");
break; else
case "lsb": {
case "usb": if(demodulators[0].high_cut<0)
case "cw": $("#openwebrx-button-lsb").addClass("highlighted");
if(demodulators[0].high_cut-demodulators[0].low_cut<300) else if(demodulators[0].low_cut>0)
$("#openwebrx-button-cw").addClass("highlighted"); $("#openwebrx-button-usb").addClass("highlighted");
else else $("#openwebrx-button-lsb, #openwebrx-button-usb").addClass("highlighted");
{ }
if(demodulators[0].high_cut<0) break;
$("#openwebrx-button-lsb").addClass("highlighted"); default:
else if(demodulators[0].low_cut>0) var mod = demodulators[0].subtype;
$("#openwebrx-button-usb").addClass("highlighted"); $("#openwebrx-button-" + mod).addClass("highlighted");
else $("#openwebrx-button-lsb, #openwebrx-button-usb").addClass("highlighted"); break;
}
break;
} }
} }
function demodulator_analog_replace_last() { demodulator_analog_replace(last_analog_demodulator_subtype); } function demodulator_analog_replace_last() { demodulator_analog_replace(last_analog_demodulator_subtype); }