修改枚举
This commit is contained in:
parent
b134358cdc
commit
b78437444b
|
|
@ -23,6 +23,34 @@ public class DeviceTelemetry {
|
|||
* 无人机独状态
|
||||
*/
|
||||
|
||||
//wind_speed{"unit_name":"米每秒 / m/s"} float
|
||||
|
||||
public static final TelemetryKey<Double> Wind_Speed = TelemetryKey.of(
|
||||
"wind_speed",
|
||||
Double.class,
|
||||
value -> {
|
||||
if (value == null) return null;
|
||||
if (value instanceof Number) {
|
||||
return ((Number) value).doubleValue();
|
||||
}
|
||||
return Double.parseDouble(value.toString());
|
||||
}
|
||||
);
|
||||
|
||||
//rainfall {"0":"无雨","1":"小雨","2":"中雨","3":"大雨"} enum_int
|
||||
|
||||
public static final TelemetryKey<Integer> Rainfall = TelemetryKey.of(
|
||||
"rainfall",
|
||||
Integer.class,
|
||||
value -> {
|
||||
if (value == null) return null;
|
||||
if (value instanceof Number) {
|
||||
return ((Number) value).intValue();
|
||||
}
|
||||
return Integer.parseInt(value.toString());
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* 网络类型 {"1":"4G","2":"以太网"}
|
||||
*/
|
||||
|
|
@ -266,7 +294,9 @@ public class DeviceTelemetry {
|
|||
Drone_Charge_State_State,
|
||||
Drone_In_Dock,
|
||||
Acc_Time,
|
||||
Network_State_Type
|
||||
Network_State_Type,
|
||||
Wind_Speed,
|
||||
Rainfall
|
||||
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue