提交 | 用户 | 时间
|
ce910c
|
1 |
package com.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
|
|
4 |
/** |
|
5 |
* @author 421657 |
|
6 |
* @description 云台功能 |
|
7 |
* @origin autoTool |
|
8 |
* @date 2023/10/16 19:23:11 |
|
9 |
*/ |
|
10 |
public enum EM_PTZ_FUNCTION { |
|
11 |
/** |
|
12 |
* 未知 |
|
13 |
*/ |
|
14 |
NET_EM_PTZ_FUNCTION_UNKNOWN(0, "未知"), |
|
15 |
/** |
|
16 |
* None |
|
17 |
*/ |
|
18 |
NET_EM_PTZ_FUNCTION_NONE(1, "None"), |
|
19 |
/** |
|
20 |
* Scan功能 |
|
21 |
*/ |
|
22 |
NET_EM_PTZ_FUNCTION_SCAN(2, "Scan功能"), |
|
23 |
/** |
|
24 |
* Pattern功能 |
|
25 |
*/ |
|
26 |
NET_EM_PTZ_FUNCTION_PATTERN(3, "Pattern功能"), |
|
27 |
/** |
|
28 |
* Tour功能 |
|
29 |
*/ |
|
30 |
NET_EM_PTZ_FUNCTION_TOUR(4, "Tour功能"), |
|
31 |
/** |
|
32 |
* AutoPan功能 |
|
33 |
*/ |
|
34 |
NET_EM_PTZ_FUNCTION_AUTOPAN(5, "AutoPan功能"), |
|
35 |
/** |
|
36 |
* Preset功能 |
|
37 |
*/ |
|
38 |
NET_EM_PTZ_FUNCTION_PRESET(6, "Preset功能"), |
|
39 |
/** |
|
40 |
* HeatMap功能 |
|
41 |
*/ |
|
42 |
NET_EM_PTZ_FUNCTION_HEATMAP(7, "HeatMap功能"), |
|
43 |
/** |
|
44 |
* Patrol功能 |
|
45 |
*/ |
|
46 |
NET_EM_PTZ_FUNCTION_PATROL(8, "Patrol功能"); |
|
47 |
|
|
48 |
private int value; |
|
49 |
|
|
50 |
private String note; |
|
51 |
|
|
52 |
public String getNote() { |
|
53 |
return note; |
|
54 |
} |
|
55 |
|
|
56 |
public int getValue() { |
|
57 |
return value; |
|
58 |
} |
|
59 |
|
|
60 |
EM_PTZ_FUNCTION(int givenValue, String note) { |
|
61 |
this.value = givenValue; |
|
62 |
this.note = note; |
|
63 |
} |
|
64 |
|
|
65 |
public static String getNoteByValue(int givenValue) { |
|
66 |
for (EM_PTZ_FUNCTION enumType : EM_PTZ_FUNCTION.values()) { |
|
67 |
if (givenValue == enumType.getValue()) { |
|
68 |
return enumType.getNote(); |
|
69 |
} |
|
70 |
} |
|
71 |
return null; |
|
72 |
} |
|
73 |
|
|
74 |
public static int getValueByNote(String givenNote) { |
|
75 |
for (EM_PTZ_FUNCTION enumType : EM_PTZ_FUNCTION.values()) { |
|
76 |
if (givenNote.equals(enumType.getNote())) { |
|
77 |
return enumType.getValue(); |
|
78 |
} |
|
79 |
} |
|
80 |
return -1; |
|
81 |
} |
|
82 |
|
|
83 |
public static EM_PTZ_FUNCTION getEnum(int value) { |
|
84 |
for (EM_PTZ_FUNCTION e : EM_PTZ_FUNCTION.values()) { |
|
85 |
if (e.getValue() == value) { |
|
86 |
return e; |
|
87 |
} |
|
88 |
} |
|
89 |
return EM_PTZ_FUNCTION.NET_EM_PTZ_FUNCTION_UNKNOWN; |
|
90 |
} |
|
91 |
|
|
92 |
} |