提交 | 用户 | 时间
|
ce910c
|
1 |
package com.netsdk.lib.enumeration; |
H |
2 |
/** |
|
3 |
* @author 251823 |
|
4 |
* @description 云台不支持的转动方向 |
|
5 |
* @date 2021/02/05 |
|
6 |
*/ |
|
7 |
public enum EM_PTZ_UNSUPPORT_DIRECTION { |
|
8 |
|
|
9 |
// 未知 |
|
10 |
EM_PTZ_UNSUPPORT_DIRECTION_UNKNOWN(0, "未知"), |
|
11 |
|
|
12 |
// 上 |
|
13 |
EM_PTZ_UNSUPPORT_DIRECTION_UP(1, "上"), |
|
14 |
|
|
15 |
// 下 |
|
16 |
EM_PTZ_UNSUPPORT_DIRECTION_DOWN(2, "下"), |
|
17 |
|
|
18 |
// 左 |
|
19 |
EM_PTZ_UNSUPPORT_DIRECTION_LEFT(3, "左"), |
|
20 |
|
|
21 |
// 右 |
|
22 |
EM_PTZ_UNSUPPORT_DIRECTION_RIGHT(4, "右"), |
|
23 |
|
|
24 |
// 左上 |
|
25 |
EM_PTZ_UNSUPPORT_DIRECTION_LEFTUP(5, "左上"), |
|
26 |
|
|
27 |
// 右上 |
|
28 |
EM_PTZ_UNSUPPORT_DIRECTION_RIGHTUP(6, "右上"), |
|
29 |
|
|
30 |
// 左下 |
|
31 |
EM_PTZ_UNSUPPORT_DIRECTION_LEFTDOWN(7, "左下"), |
|
32 |
|
|
33 |
// 右下 |
|
34 |
EM_PTZ_UNSUPPORT_DIRECTION_RIGHTDOWN(8, "右下"); |
|
35 |
|
|
36 |
|
|
37 |
private int value; |
|
38 |
private String note; |
|
39 |
|
|
40 |
private EM_PTZ_UNSUPPORT_DIRECTION(int givenValue, String note) { |
|
41 |
this.value = givenValue; |
|
42 |
this.note = note; |
|
43 |
} |
|
44 |
|
|
45 |
public String getNote() { |
|
46 |
return note; |
|
47 |
} |
|
48 |
|
|
49 |
public int getValue() { |
|
50 |
return value; |
|
51 |
} |
|
52 |
|
|
53 |
public static String getNoteByValue(int givenValue) { |
|
54 |
for (EM_PTZ_UNSUPPORT_DIRECTION enumType : EM_PTZ_UNSUPPORT_DIRECTION.values()) { |
|
55 |
if (givenValue == enumType.getValue()) { |
|
56 |
return enumType.getNote(); |
|
57 |
} |
|
58 |
} |
|
59 |
return null; |
|
60 |
} |
|
61 |
|
|
62 |
public static int getValueByNote(String givenNote) { |
|
63 |
for (EM_PTZ_UNSUPPORT_DIRECTION enumType : EM_PTZ_UNSUPPORT_DIRECTION.values()) { |
|
64 |
if (givenNote.equals(enumType.getNote())) { |
|
65 |
return enumType.getValue(); |
|
66 |
} |
|
67 |
} |
|
68 |
return -1; |
|
69 |
} |
|
70 |
|
|
71 |
} |