#
zjj
2023-12-25 793e1ecb8d24c51a15d81eabd409361248e5663e
#
4个文件已修改
89 ■■■■ 已修改文件
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java 63 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/model/protocol/StaProtocol.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/SiemensDevpThread.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -106,6 +106,57 @@
                }
                String barcode = barcodeThread.getBarcode();
                // 获取入库站信息
                SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId());
                StaProtocol staProtocol = devpThread.getStation().get(inSta.getStaNo());
                if (staProtocol == null) {
                    continue;
                } else {
                    staProtocol = staProtocol.clone();
                }
                // 尺寸检测异常
                boolean back = false;
                String errMsg = "异常:";
                if (staProtocol.isFrontErr()) {
                    errMsg = errMsg+"前超限;";
                    back = true;
                }
                if (staProtocol.isBackErr()) {
                    errMsg = errMsg+"后超限";
                    back = true;
                }
                if (staProtocol.isHighErr()) {
                    errMsg = errMsg+"高超限";
                    back = true;
                }
                if (staProtocol.isLeftErr()) {
                    errMsg = errMsg+"左超限";
                    back = true;
                }
                if (staProtocol.isRightErr()) {
                    errMsg = errMsg+"右超限";
                    back = true;
                }
                if (staProtocol.isWeightErr()) {
                    errMsg = errMsg+"超重";
                    back = true;
                }
                if (staProtocol.isBarcodeErr()) {
                    errMsg = errMsg+"扫码失败";
                    back = true;
                }
                // 退回
                if (back) {
                    // led 异常显示
                    LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed());
                    if (ledThread != null) {
                        MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errMsg));
                    }
                    continue;
                }
                if (!Cools.isEmpty(barcode)) {
                    log.info("{}号条码扫描器检测条码信息:{}", inSta.getBarcode(), barcode);
                    if ("NG".endsWith(barcode) || "NoRead".equals(barcode)) {
@@ -120,16 +171,6 @@
//                    }
                    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();
                }
                // 判断是否满足入库条件
                if (staProtocol.isAutoing()
                        && staProtocol.isLoading()
@@ -1419,7 +1460,7 @@
                // 获取叉车站点
                StaProtocol staProtocol = devpThread.getStation().get(staNo);
                if (staProtocol == null) { continue; }
                if (staProtocol.getWorkNo() != 0) {
                if (staProtocol.getWorkNo() != 0 || staProtocol.isErr()) {
                    reset = false;
                    break;
                }
src/main/java/com/zy/core/model/protocol/StaProtocol.java
@@ -85,6 +85,14 @@
    // 扫码失败
    private boolean barcodeErr = false;
    public Boolean isErr(){
        if (frontErr || backErr || highErr || leftErr || rightErr || weightErr || barcodeErr){
            return true;
        }else {
            return false;
        }
    }
    public BasDevp toSqlModel(){
        BasDevp basDevp = new BasDevp();
        basDevp.setDevNo(siteId);
src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -341,13 +341,13 @@
        //报警信息
        Thread.sleep(200);
        OperateResultExOne<byte[]> result3 = null;
        result3 = siemensS7Net.Read("DB101.800.0", (short) (getErrorStaNo().size() * 4));
        result3 = siemensS7Net.Read("DB101.200.0", (short) (getErrorStaNo().size() * 4));
        if (result3.IsSuccess) {
            for (int i = 0; i < getErrorStaNo().size(); i++) {
                Integer siteId = getErrorStaNo().get(i); // 站点编号
                StaProtocol staProtocol = station.get(siteId);
                staProtocol.setLocType1(siemensS7Net.getByteTransform().TransInt16(result.Content, i*4));   // 库位高度
                boolean[] status = siemensS7Net.getByteTransform().TransBool(result3.Content, i*4+2, 2);
//                staProtocol.setLocType1(siemensS7Net.getByteTransform().TransInt16(result.Content, i*4));   // 库位高度
                boolean[] status = siemensS7Net.getByteTransform().TransBool(result3.Content, i*4+2, 1);
                staProtocol.setFrontErr(status[0]);
                staProtocol.setBackErr(status[1]);
                staProtocol.setHighErr(status[2]);
src/main/resources/application.yml
@@ -269,28 +269,28 @@
  # LED1
  led[0]:
    id: 1
    ip: 10.10.10.205
    ip: 10.10.10.151
    port: 5005
    devpPlcId: ${wcs-slave.devp[0].id}
    staArr: 1002
  # LED2
  led[1]:
    id: 2
    ip: 10.10.10.206
    ip: 10.10.10.152
    port: 5005
    devpPlcId: ${wcs-slave.devp[0].id}
    staArr: 1006
    staArr: 1004
  # LED3
  led[2]:
    id: 3
    ip: 10.10.10.206
    ip: 10.10.10.153
    port: 5005
    devpPlcId: ${wcs-slave.devp[0].id}
    staArr: 1010
    staArr: 1008
  # LED4
  led[3]:
    id: 4
    ip: 10.10.10.206
    ip: 10.10.10.154
    port: 5005
    devpPlcId: ${wcs-slave.devp[0].id}
    staArr: 1012