From 8fc471463d4c7bab8ce3265ac6478084242f2c02 Mon Sep 17 00:00:00 2001 From: Corvus Corax Date: Tue, 15 May 2012 18:23:25 +0200 Subject: [PATCH] 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 --- .../src/plugins/uavobjects/uavmetaobject.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/uavobjects/uavmetaobject.cpp b/ground/openpilotgcs/src/plugins/uavobjects/uavmetaobject.cpp index bb45495f5..3a526377c 100644 --- a/ground/openpilotgcs/src/plugins/uavobjects/uavmetaobject.cpp +++ b/ground/openpilotgcs/src/plugins/uavobjects/uavmetaobject.cpp @@ -39,16 +39,14 @@ UAVMetaObject::UAVMetaObject(quint32 objID, const QString& name, UAVObject* pare UAVObject::MetadataInitialize(ownMetadata); // Setup fields QStringList boolEnum; - boolEnum << tr("False") << tr("True"); - QStringList updateModeEnum; - updateModeEnum << tr("Periodic") << tr("On Change") << tr("Manual") << tr("Never"); - QStringList accessModeEnum; - accessModeEnum << tr("Read/Write") << tr("Read Only"); + boolEnum << tr("0") << tr("1"); + QStringList modesBitField; + modesBitField << tr("FlightReadOnly") << tr("GCSReadOnly") << tr("FlightTelemetryAcked") << tr("GCSTelemetryAcked") << tr("FlightUpdatePeriodic") << tr("FlightUpdateOnChange") << tr("GCSUpdatePeriodic") << tr("GCSUpdateOnChange"); QList fields; - fields.append( new UAVObjectField(tr("Modes"), tr(""), UAVObjectField::UINT8, 1, accessModeEnum) ); - fields.append( new UAVObjectField(tr("Flight Telemetry Update Period"), tr(""), UAVObjectField::UINT16, 1, QStringList()) ); - fields.append( new UAVObjectField(tr("GCS Telemetry Update Period"), tr(""), UAVObjectField::UINT16, 1, QStringList()) ); - fields.append( new UAVObjectField(tr("Logging Update Period"), tr(""), UAVObjectField::UINT16, 1, QStringList()) ); + fields.append( new UAVObjectField(tr("Modes"), tr("boolean"), UAVObjectField::BITFIELD, modesBitField, boolEnum) ); + 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("ms"), UAVObjectField::UINT16, 1, QStringList()) ); + fields.append( new UAVObjectField(tr("Logging Update Period"), tr("ms"), UAVObjectField::UINT16, 1, QStringList()) ); // Initialize parent UAVObject::initialize(0); UAVObject::initializeFields(fields, (quint8*)&parentMetadata, sizeof(Metadata));