提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* @author 251823 |
|
5 |
* @description 传感器方式 |
|
6 |
* @date 2023/03/16 14:52:52 |
|
7 |
*/ |
|
8 |
public enum EM_CODEID_SENSE_METHOD_TYPE { |
|
9 |
/** |
|
10 |
* 未知的 |
|
11 |
*/ |
|
12 |
EM_CODEID_SENSE_METHOD_TYPE_UNKOWN(0, "未知的"), |
|
13 |
/** |
|
14 |
* 门磁 |
|
15 |
*/ |
|
16 |
EM_CODEID_SENSE_METHOD_TYPE_DOOR_MAGNETISM(1, "门磁"), |
|
17 |
/** |
|
18 |
* 燃气传感 |
|
19 |
*/ |
|
20 |
EM_CODEID_SENSE_METHOD_TYPE_GAS_SENSOR(2, "燃气传感"), |
|
21 |
/** |
|
22 |
* 幕帘传感器 |
|
23 |
*/ |
|
24 |
EM_CODEID_SENSE_METHOD_TYPE_CURTAIN_SENSOR(3, "幕帘传感器"), |
|
25 |
/** |
|
26 |
* 移动传感器 |
|
27 |
*/ |
|
28 |
EM_CODEID_SENSE_METHOD_TYPE_MOBILE_SENSOR(4, "移动传感器"), |
|
29 |
/** |
|
30 |
* 被动红外传感器 |
|
31 |
*/ |
|
32 |
EM_CODEID_SENSE_METHOD_TYPE_PASSIVEINFRA(5, "被动红外传感器"), |
|
33 |
/** |
|
34 |
* 紧急按钮 |
|
35 |
*/ |
|
36 |
EM_CODEID_SENSE_METHOD_TYPE_URGENCY_BUTTON(6, "紧急按钮"), |
|
37 |
/** |
|
38 |
* 烟雾传感器 |
|
39 |
*/ |
|
40 |
EM_CODEID_SENSE_METHOD_TYPE_SMOKING_SENSOR(7, "烟雾传感器"), |
|
41 |
/** |
|
42 |
* 双鉴传感器(红外+微波) |
|
43 |
*/ |
|
44 |
EM_CODEID_SENSE_METHOD_TYPE_DOUBLEMETHOD(8, "双鉴传感器(红外+微波)"), |
|
45 |
/** |
|
46 |
* 水浸传感器 |
|
47 |
*/ |
|
48 |
EM_CODEID_SENSE_METHOD_TYPE_WATER_SENSOR(9, "水浸传感器"), |
|
49 |
/** |
|
50 |
* 三技术 |
|
51 |
*/ |
|
52 |
EM_CODEID_SENSE_METHOD_TYPE_THREEMETHOD(10, "三技术"); |
|
53 |
|
|
54 |
private int value; |
|
55 |
|
|
56 |
private String note; |
|
57 |
|
|
58 |
public String getNote() { |
|
59 |
return note; |
|
60 |
} |
|
61 |
|
|
62 |
public int getValue() { |
|
63 |
return value; |
|
64 |
} |
|
65 |
|
|
66 |
EM_CODEID_SENSE_METHOD_TYPE(int givenValue, String note) { |
|
67 |
this.value = givenValue; |
|
68 |
this.note = note; |
|
69 |
} |
|
70 |
|
|
71 |
public static String getNoteByValue(int givenValue) { |
|
72 |
for (EM_CODEID_SENSE_METHOD_TYPE enumType : EM_CODEID_SENSE_METHOD_TYPE.values()) { |
|
73 |
if (givenValue == enumType.getValue()) { |
|
74 |
return enumType.getNote(); |
|
75 |
} |
|
76 |
} |
|
77 |
return null; |
|
78 |
} |
|
79 |
|
|
80 |
public static int getValueByNote(String givenNote) { |
|
81 |
for (EM_CODEID_SENSE_METHOD_TYPE enumType : EM_CODEID_SENSE_METHOD_TYPE.values()) { |
|
82 |
if (givenNote.equals(enumType.getNote())) { |
|
83 |
return enumType.getValue(); |
|
84 |
} |
|
85 |
} |
|
86 |
return -1; |
|
87 |
} |
|
88 |
} |