dsd

package
v0.0.0-...-50a2d83 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address int

Address 地址

const (
	Visible Address = 1 // 可见光
	Thermal Address = 2 // 热成像
)

func (Address) Validate

func (a Address) Validate() error

type BaudRate

type BaudRate int

BaudRate 波特率

const (
	BaudRate1200   BaudRate = 1200
	BaudRate2400   BaudRate = 2400
	BaudRate4800   BaudRate = 4800
	BaudRate9600   BaudRate = 9600
	BaudRate19200  BaudRate = 19200
	BaudRate38400  BaudRate = 38400
	BaudRate57600  BaudRate = 57600
	BaudRate115200 BaudRate = 115200
)

func (BaudRate) Validate

func (b BaudRate) Validate() error

type CommAttribute

type CommAttribute struct {
	BaudRate BaudRate  `json:"BodeRate"` // 波特率(1200,2400, 4800,9600,19200,38400,57600,115200)
	DataBits DataBit   `json:"DataBits"` // 数据位数(5,6,7,8)
	Parity   ParityBit `json:"Parity"`   // 奇偶校验选项(0:无,1:奇校验,2:偶校验,3:标志校验,4:空校验)
	StopBits StopBit   `json:"StopBits"` // 停止位(0:停止位1;1:停止位1.5;2:停止位2)
}

CommAttribute 串口属性

func NewCommAttribute

func NewCommAttribute() *CommAttribute

func (*CommAttribute) Validate

func (c *CommAttribute) Validate() error

type DataBit

type DataBit int

DataBit 数据位

const (
	FiveDataBit  DataBit = 5
	SixDataBit   DataBit = 6
	SevenDataBit DataBit = 7
	EightDataBit DataBit = 8
)

func (DataBit) Validate

func (d DataBit) Validate() error

type PTZ

type PTZ struct {
	Enable    bool           `json:"Enable"`    // 使能
	Protocol  Protocol       `json:"Protocol"`  // 协议类型: 0 PELCOD, 1 PELCOP
	Address   Address        `json:"Address"`   // PELCO协议: 485地址,0-255
	Attribute *CommAttribute `json:"Attribute"` // 串口属性
}

PTZ 串口配置

func NewPTZ

func NewPTZ() *PTZ

func (*PTZ) ConfigKey

func (p *PTZ) ConfigKey() string

ConfigKey 返回用于读取配置文件的 Key

func (*PTZ) ConvertAddress

func (s *PTZ) ConvertAddress() byte

func (*PTZ) Validate

func (p *PTZ) Validate() error

type ParityBit

type ParityBit int

ParityBit 校验位

const (
	NoParity    ParityBit = iota // 无
	OddParity                    // 奇校验
	EvenParity                   // 偶校验
	MarkParity                   // 标志校验
	SpaceParity                  // 空校验
)

func (ParityBit) Validate

func (p ParityBit) Validate() error

type Position

type Position struct {
	Pan  float64 `json:"Pan" validate:"required,gte=0,lt=360"`  // 水平坐标
	Tile float64 `json:"Tile" validate:"required,gte=0,lte=90"` // 垂直坐标
	Zoom float64 `json:"Zoom" validate:"required,gte=0,lte=20"` // 变倍
}

Position 云台坐标与放大倍数

type PresetPoint

type PresetPoint struct {
	Enable   bool     `json:"Enable" validate:"boolean"`             // 使能
	ID       int      `json:"ID" validate:"required,gte=1,lte=255"`  // 预置点id
	Name     string   `json:"Name" validate:"required,min=1,max=64"` // 预置点名称
	Position Position `json:"Position"`                              // 预置点的坐标和放大倍数
}

type Protocol

type Protocol int

Protocol 协议

const (
	PELCOD Protocol = iota
	PELCOP
)

func (Protocol) Validate

func (p Protocol) Validate() error

type StopBit

type StopBit int

StopBit 停止位

const (
	OneStopBit StopBit = iota
	OnePointFiveStopBits
	TwoStopBits
)

func (StopBit) Validate

func (s StopBit) Validate() error

Jump to

Keyboard shortcuts

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