修改枚举

This commit is contained in:
孙小云 2026-01-19 17:03:57 +08:00
parent b78437444b
commit e79d8e15fb
1 changed files with 15 additions and 4 deletions

View File

@ -20,11 +20,22 @@ public class DeviceTelemetry {
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
/** /**
* 无人机独状态 * 无人机 position_state.rtk_number RTK 搜星数量
*/ */
//wind_speed{"unit_name":"米每秒 / m/s"} float public static final TelemetryKey<Integer> Position_State_Rtk_Number = TelemetryKey.of(
"position_state.rtk_number",
Integer.class,
value -> {
if (value == null) return null;
if (value instanceof Number) {
return ((Number) value).intValue();
}
return Integer.parseInt(value.toString());
}
);
//wind_speed{"unit_name":"米每秒 / m/s"} float
public static final TelemetryKey<Double> Wind_Speed = TelemetryKey.of( public static final TelemetryKey<Double> Wind_Speed = TelemetryKey.of(
"wind_speed", "wind_speed",
Double.class, Double.class,
@ -38,7 +49,6 @@ public class DeviceTelemetry {
); );
//rainfall {"0":"无雨","1":"小雨","2":"中雨","3":"大雨"} enum_int //rainfall {"0":"无雨","1":"小雨","2":"中雨","3":"大雨"} enum_int
public static final TelemetryKey<Integer> Rainfall = TelemetryKey.of( public static final TelemetryKey<Integer> Rainfall = TelemetryKey.of(
"rainfall", "rainfall",
Integer.class, Integer.class,
@ -296,7 +306,8 @@ public class DeviceTelemetry {
Acc_Time, Acc_Time,
Network_State_Type, Network_State_Type,
Wind_Speed, Wind_Speed,
Rainfall Rainfall,
Position_State_Rtk_Number
); );
} }