28 #ifndef UAVOBJECTFIELD_H
29 #define UAVOBJECTFIELD_H
33 #include <QStringList>
57 enum LimitType { EQUAL, NOT_EQUAL, BETWEEN, BIGGER, SMALLER };
68 const QStringList &options,
const QList<int> &indices,
69 const QString &limits = QString(),
const QString &description = QString(),
73 const QStringList &elementNames,
const QStringList &options,
74 const QList<int> &indices,
const QString &limits = QString(),
75 const QString &description = QString(),
78 void initialize(quint8 *
data, quint32 dataOffset,
UAVObject *obj);
81 QString getTypeAsString()
const;
82 QString getName()
const;
83 QString getUnits()
const;
84 int getNumElements()
const;
85 QStringList getElementNames()
const;
86 QString getElementName(
int index = 0)
const;
87 int getElementIndex(
const QString &name)
const;
88 QStringList getOptions()
const;
94 bool hasOption(
const QString &option);
95 qint32 pack(quint8 *dataOut);
96 qint32 unpack(
const quint8 *dataIn);
97 QVariant getValue(
int index = 0)
const;
98 bool checkValue(
const QVariant &
data,
int index = 0)
const;
99 void setValue(
const QVariant &
data,
int index = 0);
100 double getDouble(
int index = 0)
const;
101 void setDouble(
double value,
int index = 0);
102 size_t getNumBytes()
const;
103 bool isNumeric()
const;
105 QString toString()
const;
106 QString getDescription()
const;
112 QVariant getDefaultValue(
int index = 0)
const;
118 bool isDefaultValue(
int index = 0);
123 int getDisplayIntegerBase()
const;
128 QString getDisplayPrefix()
const;
130 bool isWithinLimits(QVariant var,
int index,
int board = 0)
const;
131 QVariant getMaxLimit(
int index,
int board = 0)
const;
132 QVariant getMinLimit(
int index,
int board = 0)
const;
155 void constructorInitialize(
const QString &name,
const QString &units,
FieldType type,
156 const QStringList &elementNames,
const QStringList &options,
157 const QList<int> &indices,
const QString &limits,
160 void limitsInitialize(
const QString &limits);
163 #endif // UAVOBJECTFIELD_H
QMap< int, QList< LimitStruct > > elementLimits
QList< QVariant > defaultValues
std::map< int, int > enumToIndex