自动化立体仓库 - WCS系统
Junjie
2023-04-06 39a7c54ceffb921258ac0148f58ccea60da0c87e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package com.zy.core.enums;
 
/**
 * 四向穿梭车
 * Wm204 错误编号
 */
public enum ShuttleErrorCodeType {
 
    NORMAL(0, "无错误"),
    PCB_SUBMODULE(1, "PCB子模块"),
    PCB_PLATE(2, "PCB板"),
    SERVO(10, "伺服"),
    CANOPEN(11, "canopen"),
    RUN_ERROR(14, "运行错误"),
    SYSTEM_ERROR(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;
    }
 
}