Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadConfig ¶
Types ¶
type Compare ¶ added in v0.2.9
type PointWord ¶ added in v0.1.6
type PointWord struct {
Name string `json:"name"` //名称
Type string `json:"type"` //类型
Address uint16 `json:"address"` //偏移
BigEndian bool `json:"be,omitempty"` //大端模式
Rate float64 `json:"rate,omitempty"` //倍率
Correct float64 `json:"correct,omitempty"` //纠正
Bits []*Bit `json:"bits,omitempty"` //位,1 2 3...
}
type Product ¶ added in v0.1.6
type Product struct {
Id string `json:"id,omitempty" xorm:"pk"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Type string `json:"type,omitempty"` //类型
Version string `json:"version,omitempty"`
Protocol string `json:"protocol,omitempty"`
Disabled bool `json:"disabled,omitempty"` //禁用
Created time.Time `json:"created,omitempty" xorm:"created"`
}
type ProductConfig ¶ added in v0.1.6
type ProductModel ¶ added in v0.1.6
type ProductModel struct {
Id string `json:"id,omitempty" xorm:"pk"`
Properties []*Property `json:"properties,omitempty" xorm:"json"`
Events []*Event `json:"events,omitempty" xorm:"json"`
Actions []*Action `json:"actions,omitempty" xorm:"json"`
Validators []*Validator `json:"validators,omitempty" xorm:"json"`
Updated time.Time `json:"updated,omitempty" xorm:"updated"`
Created time.Time `json:"created,omitempty" xorm:"created"`
}
func LoadModel ¶ added in v0.2.8
func LoadModel(id string) (*ProductModel, error)
type Property ¶ added in v0.1.6
type Property struct {
Name string `json:"name,omitempty"` //变量名称
Label string `json:"label,omitempty"` //显示名称
Unit string `json:"unit,omitempty"` //单位
Type string `json:"type,omitempty"` //bool string number array object
Precision uint8 `json:"precision,omitempty"`
Default any `json:"default,omitempty"` //默认值
Writable bool `json:"writable,omitempty"` //是否可写
History bool `json:"history,omitempty"` //是否保存历史
}
Property 属性
type Validator ¶ added in v0.2.8
type Validator struct {
Type string `json:"type"` //compare对比, expression表达式
Compare Compare `json:"compare,omitempty"`
Expression string `json:"expression,omitempty"`
Title string `json:"title,omitempty"`
Message string `json:"message,omitempty"`
Level int `json:"level,omitempty"`
Delay int64 `json:"delay,omitempty"`
Reset int64 `json:"reset,omitempty"`
ResetTimes int `json:"reset_times,omitempty"`
Disabled bool `json:"disabled,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.