From c99d790b57a5382610ee64d78dfad80fc09460ea Mon Sep 17 00:00:00 2001 From: Marat Fayzullin Date: Mon, 25 Jul 2022 11:33:20 -0400 Subject: [PATCH] Addressing jketterl's review comments. --- htdocs/openwebrx.js | 8 +++++--- owrx/config/defaults.py | 24 ++++++++++++------------ 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/htdocs/openwebrx.js b/htdocs/openwebrx.js index 624382f..0ab60c9 100644 --- a/htdocs/openwebrx.js +++ b/htdocs/openwebrx.js @@ -639,13 +639,13 @@ function canvas_mousewheel(evt) { var relativeX = get_relative_x(evt); var dir = (evt.deltaY / Math.abs(evt.deltaY)) > 0; - // Zoom when mouse button down, tune otherwise + // Tune when mouse button down, zoom otherwise if (canvas_mouse2_down > 0) { - zoom_step(dir, relativeX, zoom_center_where_calc(evt.pageX)); - } else { var f = $('#openwebrx-panel-receiver').demodulatorPanel().getDemodulator().get_offset_frequency(); f += dir? -tuning_step : tuning_step; $('#openwebrx-panel-receiver').demodulatorPanel().getDemodulator().set_offset_frequency(f); + } else { + zoom_step(dir, relativeX, zoom_center_where_calc(evt.pageX)); } evt.preventDefault(); @@ -809,6 +809,8 @@ function on_ws_recv(evt) { if ('tuning_step' in config) tuning_step = config['tuning_step']; + else + tuning_step = 1; break; case "secondary_config": diff --git a/owrx/config/defaults.py b/owrx/config/defaults.py index e155fe9..5e8bc0e 100644 --- a/owrx/config/defaults.py +++ b/owrx/config/defaults.py @@ -33,7 +33,7 @@ defaultConfig = PropertyLayer( samp_rate=2400000, start_freq=439275000, start_mod="nfm", - tuning_step="1000", + tuning_step=1000, ), "2m": PropertyLayer( name="2m", @@ -42,7 +42,7 @@ defaultConfig = PropertyLayer( samp_rate=2048000, start_freq=145725000, start_mod="nfm", - tuning_step="1000", + tuning_step=1000, ), } ), @@ -59,7 +59,7 @@ defaultConfig = PropertyLayer( samp_rate=384000, start_freq=14070000, start_mod="usb", - tuning_step="500", + tuning_step=500, ), "30m": PropertyLayer( name="30m", @@ -67,7 +67,7 @@ defaultConfig = PropertyLayer( samp_rate=192000, start_freq=10142000, start_mod="usb", - tuning_step="500", + tuning_step=500, ), "40m": PropertyLayer( name="40m", @@ -75,7 +75,7 @@ defaultConfig = PropertyLayer( samp_rate=256000, start_freq=7070000, start_mod="lsb", - tuning_step="500", + tuning_step=500, ), "80m": PropertyLayer( name="80m", @@ -83,7 +83,7 @@ defaultConfig = PropertyLayer( samp_rate=384000, start_freq=3570000, start_mod="lsb", - tuning_step="500", + tuning_step=500, ), "49m": PropertyLayer( name="49m Broadcast", @@ -91,7 +91,7 @@ defaultConfig = PropertyLayer( samp_rate=384000, start_freq=6070000, start_mod="am", - tuning_step="1000", + tuning_step=1000, ), } ), @@ -109,7 +109,7 @@ defaultConfig = PropertyLayer( samp_rate=500000, start_freq=14070000, start_mod="usb", - tuning_step="500", + tuning_step=500, ), "30m": PropertyLayer( name="30m", @@ -118,7 +118,7 @@ defaultConfig = PropertyLayer( samp_rate=250000, start_freq=10142000, start_mod="usb", - tuning_step="500", + tuning_step=500, ), "40m": PropertyLayer( name="40m", @@ -127,7 +127,7 @@ defaultConfig = PropertyLayer( samp_rate=500000, start_freq=7070000, start_mod="lsb", - tuning_step="500", + tuning_step=500, ), "80m": PropertyLayer( name="80m", @@ -136,7 +136,7 @@ defaultConfig = PropertyLayer( samp_rate=500000, start_freq=3570000, start_mod="lsb", - tuning_step="500", + tuning_step=500, ), "49m": PropertyLayer( name="49m Broadcast", @@ -145,7 +145,7 @@ defaultConfig = PropertyLayer( samp_rate=500000, start_freq=6070000, start_mod="am", - tuning_step="1000", + tuning_step=1000, ), } ),