提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* @author 251823 |
|
5 |
* @description 备份模式设置错误码 |
|
6 |
* @date 2021/09/28 |
|
7 |
*/ |
|
8 |
public enum EM_BACKUP_ERROR_CODE { |
|
9 |
// 未知 |
|
10 |
EM_BACKUP_ERROR_CODE_UNKNOWN(-1, "未知"), |
|
11 |
// 备份模式设置成功 |
|
12 |
EM_BACKUP_ERROR_CODE_SUCCESS(0, "备份模式设置成功"), |
|
13 |
// 周期方案表有误 |
|
14 |
EM_BACKUP_ERROR_CODE_CYCLE_PLAN(1, "周期方案表有误"), |
|
15 |
// 绿信比表有误 |
|
16 |
EM_BACKUP_ERROR_CODE_GREEN_LETTER(2, "绿信比表有误"), |
|
17 |
// 时基方案表有误 |
|
18 |
EM_BACKUP_ERROR_CODE_TIME_BASE_PLAN(3, "时基方案表有误"), |
|
19 |
// 日计划表有误 |
|
20 |
EM_BACKUP_ERROR_CODE_DAY_PLAN(4, "日计划表有误"), |
|
21 |
// 动作方案表有误 |
|
22 |
EM_BACKUP_ERROR_CODE_ACTION_PLAN(5, "动作方案表有误"), |
|
23 |
// 相序表有误 |
|
24 |
EM_BACKUP_ERROR_CODE_PHASE_SEQUENCE(6, "相序表有误"), |
|
25 |
// 通道表有误 |
|
26 |
EM_BACKUP_ERROR_CODE_CHANNEL_TABLE(7, "通道表有误"), |
|
27 |
// 跟随相位表有误 |
|
28 |
EM_BACKUP_ERROR_CODE_FOLLOW_PHASE_TABLE(8, "跟随相位表有误"), |
|
29 |
// 相位冲突 |
|
30 |
EM_BACKUP_ERROR_CODE_PHASE_CONFLCT(9, "相位冲突"), |
|
31 |
// 下发方案超时 |
|
32 |
EM_BACKUP_ERROR_CODE_DELIVERY_PLAN(10, "下发方案超时"), |
|
33 |
// 车道表设置有误 |
|
34 |
EM_BACKUP_ERROR_CODE_LANE_TABLE_SETTING(11, "车道表设置有误"), |
|
35 |
// 用于信号灯,提示信号灯不支持短连接路口 |
|
36 |
EM_BACKUP_ERROR_CODE_NOT_SUPPORT_SHORT_JUNCTIONS(12, "用于信号灯,提示信号灯不支持短连接路口"), |
|
37 |
// 通道配置有误 用于信号灯 无掉头箭头灯、直行非机动车灯、左转非机动车灯、公交信号灯--可变车道 |
|
38 |
EM_BACKUP_ERROR_CODE_CHANNEL_CONFIGURATION(13, "通道配置有误"), |
|
39 |
// 可变车道方案表有误 |
|
40 |
EM_BACKUP_ERROR_CODE_VARIABLEE_LANE_TABLE(14, "可变车道方案表有误 "), |
|
41 |
// 周计划方案表有误 |
|
42 |
EM_BACKUP_ERROR_CODE_WEEKLY_PLAN(15, "周计划方案表有误"); |
|
43 |
|
|
44 |
private int value; |
|
45 |
private String note; |
|
46 |
|
|
47 |
private EM_BACKUP_ERROR_CODE(int givenValue, String note) { |
|
48 |
this.value = givenValue; |
|
49 |
this.note = note; |
|
50 |
} |
|
51 |
|
|
52 |
public String getNote() { |
|
53 |
return note; |
|
54 |
} |
|
55 |
|
|
56 |
public int getValue() { |
|
57 |
return value; |
|
58 |
} |
|
59 |
|
|
60 |
public static String getNoteByValue(int givenValue) { |
|
61 |
for (EM_BACKUP_ERROR_CODE enumType : EM_BACKUP_ERROR_CODE.values()) { |
|
62 |
if (givenValue == enumType.getValue()) { |
|
63 |
return enumType.getNote(); |
|
64 |
} |
|
65 |
} |
|
66 |
return null; |
|
67 |
} |
|
68 |
|
|
69 |
public static int getValueByNote(String givenNote) { |
|
70 |
for (EM_BACKUP_ERROR_CODE enumType : EM_BACKUP_ERROR_CODE.values()) { |
|
71 |
if (givenNote.equals(enumType.getNote())) { |
|
72 |
return enumType.getValue(); |
|
73 |
} |
|
74 |
} |
|
75 |
return -2; |
|
76 |
} |
|
77 |
|
|
78 |
} |