自动化立体仓库 - WCS系统
#
luxiaotao1123
2022-10-25 c253c12c4001811b970a4fdee680e33819701197
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
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
package com.zy.core.enums;
 
import com.core.exception.CoolException;
import com.zy.asrs.utils.Utils;
import com.zy.core.model.protocol.SteProtocol;
 
public enum SteTaskModeType {
 
    INIT(0, "初始"),    // 初始
    OUT_LEFT(1, "左出库"),    // 左出库
    OUT_RIGHT(2, "右出库"),    // 右出库
    IN_LEFT(3, "左入库"),    // 左入库
    IN_RIGHT(4, "右入库"),    // 右入库
    MOVE_LEFT(5, "左移库"),    // 左移库
    MOVE_RIGHT(6, "右移库"),    // 右移库
    GO_ORIGIN(7, "去右端"),    // 回原点
    BACK_ORIGIN(8, "去左端"),      // 回反原点
    WAITING_RIGHT(9, "右待机"),        // A点
    WAITING_LEFT(10, "左待机"),       // B点
//    FIT_LEFT(11, "左搬移"),   // 左搬移
//    FIT_RIGHT(12, "右搬移"),      // 右搬移
    CHARGE_LEFT(13, "左充电"),         // 左充电
    CHARGE_RIGHT(14, "右充电"),         // 左充电
//    CHECK_LEFT(14, "左盘点"),     // 左盘点
//    CHECK_RIGHT(15, "右盘点"),    // 右盘点
    CLOSE_CHARGE(17, "断开充电"),   // 断开充电
    ;
 
    public Integer id;
    public String desc;
    SteTaskModeType(Integer id, String desc) {
        this.id = id;
        this.desc = desc;
    }
 
    public static SteTaskModeType get(Short id) {
        if (null == id) {
            return null;
        }
        for (SteTaskModeType type : SteTaskModeType.values()) {
            if (type.id.equals(id.intValue())) {
                return type;
            }
        }
        return null;
    }
 
    public static SteTaskModeType get(SteTaskModeType type) {
        if (null == type) {
            return null;
        }
        for (SteTaskModeType crnTaskModeType : SteTaskModeType.values()) {
            if (crnTaskModeType == type) {
                return crnTaskModeType;
            }
        }
        return null;
    }
 
    public static SteTaskModeType findInByLoc(String locNo) {
        switch (Utils.getGroupRow(locNo, true)) {
            case 17:
                return SteTaskModeType.IN_RIGHT;   // 右
            case 18:
                return SteTaskModeType.IN_LEFT;    // 左
            default:
                throw new CoolException("解析穿梭车原点定位失败");
        }
    }
 
    public static SteTaskModeType findOutByLoc(String locNo) {
        switch (Utils.getGroupRow(locNo, false)) {
            case 2:
                return SteTaskModeType.OUT_RIGHT;   // 右
            case 18:
                return SteTaskModeType.OUT_LEFT;    // 左
            default:
                throw new CoolException("解析穿梭车原点定位失败");
        }
    }
 
 
    // -----------------------------------------------
 
    public static SteTaskModeType findOriginByLoc(SteProtocol steProtocol) {
        switch (steProtocol.getRow()) {
            case 1:
            case 2:
            case 3:
            case 8:
            case 9:
            case 10:
            case 11:
            case 15:
            case 16:
            case 17:
            case 18:
                return SteTaskModeType.GO_ORIGIN;
            case 4:
            case 5:
            case 6:
            case 7:
            case 12:
            case 13:
            case 14:
            case 19:
            case 20:
            case 21:
                return SteTaskModeType.BACK_ORIGIN;
            default:
                throw new CoolException("解析穿梭车原点定位失败");
        }
    }
 
    public static SteTaskModeType findOriginByLoc(Short row) {
        switch (row) {
            case 1:
            case 2:
            case 3:
            case 8:
            case 9:
            case 10:
            case 11:
            case 15:
            case 16:
            case 17:
            case 18:
                return SteTaskModeType.GO_ORIGIN;
            case 4:
            case 5:
            case 6:
            case 7:
            case 12:
            case 13:
            case 14:
            case 19:
            case 20:
            case 21:
                return SteTaskModeType.BACK_ORIGIN;
            default:
                throw new CoolException("解析穿梭车原点定位失败");
        }
    }
 
    public static SteTaskModeType findInByLoc(SteProtocol steProtocol) {
        switch (steProtocol.getRow()) {
            case 1:
            case 2:
            case 3:
            case 8:
            case 9:
            case 10:
            case 11:
            case 15:
            case 16:
            case 17:
            case 18:
                return SteTaskModeType.IN_LEFT;
            case 4:
            case 5:
            case 6:
            case 7:
            case 12:
            case 13:
            case 14:
            case 19:
            case 20:
            case 21:
                return SteTaskModeType.IN_RIGHT;
            default:
                throw new CoolException("解析穿梭车原点定位失败");
        }
    }
 
    public static SteTaskModeType findOutByLoc(SteProtocol steProtocol) {
        switch (steProtocol.getRow()) {
            case 1:
            case 2:
            case 3:
            case 8:
            case 9:
            case 10:
            case 11:
            case 15:
            case 16:
            case 17:
            case 18:
                return SteTaskModeType.OUT_LEFT;
            case 4:
            case 5:
            case 6:
            case 7:
            case 12:
            case 13:
            case 14:
            case 19:
            case 20:
            case 21:
                return SteTaskModeType.OUT_RIGHT;
            default:
                throw new CoolException("解析穿梭车原点定位失败");
        }
    }
 
    public static SteTaskModeType findWaiting(Integer row) {
        switch (row) {
            case 1:
            case 2:
            case 3:
            case 8:
            case 9:
            case 10:
            case 11:
            case 15:
            case 16:
            case 17:
            case 18:
                return SteTaskModeType.WAITING_RIGHT;
            case 4:
            case 5:
            case 6:
            case 7:
            case 12:
            case 13:
            case 14:
            case 19:
            case 20:
            case 21:
                return SteTaskModeType.WAITING_LEFT;
            default:
                throw new CoolException("解析穿梭车原点定位失败");
        }
    }
 
    public static SteTaskModeType findChargeByLoc(Integer row) {
        switch (row) {
            case 1:
            case 2:
            case 3:
            case 8:
            case 9:
            case 10:
            case 11:
            case 15:
            case 16:
            case 17:
            case 18:
                return SteTaskModeType.CHARGE_LEFT;
            case 4:
            case 5:
            case 6:
            case 7:
            case 12:
            case 13:
            case 14:
            case 19:
            case 20:
            case 21:
                return SteTaskModeType.CHARGE_RIGHT;
            default:
                throw new CoolException("解析穿梭车原点定位失败");
        }
    }
 
    public static SteTaskModeType findChargeByLocForCharge(Integer row) {
        switch (row) {
            case 1:
            case 2:
            case 3:
            case 8:
            case 9:
            case 10:
            case 11:
            case 15:
            case 16:
            case 17:
            case 18:
                return SteTaskModeType.GO_ORIGIN;
            case 4:
            case 5:
            case 6:
            case 7:
            case 12:
            case 13:
            case 14:
            case 19:
            case 20:
            case 21:
                return SteTaskModeType.BACK_ORIGIN;
            default:
                throw new CoolException("解析穿梭车原点定位失败");
        }
    }
 
}