Addressing jketterl's review comments.

This commit is contained in:
Marat Fayzullin 2022-07-25 11:33:20 -04:00
parent 29fc75dacc
commit c99d790b57
2 changed files with 17 additions and 15 deletions

View File

@ -639,13 +639,13 @@ function canvas_mousewheel(evt) {
var relativeX = get_relative_x(evt); var relativeX = get_relative_x(evt);
var dir = (evt.deltaY / Math.abs(evt.deltaY)) > 0; 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) { 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(); var f = $('#openwebrx-panel-receiver').demodulatorPanel().getDemodulator().get_offset_frequency();
f += dir? -tuning_step : tuning_step; f += dir? -tuning_step : tuning_step;
$('#openwebrx-panel-receiver').demodulatorPanel().getDemodulator().set_offset_frequency(f); $('#openwebrx-panel-receiver').demodulatorPanel().getDemodulator().set_offset_frequency(f);
} else {
zoom_step(dir, relativeX, zoom_center_where_calc(evt.pageX));
} }
evt.preventDefault(); evt.preventDefault();
@ -809,6 +809,8 @@ function on_ws_recv(evt) {
if ('tuning_step' in config) if ('tuning_step' in config)
tuning_step = config['tuning_step']; tuning_step = config['tuning_step'];
else
tuning_step = 1;
break; break;
case "secondary_config": case "secondary_config":

View File

@ -33,7 +33,7 @@ defaultConfig = PropertyLayer(
samp_rate=2400000, samp_rate=2400000,
start_freq=439275000, start_freq=439275000,
start_mod="nfm", start_mod="nfm",
tuning_step="1000", tuning_step=1000,
), ),
"2m": PropertyLayer( "2m": PropertyLayer(
name="2m", name="2m",
@ -42,7 +42,7 @@ defaultConfig = PropertyLayer(
samp_rate=2048000, samp_rate=2048000,
start_freq=145725000, start_freq=145725000,
start_mod="nfm", start_mod="nfm",
tuning_step="1000", tuning_step=1000,
), ),
} }
), ),
@ -59,7 +59,7 @@ defaultConfig = PropertyLayer(
samp_rate=384000, samp_rate=384000,
start_freq=14070000, start_freq=14070000,
start_mod="usb", start_mod="usb",
tuning_step="500", tuning_step=500,
), ),
"30m": PropertyLayer( "30m": PropertyLayer(
name="30m", name="30m",
@ -67,7 +67,7 @@ defaultConfig = PropertyLayer(
samp_rate=192000, samp_rate=192000,
start_freq=10142000, start_freq=10142000,
start_mod="usb", start_mod="usb",
tuning_step="500", tuning_step=500,
), ),
"40m": PropertyLayer( "40m": PropertyLayer(
name="40m", name="40m",
@ -75,7 +75,7 @@ defaultConfig = PropertyLayer(
samp_rate=256000, samp_rate=256000,
start_freq=7070000, start_freq=7070000,
start_mod="lsb", start_mod="lsb",
tuning_step="500", tuning_step=500,
), ),
"80m": PropertyLayer( "80m": PropertyLayer(
name="80m", name="80m",
@ -83,7 +83,7 @@ defaultConfig = PropertyLayer(
samp_rate=384000, samp_rate=384000,
start_freq=3570000, start_freq=3570000,
start_mod="lsb", start_mod="lsb",
tuning_step="500", tuning_step=500,
), ),
"49m": PropertyLayer( "49m": PropertyLayer(
name="49m Broadcast", name="49m Broadcast",
@ -91,7 +91,7 @@ defaultConfig = PropertyLayer(
samp_rate=384000, samp_rate=384000,
start_freq=6070000, start_freq=6070000,
start_mod="am", start_mod="am",
tuning_step="1000", tuning_step=1000,
), ),
} }
), ),
@ -109,7 +109,7 @@ defaultConfig = PropertyLayer(
samp_rate=500000, samp_rate=500000,
start_freq=14070000, start_freq=14070000,
start_mod="usb", start_mod="usb",
tuning_step="500", tuning_step=500,
), ),
"30m": PropertyLayer( "30m": PropertyLayer(
name="30m", name="30m",
@ -118,7 +118,7 @@ defaultConfig = PropertyLayer(
samp_rate=250000, samp_rate=250000,
start_freq=10142000, start_freq=10142000,
start_mod="usb", start_mod="usb",
tuning_step="500", tuning_step=500,
), ),
"40m": PropertyLayer( "40m": PropertyLayer(
name="40m", name="40m",
@ -127,7 +127,7 @@ defaultConfig = PropertyLayer(
samp_rate=500000, samp_rate=500000,
start_freq=7070000, start_freq=7070000,
start_mod="lsb", start_mod="lsb",
tuning_step="500", tuning_step=500,
), ),
"80m": PropertyLayer( "80m": PropertyLayer(
name="80m", name="80m",
@ -136,7 +136,7 @@ defaultConfig = PropertyLayer(
samp_rate=500000, samp_rate=500000,
start_freq=3570000, start_freq=3570000,
start_mod="lsb", start_mod="lsb",
tuning_step="500", tuning_step=500,
), ),
"49m": PropertyLayer( "49m": PropertyLayer(
name="49m Broadcast", name="49m Broadcast",
@ -145,7 +145,7 @@ defaultConfig = PropertyLayer(
samp_rate=500000, samp_rate=500000,
start_freq=6070000, start_freq=6070000,
start_mod="am", start_mod="am",
tuning_step="1000", tuning_step=1000,
), ),
} }
), ),