1. 添加 获取 Nvr 与 UTC 之间的插曲接口

2. 修复 球机聚焦接口存在的错误
3. 修复 PTZ 跳转到指定位置 Action 参数标准海康接口下无效的问题,以及无法设置Z值
4. 移除 GetBallCameraByName
5. 添加 PointPair 配置文件结构
This commit is contained in:
2024-10-22 15:20:51 +08:00
parent bd6cff81ec
commit 002d24e2b0
7 changed files with 40 additions and 35 deletions

42
Type.go
View File

@@ -3,25 +3,25 @@ package HikNetSDK
import "encoding/json"
type HikCfg struct {
Nvr []Nvr `json:"Nvr"`
BallCamera []BallCamera `json:"BallCamera"`
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"`
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"`
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"`
@@ -37,8 +37,17 @@ type Matrix struct {
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"`
@@ -50,8 +59,8 @@ type MoveCfg struct {
Direction int `json:"Direction"`
}
type Point struct {
X float64 `json:"x"`
Y float64 `json:"y"`
X float64 `json:"X"`
Y float64 `json:"Y"`
}
func (h *HikCfg) Json() []byte {
@@ -61,12 +70,3 @@ func (h *HikCfg) Json() []byte {
}
return marshal
}
func (h *HikCfg) GetBallCameraByName(name string) *BallCamera {
for i, camera := range h.BallCamera {
if camera.Name == name {
return &h.BallCamera[i]
}
}
return nil
}