fix: 👍 纠正RP2040显示错误

This commit is contained in:
niushuai233 2025-01-15 14:51:02 +08:00
parent 72077dc797
commit 958fa76146
2 changed files with 4 additions and 4 deletions

View File

@ -109,7 +109,7 @@ public class ChartController {
ChartResp co2 = new ChartResp("CO2浓度"); ChartResp co2 = new ChartResp("CO2浓度");
ChartResp ch4 = new ChartResp("CH4浓度"); ChartResp ch4 = new ChartResp("CH4浓度");
ChartResp temperature = new ChartResp("环境温度"); ChartResp temperature = new ChartResp("环境温度");
ChartResp rp2024_temperature = new ChartResp("rp2024温度"); ChartResp RP2040_temperature = new ChartResp("RP2040温度");
for (Gas gas : allList) { for (Gas gas : allList) {
@ -120,14 +120,14 @@ public class ChartController {
co2.getData().add(new ChartResp.Data(dateTime, gas.getCo2())); co2.getData().add(new ChartResp.Data(dateTime, gas.getCo2()));
ch4.getData().add(new ChartResp.Data(dateTime, gas.getCh4())); ch4.getData().add(new ChartResp.Data(dateTime, gas.getCh4()));
temperature.getData().add(new ChartResp.Data(dateTime, gas.getTemperature())); temperature.getData().add(new ChartResp.Data(dateTime, gas.getTemperature()));
rp2024_temperature.getData().add(new ChartResp.Data(dateTime, gas.getRp2040Temperature())); RP2040_temperature.getData().add(new ChartResp.Data(dateTime, gas.getRp2040Temperature()));
} }
map.put("co", co); map.put("co", co);
map.put("co2", co2); map.put("co2", co2);
map.put("ch4", ch4); map.put("ch4", ch4);
map.put("temperature", temperature); map.put("temperature", temperature);
map.put("rp2024_temperature", rp2024_temperature); map.put("RP2040_temperature", RP2040_temperature);
} }
} catch (Exception e) { } catch (Exception e) {
log.error("fetch gas failed", e); log.error("fetch gas failed", e);

View File

@ -126,7 +126,7 @@
rebuildChart(co2Chart, data.co2, 'ppm'); rebuildChart(co2Chart, data.co2, 'ppm');
rebuildChart(ch4Chart, data.ch4, 'ppm'); rebuildChart(ch4Chart, data.ch4, 'ppm');
rebuildChart(tempChart, data.temperature, '°C'); rebuildChart(tempChart, data.temperature, '°C');
rebuildChart(rp2040_tempChart, data.rp2024_temperature, '°C'); rebuildChart(rp2040_tempChart, data.RP2040_temperature, '°C');
rebuildChart(ch2oChart, data.ch2o, 'ppb'); rebuildChart(ch2oChart, data.ch2o, 'ppb');
} }
}); });