Skip to content

Commit

Permalink
Stopping scanner when a frequency is clicked.
Browse files Browse the repository at this point in the history
  • Loading branch information
luarvique committed May 13, 2023
1 parent 64f539c commit 8de64d1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion htdocs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@
</select>
</div>
<div class="openwebrx-panel-line">
<div title="Auto-set squelch level" class="openwebrx-squelch-auto openwebrx-button openwebrx-slider-button">
<div title="Auto-set squelch level (right-click for scanner)" class="openwebrx-squelch-auto openwebrx-button openwebrx-slider-button">
<svg viewBox="0 0 80 80"><use xlink:href="static/gfx/svg-defs.svg#squelch"></use></svg>
</div>
<input title="Squelch" class="openwebrx-squelch-slider openwebrx-panel-slider" type="range" min="-150" max="0" value="-150" step="1">
Expand Down
1 change: 1 addition & 0 deletions htdocs/lib/BookmarkBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ function BookmarkBar() {
me.getDemodulatorPanel().setMode(b.modulation, b.underlying);
}
$bookmark.addClass('selected');
stopScanner();
});

me.$container.on('click', '.action[data-action=edit]', function(e){
Expand Down
12 changes: 8 additions & 4 deletions htdocs/openwebrx.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ function zoomOutTotal() {
function tuneBySteps(steps) {
steps = Math.round(steps);
if (steps != 0) {
var f = $('#openwebrx-panel-receiver').demodulatorPanel().getDemodulator().get_offset_frequency();
f += steps * tuning_step;
$('#openwebrx-panel-receiver').demodulatorPanel().getDemodulator().set_offset_frequency(f);
var demodulator = $('#openwebrx-panel-receiver').demodulatorPanel().getDemodulator();
var f = demodulator.get_offset_frequency();
demodulator.set_offset_frequency(f + steps * tuning_step);
}
}

Expand Down Expand Up @@ -400,7 +400,10 @@ function scale_canvas_end_drag(x) {
var event_handled = false;
var demodulators = getDemodulators();
for (var i = 0; i < demodulators.length; i++) event_handled |= demodulators[i].envelope.drag_end();
if (!event_handled) demodulators[0].set_offset_frequency(scale_offset_freq_from_px(x));
if (!event_handled) {
demodulators[0].set_offset_frequency(scale_offset_freq_from_px(x));
stopScanner();
}
}

function scale_canvas_mouseup(evt) {
Expand Down Expand Up @@ -858,6 +861,7 @@ function canvas_mouseup(evt) {
f = f - 800;
}
demodulator.set_offset_frequency(f);
stopScanner();
}
else {
canvas_end_drag();
Expand Down

0 comments on commit 8de64d1

Please sign in to comment.