| | |
| | | if (steNo != null) { |
| | | // 小车行走到堆垛机待搬移点 |
| | | if (wrkMast.getWrkSts() == 2L && wrkMast.getSteNo() == null) { |
| | | this.letCarBeReady(wrkMast, steNo); |
| | | this.letCarBeReady(wrkMast, steNo, wrkMast.getLocNo()); |
| | | } |
| | | // 小车搬走 |
| | | if (wrkMast.getWrkSts() == 3L) { |
| | |
| | | if (steNo != null) { |
| | | // 小车行走到堆垛机待搬移点 |
| | | if (wrkMast.getWrkSts() == 2L && wrkMast.getSteNo() == null) { |
| | | this.letCarBeReady(wrkMast, steNo); |
| | | this.letCarBeReady(wrkMast, steNo, wrkMast.getLocNo()); |
| | | } |
| | | // 堆垛机将货放至小车上 3.小车待搬(小车不用搬运,已经在当前组库位) / 6.小车待入 ===>> 7.吊车入库中 |
| | | if (wrkMast.getWrkSts() == 3L || wrkMast.getWrkSts() == 6L) { |
| | |
| | | SteThread steThread = queryIdleCar(wrkMast); |
| | | if (steThread != null) { |
| | | // 让小车等待搬运待续 |
| | | this.letCarBeReady(wrkMast, steThread.getSlave().getId()); |
| | | this.letCarBeReady(wrkMast, steThread.getSlave().getId(), wrkMast.getLocNo()); |
| | | } |
| | | } |
| | | // 堆垛机搬运小车 |
| | |
| | | // 不是最外层库位,需要使用穿梭车搬运后,再堆垛机出库 |
| | | } else { |
| | | // 当前组库位是否有穿梭车 |
| | | Integer steNo = this.hasCarOfIdle(wrkMast.getLocNo()); |
| | | Integer steNo = this.hasCarOfIdle(wrkMast.getSourceLocNo()); |
| | | // 有小车 |
| | | if (steNo != null) { |
| | | if (wrkMast.getWrkSts() == 11L && wrkMast.getSteNo() == null) { |
| | |
| | | SteCommand steCommand = new SteCommand(); |
| | | steCommand.setSteNo(steNo); // 穿梭车编号 |
| | | steCommand.setTaskNo(wrkMast.getWrkNo()); // 工作号 |
| | | steCommand.setTaskMode(SteTaskModeType.TO_B); // 任务模式: 去近点 等待堆垛机叉取 |
| | | steCommand.setTaskMode(SteTaskModeType.findOutByLoc(wrkMast.getSourceLocNo())); // 任务模式: 去近点 等待堆垛机叉取 |
| | | |
| | | SteABType ab = Utils.selectAB(steProtocol.getRow().intValue()); |
| | | |
| | | |
| | | // todo:luxiaotao |
| | | if (!MessageQueue.offer(SlaveType.Ste, steNo, new Task(2, steCommand))) { |
| | | log.error("穿梭车命令下发失败,穿梭车号={},任务数据={}", steNo, JSON.toJSON(steCommand)); |
| | | } else { |
| | |
| | | SteThread steThread = queryIdleCar(wrkMast); |
| | | if (steThread != null) { |
| | | // 让小车等待搬运待续 |
| | | this.letCarBeReady(wrkMast, steThread.getSlave().getId()); |
| | | this.letCarBeReady(wrkMast, steThread.getSlave().getId(), wrkMast.getSourceLocNo()); |
| | | } |
| | | } |
| | | // 堆垛机搬运小车 |
| | |
| | | * 让小车从 远点 ====>> 移动到近点 |
| | | * 等待堆垛机搬运 |
| | | */ |
| | | public void letCarBeReady(WrkMast wrkMast, Integer steNo) { |
| | | public void letCarBeReady(WrkMast wrkMast, Integer steNo, String locNo) { |
| | | // 获取穿梭车信息 |
| | | SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, steNo); |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | |
| | | SteCommand steCommand = new SteCommand(); |
| | | steCommand.setSteNo(steNo); // 穿梭车编号 |
| | | steCommand.setTaskNo(wrkMast.getWrkNo()); // 工作号 |
| | | steCommand.setTaskMode(SteTaskModeType.TO_B); // 任务模式: 去近点 等待堆垛机叉取 |
| | | steCommand.setTaskMode(SteTaskModeType.findOriginByLoc(locNo)); // 任务模式: 去近点 等待堆垛机叉取 |
| | | |
| | | steCommand.setRow(Utils.getGroupRow(steProtocol.getRow().intValue()).shortValue()); |
| | | steCommand.setBay(steProtocol.getBay()); |
| | |
| | | SteCommand steCommand = new SteCommand(); |
| | | steCommand.setSteNo(steNo); // 穿梭车编号 |
| | | steCommand.setTaskNo(wrkMast.getWrkNo()); // 工作号 |
| | | steCommand.setTaskMode(SteTaskModeType.TO_B); // 任务模式: 去近点 等待堆垛机叉取 |
| | | // todo:luxiaotao |
| | | steCommand.setTaskMode(SteTaskModeType.findInByLoc(wrkMast.getLocNo())); // 任务模式: 搬入库 |
| | | if (!MessageQueue.offer(SlaveType.Ste, steNo, new Task(2, steCommand))) { |
| | | log.error("穿梭车命令下发失败,穿梭车号={},任务数据={}", steNo, JSON.toJSON(steCommand)); |
| | | } else { |
| | |
| | | SteCommand steCommand = new SteCommand(); |
| | | steCommand.setSteNo(steNo); // 穿梭车编号 |
| | | steCommand.setTaskNo(wrkMast.getWrkNo()); // 工作号 |
| | | steCommand.setTaskMode(SteTaskModeType.TO_B); // 任务模式: 去近点 等待堆垛机叉取 |
| | | // todo:luxiaotao |
| | | steCommand.setTaskMode(SteTaskModeType.findOutByLoc(wrkMast.getSourceLocNo())); // 任务模式: 搬出库 |
| | | if (!MessageQueue.offer(SlaveType.Ste, steNo, new Task(2, steCommand))) { |
| | | log.error("穿梭车命令下发失败,穿梭车号={},任务数据={}", steNo, JSON.toJSON(steCommand)); |
| | | } else { |
| | |
| | | } |
| | | } |
| | | |
| | | public static Integer getGroupRow(String locNo){ |
| | | int row = getRow(locNo); |
| | | return getGroupRow(row); |
| | | } |
| | | |
| | | public static Integer getGroupRow(Integer row) { |
| | | switch (row) { |
| | | case 1: |
| | |
| | | throw new RuntimeException("库位解析异常"); |
| | | } |
| | | } |
| | | |
| | | |
| | | public static Integer getGroupRow(String locNo){ |
| | | int row = getRow(locNo); |
| | | return getGroupRow(row); |
| | | } |
| | | |
| | | |
| | | |
| | | public static SteABType selectAB(Integer row) { |
| | | switch (row) { |
| | |
| | | package com.zy.core.enums; |
| | | |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.utils.Utils; |
| | | |
| | | public enum SteTaskModeType { |
| | | |
| | | INIT(0, "初始"), // 初始 |
| | |
| | | OUT_RIGHT(2, "右出库"), // 右出库 |
| | | IN_LEFT(3, "左入库"), // 左入库 |
| | | IN_RIGHT(4, "右入库"), // 右入库 |
| | | MOVE_LEFT(5, "左移库"), // 左移库 |
| | | MOVE_RIGHT(6, "右移库"), // 右移库 |
| | | GO_ORIGIN(7, "回原点"), // 回原点 |
| | | BACK_ORIGIN(8, "回反原点"), // 回反原点 |
| | | TO_A(9, "A点"), // A点 |
| | | TO_B(10, "B点"), // B点 |
| | | FIT_LEFT(11, "左搬移"), // 左搬移 |
| | | FIT_RIGHT(12, "右搬移"), // 右搬移 |
| | | // MOVE_LEFT(5, "左移库"), // 左移库 |
| | | // MOVE_RIGHT(6, "右移库"), // 右移库 |
| | | GO_ORIGIN(7, "去右端"), // 回原点 |
| | | BACK_ORIGIN(8, "去左端"), // 回反原点 |
| | | // TO_A(9, "A点"), // A点 |
| | | // TO_B(10, "B点"), // B点 |
| | | // FIT_LEFT(11, "左搬移"), // 左搬移 |
| | | // FIT_RIGHT(12, "右搬移"), // 右搬移 |
| | | CHARGE(13, "充电"), // 充电 |
| | | CHECK_LEFT(14, "左盘点"), // 左盘点 |
| | | CHECK_RIGHT(15, "右盘点"), // 右盘点 |
| | | // CHECK_LEFT(14, "左盘点"), // 左盘点 |
| | | // CHECK_RIGHT(15, "右盘点"), // 右盘点 |
| | | ; |
| | | |
| | | public Integer id; |
| | |
| | | return null; |
| | | } |
| | | |
| | | public static SteTaskModeType findOriginByLoc(String locNo) { |
| | | switch (Utils.getGroupRow(locNo)) { |
| | | case 3: |
| | | case 11: |
| | | case 18: |
| | | return SteTaskModeType.GO_ORIGIN; // 右 |
| | | case 4: |
| | | case 12: |
| | | case 19: |
| | | return SteTaskModeType.BACK_ORIGIN; // 左 |
| | | default: |
| | | throw new CoolException("解析穿梭车原点定位失败"); |
| | | } |
| | | } |
| | | |
| | | public static SteTaskModeType findInByLoc(String locNo) { |
| | | switch (Utils.getGroupRow(locNo)) { |
| | | case 3: |
| | | case 11: |
| | | case 18: |
| | | return SteTaskModeType.IN_RIGHT; // 右 |
| | | case 4: |
| | | case 12: |
| | | case 19: |
| | | return SteTaskModeType.IN_LEFT; // 左 |
| | | default: |
| | | throw new CoolException("解析穿梭车原点定位失败"); |
| | | } |
| | | } |
| | | |
| | | public static SteTaskModeType findOutByLoc(String locNo) { |
| | | switch (Utils.getGroupRow(locNo)) { |
| | | case 3: |
| | | case 11: |
| | | case 18: |
| | | return SteTaskModeType.OUT_RIGHT; // 右 |
| | | case 4: |
| | | case 12: |
| | | case 19: |
| | | return SteTaskModeType.OUT_LEFT; // 左 |
| | | default: |
| | | throw new CoolException("解析穿梭车原点定位失败"); |
| | | } |
| | | } |
| | | |
| | | } |