From d6670d7c2b1c0efcd43cfc1342a3b237ba3b928b Mon Sep 17 00:00:00 2001 From: lsh <lsh@163.com> Date: 星期二, 10 九月 2024 16:47:39 +0800 Subject: [PATCH] #fs --- src/main/java/com/zy/core/thread/SiemensDevpThread.java | 101 -------------------------------------------------- 1 files changed, 0 insertions(+), 101 deletions(-) diff --git a/src/main/java/com/zy/core/thread/SiemensDevpThread.java b/src/main/java/com/zy/core/thread/SiemensDevpThread.java index ebce4ea..23ec040 100644 --- a/src/main/java/com/zy/core/thread/SiemensDevpThread.java +++ b/src/main/java/com/zy/core/thread/SiemensDevpThread.java @@ -302,107 +302,6 @@ } } - if (slave.getId()==2){ - Thread.sleep(200); - int[] staNosRgv = {623,624,625,626}; - for (int i = 0; i < staNosRgv.length; i++) { - OperateResultExOne<byte[]> resultRgv = siemensS7Net.Read("DB100."+(1800+i*6), (short) 5); - OperateResultExOne<byte[]> resultRgv2 = siemensS7Net.Read("DB100."+(1824+i*12), (short) 8); - if (resultRgv.IsSuccess) { - Integer siteId = staNosRgv[i]; // 绔欑偣缂栧彿 - StaProtocol staProtocol = station.get(siteId); - if (null == staProtocol) { - continue; - } - try{ - staProtocol.setEndRow(siemensS7Net.getByteTransform().TransInt16(resultRgv2.Content, 0)); // 灏忚溅鐩爣浣� - - staProtocol.setNowRow(siemensS7Net.getByteTransform().TransInt16(resultRgv.Content, 2)); // 褰撳墠浣嶇疆 -// staProtocol.setNowRow((short)2); // 褰撳墠浣嶇疆 - - boolean[] status = siemensS7Net.getByteTransform().TransBool(resultRgv.Content, 4, 1); - staProtocol.setRGV1(status[0]); // 灏忚溅鏃犺揣绌洪棽 - staProtocol.setRGV2(status[1]); // 灏忚溅杈撻�佺嚎鍙栬揣鍒颁綅 - staProtocol.setRGV3(status[2]); // 灏忚溅杩愯涓� - -// staProtocol.setRGV1(false); // 灏忚溅鏃犺揣绌洪棽 -// staProtocol.setRGV2(true); // 灏忚溅杈撻�佺嚎鍙栬揣鍒颁綅 -// staProtocol.setRGV3(false); // 灏忚溅杩愯涓� - - staProtocol.setRGV44(siemensS7Net.getByteTransform().TransInt16(resultRgv2.Content, 2));//灏忚溅鏀瑰乏渚ц揣鐗╃洰鏍囩珯 - staProtocol.setRGV55(siemensS7Net.getByteTransform().TransInt16(resultRgv2.Content, 4)); //灏忚溅鏀瑰彸渚ц揣鐗╃洰鏍囩珯 - staProtocol.setRGV66(siemensS7Net.getByteTransform().TransInt16(resultRgv2.Content, 6)); // 涓婁綅鏈烘竻闄ゅ钩绉昏溅璧勬枡 -// -// staProtocol.setRGV44((short) 0);//灏忚溅鏀瑰乏渚ц揣鐗╃洰鏍囩珯 -// staProtocol.setRGV55((short) 0); //灏忚溅鏀瑰彸渚ц揣鐗╃洰鏍囩珯 -// staProtocol.setRGV66((short) 0); // 涓婁綅鏈烘竻闄ゅ钩绉昏溅璧勬枡 - - staProtocol.setRGV4(staProtocol.getRGV44() != 0 && staProtocol.getRGV44() != 2);//灏忚溅鏀瑰乏渚ц揣鐗╃洰鏍囩珯 - staProtocol.setRGV5(staProtocol.getRGV55() != 0 && staProtocol.getRGV55() != 2); //灏忚溅鏀瑰彸渚ц揣鐗╃洰鏍囩珯 - staProtocol.setRGV6(staProtocol.getRGV66() != 0 && staProtocol.getRGV66() != 2); // 涓婁綅鏈烘竻闄ゅ钩绉昏溅璧勬枡 - - - }catch (Exception e){ - log.error("璇诲彇RGV淇℃伅澶辫触"+e.getMessage()); - } - } - } - } - - - //鏉$爜鎵弿鍣� - Thread.sleep(200); - OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB101.2440",(short)(barcodeSize*8)); - if (result2.IsSuccess) { - int[] staNosRgv = new int[]{281,292,173,214,120}; - if (slave.getId()==2){ - staNosRgv = new int[]{453,460,508,534,611}; - } - for (int i = 0; i < barcodeSize; i++) { - //1:281 2:292 3:174(173) 4:214 5:120 - //6:453 7:460 8:508 9:534 10:611 - String barcode = siemensS7Net.getByteTransform().TransString(result2.Content,i*8,8, "UTF-8"); - BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, (i + 1+((slave.getId()-1)*5))); - if(!Cools.isEmpty(barcodeThread) && !barcodeThread.getBarcode().equals(barcode)) { - Integer siteId = staNosRgv[i]; // 绔欑偣缂栧彿 - StaProtocol staProtocol = station.get(siteId); - if (null == staProtocol) { - continue; - } - staProtocol.setBarcode(barcode); - barcodeThread.setBarcode(barcode); - } - } - } - - if (slave.getId()==2){ - OperateResultExOne<byte[]> result464 = siemensS7Net.Read("DB101.3720",(short)(8)); - if (result464.IsSuccess) { - String barcode = siemensS7Net.getByteTransform().TransString(result464.Content,0,8, "UTF-8"); - BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, 11); - if(!Cools.isEmpty(barcodeThread) && !barcodeThread.getBarcode().equals(barcode)) { - StaProtocol staProtocol = station.get(464); - if (null != staProtocol) { - staProtocol.setBarcode(barcode); - barcodeThread.setBarcode(barcode); - } - } - } - } - -// //RGV灏忚溅 -// Thread.sleep(200); -// OperateResultExOne<byte[]> result3 = siemensS7Net.Read("DB100.160",(short)2); -// if (result3.IsSuccess) { -// Integer siteId = 2000; -// StaProtocol staProtocol = station.get(siteId); -// if (null == staProtocol) { -// staProtocol = new StaProtocol(); -// staProtocol.setSiteId(siteId); -// station.put(siteId, staProtocol); -// } -// staProtocol.setNearbySta(String.valueOf(siemensS7Net.getByteTransform().TransInt16(result3.Content, 0))); -// } if (result.IsSuccess) { -- Gitblit v1.9.1