Exemple #1
0
class Device_Item(db.Model):

    __tablename__ = 'device_items'

    id = db.Column(db.String, primary_key=True, default=util.createUUID)
    created_at = db.Column(db.DateTime, nullable=False, default=datetime.now)
    updated_at = db.Column(db.DateTime, nullable=False, default=datetime.now, onupdate=datetime.now)
    column_id = db.Column(db.String, nullable=False)
    device_id = db.Column(db.String, nullable=False)
    device_item_id = db.Column(db.String, nullable=False)
    name = db.Column(db.String, nullable=False)
    unit = db.Column(db.String, nullable=False)
Exemple #2
0
class AsynchronousLog(db.Model):

    __tablename__ = 'asynchronous_logs'

    id = db.Column(db.String, primary_key=True, default=util.createUUID)
    created_at = db.Column(db.DateTime, nullable=False, default=datetime.now)
    updated_at = db.Column(db.DateTime,
                           nullable=False,
                           default=datetime.now,
                           onupdate=datetime.now)
    event_date = db.Column(db.DateTime, nullable=False, default=datetime.now)
    event_code = db.Column(db.String, nullable=False, default='0000')
    event_category = db.Column(db.String, nullable=False, default='0000')
    event_name = db.Column(db.String, nullable=False, default='0000')
    event_type = db.Column(db.String, nullable=False, default='info')
    device_id = db.Column(db.String, nullable=False, default='0000')
Exemple #3
0
class CyclicLog(db.Model):

    __tablename__ = 'cyclic_logs'

    id = db.Column(db.String, primary_key=True, default=util.createUUID)
    created_at = db.Column(db.DateTime, nullable=False, default=datetime.now)
    updated_at = db.Column(db.DateTime,
                           nullable=False,
                           default=datetime.now,
                           onupdate=datetime.now)
    is_parsed = db.Column(db.Boolean, nullable=False, default=False)
    event_date = db.Column(db.DateTime, nullable=False, default=datetime.now)
    device_id = db.Column(db.String, nullable=False, default='0000')
    item0 = db.Column(db.REAL, nullable=False, default=-32000)
    item1 = db.Column(db.REAL, nullable=False, default=-32000)
    item2 = db.Column(db.REAL, nullable=False, default=-32000)
    item3 = db.Column(db.REAL, nullable=False, default=-32000)
    item4 = db.Column(db.REAL, nullable=False, default=-32000)
    item5 = db.Column(db.REAL, nullable=False, default=-32000)
    item6 = db.Column(db.REAL, nullable=False, default=-32000)
    item7 = db.Column(db.REAL, nullable=False, default=-32000)
    item8 = db.Column(db.REAL, nullable=False, default=-32000)
    item9 = db.Column(db.REAL, nullable=False, default=-32000)
Exemple #4
0
class ParcedLog(db.Model):

    __tablename__ = 'parsed_logs'

    id = db.Column(db.String, primary_key=True, default=util.createUUID)
    created_at = db.Column(db.DateTime, nullable=False, default=datetime.now)
    updated_at = db.Column(db.DateTime,
                           nullable=False,
                           default=datetime.now,
                           onupdate=datetime.now)
    event_date = db.Column(db.DateTime, nullable=False, default=datetime.now)
    device_id = db.Column(db.String, nullable=False, default='0000')
    item0_max = db.Column(db.REAL, nullable=False, default=-32000)
    item0_min = db.Column(db.REAL, nullable=False, default=-32000)
    item1_max = db.Column(db.REAL, nullable=False, default=-32000)
    item1_min = db.Column(db.REAL, nullable=False, default=-32000)
    item2_max = db.Column(db.REAL, nullable=False, default=-32000)
    item2_min = db.Column(db.REAL, nullable=False, default=-32000)
    item3_max = db.Column(db.REAL, nullable=False, default=-32000)
    item3_min = db.Column(db.REAL, nullable=False, default=-32000)
    item4_max = db.Column(db.REAL, nullable=False, default=-32000)
    item4_min = db.Column(db.REAL, nullable=False, default=-32000)
    item5_max = db.Column(db.REAL, nullable=False, default=-32000)
    item5_min = db.Column(db.REAL, nullable=False, default=-32000)
    item6_max = db.Column(db.REAL, nullable=False, default=-32000)
    item6_min = db.Column(db.REAL, nullable=False, default=-32000)
    item7_max = db.Column(db.REAL, nullable=False, default=-32000)
    item7_min = db.Column(db.REAL, nullable=False, default=-32000)
    item8_max = db.Column(db.REAL, nullable=False, default=-32000)
    item8_min = db.Column(db.REAL, nullable=False, default=-32000)
    item9_max = db.Column(db.REAL, nullable=False, default=-32000)
    item9_min = db.Column(db.REAL, nullable=False, default=-32000)
Exemple #5
0
class Device(db.Model):

    __tablename__ = 'devices'

    id = db.Column(db.String, primary_key=True)
    message = db.Column(db.String, default="")