提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
|
|
4 |
/** |
|
5 |
* @author 291189 |
|
6 |
* @description 呼叫电梯命令 |
|
7 |
* @date 2022/10/19 14:01:07 |
|
8 |
*/ |
|
9 |
public enum EM_CALLLIFT_CMD { |
|
10 |
/** |
|
11 |
未知 |
|
12 |
*/ |
|
13 |
EM_CALLLIFT_CMD_UNKNOWN(-1,"未知"), |
|
14 |
/** |
|
15 |
呼叫电梯到某个楼层,并开放其它任何楼层数 |
|
16 |
*/ |
|
17 |
EM_CALLLIFT_CMD_ANY_FLOOR(0,"呼叫电梯到某个楼层,并开放其它任何楼层数"), |
|
18 |
/** |
|
19 |
呼叫电梯到某个楼层,用户进去后只能按目标楼层 |
|
20 |
*/ |
|
21 |
EM_CALLLIFT_CMD_DEST_FLOOR(1,"呼叫电梯到某个楼层,用户进去后只能按目标楼层"), |
|
22 |
/** |
|
23 |
呼叫电梯到某个楼层后,还需要刷卡,电梯才能运行, 默认电梯上行 |
|
24 |
*/ |
|
25 |
EM_CALLLIFT_CMD_CARD_UP(2,"呼叫电梯到某个楼层后,还需要刷卡,电梯才能运行, 默认电梯上行"), |
|
26 |
/** |
|
27 |
呼叫电梯到某个楼层,用户进去不用按钮,电梯会自动运行到目标楼层 |
|
28 |
*/ |
|
29 |
EM_CALLLIFT_CMD_AUTO_FLOOR(3,"呼叫电梯到某个楼层,用户进去不用按钮,电梯会自动运行到目标楼层"), |
|
30 |
/** |
|
31 |
呼叫电梯到某个楼层后,还需要刷卡,电梯才能运行, 默认电梯下行 |
|
32 |
*/ |
|
33 |
EM_CALLLIFT_CMD_CARD_DOWN(4,"呼叫电梯到某个楼层后,还需要刷卡,电梯才能运行, 默认电梯下行"); |
|
34 |
|
|
35 |
private int value; |
|
36 |
|
|
37 |
private String note; |
|
38 |
|
|
39 |
public String getNote() { |
|
40 |
return note; |
|
41 |
} |
|
42 |
|
|
43 |
public int getValue() { |
|
44 |
return value; |
|
45 |
} |
|
46 |
|
|
47 |
EM_CALLLIFT_CMD(int givenValue, String note) { |
|
48 |
this.value = givenValue; |
|
49 |
this.note = note; |
|
50 |
} |
|
51 |
|
|
52 |
public static String getNoteByValue(int givenValue) { |
|
53 |
for (EM_CALLLIFT_CMD enumType : EM_CALLLIFT_CMD.values()) { |
|
54 |
if (givenValue == enumType.getValue()) { |
|
55 |
return enumType.getNote(); |
|
56 |
} |
|
57 |
} |
|
58 |
return null; |
|
59 |
} |
|
60 |
|
|
61 |
public static int getValueByNote(String givenNote) { |
|
62 |
for (EM_CALLLIFT_CMD enumType : EM_CALLLIFT_CMD.values()) { |
|
63 |
if (givenNote.equals(enumType.getNote())) { |
|
64 |
return enumType.getValue(); |
|
65 |
} |
|
66 |
} |
|
67 |
return -2; |
|
68 |
} |
|
69 |
|
|
70 |
public static EM_CALLLIFT_CMD getEnum(int value) { |
|
71 |
for (EM_CALLLIFT_CMD e : EM_CALLLIFT_CMD.values()) { |
|
72 |
if (e.getValue() == value) |
|
73 |
return e; |
|
74 |
} |
|
75 |
return EM_CALLLIFT_CMD.EM_CALLLIFT_CMD_UNKNOWN; |
|
76 |
} |
|
77 |
|
|
78 |
} |