2021与蓝度共同重构项目,服务端
chenjiantian
2021-12-17 a0587b1f268b8535ed660fbc521d341d9268340a
ximon-admin/src/main/java/com/sandu/ximon/admin/manager/iot/frame/inner/report/A5LightHeartbeatReportInnerFrame.java
@@ -69,7 +69,7 @@
        private Integer sec;
        //  设备温度 2  1字节整数1字节小数
        private Double deviceTemperature;
        //  亮度百分比 1
        //  灯1亮度百分比 1
        private Integer lightPercent;
        //  电网电压 2 1字节整数1字节小数
        private Double voltage;
@@ -91,6 +91,8 @@
        private Double recentlyUsingPower;
        //  累计用电电量 4
        private Double totalUsingPower;
        //  灯2亮度百分比 1
        private Integer light2Percent;
        //  保留 11
        private String retain;
        //  原帧
@@ -118,13 +120,10 @@
            this.totalLightSec = HexUtil.hexToLong(hex.substring(50, 58));
            this.recentlyUsingPower = NumberUtil.round(HexUtil.hexToInt(hex.substring(58, 66)) * (double) 0.001, 3).doubleValue();
            this.totalUsingPower = NumberUtil.round(HexUtil.hexToInt(hex.substring(66, 74)) * (double) 0.001, 3).doubleValue();
            this.retain = hex.substring(74, 96);
            this.light2Percent = HexUtil.hexToInt(hex.substring(74, 76));
            this.retain = hex.substring(76, 96);
            return this;
        }
    }
    public static void main(String[] args) {
        System.out.println(HexUtil.hexToLong("F64D020F"));
        System.out.println(5 * (float) 0.001);
    }
}