123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- package HikNetSDK
- import "encoding/json"
- type HikCfg struct {
- Nvr []Nvr `json:"Nvr"`
- BallCamera []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"`
- }
- 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
- }
- func (h *HikCfg) GetBallCameraByName(name string) *BallCamera {
- for i, camera := range h.BallCamera {
- if camera.Name == name {
- return &h.BallCamera[i]
- }
- }
- return nil
- }
|