提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* @author 251823 |
|
5 |
* @description 标定区域类型 |
|
6 |
* @date 2021/01/11 |
|
7 |
*/ |
|
8 |
public enum EM_CALIBRATEAREA_TYPE { |
|
9 |
// 错误 |
|
10 |
EM_CALIBRATEAREA_TYPE_ERR(0, "err"), |
|
11 |
|
|
12 |
//地面,需要N条竖直线段+M条水平线段((N=3,M=1);(N=2,M=2);今后扩展) |
|
13 |
EM_CALIBRATEAREA_TYPE_GROUD(1, "Groud"), |
|
14 |
|
|
15 |
//水平面,需要水平面上一点到地面点的投影垂直线段 |
|
16 |
EM_CALIBRATEAREA_TYPE_HORIZONTAL(2, "Horizontal"), |
|
17 |
|
|
18 |
//垂直面,需要垂直面与地面的交线 |
|
19 |
EM_CALIBRATEAREA_TYPE_VERTICAL(3, "Vertical"), |
|
20 |
|
|
21 |
//任意平面,N条竖直线段,及每条长度(N=3,及今后扩展) |
|
22 |
EM_CALIBRATEAREA_TYPE_ANY(4, "Any"); |
|
23 |
|
|
24 |
private int value; |
|
25 |
private String note; |
|
26 |
|
|
27 |
private EM_CALIBRATEAREA_TYPE(int givenValue, String note) { |
|
28 |
this.value = givenValue; |
|
29 |
this.note = note; |
|
30 |
} |
|
31 |
|
|
32 |
public String getNote() { |
|
33 |
return note; |
|
34 |
} |
|
35 |
|
|
36 |
public int getValue() { |
|
37 |
return value; |
|
38 |
} |
|
39 |
|
|
40 |
public static String getNoteByValue(int givenValue) { |
|
41 |
for (EM_CALIBRATEAREA_TYPE enumType : EM_CALIBRATEAREA_TYPE.values()) { |
|
42 |
if (givenValue == enumType.getValue()) { |
|
43 |
return enumType.getNote(); |
|
44 |
} |
|
45 |
} |
|
46 |
return null; |
|
47 |
} |
|
48 |
|
|
49 |
public static int getValueByNote(String givenNote) { |
|
50 |
for (EM_CALIBRATEAREA_TYPE enumType : EM_CALIBRATEAREA_TYPE.values()) { |
|
51 |
if (givenNote.equals(enumType.getNote())) { |
|
52 |
return enumType.getValue(); |
|
53 |
} |
|
54 |
} |
|
55 |
return -1; |
|
56 |
} |
|
57 |
} |