| | |
| | | } |
| | | |
| | | Thread.sleep(200); |
| | | OperateResultExOne<byte[]> result1 = siemensS7Net.Read("DB102.2", (short) (staNoSize * 4)); |
| | | OperateResultExOne<byte[]> result1 = siemensS7Net.Read("DB101.0", (short) (staNoSize * 4)); |
| | | if (result1.IsSuccess) { |
| | | for (int i = 0; i < staNoSize; i++) { |
| | | Integer siteId = staNos.get(i); // 站点编号 |
| | |
| | | //条码扫描器 |
| | | Thread.sleep(200); |
| | | OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB101.0",(short)(barcodeSize*8)); |
| | | if (result2.IsSuccess && 1!=1) { |
| | | if (slave.getId()==1){ |
| | | for (int i = 0; i < barcodeSize/3; i++) { |
| | | String barcode = siemensS7Net.getByteTransform().TransString(result2.Content,i*8,8, "UTF-8"); |
| | | BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, i + 1); |
| | | if(!Cools.isEmpty(barcodeThread) && !barcodeThread.getBarcode().equals(barcode)){ |
| | | if (result2.IsSuccess) { |
| | | for (int i = 0; i < barcodeSize; i++) { |
| | | String barcode = siemensS7Net.getByteTransform().TransString(result2.Content,i*8,8, "UTF-8"); |
| | | BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, i + 1); |
| | | if(!Cools.isEmpty(barcodeThread) && !barcodeThread.getBarcode().equals(barcode)){ |
| | | // && !Cools.isEmpty(barcode) && Cools.isEmpty(barcodeThread.getBarcode())) { |
| | | barcodeThread.setBarcode(barcode); |
| | | } |
| | | } |
| | | }else if (slave.getId()==2){ |
| | | for (int i = barcodeSize/3; i < barcodeSize; i++) { |
| | | String barcode = siemensS7Net.getByteTransform().TransString(result2.Content,(i-barcodeSize/3)*8,8, "UTF-8"); |
| | | BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, i + 1); |
| | | if(!Cools.isEmpty(barcodeThread) && !barcodeThread.getBarcode().equals(barcode)){ |
| | | // && !Cools.isEmpty(barcode) && Cools.isEmpty(barcodeThread.getBarcode())) { |
| | | barcodeThread.setBarcode(barcode); |
| | | } |
| | | } |
| | | }else if (slave.getId()==3){ |
| | | for (int i = barcodeSize/3+1; i < barcodeSize; i++) { |
| | | String barcode = siemensS7Net.getByteTransform().TransString(result2.Content,(i-(barcodeSize/3)*2)*8,8, "UTF-8"); |
| | | BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, i + 1); |
| | | if(!Cools.isEmpty(barcodeThread) && !barcodeThread.getBarcode().equals(barcode)){ |
| | | // && !Cools.isEmpty(barcode) && Cools.isEmpty(barcodeThread.getBarcode())) { |
| | | barcodeThread.setBarcode(barcode); |
| | | } |
| | | barcodeThread.setBarcode(barcode); |
| | | } |
| | | } |
| | | } |
| | |
| | | "top": 65, |
| | | "left": 226, |
| | | "width": 6, |
| | | "height": 700 |
| | | "height": 720 |
| | | }, { |
| | | "type": "track", |
| | | "id": "lb_trCart22", |
| | |
| | | "top": 65, |
| | | "left": 270, |
| | | "width": 6, |
| | | "height": 700 |
| | | "height": 720 |
| | | }, { |
| | | "type": "stn", |
| | | "id": "site-1", |
| | |
| | | "height": 19 |
| | | }, { |
| | | "type": "stn", |
| | | "id": "site-3", |
| | | "text": "备用PGV、RGV维修区", |
| | | "top": 620, |
| | | "left": 283, |
| | | "width": 184, |
| | | "height": 19 |
| | | }, { |
| | | "type": "stn", |
| | | "id": "site-110", |
| | | "text": "110", |
| | | "top": 620, |
| | | "top": 641, |
| | | "left": 406, |
| | | "width": 60, |
| | | "height": 19 |
| | |
| | | "type": "stn", |
| | | "id": "site-111", |
| | | "text": "111", |
| | | "top": 620, |
| | | "top": 641, |
| | | "left": 344.5, |
| | | "width": 60, |
| | | "height": 19 |
| | |
| | | "type": "stn", |
| | | "id": "site-112", |
| | | "text": "112", |
| | | "top": 620, |
| | | "top": 641, |
| | | "left": 283, |
| | | "width": 60, |
| | | "height": 19 |
| | |
| | | "type": "stn", |
| | | "id": "site-109", |
| | | "text": "109", |
| | | "top": 641, |
| | | "top": 662, |
| | | "left": 406, |
| | | "width": 60, |
| | | "height": 19 |
| | |
| | | "type": "stn", |
| | | "id": "site-108", |
| | | "text": "108", |
| | | "top": 662, |
| | | "top": 683, |
| | | "left": 406, |
| | | "width": 60, |
| | | "height": 19 |
| | |
| | | "type": "stn", |
| | | "id": "site-107", |
| | | "text": "107", |
| | | "top": 662, |
| | | "top": 683, |
| | | "left": 283, |
| | | "width": 122, |
| | | "height": 19 |
| | |
| | | "type": "stn", |
| | | "id": "site-105", |
| | | "text": "105", |
| | | "top": 684, |
| | | "top": 705, |
| | | "left": 406, |
| | | "width": 60, |
| | | "height": 19 |
| | |
| | | "type": "stn", |
| | | "id": "site-106", |
| | | "text": "106", |
| | | "top": 684, |
| | | "top": 705, |
| | | "left": 283, |
| | | "width": 122, |
| | | "height": 19 |
| | |
| | | "type": "stn", |
| | | "id": "site-104", |
| | | "text": "104", |
| | | "top": 704, |
| | | "top": 705, |
| | | "left": 406, |
| | | "width": 60, |
| | | "height": 19 |
| | |
| | | "type": "stn", |
| | | "id": "site-103", |
| | | "text": "103", |
| | | "top": 724, |
| | | "top": 745, |
| | | "left": 406, |
| | | "width": 60, |
| | | "height": 19 |
| | |
| | | "type": "stn", |
| | | "id": "site-102", |
| | | "text": "102", |
| | | "top": 724, |
| | | "top": 745, |
| | | "left": 344.5, |
| | | "width": 60, |
| | | "height": 19 |
| | |
| | | "type": "stn", |
| | | "id": "site-101", |
| | | "text": "101", |
| | | "top": 724, |
| | | "top": 745, |
| | | "left": 283, |
| | | "width": 60, |
| | | "height": 19 |
| | |
| | | "type": "stn", |
| | | "id": "site-100", |
| | | "text": "100", |
| | | "top": 745, |
| | | "top": 766, |
| | | "left": 283, |
| | | "width": 184, |
| | | "height": 19 |