提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* @author 251823 |
|
5 |
* @description 控制模式 |
|
6 |
* @date 2021/09/01 |
|
7 |
*/ |
|
8 |
public enum EM_CONTROL_MODE { |
|
9 |
// 未知 |
|
10 |
EM_CONTROL_UNKNOWN(0, "未知"), |
|
11 |
// 黄闪控制 |
|
12 |
EM_CONTROL_YELLOW_FLASH(1, "黄闪控制"), |
|
13 |
// 多时段控制 |
|
14 |
EM_CONTROL_MULITI_TIME(2, "多时段控制"), |
|
15 |
// 手动控制 |
|
16 |
EM_CONTROL_MANUAL(3, "手动控制"), |
|
17 |
// 感应控制 |
|
18 |
EM_CONTROL_INDUCTION(4, "感应控制"), |
|
19 |
// 无电缆协调控制 |
|
20 |
EM_CONTROL_WIRELESS_COORDINATION(5, "无电缆协调控制"), |
|
21 |
// 单点协调控制 |
|
22 |
EM_CONTROL_SINGLE_OPTIMIZATION(6, "单点协调控制"), |
|
23 |
//公交信号优先 |
|
24 |
EM_CONTROL_BUS_SINGAL(7, "公交信号优先"), |
|
25 |
// 紧急信号优先 |
|
26 |
EM_CONTROL_EMERGENCY_SINGAL(8, "紧急信号优先"), |
|
27 |
// 其他 |
|
28 |
EM_CONTROL_OTHER(9, "其他"); |
|
29 |
|
|
30 |
private int value; |
|
31 |
private String note; |
|
32 |
|
|
33 |
private EM_CONTROL_MODE(int givenValue, String note) { |
|
34 |
this.value = givenValue; |
|
35 |
this.note = note; |
|
36 |
} |
|
37 |
|
|
38 |
public String getNote() { |
|
39 |
return note; |
|
40 |
} |
|
41 |
|
|
42 |
public int getValue() { |
|
43 |
return value; |
|
44 |
} |
|
45 |
|
|
46 |
public static String getNoteByValue(int givenValue) { |
|
47 |
for (EM_CONTROL_MODE enumType : EM_CONTROL_MODE.values()) { |
|
48 |
if (givenValue == enumType.getValue()) { |
|
49 |
return enumType.getNote(); |
|
50 |
} |
|
51 |
} |
|
52 |
return null; |
|
53 |
} |
|
54 |
|
|
55 |
public static int getValueByNote(String givenNote) { |
|
56 |
for (EM_CONTROL_MODE enumType : EM_CONTROL_MODE.values()) { |
|
57 |
if (givenNote.equals(enumType.getNote())) { |
|
58 |
return enumType.getValue(); |
|
59 |
} |
|
60 |
} |
|
61 |
return -1; |
|
62 |
} |
|
63 |
|
|
64 |
} |