提交 | 用户 | 时间
|
ce910c
|
1 |
package com.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
|
|
4 |
/** |
|
5 |
* @author 291189 |
|
6 |
* @description 事件报警类型 |
|
7 |
* @date 2022/08/22 16:50:06 |
|
8 |
*/ |
|
9 |
public enum EM_WATER_DETECTION_ALARM_TYPE { |
|
10 |
/** |
|
11 |
未知 |
|
12 |
*/ |
|
13 |
EM_WATER_DETECTION_ALARM_TYPE_UNKNOWN(0,"未知"), |
|
14 |
/** |
|
15 |
水质类别 |
|
16 |
*/ |
|
17 |
EM_WATER_DETECTION_ALARM_TYPE_QUALITY(1,"水质类别"), |
|
18 |
/** |
|
19 |
PH |
|
20 |
*/ |
|
21 |
EM_WATER_DETECTION_ALARM_TYPE_PH(2,"PH"), |
|
22 |
/** |
|
23 |
浊度值 |
|
24 |
*/ |
|
25 |
EM_WATER_DETECTION_ALARM_TYPE_NTU(3,"浊度值"), |
|
26 |
/** |
|
27 |
氨氮值 |
|
28 |
*/ |
|
29 |
EM_WATER_DETECTION_ALARM_TYPE_NH3_N(4,"氨氮值"), |
|
30 |
/** |
|
31 |
总氮值 |
|
32 |
*/ |
|
33 |
EM_WATER_DETECTION_ALARM_TYPE_TN(5,"总氮值"), |
|
34 |
/** |
|
35 |
透明度值 |
|
36 |
*/ |
|
37 |
EM_WATER_DETECTION_ALARM_TYPE_SD(6,"透明度值"), |
|
38 |
/** |
|
39 |
化学需氧量 |
|
40 |
*/ |
|
41 |
EM_WATER_DETECTION_ALARM_TYPE_COD(7,"化学需氧量"), |
|
42 |
/** |
|
43 |
亚硝酸盐氮 |
|
44 |
*/ |
|
45 |
EM_WATER_DETECTION_ALARM_TYPE_NN(8,"亚硝酸盐氮"), |
|
46 |
/** |
|
47 |
溶解氧 |
|
48 |
*/ |
|
49 |
EM_WATER_DETECTION_ALARM_TYPE_DO(9,"溶解氧"), |
|
50 |
/** |
|
51 |
叶绿素a |
|
52 |
*/ |
|
53 |
EM_WATER_DETECTION_ALARM_TYPE_CHL_A(10,"叶绿素a"), |
|
54 |
/** |
|
55 |
总磷 |
|
56 |
*/ |
|
57 |
EM_WATER_DETECTION_ALARM_TYPE_TP(11,"总磷"), |
|
58 |
/** |
|
59 |
高锰酸盐指数范围 |
|
60 |
*/ |
|
61 |
EM_WATER_DETECTION_ALARM_TYPE_CODMN(12,"高锰酸盐指数范围"), |
|
62 |
/** |
|
63 |
悬浮物 |
|
64 |
*/ |
|
65 |
EM_WATER_DETECTION_ALARM_TYPE_SS(13,"悬浮物"), |
|
66 |
/** |
|
67 |
五日生化需氧量 |
|
68 |
*/ |
|
69 |
EM_WATER_DETECTION_ALARM_TYPE_BOD_5(14,"五日生化需氧量"), |
|
70 |
/** |
|
71 |
硝酸盐 |
|
72 |
*/ |
|
73 |
EM_WATER_DETECTION_ALARM_TYPE_NO3_N(15,"硝酸盐"), |
|
74 |
/** |
|
75 |
富营养状况指数 |
|
76 |
*/ |
|
77 |
EM_WATER_DETECTION_ALARM_TYPE_TSI(16,"富营养状况指数"), |
|
78 |
/** |
|
79 |
黑臭等级 |
|
80 |
*/ |
|
81 |
EM_WATER_DETECTION_ALARM_TYPE_SMELLY_LEVEL(17,"黑臭等级"); |
|
82 |
|
|
83 |
private int value; |
|
84 |
|
|
85 |
private String note; |
|
86 |
|
|
87 |
public String getNote() { |
|
88 |
return note; |
|
89 |
} |
|
90 |
|
|
91 |
public int getValue() { |
|
92 |
return value; |
|
93 |
} |
|
94 |
|
|
95 |
EM_WATER_DETECTION_ALARM_TYPE(int givenValue, String note) { |
|
96 |
this.value = givenValue; |
|
97 |
this.note = note; |
|
98 |
} |
|
99 |
|
|
100 |
public static String getNoteByValue(int givenValue) { |
|
101 |
for (EM_WATER_DETECTION_ALARM_TYPE enumType : EM_WATER_DETECTION_ALARM_TYPE.values()) { |
|
102 |
if (givenValue == enumType.getValue()) { |
|
103 |
return enumType.getNote(); |
|
104 |
} |
|
105 |
} |
|
106 |
return null; |
|
107 |
} |
|
108 |
|
|
109 |
public static int getValueByNote(String givenNote) { |
|
110 |
for (EM_WATER_DETECTION_ALARM_TYPE enumType : EM_WATER_DETECTION_ALARM_TYPE.values()) { |
|
111 |
if (givenNote.equals(enumType.getNote())) { |
|
112 |
return enumType.getValue(); |
|
113 |
} |
|
114 |
} |
|
115 |
return -1; |
|
116 |
} |
|
117 |
|
|
118 |
public static EM_WATER_DETECTION_ALARM_TYPE getEnum(int value) { |
|
119 |
for (EM_WATER_DETECTION_ALARM_TYPE e : EM_WATER_DETECTION_ALARM_TYPE.values()) { |
|
120 |
if (e.getValue() == value) |
|
121 |
return e; |
|
122 |
} |
|
123 |
return EM_WATER_DETECTION_ALARM_TYPE.EM_WATER_DETECTION_ALARM_TYPE_UNKNOWN; |
|
124 |
} |
|
125 |
|
|
126 |
} |