|
|
@ -15,6 +15,7 @@ import com.iflytop.sgs.common.enums.ContainerType; |
|
|
|
import com.iflytop.sgs.common.enums.HeatModuleCode; |
|
|
|
import com.iflytop.sgs.common.enums.cmd.CmdColor; |
|
|
|
import com.iflytop.sgs.common.service.CanBusService; |
|
|
|
import com.iflytop.sgs.hardware.exception.HardwareException; |
|
|
|
import jakarta.annotation.PostConstruct; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
@ -34,6 +35,7 @@ public class DeviceInitService { |
|
|
|
private final DeviceParamConfigService deviceParamConfigService; |
|
|
|
private final CanBusService canBusService; |
|
|
|
private final DeviceCommandService deviceCommandService; |
|
|
|
private final DeviceSensorService deviceSensorService; |
|
|
|
|
|
|
|
@PostConstruct |
|
|
|
public void init() { |
|
|
@ -48,13 +50,16 @@ public class DeviceInitService { |
|
|
|
initDeviceSetData(); |
|
|
|
canBusService.initOvertime(); |
|
|
|
initEnable(); |
|
|
|
initSensorState(); |
|
|
|
deviceStateService.getDeviceState().setInitComplete(true); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("设备初始化失败", e); |
|
|
|
} |
|
|
|
}).start(); |
|
|
|
} |
|
|
|
|
|
|
|
public void initSensorState() throws Exception { |
|
|
|
deviceSensorService.deviceSensorSchedule(); |
|
|
|
} |
|
|
|
|
|
|
|
public void initDeviceSetData() throws Exception { |
|
|
|
if (deviceStateService.getDeviceState().isVirtual() || deviceStateService.getDeviceState().isInitComplete()) { |
|
|
|