Commit 8a6fe130 authored by Don Gagne's avatar Don Gagne

PX4 Fact enum meta data support

parent 34ee1349
......@@ -320,6 +320,24 @@ void PX4ParameterMetaData::_loadParameterFactMetaData(void)
metaData->setRebootRequired(true);
}
} else if (elementName == "values") {
// doing nothing individual value will follow anyway. May be used for sanity checking.
} else if (elementName == "value") {
QString enumValueStr = xml.attributes().value("code").toString();
QString enumString = xml.readElementText();
qCDebug(PX4ParameterMetaDataLog) << "parameter value:"
<< "value desc:" << enumString << "code:" << enumValueStr;
QVariant enumValue;
QString errorString;
if (metaData->convertAndValidateRaw(enumValueStr, false /* validate */, enumValue, errorString)) {
metaData->addEnumInfo(enumString, enumValue);
} else {
qCDebug(PX4ParameterMetaDataLog) << "Invalid enum value, name:" << metaData->name()
<< " type:" << metaData->type() << " value:" << enumValueStr
<< " error:" << errorString;
}
} else {
qDebug() << "Unknown element in XML: " << elementName;
}
......
......@@ -507,7 +507,7 @@
1 50 SENS_FLOW_ROT 0 6
1 50 SYS_AUTOCONFIG 0 6
1 50 SYS_AUTOSTART 10016 6
1 50 SYS_COMPANION 0 6
1 50 SYS_COMPANION 157600 6
1 50 SYS_RESTART_TYPE 0 6
1 50 SYS_USE_IO 1 6
1 50 TEST_D 0.01 9
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment