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

Merge remote-tracking branch 'origin/pt/OP586' into next

Conflicts:
	ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp
	ground/openpilotgcs/src/plugins/config/configoutputwidget.h
This commit is contained in:
James Cotton 2011-11-11 10:51:04 -06:00
commit 40b2b654b7
2 changed files with 23 additions and 2 deletions

View File

@ -42,7 +42,7 @@
#include "systemalarms.h"
#include "uavsettingsimportexport/uavsettingsimportexportfactory.h"
ConfigOutputWidget::ConfigOutputWidget(QWidget *parent) : ConfigTaskWidget(parent)
ConfigOutputWidget::ConfigOutputWidget(QWidget *parent) : ConfigTaskWidget(parent),wasItMe(false)
{
m_config = new Ui_OutputWidget();
m_config->setupUi(this);
@ -163,6 +163,12 @@ ConfigOutputWidget::ConfigOutputWidget(QWidget *parent) : ConfigTaskWidget(paren
addWidget(m_config->outputRate1);
addWidget(m_config->spinningArmed);
UAVObjectManager *objManager = pm->getObject<UAVObjectManager>();
UAVObject* obj = objManager->getObject(QString("ActuatorCommand"));
if(obj->getMetadata().gcsTelemetryUpdateMode == UAVObject::UPDATEMODE_ONCHANGE)
this->setEnabled(false);
connect(obj,SIGNAL(objectUpdated(UAVObject*)),this,SLOT(disableIfNotMe(UAVObject*)));
}
ConfigOutputWidget::~ConfigOutputWidget()
@ -244,6 +250,7 @@ void ConfigOutputWidget::runChannelTests(bool state)
UAVObject::Metadata mdata = obj->getMetadata();
if (state)
{
wasItMe=true;
accInitialData = mdata;
mdata.flightAccess = UAVObject::ACCESS_READONLY;
mdata.flightTelemetryUpdateMode = UAVObject::UPDATEMODE_ONCHANGE;
@ -266,6 +273,7 @@ void ConfigOutputWidget::runChannelTests(bool state)
}
else
{
wasItMe=false;
mdata = accInitialData; // Restore metadata
foreach (QSpinBox* box, outMin) {
box->setEnabled(true);
@ -279,6 +287,7 @@ void ConfigOutputWidget::runChannelTests(bool state)
}
obj->setMetadata(mdata);
obj->updated();
}
@ -600,3 +609,14 @@ void ConfigOutputWidget::stopTests()
{
m_config->channelOutTest->setChecked(false);
}
void ConfigOutputWidget::disableIfNotMe(UAVObject* obj)
{
if(obj->getMetadata().gcsTelemetryUpdateMode == UAVObject::UPDATEMODE_ONCHANGE)
{
if(!wasItMe)
this->setEnabled(false);
}
else
this->setEnabled(true);
}

View File

@ -69,9 +69,10 @@ private:
bool firstUpdate;
bool wasItMe;
private slots:
void stopTests();
void disableIfNotMe(UAVObject *obj);
virtual void refreshWidgetsValues();
void updateObjectsFromWidgets();
void runChannelTests(bool state);