modbus_device.py 1017 B

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