mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 14:03:33 +08:00
protocol.param.GetSet update - min/max only for numeric types, longer string value
This commit is contained in:
@@ -90,11 +90,27 @@ std::string paramValueToString(const uavcan::protocol::param::Value& value)
|
||||
}
|
||||
else if (!value.value_string.empty())
|
||||
{
|
||||
return std::string(value.value_string[0].value.c_str());
|
||||
return std::string(value.value_string[0].value.c_str()) + " ";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "?";
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
std::string paramValueToString(const uavcan::protocol::param::NumericValue& value)
|
||||
{
|
||||
if (!value.value_int.empty())
|
||||
{
|
||||
return std::to_string(value.value_int[0]);
|
||||
}
|
||||
else if (!value.value_float.empty())
|
||||
{
|
||||
return std::to_string(value.value_float[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user