-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathFact.h
More file actions
55 lines (41 loc) · 1.5 KB
/
Copy pathFact.h
File metadata and controls
55 lines (41 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef FACT_H
#define FACT_H
#include <QObject>
#include <QVariant>
#include "FactMetaData.h"
/// @brief A Fact is used to hold a single param value within the system.
class Fact : public QObject
{
Q_OBJECT
public:
explicit Fact(QObject *parent = 0);
Fact(int componentId,QString name, FactMetaData::ValueType_t type,QObject *parent);
~Fact();
int compId() {return _compId;}
/// Sets the meta data associated with the Fact.
void setMetaData(FactMetaData* metadata);
QVariant rawValue() const {return _rawValue;}
void setRawValue(const QVariant &value);
/// set value of Fact
void _containerSetRawValue(const QVariant& value);
QString name() const { return _name;}
FactMetaData::ValueType_t type() const {return _type;}
/// get value of type,name etc. from metadata object of Fact
QString shortDescription() const;
QVariant rawDefaultValue() const;
QVariant rawMin() const;
QVariant rawMax() const;
signals:
/// signal to VehicleComponent tfor calibration
void valueChanged(QVariant value);
/// Signalled when property has been changed, sent to ParameterLoader to write to flight controller
void _containerRawValueChanged(const QVariant& value);
public slots:
private:
QVariant _rawValue;
FactMetaData* _metaData; /// metadata object of Fact object
int _compId;
QString _name; /// name of Fact object
FactMetaData::ValueType_t _type; /// type of Fact object, same as its metadata object
};
#endif // FACT_H