| | |
| | | back = true; |
| | | } |
| | | // 退回 |
| | | if (back && (staProtocol.getWorkNo() == 9999 || staProtocol.getWorkNo() == 9998) && staProtocol.isInEnable() && staProtocol.isLoading() && staProtocol.isPakMk()) { |
| | | if (back && staProtocol.isInEnable() && staProtocol.isLoading() && staProtocol.isPakMk() && !staProtocol.isEmptyMk() ) { |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errMsg)); |
| | | staProtocol.setWorkNo(wrkNo); |
| | | wrkNo++; |
| | |
| | | } |
| | | |
| | | // 判断是否满足入库条件 |
| | | if (staProtocol.isAutoing() |
| | | && staProtocol.isLoading() |
| | | && staProtocol.isInEnable() |
| | | && !staProtocol.isEmptyMk() |
| | | && staProtocol.isPakMk() && staProtocol.getWorkNo() == 9999) { |
| | | if (staProtocol.isAutoing() //自动 |
| | | && staProtocol.isLoading() //有物 |
| | | && staProtocol.isInEnable() //可入 |
| | | && !staProtocol.isEmptyMk() // 非空板 |
| | | && staProtocol.isPakMk() //防止重复下发信号 站点无物 无任务号会自动变成true |
| | | ) { |
| | | if(Cools.isEmpty(barcode) || "NG".endsWith(barcode) || "NoRead".equals(barcode) || "00000000".equals(barcode)) { |
| | | News.info("{}条码扫描错误:{}",barcodeThread.getSlave().getId(),barcode); |
| | | continue; |
| | |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | String errorMsg = jsonObject.getString("msg"); |
| | | log.error("全版入库回退,"+wrkNo+","+errorMsg); |
| | | if (!Cools.isEmpty(errorMsg)) { |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg)); |
| | | } |
| | |
| | | // continue; |
| | | } |
| | | |
| | | // 判断堆垛机出库站状态 |
| | | if (staProtocol.isAutoing() && !staProtocol.isLoading() && staDetl.getCanouting() != null && staDetl.getCanouting().equals("Y") |
| | | && staProtocol.getWorkNo() == 0 && staProtocol.isOutEnable()) { |
| | | boolean outStationAvailable = true; |
| | | // 是否检查堆垛机出库站状态(true: 检查,false: 不检查) |
| | | if (slaveProperties.isCheckOutStationStatus()) { |
| | | // 检查出库站状态 |
| | | outStationAvailable = |
| | | //自动 |
| | | staProtocol.isAutoing() |
| | | //!有物 |
| | | && !staProtocol.isLoading() |
| | | //能出 |
| | | && staDetl.getCanouting() != null |
| | | && staDetl.getCanouting().equals("Y") |
| | | //工作号 |
| | | && staProtocol.getWorkNo() == 0 |
| | | //可出 |
| | | && staProtocol.isOutEnable(); |
| | | } |
| | | // 出库站可用时继续执行 |
| | | if (outStationAvailable) { |
| | | // 堆垛机控制过滤 |
| | | if (!crnProtocol.getStatusType().equals(CrnStatusType.IDLE) || crnProtocol.getTaskNo() != 0) { |
| | | // continue; |
| | |
| | | } |
| | | |
| | | // 站点条件判断 |
| | | if (staProtocol.isAutoing() |
| | | && staProtocol.isLoading() |
| | | && staProtocol.isInEnable() |
| | | && staProtocol.isEmptyMk() |
| | | && staProtocol.isPakMk() |
| | | && staProtocol.getWorkNo() == 9998 // 9997 回退 9998 空 9999 满 |
| | | ) { |
| | | if (staProtocol.isAutoing() //自动 |
| | | && staProtocol.isLoading() //有物 |
| | | && staProtocol.isInEnable() //可入 |
| | | && staProtocol.isEmptyMk()// 空板 |
| | | && staProtocol.isPakMk() //防止重复下发信号 站点无物 无任务号会自动变成true |
| | | |
| | | ) { |
| | | News.warnNoLog(""+mark+" - 0"+" - 开始执行:空栈板初始化入库,叉车入库站放货"); |
| | | |
| | | try { |
| | |
| | | LedCommand ledCommand = new LedCommand(); |
| | | ledCommand.setWorkNo(dto.getWorkNo()); |
| | | ledCommand.setIoType(1); |
| | | ledCommand.setTitle("全板入库"); |
| | | ledCommand.setTitle("空板入库"); |
| | | ledCommand.setLocNo(dto.getLocNo()); |
| | | ledCommand.setStaNo(dto.getStaNo()); |
| | | commands.add(ledCommand); |
| | |
| | | staProtocol.setStaNo(emptyInSta.getBackSta().shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | String errorMsg = jsonObject.getString("msg"); |
| | | log.error("空板入库回退"+wrkNo+","+errorMsg); |
| | | if (!result) { |
| | | News.errorNoLog(""+mark+" - 2"+" - 更新plc站点信息失败"); |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } |
| | | |
| | | if (ledThread != null) { |
| | | String errorMsg = jsonObject.getString("msg"); |
| | | |
| | | if (!Cools.isEmpty(errorMsg)) { |
| | | MessageQueue.offer(SlaveType.Led, emptyInSta.getLed(), new Task(3, errorMsg)); |
| | | } |