allow initial_squelch_level to be set per profile

This commit is contained in:
Jakob Ketterl
2019-11-23 16:56:29 +01:00
parent d5b7338531
commit b27caf2405
3 changed files with 13 additions and 6 deletions

View File

@ -141,9 +141,8 @@ function setSquelchToAuto() {
}
function updateSquelch() {
var sliderValue = parseInt(e("openwebrx-panel-squelch").value);
var outputValue = (sliderValue === parseInt(e("openwebrx-panel-squelch").min)) ? 0 : getLinearSmeterValue(sliderValue);
ws.send(JSON.stringify({"type": "dspcontrol", "params": {"squelch_level": outputValue}}));
var sliderValue = parseInt($("#openwebrx-panel-squelch").val());
ws.send(JSON.stringify({"type": "dspcontrol", "params": {"squelch_level": sliderValue}}));
}
var waterfall_min_level;
@ -1058,6 +1057,9 @@ function on_ws_recv(evt) {
mathbox_waterfall_colors = config['mathbox_waterfall_colors'];
mathbox_waterfall_frequency_resolution = config['mathbox_waterfall_frequency_resolution'];
mathbox_waterfall_history_length = config['mathbox_waterfall_history_length'];
var sql = Number.isInteger(config['initial_squelch_level']) ? config['initial_squelch_level'] : -150;
$("#openwebrx-panel-squelch").val(sql);
updateSquelch();
waterfall_init();
initialize_demodulator();