1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

UAVOBJECTS: On GCS side, handle Mode Bitfield in UAVOBJECT Metadata as a type BITFIELD. This has no effect on flight side, since the serialized form is identical to an UINT8 that's interpreted as a bitfield which is used there, so that can change later if necessary

This commit is contained in:
Corvus Corax 2012-05-15 18:23:25 +02:00
parent 31fd30b108
commit 8fc471463d

View File

@ -39,16 +39,14 @@ UAVMetaObject::UAVMetaObject(quint32 objID, const QString& name, UAVObject* pare
UAVObject::MetadataInitialize(ownMetadata); UAVObject::MetadataInitialize(ownMetadata);
// Setup fields // Setup fields
QStringList boolEnum; QStringList boolEnum;
boolEnum << tr("False") << tr("True"); boolEnum << tr("0") << tr("1");
QStringList updateModeEnum; QStringList modesBitField;
updateModeEnum << tr("Periodic") << tr("On Change") << tr("Manual") << tr("Never"); modesBitField << tr("FlightReadOnly") << tr("GCSReadOnly") << tr("FlightTelemetryAcked") << tr("GCSTelemetryAcked") << tr("FlightUpdatePeriodic") << tr("FlightUpdateOnChange") << tr("GCSUpdatePeriodic") << tr("GCSUpdateOnChange");
QStringList accessModeEnum;
accessModeEnum << tr("Read/Write") << tr("Read Only");
QList<UAVObjectField*> fields; QList<UAVObjectField*> fields;
fields.append( new UAVObjectField(tr("Modes"), tr(""), UAVObjectField::UINT8, 1, accessModeEnum) ); fields.append( new UAVObjectField(tr("Modes"), tr("boolean"), UAVObjectField::BITFIELD, modesBitField, boolEnum) );
fields.append( new UAVObjectField(tr("Flight Telemetry Update Period"), tr(""), UAVObjectField::UINT16, 1, QStringList()) ); fields.append( new UAVObjectField(tr("Flight Telemetry Update Period"), tr("ms"), UAVObjectField::UINT16, 1, QStringList()) );
fields.append( new UAVObjectField(tr("GCS Telemetry Update Period"), tr(""), UAVObjectField::UINT16, 1, QStringList()) ); fields.append( new UAVObjectField(tr("GCS Telemetry Update Period"), tr("ms"), UAVObjectField::UINT16, 1, QStringList()) );
fields.append( new UAVObjectField(tr("Logging Update Period"), tr(""), UAVObjectField::UINT16, 1, QStringList()) ); fields.append( new UAVObjectField(tr("Logging Update Period"), tr("ms"), UAVObjectField::UINT16, 1, QStringList()) );
// Initialize parent // Initialize parent
UAVObject::initialize(0); UAVObject::initialize(0);
UAVObject::initializeFields(fields, (quint8*)&parentMetadata, sizeof(Metadata)); UAVObject::initializeFields(fields, (quint8*)&parentMetadata, sizeof(Metadata));