Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var A map[string][]Point
Functions ¶
This section is empty.
Types ¶
type DeviceAdapter ¶
type DeviceAdapter struct {
UUID string `gorm:"primaryKey;column:uuid;size:36;uniqueIndex;not null" json:"uuid"` //
Vendor string // 厂商
Model string // 型号
DeviceType DeviceType // 类型
Version string // 版本
}
type DeviceType ¶
type DeviceType uint
设备类型
const ( DeviceTypeOther DeviceType = 0 DeviceTypeESS DeviceType = 1 DeviceTypePCS DeviceType = 2 DeviceTypePID DeviceType = 3 DeviceTypeInvertor DeviceType = 4 DeviceTypeLogger DeviceType = 5 DeviceTypeSTS DeviceType = 6 )
type Point ¶
type Point struct {
Address uint16 `gorm:"not null;index" json:"address"` // 地址
Quantity uint16 `gorm:"not null;default:1" json:"quantity"` // 寄存器数量
PointType RegType `gorm:"not null" json:"point_type"` // holding/input/coil/discrete // 功能(寄存器类型)
Name string `json:"name" yaml:"name"` // 信号名,英文 key
DataType DataType `json:"dataType" yaml:"dataType"` // u16/s16/u32/float32...
Access string `json:"access" yaml:"access"` // RO/RW/WO
Unit string `json:"unit,omitempty" yaml:"unit,omitempty"` // 单位,如 V/A/kW/%/kWh
Gain float64 `json:"gain,omitempty" yaml:"gain,omitempty"` // 线性变换:实际值 = Raw * Gain + Offset
Offset float64 `json:"offset,omitempty" yaml:"offset,omitempty"` //
Desc string `json:"description,omitempty" yaml:"description,omitempty"` // 说明
}
Click to show internal directories.
Click to hide internal directories.