Tuning step button restores default tuning step now.

This commit is contained in:
Marat Fayzullin 2022-11-20 20:26:24 -05:00
parent a1bd9f4d9b
commit dff515be46
3 changed files with 10 additions and 4 deletions

View File

@ -1354,4 +1354,4 @@ img.openwebrx-mirror-img
.openwebrx-waterfall-container > * { .openwebrx-waterfall-container > * {
flex: 0 0 auto; flex: 0 0 auto;
} }

View File

@ -185,7 +185,7 @@
<svg class="muted" viewBox="0 0 80 80"><use xlink:href="static/gfx/svg-defs.svg#speaker-muted"></use></svg> <svg class="muted" viewBox="0 0 80 80"><use xlink:href="static/gfx/svg-defs.svg#speaker-muted"></use></svg>
</div> </div>
<input title="Volume" id="openwebrx-panel-volume" class="openwebrx-panel-slider" type="range" min="0" max="150" value="50" step="1" onchange="updateVolume()" oninput="updateVolume()"> <input title="Volume" id="openwebrx-panel-volume" class="openwebrx-panel-slider" type="range" min="0" max="150" value="50" step="1" onchange="updateVolume()" oninput="updateVolume()">
<div title="Tuning step" class="openwebrx-button openwebrx-slider-button"> <div title="Tuning step" class="openwebrx-button openwebrx-slider-button" onclick="tuning_step_reset();">
<svg viewBox="0 0 80 80"><use xlink:href="static/gfx/svg-defs.svg#tuning-step"></use></svg> <svg viewBox="0 0 80 80"><use xlink:href="static/gfx/svg-defs.svg#tuning-step"></use></svg>
</div> </div>
<select id="openwebrx-tuning-step-listbox" class="openwebrx-panel-listbox" onchange="tuning_step_changed();"> <select id="openwebrx-tuning-step-listbox" class="openwebrx-panel-listbox" onchange="tuning_step_changed();">

View File

@ -31,6 +31,7 @@ var fft_compression = "none";
var fft_codec; var fft_codec;
var waterfall_setup_done = 0; var waterfall_setup_done = 0;
var secondary_fft_size; var secondary_fft_size;
var tuning_step_default = 1;
var tuning_step = 1; var tuning_step = 1;
var nr_enabled = false; var nr_enabled = false;
var nr_threshold = 0; var nr_threshold = 0;
@ -835,8 +836,8 @@ function on_ws_recv(evt) {
$('#openwebrx-panel-receiver').demodulatorPanel().setTuningPrecision(config['tuning_precision']); $('#openwebrx-panel-receiver').demodulatorPanel().setTuningPrecision(config['tuning_precision']);
if ('tuning_step' in config) { if ('tuning_step' in config) {
tuning_step = config['tuning_step']; tuning_step_default = config['tuning_step'];
$('#openwebrx-tuning-step-listbox').val(tuning_step); tuning_step_reset();
} }
break; break;
@ -1630,6 +1631,11 @@ function tuning_step_changed() {
tuning_step = parseInt($('#openwebrx-tuning-step-listbox').val()); tuning_step = parseInt($('#openwebrx-tuning-step-listbox').val());
} }
function tuning_step_reset() {
$('#openwebrx-tuning-step-listbox').val(tuning_step_default);
tuning_step = tuning_step_default;
}
function nr_changed() { function nr_changed() {
ws.send(JSON.stringify({ ws.send(JSON.stringify({
"type": "connectionproperties", "type": "connectionproperties",