提交 | 用户 | 时间
|
ce910c
|
1 |
package com.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* @创建人 291189 |
|
5 |
* @创建时间 2021/5/28 |
|
6 |
* @描述 |
|
7 |
*/ |
|
8 |
public enum CFG_PTZ_FUNC_TYPE { |
|
9 |
/** |
|
10 |
* 巡航 |
|
11 |
*/ |
|
12 |
FUNC_TYPE_TOUR (0,"巡航") , |
|
13 |
/** |
|
14 |
* 自动巡迹 |
|
15 |
*/ |
|
16 |
FUNC_TYPE_PATTERN (1,"自动巡迹") , |
|
17 |
/** |
|
18 |
* 预置点 |
|
19 |
*/ |
|
20 |
FUNC_TYPE_PRE(2,"预置点") , |
|
21 |
|
|
22 |
FUNC_TYPE_SCAN(3,"自动线扫"), |
|
23 |
|
|
24 |
FUNC_TYPE_MAX(4,"最大值"); |
|
25 |
|
|
26 |
private int id; |
|
27 |
private String desc; |
|
28 |
|
|
29 |
CFG_PTZ_FUNC_TYPE(int id, String desc) { |
|
30 |
this.id = id; |
|
31 |
this.desc = desc; |
|
32 |
} |
|
33 |
public int getId() { |
|
34 |
return id; |
|
35 |
} |
|
36 |
|
|
37 |
public String getDesc() { |
|
38 |
return desc; |
|
39 |
} |
|
40 |
|
|
41 |
public static String getDescById(int id) { |
|
42 |
for (CFG_PTZ_FUNC_TYPE enumType : CFG_PTZ_FUNC_TYPE.values()) { |
|
43 |
if (id == enumType.getId()) { |
|
44 |
return enumType.desc; |
|
45 |
} |
|
46 |
} |
|
47 |
return null; |
|
48 |
} |
|
49 |
|
|
50 |
public static int getIdByValue(String desc) { |
|
51 |
for (CFG_PTZ_FUNC_TYPE enumType : CFG_PTZ_FUNC_TYPE.values()) { |
|
52 |
if (desc.equals(enumType.getDesc())) { |
|
53 |
return enumType.getId(); |
|
54 |
} |
|
55 |
} |
|
56 |
return -1; |
|
57 |
} |
|
58 |
} |