#
TQS
2024-08-13 876db5fee890311a1d7eaea983af20826b817e01
src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -56,7 +56,7 @@
        add(112);add(113);add(114);
    }};
    public static final ArrayList<Integer> staNos3 = new ArrayList<Integer>() {{
        add(212);add(213);add(214);
        add(212);add(214);add(213);
    }};
    public boolean charge0;
@@ -154,9 +154,9 @@
        // 更新入出库模式
        updateIoMode();
        ArrayList<Integer> staNos = getStaNo();
        OperateResultExOne<byte[]> result = siemensS7Net.Read("DB100.0", (short) 50);
        OperateResultExOne<byte[]> result = siemensS7Net.Read("DB100.0", (short) (staNos.size()*2));
        if (result.IsSuccess) {
            for (int i = 0; i < 25; i++) {
            for (int i = 0; i < staNos.size(); i++) {
                Integer siteId = staNos.get(i); // 站点编号
                StaProtocol staProtocol = station.get(siteId);
                if (null == staProtocol) {
@@ -168,9 +168,9 @@
            }
        }
        Thread.sleep(200);
        OperateResultExOne<byte[]> result0 = siemensS7Net.Read("DB101.0", (short) 50);
        OperateResultExOne<byte[]> result0 = siemensS7Net.Read("DB101.0", (short) (staNos.size()*2));
        if (result0.IsSuccess) {
            for (int i = 0; i < 25; i++) {
            for (int i = 0; i < staNos.size(); i++) {
                Integer siteId = staNos.get(i); // 站点编号
                StaProtocol staProtocol = station.get(siteId);
                if (null == staProtocol) {
@@ -182,11 +182,11 @@
            }
        }
        Thread.sleep(200);
        OperateResultExOne<byte[]> result1 = siemensS7Net.Read("DB102.0", (short) 50);
        OperateResultExOne<byte[]> result1 = siemensS7Net.Read("DB102.0", (short) (staNos.size()*2));
        if (result1.IsSuccess) {
            for (int i = 0; i < 25; i++) {
            for (int i = 0; i < staNos.size(); i++) {
                Integer siteId = staNos.get(i); // 站点编号
                boolean[] status = siemensS7Net.getByteTransform().TransBool(result1.Content, i*2, 1);
                boolean[] status = siemensS7Net.getByteTransform().TransBool(result1.Content, i * 2, 1);
                StaProtocol staProtocol = station.get(siteId);
                staProtocol.setAutoing(status[0]);  // 自动
                staProtocol.setLoading(status[1]);  // 有物
@@ -199,10 +199,10 @@
                if (!staProtocol.isPakMk() && !staProtocol.isLoading()) {
                    staProtocol.setPakMk(true);
                }else if (staProtocol.getSiteId().equals(300)){
                } else if (staProtocol.getSiteId().equals(300)) {
                    BasDevpMapper basDevpMapper = SpringUtils.getBean(BasDevpMapper.class);
                    BasDevp basDevp = basDevpMapper.selectByDevNo(300);
                    if (!basDevp.getWrkNo().equals(basDevp.getWrkNo1())){
                    if (!basDevp.getWrkNo().equals(basDevp.getWrkNo1())) {
                        staProtocol.setPakMk(true);
                    }
                }