Merge pull request #692 from DJ2LS/dev-add-grid-to-event

add gridsquare to event
This commit is contained in:
DJ2LS 2024-03-27 09:45:44 +01:00 committed by GitHub
commit b0e46fb998
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -132,6 +132,10 @@ class FrameHandler():
if 'origin' in self.details['frame']: if 'origin' in self.details['frame']:
event['dxcallsign'] = self.details['frame']['origin'] event['dxcallsign'] = self.details['frame']['origin']
if 'gridsquare' in self.details['frame']:
event['gridsquare'] = self.details['frame']['gridsquare']
return event return event
def emit_event(self): def emit_event(self):
@ -160,6 +164,8 @@ class FrameHandler():
self.details['freedv_inst'] = freedv_inst self.details['freedv_inst'] = freedv_inst
self.details['bytes_per_frame'] = bytes_per_frame self.details['bytes_per_frame'] = bytes_per_frame
print(self.details)
# look in database for a full callsign if only crc is present # look in database for a full callsign if only crc is present
if 'origin' not in frame and 'origin_crc' in frame: if 'origin' not in frame and 'origin_crc' in frame:
self.details['frame']['origin'] = DatabaseManager(self.event_manager).get_callsign_by_checksum(frame['origin_crc']) self.details['frame']['origin'] = DatabaseManager(self.event_manager).get_callsign_by_checksum(frame['origin_crc'])