自动化立体仓库 - 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
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;
    }
 
}