ptz

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: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Function

type Function int

Function 云台当前运行功能

const (
	None       Function = iota // 未运行任务
	Cruise                     // 巡航
	Trace                      // 巡迹
	LineScan                   // 线性扫描
	RegionScan                 // 区域扫描
	PanMove                    // 水平旋转
	Preset                     // 预置点
	ManualFunc                 // 手动转动云台
)

type Limit

type Limit struct {
	// contains filtered or unexported fields
}

type Speed

type Speed int

Speed 云台速度

const (
	SpeedOne Speed = iota + 1
	SpeedTwo
	SpeedThree
	SpeedFour
	SpeedFive
	SpeedSix
	SpeedSeven
	SpeedEight
)

func (Speed) Convert

func (s Speed) Convert() byte

func (Speed) Validate

func (s Speed) Validate() error

type State

type State struct {
	// contains filtered or unexported fields
}

func NewState

func NewState(limit *dsd.Limit) *State

func (*State) Change

func (s *State) Change(trigger Trigger, function Function, funcID int, cronID int) error

func (*State) Convert

func (s *State) Convert() *dsd.Status

func (*State) Function

func (s *State) Function() Function

func (*State) Validate

func (s *State) Validate(trigger Trigger, l *Limit) error

type Trigger

type Trigger int

Trigger 云台运动状态变更的触发者

const (
	Manual  Trigger = iota // 手动
	Alarm                  // 报警联动
	Cron                   // 定时任务
	PowerUp                // 开机动作
	Idle                   // 空闲动作
)

func (Trigger) Compare

func (t Trigger) Compare(trigger Trigger) bool

Compare 触发者优先级对比,数字越小,优先级越高 返回 ture,表示 t 的优先级高于 trigger 返回 false,表示 t 的优先级低于 trigger

Jump to

Keyboard shortcuts

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