ogn-python/app/model/beacon.py

34 wiersze
988 B
Python
Czysty Zwykły widok Historia

2017-10-03 11:31:24 +00:00
from geoalchemy2.shape import to_shape
from geoalchemy2.types import Geometry
2015-10-24 21:13:21 +00:00
from sqlalchemy.ext.declarative import AbstractConcreteBase
2019-01-28 21:06:38 +00:00
from sqlalchemy.ext.hybrid import hybrid_property
2015-10-24 21:13:21 +00:00
from .geo import Location
2015-10-24 21:13:21 +00:00
2019-08-31 08:14:41 +00:00
from app import db
2015-10-24 21:13:21 +00:00
2019-02-10 12:10:19 +00:00
class Beacon(AbstractConcreteBase, db.Model):
2015-10-24 21:13:21 +00:00
# APRS data
location = db.Column("location", Geometry("POINT", srid=4326))
2019-02-10 12:25:24 +00:00
altitude = db.Column(db.Float(precision=2))
name = db.Column(db.String, primary_key=True)
2019-02-10 12:25:24 +00:00
dstcall = db.Column(db.String)
relay = db.Column(db.String)
receiver_name = db.Column(db.String(9), primary_key=True)
timestamp = db.Column(db.DateTime, primary_key=True)
2015-10-24 21:13:21 +00:00
symboltable = None
symbolcode = None
2019-02-10 12:25:24 +00:00
track = db.Column(db.SmallInteger)
ground_speed = db.Column(db.Float(precision=2))
2015-10-24 21:13:21 +00:00
comment = None
2018-09-03 17:58:35 +00:00
# Type information
2017-10-03 12:14:48 +00:00
beacon_type = None
aprs_type = None
2018-09-03 17:58:35 +00:00
# Debug information
2019-01-30 19:29:56 +00:00
raw_message = None
reference_timestamp = db.Column(db.DateTime, nullable=False)