提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.lib.structure.customize; |
H |
2 |
|
|
3 |
import com.iailab.netsdk.lib.NetSDKLib; |
|
4 |
import com.iailab.netsdk.lib.Utils; |
|
5 |
import com.iailab.netsdk.lib.structure.NET_TIME; |
|
6 |
|
|
7 |
import java.nio.charset.Charset; |
|
8 |
import java.util.ArrayList; |
|
9 |
import java.util.Arrays; |
|
10 |
import java.util.List; |
|
11 |
|
|
12 |
/** |
|
13 |
* @author 47081 |
|
14 |
* @version 1.0 |
|
15 |
* @description ERR210301049主动注册重新定向, 结构体, 日常使用以structure包和NetSDKLib下的同名结构体为主 |
|
16 |
* @date 2021/3/17 |
|
17 |
*/ |
|
18 |
public class MEDIAFILE_FACERECOGNITION_INFO extends NetSDKLib.SdkStructure { |
|
19 |
/** 结构体大小 */ |
|
20 |
public int dwSize; |
|
21 |
/** 报警发生时间 */ |
|
22 |
public NET_TIME stTime; |
|
23 |
/** 报警发生地点 */ |
|
24 |
public byte[] szAddress = new byte[260]; |
|
25 |
/** 通道号 */ |
|
26 |
public int nChannelId; |
|
27 |
/** 当前人脸匹配到的候选对象(扩展结构体) 数量 */ |
|
28 |
public int nCandidateExNum; |
|
29 |
/** 当前人脸匹配到的候选对象信息, 实际返回个数同nCandidateNum */ |
|
30 |
// public CANDIDATE_INFO_CEX[] stuCandidatesEx = (CANDIDATE_INFO_CEX[]) new CANDIDATE_INFO_CEX().toArray(50); |
|
31 |
public CANDIDATE_INFO_CEX[] stuCandidatesEx = new CANDIDATE_INFO_CEX[50]; |
|
32 |
|
|
33 |
public MEDIAFILE_FACERECOGNITION_INFO() { |
|
34 |
|
|
35 |
for(int i=0;i<stuCandidatesEx.length;i++){ |
|
36 |
stuCandidatesEx[i]=new CANDIDATE_INFO_CEX(); |
|
37 |
} |
|
38 |
|
|
39 |
this.dwSize = this.size(); |
|
40 |
} |
|
41 |
|
|
42 |
public void setAddress(String address) { |
|
43 |
byte[] data = address.getBytes(Charset.forName(Utils.getPlatformEncode())); |
|
44 |
System.arraycopy(data, 0, szAddress, 0, data.length); |
|
45 |
} |
|
46 |
|
|
47 |
public String getAddress() { |
|
48 |
return new String(szAddress, Charset.forName(Utils.getPlatformEncode())).trim(); |
|
49 |
} |
|
50 |
|
|
51 |
public List<CANDIDATE_INFO_CEX> getCandidateInfos() { |
|
52 |
return new ArrayList<>(Arrays.asList(stuCandidatesEx).subList(0, nCandidateExNum)); |
|
53 |
} |
|
54 |
|
|
55 |
@Override |
|
56 |
public String toString() { |
|
57 |
return "MEDIAFILE_FACERECOGNITION_INFO{" |
|
58 |
+ "stTime=" |
|
59 |
+ stTime.toStringTime() |
|
60 |
+ ", szAddress=" |
|
61 |
+ getAddress() |
|
62 |
+ ", nChannelId=" |
|
63 |
+ nChannelId |
|
64 |
+ ", nCandidateExNum=" |
|
65 |
+ nCandidateExNum |
|
66 |
+ ", stuCandidatesEx=" |
|
67 |
+ getCandidateInfos().toString() |
|
68 |
+ '}'; |
|
69 |
} |
|
70 |
} |