package com.zy.core.enums;
|
|
/**
|
* 四向穿梭车
|
* WM205 Plc输出状态IO
|
*/
|
public enum ShuttlePlcOutputStatusType {
|
|
NULL(Byte.parseByte("0"), "空"),
|
LIFT(Byte.parseByte("1"), "顶升位"),
|
TURN(Byte.parseByte("2"), "转向位"),
|
BRAKE(Byte.parseByte("3"), "抱闸位"),
|
CHARGE(Byte.parseByte("4"), "冲电位")
|
;
|
|
public byte id;
|
public String desc;
|
|
ShuttlePlcOutputStatusType(byte id, String desc) {
|
this.id = id;
|
this.desc = desc;
|
}
|
|
public static ShuttlePlcOutputStatusType get(byte id) {
|
for (ShuttlePlcOutputStatusType type : ShuttlePlcOutputStatusType.values()) {
|
if (type.id == id) {
|
return type;
|
}
|
}
|
return null;
|
}
|
|
public static ShuttlePlcOutputStatusType get(ShuttlePlcOutputStatusType type) {
|
if (null == type) {
|
return null;
|
}
|
for (ShuttlePlcOutputStatusType shuttlePlcOutputStatusType : ShuttlePlcOutputStatusType.values()) {
|
if (shuttlePlcOutputStatusType == type) {
|
return shuttlePlcOutputStatusType;
|
}
|
}
|
return null;
|
}
|
|
}
|