Merge branch 'develop' into csdr++
This commit is contained in:
commit
483d954b95
@ -376,7 +376,10 @@ class OpenWebRxReceiverClient(OpenWebRxClient, SdrSourceEventClient):
|
|||||||
self.send(bytes([0x04]) + data)
|
self.send(bytes([0x04]) + data)
|
||||||
|
|
||||||
def write_s_meter_level(self, level):
|
def write_s_meter_level(self, level):
|
||||||
self.send({"type": "smeter", "value": level})
|
try:
|
||||||
|
self.send({"type": "smeter", "value": level})
|
||||||
|
except ValueError:
|
||||||
|
logger.warning("unable to send smeter value: %s", str(level))
|
||||||
|
|
||||||
def write_cpu_usage(self, usage):
|
def write_cpu_usage(self, usage):
|
||||||
self.mp_send({"type": "cpuusage", "value": usage})
|
self.mp_send({"type": "cpuusage", "value": usage})
|
||||||
|
33
owrx/meta.py
33
owrx/meta.py
@ -122,22 +122,25 @@ class DStarEnricher(Enricher):
|
|||||||
loc = LatLngLocation(meta["lat"], meta["lon"])
|
loc = LatLngLocation(meta["lat"], meta["lon"])
|
||||||
Map.getSharedInstance().updateLocation(meta["ourcall"], loc, "D-Star", self.parser.getBand())
|
Map.getSharedInstance().updateLocation(meta["ourcall"], loc, "D-Star", self.parser.getBand())
|
||||||
if "dprs" in meta:
|
if "dprs" in meta:
|
||||||
# we can send the DPRS stuff through our APRS parser to extract the information
|
try:
|
||||||
# TODO: only third-party parsing accepts this format right now
|
# we can send the DPRS stuff through our APRS parser to extract the information
|
||||||
# TODO: we also need to pass a handler, which is not needed
|
# TODO: only third-party parsing accepts this format right now
|
||||||
parser = AprsParser(None)
|
# TODO: we also need to pass a handler, which is not needed
|
||||||
dprsData = parser.parseThirdpartyAprsData(meta["dprs"])
|
parser = AprsParser(None)
|
||||||
if "data" in dprsData:
|
dprsData = parser.parseThirdpartyAprsData(meta["dprs"])
|
||||||
data = dprsData["data"]
|
if "data" in dprsData:
|
||||||
if "lat" in data and "lon" in data:
|
data = dprsData["data"]
|
||||||
# TODO: we could actually get the symbols from the parsed APRS data and show that on the meta panel
|
if "lat" in data and "lon" in data:
|
||||||
meta["lat"] = data["lat"]
|
# TODO: we could actually get the symbols from the parsed APRS data and show that on the meta panel
|
||||||
meta["lon"] = data["lon"]
|
meta["lat"] = data["lat"]
|
||||||
|
meta["lon"] = data["lon"]
|
||||||
|
|
||||||
if "ourcall" in meta:
|
if "ourcall" in meta:
|
||||||
# send location info to map as well (it will show up with the correct symbol there!)
|
# 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, "DPRS", self.parser.getBand())
|
Map.getSharedInstance().updateLocation(meta["ourcall"], loc, "DPRS", self.parser.getBand())
|
||||||
|
except Exception:
|
||||||
|
logger.exception("Error while parsing DPRS data")
|
||||||
|
|
||||||
return meta
|
return meta
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user