vince
2024-05-20 75bdadc0c4e468217b93142d965cd92ee52838ec
src/main/java/com/fzzy/protocol/youxian0/analysis/AnalysisService.java
@@ -160,7 +160,12 @@
        String tempStr = "";
        for (int j = 0;j<cableY;j++){
            tempStr = strMsg.substring((6+2*cableZ) * j,(6+2*cableZ)  * j + (6+2*cableZ) );
            String index = BytesUtil.intToHexStr1((msgId -1)*cableY + j +1);
            tempStr = strMsg.substring(strMsg.indexOf(index),strMsg.indexOf(index) + (6+2*cableZ) );
            strMsg = strMsg.substring(strMsg.indexOf(index) + (6+2*cableZ));
            //tempStr = strMsg.substring((6+2*cableZ) * j,(6+2*cableZ)  * j + (6+2*cableZ) );
            log.info("----线缆报文----:"+tempStr);
            log.info("----剩余报文----:"+strMsg);
            //密钥和点数 02 A4 BB BA BA B4
            String kyeNumHex = tempStr.substring(2, 4);
            String kyeNumBin = BytesUtil.toBinary8String(BytesUtil.hexToInt(kyeNumHex));
@@ -173,10 +178,11 @@
            //02 A4 BB BA BA B4
            start = 2 * 2;
            String tempHex;
            double point = 0;
            for (int i = 0; i < numValue; i++) {
                start = start + i * 2;
            log.info("----报文----:"+tempStr);
            log.info("----密钥="+keyValue +"----点数="+numValue+"----"+"层数="+cableZ+"----");
            for (int i = 0; i < cableZ; i++) {
                start = start + (i * 2);
                tempHex = tempStr.substring(start, start + 2);
                //实际温度=密钥*密钥*37(溢出为无符号字节)再异或加密后的温度/2。
                point = this.getGrainTemp(keyValue, tempHex);
@@ -295,7 +301,7 @@
        outPut.setTemperature(temperature);
        outPut.setAvgTemperature(NumberUtil.keepPrecision((sumT / sumNum), 1) + "");
        outPut.setMinTemperature(min + "");
        outPut.setMaxTemperature(min + "");
        outPut.setMaxTemperature(max + "");
        List<GrainTH> ths = new ArrayList<>();