| | |
| | | * 组托 |
| | | * 入库站,根据条码扫描生成入库工作档,工作状态 2 |
| | | */ |
| | | public synchronized void generateStoreWrkFile(Integer mark) { |
| | | public synchronized void generateStoreWrkFile(Integer mark) throws InterruptedException { |
| | | // 根据输送线plc遍历 |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { //遍历输送线 |
| | | // 遍历入库口 |
| | |
| | | 是2号输送线9995拣料任务 |
| | | */ |
| | | String barcode = barcodeThread.getBarcode(); |
| | | if (Cools.isEmpty(barcode) || !staProtocol.isInEnable() || staProtocol.isEmptyMk() |
| | | || !staProtocol.isFullPlt() || (staProtocol.getWorkNo() == 9995 && devp.getId() == 2)) { |
| | | continue; |
| | | } |
| | | |
| | | |
| | | // 尺寸检测异常 |
| | | boolean back = false; |
| | |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg)); |
| | | Thread.sleep(500); |
| | | } |
| | | |
| | | if (Cools.isEmpty(barcode) || !staProtocol.isInEnable() || staProtocol.isEmptyMk() |
| | | || !staProtocol.isFullPlt() || (staProtocol.getWorkNo() == 9995 && devp.getId() == 2)) { |
| | | continue; |
| | | } |
| | | |
| | | if (staProtocol.isAutoing() && staProtocol.isInEnable() |
| | |
| | | ledCommand.setTitle("全板入库"); |
| | | ledCommand.setLocNo(dto.getLocNo()); |
| | | ledCommand.setStaNo(dto.getStaNo()); |
| | | ArrayList<MatDto> matDtos = new ArrayList<>(); |
| | | MatDto matDto = new MatDto(); |
| | | matDto.setLocNo(dto.getLocNo()); |
| | | matDtos.add(matDto); |
| | | ledCommand.setMatDtos(matDtos); |
| | | ledCommand.setBarcode(barcode); |
| | | commands.add(ledCommand); |
| | | if (devp.getId() == 1) { |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(1, commands)); |
| | | if (MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(1, commands))){ |
| | | ledThread.setLedMk(false); |
| | | } |
| | | } else { |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, commands)); |
| | | if (MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, commands))){ |
| | | ledThread.setLedMk(false); |
| | | } |
| | | } |
| | | // ledThread.errorReset(); |
| | | } |
| | |
| | | .eq("stn_no", stnNo) // 作业站点 = 拣料出库的目标站 |
| | | .eq("crn_no", wrkMast.getCrnNo()); // 堆垛机号 |
| | | StaDesc staDesc = staDescService.selectOne(wrapper); |
| | | //LED |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, pickSta.getLed()); |
| | | if (Cools.isEmpty(staDesc)) { |
| | | News.error(""+mark+" - 2"+" - 入库路径不存在!type_no={},stn_no={},crn_no={}", wrkMast.getIoType(), pickSta.getStaNo(), wrkMast.getCrnNo()); |
| | | if (devp.getId() == 2) { |
| | |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | } |
| | | //LED |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, pickSta.getLed()); |
| | | |
| | | // led 异常显示 |
| | | if (ledThread != null) { |
| | | String errorMsg = "此为拣料、并板、盘点再入库.请放在"+pickSta.getBackSta().shortValue()+"站点"; |
| | |
| | | ledCommand.setLocNo(wrkMast.getLocNo()); |
| | | ledCommand.setStaNo(wrkMast.getStaNo()); |
| | | ledCommand.setBarcode(barcode); |
| | | ArrayList<MatDto> matDtos = new ArrayList<>(); |
| | | MatDto matDto = new MatDto(); |
| | | matDto.setLocNo(wrkMast.getLocNo()); |
| | | matDtos.add(matDto); |
| | | ledCommand.setMatDtos(matDtos); |
| | | commands.add(ledCommand); |
| | | if (devp.getId() == 1) { |
| | | MessageQueue.offer(SlaveType.Led, pickSta.getLed(), new Task(1, commands)); |
| | | if (MessageQueue.offer(SlaveType.Led, pickSta.getLed(), new Task(1, commands))) { |
| | | ledThread.setLedMk(false); |
| | | } |
| | | } else { |
| | | MessageQueue.offer(SlaveType.Led, pickSta.getLed(), new Task(3, commands)); |
| | | if (MessageQueue.offer(SlaveType.Led, pickSta.getLed(), new Task(3, commands))){ |
| | | ledThread.setLedMk(false); |
| | | } |
| | | } |
| | | |
| | | // 更新站点信息 且 下发plc命令 |
| | |
| | | ledCommand.setLocNo(dto.getLocNo()); |
| | | ledCommand.setStaNo(dto.getStaNo()); |
| | | ledCommand.setBarcode(""); |
| | | ArrayList<MatDto> matDtos = new ArrayList<>(); |
| | | MatDto matDto = new MatDto(); |
| | | matDto.setLocNo(dto.getLocNo()); |
| | | matDtos.add(matDto); |
| | | ledCommand.setMatDtos(matDtos); |
| | | commands.add(ledCommand); |
| | | if (devp.getId() == 1) { |
| | | MessageQueue.offer(SlaveType.Led, emptyInSta.getLed(), new Task(1, commands)); |
| | |
| | | // 工作档集合 |
| | | List<WrkMast> wrkMasts = new ArrayList<>(); |
| | | for (Integer staNo : led.getStaArr()) { |
| | | if (staNo == 104 || staNo == 204) { |
| | | if (staNo == 104 || staNo == 204 || staNo == 304) { |
| | | continue; |
| | | } |
| | | // 获取叉车站点 |
| | |
| | | } else { |
| | | ledThread.setLedMk(false); |
| | | } |
| | | } else { |
| | | } else if(led.getId() == 1 || led.getId() == 2){ |
| | | if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(1, commands))) { |
| | | News.error(""+mark+" - 3"+" - {}号LED命令下发失败!!![ip:{}] [port:{}]", led.getId(), led.getIp(), led.getPort()); |
| | | continue; |