Type.go 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. package HikNetSDK
  2. import "encoding/json"
  3. type HikCfg struct {
  4. Nvr map[string]Nvr `json:"Nvr"`
  5. BallCamera map[string]BallCamera `json:"BallCamera"`
  6. }
  7. type Nvr struct {
  8. Name string `json:"Name"`
  9. Ip string `json:"Ip"`
  10. Port string `json:"Port"`
  11. User string `json:"User"`
  12. Password string `json:"Password"`
  13. Channel int `json:"Channel"`
  14. }
  15. type BallCamera struct {
  16. Type string `json:"Type"`
  17. Name string `json:"Name"`
  18. Ip string `json:"Ip"`
  19. Port string `json:"Port"`
  20. User string `json:"User"`
  21. Password string `json:"Password"`
  22. RtspUrl string `json:"RtspUrl"`
  23. Matrix Matrix `json:"Matrix"`
  24. Channel int `json:"Channel"`
  25. }
  26. type Matrix struct {
  27. PStart float64 `json:"P_Start"`
  28. PMax float64 `json:"P_Max"`
  29. PPositiveDirection string `json:"p_Positive_Direction"`
  30. TStart float64 `json:"T_Start"`
  31. TMax float64 `json:"T_Max"`
  32. TPositiveDirection string `json:"T_Positive_Direction"`
  33. Matrix []float64 `json:"Matrix"`
  34. InvMatrix []float64 `json:"InvMatrix"`
  35. PointSet map[string]PointPair `json:"PointSet"`
  36. }
  37. type PointPair struct {
  38. X float64 `json:"X"`
  39. Y float64 `json:"Y"`
  40. P float64 `json:"P"`
  41. T float64 `json:"T"`
  42. }
  43. type PTZ struct {
  44. P float32 `json:"P"`
  45. T float32 `json:"T"`
  46. Z float32 `json:"Z"`
  47. }
  48. type MoveCfg struct {
  49. Speed int `json:"Speed"`
  50. Direction int `json:"Direction"`
  51. }
  52. type Point struct {
  53. X float64 `json:"X"`
  54. Y float64 `json:"Y"`
  55. }
  56. func (h *HikCfg) Json() []byte {
  57. marshal, err := json.Marshal(h)
  58. if err != nil {
  59. return nil
  60. }
  61. return marshal
  62. }