dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
UAVObjectField Class Reference

#include <uavobjectfield.h>

Inheritance diagram for UAVObjectField:

Classes

struct  LimitStruct
 

Public Types

enum  FieldType {
  INT8 = 0, INT16, INT32, UINT8,
  UINT16, UINT32, FLOAT32, ENUM,
  BITFIELD, STRING
}
 
enum  LimitType {
  EQUAL, NOT_EQUAL, BETWEEN, BIGGER,
  SMALLER
}
 
enum  DisplayType { DEC, HEX, BIN, OCT }
 

Signals

void fieldUpdated (UAVObjectField *field)
 

Public Member Functions

 UAVObjectField (const QString &name, const QString &units, FieldType type, int numElements, const QStringList &options, const QList< int > &indices, const QString &limits=QString(), const QString &description=QString(), const QList< QVariant > defaultValues=QList< QVariant >(), const DisplayType display=DEC)
 
 UAVObjectField (const QString &name, const QString &units, FieldType type, const QStringList &elementNames, const QStringList &options, const QList< int > &indices, const QString &limits=QString(), const QString &description=QString(), const QList< QVariant > defaultValues=QList< QVariant >(), const DisplayType display=DEC)
 
void initialize (quint8 *data, quint32 dataOffset, UAVObject *obj)
 
UAVObjectgetObject () const
 
FieldType getType () const
 
QString getTypeAsString () const
 
QString getName () const
 
QString getUnits () const
 
int getNumElements () const
 
QStringList getElementNames () const
 
QString getElementName (int index=0) const
 
int getElementIndex (const QString &name) const
 Get the index of an element from it's name. More...
 
QStringList getOptions () const
 
bool hasOption (const QString &option)
 hasOption Check if the given option exists More...
 
qint32 pack (quint8 *dataOut)
 
qint32 unpack (const quint8 *dataIn)
 
QVariant getValue (int index=0) const
 
bool checkValue (const QVariant &data, int index=0) const
 
void setValue (const QVariant &data, int index=0)
 
double getDouble (int index=0) const
 
void setDouble (double value, int index=0)
 
size_t getNumBytes () const
 
bool isNumeric () const
 
bool isText () const
 
QString toString () const
 
QString getDescription () const
 
QVariant getDefaultValue (int index=0) const
 Get the default value (defined in the UAVO def) for the element. More...
 
bool isDefaultValue (int index=0)
 Check if the element is set to default value. More...
 
int getDisplayIntegerBase () const
 Get the preferred integer base for this field. More...
 
QString getDisplayPrefix () const
 Get the prefix for the preferred display format. More...
 
bool isWithinLimits (QVariant var, int index, int board=0) const
 
QVariant getMaxLimit (int index, int board=0) const
 
QVariant getMinLimit (int index, int board=0) const
 

Protected Member Functions

void clear ()
 
void constructorInitialize (const QString &name, const QString &units, FieldType type, const QStringList &elementNames, const QStringList &options, const QList< int > &indices, const QString &limits, const QString &description, const QList< QVariant > defaultValues, const DisplayType display)
 
void limitsInitialize (const QString &limits)
 

Protected Attributes

QString name
 
QString units
 
FieldType type
 
QStringList elementNames
 
QList< int > indices
 
std::map< int, int > enumToIndex
 
QStringList options
 
int numElements
 
size_t elementSize
 
size_t offset
 
quint8 * data
 
UAVObjectobj
 
QMap< int, QList< LimitStruct > > elementLimits
 
QString description
 
QList< QVariant > defaultValues
 
DisplayType display
 

Detailed Description

Definition at line 40 of file uavobjectfield.h.

Member Enumeration Documentation

Enumerator
DEC 
HEX 
BIN 
OCT 

Definition at line 58 of file uavobjectfield.h.

Enumerator
INT8 
INT16 
INT32 
UINT8 
UINT16 
UINT32 
FLOAT32 
ENUM 
BITFIELD 
STRING 

Definition at line 45 of file uavobjectfield.h.

Enumerator
EQUAL 
NOT_EQUAL 
BETWEEN 
BIGGER 
SMALLER 

Definition at line 57 of file uavobjectfield.h.

Member Function Documentation

void UAVObjectField::fieldUpdated ( UAVObjectField field)
signal

Member Data Documentation

quint8* UAVObjectField::data
protected

Definition at line 147 of file uavobjectfield.h.

QList<QVariant> UAVObjectField::defaultValues
protected

Definition at line 151 of file uavobjectfield.h.

QString UAVObjectField::description
protected

Definition at line 150 of file uavobjectfield.h.

DisplayType UAVObjectField::display
protected

Definition at line 152 of file uavobjectfield.h.

QMap<int, QList<LimitStruct> > UAVObjectField::elementLimits
protected

Definition at line 149 of file uavobjectfield.h.

QStringList UAVObjectField::elementNames
protected

Definition at line 140 of file uavobjectfield.h.

size_t UAVObjectField::elementSize
protected

Definition at line 145 of file uavobjectfield.h.

std::map<int, int> UAVObjectField::enumToIndex
protected

Definition at line 142 of file uavobjectfield.h.

QList<int> UAVObjectField::indices
protected

Definition at line 141 of file uavobjectfield.h.

QString UAVObjectField::name
protected

Definition at line 137 of file uavobjectfield.h.

int UAVObjectField::numElements
protected

Definition at line 144 of file uavobjectfield.h.

UAVObject* UAVObjectField::obj
protected

Definition at line 148 of file uavobjectfield.h.

size_t UAVObjectField::offset
protected

Definition at line 146 of file uavobjectfield.h.

QStringList UAVObjectField::options
protected

Definition at line 143 of file uavobjectfield.h.

FieldType UAVObjectField::type
protected

Definition at line 139 of file uavobjectfield.h.

QString UAVObjectField::units
protected

Definition at line 138 of file uavobjectfield.h.


The documentation for this class was generated from the following files: