From e9b20078633e540dbd9ee8f034e0abb7076afdfc Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Fri, 11 Jun 2021 14:36:11 +0200 Subject: [PATCH] fix DPRS parsing and display --- htdocs/lib/MetaPanel.js | 2 +- owrx/meta.py | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/htdocs/lib/MetaPanel.js b/htdocs/lib/MetaPanel.js index 0a3a334..96f92b7 100644 --- a/htdocs/lib/MetaPanel.js +++ b/htdocs/lib/MetaPanel.js @@ -234,7 +234,7 @@ DStarMetaPanel.prototype.setLocation = function(lat, lon, callsign) { if (hasLocation) { html = ''; } - this.el.find('.openwebrx-dstar-source .location').html(html); + this.el.find('.openwebrx-dstar-ourcall .location').html(html); }; MetaPanel.types = { diff --git a/owrx/meta.py b/owrx/meta.py index 90808c2..9a8b3eb 100644 --- a/owrx/meta.py +++ b/owrx/meta.py @@ -100,22 +100,21 @@ class YsfMetaEnricher(Enricher): class DStarEnricher(Enricher): def enrich(self, meta): - if "dpmr" in meta: - # we can send the DPMR stuff through our APRS parser to extract the information - # TODO: only thrid-party parsing accepts this format right now + if "dprs" in meta: + # we can send the DPRS stuff through our APRS parser to extract the information + # TODO: only third-party parsing accepts this format right now # TODO: we also need to pass a handler, which is not needed parser = AprsParser(None) - dprsData = parser.parseThirdpartyAprsData(meta["dpmr"]) - logger.debug("decoded APRS data: %s", dprsData) + dprsData = parser.parseThirdpartyAprsData(meta["dprs"]) if "data" in dprsData: data = dprsData["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["lon"] = data["lon"] 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) Map.getSharedInstance().updateLocation(meta["ourcall"], loc, "APRS", self.parser.getBand()) @@ -129,7 +128,7 @@ class MetaParser(Parser): def parse(self, meta): 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: protocol = meta["protocol"]