自动化立体仓库 - WCS系统
#
luxiaotao1123
2020-08-08 bdcc326cf75564f324c164d8ad64e90bda4a95eb
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
package com.zy.core.model.protocol;
 
import com.zy.core.enums.CrnModeType;
import com.zy.core.enums.CrnStatusType;
import lombok.Data;
 
/**
 * Created by vincent on 2020/8/7
 */
@Data
public class CrnProtocol {
 
    /**
     * 1 = 手动模式
     * 2 = 自动模式
     * 3 = 电脑模式
     * 4 = 手动模式启动中
     * 5 = 自动模式启动中
     * 6 = 电脑模式启动中
     */
    public short mode;
 
    public CrnModeType modeType;
 
    /**
     * 1 = 急停
     */
    public short eStop;
 
    /**
     * 异常码
     */
    public short alarm;
 
    /**
     * 任务号
     */
    public short taskNo;
 
    /**
     * 堆垛机当前状态
     * 0 = 未知
     * 1 = 空闲
     * 2 = 检查任务数据
     * 3 = 定位到取货位
     * 7 = 取货完成
     * 8 = 等待调度柜允许
     * 9 = 移动到放货位置
     * 10 = 放货中
     * 13 = 搬运完成
     * 14 = 空载避让
     * 15 = 检查任务数据
     * 20 = 检查源位置
     * 21 = 检查目标位置
     * 50 = 移动任务
     * 98 = 任务完成,wcs未确认
     * 99 = 报警
     */
    public short status;
 
    /**
     * 状态枚举
     */
    public CrnStatusType statusType;
 
    /**
     * 堆垛机当前列号
     */
    public short bay;
 
    /**
     * 堆垛机当前层号
     */
    public short level;
 
    /**
     * 当前货叉位置
     * 0 = 货叉原位
     * 1 = 货叉在左侧
     * 2 = 货叉在右侧
     */
    public short forkPos;
 
    /**
     * 当前载货台位置
     * 0 = 下定位
     * 1 = 上定位
     */
    public short liftPos;
 
    /**
     * 走行在定位
     * 0 = 在定位
     * 1 = 不在定位
     */
    public short walkPos;
 
    /**
     * 堆垛机任务完成
     */
    public short taskFinish;
 
    /**
     * 载货台有物
     */
    public short loaded;
 
    /**
     * 堆垛机累计走行距离
     */
    public int xDistance;
 
    /**
     * 堆垛机累计升降距离
     */
    public int yDistance;
 
    /**
     * 堆垛机累计运行时长
     */
    public int duration;
 
    public void setMode(Short mode) {
        this.mode = mode;
        this.modeType = CrnModeType.get(mode);
    }
 
    public void setMode(CrnModeType type) {
        this.modeType = type;
        this.mode = CrnModeType.get(type).id.shortValue();
    }
 
    public void setStatus(Short status){
        this.status = status;
        this.statusType = CrnStatusType.get(status);
    }
 
    public void setStatus(CrnStatusType type){
        this.statusType = type;
        this.status = CrnStatusType.get(type).id.shortValue();
    }
 
}