| | |
| | | if (bay == 2 || bay == 7) { |
| | | return (short) 3; |
| | | } else if (bay == 3) { |
| | | return (short) 1; |
| | | return (short) 2; |
| | | } else if (bay == 4) { |
| | | return (short) 2; |
| | | } else if (bay == 5) { |
| | |
| | | if (back) { |
| | | log.info("errmsg: " + errMsg); |
| | | // News.warn("扫码入库失败,{}入库站因{}异常,托盘已被退回", inSta.getStaNo(), errMsg); |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errMsg)); |
| | | |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg)); |
| | | if (!staProtocol.isLoading()) { |
| | | continue; |
| | | } |
| | |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | log.error("输送线下发1:" + 9999 + "," + inSta.getBackSta()); |
| | | } |
| | | |
| | | |
| | | // 获取条码扫描仪信息 |
| | | //BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcode()); |
| | | if (barcodeThread == null) { |
| | | // led 异常显示 |
| | | if (ledThread != null) { |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg)); |
| | | } |
| | | continue; |
| | | } |
| | | // 获取入库站信息 |
| | | //SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); |
| | | //StaProtocol staProtocol = devpThread.getStation().get(inSta.getStaNo()); |
| | | if (staProtocol == null) { |
| | | continue; |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | |
| | | //LED |
| | | //LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | // 入出库模式判断 |
| | | // if ( inSta.getStaNo()==203 && devpThread.ioModeOf2F != IoModeType.PAKIN_MODE) { continue; } |
| | | // if (inSta.getStaNo() == 203 && devpThread.ioModeOf2F == IoModeType.PAKOUT_MODE) { |
| | | // continue; |
| | | // } |
| | | //System.out.println(staProtocol); |
| | | // 判断是否满足入库条件 |
| | | if (!staProtocol.isLoading()) { |
| | | continue; |
| | | } |
| | | String barcode11 = barcodeThread.getBarcode(); |
| | | if (Cools.isEmpty(barcode11)) { |
| | | if (staProtocol.isAutoing() && !staProtocol.isEmptyMk() && staProtocol.getWorkNo() == 9999 && staProtocol.isPakMk() && staProtocol.getStamp() == 2) { |
| | | staProtocol.setStamp(3); |
| | | News.info("" + mark + " - 7" + " - 扫码失败2 ===>> {}号条码扫描器检测条码信息:{},站点:{}", inSta.getBarcode(), barcode11, inSta.getStaNo()); |
| | | staProtocol.setWorkNo((short) 9989); |
| | | staProtocol.setStaNo(inSta.getBackSta().shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | // led 异常显示 |
| | | if (ledThread != null) { |
| | | String errorMsg = "扫码失败,请重试"; |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errorMsg)); |
| | | } |
| | | continue; |
| | | } |
| | | } |
| | | System.out.println(staProtocol); |
| | | if (staProtocol.isAutoing() && staProtocol.isInEnable() |
| | | && !staProtocol.isEmptyMk() && (staProtocol.getWorkNo() == 0 || staProtocol.getWorkNo() > 9990) |
| | | && !staProtocol.isEmptyMk() && (staProtocol.getWorkNo() > 0 && staProtocol.getWorkNo() < 6001) |
| | | && staProtocol.isPakMk() && staProtocol.getStamp() >= 2 && staProtocol.getStamp() != 3) {// && !Cools.isEmpty(barcode)) { |
| | | News.warnNoLog("" + mark + " - 0" + " - 开始执行"); |
| | | // try { |
| | | // Thread.sleep(300); |
| | | // }catch (Exception e){} |
| | | News.warn("" + mark + " - 0" + " - 开始执行"); |
| | | |
| | | //String barcode = barcodeThread.getBarcode(); |
| | | if (!Cools.isEmpty(barcode)) { |
| | | News.info("" + mark + " - 1" + " - {}号条码扫描器检测条码信息:{}", inSta.getBarcode(), barcode); |
| | | if ("NG".endsWith(barcode) || "NoRead".equals(barcode) || "empty".equals(barcode)) { |
| | | News.infoNoLog("" + mark + " - 1" + " - {}号条码扫描器检测条码信息:{}", inSta.getBarcode(), barcode); |
| | | if ("NG".endsWith(barcode) || barcode.equals("00000000") || "NoRead".equals(barcode) || "empty".equals(barcode)) { |
| | | staProtocol.setWorkNo((short) 9999); |
| | | staProtocol.setStaNo(inSta.getBackSta().shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | |
| | | for (DevpSlave.Sta pickSta : devp.getPickSta()) { |
| | | // 获取条码扫描仪信息 |
| | | BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, pickSta.getBarcode()); |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, pickSta.getLed()); |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); |
| | | StaProtocol staProtocol = devpThread.getStation().get(pickSta.getStaNo()); |
| | | if (staProtocol == null) { |
| | | continue; |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | |
| | | if (barcodeThread == null) { |
| | | continue; |
| | | } |
| | | String barcode = barcodeThread.getBarcode(); |
| | | // 尺寸检测异常 |
| | | boolean back = false; |
| | | String errMsg = ""; |
| | | if (staProtocol.isFrontErr()) { |
| | | errMsg = "前超限"; |
| | | back = true; |
| | | } |
| | | if (!back && staProtocol.isBackErr()) { |
| | | errMsg = "后超限"; |
| | | back = true; |
| | | } |
| | | if (!back && staProtocol.isHighErr()) { |
| | | errMsg = "高超限"; |
| | | back = true; |
| | | } |
| | | if (!back && staProtocol.isLeftErr()) { |
| | | errMsg = "左超限"; |
| | | back = true; |
| | | } |
| | | if (!back && staProtocol.isRightErr()) { |
| | | errMsg = "右超限"; |
| | | back = true; |
| | | } |
| | | if (!back && staProtocol.isWeightErr()) { |
| | | errMsg = "超重"; |
| | | back = true; |
| | | } |
| | | if (!back && staProtocol.isBarcodeErr()) { |
| | | errMsg = "扫码失败"; |
| | | back = true; |
| | | } |
| | | |
| | | // 退回 |
| | | if (back) { |
| | | log.info("errmsg: " + errMsg); |
| | | // News.warn("扫码入库失败,{}入库站因{}异常,托盘已被退回", inSta.getStaNo(), errMsg); |
| | | MessageQueue.offer(SlaveType.Led, pickSta.getLed(), new Task(5, errMsg)); |
| | | if (!staProtocol.isLoading()) { |
| | | continue; |
| | | } |
| | | if (!staProtocol.isPakMk()) { |
| | | continue; |
| | | } |
| | | staProtocol.setWorkNo((short) 9999); |
| | | News.info("{}入库回退:{},任务号:{}", pickSta.getStaNo(), errMsg, (short) 9999); |
| | | staProtocol.setStaNo(pickSta.getBackSta().shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | log.error("输送线下发1:" + 9999 + "," + pickSta.getBackSta()); |
| | | |
| | | // led 异常显示 |
| | | if (ledThread != null) { |
| | | MessageQueue.offer(SlaveType.Led, pickSta.getLed(), new Task(5, errMsg)); |
| | | } |
| | | continue; |
| | | } |
| | | if (!Cools.isEmpty(barcode)) { |
| | | News.info("" + mark + " - 1" + " - {}号条码扫描器检测条码信息:{}", pickSta.getBarcode(), barcode); |
| | | if ("NG".endsWith(barcode) || "NoRead".equals(barcode)) { |
| | |
| | | } |
| | | |
| | | // 获取拣料入库站信息 |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); |
| | | StaProtocol staProtocol = devpThread.getStation().get(pickSta.getStaNo()); |
| | | if (staProtocol == null) { |
| | | continue; |
| | | } else { |
| | |
| | | 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() + "站点"; |
| | |
| | | } |
| | | } |
| | | } |
| | | System.out.println("434323"); |
| | | News.warnNoLog("" + mark + " - 1" + " - 15" + " - 命令下发 : 工作号={},源排={},源列={},源层={},目标排={},目标列={},目标层={}", wrkMast.getWrkNo().shortValue() |
| | | , crnStn.getRow().shortValue(), crnStn.getBay().shortValue(), crnStn.getLev().shortValue() |
| | | , locMast.getRow1().shortValue(), locMast.getBay1().shortValue(), locMast.getLev1().shortValue()); |
| | |
| | | // 遍历空板入库口 |
| | | for (DevpSlave.Sta emptyInSta : devp.getEmptyInSta()) { |
| | | // 获取空板入库站信息 |
| | | BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, emptyInSta.getBarcode()); |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, emptyInSta.getLed()); |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); |
| | | StaProtocol staProtocol = devpThread.getStation().get(emptyInSta.getStaNo()); |
| | | if (staProtocol == null) { |
| | |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | |
| | | LedThread ledThread = null; |
| | | if (!Cools.isEmpty(emptyInSta.getLed())) { |
| | | ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, emptyInSta.getLed()); |
| | | if (barcodeThread == null) { |
| | | continue; |
| | | } |
| | | String barcode = barcodeThread.getBarcode(); |
| | | // 尺寸检测异常 |
| | | boolean back = false; |
| | | String errMsg = ""; |
| | | if (staProtocol.isFrontErr()) { |
| | | errMsg = "前超限"; |
| | | back = true; |
| | | } |
| | | if (!back && staProtocol.isBackErr()) { |
| | | errMsg = "后超限"; |
| | | back = true; |
| | | } |
| | | if (!back && staProtocol.isHighErr()) { |
| | | errMsg = "高超限"; |
| | | back = true; |
| | | } |
| | | if (!back && staProtocol.isLeftErr()) { |
| | | errMsg = "左超限"; |
| | | back = true; |
| | | } |
| | | if (!back && staProtocol.isRightErr()) { |
| | | errMsg = "右超限"; |
| | | back = true; |
| | | } |
| | | if (!back && staProtocol.isWeightErr()) { |
| | | errMsg = "超重"; |
| | | back = true; |
| | | } |
| | | if (!back && staProtocol.isBarcodeErr()) { |
| | | errMsg = "扫码失败"; |
| | | back = true; |
| | | } |
| | | |
| | | // 退回 |
| | | if (back) { |
| | | log.info("errmsg: " + errMsg); |
| | | // News.warn("扫码入库失败,{}入库站因{}异常,托盘已被退回", inSta.getStaNo(), errMsg); |
| | | MessageQueue.offer(SlaveType.Led, emptyInSta.getLed(), new Task(5, errMsg)); |
| | | if (!staProtocol.isLoading()) { |
| | | continue; |
| | | } |
| | | if (!staProtocol.isPakMk()) { |
| | | continue; |
| | | } |
| | | staProtocol.setWorkNo((short) 9999); |
| | | News.info("{}入库回退:{},任务号:{}", emptyInSta.getStaNo(), errMsg, (short) 9999); |
| | | staProtocol.setStaNo(emptyInSta.getBackSta().shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | log.error("输送线下发1:" + 9999 + "," + emptyInSta.getBackSta()); |
| | | |
| | | // led 异常显示 |
| | | if (ledThread != null) { |
| | | MessageQueue.offer(SlaveType.Led, emptyInSta.getLed(), new Task(5, errMsg)); |
| | | } |
| | | continue; |
| | | } |
| | | |
| | | if (!staProtocol.isLoading()) { |
| | |
| | | if (staProtocol.isAutoing() |
| | | && staProtocol.isInEnable() |
| | | && staProtocol.isEmptyMk() |
| | | && (staProtocol.getWorkNo() > 9990 && staProtocol.getWorkNo() <= 9999) |
| | | && (staProtocol.getWorkNo() >= 9990 && staProtocol.getWorkNo() <= 9999) |
| | | && staProtocol.isPakMk() && staProtocol.getStamp() >= 2) { |
| | | News.warnNoLog("" + mark + " - 0" + " - 开始执行:空栈板初始化入库,叉车入库站放货"); |
| | | |
| | |
| | | if (staProtocol.isAutoing() //自动 |
| | | && staProtocol.isLoading() //有物 |
| | | && staProtocol.isInEnable() //可入信号 |
| | | && (staProtocol.getWorkNo() == 0 || staProtocol.getWorkNo() > 9990) //工作号为0或者工作号是9991~9999(输送机留用) |
| | | && (staProtocol.getWorkNo() == 0 || staProtocol.getWorkNo() >= 9990) //工作号为0或者工作号是9991~9999(输送机留用) |
| | | ) { |
| | | |
| | | try { |