You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

110 line
3.6 KiB

  1. #pragma once
  2. #include "JObject_NetSDK.h"
  3. NS_NETSDK_CFG_BEGIN
  4. #define JK_PlayBackParameter "Parameter"
  5. class PlayBackParameter : public JObject
  6. {
  7. public:
  8. JIntObj Channel;
  9. JStrObj FileName;
  10. JStrObj PlayMode;
  11. JIntObj Stream_Type;
  12. JIntObj Value;
  13. JStrObj TransMode;
  14. JStrObj IntelligentPlayBackEvent;
  15. JIntObj IntelligentPlayBackSpeed;
  16. public:
  17. PlayBackParameter(JObject *pParent = NULL, const char *szName = JK_PlayBackParameter):
  18. JObject(pParent,szName),
  19. Channel(this, "Channel"),
  20. FileName(this, "FileName"),
  21. PlayMode(this, "PlayMode"),
  22. Stream_Type(this, "Stream_Type"),
  23. Value(this, "Value"),
  24. TransMode(this, "TransMode"),
  25. IntelligentPlayBackEvent(this, "IntelligentPlayBackEvent"),
  26. IntelligentPlayBackSpeed(this, "IntelligentPlayBackSpeed"){
  27. };
  28. ~PlayBackParameter(void){};
  29. // F_SUB_COMMON = 0x00, F_SUB_LOCALALARM = 0x01, ///< 本地报警
  30. // F_SUB_NETALARM = 0x02, ///< 网络报警 F_SUB_NETABORT = 0x03, ///< 断网报警
  31. // F_SUB_IPCALARM = 0x04, ///< IPC报警 F_SUB_SPEEDALARM = 0x05, ///< 超速报警
  32. // F_SUB_GSENSORALARM = 0x06, ///< SENSOR报警 F_SUB_SERIALALARM = 0x07, ///<串口报警
  33. // F_SUB_MOTIONDETECT = 0x08, ///< 移动侦测 F_SUB_LOSSDETECT = 0x09, ///< 视频丢失
  34. // F_SUB_BLINDDETECT = 0x0a, ///< 视频遮挡 F_SUB_PIRALARM = 0x0b, ///< 红外检测
  35. // F_SUB_CARDNUMBER = 0x0c, ///< 卡号录像 F_SUB_PERIMETER = 0x0d, ///< 周界检测
  36. // F_SUB_TRIPWIRE = 0x0e, ///< 单绊线检测 F_SUB_ABANDUM = 0x0f, ///< 物品遗留
  37. // F_SUB_STOLEN = 0x10, ///< 物品被盗 F_SUB_CHANGE = 0x11, ///< 场景变换
  38. // F_SUB_NR = 0x1f,
  39. void SetPlayBackEvent(unsigned int *event, int nCount)
  40. {
  41. unsigned int value;
  42. for(int i = 0; i < nCount; i++)
  43. {
  44. value |= (0x1 << event[i]);
  45. }
  46. };
  47. void SetPlayBackEvent(const char *szEvent)
  48. {
  49. };
  50. };
  51. #define JK_OPPlayBack "OPPlayBack"
  52. class OPPlayBack : public JObject
  53. {
  54. public:
  55. JStrObj Action;
  56. PlayBackParameter mParameter;
  57. JStrObj EndTime;
  58. JStrObj StartTime;
  59. public:
  60. OPPlayBack(JObject *pParent = NULL, const char *szName = JK_OPPlayBack):
  61. JObject(pParent,szName),
  62. Action(this, "Action"),
  63. mParameter(this, JK_PlayBackParameter),
  64. EndTime(this, "EndTime"),
  65. StartTime(this, "StartTime"){
  66. static const char *s_szInitValue =
  67. "{\r\n\"Name\" : \"OPPlayBack\",\r\n\
  68. \"SessionID\" : \"0x2c\", \r\n\
  69. \"OPPlayBack\": {\r\n\
  70. \"Action\": \"Stop\",\r\n\
  71. \"Parameter\": {\r\n\
  72. \"Channel\": 1,\r\n\
  73. \"FileName\": \"01_2018-09-12 00:00:00\",\r\n\
  74. \"PlayMode\": \"ByTime\",\r\n\
  75. \"Stream_Type\": 0,\r\n\
  76. \"Value\": 0,\r\n\
  77. \"TransMode\": \"TCP\",\r\n\
  78. \"IntelligentPlayBackEvent\": \"ALL\",\r\n\
  79. \"IntelligentPlayBackSpeed\": 0\r\n\
  80. },\r\n\
  81. \"StartTime\": \"2018-09-12 00:00:00\",\r\n\
  82. \"EndTime\": \"2018-09-12 23:59:59\"\r\n\
  83. }\r\n}";
  84. this->Parse(s_szInitValue);
  85. };
  86. void SetStartTime(int tt[6])
  87. {
  88. char szTime[32];
  89. sprintf(szTime, "%04d-%02d-%02d %02d:%02d:%02d", tt[0], tt[1], tt[2], tt[3], tt[4], tt[5]);
  90. StartTime = szTime;
  91. };
  92. void SetEndTime(int tt[6])
  93. {
  94. char szTime[32];
  95. sprintf(szTime, "%04d-%02d-%02d %02d:%02d:%02d", tt[0], tt[1], tt[2], tt[3], tt[4], tt[5]);
  96. EndTime = szTime;
  97. };
  98. ~OPPlayBack(void){};
  99. };
  100. NS_NETSDK_CFG_END