QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
CompInfoParam.h
Go to the documentation of this file.
1#pragma once
2
3#include "CompInfo.h"
4#include "FactMetaData.h"
5
6#include <QtCore/QRegularExpression>
7
9
10class CompInfoParam : public CompInfo
11{
12 Q_OBJECT
13
14public:
15 CompInfoParam(uint8_t compId_, Vehicle *vehicle_, QObject *parent = nullptr);
16
17 FactMetaData *factMetaDataForName(const QString &name, FactMetaData::ValueType_t valueType);
18
19 void setJson(const QString &metadataJsonFileName) override;
20
21private:
22 ParameterMetaData *_getParameterMetaData();
23 FactMetaData *_resolveMetaData(const QString &name, FactMetaData::ValueType_t valueType);
24 FactMetaData *_lookupJsonMetaData(const QString &name);
25
26 struct IndexedParamEntry {
27 QRegularExpression regex;
28 FactMetaData *templateMeta;
29 };
30
31 bool _noJsonMetadata = true;
32 FactMetaData::NameToMetaDataMap_t _nameToMetaDataMap;
33 QList<IndexedParamEntry> _indexedNameMetaDataList;
34 ParameterMetaData *_parameterMetaData = nullptr;
35
36 static constexpr const char *kJsonParametersKey = "parameters";
37 static constexpr const char *kIndexedNameTag = "{n}";
38};
void setJson(const QString &metadataJsonFileName) override
FactMetaData * factMetaDataForName(const QString &name, FactMetaData::ValueType_t valueType)
Base class for all CompInfo types.
Definition CompInfo.h:15
Holds the meta data associated with a Fact.
QHash< QString, FactMetaData * > NameToMetaDataMap_t