提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
|
|
4 |
/** |
|
5 |
* @author 421657 |
|
6 |
* @description 灯光类型 |
|
7 |
* @origin autoTool |
|
8 |
* @date 2023/10/19 17:27:53 |
|
9 |
*/ |
|
10 |
public enum EM_LC_LIGHT_TYPE { |
|
11 |
/** |
|
12 |
* 未知 |
|
13 |
*/ |
|
14 |
EM_LC_LIGHT_TYPE_UNKNOWN(0, "未知"), |
|
15 |
/** |
|
16 |
* 红外灯 |
|
17 |
*/ |
|
18 |
EM_LC_LIGHT_TYPE_INFRAREDLIGHT(1, "红外灯"), |
|
19 |
/** |
|
20 |
* 白光灯 |
|
21 |
*/ |
|
22 |
EM_LC_LIGHT_TYPE_WIHTELIGHT(2, "白光灯"), |
|
23 |
/** |
|
24 |
* 激光灯 |
|
25 |
*/ |
|
26 |
EM_LC_LIGHT_TYPE_LASERLIGHT(3, "激光灯"), |
|
27 |
/** |
|
28 |
* 智能混光灯(根据智能ID切换红外和白光灯) |
|
29 |
*/ |
|
30 |
EM_LC_LIGHT_TYPE_AIMIXLIGHT(4, "智能混光灯(根据智能ID切换红外和白光灯)"), |
|
31 |
/** |
|
32 |
* 指示灯 |
|
33 |
*/ |
|
34 |
EM_LC_LIGHT_TYPE_PILOTLIGHT(5, "指示灯"); |
|
35 |
|
|
36 |
private int value; |
|
37 |
|
|
38 |
private String note; |
|
39 |
|
|
40 |
public String getNote() { |
|
41 |
return note; |
|
42 |
} |
|
43 |
|
|
44 |
public int getValue() { |
|
45 |
return value; |
|
46 |
} |
|
47 |
|
|
48 |
EM_LC_LIGHT_TYPE(int givenValue, String note) { |
|
49 |
this.value = givenValue; |
|
50 |
this.note = note; |
|
51 |
} |
|
52 |
|
|
53 |
public static String getNoteByValue(int givenValue) { |
|
54 |
for (EM_LC_LIGHT_TYPE enumType : EM_LC_LIGHT_TYPE.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_LC_LIGHT_TYPE enumType : EM_LC_LIGHT_TYPE.values()) { |
|
64 |
if (givenNote.equals(enumType.getNote())) { |
|
65 |
return enumType.getValue(); |
|
66 |
} |
|
67 |
} |
|
68 |
return -1; |
|
69 |
} |
|
70 |
|
|
71 |
public static EM_LC_LIGHT_TYPE getEnum(int value) { |
|
72 |
for (EM_LC_LIGHT_TYPE e : EM_LC_LIGHT_TYPE.values()) { |
|
73 |
if (e.getValue() == value) { |
|
74 |
return e; |
|
75 |
} |
|
76 |
} |
|
77 |
return EM_LC_LIGHT_TYPE.EM_LC_LIGHT_TYPE_UNKNOWN; |
|
78 |
} |
|
79 |
|
|
80 |
} |