派生自 development/c++

zhangjixing
2019-01-24 f676f7af18163b4532b6b982bbe1dc57b32e96dd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
#ifndef DBCONNECTSTRUCT
#define DBCONNECTSTRUCT
 
 
//#include <QImage>
#include <QString>
#include <QDateTime>
#include <QVector>
#include <map>
struct Record_Storage_Dev
{
    Record_Storage_Dev()
    {
        n_id = 0;
        str_storage_dev_id = "";
        str_dev_name = "";
        n_total_chn = 0;
        str_all_chn_num = "";
        str_addr = "";
        str_longitude = "";
        str_latitude = "";
        str_ip = "";
        n_port = 0;
        str_username = "";
        str_password = "";
        tim_start_time = QDateTime();
        n_duration = 1;
        str_brand = "";
        str_reserved = "";
    }
 
    int n_id;//自增id
    QString str_storage_dev_id;//磁盘阵列id
    QString str_dev_name;//设备名称
    int n_total_chn;//该设备的总可用通道
    QString str_all_chn_num;//每个通道的通道号
    QString str_addr;//设备地址描述
    QString str_longitude;//设备地址经度
    QString str_latitude;//设备地址维度
    QString str_ip;//ip地址
    int n_port;//ip端口
    QString str_username;//设备的用户名
    QString str_password;//设备的密码
    QDateTime tim_start_time;//开始下载的文件的时间
    int n_duration;//每次下载的时间长度,单位:小时
    QString str_brand;//品牌
    QString str_reserved;//截图地址
};
 
struct Record_Cam_Dev
{
    Record_Cam_Dev()
    {
        n_id = 0;
        str_name = "";
        str_addr = "";
        str_longitude = "";
        str_latitude = "";
        str_cam_dev_id = "";
        str_ip = "";
        n_port = 0;
        str_username = "";
        str_password = "";
        str_brand = "";
        str_reserved = "";
    }
 
    int n_id;//自增id
    QString str_cam_dev_id;//摄像机id
    QString str_name;//通道对应的摄像机名称
    QString str_addr;//通道对应的摄像机地址描述
    QString str_longitude;//通道对应的摄像机地址经度
    QString str_latitude;//通道对应的摄像机地址维度
    QString str_ip;//摄像机ip
    int n_port;//摄像机port
    QString str_username;//摄像机用户名
    QString str_password;//摄像机密码
    QString str_brand;//摄像机品牌
    QString str_reserved;//预留
};
 
struct Record_Cam_Chn
{
 
    Record_Cam_Chn()
    {
        n_id = 0;
        str_storage_dev_id = "";
        n_chn = 0;
        str_name = "";
        str_addr = "";
        str_longitude = "";
        str_latitude = "";
        tim_do_time = QDateTime();
        tim_update_time = QDateTime();
//        str_cam_dev_id = "";
//        str_ip = "";
//        n_port = 0;
//        str_username = "";
//        str_password = "";
//        str_brand = "";
        str_reserved = "";
    }
 
 
    int n_id;//自增id
    QString str_storage_dev_id;//磁盘阵列id
    int n_chn;//通道号
    QString str_name;//通道对应的摄像机名称
    QString str_addr;//通道对应的摄像机地址描述
    QString str_longitude;//通道对应的摄像机地址经度
    QString str_latitude;//通道对应的摄像机地址维度
    QDateTime tim_do_time;//即将下载的文件的开始时间
    QDateTime tim_update_time;//记录更新时间
//    QString str_cam_dev_id;//摄像机id
//    QString str_ip;//摄像机ip
//    int n_port;//摄像机port
//    QString str_username;//摄像机用户名
//    QString str_password;//摄像机密码
//    QString str_brand;//摄像机品牌
    QString str_reserved;//预留
};
 
struct Record_Load_File_info
{
 
//    Record_Load_File_info()
//    {
//        n_id = 0;
//        str_storage_dev_id = "";
//        n_chn = 0;
//        tim_do_time = QDateTime();
//        b_finish_flag = 0;
//        str_load_file_path = "";
//        tim_update_time = QDateTime();
//        str_reserved = "";
//    }
 
    int n_id;//自增id
    QString str_storage_dev_id;//磁盘阵列id
    int n_chn;//通道号
    QDateTime tim_do_time;//正在下载的文件的开始时间
    int b_finish_flag;//下载完成标志
    QString str_load_file_path;//下载文件保存路径
    QDateTime tim_update_time;//记录更新时间
    QString str_reserved;//预留
};
 
struct Record_Cut_Video_info
{
 
//    Record_Cut_Video_info()
//    {
//        n_id = 0;
//        str_storage_dev_id = "";
//        n_chn = 0;
//        str_src_path = "";
//        str_dst_path = "";
//        n_total = 0;
//        b_finish_flag = 0;
//        tim_update_time = QDateTime();
//        str_reserved = "";
//    }
 
    int n_id;//自增id
    QString str_storage_dev_id;//磁盘阵列id
    int n_chn;//通道号
    QString str_src_path;//下载文件保存路径
    QString str_dst_path;//裁剪完的文件保存路径
    int n_total;//裁剪后的视频总数
    int b_finish_flag;//下载完成标志
    QDateTime tim_update_time;//记录更新时间
    QString str_reserved;//预留
};
 
struct Record_Sdk_Hdl_info
{
 
//    Record_Sdk_Hdl_info()
//    {
//        n_id = 0;
//        str_storage_dev_id = "";
//        n_chn = 0;
//        str_src_path = "";
//        n_total = 0;
//        n_pos = 0;
//        str_reserved = "";
//    }
 
    int n_id;//自增id
    QString str_storage_dev_id;//磁盘阵列id
    int n_chn;//通道号
    QString str_src_path;//裁剪后,待sdk处理的文件路径
    int n_total;//裁剪后的视频总数
    int n_pos;//处理完的文件的序号
    QString str_reserved;//预留
};
 
struct Record_Chn_Sdk
{
 
    Record_Chn_Sdk()
    {
        n_id = 0;
        str_storage_dev_id = "";
        n_chn = 0;
        str_sdks = "";
        str_det_thr = "";
        str_cmp_thr = "";
//        str_cam_dev_id = "";
        str_reserved = "";
    }
 
    int n_id;//自增id
    QString str_storage_dev_id;//磁盘阵列id
    int n_chn;//通道号
    QString str_sdks;//该通道要使用的sdk种类,人脸-1,yolo-2,车牌-3,其他-4
    QString str_det_thr;//该通道要使用的检测阈值,人脸阈值-1,yolo阈值-2,车牌阈值-3,其他阈值-4
    QString str_cmp_thr;//该通道要使用的比对阈值,人脸阈值-1,yolo阈值-2,车牌阈值-3,其他阈值-4
//    QString str_cam_dev_id;//摄像机id
    QString str_reserved;//预留
};
 
struct Record_Cam_Sdk
{
 
    Record_Cam_Sdk()
    {
        n_id = 0;
        str_cam_dev_id = "";
        str_sdks = "";
        str_det_thr = "";
        str_cmp_thr = "";
        str_reserved = "";
    }
 
    int n_id;//自增id
    QString str_cam_dev_id;//摄像机id
    QString str_sdks;//该通道要使用的sdk种类,人脸-1,车牌-2,yolo-3,其他-4
    QString str_det_thr;//该通道要使用的检测阈值,人脸阈值-1,车牌阈值-2,yolo阈值-3,其他阈值-4
    QString str_cmp_thr;//该通道要使用的比对阈值,人脸阈值-1,车牌阈值-2,yolo阈值-3,其他阈值-4
    QString str_reserved;//预留
};
 
struct Record_Config
{
    Record_Config()
    {
        str_alarm_ip = "";
        n_alarm_port = 0;
        str_web_pic_ip = "";
        n_web_pic_port = 0;
        str_es_pic_ip = "";
        n_es_pic_port = 0;
        n_cut_max_duration = 20;
        n_cut_min_duration = 5;
        n_dev_type = 0;
        str_reserved = "";
        dev_id = "";
        dev_name= "";
    }
 
    QString str_alarm_ip;//报警服务器ip
    int n_alarm_port;//报警服务器端口
    QString str_web_pic_ip;//web端图片服务器ip
    int n_web_pic_port;//web端图片服务器端口
    QString str_es_pic_ip;//ES端图片服务器ip
    int n_es_pic_port;//ES端图片服务器端口
    int n_cut_max_duration;//裁剪视频最长
    int n_cut_min_duration;//裁剪视频最duan
    int n_dev_type;//0:no dev; 1:storage; 2:camera
    QString str_reserved;//预留
    QString dev_id;
    QString dev_name;
};
 
struct LActRuleWeekRecord
{
    LActRuleWeekRecord()
    {
        m_strCamId="";
        m_nSdkType=0;
        m_nType = 0;
        m_strBegin = "";
        m_strEnd = "";
    }
    QString m_strCamId;
    int m_nSdkType;
    int m_nType; //周几
    QString m_strBegin;
    QString m_strEnd;
};
 
 
struct SdkRule
{
    SdkRule()
    {
        nIsRun=0;
        nSdkType = 0 ;
        strCamId = "";
        strAreas = "";
        strLine = "";
        strImageUrl = "";
        nTriggerTolerance = 0;
        nTriggerDelay=0;
        nQuality=0;
        nThreshold=0;
        nAlarmNumUpperLimit = 0;
        nAlarmNumLowerLimit = 0;
        fSensitivity=0;
        strExAreas="";
        strLine="";
        strAddr="";
    }
    int nSdkType;
    QString strCamId;
    QString strAreas; //监测区域
    QString strExAreas;
    QString strLine; //分割线
    QString strExLine;
    QString strImageUrl; //划区域的图片路径
    QString strBroadcast;
    QString strAddr;
    int nTriggerTolerance;
    int nTriggerDelay; //延迟时间(秒)
    int nQuality;
    int nThreshold;//阈值
    float fSensitivity;
    int nAlarmNumUpperLimit; //报警人数(人员拥挤)
    int nAlarmNumLowerLimit;
    int nIsRun;
 
    std::vector<LActRuleWeekRecord> weekRuleVec;
};
typedef std::map<int,SdkRule> SdkRuleMap;
enum SdkType
{
    SdkTypeStart=0,
    FaceSdk,
    CarSdk,
    YoloSdk,   //人体
    PerimeterSdk,
    CrowdSdk,  //人员拥挤
    KeepRightSdk,
    PerHubSdk,    //人员异常7
    PerStaticSdk,  //个体静止8
    SdkTypeEnd
 
};
 
#endif // DBCONNECTSTRUCT