自动化立体仓库 - WCS系统
#
lsh
2024-06-26 2cebd39fd1514c991da647f08124e18a0b02abe9
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
package com.zy.core.enums;
 
public enum SteStatusType {
 
    OFF_LINE(-1, "未知"),
    IDLE(0, "空闲"),
    MOVING(1, "作业中"),
    SOS(2, "停止中"),
    SOS2(3, "报警:故障中"),
    SOS3(4, "复位中"),
    WAITING(10, "等待确认"),
    WAITING2(11, "有物待作业"),
    OTHER(100, "其它"),
    ;
 
    public Integer id;
    public String desc;
    SteStatusType(Integer id, String desc) {
        this.id = id;
        this.desc = desc;
    }
 
    public static SteStatusType get(Short id) {
        if (null == id) {
            return null;
        }
        for (SteStatusType type : SteStatusType.values()) {
            if (type.id.equals(id.intValue())) {
                return type;
            }
        }
        return OFF_LINE;
    }
 
    public static SteStatusType get(SteStatusType type) {
        if (null == type) {
            return null;
        }
        for (SteStatusType crnStatusType : SteStatusType.values()) {
            if (crnStatusType == type) {
                return crnStatusType;
            }
        }
        return null;
    }
}