isapi_smart_fieldDetection.go 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. package isapi
  2. import (
  3. "encoding/xml"
  4. )
  5. //能力
  6. //http://192.168.1.64/ISAPI/Smart/FieldDetection/1/capabilities
  7. //http://192.168.1.64/ISAPI/Smart/channels/1/calibrations/capabilities
  8. // FieldDetection 区域入侵
  9. type FieldDetection struct {
  10. XMLName xml.Name `xml:"FieldDetection"`
  11. Xmlns string `xml:"xmlns,attr"`
  12. Version string `xml:"version,attr"`
  13. ID string `xml:"id"`
  14. Enabled string `xml:"enabled"`
  15. StartTriggerTime string `xml:"startTriggerTime"`
  16. EndTriggerTime string `xml:"endTriggerTime"`
  17. NormalizedScreenSize struct {
  18. NormalizedScreenWidth string `xml:"normalizedScreenWidth"`
  19. NormalizedScreenHeight string `xml:"normalizedScreenHeight"`
  20. } `xml:"normalizedScreenSize"`
  21. FieldDetectionRegionList struct {
  22. Size string `xml:"size,attr"`
  23. FieldDetectionRegion []struct {
  24. ID string `xml:"id"`
  25. Enabled string `xml:"enabled"`
  26. SensitivityLevel string `xml:"sensitivityLevel"`
  27. TimeThreshold string `xml:"timeThreshold"`
  28. DetectionTarget string `xml:"detectionTarget"`
  29. AlarmConfidence struct {
  30. Opt string `xml:"opt,attr"`
  31. } `xml:"alarmConfidence"`
  32. RegionCoordinatesList struct {
  33. RegionCoordinates []struct {
  34. PositionX string `xml:"positionX"`
  35. PositionY string `xml:"positionY"`
  36. } `xml:"RegionCoordinates"`
  37. } `xml:"RegionCoordinatesList"`
  38. } `xml:"FieldDetectionRegion"`
  39. } `xml:"FieldDetectionRegionList"`
  40. IsSupportMultiScene string `xml:"isSupportMultiScene"`
  41. IsSupportHumanMisinfoFilter string `xml:"isSupportHumanMisinfoFilter"`
  42. IsSupportVehicleMisinfoFilter string `xml:"isSupportVehicleMisinfoFilter"`
  43. }
  44. func (c *Client) GetFieldDetectionCap() ([]byte, error) {
  45. return c.CommonGet("/ISAPI/Smart/FieldDetection/1/capabilities")
  46. }
  47. func (c *Client) GetSizeFd() ([]byte, error) {
  48. return c.CommonGet("/ISAPI/Smart/channels/1/calibrations/FieldDetection")
  49. }
  50. func (c *Client) PutSizeFd(data []byte) ([]byte, error) {
  51. return c.CommonPut(data, "/ISAPI/Smart/channels/1/calibrations/FieldDetection")
  52. }
  53. // PutFieldDetection 设置区域入侵报警区域
  54. func (c *Client) PutFieldDetection(data []byte) ([]byte, error) {
  55. return c.CommonPut(data, "/ISAPI/Smart/FieldDetection/1")
  56. }
  57. // GetFieldDetection 获取报警区域
  58. func (c *Client) GetFieldDetection() ([]byte, error) {
  59. return c.CommonGet("/ISAPI/Smart/FieldDetection/1")
  60. }