| | |
| | | |
| | | String tempStr = ""; |
| | | for (int j = 0;j<cableY;j++){ |
| | | tempStr = strMsg.substring(12 * j,12 * j +12); |
| | | tempStr = strMsg.substring((6+2*cableZ) * j,(6+2*cableZ) * j + (6+2*cableZ) ); |
| | | //密钥和点数 02 A4 BB BA BA B4 |
| | | String kyeNumHex = tempStr.substring(2, 4); |
| | | String kyeNumBin = BytesUtil.toBinary8String(BytesUtil.hexToInt(kyeNumHex)); |
| | |
| | | |
| | | List<Double> points = new ArrayList<>(); |
| | | GrainRoot root; |
| | | List<Double> t = null; |
| | | for (int i = 1; i <= cableX; i++) { |
| | | root = this.getGrainRoot(buildGrainRootKey(reqData.getDevice().getDeviceSn(), i)); |
| | | |
| | | if (null == root || null == root.getPoints()) { |
| | | log.error("-----------解析获取所有粮情检测点失败,取消执行---------{}---{}", reqData.getDevice().getDeviceName(),i); |
| | | return; |
| | | ; |
| | | t = new ArrayList<>(); |
| | | for (int x = 0;x<cableY*cableZ;x++ |
| | | ) { |
| | | t.add(-100.00); |
| | | } |
| | | //return; |
| | | points.addAll(t); |
| | | }else{ |
| | | points.addAll(root.getPoints()); |
| | | } |
| | | |
| | | } |
| | | |
| | | //执行封装解析 |
| | |
| | | reportService.reportGrainData(reqData); |
| | | } |
| | | |
| | | private void add2GrainMap(GrainRoot grainRoot) { |
| | | private synchronized void add2GrainMap(GrainRoot grainRoot) { |
| | | contextGrainRoot.put(grainRoot.getKey(), grainRoot); |
| | | } |
| | | |
| | |
| | | |
| | | int num1 = BytesUtil.hexToInt(valueHex); |
| | | int num2 = BytesUtil.hexToInt(tempHex); |
| | | |
| | | if((num1 ^ num2) / 2.0 > 35){ |
| | | return -100.00; |
| | | }else { |
| | | return (num1 ^ num2) / 2.0; |
| | | } |
| | | |
| | | } |
| | | |
| | | private void add2ThMap(String depotIdSys, THDto th) { |
| | | String key = "TH_" + depotIdSys; |
| | | contextMapTH.put(key, th); |