#
Junjie
4 天以前 2f9849905dbb8d65faa28628a40084708a0386ef
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
package com.zy.core.model.protocol;
 
import com.zy.core.enums.CrnForkPosType;
import com.zy.core.enums.CrnLiftPosType;
import com.zy.core.enums.CrnModeType;
import com.zy.core.enums.CrnStatusType;
import lombok.Data;
 
import java.util.Map;
 
@Data
public class DualCrnProtocol {
 
    private Integer crnNo;
 
    /**
     * 1 = 手动模式
     * 2 = 自动模式
     * 3 = 电脑模式
     */
    public Integer mode;
 
    public CrnModeType modeType;
 
    /**
     * 异常码
     */
    public Integer alarm;
 
    /**
     * 工位1任务号
     */
    public Integer taskNo = 0;
 
    /**
     * 工位2任务号
     */
    public Integer taskNoTwo = 0;
 
    /**
     * 工位1当前状态
     * 0:空闲,无任务
     * 1:取货定位中
     * 2:取货中
     * 3:取货完成,放货定位中
     * 4:放货中
     * 5:回原点中
     * 6:反原点
     * 7:库位移位
     * 90:任务完成等待WCS确认
     * 99:报警
     */
    public Integer status;
 
    /**
     * 工位2当前状态
     */
    public Integer statusTwo;
 
    /**
     * 工位1状态枚举
     */
    public CrnStatusType statusType;
 
    /**
     * 工位2状态枚举
     */
    public CrnStatusType statusTypeTwo;
 
    /**
     * 工位1堆垛机当前列号
     */
    public Integer bay;
 
    /**
     * 工位2堆垛机当前列号
     */
    public Integer bayTwo;
 
    /**
     * 工位1堆垛机当前层号
     */
    public Integer level;
 
    /**
     * 工位2堆垛机当前层号
     */
    public Integer levelTwo;
 
    /**
     * 工位1当前货叉位置
     * 0 = 货叉原位
     * 1 = 货叉在左侧
     * 2 = 货叉在右侧
     */
    public Integer forkPos;
 
    /**
     * 工位2当前货叉位置
     * 0 = 货叉原位
     * 1 = 货叉在左侧
     * 2 = 货叉在右侧
     */
    public Integer forkPosTwo;
 
    public CrnForkPosType forkPosType;
 
    public CrnForkPosType forkPosTypeTwo;
 
    /**
     * 当前载货台位置
     * 0 = 下定位
     * 1 = 上定位
     */
    public Integer liftPos;
 
    public Integer liftPosTwo;
 
    public CrnLiftPosType liftPosType;
 
    public CrnLiftPosType liftPosTypeTwo;
 
    /**
     * 走行在定位
     * 0 = 在定位
     * 1 = 不在定位
     */
    public Integer walkPos;
 
    public Integer walkPosTwo;
 
    /**
     * 载货台有物
     */
    public Integer loaded;
 
    public Integer loadedTwo;
 
    private Integer temp1;
 
    private Integer temp2;
 
    private Integer temp3;
 
    private Integer temp4;
 
    /**
     * X行走线速度m/min
     */
    private Integer xSpeed;
 
    /**
     * Y行走线速度m/min
     */
    private Integer ySpeed;
 
    /**
     * Z行走线速度m/min
     */
    private Integer zSpeed;
 
    /**
     * 堆垛机累计走行距离km
     */
    public Integer xDistance;
 
    /**
     * 堆垛机累计升降距离km
     */
    public Integer yDistance;
 
    /**
     * 堆垛机累计走行时长h
     */
    public Integer xDuration;
 
    /**
     * 堆垛机累计升降时长h
     */
    public Integer yDuration;
 
    /**
     * 最近一次入出库类型
     *       I:入库
     *       O:出库
     */
    private String lastIo = "I";
 
    /**
     * 堆垛机所在巷道
     */
    private Integer crnLane = 1;
 
    /**
     * 日志采集时间
     */
    private Long deviceDataLog = System.currentTimeMillis();
 
    /**
     * 上一次指令下发时间
     */
    private Long lastCommandTime = System.currentTimeMillis();
 
    /**
     * 扩展数据
     */
    private Map<String, Object> extend;
 
    public void setMode(Integer mode) {
        this.mode = mode;
        this.modeType = CrnModeType.get(mode);
    }
 
    public void setMode(CrnModeType type) {
        this.modeType = type;
        this.mode = CrnModeType.get(type).id;
    }
 
    public void setForkPos(Integer forkPos) {
        this.forkPos = forkPos;
        this.forkPosType = CrnForkPosType.get(forkPos);
    }
 
    public void setForkPosTwo(Integer forkPosTwo) {
        this.forkPosTwo = forkPosTwo;
        this.forkPosTypeTwo = CrnForkPosType.get(forkPosTwo);
    }
 
    public void setForkPos(CrnForkPosType type) {
        this.forkPosType = type;
        this.forkPos = CrnForkPosType.get(type).id;
    }
 
    public void setForkPosTwo(CrnForkPosType type) {
        this.forkPosTypeTwo = type;
        this.forkPosTwo = CrnForkPosType.get(type).id;
    }
 
    public void setLiftPos(Integer liftPos) {
        this.liftPos = liftPos;
        this.liftPosType = CrnLiftPosType.get(liftPos);
    }
 
    public void setLiftPosTwo(Integer liftPosTwo) {
        this.liftPosTwo = liftPosTwo;
        this.liftPosTypeTwo = CrnLiftPosType.get(liftPosTwo);
    }
 
    public void setLiftPos(CrnLiftPosType type) {
        this.liftPosType = type;
        this.liftPos = CrnLiftPosType.get(type).id;
    }
 
    public void setLiftPosTwo(CrnLiftPosType type) {
        this.liftPosTypeTwo = type;
        this.liftPosTwo = CrnLiftPosType.get(type).id;
    }
 
    public void setStatus(Integer status){
        this.status = status;
        this.statusType = CrnStatusType.get(status);
    }
 
    public void setStatus(CrnStatusType type){
        this.statusType = type;
        this.status = CrnStatusType.get(type).id;
    }
 
    public void setStatusTwo(Integer statusTwo){
        this.statusTwo = statusTwo;
        this.statusTypeTwo = CrnStatusType.get(statusTwo);
    }
 
    public void setStatusTwo(CrnStatusType type){
        this.statusTypeTwo = type;
        this.statusTwo = CrnStatusType.get(type).id;
    }
 
}