point

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var A map[string][]Point

Functions

This section is empty.

Types

type DataType

type DataType uint

数据类型

const (
	DataTypeByte DataType = 0
	DataTypeU16  DataType = 1
	DataTypeS16  DataType = 2
	DataTypeU32  DataType = 3
	DataTypeU64  DataType = 4
	DataTypeF32  DataType = 5
)

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"` // 说明
}

type RegType

type RegType uint

寄存器类型

const (
	HOLDING_REGISTER  RegType = 0
	INPUT_REGISTER    RegType = 1
	COILS_REGISTER    RegType = 2
	DISCRETE_REGISTER RegType = 3
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL