| | |
| | | } |
| | | |
| | | // 读取正面条码 |
| | | OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB103.0", (short) (5 * 40)); |
| | | if (result2.IsSuccess) { |
| | | OperateResultExOne<byte[]> result3 = siemensS7Net.Read("DB103.0", (short) (5 * 40)); |
| | | if (result3.IsSuccess) { |
| | | for (int i = 0; i < 5; i++) { |
| | | String barcode = siemensS7Net.getByteTransform().TransString(result2.Content, i * 40, 40, "UTF-8"); |
| | | String barcode = siemensS7Net.getByteTransform().TransString(result3.Content, i * 40, 40, "UTF-8"); |
| | | if(!Cools.isEmpty()){ |
| | | barcode = barcode.trim(); |
| | | } |
| | | List<String> barcodeList = Arrays.stream(barcode.split(",")).collect(Collectors.toList()); |
| | | List<String> barcodeList = Arrays.stream(barcode.split(";")).collect(Collectors.toList()); |
| | | Iterator<String> iterator = barcodeList.iterator(); |
| | | while (iterator.hasNext()){ |
| | | String next = iterator.next(); |
| | |
| | | } |
| | | } |
| | | |
| | | BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, i); |
| | | BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, i+1); |
| | | if (!Cools.isEmpty(barcodeThread) && !barcodeThread.getBarcode().equals(barcode)) { |
| | | barcodeThread.setBarcode(barcode); |
| | | } |