allow frequency display precision to be set via configuration

This commit is contained in:
Jakob Ketterl
2020-12-10 20:58:07 +01:00
parent 05096c2a16
commit 23080dbe22
5 changed files with 31 additions and 4 deletions

View File

@ -11,6 +11,8 @@ function DemodulatorPanel(el) {
self.getDemodulator().set_offset_frequency(freq - self.center_freq);
});
this.mouseFrequencyDisplay = el.find('.webrx-mouse-freq').frequencyDisplay();
Modes.registerModePanel(this);
el.on('click', '.openwebrx-demodulator-button', function() {
var modulation = $(this).data('modulation');
@ -332,6 +334,15 @@ DemodulatorPanel.prototype.getSquelchMargin = function() {
return this.squelchMargin;
};
DemodulatorPanel.prototype.setMouseFrequency = function(freq) {
this.mouseFrequencyDisplay.setFrequency(freq);
};
DemodulatorPanel.prototype.setFrequencyPrecision = function(precision) {
this.tuneableFrequencyDisplay.setFrequencyPrecision(precision);
this.mouseFrequencyDisplay.setFrequencyPrecision(precision);
};
$.fn.demodulatorPanel = function(){
if (!this.data('panel')) {
this.data('panel', new DemodulatorPanel(this));