2. 修复 球机聚焦接口存在的错误 3. 修复 PTZ 跳转到指定位置 Action 参数标准海康接口下无效的问题,以及无法设置Z值 4. 移除 GetBallCameraByName 5. 添加 PointPair 配置文件结构
		
			
				
	
	
		
			73 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			73 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
| package HikNetSDK
 | |
| 
 | |
| import "encoding/json"
 | |
| 
 | |
| type HikCfg struct {
 | |
| 	Nvr        map[string]Nvr        `json:"Nvr"`
 | |
| 	BallCamera map[string]BallCamera `json:"BallCamera"`
 | |
| }
 | |
| 
 | |
| type Nvr struct {
 | |
| 	Name     string `json:"Name"`
 | |
| 	Ip       string `json:"Ip"`
 | |
| 	Port     string `json:"Port"`
 | |
| 	User     string `json:"User"`
 | |
| 	Password string `json:"Password"`
 | |
| 	Channel  int    `json:"Channel"`
 | |
| }
 | |
| 
 | |
| type BallCamera struct {
 | |
| 	Type     string `json:"Type"`
 | |
| 	Name     string `json:"Name"`
 | |
| 	Ip       string `json:"Ip"`
 | |
| 	Port     string `json:"Port"`
 | |
| 	User     string `json:"User"`
 | |
| 	Password string `json:"Password"`
 | |
| 	RtspUrl  string `json:"RtspUrl"`
 | |
| 	Matrix   Matrix `json:"Matrix"`
 | |
| 	Channel  int    `json:"Channel"`
 | |
| }
 | |
| 
 | |
| type Matrix struct {
 | |
| 	PStart             float64   `json:"P_Start"`
 | |
| 	PMax               float64   `json:"P_Max"`
 | |
| 	PPositiveDirection string    `json:"p_Positive_Direction"`
 | |
| 	TStart             float64   `json:"T_Start"`
 | |
| 	TMax               float64   `json:"T_Max"`
 | |
| 	TPositiveDirection string    `json:"T_Positive_Direction"`
 | |
| 	Matrix             []float64 `json:"Matrix"`
 | |
| 	InvMatrix          []float64 `json:"InvMatrix"`
 | |
| 	PointSet           map[string]PointPair `json:"PointSet"`
 | |
| }
 | |
| 
 | |
| type PointPair struct {
 | |
| 	X float64 `json:"X"`
 | |
| 	Y float64 `json:"Y"`
 | |
| 	P float64 `json:"P"`
 | |
| 	T float64 `json:"T"`
 | |
| }
 | |
| 
 | |
| 
 | |
| type PTZ struct {
 | |
| 	P float32 `json:"P"`
 | |
| 	T float32 `json:"T"`
 | |
| 	Z float32 `json:"Z"`
 | |
| }
 | |
| 
 | |
| type MoveCfg struct {
 | |
| 	Speed     int `json:"Speed"`
 | |
| 	Direction int `json:"Direction"`
 | |
| }
 | |
| type Point struct {
 | |
| 	X float64 `json:"X"`
 | |
| 	Y float64 `json:"Y"`
 | |
| }
 | |
| 
 | |
| func (h *HikCfg) Json() []byte {
 | |
| 	marshal, err := json.Marshal(h)
 | |
| 	if err != nil {
 | |
| 		return nil
 | |
| 	}
 | |
| 	return marshal
 | |
| }
 |