# -*- coding: utf-8 -*-
"""
    demeter database
    name:hardware.py
    author:rabin
"""
from .__load__ import *

class Setting_modbus_code(Model):
	__table__ = 'setting_modbus_code'
	__comment__ = 'modbus命令码'
	id = Fields(type='int', primaryKey=True, autoIncrement=True, comment='id')
	name = Fields(type='varchar(50)', comment='命令码名称')
	device_type_key = Fields(type='varchar(300)', comment='设备名称，多个用换行隔开')
	product_id = Fields(type='int', comment='产品id')
	exp = Fields(type='varchar(300)', comment='设备计算公式，多个用换行隔开')
	hardware_type = Fields(type='int', comment='硬件类型')
	slave_id = Fields(type='int', comment='从机id')
	register_read_address = Fields(type='varchar(200)', comment='寄存器读取地址和长度，多个用换行隔开，与设备名称对应')
	register_write_address = Fields(type='varchar(200)', comment='寄存器写入地址和长度，多个用换行隔开，与设备名称对应')
	state = Fields(type='boolean', default='True', comment='数据存在状态')
	cdate = Fields(type='int', default='time', comment='创建时间')