switch NXDN to use digiham decoder; add meta panel
This commit is contained in:
@ -1051,12 +1051,14 @@ img.openwebrx-mirror-img
|
||||
}
|
||||
|
||||
.openwebrx-meta-slot.active.direct .openwebrx-meta-user-image .directcall,
|
||||
.openwebrx-meta-slot.active.individual .openwebrx-meta-user-image .directcall,
|
||||
#openwebrx-panel-metadata-ysf .openwebrx-meta-slot.active .openwebrx-meta-user-image .directcall,
|
||||
#openwebrx-panel-metadata-dstar .openwebrx-meta-slot.active .openwebrx-meta-user-image .directcall {
|
||||
display: initial;
|
||||
}
|
||||
|
||||
.openwebrx-meta-slot.active.group .openwebrx-meta-user-image .groupcall {
|
||||
.openwebrx-meta-slot.active.group .openwebrx-meta-user-image .groupcall,
|
||||
.openwebrx-meta-slot.active.conference .openwebrx-meta-user-image .groupcall {
|
||||
display: initial;
|
||||
}
|
||||
|
||||
@ -1097,6 +1099,14 @@ img.openwebrx-mirror-img
|
||||
content: "RPT2: ";
|
||||
}
|
||||
|
||||
.openwebrx-meta-slot.individual .openwebrx-nxdn-destination:not(:empty):before {
|
||||
content: "Direct: ";
|
||||
}
|
||||
|
||||
.openwebrx-meta-slot.conference .openwebrx-nxdn-destination:not(:empty):before {
|
||||
content: "Conference: ";
|
||||
}
|
||||
|
||||
.openwebrx-maps-pin svg {
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
|
@ -97,6 +97,17 @@
|
||||
<div class="openwebrx-dstar-destination"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="openwebrx-panel openwebrx-meta-panel" id="openwebrx-panel-metadata-nxdn" style="display: none;" data-panel-name="metadata-nxdn">
|
||||
<div class="openwebrx-meta-slot">
|
||||
<div class="openwebrx-meta-user-image">
|
||||
<img class="directcall" src="static/gfx/openwebrx-directcall.svg">
|
||||
<img class="groupcall" src="static/gfx/openwebrx-groupcall.svg">
|
||||
</div>
|
||||
<div class="openwebrx-nxdn-source"></div>
|
||||
<div class="openwebrx-nxdn-name"></div>
|
||||
<div class="openwebrx-nxdn-destination"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="openwebrx-panel openwebrx-meta-panel" id="openwebrx-panel-metadata-dmr" style="display: none;" data-panel-name="metadata-dmr">
|
||||
<div class="openwebrx-meta-slot openwebrx-dmr-timeslot-panel">
|
||||
<div class="openwebrx-dmr-slot">Timeslot 1</div>
|
||||
|
@ -237,10 +237,71 @@ DStarMetaPanel.prototype.setLocation = function(lat, lon, callsign) {
|
||||
this.el.find('.openwebrx-dstar-ourcall .location').html(html);
|
||||
};
|
||||
|
||||
function NxdnMetaPanel(el) {
|
||||
MetaPanel.call(this, el);
|
||||
this.modes = ['NXDN'];
|
||||
this.clear();
|
||||
}
|
||||
|
||||
NxdnMetaPanel.prototype = new MetaPanel();
|
||||
|
||||
NxdnMetaPanel.prototype.update = function(data) {
|
||||
if (!this.isSupported(data)) return;
|
||||
|
||||
if (data['sync'] && data['sync'] == 'voice') {
|
||||
this.el.find(".openwebrx-meta-slot").addClass("active");
|
||||
this.setSource(data['additional'] && data['additional']['callsign'] || data['source']);
|
||||
this.setName(data['additional'] && data['additional']['fname']);
|
||||
this.setDestination(data['destination']);
|
||||
this.setMode(['conference', 'individual'].includes(data['type']) ? data['type'] : undefined);
|
||||
} else {
|
||||
this.clear();
|
||||
}
|
||||
};
|
||||
|
||||
NxdnMetaPanel.prototype.setSource = function(source) {
|
||||
if (this.source === source) return;
|
||||
this.source = source;
|
||||
this.el.find('.openwebrx-nxdn-source').text(source || '');
|
||||
};
|
||||
|
||||
NxdnMetaPanel.prototype.setName = function(name) {
|
||||
if (this.name === name) return;
|
||||
this.name = name;
|
||||
this.el.find('.openwebrx-nxdn-name').text(name || '');
|
||||
};
|
||||
|
||||
NxdnMetaPanel.prototype.setDestination = function(destination) {
|
||||
if (this.destination === destination) return;
|
||||
this.destination = destination;
|
||||
this.el.find('.openwebrx-nxdn-destination').text(destination || '');
|
||||
};
|
||||
|
||||
NxdnMetaPanel.prototype.setMode = function(mode) {
|
||||
if (this.mode === mode) return;
|
||||
var modes = ['individual', 'conference'];
|
||||
if (modes.indexOf(mode) < 0) return;
|
||||
|
||||
this.mode = mode;
|
||||
var classes = modes.filter(function(c){
|
||||
return c !== mode;
|
||||
});
|
||||
this.el.find('.openwebrx-meta-slot').removeClass(classes.join(' ')).addClass(mode);
|
||||
};
|
||||
|
||||
NxdnMetaPanel.prototype.clear = function() {
|
||||
MetaPanel.prototype.clear.call(this);
|
||||
this.setMode();
|
||||
this.setSource();
|
||||
this.setName();
|
||||
this.setDestination();
|
||||
};
|
||||
|
||||
MetaPanel.types = {
|
||||
dmr: DmrMetaPanel,
|
||||
ysf: YsfMetaPanel,
|
||||
dstar: DStarMetaPanel,
|
||||
nxdn: NxdnMetaPanel,
|
||||
};
|
||||
|
||||
$.fn.metaPanel = function() {
|
||||
|
Reference in New Issue
Block a user