setting_modbus_code.py 1.1 KB

12345678910111213141516171819202122
  1. # -*- coding: utf-8 -*-
  2. """
  3. demeter database
  4. name:hardware.py
  5. author:rabin
  6. """
  7. from .__load__ import *
  8. class Setting_modbus_code(Model):
  9. __table__ = 'setting_modbus_code'
  10. __comment__ = 'modbus命令码'
  11. id = Fields(type='int', primaryKey=True, autoIncrement=True, comment='id')
  12. name = Fields(type='varchar(50)', comment='命令码名称')
  13. device_type_key = Fields(type='varchar(300)', comment='设备名称,多个用换行隔开')
  14. product_id = Fields(type='int', comment='产品id')
  15. exp = Fields(type='varchar(300)', comment='设备计算公式,多个用换行隔开')
  16. hardware_type = Fields(type='int', comment='硬件类型')
  17. slave_id = Fields(type='int', comment='从机id')
  18. register_read_address = Fields(type='varchar(200)', comment='寄存器读取地址和长度,多个用换行隔开,与设备名称对应')
  19. register_write_address = Fields(type='varchar(200)', comment='寄存器写入地址和长度,多个用换行隔开,与设备名称对应')
  20. state = Fields(type='boolean', default='True', comment='数据存在状态')
  21. cdate = Fields(type='int', default='time', comment='创建时间')