This commit is contained in:
Jason Gaunt 2023-03-13 16:21:37 +02:00 committed by GitHub
commit a41c124550
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 3 deletions

View File

@ -73,7 +73,10 @@ var waterfall_min_level_default;
var waterfall_max_level_default; var waterfall_max_level_default;
var waterfall_colors = buildWaterfallColors(['#000', '#FFF']); var waterfall_colors = buildWaterfallColors(['#000', '#FFF']);
var waterfall_auto_levels; var waterfall_auto_levels;
var waterfall_auto_level_default_mode;
var waterfall_auto_min_range; var waterfall_auto_min_range;
var waterfall_measure_minmax_now = false;
var waterfall_measure_minmax_continuous = false;
function buildWaterfallColors(input) { function buildWaterfallColors(input) {
return chroma.scale(input).colors(256, 'rgb') return chroma.scale(input).colors(256, 'rgb')
@ -733,6 +736,12 @@ function on_ws_recv(evt) {
waterfall_auto_levels = config['waterfall_auto_levels']; waterfall_auto_levels = config['waterfall_auto_levels'];
if ('waterfall_auto_min_range' in config) if ('waterfall_auto_min_range' in config)
waterfall_auto_min_range = config['waterfall_auto_min_range']; waterfall_auto_min_range = config['waterfall_auto_min_range'];
if ('waterfall_auto_level_default_mode' in config)
waterfall_measure_minmax_continuous = waterfall_auto_level_default_mode = config['waterfall_auto_level_default_mode'];
var waterfallAutoButton = $('#openwebrx-waterfall-colors-auto');
waterfallAutoButton[waterfall_measure_minmax_continuous ? 'addClass' : 'removeClass']('highlighted');
$('#openwebrx-waterfall-color-min, #openwebrx-waterfall-color-max').prop('disabled', waterfall_measure_minmax_continuous);
waterfallColorsDefault(); waterfallColorsDefault();
var initial_demodulator_params = {}; var initial_demodulator_params = {};
@ -939,9 +948,6 @@ function on_ws_recv(evt) {
} }
} }
var waterfall_measure_minmax_now = false;
var waterfall_measure_minmax_continuous = false;
function waterfall_measure_minmax_do(what) { function waterfall_measure_minmax_do(what) {
// Get visible range // Get visible range
var range = get_visible_freq_range(); var range = get_visible_freq_range();

View File

@ -142,6 +142,7 @@ defaultConfig = PropertyLayer(
waterfall_scheme="GoogleTurboWaterfall", waterfall_scheme="GoogleTurboWaterfall",
waterfall_levels=PropertyLayer(min=-88, max=-20), waterfall_levels=PropertyLayer(min=-88, max=-20),
waterfall_auto_levels=PropertyLayer(min=3, max=10), waterfall_auto_levels=PropertyLayer(min=3, max=10),
waterfall_auto_level_default_mode=False,
waterfall_auto_min_range=50, waterfall_auto_min_range=50,
tuning_precision=2, tuning_precision=2,
squelch_auto_margin=10, squelch_auto_margin=10,

View File

@ -130,6 +130,7 @@ class OpenWebRxReceiverClient(OpenWebRxClient, SdrSourceEventClient):
"waterfall_scheme", "waterfall_scheme",
"waterfall_colors", "waterfall_colors",
"waterfall_auto_levels", "waterfall_auto_levels",
"waterfall_auto_level_default_mode",
"waterfall_auto_min_range", "waterfall_auto_min_range",
"fft_size", "fft_size",
"audio_compression", "audio_compression",

View File

@ -2,6 +2,7 @@ from owrx.controllers.settings import SettingsFormController
from owrx.form.section import Section from owrx.form.section import Section
from owrx.config.core import CoreConfig from owrx.config.core import CoreConfig
from owrx.form.input import ( from owrx.form.input import (
CheckboxInput,
TextInput, TextInput,
NumberInput, NumberInput,
FloatInput, FloatInput,
@ -117,6 +118,11 @@ class GeneralSettingsController(SettingsFormController):
infotext="Specifies the upper and lower dynamic headroom that should be added when automatically " infotext="Specifies the upper and lower dynamic headroom that should be added when automatically "
+ "adjusting waterfall colors", + "adjusting waterfall colors",
), ),
CheckboxInput(
"waterfall_auto_level_default_mode",
'Automatically adjust waterfall level by default',
infotext="Enable this to automatically enable auto adjusting waterfall levels on page load."
),
NumberInput( NumberInput(
"waterfall_auto_min_range", "waterfall_auto_min_range",
"Automatic adjustment minimum range", "Automatic adjustment minimum range",