예제 #1
0
class ColorRule(db.Model):
    id = db.Column(UUID(as_uuid=True), default=uuid4, primary_key=True)
    map_id = db.Column(UUID(as_uuid=True), db.ForeignKey('map.id'), nullable=False)
    type = db.Column(db.String, nullable=False)
    block_id = db.Column(UUID(as_uuid=True), db.ForeignKey('block.id'), nullable=True)
    origin = db.Column(db.String, nullable=True)
    to = db.Column(db.String, nullable=False)

    def __repr__(self):
        return "<ColorRule(map_id='%s', type='%s')>" % (self.map_id, self.type)
예제 #2
0
class MergeMap(db.Model):
    id = db.Column(UUID(as_uuid=True), default=uuid4, primary_key=True)
    map_id = db.Column(UUID(as_uuid=True), db.ForeignKey('map.id'), nullable=False)
    merge_id = db.Column(UUID(as_uuid=True), db.ForeignKey('merge.id'), nullable=False)
    x = db.Column(db.Integer, nullable=False)
    y = db.Column(db.Integer, nullable=False)
    rotate = db.Column(db.Integer, nullable=False)

    def __repr__(self):
        return "<MergeMap(merge_id='%s', map_id='%s')>" % (self.merge_id, self.map_id)
예제 #3
0
class Block(db.Model):
    id = db.Column(UUID(as_uuid=True), default=uuid4, primary_key=True)
    x = db.Column(db.Integer, nullable=False)
    y = db.Column(db.Integer, nullable=False)
    z = db.Column(db.Integer, nullable=False)
    time = db.Column(db.Float, nullable=False)
    colorID = db.Column(db.String, nullable=False)
    map_id = db.Column(UUID(as_uuid=True), db.ForeignKey('map.id'), nullable=False)
    pattern_name = db.Column(db.String, db.ForeignKey('pattern.name'), nullable=True)
    pattern_group_id = db.Column(UUID(as_uuid=True), nullable=True)

    color_rule = db.relationship('ColorRule', backref='block', lazy=True)

    def __repr__(self):
        return "<Block(map_id='%s')>" % self.map_id
예제 #4
0
class RealSense(db.Model):
    id = db.Column(UUID(as_uuid=True), default=uuid4, primary_key=True)
    name = db.Column(db.String, nullable=False)
    current_map_id = db.Column(UUID(as_uuid=True), db.ForeignKey('map.id'), nullable=False)

    def __repr__(self):
        return "<Realsense(name='%s')>" % self.name
예제 #5
0
class PatternBlock(db.Model):
    __tablename__ = 'pattern_block'
    id = db.Column(UUID(as_uuid=True), default=uuid4, primary_key=True)
    x = db.Column(db.Integer, nullable=False)
    y = db.Column(db.Integer, nullable=False)
    z = db.Column(db.Integer, nullable=False)
    colorID = db.Column(db.String, nullable=False)
    pattern_id = db.Column(UUID(as_uuid=True), db.ForeignKey('pattern.id'), nullable=False)

    def __repr__(self):
        return "<PatternBlock(pattern_id='%s')>" % self.pattern_id