Compare commits
2 Commits
dfc5033eab
...
8a418c063d
| Author | SHA1 | Date |
|---|---|---|
|
|
8a418c063d | |
|
|
a636c9a858 |
|
|
@ -240,6 +240,20 @@ public class DeviceTelemetry {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电量百分比
|
||||||
|
*/
|
||||||
|
public static final TelemetryKey<Integer> Drone_Charge_State_Capacity_Percent = TelemetryKey.of(
|
||||||
|
"drone_charge_state.capacity_percent",
|
||||||
|
Integer.class,
|
||||||
|
value -> {
|
||||||
|
if (value == null) return null;
|
||||||
|
if (value instanceof Number) {
|
||||||
|
return ((Number) value).intValue();
|
||||||
|
}
|
||||||
|
return Integer.parseInt(value.toString());
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -273,6 +287,22 @@ public class DeviceTelemetry {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 无人机 position_state.gps_number GPS 搜星数量
|
||||||
|
*/
|
||||||
|
|
||||||
|
public static final TelemetryKey<Integer> Position_State_GPS_Number = TelemetryKey.of(
|
||||||
|
"position_state.gps_number",
|
||||||
|
Integer.class,
|
||||||
|
value -> {
|
||||||
|
if (value == null) return null;
|
||||||
|
if (value instanceof Number) {
|
||||||
|
return ((Number) value).intValue();
|
||||||
|
}
|
||||||
|
return Integer.parseInt(value.toString());
|
||||||
|
}
|
||||||
|
);
|
||||||
/**
|
/**
|
||||||
* 风速
|
* 风速
|
||||||
*/
|
*/
|
||||||
|
|
@ -499,7 +529,9 @@ public class DeviceTelemetry {
|
||||||
Alternate_land_point_Longitude,
|
Alternate_land_point_Longitude,
|
||||||
Environment_Temperature,
|
Environment_Temperature,
|
||||||
Network_State_Rate,
|
Network_State_Rate,
|
||||||
Cover_State
|
Cover_State,
|
||||||
|
Drone_Charge_State_Capacity_Percent,
|
||||||
|
Position_State_GPS_Number
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,9 @@ public class AircraftDetailDTO implements Serializable
|
||||||
/** RTK信号 */
|
/** RTK信号 */
|
||||||
private Integer rtkSignal;
|
private Integer rtkSignal;
|
||||||
|
|
||||||
|
/** GPS信号 */
|
||||||
|
private Integer gpsSignal;
|
||||||
|
|
||||||
/** 限高 */
|
/** 限高 */
|
||||||
private Integer maxAltitude;
|
private Integer maxAltitude;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -125,6 +125,11 @@ public class DockDetailDTO implements Serializable
|
||||||
/** 充放电状态 */
|
/** 充放电状态 */
|
||||||
private String chargingStatus;
|
private String chargingStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电量百分比
|
||||||
|
*/
|
||||||
|
private Integer capacity_percent;
|
||||||
|
|
||||||
/** 舱内温度 */
|
/** 舱内温度 */
|
||||||
private Double cabinTemperature;
|
private Double cabinTemperature;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -340,6 +340,23 @@ public class BufferDeviceImpl implements IBufferDeviceService
|
||||||
() -> log.warn("未获取到经度数据,dockerDeviceIotId: {}", dockerDeviceIotId)
|
() -> log.warn("未获取到经度数据,dockerDeviceIotId: {}", dockerDeviceIotId)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// 无人机充电状态(枚举值:0-空闲,1-充电中)
|
||||||
|
telemetryMap.get(DeviceTelemetry.Drone_Charge_State_State)
|
||||||
|
.ifPresent(telemetryValue -> {
|
||||||
|
Integer chargeState = telemetryValue.getValue();
|
||||||
|
if (chargeState != null) {
|
||||||
|
String chargingStatus = mapChargeStateToStatus(chargeState);
|
||||||
|
dto.setChargingStatus(chargingStatus);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 电量百分比
|
||||||
|
telemetryMap.get(DeviceTelemetry.Drone_Charge_State_Capacity_Percent)
|
||||||
|
.ifPresent(telemetryValue -> {
|
||||||
|
Integer capacityPercent = telemetryValue.getValue();
|
||||||
|
dto.setCapacity_percent(capacityPercent);
|
||||||
|
});
|
||||||
|
|
||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -385,6 +402,26 @@ public class BufferDeviceImpl implements IBufferDeviceService
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将充电状态代码映射到充电状态字符串
|
||||||
|
* @param chargeState 充电状态代码(0-空闲,1-充电中)
|
||||||
|
* @return 充电状态字符串
|
||||||
|
*/
|
||||||
|
private String mapChargeStateToStatus(Integer chargeState) {
|
||||||
|
if (chargeState == null) {
|
||||||
|
return "未知";
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (chargeState) {
|
||||||
|
case 0:
|
||||||
|
return "FREE";
|
||||||
|
case 1:
|
||||||
|
return "CHARGING";
|
||||||
|
default:
|
||||||
|
return "UNKNOWN";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 将空调状态代码映射到 AirConditionerStatusEnum
|
* 将空调状态代码映射到 AirConditionerStatusEnum
|
||||||
* @param stateCode 空调状态代码
|
* @param stateCode 空调状态代码
|
||||||
|
|
@ -465,6 +502,14 @@ public class BufferDeviceImpl implements IBufferDeviceService
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
telemetryMap.get(DeviceTelemetry.Position_State_GPS_Number)
|
||||||
|
.ifPresent(telemetryValue -> {
|
||||||
|
Integer gpsNumber = telemetryValue.getValue();
|
||||||
|
if (gpsNumber != null) {
|
||||||
|
dto.setGpsSignal(gpsNumber);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// 限高
|
// 限高
|
||||||
telemetryMap.get(DeviceTelemetry.Height_Limit)
|
telemetryMap.get(DeviceTelemetry.Height_Limit)
|
||||||
.ifPresent(telemetryValue -> dto.setMaxAltitude(telemetryValue.getValue()));
|
.ifPresent(telemetryValue -> dto.setMaxAltitude(telemetryValue.getValue()));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue