修改无人机的任务判断
This commit is contained in:
parent
a5e51849d9
commit
81e6199812
|
|
@ -584,12 +584,16 @@ public class TuohengBufferDeviceImpl implements IBufferDeviceService {
|
||||||
boolean isPowerOn = (droneState != null && droneState != DroneState.POWER_OFF && droneState != DroneState.UNKNOWN);
|
boolean isPowerOn = (droneState != null && droneState != DroneState.POWER_OFF && droneState != DroneState.UNKNOWN);
|
||||||
log.info("无人机开关机状态: {}", isPowerOn ? "开机" : "关机");
|
log.info("无人机开关机状态: {}", isPowerOn ? "开机" : "关机");
|
||||||
|
|
||||||
// 判断逻辑:舱门打开就是任务中
|
// 判断逻辑:开仓且开机才是任务中
|
||||||
String aircraftStatus;
|
String aircraftStatus;
|
||||||
if (coverState == CoverState.OPENED) {
|
if (coverState == CoverState.OPENED && isPowerOn) {
|
||||||
// 舱门打开,表示正在执行任务
|
// 舱门打开且开机,表示正在执行任务
|
||||||
aircraftStatus = "IN_MISSION";
|
aircraftStatus = "IN_MISSION";
|
||||||
log.info("舱门打开,设置状态: IN_MISSION");
|
log.info("舱门打开 + 开机 → IN_MISSION");
|
||||||
|
} else if (coverState == CoverState.OPENED && !isPowerOn) {
|
||||||
|
// 舱门打开但关机
|
||||||
|
aircraftStatus = "POWER_OFF_OUT_CABIN";
|
||||||
|
log.info("舱门打开 + 关机 → POWER_OFF_OUT_CABIN");
|
||||||
} else if (coverState == CoverState.CLOSED) {
|
} else if (coverState == CoverState.CLOSED) {
|
||||||
// 舱门关闭(舱内),根据开关机状态判断
|
// 舱门关闭(舱内),根据开关机状态判断
|
||||||
if (isPowerOn) {
|
if (isPowerOn) {
|
||||||
|
|
@ -687,12 +691,16 @@ public class TuohengBufferDeviceImpl implements IBufferDeviceService {
|
||||||
log.warn("机场SN为空,无法从MachineStateManager获取舱门状态");
|
log.warn("机场SN为空,无法从MachineStateManager获取舱门状态");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 判断逻辑:舱门打开就是任务中
|
// 判断逻辑:开仓且开机才是任务中
|
||||||
String aircraftStatus;
|
String aircraftStatus;
|
||||||
if (coverState == CoverState.OPENED) {
|
if (coverState == CoverState.OPENED && isPowerOn) {
|
||||||
// 舱门打开,表示正在执行任务
|
// 舱门打开且开机,表示正在执行任务
|
||||||
aircraftStatus = "IN_MISSION";
|
aircraftStatus = "IN_MISSION";
|
||||||
log.info("舱门打开,设置状态: IN_MISSION");
|
log.info("舱门打开 + 开机 → IN_MISSION");
|
||||||
|
} else if (coverState == CoverState.OPENED && !isPowerOn) {
|
||||||
|
// 舱门打开但关机
|
||||||
|
aircraftStatus = "POWER_OFF_OUT_CABIN";
|
||||||
|
log.info("舱门打开 + 关机 → POWER_OFF_OUT_CABIN");
|
||||||
} else if (coverState == CoverState.CLOSED) {
|
} else if (coverState == CoverState.CLOSED) {
|
||||||
// 舱门关闭(舱内),根据开关机状态判断
|
// 舱门关闭(舱内),根据开关机状态判断
|
||||||
if (isPowerOn) {
|
if (isPowerOn) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue