Documentation ¶
Index ¶
- Constants
- type Address
- type AutoHoming
- type AutoMovementSlice
- type BaudRate
- type CommAttribute
- type CommInfo
- type Command
- type CronFunction
- type CronID
- type CruiseID
- type CruiseSlice
- type DataBit
- type IdleMotion
- type LineMarginOp
- type LineScan
- type LineScanID
- type LineSlice
- type PTZ
- type ParityBit
- type Pattern
- type Position
- type PowerUps
- type PresetID
- type PresetPoint
- type PresetSlice
- type Protocol
- type PtzAutoMovement
- type Record
- type RecordSlice
- type Schedule
- type Status
- type StopBit
- type TourPreset
- type TourPresetPoint
- type TraceID
Constants ¶
View Source
const MarginNoLimit float64 = -1
View Source
const (
MaxCronNum = 4
)
View Source
const (
MaxCruiseNum = 8
)
View Source
const (
MaxLineScanNum = 5
)
View Source
const (
MaxPresetNum = 255
)
View Source
const (
MaxTraceNum = 5
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AutoHoming ¶
type AutoMovementSlice ¶
type AutoMovementSlice []PtzAutoMovement
func NewAutoMovementSlice ¶
func NewAutoMovementSlice() AutoMovementSlice
func (*AutoMovementSlice) ConfigKey ¶
func (s *AutoMovementSlice) ConfigKey() string
type CommAttribute ¶
type CommAttribute struct { BaudRate BaudRate `json:"BodeRate" validate:"oneof=1200 2400 4800 9600 19200 38400 57600 115200"` DataBits DataBit `json:"DataBits" validate:"oneof=5 6 7 8"` Parity ParityBit `json:"Parity" validate:"oneof=0 1 2 3 4"` StopBits StopBit `json:"StopBits" validate:"oneof=0 1 2"` }
CommAttribute 串口属性
func NewCommAttribute ¶
func NewCommAttribute() *CommAttribute
func (*CommAttribute) Validate ¶
func (c *CommAttribute) Validate() error
type CronFunction ¶
type CronFunction int
CronFunction 定时功能
const ( None CronFunction = iota // None Preset // 预置点 Cruise // 巡航 Trace // 巡迹 Line // 线性扫描 Region // 区域扫描 )
func (CronFunction) Validate ¶
func (f CronFunction) Validate() error
type CruiseSlice ¶
type CruiseSlice []TourPreset
func NewCruiseSlice ¶
func NewCruiseSlice() CruiseSlice
func (*CruiseSlice) ConfigKey ¶
func (s *CruiseSlice) ConfigKey() string
type IdleMotion ¶
type IdleMotion struct { Enable bool `json:"Enable" validate:"boolean"` Second int `json:"Second" validate:"required,gte=5,lte=720"` Function int `json:"Function" validate:"gte=0,lte=5"` PresetID int `json:"PresetID" validate:"required,gte=1,lte=255"` TourID int `json:"TourID" validate:"required,gte=1,lte=8"` PatternID int `json:"PatternID" validate:"required,gte=1,lte=5"` LinearScanID int `json:"LinearScanID" validate:"required,gte=1,lte=5"` RegionScanID int `json:"RegionScanID" validate:"required,gte=1,lte=5"` Running bool `json:"Runing" validate:"boolean"` RunningFunction int `json:"RunningFunction" validate:"required,gte=0,lte=5"` }
func NewIdleMotion ¶
func NewIdleMotion() *IdleMotion
func (*IdleMotion) ConfigKey ¶
func (m *IdleMotion) ConfigKey() string
func (*IdleMotion) Validate ¶
func (m *IdleMotion) Validate() error
type LineMarginOp ¶
type LineMarginOp int
const ( SetLeftMargin LineMarginOp = iota SetRightMargin ClearLeftMargin ClearRightMargin )
type LineScan ¶
type LineScan struct { Enable bool `json:"Enable" validate:"boolean"` ID LineScanID `json:"ID" validate:"required,gte=1,lte=5"` LeftMargin float64 `json:"LeftMargin" validate:"gte=-1,lt=360"` ResidenceTimeLeft int `json:"ResidenceTimeLeft" validate:"required,gte=1,lte=60"` RightMargin float64 `json:"RightMargin" validate:"gte=-1,lt=360"` ResidenceTimeRight int `json:"ResidenceTimeRight" validate:"required,gte=1,lte=60"` Running bool `json:"Runing" validate:"boolean"` Speed int `json:"Speed" validate:"required,gte=1,lte=8"` }
func NewLine ¶
func NewLine(id LineScanID) LineScan
type LineScanID ¶
type LineScanID int
func (LineScanID) Validate ¶
func (i LineScanID) Validate() error
type PTZ ¶
type PTZ struct { Enable bool `json:"Enable"` Protocol Protocol `json:"Protocol" validate:"oneof=0 1"` Address Address `json:"Address" validate:"oneof=1 2"` Attribute *CommAttribute `json:"Attribute"` // 串口属性 }
PTZ 串口配置
func (*PTZ) ConvertAddress ¶
type Pattern ¶
type Pattern struct { ID int `json:"ID" validate:"required,gte=1,lte=5"` // ID Enable bool `json:"Enable" validate:"boolean"` // 使能 Check int `json:"Check"` // 校验 点击开始记录和停止记录都加2,结果为4才能开始 Commands []Command `json:"Commands"` // 用户操作记录 StartPosition Position `json:"StartPosition"` // 巡迹PTZ坐标起始位置 EndPosition Position `json:"EndPosition"` // 巡迹PTZ坐标结束位置 Running bool `json:"Runing"` // 运行状态 }
type Position ¶
type Position struct { Pan float64 `json:"Pan" validate:"gte=0,lt=360"` // 水平坐标 Tilt float64 `json:"Tilt" validate:"gte=0,lte=90"` // 垂直坐标 Zoom float64 `json:"Zoom" validate:"gte=1,lte=20"` // 变倍 }
Position 云台坐标与放大倍数
func NewPosition ¶
func NewPosition() Position
type PowerUps ¶
type PowerUps struct { Enable bool `json:"Enable" validate:"boolean"` Function int `json:"Function" validate:"gte=0,lte=5"` PresetID int `json:"PresetID" validate:"required,gte=1,lte=255"` TourID int `json:"TourID" validate:"required,gte=1,lte=8"` PatternID int `json:"PatternID" validate:"required,gte=1,lte=5"` LinearScanID int `json:"LinearScanID" validate:"required,gte=1,lte=5"` RegionScanID int `json:"RegionScanID" validate:"required,gte=1,lte=5"` }
func NewPowerUps ¶
func NewPowerUps() *PowerUps
type PresetPoint ¶
type PresetPoint struct { Enable bool `json:"Enable" validate:"boolean"` ID PresetID `json:"ID" validate:"required,gte=1,lte=255"` Name string `json:"Name" validate:"required,min=1,max=64"` Position Position `json:"Position"` }
func NewPreset ¶
func NewPreset(id PresetID, name string) PresetPoint
func (*PresetPoint) Validate ¶
func (p *PresetPoint) Validate() error
type PresetSlice ¶
type PresetSlice []PresetPoint
func NewPresetSlice ¶
func NewPresetSlice() PresetSlice
func (*PresetSlice) ConfigKey ¶
func (p *PresetSlice) ConfigKey() string
type PtzAutoMovement ¶
type PtzAutoMovement struct { ID CronID `json:"ID" validate:"required,gte=1,lte=4"` Enable bool `json:"Enable" validate:"boolean"` Function int `json:"Function" validate:"gte=0,lte=5"` PresetID int `json:"PresetID" validate:"required,gte=1,lte=255"` TourID int `json:"TourID" validate:"required,gte=1,lte=8"` PatternID int `json:"PatternID" validate:"required,gte=1,lte=5"` LinearScanID int `json:"LinearScanID" validate:"required,gte=1,lte=5"` RegionScanID int `json:"RegionScanID" validate:"required,gte=1,lte=5"` AutoHoming AutoHoming `json:"AutoHoming" validate:"required"` RunningFunction int `json:"RunningFunction" validate:"gte=0,lte=5"` Schedule types.WeekSchedule `json:"Schedule" validate:"required"` }
func NewAutoMovement ¶
func NewAutoMovement(id CronID) PtzAutoMovement
func (*PtzAutoMovement) GetFuncID ¶
func (a *PtzAutoMovement) GetFuncID() (int, error)
func (*PtzAutoMovement) Validate ¶
func (a *PtzAutoMovement) Validate() error
type RecordSlice ¶
type RecordSlice []Record
func NewRecordSlice ¶
func NewRecordSlice() RecordSlice
func (*RecordSlice) ConfigKey ¶
func (s *RecordSlice) ConfigKey() string
type Status ¶
type Status struct { Moving bool `json:"Moving" validate:"boolean"` Trigger int `json:"Trigger" validate:"required,gte=0,lte=4"` Function int `json:"Function" validate:"required,gte=0,lte=5"` FunctionID int `json:"FunctionID" validate:"required"` TimingTaskID int `json:"TimingTaskID" validate:"required,gte=1,lte=4"` StartTime int64 `json:"StartTime" validate:"required"` }
type TourPreset ¶
type TourPreset struct { Enable bool `json:"Enable" validate:"boolean"` ID CruiseID `json:"ID" validate:"required,gte=1,lte=8"` Name string `json:"Name" validate:"required,min=1,max=64"` Preset []TourPresetPoint `json:"Preset" ` Running bool `json:"Runing" validate:"boolean"` }
func NewCruise ¶
func NewCruise(id CruiseID, name string) TourPreset
func (*TourPreset) Validate ¶
func (p *TourPreset) Validate() error
type TourPresetPoint ¶
type TourPresetPoint struct { ID PresetID `json:"ID" validate:"required,gte=1,lte=255"` Name string `json:"Name" validate:"required,min=1,max=64"` ResidenceTime int `json:"ResidenceTime" validate:"gte=0,lte=255"` }
func NewTourPresetPoint ¶
func NewTourPresetPoint(id PresetID, name string, time int) TourPresetPoint
func (*TourPresetPoint) Validate ¶
func (p *TourPresetPoint) Validate() error
Click to show internal directories.
Click to hide internal directories.