mirror of
https://github.com/jketterl/openwebrx.git
synced 2025-12-06 07:12:09 +01:00
display ensemble info
This commit is contained in:
parent
cf60932ed0
commit
87afa13b46
|
|
@ -23,23 +23,25 @@ class MetaProcessor(PickleModule):
|
|||
|
||||
def process(self, data):
|
||||
result = {}
|
||||
if "coarse_frequency_shift" in data:
|
||||
value = int(data["coarse_frequency_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 "fine_frequency_shift" in data:
|
||||
value = float(data["fine_frequency_shift"])
|
||||
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)
|
||||
if "programmes" in data:
|
||||
result["programmes"] = data["programmes"]
|
||||
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
|
||||
|
|
|
|||
|
|
@ -1389,6 +1389,10 @@ img.openwebrx-mirror-img
|
|||
width: 100%;
|
||||
}
|
||||
|
||||
.dab-container > * {
|
||||
margin: 2px 0;
|
||||
}
|
||||
|
||||
.dab-container label {
|
||||
display: block;
|
||||
margin: 5px 0;
|
||||
|
|
@ -1398,3 +1402,11 @@ img.openwebrx-mirror-img
|
|||
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: ";
|
||||
}
|
||||
|
|
@ -562,6 +562,8 @@ function DabMetaPanel(el) {
|
|||
});
|
||||
var $container = $(
|
||||
'<div class="dab-container">' +
|
||||
'<div class="dab-auto-clear dab-ensemble-id"></div>' +
|
||||
'<div class="dab-auto-clear dab-ensemble-label"></div>' +
|
||||
'<label for="dab-service-id">DAB Service:</label>' +
|
||||
'</div>'
|
||||
);
|
||||
|
|
@ -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 '<option value="' + e[0] + '">' + e[1] + '</option>';
|
||||
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue