| | |
| | | crnCommand.setLaneNo(crnProtocol.getLaneNo()); // 堆垛机巷道编号 |
| | | crnCommand.setTaskNo((short)999); // 工作号 |
| | | crnCommand.setAckFinish((short) 0); // 任务完成确认位 |
| | | crnCommand.setTaskMode(CrnTaskModeType.GO_ORIGIN); // 任务模式: 库位移转 |
| | | crnCommand.setTaskMode(CrnTaskModeType.SITE_MOVE); // 任务模式: 站位移转4 |
| | | crnCommand.setSourcePosX((short) 0); // 源库位排 |
| | | crnCommand.setSourcePosY((short) 0); // 源库位列 |
| | | crnCommand.setSourcePosZ((short) 0); // 源库位层 |
| | | crnCommand.setSourcePosY(crnProtocol.getBay()); // 源库位列 |
| | | crnCommand.setSourcePosZ(crnProtocol.getLevel()); // 源库位层 |
| | | int row = crnProtocol.getLaneNo() * 2; |
| | | crnCommand.setDestinationPosX((short) row); // 目标库位排 |
| | | crnCommand.setDestinationPosY((short) 1); // 目标库位层 |
| | |
| | | // } |
| | | |
| | | // 命令下发区 -------------------------------------------------------------------------- |
| | | CrnCommand crnCommand = new CrnCommand(); |
| | | crnCommand.setCrnNo(slave.getId()); // 堆垛机编号 |
| | | crnCommand.setLaneNo(crnProtocol.getLaneNo()); // 堆垛机巷道编号 |
| | | crnCommand.setTaskNo(taskWrk.getWrkNo().shortValue()); // 工作号 |
| | | crnCommand.setAckFinish((short) 0); // 任务完成确认位 |
| | | crnCommand.setTaskMode(CrnTaskModeType.LOC_MOVE); // 任务模式: 库位移转 |
| | | crnCommand.setSourcePosX(crnStn.getRow().shortValue()); // 源库位排 |
| | | crnCommand.setSourcePosY(crnStn.getBay().shortValue()); // 源库位列 |
| | | crnCommand.setSourcePosZ(crnStn.getLev().shortValue()); // 源库位层 |
| | | crnCommand.setDestinationPosX(Utils.getRowShort(taskWrk.getTargetPoint())); // 目标库位列 |
| | | CrnCommand crnCommand1 = new CrnCommand(); |
| | | crnCommand1.setCrnNo(slave.getId()); // 堆垛机编号 |
| | | crnCommand1.setLaneNo(crnProtocol.getLaneNo()); // 堆垛机巷道编号 |
| | | crnCommand1.setTaskNo(taskWrk.getWrkNo().shortValue()); // 工作号 |
| | | crnCommand1.setAckFinish((short) 0); // 任务完成确认位 |
| | | crnCommand1.setTaskMode(CrnTaskModeType.LOC_MOVE); // 任务模式: 库位移转 |
| | | crnCommand1.setSourcePosX(crnStn.getRow().shortValue()); // 源库位排 |
| | | crnCommand1.setSourcePosY(crnStn.getBay().shortValue()); // 源库位列 |
| | | crnCommand1.setSourcePosZ(crnStn.getLev().shortValue()); // 源库位层 |
| | | crnCommand1.setDestinationPosX(Utils.getRowShort(taskWrk.getTargetPoint())); // 目标库位列 |
| | | int bay1 = Utils.getBayShort(taskWrk.getTargetPoint()) + 1; |
| | | crnCommand.setDestinationPosY((short)bay1); // 目标库位层 |
| | | crnCommand.setDestinationPosZ(Utils.getLevShort(taskWrk.getTargetPoint())); // 目标库位排 |
| | | crnCommand1.setDestinationPosY((short)bay1); // 目标库位层 |
| | | crnCommand1.setDestinationPosZ(Utils.getLevShort(taskWrk.getTargetPoint())); // 目标库位排 |
| | | // crnCommand.setCommand((short) 1); |
| | | if (!MessageQueue.offer(SlaveType.Crn, slave.getId(), new Task(2, crnCommand))) { |
| | | log.error("堆垛机命令生成失败,堆垛机号={},任务数据={}", taskWrk.getCrnNo(), JSON.toJSON(crnCommand)); |
| | | if (!MessageQueue.offer(SlaveType.Crn, slave.getId(), new Task(2, crnCommand1))) { |
| | | log.error("堆垛机命令生成失败,堆垛机号={},任务数据={}", taskWrk.getCrnNo(), JSON.toJSON(crnCommand1)); |
| | | devpThread.setErrorDev(staProtocol.getSiteId(), crnProtocol.getLaneNo()+"巷道堆垛机命令生成失败"); |
| | | CrnErrCache.updateCrnErr(crnProtocol.getCrnNo(), "运行命令下发失败"); |
| | | |
| | |
| | | } |
| | | |
| | | // 判断堆垛机出库站状态 |
| | | if (staProtocol.isAutoing() && staDetl.getCanouting() != null && staDetl.getCanouting().equals("Y")) { |
| | | // if (staProtocol.isAutoing() && staDetl.getCanouting() != null && staDetl.getCanouting().equals("Y")) { |
| | | |
| | | // // 判断堆垛机出库站状态 |
| | | // if (staProtocol.isAutoing() && !staProtocol.isLoading() && staDetl.getCanouting() != null && staDetl.getCanouting().equals("Y") |
| | | // && staProtocol.getWorkNo() == 0 && staProtocol.isOutEnable()) { |
| | | if (staProtocol.isAutoing() && !staProtocol.isLoading() && staDetl.getCanouting() != null && staDetl.getCanouting().equals("Y") |
| | | && staProtocol.getWorkNo() == 0 && staProtocol.isOutEnable()) { |
| | | // 命令下发区 -------------------------------------------------------------------------- |
| | | |
| | | // 堆垛机控制过滤 |
| | |
| | | if (staProtocol.isOutEnable()){ |
| | | CrnErrCache.updateCrnErr(crnProtocol.getCrnNo(), "没有可出"); |
| | | } |
| | | if (staProtocol.isLoading()){ |
| | | CrnErrCache.updateCrnErr(crnProtocol.getCrnNo(), "出库站有物"); |
| | | } |
| | | } else { |
| | | CrnErrCache.updateCrnErr(crnProtocol.getCrnNo(), "出库站点:非自动"); |
| | | } |
| | |
| | | |
| | | // 已经存在吊车执行任务时,则过滤 |
| | | if (taskWrkMapper.selectCrnWorking(crnProtocol.getLaneNo()) != null) { |
| | | CrnErrCache.updateCrnErr(crnProtocol.getCrnNo(), "堆垛机存在执行中吊车任务"); |
| | | continue; |
| | | } |
| | | |
| | |
| | | } |
| | | return null; |
| | | } |
| | | return null; |
| | | } |
| | | return taskWrk; |
| | | } |