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:
commit
40b2b654b7
@ -42,7 +42,7 @@
|
|||||||
#include "systemalarms.h"
|
#include "systemalarms.h"
|
||||||
#include "uavsettingsimportexport/uavsettingsimportexportfactory.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 = new Ui_OutputWidget();
|
||||||
m_config->setupUi(this);
|
m_config->setupUi(this);
|
||||||
@ -163,6 +163,12 @@ ConfigOutputWidget::ConfigOutputWidget(QWidget *parent) : ConfigTaskWidget(paren
|
|||||||
addWidget(m_config->outputRate1);
|
addWidget(m_config->outputRate1);
|
||||||
|
|
||||||
addWidget(m_config->spinningArmed);
|
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()
|
ConfigOutputWidget::~ConfigOutputWidget()
|
||||||
@ -244,6 +250,7 @@ void ConfigOutputWidget::runChannelTests(bool state)
|
|||||||
UAVObject::Metadata mdata = obj->getMetadata();
|
UAVObject::Metadata mdata = obj->getMetadata();
|
||||||
if (state)
|
if (state)
|
||||||
{
|
{
|
||||||
|
wasItMe=true;
|
||||||
accInitialData = mdata;
|
accInitialData = mdata;
|
||||||
mdata.flightAccess = UAVObject::ACCESS_READONLY;
|
mdata.flightAccess = UAVObject::ACCESS_READONLY;
|
||||||
mdata.flightTelemetryUpdateMode = UAVObject::UPDATEMODE_ONCHANGE;
|
mdata.flightTelemetryUpdateMode = UAVObject::UPDATEMODE_ONCHANGE;
|
||||||
@ -266,6 +273,7 @@ void ConfigOutputWidget::runChannelTests(bool state)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
wasItMe=false;
|
||||||
mdata = accInitialData; // Restore metadata
|
mdata = accInitialData; // Restore metadata
|
||||||
foreach (QSpinBox* box, outMin) {
|
foreach (QSpinBox* box, outMin) {
|
||||||
box->setEnabled(true);
|
box->setEnabled(true);
|
||||||
@ -279,6 +287,7 @@ void ConfigOutputWidget::runChannelTests(bool state)
|
|||||||
|
|
||||||
}
|
}
|
||||||
obj->setMetadata(mdata);
|
obj->setMetadata(mdata);
|
||||||
|
obj->updated();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -600,3 +609,14 @@ void ConfigOutputWidget::stopTests()
|
|||||||
{
|
{
|
||||||
m_config->channelOutTest->setChecked(false);
|
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);
|
||||||
|
}
|
||||||
|
@ -69,9 +69,10 @@ private:
|
|||||||
|
|
||||||
bool firstUpdate;
|
bool firstUpdate;
|
||||||
|
|
||||||
|
bool wasItMe;
|
||||||
private slots:
|
private slots:
|
||||||
void stopTests();
|
void stopTests();
|
||||||
|
void disableIfNotMe(UAVObject *obj);
|
||||||
virtual void refreshWidgetsValues();
|
virtual void refreshWidgetsValues();
|
||||||
void updateObjectsFromWidgets();
|
void updateObjectsFromWidgets();
|
||||||
void runChannelTests(bool state);
|
void runChannelTests(bool state);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user