Documentation ¶
Index ¶
- Constants
- type Address
- type AutoHoming
- type BaudRate
- type CommAttribute
- type CommInfo
- type Command
- type CronID
- type CruiseID
- type CruiseName
- type DataBit
- type IdleMotion
- type Limit
- type LineScan
- type LineScanID
- type PTZ
- type ParityBit
- type Pattern
- type Position
- type PowerUps
- type PresetID
- type PresetName
- type PresetPoint
- type Protocol
- type PtzAutoMovement
- type Status
- type StopBit
- type TourPreset
- type TourPresetPoint
- type TraceID
Constants ¶
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 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 CruiseName ¶
type CruiseName string
func (CruiseName) Validate ¶
func (n CruiseName) Validate() error
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:"required,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:"TourID" 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"` Runing 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
type Limit ¶
type Limit struct { LevelEnable bool `json:"LevelEnable" validate:"boolean"` // 水平限位使能 CheckLeft int `json:"CheckLeft" validate:"gte=0,lte=1"` // 水平左校验位 点左限位为check=1 CheckRight int `json:"CheckRight" validate:"gte=0,lte=1"` // 水平右校验位 点右限位为check=1 LeftBoundary float64 `json:"LeftBoundary" validate:"gte=0,lt=360"` // 左边界位置 RightBoundary float64 `json:"RightBoundary" validate:"gte=0,lt=360"` // 右边界位置 VerticalEnable bool `json:"VerticalEnable" validate:"boolean"` // 垂直限位使能 CheckUp int `json:"CheckUp" validate:"gte=0,lte=1"` // 水平上校验位 点左限位为check=1 CheckDown int `json:"CheckDown" validate:"gte=0,lte=1"` // 水平下校验位 点右限位为check=1 DownBoundary float64 `json:"DownBoundary" validate:"gte=0,lte=90"` // 下边界位置 UpBoundary float64 `json:"UpBoundary" validate:"gte=0,lte=90"` // 上边界位置 }
type LineScan ¶
type LineScan struct { Enable bool `json:"Enable" validate:"boolean"` // 使能 ID LineScanID `json:"ID" validate:"required,gte=1,lte=5"` // 线性扫描id LeftMargin float64 `json:"LeftMargin" validate:"gte=-1,lte=360"` // 设置左边界,-1 清除边界 ResidenceTimeLeft int `json:"ResidenceTimeLeft" validate:"required,gte=1,lte=60"` // 停留时间(左)秒 RightMargin float64 `json:"RightMargin" validate:"gte=-1,lte=360"` // 设置右边界,-1 清除边界 ResidenceTimeRight int `json:"ResidenceTimeRight" validate:"required,gte=1,lte=60"` // 停留时间(右)秒 Runing bool `json:"Runing" validate:"boolean"` // 运行状态 Speed int `json:"Speed" validate:"required,gte=1,lte=8"` // 线扫速度 1-8 1:最慢 8:最快 }
func NewLineScan ¶
func NewLineScan(id LineScanID) (LineScan, error)
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"` // 协议类型: 0 PELCOD, 1 PELCOP Address Address `json:"Address"` // PELCO协议: 485地址,0-255 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坐标结束位置 Runing bool `json:"Runing"` // 运行状态 }
type Position ¶
type Position struct { Pan float64 `json:"Pan" validate:"required,gte=0,lt=360"` // 水平坐标 Tilt float64 `json:"Tilt" validate:"required,gte=0,lte=90"` // 垂直坐标 Zoom float64 `json:"Zoom" validate:"required,gte=0,lte=20"` // 变倍 }
Position 云台坐标与放大倍数
func NewPosition ¶
func NewPosition() *Position
type PowerUps ¶
type PowerUps struct { Enable bool `json:"Enable" validate:"boolean"` Function int `json:"Function" validate:"required,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 PresetName ¶
type PresetName string
func (PresetName) Validate ¶
func (n PresetName) Validate() error
type PresetPoint ¶
type PresetPoint struct { Enable bool `json:"Enable" validate:"boolean"` // 使能 ID PresetID `json:"ID" validate:"required,gte=1,lte=255"` // 预置点id Name PresetName `json:"Name" validate:"required,min=1,max=64"` // 预置点名称 Position *Position `json:"Position"` // 预置点的坐标和放大倍数 }
func NewPreset ¶
func NewPreset(id PresetID, name PresetName) (PresetPoint, error)
func (*PresetPoint) ConfigKey ¶
func (p *PresetPoint) ConfigKey() string
func (*PresetPoint) Default ¶
func (p *PresetPoint) Default() []PresetPoint
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:"required,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:"required,gte=0,lte=5"` Schedule types.WeekSchedule `json:"Schedule" validate:"required"` }
func NewPtzAutoMovement ¶
func NewPtzAutoMovement(id CronID) (*PtzAutoMovement, error)
func (*PtzAutoMovement) ConfigKey ¶
func (m *PtzAutoMovement) ConfigKey() string
func (*PtzAutoMovement) DefaultSlice ¶
func (m *PtzAutoMovement) DefaultSlice() []PtzAutoMovement
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"` // ID Name CruiseName `json:"Name" validate:"required,min=1,max=64"` // 名字 Preset []TourPresetPoint `json:"Preset" validate:"required"` // 关联预置点 Running bool `json:"Runing" validate:"boolean"` // 运行状态 }
func NewCruise ¶
func NewCruise(id CruiseID, name CruiseName) (TourPreset, error)
func (*TourPreset) ConfigKey ¶
func (p *TourPreset) ConfigKey() string
func (*TourPreset) Default ¶
func (p *TourPreset) Default() []TourPreset
type TourPresetPoint ¶
type TourPresetPoint struct { ID PresetID `json:"ID" validate:"required,gte=1,lte=255"` // 预设点id Name PresetName `json:"Name" validate:"required,min=1,max=64"` // 预设点名称 ResidenceTime int `json:"ResidenceTime" validate:"required,gte=0,lte=255"` // 停留时间(s) }
Click to show internal directories.
Click to hide internal directories.