Browse Source

传感器采集温度04*4

master
王梦远 2 months ago
parent
commit
fc89324ba6
  1. 22
      src/main/java/com/iflytop/sgs/app/service/scheduled/FetchTemperatureScheduledTask.java

22
src/main/java/com/iflytop/sgs/app/service/scheduled/FetchTemperatureScheduledTask.java

@ -29,23 +29,23 @@ public class FetchTemperatureScheduledTask {
deviceStateService.getDeviceState().getHeatModuleByCode(HeatModuleCode.heat_module_03).setTemperature(heatModule03Temperature); deviceStateService.getDeviceState().getHeatModuleByCode(HeatModuleCode.heat_module_03).setTemperature(heatModule03Temperature);
Double heatModule04Temperature = gdDeviceStatusService.getHeaterRodTemperature("HEATER_ROD4_ID"); Double heatModule04Temperature = gdDeviceStatusService.getHeaterRodTemperature("HEATER_ROD4_ID");
deviceStateService.getDeviceState().getHeatModuleByCode(HeatModuleCode.heat_module_04).setTemperature(heatModule04Temperature);
}else{
Double temperature01 = deviceStateService.getDeviceState().getHeatModuleByCode(HeatModuleCode.heat_module_01).getTemperature();
Double temperature02 = deviceStateService.getDeviceState().getHeatModuleByCode(HeatModuleCode.heat_module_02).getTemperature();
Double temperature03 = deviceStateService.getDeviceState().getHeatModuleByCode(HeatModuleCode.heat_module_03).getTemperature();
Double temperature04 = deviceStateService.getDeviceState().getHeatModuleByCode(HeatModuleCode.heat_module_04).getTemperature();
if(temperature01 == null){
//todo
deviceStateService.getDeviceState().getHeatModuleByCode(HeatModuleCode.heat_module_04).setTemperature(heatModule04Temperature * 4);
} else {
Double temperature01 = deviceStateService.getDeviceState().getHeatModuleByCode(HeatModuleCode.heat_module_01).getTemperature();
Double temperature02 = deviceStateService.getDeviceState().getHeatModuleByCode(HeatModuleCode.heat_module_02).getTemperature();
Double temperature03 = deviceStateService.getDeviceState().getHeatModuleByCode(HeatModuleCode.heat_module_03).getTemperature();
Double temperature04 = deviceStateService.getDeviceState().getHeatModuleByCode(HeatModuleCode.heat_module_04).getTemperature();
if (temperature01 == null) {
deviceStateService.getDeviceState().getHeatModuleByCode(HeatModuleCode.heat_module_01).setTemperature(26.0); deviceStateService.getDeviceState().getHeatModuleByCode(HeatModuleCode.heat_module_01).setTemperature(26.0);
} }
if(temperature02 == null){
if (temperature02 == null) {
deviceStateService.getDeviceState().getHeatModuleByCode(HeatModuleCode.heat_module_02).setTemperature(26.0); deviceStateService.getDeviceState().getHeatModuleByCode(HeatModuleCode.heat_module_02).setTemperature(26.0);
} }
if(temperature03 == null){
if (temperature03 == null) {
deviceStateService.getDeviceState().getHeatModuleByCode(HeatModuleCode.heat_module_03).setTemperature(26.0); deviceStateService.getDeviceState().getHeatModuleByCode(HeatModuleCode.heat_module_03).setTemperature(26.0);
} }
if(temperature04 == null){
if (temperature04 == null) {
deviceStateService.getDeviceState().getHeatModuleByCode(HeatModuleCode.heat_module_04).setTemperature(26.0); deviceStateService.getDeviceState().getHeatModuleByCode(HeatModuleCode.heat_module_04).setTemperature(26.0);
} }
} }

Loading…
Cancel
Save