自动化立体仓库 - WCS系统
#
Junjie
2023-12-25 7c16bcc9b921ebe24ee6f9591e1675afc10816bf
#
2个文件已修改
54 ■■■■■ 已修改文件
src/main/java/com/zy/core/model/protocol/StaProtocol.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/SiemensDevpThread.java 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/model/protocol/StaProtocol.java
@@ -59,6 +59,9 @@
    private boolean emptyOutPalletRequire;
    private boolean emptyInPalletRequire;
    //库位高度
    private Short locType1;
    public BasDevp toSqlModel(){
        BasDevp basDevp = new BasDevp();
        basDevp.setDevNo(siteId);
src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -143,6 +143,18 @@
        add(4010);add(4016);
    }};
    public static final ArrayList<Integer> errorStaNos1 = new ArrayList<Integer>() {{
        add(1002);add(1012);
    }};
    public static final ArrayList<Integer> errorStaNos2 = new ArrayList<Integer>() {{
        add(2107);
    }};
    public static final ArrayList<Integer> errorStaNos4 = new ArrayList<Integer>() {{
        add(3007);add(3012);
    }};
    /**
     * 条码数量
     */
@@ -195,6 +207,19 @@
                return writeStaNos5;
            case 6:
                return writeStaNos6;
            default:
                throw new CoolException("获取站点失败!");
        }
    }
    private ArrayList<Integer> getErrorStaNo() {
        switch (slave.getId()) {
            case 1:
                return errorStaNos1;
            case 2:
                return errorStaNos2;
            case 4:
                return errorStaNos4;
            default:
                throw new CoolException("获取站点失败!");
        }
@@ -313,6 +338,32 @@
            }
        }
        Thread.sleep(200);
        OperateResultExOne<byte[]> result3 = null;
        result3 = siemensS7Net.Read("DB101.0", (short) (getErrorStaNo().size() * 8));
        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*8 + 4 ));   // 库位高度
                boolean[] status = siemensS7Net.getByteTransform().TransBool(result3.Content, i*4, 2);
                staProtocol.setF(status[0]);  // 自动
                staProtocol.setLoading(status[1]);  // 有物
                staProtocol.setInEnable(status[2]); // 可入
                staProtocol.setOutEnable(status[3]);// 可出
                staProtocol.setEmptyMk(status[4]);  // 空板信号
                staProtocol.setFullPlt(status[5]);  // 满托盘
                staProtocol.setHigh(status[6]);     // 高库位
                staProtocol.setLow(status[7]);      // 低库位
                staProtocol.setEmptyOutPalletRequire(status[8]);      // 空托盘可出需求信号
                staProtocol.setEmptyInPalletRequire(status[9]);      // 空托盘可入需求信号
                if (!staProtocol.isPakMk() && !staProtocol.isLoading()) {
                    staProtocol.setPakMk(true);
                }
            }
        }
        if (result.IsSuccess && !Cools.isEmpty(result1) && result1.IsSuccess) {
            OutputQueue.DEVP.offer(MessageFormat.format("【{0}】[id:{1}] <<<<< 实时数据更新成功",DateUtils.convert(new Date()), slave.getId()));