dengzedong
2024-12-19 85b2001c0ec2f1adc598db3bf47ad457dcca7074
提交 | 用户 | 时间
149dd0 1 package com.iailab.netsdk.lib.structure;
H 2
3
4 import com.iailab.netsdk.lib.NetSDKLib;
5
6 import java.io.UnsupportedEncodingException;
7
8 /**
9  * @author : 260611
10  * @description : 交通路口车道统计事件 (对应 DH_ALARM_TRAFFIC_FLOW_STAT)
11  * @since : Created in 2022/03/10 10:12
12  */
13
14 public class ALARM_TRAFFIC_FLOW_STAT_INFO extends NetSDKLib.SdkStructure {
15     /**
16      * 事件动作 0:脉冲
17      */
18     public int nAction;
19     /**
20      * 通道号
21      */
22     public int nChannelID;
23     /**
24      * 事件名称
25      */
26     public byte[] szName = new byte[128];
27     /**
28      * 时间戳(单位是毫秒)
29      */
30     public int PTS;
31     /**
32      * 事件ID
33      */
34     public int nEventID;
35     /**
36      * 事件发生的时间
37      */
38     public NET_TIME_EX stuUTC = new NET_TIME_EX();
39     /**
40      * 序号
41      */
42     public int nSequence;
43     /**
44      * 流量状态数量
45      */
46     public int nStateNum;
47     /**
48      * 流量状态, 每个车道对应数组中一个元素
49      */
50     public NET_TRAFFIC_FLOW_STATE[] stuStates = (NET_TRAFFIC_FLOW_STATE[]) new NET_TRAFFIC_FLOW_STATE().toArray(8);
51     /**
52      * 静止车辆数,当前时刻检测范围内车速小于某个阀值的车辆数,单位:辆
53      */
54     public int nStopVehiclenum;
55     /**
56      * 车辆总数,当前时刻检测范围内检测到的所有车道内的车辆总数,单位:辆
57      */
58     public int nDetectionAreaVehicleNum;
59     /**
60      * 保留字节
61      */
62     public byte[] szReserverd = new byte[1024];
63
64     @Override
65     public String toString() {
66         String stuStatesStr = "";
67         if(stuStates.length > 0){
68             stuStatesStr += "stuStates[0] = ";
69             stuStatesStr += stuStates[0].toString();
70         }
71         for(int i = 1; i < stuStates.length; i ++){
72             stuStatesStr += ",stuStates[" + i + "] = ";
73             stuStatesStr += stuStates[i].toString();
74         }
75         try {
76             return "ALARM_TRAFFIC_FLOW_STAT_INFO{" +
77                     "nAction=" + nAction +
78                     ", nChannelID=" + nChannelID +
79                     ", szName UTF-8=" + new String(szName,"UTF-8").trim() +
80                     ", szName GBK=" + new String(szName,"GBK").trim() +
81                     ", PTS=" + PTS +
82                     ", nEventID=" + nEventID +
83                     ", stuUTC=" + stuUTC.toStringTime() +
84                     ", nSequence=" + nSequence +
85                     ", nStateNum=" + nStateNum +
86                     ", stuStates=" + stuStatesStr +
87                     ", nStopVehiclenum=" + nStopVehiclenum +
88                     ", nDetectionAreaVehicleNum=" + nDetectionAreaVehicleNum +
89                     '}';
90         } catch (UnsupportedEncodingException e) {
91             e.printStackTrace();
92         }
93         return null;
94     }
95 }