diff --git a/config_webrx.py b/config_webrx.py
index e3a6fda..1e3e3cf 100644
--- a/config_webrx.py
+++ b/config_webrx.py
@@ -149,15 +149,25 @@ iq_server_port = 4951 #TCP port for ncat to listen on. It will send I/Q data ove
# ==== Color themes ====
#A guide is available to help you set these values: https://github.com/simonyiszk/openwebrx/wiki/Calibrating-waterfall-display-levels
+
### default theme by teejez:
waterfall_colors = "[0x000000ff,0x0000ffff,0x00ffffff,0x00ff00ff,0xffff00ff,0xff0000ff,0xff00ffff,0xffffffff]"
waterfall_min_level = -88 #in dB
waterfall_max_level = -20
+waterfall_auto_level_margin = (5, 40)
### old theme by HA7ILM:
#waterfall_colors = "[0x000000ff,0x2e6893ff, 0x69a5d0ff, 0x214b69ff, 0x9dc4e0ff, 0xfff775ff, 0xff8a8aff, 0xb20000ff]"
#waterfall_min_level = -115 #in dB
#waterfall_max_level = 0
+#waterfall_auto_level_margin = (20, 30)
+#Note: When the auto waterfall level button is clicked, the following happens:
+# [waterfall_min_level] = [current_min_power_level] - [waterfall_auto_level_margin[0]]
+# [waterfall_max_level] = [current_max_power_level] + [waterfall_auto_level_margin[1]]
+#
+# ___|____________________________________|____________________________________|____________________________________|___> signal power
+# \_waterfall_auto_level_margin[0]_/ |__ current_min_power_level | \_waterfall_auto_level_margin[1]_/
+# current_max_power_level __|
# ==== Experimental settings ===
#Warning! These are very experimental.
diff --git a/htdocs/index.wrx b/htdocs/index.wrx
index 2debd54..0647210 100644
--- a/htdocs/index.wrx
+++ b/htdocs/index.wrx
@@ -33,6 +33,7 @@
var waterfall_colors=%[WATERFALL_COLORS];
var waterfall_min_level_default=%[WATERFALL_MIN_LEVEL];
var waterfall_max_level_default=%[WATERFALL_MAX_LEVEL];
+ var waterfall_auto_level_margin=%[WATERFALL_AUTO_LEVEL_MARGIN];
diff --git a/htdocs/openwebrx.js b/htdocs/openwebrx.js
index fd4833a..9febe02 100644
--- a/htdocs/openwebrx.js
+++ b/htdocs/openwebrx.js
@@ -183,8 +183,8 @@ function waterfallColorsDefault()
function waterfallColorsAuto()
{
- e("openwebrx-waterfall-color-min").value=(waterfall_measure_minmax_min-20).toString();
- e("openwebrx-waterfall-color-max").value=(waterfall_measure_minmax_max+30).toString();
+ e("openwebrx-waterfall-color-min").value=(waterfall_measure_minmax_min-waterfall_auto_level_margin[0]).toString();
+ e("openwebrx-waterfall-color-max").value=(waterfall_measure_minmax_max+waterfall_auto_level_margin[1]).toString();
updateWaterfallColors(0);
}
diff --git a/openwebrx.py b/openwebrx.py
index 5612d46..5640a8a 100755
--- a/openwebrx.py
+++ b/openwebrx.py
@@ -632,7 +632,8 @@ class WebRXHandler(BaseHTTPRequestHandler):
("%[START_MOD]",cfg.start_mod),
("%[WATERFALL_COLORS]",cfg.waterfall_colors),
("%[WATERFALL_MIN_LEVEL]",str(cfg.waterfall_min_level)),
- ("%[WATERFALL_MAX_LEVEL]",str(cfg.waterfall_max_level))
+ ("%[WATERFALL_MAX_LEVEL]",str(cfg.waterfall_max_level)),
+ ("%[WATERFALL_AUTO_LEVEL_MARGIN]","[%d,%d]"%cfg.waterfall_auto_level_margin)
)
for rule in replace_dictionary:
while data.find(rule[0])!=-1: