You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
78 lines
1.6 KiB
78 lines
1.6 KiB
package com.galaxis.rcs.amr;
|
|
|
|
import com.google.common.collect.Maps;
|
|
|
|
import java.util.Collections;
|
|
import java.util.Map;
|
|
|
|
/**
|
|
* AMR 任务模式
|
|
*/
|
|
public enum AmrTaskMode {
|
|
/**
|
|
* 空闲模式
|
|
*/
|
|
AMR_FREE_MODE(0, "空闲模式"),
|
|
/**
|
|
* 初始化模式
|
|
*/
|
|
AMR_INIT_MODE(1, "初始化模式"),
|
|
/**
|
|
* 任务模式
|
|
*/
|
|
AMR_TASK_MODE(2, "任务模式"),
|
|
/**
|
|
* 单动作模式
|
|
*/
|
|
AMR_SINGLE_ACTION_MODE(3, "单动作模式"),
|
|
/**
|
|
* 手动模式
|
|
*/
|
|
AMR_MANUAL_MODE(4, "手动模式"),
|
|
/**
|
|
* 遥控器模式
|
|
*/
|
|
AMR_HANDSET_MODE(5, "遥控器模式"),
|
|
/**
|
|
* 充电模式
|
|
*/
|
|
AMR_CHARGE_MODE(6, "充电模式"),
|
|
/**
|
|
* 任务被中断模式
|
|
*/
|
|
AMR_TASK_INTERRUPT_MODE (7, "任务被中断模式"),
|
|
/**
|
|
* 自定义模式
|
|
*/
|
|
AMR_CUSTOMIZE_MODE(8, "自定义模式");
|
|
|
|
// 枚举值映射
|
|
private static final Map<Integer, AmrTaskMode> VALUE_MAP;
|
|
|
|
static {
|
|
Map<Integer, AmrTaskMode> map = Maps.newHashMap();
|
|
for (AmrTaskMode message : values()) {
|
|
map.put(message.value, message);
|
|
}
|
|
VALUE_MAP = Collections.unmodifiableMap(map);
|
|
}
|
|
|
|
public final int value;
|
|
public final String description;
|
|
|
|
AmrTaskMode(int value, String description) {
|
|
this.value = value;
|
|
this.description = description;
|
|
}
|
|
|
|
/**
|
|
* 从整数值获取对应的枚举
|
|
*
|
|
* @param value 整数值
|
|
* @return 对应的枚举,如果找不到则返回 null
|
|
*/
|
|
public static AmrTaskMode fromValue(int value) {
|
|
return VALUE_MAP.get(value);
|
|
}
|
|
|
|
}
|
|
|