| | |
| | | // 获取工作状态为 2,3,4,5,6 的入库工作档 |
| | | WrkMast wrkMast = wrkMastMapper.selectPakInStep23456(slave.getId(), staProtocol.getWorkNo().intValue(), crnStn.getStaNo()); |
| | | if(null == wrkMast || (wrkMast.getCrnNo()==2 && wrkMast.getWrkSts()==2 && crnProtocol.getCrnNo()!=2 && (wrkMast.getIoType()==1 || wrkMast.getIoType()==10)) ){ |
| | | // News.error("{}站点查询无待入库数据 工作号={}", crnStn.getStaNo(), staProtocol.getWorkNo()); |
| | | // 已经存在吊车执行任务时,则过滤 |
| | | if (wrkMastMapper.selectWorking(slave.getId()) != null) { |
| | | continue; |
| | | } |
| | | if (Cools.isEmpty(staProtocol.getWorkNo())){ |
| | | continue; |
| | | } |
| | | // 判断堆垛机状态等待确认 |
| | | if (crnProtocol.modeType == CrnModeType.AUTO |
| | | && crnProtocol.statusType == CrnStatusType.IDLE |
| | | && crnProtocol.forkPosType == CrnForkPosType.HOME) { |
| | | News.info("堆垛机接驳任务执行,工作号:"+staProtocol.getWorkNo()+";执行堆垛机号:"+slave.getId()+";接驳取货位:"+crnStn.getStaNo()+";接驳放货位:"+staProtocol.getSiteId()); |
| | | // 堆垛机接驳任务命令下发区 -------------------------------------------------------------------------- |
| | | CrnCommand crnCommand = new CrnCommand(); |
| | | crnCommand.setCrnNo(slave.getId()); // 堆垛机编号 |
| | | crnCommand.setTaskNo(staProtocol.getWorkNo()); // 工作号 |
| | | crnCommand.setAckFinish((short) 0); // 任务完成确认位 |
| | | crnCommand.setCommand((short) 0); |
| | | crnCommand.setTaskMode(CrnTaskModeType.XY_MOVE); // 任务模式: 站位转移 |
| | | crnCommand.setSourcePosX(crnStn.getRow().shortValue()); // 源库位排 |
| | | crnCommand.setSourcePosY(crnStn.getBay().shortValue()); // 源库位列 |
| | | crnCommand.setSourcePosZ(crnStn.getLev().shortValue()); // 源库位层 |
| | | crnCommand.setDestinationPosX(Utils.getRow(staProtocol.getSiteId())); // 目标库位排 |
| | | crnCommand.setDestinationPosY(Utils.getBay(staProtocol.getSiteId())); // 目标库位列 |
| | | crnCommand.setDestinationPosZ(Utils.getLev(staProtocol.getSiteId())); // 目标库位层 |
| | | if (!MessageQueue.offer(SlaveType.Crn, slave.getId(), new Task(2, crnCommand))) { |
| | | News.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", slave.getId(), JSON.toJSONString(crnCommand)); |
| | | try{ |
| | | // News.error("{}站点查询无待入库数据 工作号={}", crnStn.getStaNo(), staProtocol.getWorkNo()); |
| | | // 已经存在吊车执行任务时,则过滤 |
| | | if (wrkMastMapper.selectWorking(slave.getId()) != null) { |
| | | continue; |
| | | } |
| | | return true; |
| | | if (Cools.isEmpty(staProtocol.getWorkNo()) || !staProtocol.isLoading()){ |
| | | continue; |
| | | } |
| | | // 判断堆垛机状态等待确认 |
| | | if (crnProtocol.modeType == CrnModeType.AUTO |
| | | && crnProtocol.statusType == CrnStatusType.IDLE |
| | | && crnProtocol.forkPosType == CrnForkPosType.HOME) { |
| | | News.info("堆垛机接驳任务执行,工作号:"+staProtocol.getWorkNo()+";执行堆垛机号:"+slave.getId()+";接驳取货位:"+crnStn.getStaNo()+";接驳放货位:"+staProtocol.getSiteId()); |
| | | // 堆垛机接驳任务命令下发区 -------------------------------------------------------------------------- |
| | | CrnCommand crnCommand = new CrnCommand(); |
| | | crnCommand.setCrnNo(slave.getId()); // 堆垛机编号 |
| | | crnCommand.setTaskNo(staProtocol.getWorkNo()); // 工作号 |
| | | crnCommand.setAckFinish((short) 0); // 任务完成确认位 |
| | | crnCommand.setCommand((short) 0); |
| | | crnCommand.setTaskMode(CrnTaskModeType.XY_MOVE); // 任务模式: 站位转移 |
| | | crnCommand.setSourcePosX(crnStn.getRow().shortValue()); // 源库位排 |
| | | crnCommand.setSourcePosY(crnStn.getBay().shortValue()); // 源库位列 |
| | | crnCommand.setSourcePosZ(crnStn.getLev().shortValue()); // 源库位层 |
| | | crnCommand.setDestinationPosX(Utils.getRow(staProtocol.getSiteId())); // 目标库位排 |
| | | crnCommand.setDestinationPosY(Utils.getBay(staProtocol.getSiteId())); // 目标库位列 |
| | | crnCommand.setDestinationPosZ(Utils.getLev(staProtocol.getSiteId())); // 目标库位层 |
| | | if (!MessageQueue.offer(SlaveType.Crn, slave.getId(), new Task(2, crnCommand))) { |
| | | News.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", slave.getId(), JSON.toJSONString(crnCommand)); |
| | | } |
| | | return true; |
| | | } |
| | | continue; |
| | | } catch (Exception e){ |
| | | News.info("堆垛机接驳任务执行,一场:"+e.getMessage()); |
| | | } |
| | | continue; |
| | | } |
| | |
| | | */ |
| | | public synchronized void ledReset() { |
| | | for (LedSlave led : slaveProperties.getLed()) { |
| | | if (led.getId()>3){ |
| | | continue; |
| | | } |
| | | // 获取输送线plc线程 |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, led.getDevpPlcId()); |
| | | // 命令集合 |