1234567891011121314151617181920212223 |
- # -*- coding: utf-8 -*-
- """
- demeter database
- name:hardware.py
- author:rabin
- """
- from .__load__ import *
- class Modbus_device(Model):
- __table__ = 'modbus_device'
- __comment__ = 'modbus设备表'
- id = Fields(type='uuid', primaryKey=True, comment='设备表ID', uuid='farm_id')
- farm_id = Fields(type='int', default='setting.farm', comment='园区ID', match='not')
- modbus_id = Fields(type='uuid', comment='modbusid')
- slave_id = Fields(type='int', comment='从机id', unique=True)
- slave_type = Fields(type='int', comment='1读取2写入')
- register_type = Fields(type='int', comment='寄存器类型')
- register_address = Fields(type='varchar(50)', comment='寄存器地址')
- register_length = Fields(type='varchar(50)', comment='寄存器长度')
- exp = Fields(type='varchar(50)', comment='计算公式')
- unit = Fields(type='varchar(10)', comment='单位')
- state = Fields(type='boolean', default='True', comment='数据存在状态')
- cdate = Fields(type='int', default='time', comment='创建时间')
|