From 504c256b3ec99d52bf266d1426f91b607334afb7 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Thu, 12 Nov 2020 18:00:24 +0100 Subject: [PATCH] make auto squelch level margin configurable --- CHANGELOG.md | 1 + config_webrx.py | 5 +++++ debian/changelog | 2 ++ htdocs/index.html | 2 +- htdocs/lib/DemodulatorPanel.js | 16 +++++++++++++--- htdocs/openwebrx.js | 1 + owrx/connection.py | 1 + 7 files changed, 24 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab3230e..af01871 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ **unreleased** +- Introduced `squelch_auto_margin` config option that allows configuring the auto squelch level **0.20.0** - Added the ability to sign multiple keys in a single request, thus enabling multiple users to claim a single receiver diff --git a/config_webrx.py b/config_webrx.py index 6e0765f..a95de0d 100644 --- a/config_webrx.py +++ b/config_webrx.py @@ -279,6 +279,11 @@ waterfall_auto_level_margin = {"min": 3, "max": 10, "min_range": 50} # \_waterfall_auto_level_margin["min"]_/ |__ current_min_power_level | \_waterfall_auto_level_margin["max"]_/ # current_max_power_level __| +# This setting tells the auto-squelch the offset to add to the current signal level to use as the new squelch level. +# Lowering this setting will give you a more sensitive squelch, but it may also cause unwanted squelch openings when +# using the auto squelch. +squelch_auto_margin = 10 # in dB + # === Experimental settings === # Warning! The settings below are very experimental. csdr_dynamic_bufsize = False # This allows you to change the buffering mode of csdr. diff --git a/debian/changelog b/debian/changelog index fae1aca..7357723 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,6 @@ openwebrx (0.21.0) UNRELEASED; urgency=low + * Introduced `squelch_auto_margin` config option that allows configuring the + auto squelch level -- Jakob Ketterl Sun, 11 Oct 2020 21:12:00 +0000 diff --git a/htdocs/index.html b/htdocs/index.html index ed05093..6aaff14 100644 --- a/htdocs/index.html +++ b/htdocs/index.html @@ -168,7 +168,7 @@
-
+
diff --git a/htdocs/lib/DemodulatorPanel.js b/htdocs/lib/DemodulatorPanel.js index 43613d0..2a770bb 100644 --- a/htdocs/lib/DemodulatorPanel.js +++ b/htdocs/lib/DemodulatorPanel.js @@ -3,6 +3,7 @@ function DemodulatorPanel(el) { self.el = el; self.demodulator = null; self.mode = null; + self.squelchMargin = 10; var displayEl = el.find('.webrx-actual-freq') this.tuneableFrequencyDisplay = displayEl.tuneableFrequencyDisplay(); @@ -27,9 +28,9 @@ function DemodulatorPanel(el) { self.setMode(value); } }); - el.on('click', '.openwebrx-squelch-default', function() { + el.on('click', '.openwebrx-squelch-auto', function() { if (!self.squelchAvailable()) return; - el.find('.openwebrx-squelch-slider').val(getLogSmeterValue(smeter_level) + 10); + el.find('.openwebrx-squelch-slider').val(getLogSmeterValue(smeter_level) + self.getSquelchMargin()); self.updateSquelch(); }); el.on('change', '.openwebrx-squelch-slider', function() { @@ -247,7 +248,7 @@ DemodulatorPanel.prototype.updateButtons = function() { } var squelch_disabled = !this.squelchAvailable(); this.el.find('.openwebrx-squelch-slider').prop('disabled', squelch_disabled); - this.el.find('.openwebrx-squelch-default')[squelch_disabled ? 'addClass' : 'removeClass']('disabled'); + this.el.find('.openwebrx-squelch-auto')[squelch_disabled ? 'addClass' : 'removeClass']('disabled'); } DemodulatorPanel.prototype.setCenterFrequency = function(center_freq) { @@ -322,6 +323,15 @@ DemodulatorPanel.prototype.updateSquelch = function() { if (demod) demod.setSquelch(sliderValue); }; +DemodulatorPanel.prototype.setSquelchMargin = function(margin) { + if (!margin || this.squelchMargin == margin) return; + this.squelchMargin = margin; +}; + +DemodulatorPanel.prototype.getSquelchMargin = function() { + return this.squelchMargin; +}; + $.fn.demodulatorPanel = function(){ if (!this.data('panel')) { this.data('panel', new DemodulatorPanel(this)); diff --git a/htdocs/openwebrx.js b/htdocs/openwebrx.js index c5d094f..af88f2f 100644 --- a/htdocs/openwebrx.js +++ b/htdocs/openwebrx.js @@ -726,6 +726,7 @@ function on_ws_recv(evt) { var demodulatorPanel = $('#openwebrx-panel-receiver').demodulatorPanel(); demodulatorPanel.setCenterFrequency(center_freq); demodulatorPanel.setInitialParams(initial_demodulator_params); + demodulatorPanel.setSquelchMargin(config['squelch_auto_margin']); bookmarks.loadLocalBookmarks(); waterfall_clear(); diff --git a/owrx/connection.py b/owrx/connection.py index ddc6fa9..9ff4201 100644 --- a/owrx/connection.py +++ b/owrx/connection.py @@ -123,6 +123,7 @@ class OpenWebRxReceiverClient(OpenWebRxClient, SdrSourceEventClient): "center_freq", "initial_squelch_level", "profile_id", + "squelch_auto_margin", ] def __init__(self, conn):