1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00

GCS/Altitude Update altitude object with new metafields, modified update rates in XML and flight s/w

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@646 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
vassilis 2010-05-20 01:22:22 +00:00 committed by vassilis
parent f143628e80
commit f1b6b5e410
2 changed files with 18 additions and 9 deletions

View File

@ -62,12 +62,14 @@ AltitudeActual::AltitudeActual(): UAVDataObject(OBJID, ISSINGLEINST, ISSETTINGS,
UAVObject::Metadata AltitudeActual::getDefaultMetadata() UAVObject::Metadata AltitudeActual::getDefaultMetadata()
{ {
UAVObject::Metadata metadata; UAVObject::Metadata metadata;
metadata.flightAccess = ACCESS_READWRITE;
metadata.gcsAccess = ACCESS_READWRITE;
metadata.gcsTelemetryAcked = 1; metadata.gcsTelemetryAcked = 1;
metadata.gcsTelemetryUpdateMode = UAVObject::UPDATEMODE_PERIODIC; metadata.gcsTelemetryUpdateMode = UAVObject::UPDATEMODE_MANUAL;
metadata.gcsTelemetryUpdatePeriod = 200; metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightTelemetryAcked = 1; metadata.flightTelemetryAcked = 1;
metadata.flightTelemetryUpdateMode = UAVObject::UPDATEMODE_ONCHANGE; metadata.flightTelemetryUpdateMode = UAVObject::UPDATEMODE_PERIODIC;
metadata.flightTelemetryUpdatePeriod = 0; metadata.flightTelemetryUpdatePeriod = 1000;
metadata.loggingUpdateMode = UAVObject::UPDATEMODE_NEVER; metadata.loggingUpdateMode = UAVObject::UPDATEMODE_NEVER;
metadata.loggingUpdatePeriod = 0; metadata.loggingUpdatePeriod = 0;
return metadata; return metadata;
@ -98,9 +100,15 @@ AltitudeActual::DataFields AltitudeActual::getData()
void AltitudeActual::setData(const DataFields& data) void AltitudeActual::setData(const DataFields& data)
{ {
QMutexLocker locker(mutex); QMutexLocker locker(mutex);
// Get metadata
Metadata mdata = getMetadata();
// Update object if the access mode permits
if ( mdata.gcsAccess == ACCESS_READWRITE )
{
this->data = data; this->data = data;
emit objectUpdatedAuto(this); // trigger object updated event emit objectUpdatedAuto(this); // trigger object updated event
emit objectUpdated(this); emit objectUpdated(this);
}
} }
/** /**

View File

@ -3,8 +3,9 @@
<field name="Altitude" units="m" type="float" elements="1"/> <field name="Altitude" units="m" type="float" elements="1"/>
<field name="Temperature" units="C" type="float" elements="1"/> <field name="Temperature" units="C" type="float" elements="1"/>
<field name="Pressure" units="kPa" type="float" elements="1"/> <field name="Pressure" units="kPa" type="float" elements="1"/>
<telemetrygcs acked="true" updatemode="periodic" period="200"/> <access gcs="readwrite" flight="readwrite"/>
<telemetryflight acked="true" updatemode="onchange" period="0"/> <telemetrygcs acked="true" updatemode="manual" period="0"/>
<telemetryflight acked="true" updatemode="periodic" period="1000"/>
<logging updatemode="never" period="0"/> <logging updatemode="never" period="0"/>
</object> </object>
</xml> </xml>