#
zzgtfwq
12 小时以前 de480b42a379d1cf23e1703977c0169e837fa786
src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -47,13 +47,20 @@
    public static final ArrayList<Integer> staNos1 = new ArrayList<Integer>() {{
        add(101);add(102);add(103);add(104);add(105);add(106);add(107);add(108);add(109);add(110);
        add(111);add(112);add(113);add(114);add(115);add(116);add(117);add(118);add(119);add(120);
        add(121);add(122);add(124);add(125);
        add(121);add(122);add(123);add(124);add(125);
    }};
    public static final ArrayList<Integer> staNos2 = new ArrayList<Integer>() {{
        add(201);add(202);add(203);add(204);add(205);add(206);add(207);add(208);add(209);add(210);
        add(211);add(212);add(213);add(214);add(215);add(216);add(217);add(218);add(219);add(220);
        add(221);add(222);add(224);add(225);
        add(221);add(222);add(223);add(224);add(225);
    }};
    public static final ArrayList<Integer> staNos1W = new ArrayList<Integer>() {{
        add(118);add(121);add(124);
    }};
    public static final ArrayList<Integer> staNos2W = new ArrayList<Integer>() {{
        add(218);add(221);add(224);
    }};
    private boolean connectDev = false;
    public Long currentTimeMilliConnectDev= 0L;
@@ -80,6 +87,16 @@
                return staNos1;
            case 2:
                return staNos2;
            default:
                throw new CoolException("服务器异常");
        }
    }
    private ArrayList<Integer> getStaNoW() {
        switch (slave.getId()) {
            case 1:
                return staNos1W;
            case 2:
                return staNos2W;
            default:
                throw new CoolException("服务器异常");
        }
@@ -320,24 +337,24 @@
                }
            }
        }
        int[] staW = new int[]{1004,1014,1020};
        ArrayList<Integer> staW = getStaNoW();
        //条码
//        Thread.sleep(50);
        OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB400.100.0",(short) (barcodeSize*8));
        OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB101.212",(short) (barcodeSize*8));
        if (result2.IsSuccess) {
            for (int i = 0; i < barcodeSize; i++) {
                Integer siteId = staW[i]; // 站点编号
                Integer siteId = staW.get(i); // 站点编号
                StaProtocol staProtocol = station.get(siteId);
                if (null == staProtocol) {
                    staProtocol = new StaProtocol();
                    station.put(siteId, staProtocol);
                }
                String barcode = siemensS7Net.getByteTransform().TransString(result2.Content,i*8,6, "UTF-8");
                BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, i + 1);
                String barcode = siemensS7Net.getByteTransform().TransString(result2.Content,i*8,8, "UTF-8");
                BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, i + 1+3*(slave.getId()-1));
                if(!Cools.isEmpty(barcodeThread) && !barcodeThread.getBarcode().equals(barcode)) {
                    barcodeThread.setBarcode(barcode);
                    if (!Cools.isEmpty(barcode) && !barcode.equals("000000")){
                    if (!Cools.isEmpty(barcode) && !barcode.equals("00000000")){
                        staProtocol.setBarcodeNow(barcode);
                    } else if (Cools.isEmpty(barcode)){
                        staProtocol.setBarcodeNow("-");
@@ -350,10 +367,10 @@
        //条码
//        Thread.sleep(50);
        OperateResultExOne<byte[]> result3 = siemensS7Net.Read("DB400.148.0",(short) (staW.length*4));
        OperateResultExOne<byte[]> result3 = siemensS7Net.Read("DB101.200",(short) (staW.size()*4));
        if (result3.IsSuccess) {
            for (int i = 0; i < staW.length; i++) {
                Integer siteId = staW[i]; // 站点编号
            for (int i = 0; i < staW.size(); i++) {
                Integer siteId = staW.get(i); // 站点编号
                StaProtocol staProtocol = station.get(siteId);
                if (null == staProtocol) {
                    staProtocol = new StaProtocol();