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 "MAVLinkLib.h"
5#include "FactMetaData.h"
6
7#include <QtCore/QLoggingCategory>
8#include <QtCore/QObject>
9
10class Vehicle;
11class FirmwarePlugin;
12
13Q_DECLARE_LOGGING_CATEGORY(CompInfoParamLog)
14
15class CompInfoParam : public CompInfo
16{
17 Q_OBJECT
18
19public:
20 CompInfoParam(uint8_t compId_, Vehicle* vehicle_, QObject* parent = nullptr);
21
22 FactMetaData* factMetaDataForName(const QString& name, FactMetaData::ValueType_t valueType);
23
24 // Overrides from CompInfo
25 void setJson(const QString& metadataJsonFileName) override;
26
27 static void _cachePX4MetaDataFile(const QString& metaDataFile);
28
29private:
30 QObject* _getOpaqueParameterMetaData(void);
31
32 static FirmwarePlugin* _anyVehicleTypeFirmwarePlugin (MAV_AUTOPILOT firmwareType);
33 static QString _parameterMetaDataFile (Vehicle* vehicle, MAV_AUTOPILOT firmwareType, int& majorVersion, int& minorVersion);
34
35 typedef QPair<QString /* indexed name */, FactMetaData*> RegexFactMetaDataPair_t;
36
37 bool _noJsonMetadata = true;
38 FactMetaData::NameToMetaDataMap_t _nameToMetaDataMap;
39 QList<RegexFactMetaDataPair_t> _indexedNameMetaDataList;
40 QObject* _opaqueParameterMetaData = nullptr;
41
42 static constexpr const char* _jsonParametersKey = "parameters";
43 static constexpr const char* _cachedMetaDataFilePrefix = "ParameterFactMetaData";
44 static constexpr const char* _indexedNameTag = "{n}";
45};
Q_DECLARE_LOGGING_CATEGORY(AndroidSerialLog)
Base class for all CompInfo types.
Definition CompInfo.h:14
QMap< QString, FactMetaData * > NameToMetaDataMap_t