Browse Source

Merge branch 'dev' of ssh://10.10.100.21/source/smartschool-platform into dev

zhaoy 6 years ago
parent
commit
0e4af66bc5

+ 90 - 14
applications/device/device-sdk-dahua/src/main/java/com/usoftchina/smartschool/device/dahua/lib/DahuaLibrary.java

@@ -8,9 +8,9 @@ import com.sun.jna.ptr.IntByReference;
 import com.sun.jna.win32.StdCallLibrary;
 
 import java.time.LocalDateTime;
-import java.time.ZoneId;
 import java.time.ZoneOffset;
 import java.time.ZonedDateTime;
+import java.util.Arrays;
 import java.util.Date;
 
 /**
@@ -862,10 +862,10 @@ public interface DahuaLibrary extends Library {
         @Override
         public String toString() {
             return "DH_EVENT_FILE_INFO{" +
-                    "bCount=" + bCount +
-                    ", bIndex=" + bIndex +
-                    ", bFileTag=" + bFileTag +
-                    ", bFileType=" + bFileType +
+                    "bCount=" + (bCount & 0xff) +
+                    ", bIndex=" + (bIndex & 0xff) +
+                    ", bFileTag=" + (bFileTag & 0xff) +
+                    ", bFileType=" + (bFileType & 0xff) +
                     ", stuFileTime=" + stuFileTime +
                     ", nGroupId=" + nGroupId +
                     '}';
@@ -1445,6 +1445,7 @@ public interface DahuaLibrary extends Library {
                     ", PTS=" + PTS +
                     ", UTC=" + UTC +
                     ", nEventID=" + nEventID +
+                    ", stuObject=" + stuObject +
                     ", stuFileInfo=" + stuFileInfo +
                     ", emEventType=" + emEventType +
                     ", bStatus=" + bStatus +
@@ -1474,10 +1475,20 @@ public interface DahuaLibrary extends Library {
      */
     @Structure.FieldOrder({"left", "top", "right", "bottom"})
     class DH_RECT extends Structure {
-        public long left;
-        public long top;
-        public long right;
-        public long bottom;
+        public NativeLong left;
+        public NativeLong top;
+        public NativeLong right;
+        public NativeLong bottom;
+
+        @Override
+        public String toString() {
+            return "DH_RECT{" +
+                    "left=" + left.longValue() +
+                    ", top=" + top.longValue() +
+                    ", right=" + right.longValue() +
+                    ", bottom=" + bottom.longValue() +
+                    '}';
+        }
     }
 
     /**
@@ -1487,6 +1498,14 @@ public interface DahuaLibrary extends Library {
     class DH_POINT extends Structure {
         public short nx;
         public short ny;
+
+        @Override
+        public String toString() {
+            return "DH_POINT{" +
+                    "nx=" + nx +
+                    ", ny=" + ny +
+                    '}';
+        }
     }
 
     /**
@@ -1534,6 +1553,21 @@ public interface DahuaLibrary extends Library {
          * 小图左上角在大图的位置,使用绝对坐标系
          */
         public DH_POINT stuPoint;
+
+        @Override
+        public String toString() {
+            return "DH_PIC_INFO{" +
+                    "dwOffSet=" + dwOffSet +
+                    ", dwFileLenth=" + dwFileLenth +
+                    ", wWidth=" + wWidth +
+                    ", wHeight=" + wHeight +
+                    ", pszFilePath='" + pszFilePath + '\'' +
+                    ", bIsDetected=" + bIsDetected +
+                    ", bReserved=" + new String(bReserved) +
+                    ", nFilePathLen=" + nFilePathLen +
+                    ", stuPoint=" + stuPoint +
+                    '}';
+        }
     }
 
     /**
@@ -1792,11 +1826,11 @@ public interface DahuaLibrary extends Library {
         /**
          * 车辆子品牌 需要通过映射表得到真正的子品牌 映射表详见开发手册
          */
-        public int wColorLogoIndex;
+        public short wColorLogoIndex;
         /**
          * 车辆子品牌 需要通过映射表得到真正的子品牌 映射表详见开发手册
          */
-        public int wSubBrand;
+        public short wSubBrand;
         public byte byReserved1;
         /**
          * 是否有物体对应图片文件信息
@@ -1854,11 +1888,11 @@ public interface DahuaLibrary extends Library {
         /**
          * 开始时文件偏移, 单位: 字节(物体开始出现时,视频帧在原始视频文件中相对于文件起始处的偏移)
          */
-        public int nBeginFileOffset;
+        public long nBeginFileOffset;
         /**
          * 结束时文件偏移, 单位: 字节(物体消逝时,视频帧在原始视频文件中相对于文件起始处的偏移)
          */
-        public int nEndFileOffset;
+        public long nEndFileOffset;
         /**
          * 物体颜色相似度,取值范围:0-100,数组下标值代表某种颜色,详见EM_COLOR_TYPE
          */
@@ -1882,7 +1916,49 @@ public interface DahuaLibrary extends Library {
         /**
          * 车辆品牌年款 需要通过映射表得到真正的年款 映射表详见开发手册
          */
-        public int wBrandYear;
+        public short wBrandYear;
+
+        @Override
+        public String toString() {
+            return "DH_MSG_OBJECT{" +
+                    "nObjectID=" + nObjectID +
+                    ", szObjectType=" + new String(szObjectType) +
+                    ", nConfidence=" + nConfidence +
+                    ", nAction=" + nAction +
+                    ", BoundingBox=" + BoundingBox +
+                    ", Center=" + Center +
+                    ", nPolygonNum=" + nPolygonNum +
+                    ", Contour=" + Arrays.toString(Contour) +
+                    ", rgbaMainColor=" + rgbaMainColor +
+                    ", szText=" + new String(szText) +
+                    ", szObjectSubType=" + new String(szObjectSubType) +
+                    ", wColorLogoIndex=" + wColorLogoIndex +
+                    ", wSubBrand=" + wSubBrand +
+                    ", byReserved1=" + byReserved1 +
+                    ", bPicEnble=" + bPicEnble +
+                    ", stPicInfo=" + stPicInfo +
+                    ", bShotFrame=" + bShotFrame +
+                    ", bColor=" + bColor +
+                    ", byReserved2=" + byReserved2 +
+                    ", byTimeType=" + byTimeType +
+                    ", stuCurrentTime=" + stuCurrentTime +
+                    ", stuStartTime=" + stuStartTime +
+                    ", stuEndTime=" + stuEndTime +
+                    ", stuOriginalBoundingBox=" + stuOriginalBoundingBox +
+                    ", stuSignBoundingBox=" + stuSignBoundingBox +
+                    ", dwCurrentSequence=" + dwCurrentSequence +
+                    ", dwBeginSequence=" + dwBeginSequence +
+                    ", dwEndSequence=" + dwEndSequence +
+                    ", nBeginFileOffset=" + nBeginFileOffset +
+                    ", nEndFileOffset=" + nEndFileOffset +
+                    ", byColorSimilar=" + new String(byColorSimilar) +
+                    ", byUpperBodyColorSimilar=" + new String(byUpperBodyColorSimilar) +
+                    ", byLowerBodyColorSimilar=" + new String(byLowerBodyColorSimilar) +
+                    ", nRelativeID=" + nRelativeID +
+                    ", szSubText=" + new String(szSubText) +
+                    ", wBrandYear=" + wBrandYear +
+                    '}';
+        }
     }
 
     /**