| | |
| | | Short endStartCode = Short.parseShort(basDevp.getQrCodeValue());//站点二维码 |
| | | |
| | | //增加移动进提升机命令 |
| | | ShuttleCommand moveCommand = shuttleThread.getMoveCommand(endStartCode, liftProtocol.getBarcode(), 1400, ShuttleRunDirection.TOP.id, null, null, 500); |
| | | ShuttleCommand moveCommand = shuttleThread.getMoveCommand(endStartCode, liftProtocol.getBarcode(), 1600, ShuttleRunDirection.TOP.id, null, null, 500); |
| | | commands.add(moveCommand); |
| | | |
| | | //分配目标库位 |
| | |
| | | Short distCode = Short.parseShort(basDevp.getQrCodeValue());//提升机口站点二维码 |
| | | Short runDirection = ShuttleRunDirection.BOTTOM.id;//运行方向 |
| | | //获取命令 |
| | | ShuttleCommand moveCommand = shuttleThread.getMoveCommand(startCode, distCode, 1400, runDirection, null, null, 500); |
| | | ShuttleCommand moveCommand = shuttleThread.getMoveCommand(startCode, distCode, 1600, runDirection, null, null, 500); |
| | | commands.add(0, moveCommand);//将该指令添加到队头 |
| | | |
| | | assignCommand.setCommands(commands); |
| | |
| | | // Short distCode = Short.parseShort(basDevp.getQrCodeValue());//提升机口站点二维码 |
| | | // Short runDirection = ShuttleRunDirection.BOTTOM.id;//运行方向 |
| | | // //获取命令 |
| | | // ShuttleCommand moveCommand = shuttleThread.getMoveCommand(startCode, distCode, 1400, runDirection, startCode, 1400, 500); |
| | | // ShuttleCommand moveCommand = shuttleThread.getMoveCommand(startCode, distCode, 1600, runDirection, startCode, 1600, 500); |
| | | // commands.add(0, moveCommand);//将该指令添加到队头 |
| | | // } |
| | | // assignCommand.setCommands(commands); |
| | |
| | | // Short endStartCode = Short.parseShort(basDevp.getQrCodeValue());//站点二维码 |
| | | // |
| | | // //增加移动进提升机命令 |
| | | // ShuttleCommand moveCommand = shuttleThread.getMoveCommand(endStartCode, liftProtocol.getBarcode(), 1400, ShuttleRunDirection.TOP.id, endStartCode, 1400, 500); |
| | | // ShuttleCommand moveCommand = shuttleThread.getMoveCommand(endStartCode, liftProtocol.getBarcode(), 1600, ShuttleRunDirection.TOP.id, endStartCode, 1600, 500); |
| | | // commands.add(moveCommand); |
| | | // |
| | | // //分配目标库位 |
| | |
| | | for (ArrayList<NavigateNode> nodes : data2) { |
| | | //开始路径 |
| | | NavigateNode startPath = nodes.get(0); |
| | | |
| | | //中间路径 |
| | | NavigateNode middlePath = nodes.get(nodes.size() - 2); |
| | | NavigateNode middlePath = null; |
| | | //通过xy坐标小车二维码 |
| | | Short middleCodeNum = null; |
| | | Integer middleToDistDistance = null;//计算中间点到目标点行走距离 |
| | | if (nodes.size() > 10) {//中段码传倒数第三个 |
| | | //中间路径 |
| | | middlePath = nodes.get(nodes.size() - 3); |
| | | //通过xy坐标小车二维码 |
| | | middleCodeNum = NavigatePositionConvert.xyToPosition(middlePath.getX(), middlePath.getY(), middlePath.getZ()); |
| | | middleToDistDistance = NavigateUtils.getMiddleToDistDistance(nodes);//计算中间点到目标点行走距离 |
| | | } else if (nodes.size() > 5) {//中段码传倒数第二个 |
| | | //中间路径 |
| | | middlePath = nodes.get(nodes.size() - 2); |
| | | //通过xy坐标小车二维码 |
| | | middleCodeNum = NavigatePositionConvert.xyToPosition(middlePath.getX(), middlePath.getY(), middlePath.getZ()); |
| | | middleToDistDistance = NavigateUtils.getMiddleToDistDistance(nodes);//计算中间点到目标点行走距离 |
| | | } |
| | | |
| | | //目标路径 |
| | | NavigateNode endPath = nodes.get(nodes.size() - 1); |
| | | Integer allDistance = NavigateUtils.getCurrentPathAllDistance(nodes);//计算当前路径行走总距离 |
| | | Integer middleToDistDistance = NavigateUtils.getMiddleToDistDistance(nodes);//计算中间点到目标点行走距离 |
| | | |
| | | //通过xy坐标小车二维码 |
| | | Short startCodeNum = NavigatePositionConvert.xyToPosition(startPath.getX(), startPath.getY(), startPath.getZ()); |
| | | //通过xy坐标小车二维码 |
| | | Short middleCodeNum = NavigatePositionConvert.xyToPosition(middlePath.getX(), middlePath.getY(), middlePath.getZ()); |
| | | //通过xy坐标小车二维码 |
| | | Short distCodeNum = NavigatePositionConvert.xyToPosition(endPath.getX(), endPath.getY(), endPath.getZ()); |
| | | ShuttleCommand moveCommand = shuttleThread.getMoveCommand(startCodeNum, distCodeNum, allDistance, ShuttleRunDirection.get(startPath.getDirection()).id, middleCodeNum, middleToDistDistance, runSpeed); |
| | |
| | | Short endStartCode = Short.parseShort(basDevp.getQrCodeValue());//站点二维码 |
| | | |
| | | //增加移动进提升机命令 |
| | | ShuttleCommand moveCommand = shuttleThread.getMoveCommand(endStartCode, liftProtocol.getBarcode(), 1400, ShuttleRunDirection.TOP.id, null, null, 500); |
| | | ShuttleCommand moveCommand = shuttleThread.getMoveCommand(endStartCode, liftProtocol.getBarcode(), 1600, ShuttleRunDirection.TOP.id, null, null, 500); |
| | | commands.add(moveCommand); |
| | | |
| | | //目标库位 |
| | |
| | | short startCode = liftProtocol.getBarcode();//提升机内部二维码 |
| | | Short distCode = commands.get(0).getStartCodeNum();//目标二维码 |
| | | //获取移动命令 |
| | | ShuttleCommand moveCommand = shuttleThread.getMoveCommand(startCode, distCode, 1400, commands.get(0).getRunDirection(), null, null, 500); |
| | | ShuttleCommand moveCommand = shuttleThread.getMoveCommand(startCode, distCode, 1600, commands.get(0).getRunDirection(), null, null, 500); |
| | | commands.add(0, moveCommand);//将该指令添加到队头 |
| | | |
| | | //分配目标库位 |
| | |
| | | |
| | | //判断提升机是否到位 |
| | | StaProtocol staProtocol = devpThread.getStation().get(Utils.levToOutInStaNo(wrkMastLocNoLey >= 2 ? wrkMastLocNoLey + 1 : wrkMastLocNoLey));//起始站点 |
| | | //判断输送站点是否有物,只有无物情况才能继续调度提升机 |
| | | if (staProtocol.isLoading()) { |
| | | //有物禁止调度 |
| | | continue; |
| | | } |
| | | |
| | | if (liftLev != wrkMastLocNoLey && !staProtocol.isLiftArrival()) { |
| | | //提升机不在工作档源库位楼层,调度提升机 |
| | | LiftCommand command1 = liftThread.getLiftUpDownCommand(liftProtocol.getLiftNo(), liftProtocol.getTaskNo(), wrkMastLocNoLey); |
| | |
| | | shuttleProtocol.setProtocolStatus(ShuttleProtocolStatusType.CHARGING); |
| | | |
| | | assignCommand.setShuttleNo(shuttleProtocol.getShuttleNo()); |
| | | assignCommand.setTaskMode((short) 9);//充电 |
| | | assignCommand.setTaskMode(ShuttleTaskModeType.CHARGE.id.shortValue());//充电 |
| | | assignCommand.setTaskNo(wrkCharge.getWrkNo().shortValue()); |
| | | assignCommand.setCharge(true);//充电任务 |
| | | |
| | |
| | | Short basDevpQrCode = Short.parseShort(basDevp.getQrCodeValue());//站点二维码 |
| | | |
| | | //增加移动进提升机命令 |
| | | ShuttleCommand moveCommand = shuttleThread.getMoveCommand(basDevpQrCode, liftProtocol.getBarcode(), 1400, ShuttleRunDirection.TOP.id, basDevpQrCode, 1400, 500); |
| | | ShuttleCommand moveCommand = shuttleThread.getMoveCommand(basDevpQrCode, liftProtocol.getBarcode(), 1600, ShuttleRunDirection.TOP.id, basDevpQrCode, 1600, 500); |
| | | commands.add(moveCommand); |
| | | |
| | | //分配目标库位 |
| | | shuttleProtocol.setLocNo(chargeLocNo); |
| | | assignCommand.setShuttleNo(shuttleProtocol.getShuttleNo()); |
| | | assignCommand.setTaskMode((short) 9);//充电 |
| | | assignCommand.setTaskMode(ShuttleTaskModeType.CHARGE.id.shortValue());//充电 |
| | | assignCommand.setTaskNo(wrkCharge.getWrkNo().shortValue()); |
| | | assignCommand.setCharge(true);//充电任务 |
| | | //目标库位 |
| | |
| | | Short distCode = Short.parseShort(basDevp.getQrCodeValue());//提升机口站点二维码 |
| | | Short runDirection = ShuttleRunDirection.BOTTOM.id;//运行方向 |
| | | //获取命令 |
| | | ShuttleCommand moveCommand = shuttleThread.getMoveCommand(startCode, distCode, 1400, runDirection, startCode, 1400, 500); |
| | | ShuttleCommand moveCommand = shuttleThread.getMoveCommand(startCode, distCode, 1600, runDirection, startCode, 1600, 500); |
| | | commands.add(0, moveCommand);//将该指令添加到队头 |
| | | |
| | | //进行充电中 |
| | | shuttleProtocol.setProtocolStatus(ShuttleProtocolStatusType.CHARGING); |
| | | |
| | | assignCommand.setShuttleNo(shuttleProtocol.getShuttleNo()); |
| | | assignCommand.setTaskMode((short) 9);//充电 |
| | | assignCommand.setTaskMode(ShuttleTaskModeType.CHARGE.id.shortValue());//充电 |
| | | assignCommand.setTaskNo(wrkCharge.getWrkNo().shortValue()); |
| | | assignCommand.setCharge(true);//充电任务 |
| | | |