|
|
|
@ -59,20 +59,7 @@ SetupView::SetupView(QWidget* parent) :
@@ -59,20 +59,7 @@ SetupView::SetupView(QWidget* parent) :
|
|
|
|
|
_ui->buttonHolder->setAutoPilot(NULL); |
|
|
|
|
_ui->buttonHolder->setSource(QUrl::fromUserInput("qrc:/qml/SetupViewButtons.qml")); |
|
|
|
|
|
|
|
|
|
QObject* rootObject = (QObject*)_ui->buttonHolder->rootObject(); |
|
|
|
|
Q_ASSERT(rootObject); |
|
|
|
|
|
|
|
|
|
fSucceeded = connect(rootObject, SIGNAL(setupButtonClicked(QVariant)), this, SLOT(_setupButtonClicked(QVariant))); |
|
|
|
|
Q_ASSERT(fSucceeded); |
|
|
|
|
|
|
|
|
|
fSucceeded = connect(rootObject, SIGNAL(firmwareButtonClicked()), this, SLOT(_firmwareButtonClicked())); |
|
|
|
|
Q_ASSERT(fSucceeded); |
|
|
|
|
|
|
|
|
|
fSucceeded = connect(rootObject, SIGNAL(parametersButtonClicked()), this, SLOT(_parametersButtonClicked())); |
|
|
|
|
Q_ASSERT(fSucceeded); |
|
|
|
|
|
|
|
|
|
fSucceeded = connect(rootObject, SIGNAL(summaryButtonClicked()), this, SLOT(_summaryButtonClicked())); |
|
|
|
|
Q_ASSERT(fSucceeded); |
|
|
|
|
_ui->buttonHolder->rootContext()->setContextProperty("controller", this); |
|
|
|
|
|
|
|
|
|
_setActiveUAS(UASManager::instance()->getActiveUAS()); |
|
|
|
|
} |
|
|
|
@ -91,7 +78,7 @@ void SetupView::_setActiveUAS(UASInterface* uas)
@@ -91,7 +78,7 @@ void SetupView::_setActiveUAS(UASInterface* uas)
|
|
|
|
|
|
|
|
|
|
_autoPilotPlugin = NULL; |
|
|
|
|
_ui->buttonHolder->setAutoPilot(NULL); |
|
|
|
|
_firmwareButtonClicked(); |
|
|
|
|
firmwareButtonClicked(); |
|
|
|
|
QObject* button = _ui->buttonHolder->rootObject()->findChild<QObject*>("firmwareButton"); |
|
|
|
|
Q_ASSERT(button); |
|
|
|
|
button->setProperty("checked", true); |
|
|
|
@ -111,7 +98,7 @@ void SetupView::_setActiveUAS(UASInterface* uas)
@@ -111,7 +98,7 @@ void SetupView::_setActiveUAS(UASInterface* uas)
|
|
|
|
|
void SetupView::_pluginReady(void) |
|
|
|
|
{ |
|
|
|
|
_ui->buttonHolder->setAutoPilot(_autoPilotPlugin); |
|
|
|
|
_summaryButtonClicked(); |
|
|
|
|
summaryButtonClicked(); |
|
|
|
|
QObject* button = _ui->buttonHolder->rootObject()->findChild<QObject*>("summaryButton"); |
|
|
|
|
Q_ASSERT(button); |
|
|
|
|
button->setProperty("checked", true); |
|
|
|
@ -126,7 +113,7 @@ void SetupView::_changeSetupWidget(QWidget* newWidget)
@@ -126,7 +113,7 @@ void SetupView::_changeSetupWidget(QWidget* newWidget)
|
|
|
|
|
_ui->setupWidgetLayout->addWidget(newWidget); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void SetupView::_firmwareButtonClicked(void) |
|
|
|
|
void SetupView::firmwareButtonClicked(void) |
|
|
|
|
{ |
|
|
|
|
if (_uasCurrent && _uasCurrent->isArmed()) { |
|
|
|
|
QGCMessageBox::warning("Setup", "Firmware Update cannot be performed while vehicle is armed."); |
|
|
|
@ -146,13 +133,13 @@ void SetupView::_firmwareButtonClicked(void)
@@ -146,13 +133,13 @@ void SetupView::_firmwareButtonClicked(void)
|
|
|
|
|
_changeSetupWidget(setup); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void SetupView::_parametersButtonClicked(void) |
|
|
|
|
void SetupView::parametersButtonClicked(void) |
|
|
|
|
{ |
|
|
|
|
ParameterEditor* setup = new ParameterEditor(_uasCurrent, QStringList(), this); |
|
|
|
|
_changeSetupWidget(setup); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void SetupView::_summaryButtonClicked(void) |
|
|
|
|
void SetupView::summaryButtonClicked(void) |
|
|
|
|
{ |
|
|
|
|
Q_ASSERT(_autoPilotPlugin); |
|
|
|
|
|
|
|
|
@ -165,7 +152,7 @@ void SetupView::_summaryButtonClicked(void)
@@ -165,7 +152,7 @@ void SetupView::_summaryButtonClicked(void)
|
|
|
|
|
_changeSetupWidget(summary); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void SetupView::_setupButtonClicked(const QVariant& component) |
|
|
|
|
void SetupView::setupButtonClicked(const QVariant& component) |
|
|
|
|
{ |
|
|
|
|
if (_uasCurrent->isArmed()) { |
|
|
|
|
QGCMessageBox::warning("Setup", "Setup cannot be performed while vehicle is armed."); |
|
|
|
|