This commit is contained in:
parent
87cdb465d9
commit
b9e9b99b3f
|
|
@ -288,7 +288,7 @@ public class TuohengService {
|
||||||
if (powerOn == 1) {
|
if (powerOn == 1) {
|
||||||
// 开机时,只有在特定状态下才更新为 ONLINE
|
// 开机时,只有在特定状态下才更新为 ONLINE
|
||||||
// 只有从 POWER_OFF、UNKNOWN、ARRIVED、RETURNING 这些状态才能转为 ONLINE
|
// 只有从 POWER_OFF、UNKNOWN、ARRIVED、RETURNING 这些状态才能转为 ONLINE
|
||||||
MachineStates currentStates = stateManager.getMachineStates(deviceSn);
|
MachineStates currentStates = stateManager.getStates(deviceSn);
|
||||||
if (currentStates != null && currentStates.getDroneState() != null) {
|
if (currentStates != null && currentStates.getDroneState() != null) {
|
||||||
DroneState currentState = currentStates.getDroneState();
|
DroneState currentState = currentStates.getDroneState();
|
||||||
if (currentState == DroneState.POWER_OFF ||
|
if (currentState == DroneState.POWER_OFF ||
|
||||||
|
|
@ -304,7 +304,7 @@ public class TuohengService {
|
||||||
} else {
|
} else {
|
||||||
// 如果没有当前状态,直接设置为 ONLINE
|
// 如果没有当前状态,直接设置为 ONLINE
|
||||||
stateManager.setDroneState(deviceSn, DroneState.ONLINE);
|
stateManager.setDroneState(deviceSn, DroneState.ONLINE);
|
||||||
log.debug("同步无人机开机状态: sn={}, powerOn=, 初始化为 ONLINE", deviceSn, powerOn);
|
log.debug("同步无人机开机状态: sn={}, powerOn={}, 初始化为 ONLINE", deviceSn, powerOn);
|
||||||
}
|
}
|
||||||
} else if (powerOn == 2) {
|
} else if (powerOn == 2) {
|
||||||
stateManager.setDroneState(deviceSn, DroneState.POWER_OFF);
|
stateManager.setDroneState(deviceSn, DroneState.POWER_OFF);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue