make auto squelch level margin configurable
This commit is contained in:
@ -168,7 +168,7 @@
|
||||
<input title="Waterfall minimum level" id="openwebrx-waterfall-color-min" class="openwebrx-panel-slider" type="range" min="-200" max="100" value="50" step="1" onchange="updateWaterfallColors(0);" oninput="updateVolume()">
|
||||
</div>
|
||||
<div class="openwebrx-panel-line">
|
||||
<div title="Auto-set squelch level" class="openwebrx-squelch-default openwebrx-button"><span class="sprite sprite-squelch openwebrx-sliderbtn-img"></span></div>
|
||||
<div title="Auto-set squelch level" class="openwebrx-squelch-auto openwebrx-button"><span class="sprite sprite-squelch openwebrx-sliderbtn-img"></span></div>
|
||||
<input title="Squelch" class="openwebrx-squelch-slider openwebrx-panel-slider" type="range" min="-150" max="0" value="-150" step="1">
|
||||
<div title="Set waterfall colors to default" id="openwebrx-waterfall-colors-default" class="openwebrx-button" onclick="waterfallColorsDefault()"><span class="sprite sprite-waterfall-default openwebrx-sliderbtn-img"></span></div>
|
||||
<input title="Waterfall maximum level" id="openwebrx-waterfall-color-max" class="openwebrx-panel-slider" type="range" min="-200" max="100" value="50" step="1" onchange="updateWaterfallColors(1);" oninput="updateVolume()">
|
||||
|
@ -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));
|
||||
|
@ -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();
|
||||
|
Reference in New Issue
Block a user