Commit 74ac7502 authored by Don Gagne's avatar Don Gagne

Create meta data from json support

parent ee22373c
This diff is collapsed.
......@@ -17,7 +17,7 @@
#include <QObject>
#include <QString>
#include <QVariant>
#include <QJsonObject>
/// Holds the meta data associated with a Fact.
///
......@@ -46,6 +46,8 @@ public:
FactMetaData(ValueType_t type, QObject* parent = NULL);
FactMetaData(const FactMetaData& other, QObject* parent = NULL);
static QMap<QString, FactMetaData*> createMapFromJsonFile(const QString& jsonFilename, QObject* metaDataParent);
const FactMetaData& operator=(const FactMetaData& other);
/// Converts from meters to the user specified distance unit
......@@ -142,6 +144,7 @@ private:
QVariant _minForType(void) const;
QVariant _maxForType(void) const;
void _setAppSettingsTranslators(void);
static FactMetaData* _createFromJsonObject(const QJsonObject& json, QObject* metaDataParent);
// Built in translators
static QVariant _defaultTranslator(const QVariant& from) { return from; }
......@@ -225,6 +228,16 @@ private:
static const BuiltInTranslation_s _rgBuiltInTranslations[];
static const AppSettingsTranslation_s _rgAppSettingsTranslations[];
static const char* _nameJsonKey;
static const char* _decimalPlacesJsonKey;
static const char* _typeJsonKey;
static const char* _shortDescriptionJsonKey;
static const char* _longDescriptionJsonKey;
static const char* _unitsJsonKey;
static const char* _defaultValueJsonKey;
static const char* _minJsonKey;
static const char* _maxJsonKey;
};
#endif
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