| | |
| | | BasDevp basDevp = basDevpService.queryByLocNo(liftSiteLocNo); |
| | | Short endStartCode = Short.parseShort(basDevp.getQrCodeValue());//站点二维码 |
| | | |
| | | String disLocNo = "190020" + Utils.getLev(liftSiteLocNo);//避让位置 |
| | | String disLocNo = "200020" + Utils.getLev(liftSiteLocNo);//避让位置 |
| | | LocMast locMast1 = locMastService.queryByLoc(disLocNo); |
| | | if (locMast1 == null) { |
| | | continue;//找不到库位 |
| | | } |
| | | short disCode = Short.parseShort(locMast1.getQrCodeValue()); |
| | | //任务执行完后,小车进入移开提升机口站点位置,以免坠落 |
| | | ShuttleCommand moveCommand = shuttleThread.getMoveCommand(endStartCode, disCode, 1400, ShuttleRunDirection.BOTTOM.id, endStartCode, 1400, 500); |
| | | ShuttleCommand moveCommand = shuttleThread.getMoveCommand(endStartCode, disCode, 2800, ShuttleRunDirection.BOTTOM.id, endStartCode, 2800, 1000); |
| | | commands.add(moveCommand); |
| | | |
| | | //分配目标库位 |
| | |
| | | BasDevp basDevp = basDevpService.queryByLocNo(liftSiteLocNo); |
| | | Short endStartCode = Short.parseShort(basDevp.getQrCodeValue());//站点二维码 |
| | | |
| | | String disLocNo = "190020" + Utils.getLev(liftSiteLocNo);//避让位置 |
| | | String disLocNo = "200020" + Utils.getLev(liftSiteLocNo);//避让位置 |
| | | LocMast locMast1 = locMastService.queryByLoc(disLocNo); |
| | | if (locMast1 == null) { |
| | | continue;//找不到库位 |
| | | } |
| | | short disCode = Short.parseShort(locMast1.getQrCodeValue()); |
| | | //任务执行完后,小车进入移开提升机口站点位置,以免坠落 |
| | | ShuttleCommand moveCommand2 = shuttleThread.getMoveCommand(endStartCode, disCode, 1400, ShuttleRunDirection.BOTTOM.id, endStartCode, 1400, 500); |
| | | ShuttleCommand moveCommand2 = shuttleThread.getMoveCommand(endStartCode, disCode, 2800, ShuttleRunDirection.BOTTOM.id, endStartCode, 2800, 1000); |
| | | |
| | | List<ShuttleCommand> commands = this.shuttleAssignCommand(liftSiteLocNo, wrkMast.getSourceLocNo(), liftSiteLocNo, assignCommand, shuttleThread); |
| | | if (commands == null) { |
| | |
| | | continue; |
| | | } |
| | | |
| | | //获取目标站 |
| | | StaProtocol staProtocol = devpThread.getStation().get(wrkMast.getStaNo()); |
| | | if (staProtocol.isLoading() || !staProtocol.isInEnable()) {//目标站有物,不可入,禁止分配任务 |
| | | continue; |
| | | } |
| | | |
| | | //工作档目标库位号 |
| | | String wrkMastLocNo = wrkMast.getLocNo(); |
| | | //工作档目标库位楼层 |
| | |
| | | && !liftProtocol.getRunning() |
| | | ) { |
| | | |
| | | //标记复位 |
| | | liftProtocol.setPakMk(true); |
| | | |
| | | DevpThread devpThread = null; |
| | | Integer devpId = null; |
| | | for (DevpSlave devp : slaveProperties.getDevp()){ |
| | |
| | | //将任务档标记为完成 |
| | | WrkMast wrkMast = wrkMastMapper.selectByWorkNo372428(liftProtocol.getTaskNo().intValue()); |
| | | if (wrkMast != null) { |
| | | //判断提升机是否到达任务楼层 |
| | | String locNo = wrkMast.getIoType() < 101 ? wrkMast.getLocNo() : wrkMast.getSourceLocNo(); |
| | | int lev = Utils.getLev(locNo);//任务目标楼层 |
| | | if (liftProtocol.getLev().intValue() != lev) { |
| | | continue;//提升机没有到达目标 |
| | | } |
| | | |
| | | //标记复位 |
| | | liftProtocol.setPakMk(true); |
| | | |
| | | switch (wrkMast.getWrkSts().intValue()) { |
| | | case 3://3.提升机搬运中 ==> 4.提升机搬运完成 |
| | | //给目标站设置工作号 |
| | |
| | | if (!result) { |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } |
| | | //任务号清零 |
| | | liftProtocol.setTaskNo((short) 0); |
| | | wrkMast.setWrkSts(4L); |
| | | break; |
| | | case 7://7.提升机迁移小车中 ==> 8.提升机迁移小车完成 |
| | |
| | | //查询是否有充电任务 |
| | | WrkCharge wrkCharge = wrkChargeMapper.selectByWorkNo(liftProtocol.getTaskNo().intValue()); |
| | | if (wrkCharge != null) { |
| | | //标记复位 |
| | | liftProtocol.setPakMk(true); |
| | | |
| | | switch (wrkCharge.getWrkSts().intValue()) { |
| | | case 54://提升机搬运中 |
| | | wrkCharge.setWrkSts(55L);//提升机搬运完成 |