package com.zy.core.enums; /** * 四向穿梭车 * Wm204 错误编号 */ public enum ShuttleErrorCodeType { NORMAL(0, "无错误"), PCB_SUBMODULE(1, "PCB子模块(1)"), PCB_PLATE(2, "PCB板(2)"), SERVO(10, "伺服(10)"), CANOPEN(11, "canopen(11)"), RUN_ERROR(14, "运行错误(14)"), SYSTEM_ERROR(16, "系统错误(16)") ; public Integer id; public String desc; ShuttleErrorCodeType(Integer id, String desc) { this.id = id; this.desc = desc; } public static ShuttleErrorCodeType get(Integer id) { if (null == id) { return null; } for (ShuttleErrorCodeType type : ShuttleErrorCodeType.values()) { if (type.id.equals(id.intValue())) { return type; } } return null; } public static ShuttleErrorCodeType get(ShuttleErrorCodeType type) { if (null == type) { return null; } for (ShuttleErrorCodeType shuttleErrorCodeType : ShuttleErrorCodeType.values()) { if (shuttleErrorCodeType == type) { return shuttleErrorCodeType; } } return null; } }