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

OP-115 UAV Control gadget now preserves initial state of metadata when it stops.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1338 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
edouard 2010-08-19 20:39:19 +00:00 committed by edouard
parent ef0b307353
commit adc6385880
2 changed files with 8 additions and 5 deletions

View File

@ -79,16 +79,18 @@ void GCSControlGadgetWidget::gcsControlToggle(int state)
UAVObject::Metadata mdata = getMCC()->getMetadata();
if (state)
{
mccInitialData = mdata;
mdata.flightAccess = UAVObject::ACCESS_READONLY;
mdata.flightTelemetryUpdateMode = UAVObject::UPDATEMODE_ONCHANGE;
mdata.gcsTelemetryAcked = false;
mdata.gcsTelemetryUpdateMode = UAVObject::UPDATEMODE_ONCHANGE;
mdata.gcsTelemetryUpdatePeriod = 100;
}
else
{
mdata.flightAccess = UAVObject::ACCESS_READWRITE;
mdata = mccInitialData;
}
mdata.flightTelemetryUpdateMode = UAVObject::UPDATEMODE_ONCHANGE;
mdata.gcsTelemetryAcked = false;
mdata.gcsTelemetryUpdateMode = UAVObject::UPDATEMODE_ONCHANGE;
mdata.gcsTelemetryUpdatePeriod = 100;
getMCC()->setMetadata(mdata);
}

View File

@ -48,6 +48,7 @@ private slots:
private:
Ui_GCSControl *m_gcscontrol;
ManualControlCommand* getMCC();
UAVObject::Metadata mccInitialData;
};
#endif /* GCSControlGADGETWIDGET_H_ */