|
@@ -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
|
|
|
-}
|