2016-05-22 05:23:22 +00:00
|
|
|
from sqlalchemy import Column, Float, String, Integer, ForeignKey
|
|
|
|
from sqlalchemy.orm import relationship
|
2015-10-24 21:13:21 +00:00
|
|
|
|
2015-10-30 20:19:03 +00:00
|
|
|
from .beacon import Beacon
|
2015-10-24 21:13:21 +00:00
|
|
|
|
|
|
|
|
2015-11-11 17:43:39 +00:00
|
|
|
class ReceiverBeacon(Beacon):
|
|
|
|
__tablename__ = "receiver_beacon"
|
2015-10-24 21:13:21 +00:00
|
|
|
|
2015-11-11 17:43:39 +00:00
|
|
|
# ReceiverBeacon specific data
|
2015-10-24 21:13:21 +00:00
|
|
|
version = Column(String)
|
2015-10-28 14:47:53 +00:00
|
|
|
platform = Column(String)
|
2016-01-21 22:18:02 +00:00
|
|
|
cpu_load = Column(Float)
|
|
|
|
cpu_temp = Column(Float)
|
|
|
|
free_ram = Column(Float)
|
|
|
|
total_ram = Column(Float)
|
|
|
|
ntp_error = Column(Float)
|
|
|
|
rt_crystal_correction = Column(Float)
|
|
|
|
|
|
|
|
rec_crystal_correction = 0 # obsolete since 0.2.0
|
|
|
|
rec_crystal_correction_fine = 0 # obsolete since 0.2.0
|
|
|
|
rec_input_noise = Column(Float)
|
2015-10-24 21:13:21 +00:00
|
|
|
|
2016-10-03 13:14:44 +00:00
|
|
|
snr_total_average = None
|
|
|
|
snr_total_fixes = None
|
|
|
|
snr_filtered_average_daily = None
|
|
|
|
snr_devices_daily_selection = None
|
|
|
|
snr_devices_daily = None
|
|
|
|
|
2016-05-22 05:23:22 +00:00
|
|
|
# Relations
|
|
|
|
receiver_id = Column(Integer, ForeignKey('receiver.id', ondelete='SET NULL'), index=True)
|
|
|
|
receiver = relationship('Receiver', foreign_keys=[receiver_id])
|
|
|
|
|
2015-10-24 21:13:21 +00:00
|
|
|
def __repr__(self):
|
2015-11-15 18:31:58 +00:00
|
|
|
return "<ReceiverBeacon %s: %s>" % (self.name, self.version)
|