diff --git a/csdr/chain/dablin.py b/csdr/chain/dablin.py index 1e1c5667..0effa6f9 100644 --- a/csdr/chain/dablin.py +++ b/csdr/chain/dablin.py @@ -23,23 +23,25 @@ class MetaProcessor(PickleModule): def process(self, data): result = {} - if "coarse_frequency_shift" in data: - value = int(data["coarse_frequency_shift"]) - if value > 0: - self.shift += random() * self.coarse_increment - else: - self.shift -= random() * self.coarse_increment - logger.debug("coarse adjustment - new shift: %f", self.shift) - self.shifter.setRate(self.shift) - if "fine_frequency_shift" in data: - value = float(data["fine_frequency_shift"]) - if abs(value) > 10: - self.shift += self.fine_increment * value - logger.debug("ffs: %f", value) - logger.debug("fine adjustment - new shift: %f", self.shift) + for key, value in data.items(): + if key == "coarse_frequency_shift": + value = int(value) + if value > 0: + self.shift += random() * self.coarse_increment + else: + self.shift -= random() * self.coarse_increment + logger.debug("coarse adjustment - new shift: %f", self.shift) self.shifter.setRate(self.shift) - if "programmes" in data: - result["programmes"] = data["programmes"] + elif key == "fine_frequency_shift": + value = float(value) + if abs(value) > 10: + self.shift += self.fine_increment * value + logger.debug("ffs: %f", value) + logger.debug("fine adjustment - new shift: %f", self.shift) + self.shifter.setRate(self.shift) + else: + # pass through everything else + result[key] = value # don't send out data if there was nothing interesting for the client if not result: return diff --git a/htdocs/css/openwebrx.css b/htdocs/css/openwebrx.css index b327dd21..38a06464 100644 --- a/htdocs/css/openwebrx.css +++ b/htdocs/css/openwebrx.css @@ -1389,6 +1389,10 @@ img.openwebrx-mirror-img width: 100%; } +.dab-container > * { + margin: 2px 0; +} + .dab-container label { display: block; margin: 5px 0; @@ -1397,4 +1401,12 @@ img.openwebrx-mirror-img .dab-container select#dab-service-id { width: 100%; padding: 3px; +} + +.dab-container .dab-ensemble-id:not(:empty):before { + content: "Ensemble ID: "; +} + +.dab-container .dab-ensemble-label:not(:empty):before { + content: "Ensemble: "; } \ No newline at end of file diff --git a/htdocs/lib/MetaPanel.js b/htdocs/lib/MetaPanel.js index 68729cd9..7acc4b42 100644 --- a/htdocs/lib/MetaPanel.js +++ b/htdocs/lib/MetaPanel.js @@ -562,6 +562,8 @@ function DabMetaPanel(el) { }); var $container = $( '
' + + '
' + + '
' + '' + '
' ); @@ -580,6 +582,14 @@ DabMetaPanel.prototype.isSupported = function(data) { DabMetaPanel.prototype.update = function(data) { if (!this.isSupported(data)) return; + if ('ensemble_id' in data) { + $(this.el).find('.dab-ensemble-id').text('0x' + parseInt(data.ensemble_id).toString(16)); + } + + if ('ensemble_label' in data) { + $(this.el).find('.dab-ensemble-label').text(data.ensemble_label); + } + if ('programmes' in data) { var options = Object.entries(data.programmes).map(function(e) { return ''; @@ -593,6 +603,7 @@ DabMetaPanel.prototype.update = function(data) { DabMetaPanel.prototype.clear = function() { this.service_id = 0; + $(this.el).find('.dab-auto-clear').empty(); this.$select.empty(); }