add timestamp display
This commit is contained in:
parent
87afa13b46
commit
47a5ba7634
|
|
@ -25,7 +25,6 @@ class MetaProcessor(PickleModule):
|
||||||
result = {}
|
result = {}
|
||||||
for key, value in data.items():
|
for key, value in data.items():
|
||||||
if key == "coarse_frequency_shift":
|
if key == "coarse_frequency_shift":
|
||||||
value = int(value)
|
|
||||||
if value > 0:
|
if value > 0:
|
||||||
self.shift += random() * self.coarse_increment
|
self.shift += random() * self.coarse_increment
|
||||||
else:
|
else:
|
||||||
|
|
@ -33,7 +32,6 @@ class MetaProcessor(PickleModule):
|
||||||
logger.debug("coarse adjustment - new shift: %f", self.shift)
|
logger.debug("coarse adjustment - new shift: %f", self.shift)
|
||||||
self.shifter.setRate(self.shift)
|
self.shifter.setRate(self.shift)
|
||||||
elif key == "fine_frequency_shift":
|
elif key == "fine_frequency_shift":
|
||||||
value = float(value)
|
|
||||||
if abs(value) > 10:
|
if abs(value) > 10:
|
||||||
self.shift += self.fine_increment * value
|
self.shift += self.fine_increment * value
|
||||||
logger.debug("ffs: %f", value)
|
logger.debug("ffs: %f", value)
|
||||||
|
|
|
||||||
|
|
@ -1391,6 +1391,8 @@ img.openwebrx-mirror-img
|
||||||
|
|
||||||
.dab-container > * {
|
.dab-container > * {
|
||||||
margin: 2px 0;
|
margin: 2px 0;
|
||||||
|
text-align: center;
|
||||||
|
overflow: hidden auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dab-container label {
|
.dab-container label {
|
||||||
|
|
|
||||||
|
|
@ -564,6 +564,7 @@ function DabMetaPanel(el) {
|
||||||
'<div class="dab-container">' +
|
'<div class="dab-container">' +
|
||||||
'<div class="dab-auto-clear dab-ensemble-id"></div>' +
|
'<div class="dab-auto-clear dab-ensemble-id"></div>' +
|
||||||
'<div class="dab-auto-clear dab-ensemble-label"></div>' +
|
'<div class="dab-auto-clear dab-ensemble-label"></div>' +
|
||||||
|
'<div class="dab-auto-clear dab-timestamp"></div>' +
|
||||||
'<label for="dab-service-id">DAB Service:</label>' +
|
'<label for="dab-service-id">DAB Service:</label>' +
|
||||||
'</div>'
|
'</div>'
|
||||||
);
|
);
|
||||||
|
|
@ -583,13 +584,18 @@ DabMetaPanel.prototype.update = function(data) {
|
||||||
if (!this.isSupported(data)) return;
|
if (!this.isSupported(data)) return;
|
||||||
|
|
||||||
if ('ensemble_id' in data) {
|
if ('ensemble_id' in data) {
|
||||||
$(this.el).find('.dab-ensemble-id').text('0x' + parseInt(data.ensemble_id).toString(16));
|
$(this.el).find('.dab-ensemble-id').text('0x' + data.ensemble_id.toString(16));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ('ensemble_label' in data) {
|
if ('ensemble_label' in data) {
|
||||||
$(this.el).find('.dab-ensemble-label').text(data.ensemble_label);
|
$(this.el).find('.dab-ensemble-label').text(data.ensemble_label);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ('timestamp' in data) {
|
||||||
|
var date = new Date(data.timestamp * 1000);
|
||||||
|
$(this.el).find('.dab-timestamp').text(date.toLocaleString([], {dateStyle: 'short', timeStyle: 'medium'}));
|
||||||
|
}
|
||||||
|
|
||||||
if ('programmes' in data) {
|
if ('programmes' in data) {
|
||||||
var options = Object.entries(data.programmes).map(function(e) {
|
var options = Object.entries(data.programmes).map(function(e) {
|
||||||
return '<option value="' + e[0] + '">' + e[1] + '</option>';
|
return '<option value="' + e[0] + '">' + e[1] + '</option>';
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue