Modifications for 0.2.5 protocol

pull/61/head
Konstantin Gründger 2016-10-03 15:14:44 +02:00
rodzic a3e4d21e1a
commit 16984883e3
2 zmienionych plików z 21 dodań i 1 usunięć

Wyświetl plik

@ -30,7 +30,21 @@ def process_beacon(raw_message, reference_date=None, reference_time=None):
# \n: ?
# /z: ?
# /o: ?
if message['symboltable'] == "I" and message['symbolcode'] == '&':
if 'symboltable' not in message and 'symbolcode' not in message:
# we have a receiver_beacon (status message)
message.update(parse_ogn_receiver_beacon(message['comment']))
beacon = ReceiverBeacon(**message)
# connect beacon with receiver
receiver = session.query(Receiver.id) \
.filter(Receiver.name == beacon.name) \
.first()
if receiver is None:
receiver = Receiver()
receiver.name = beacon.name
session.add(receiver)
beacon.receiver_id = receiver.id
elif message['symboltable'] == "I" and message['symbolcode'] == '&':
# ... we have a receiver_beacon
message.update(parse_ogn_receiver_beacon(message['comment']))
message = replace_lonlat_with_wkt(message)

Wyświetl plik

@ -21,6 +21,12 @@ class ReceiverBeacon(Beacon):
rec_crystal_correction_fine = 0 # obsolete since 0.2.0
rec_input_noise = Column(Float)
snr_total_average = None
snr_total_fixes = None
snr_filtered_average_daily = None
snr_devices_daily_selection = None
snr_devices_daily = None
# Relations
receiver_id = Column(Integer, ForeignKey('receiver.id', ondelete='SET NULL'), index=True)
receiver = relationship('Receiver', foreign_keys=[receiver_id])