Browse Source

FactMetadata: add 'rebootRequired' to json parsing

This is set from PX4.
QGC4.4
Beat Küng 3 years ago
parent
commit
003f55f55a
  1. 8
      src/FactSystem/FactMetaData.cc
  2. 1
      src/FactSystem/FactMetaData.h

8
src/FactSystem/FactMetaData.cc

@ -141,6 +141,7 @@ const char* FactMetaData::_maxJsonKey = "max"; @@ -141,6 +141,7 @@ const char* FactMetaData::_maxJsonKey = "max";
const char* FactMetaData::_incrementJsonKey = "increment";
const char* FactMetaData::_hasControlJsonKey = "control";
const char* FactMetaData::_qgcRebootRequiredJsonKey = "qgcRebootRequired";
const char* FactMetaData::_rebootRequiredJsonKey = "rebootRequired";
const char* FactMetaData::_categoryJsonKey = "category";
const char* FactMetaData::_groupJsonKey = "group";
const char* FactMetaData::_volatileJsonKey = "volatile";
@ -1269,6 +1270,7 @@ FactMetaData* FactMetaData::createFromJsonObject(const QJsonObject& json, QMap<Q @@ -1269,6 +1270,7 @@ FactMetaData* FactMetaData::createFromJsonObject(const QJsonObject& json, QMap<Q
{ _maxJsonKey, QJsonValue::Double, false },
{ _hasControlJsonKey, QJsonValue::Bool, false },
{ _qgcRebootRequiredJsonKey, QJsonValue::Bool, false },
{ _rebootRequiredJsonKey, QJsonValue::Bool, false },
{ _categoryJsonKey, QJsonValue::String, false },
{ _groupJsonKey, QJsonValue::String, false },
{ _volatileJsonKey, QJsonValue::Bool, false },
@ -1424,6 +1426,12 @@ FactMetaData* FactMetaData::createFromJsonObject(const QJsonObject& json, QMap<Q @@ -1424,6 +1426,12 @@ FactMetaData* FactMetaData::createFromJsonObject(const QJsonObject& json, QMap<Q
}
metaData->setQGCRebootRequired(qgcRebootRequired);
bool rebootRequired = false;
if (json.contains(_rebootRequiredJsonKey)) {
rebootRequired = json[_rebootRequiredJsonKey].toBool();
}
metaData->setVehicleRebootRequired(rebootRequired);
bool volatileValue = false;
if (json.contains(_volatileJsonKey)) {
volatileValue = json[_volatileJsonKey].toBool();

1
src/FactSystem/FactMetaData.h

@ -371,6 +371,7 @@ private: @@ -371,6 +371,7 @@ private:
static const char* _incrementJsonKey;
static const char* _hasControlJsonKey;
static const char* _qgcRebootRequiredJsonKey;
static const char* _rebootRequiredJsonKey;
static const char* _categoryJsonKey;
static const char* _groupJsonKey;
static const char* _volatileJsonKey;

Loading…
Cancel
Save