fix DPRS parsing and display
This commit is contained in:
parent
455b2ce1f1
commit
e9b2007863
@ -234,7 +234,7 @@ DStarMetaPanel.prototype.setLocation = function(lat, lon, callsign) {
|
|||||||
if (hasLocation) {
|
if (hasLocation) {
|
||||||
html = '<a class="openwebrx-maps-pin" href="map?callsign=' + encodeURIComponent(callsign) + '" target="_blank"><svg viewBox="0 0 20 35"><use xlink:href="static/gfx/svg-defs.svg#maps-pin"></use></svg></a>';
|
html = '<a class="openwebrx-maps-pin" href="map?callsign=' + encodeURIComponent(callsign) + '" target="_blank"><svg viewBox="0 0 20 35"><use xlink:href="static/gfx/svg-defs.svg#maps-pin"></use></svg></a>';
|
||||||
}
|
}
|
||||||
this.el.find('.openwebrx-dstar-source .location').html(html);
|
this.el.find('.openwebrx-dstar-ourcall .location').html(html);
|
||||||
};
|
};
|
||||||
|
|
||||||
MetaPanel.types = {
|
MetaPanel.types = {
|
||||||
|
15
owrx/meta.py
15
owrx/meta.py
@ -100,22 +100,21 @@ class YsfMetaEnricher(Enricher):
|
|||||||
|
|
||||||
class DStarEnricher(Enricher):
|
class DStarEnricher(Enricher):
|
||||||
def enrich(self, meta):
|
def enrich(self, meta):
|
||||||
if "dpmr" in meta:
|
if "dprs" in meta:
|
||||||
# we can send the DPMR stuff through our APRS parser to extract the information
|
# we can send the DPRS stuff through our APRS parser to extract the information
|
||||||
# TODO: only thrid-party parsing accepts this format right now
|
# TODO: only third-party parsing accepts this format right now
|
||||||
# TODO: we also need to pass a handler, which is not needed
|
# TODO: we also need to pass a handler, which is not needed
|
||||||
parser = AprsParser(None)
|
parser = AprsParser(None)
|
||||||
dprsData = parser.parseThirdpartyAprsData(meta["dpmr"])
|
dprsData = parser.parseThirdpartyAprsData(meta["dprs"])
|
||||||
logger.debug("decoded APRS data: %s", dprsData)
|
|
||||||
if "data" in dprsData:
|
if "data" in dprsData:
|
||||||
data = dprsData["data"]
|
data = dprsData["data"]
|
||||||
if "lat" in data and "lon" in data:
|
if "lat" in data and "lon" in data:
|
||||||
# TODO: we could actually get the symbols from the parsed APRS data and show that
|
# TODO: we could actually get the symbols from the parsed APRS data and show that on the meta panel
|
||||||
meta["lat"] = data["lat"]
|
meta["lat"] = data["lat"]
|
||||||
meta["lon"] = data["lon"]
|
meta["lon"] = data["lon"]
|
||||||
|
|
||||||
if "ourcall" in meta:
|
if "ourcall" in meta:
|
||||||
# send location info to map as well
|
# send location info to map as well (it will show up with the correct symbol there!)
|
||||||
loc = AprsLocation(data)
|
loc = AprsLocation(data)
|
||||||
Map.getSharedInstance().updateLocation(meta["ourcall"], loc, "APRS", self.parser.getBand())
|
Map.getSharedInstance().updateLocation(meta["ourcall"], loc, "APRS", self.parser.getBand())
|
||||||
|
|
||||||
@ -129,7 +128,7 @@ class MetaParser(Parser):
|
|||||||
|
|
||||||
def parse(self, meta):
|
def parse(self, meta):
|
||||||
fields = meta.split(";")
|
fields = meta.split(";")
|
||||||
meta = {v[0]: "".join(v[1:]) for v in map(lambda x: x.split(":"), fields) if v[0] != ""}
|
meta = {v[0]: ":".join(v[1:]) for v in map(lambda x: x.split(":"), fields) if v[0] != ""}
|
||||||
|
|
||||||
if "protocol" in meta:
|
if "protocol" in meta:
|
||||||
protocol = meta["protocol"]
|
protocol = meta["protocol"]
|
||||||
|
Loading…
Reference in New Issue
Block a user