structured callsign data

This commit is contained in:
Jakob Ketterl
2022-11-30 01:07:16 +01:00
parent 975f5ffdf0
commit 258e41669e
9 changed files with 130 additions and 94 deletions

View File

@@ -276,9 +276,9 @@ class WsjtParser(AudioChopperParser):
out["interval"] = profile.getInterval()
self.pushDecode(mode, band)
if "callsign" in out and "locator" in out:
if "source" in out and "locator" in out:
Map.getSharedInstance().updateLocation(
out["callsign"], LocatorLocation(out["locator"]), mode, band
out["source"], LocatorLocation(out["locator"]), mode, band
)
ReportingEngine.getSharedInstance().spot(out)
@@ -342,8 +342,8 @@ class QsoMessageParser(MessageParser):
# this is a valid locator in theory, but it's somewhere in the arctic ocean, near the north pole, so it's very
# likely this just means roger roger goodbye.
if m.group(3) == "RR73":
return {"callsign": m.group(1)}
return {"callsign": m.group(1), "locator": m.group(3)}
return {"source": {"callsign": m.group(1)}}
return {"source": {"callsign": m.group(1)}, "locator": m.group(3)}
# Used in propagation reporting / beacon modes (WSPR / FST4W)
@@ -354,7 +354,7 @@ class BeaconMessageParser(MessageParser):
m = BeaconMessageParser.wspr_splitter_pattern.match(msg)
if m is None:
return {}
return {"callsign": m.group(1), "locator": m.group(2), "dbm": m.group(3)}
return {"source": {"callsign": m.group(1)}, "locator": m.group(2), "dbm": m.group(3)}
class Jt9Decoder(Decoder):