提交 | 用户 | 时间
|
ce910c
|
1 |
package com.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
|
|
4 |
/** |
|
5 |
* @author 291189 |
|
6 |
* @description 仪表类型 |
|
7 |
* @date 2022/06/30 11:30:53 |
|
8 |
*/ |
|
9 |
public enum EM_DIALDETECT_TYPE { |
|
10 |
/** |
|
11 |
未知 |
|
12 |
*/ |
|
13 |
EM_DIALDETECT_TYPE_UNKNOWN(0,"未知"), |
|
14 |
/** |
|
15 |
压板检测 |
|
16 |
*/ |
|
17 |
EM_DIALDETECT_TYPE_PLATEN(1,"压板检测"), |
|
18 |
/** |
|
19 |
刀闸检测 |
|
20 |
*/ |
|
21 |
EM_DIALDETECT_TYPE_KNIFE(2,"刀闸检测"), |
|
22 |
/** |
|
23 |
指针表计检测 |
|
24 |
*/ |
|
25 |
EM_DIALDETECT_TYPE_POINTERMETER(3,"指针表计检测"), |
|
26 |
/** |
|
27 |
油位表计 |
|
28 |
*/ |
|
29 |
EM_DIALDETECT_TYPE_OILMETER(4,"油位表计"), |
|
30 |
/** |
|
31 |
数码管字符检测 |
|
32 |
*/ |
|
33 |
EM_DIALDETECT_TYPE_LED(5,"数码管字符检测"), |
|
34 |
/** |
|
35 |
液晶屏字符检测 |
|
36 |
*/ |
|
37 |
EM_DIALDETECT_TYPE_LCD(6,"液晶屏字符检测"), |
|
38 |
/** |
|
39 |
指示灯检测 |
|
40 |
*/ |
|
41 |
EM_DIALDETECT_TYPE_LIGHT(7,"指示灯检测"), |
|
42 |
/** |
|
43 |
旋转开关检测 |
|
44 |
*/ |
|
45 |
EM_DIALDETECT_TYPE_SWITCH(8,"旋转开关检测"), |
|
46 |
/** |
|
47 |
呼吸器检测 |
|
48 |
*/ |
|
49 |
EM_DIALDETECT_TYPE_PESPIRATOR(9,"呼吸器检测"), |
|
50 |
/** |
|
51 |
字符指示器检测 |
|
52 |
*/ |
|
53 |
EM_DIALDETECT_TYPE_CHARLNDICTOR(10,"字符指示器检测"), |
|
54 |
/** |
|
55 |
指针指示器检测 |
|
56 |
*/ |
|
57 |
EM_DIALDETECT_TYPE_POINTERLNDICTOR(11,"指针指示器检测"), |
|
58 |
/** |
|
59 |
液位计检测 |
|
60 |
*/ |
|
61 |
EM_DIALDETECT_TYPE_OILLEVEL(12,"液位计检测"), |
|
62 |
/** |
|
63 |
拨码盘字符检测 |
|
64 |
*/ |
|
65 |
EM_DIALDETECT_TYPE_DIALSWTICH(13,"拨码盘字符检测"); |
|
66 |
|
|
67 |
private int value; |
|
68 |
|
|
69 |
private String note; |
|
70 |
|
|
71 |
public String getNote() { |
|
72 |
return note; |
|
73 |
} |
|
74 |
|
|
75 |
public int getValue() { |
|
76 |
return value; |
|
77 |
} |
|
78 |
|
|
79 |
EM_DIALDETECT_TYPE(int givenValue, String note) { |
|
80 |
this.value = givenValue; |
|
81 |
this.note = note; |
|
82 |
} |
|
83 |
|
|
84 |
public static String getNoteByValue(int givenValue) { |
|
85 |
for (EM_DIALDETECT_TYPE enumType : EM_DIALDETECT_TYPE.values()) { |
|
86 |
if (givenValue == enumType.getValue()) { |
|
87 |
return enumType.getNote(); |
|
88 |
} |
|
89 |
} |
|
90 |
return null; |
|
91 |
} |
|
92 |
|
|
93 |
public static int getValueByNote(String givenNote) { |
|
94 |
for (EM_DIALDETECT_TYPE enumType : EM_DIALDETECT_TYPE.values()) { |
|
95 |
if (givenNote.equals(enumType.getNote())) { |
|
96 |
return enumType.getValue(); |
|
97 |
} |
|
98 |
} |
|
99 |
return -1; |
|
100 |
} |
|
101 |
|
|
102 |
public static EM_DIALDETECT_TYPE getEnum(int value) { |
|
103 |
for (EM_DIALDETECT_TYPE e : EM_DIALDETECT_TYPE.values()) { |
|
104 |
if (e.getValue() == value) |
|
105 |
return e; |
|
106 |
} |
|
107 |
return EM_DIALDETECT_TYPE.EM_DIALDETECT_TYPE_UNKNOWN; |
|
108 |
} |
|
109 |
|
|
110 |
} |