From 91614e3add0917c213e87c1497f84c409ff85755 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Sat, 20 Dec 2014 09:43:19 -0800 Subject: [PATCH] VehicleSummary converted to QML Summary page is also the launching spot for the setup screens. No more left hand set of buttons. --- qgroundcontrol.pro | 13 +- qgroundcontrol.qrc | 9 +- src/VehicleSetup/ParameterEditor.ui | 10 +- src/VehicleSetup/SetupView.cc | 249 +++++------------- src/VehicleSetup/SetupView.h | 34 +-- src/VehicleSetup/SetupView.ui | 148 ----------- src/VehicleSetup/SetupViewConnected.qml | 134 ++++++++++ src/VehicleSetup/SetupViewDisconnected.qml | 32 +++ src/VehicleSetup/SetupWidgetHolder.cc | 19 ++ src/VehicleSetup/SetupWidgetHolder.h | 24 ++ src/VehicleSetup/SetupWidgetHolder.ui | 40 +++ .../px4_configuration/PX4FirmwareUpgrade.ui | 22 +- src/ui/px4_configuration/PX4RCCalibration.ui | 12 +- .../px4_configuration/QGCPX4AirframeConfig.ui | 22 +- .../QGCPX4SensorCalibration.cc | 4 +- 15 files changed, 397 insertions(+), 375 deletions(-) delete mode 100644 src/VehicleSetup/SetupView.ui create mode 100644 src/VehicleSetup/SetupViewConnected.qml create mode 100644 src/VehicleSetup/SetupViewDisconnected.qml create mode 100644 src/VehicleSetup/SetupWidgetHolder.cc create mode 100644 src/VehicleSetup/SetupWidgetHolder.h create mode 100644 src/VehicleSetup/SetupWidgetHolder.ui diff --git a/qgroundcontrol.pro b/qgroundcontrol.pro index 846c8945c..b2a1b6250 100644 --- a/qgroundcontrol.pro +++ b/qgroundcontrol.pro @@ -630,7 +630,7 @@ SOURCES += \ src/QGCComboBox.cc \ src/QGCTemporaryFile.cc \ src/audio/QGCAudioWorker.cpp \ - src/QGCQuickWidget.cc + src/QGCQuickWidget.cc \ # # Unit Test specific configuration goes here @@ -698,19 +698,18 @@ SOURCES += \ # AutoPilot Plugin Support # FORMS += \ - src/VehicleSetup/SetupView.ui \ - src/VehicleSetup/SummaryPage.ui \ src/VehicleSetup/ParameterEditor.ui \ src/ui/QGCPX4VehicleConfig.ui \ - src/AutoPilotPlugins/PX4/FlightModeConfig.ui + src/AutoPilotPlugins/PX4/FlightModeConfig.ui \ + src/VehicleSetup/SetupWidgetHolder.ui \ HEADERS+= \ src/VehicleSetup/SetupView.h \ - src/VehicleSetup/SummaryPage.h \ src/VehicleSetup/ParameterEditor.h \ src/VehicleSetup/VehicleSetupButton.h \ src/VehicleSetup/VehicleComponentButton.h \ src/VehicleSetup/VehicleComponent.h \ + src/VehicleSetup/VehicleComponentSummaryItem.h \ src/AutoPilotPlugins/AutoPilotPluginManager.h \ src/AutoPilotPlugins/AutoPilotPlugin.h \ src/AutoPilotPlugins/Generic/GenericAutoPilotPlugin.h \ @@ -722,12 +721,13 @@ HEADERS+= \ src/AutoPilotPlugins/PX4/AirframeComponent.h \ src/AutoPilotPlugins/PX4/SensorsComponent.h \ src/AutoPilotPlugins/PX4/PX4ParameterFacts.h \ + src/VehicleSetup/SetupWidgetHolder.h \ SOURCES += \ src/VehicleSetup/SetupView.cc \ - src/VehicleSetup/SummaryPage.cc \ src/VehicleSetup/ParameterEditor.cc \ src/VehicleSetup/VehicleComponent.cc \ + src/VehicleSetup/VehicleComponentSummaryItem.cc \ src/AutoPilotPlugins/AutoPilotPluginManager.cc \ src/AutoPilotPlugins/Generic/GenericAutoPilotPlugin.cc \ src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.cc \ @@ -738,6 +738,7 @@ SOURCES += \ src/AutoPilotPlugins/PX4/AirframeComponent.cc \ src/AutoPilotPlugins/PX4/SensorsComponent.cc \ src/AutoPilotPlugins/PX4/PX4ParameterFacts.cc \ + src/VehicleSetup/SetupWidgetHolder.cc \ # Fact System code diff --git a/qgroundcontrol.qrc b/qgroundcontrol.qrc index e86f2173b..bca9f09bf 100644 --- a/qgroundcontrol.qrc +++ b/qgroundcontrol.qrc @@ -236,8 +236,13 @@ files/QLoggingCategory/qtlogging.ini - files/qml/qmldir - files/qml/FactTextInput.qml + src/test.qml + qml/QGroundControl/FactControls/qmldir + qml/QGroundControl/FactControls/SetupButton.qml + src/VehicleSetup/SetupViewConnected.qml + src/VehicleSetup/SetupViewDisconnected.qml + files/images/px4/airframes/octo_x.png + files/images/px4/boards/px4fmu_2.x.png src/AutoPilotPlugins/PX4/ParameterFactMetaData.xml diff --git a/src/VehicleSetup/ParameterEditor.ui b/src/VehicleSetup/ParameterEditor.ui index 540cd640f..740800c1c 100644 --- a/src/VehicleSetup/ParameterEditor.ui +++ b/src/VehicleSetup/ParameterEditor.ui @@ -6,16 +6,22 @@ 0 0 - 600 + 750 600 - + 0 0 + + + 750 + 600 + + Form diff --git a/src/VehicleSetup/SetupView.cc b/src/VehicleSetup/SetupView.cc index 6843fe327..caebee6e0 100644 --- a/src/VehicleSetup/SetupView.cc +++ b/src/VehicleSetup/SetupView.cc @@ -25,249 +25,130 @@ /// @author Don Gagne #include "SetupView.h" -#include "ui_SetupView.h" #include "UASManager.h" #include "AutoPilotPluginManager.h" #include "VehicleComponent.h" -#include "VehicleComponentButton.h" -#include "SummaryPage.h" #include "PX4FirmwareUpgrade.h" +#include "ParameterEditor.h" +#include "SetupWidgetHolder.h" +#include "MainWindow.h" -# #include #include #include SetupView::SetupView(QWidget* parent) : - QWidget(parent), + QGCQuickWidget(parent), _uasCurrent(NULL), - _setupWidget(NULL), - _parameterWidget(NULL), _initComplete(false), - _ui(new Ui::SetupView) + _autoPilotPlugin(NULL) { - _ui->setupUi(this); - bool fSucceeded = connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), this, SLOT(_setActiveUAS(UASInterface*))); Q_UNUSED(fSucceeded); Q_ASSERT(fSucceeded); - connect(_ui->firmwareButton, &QPushButton::clicked, this, &SetupView::_firmwareButtonClicked); - connect(_ui->summaryButton, &QPushButton::clicked, this, &SetupView::_summaryButtonClicked); - - // Summary button is not shown until we have parameters ready - _ui->summaryButton->setVisible(false); - - // We show firmware upgrade until we get parameters - _firmwareButtonClicked(); + _setActiveUAS(NULL); } SetupView::~SetupView() { - delete _ui; + } void SetupView::_setActiveUAS(UASInterface* uas) { if (_uasCurrent) { - disconnect(_uasCurrent->getParamManager(), SIGNAL(parameterListUpToDate()), this, SLOT(_parametersReady())); + Q_ASSERT(_autoPilotPlugin); + disconnect(_autoPilotPlugin); + _autoPilotPlugin = NULL; } - - // Clear all UI and fall back to Firmware ui since that is the only thing available when no UAS - _clearWidgets(); - _clearComponentButtons(); - _ui->summaryButton->setVisible(false); - _components.clear(); - _firmwareButtonClicked(); - + _uasCurrent = uas; if (_uasCurrent) { - connect(_uasCurrent, &UASInterface::connected, this, &SetupView::_uasConnected); - connect(_uasCurrent, &UASInterface::disconnected, this, &SetupView::_uasDisconnected); + _autoPilotPlugin = AutoPilotPluginManager::instance()->getInstanceForAutoPilotPlugin(_uasCurrent); - bool fSucceeded = connect(_uasCurrent->getParamManager(), SIGNAL(parameterListUpToDate()), this, SLOT(_parametersReady())); - Q_ASSERT(fSucceeded); - Q_UNUSED(fSucceeded); - if (_uasCurrent->getParamManager()->parametersReady()) { - _parametersReady(); + connect(_autoPilotPlugin, &AutoPilotPlugin::pluginReady, this, &SetupView::_pluginReady); + if (_autoPilotPlugin->pluginIsReady()) { + _setConnectedView(); } + } else { + _setDisconnectedView(); } } -/// @brief Removes and deletes both the setup and parameter widgets from the tab view. -void SetupView::_clearWidgets(void) +void SetupView::_pluginReady(void) { - if (_setupWidget) { - _ui->setupLayout->removeWidget(_setupWidget); - delete _setupWidget; - _setupWidget = NULL; - } - - if (_parameterWidget) { - _ui->setupLayout->removeWidget(_parameterWidget); - delete _parameterWidget; - _parameterWidget = NULL; - } -} - -/// @brief Removes and deletes all vehicle component setup buttons from the view. -void SetupView::_clearComponentButtons(void) -{ - QLayoutItem* item; - while ((item = _ui->componentButtonLayout->itemAt(0))) { - VehicleComponentButton* componentButton = dynamic_cast(item->widget()); - // Make sure this is really a VehicleComponentButton. If it isn't the UI has changed but the code hasn't. - Q_ASSERT(componentButton); - Q_UNUSED(componentButton); - _ui->componentButtonLayout->removeWidget(item->widget()); - } + _setConnectedView(); } -void SetupView::_summaryButtonClicked(void) +void SetupView::_setViewConnections(void) { - // Clear previous tab widgets - _clearWidgets(); + QObject*button = rootObject()->findChild("firmwareButton"); + Q_ASSERT(button); + connect(button, SIGNAL(clicked()), this, SLOT(_firmwareButtonClicked())); - // Create new tab widgets - - _setupWidget = new SummaryPage(_components); - Q_CHECK_PTR(_setupWidget); - _ui->setupLayout->addWidget(_setupWidget); - - _parameterWidget = new ParameterEditor(_uasCurrent, QStringList(), this); - _ui->parameterLayout->addWidget(_parameterWidget); - - _showBothTabs(); - _ui->tabWidget->setTabText(0, tr("Vehicle Summary")); - _ui->tabWidget->setTabText(1, tr("All Parameters")); - - _uncheckAllButtons(); - _ui->summaryButton->setChecked(true); + button = rootObject()->findChild("parametersButton"); + if (button) { + connect(button, SIGNAL(clicked()), this, SLOT(_parametersButtonClicked())); + } } -void SetupView::_firmwareButtonClicked(void) +void SetupView::_setDisconnectedView(void) { - // Clear previous tab widgets - _clearWidgets(); - - // Create new tab widgets - - _setupWidget = new PX4FirmwareUpgrade(this); - Q_CHECK_PTR(_setupWidget); - _ui->setupLayout->addWidget(_setupWidget); - - _showOnlySetupTab(); - _ui->tabWidget->setTabEnabled(1, false); - _ui->tabWidget->setTabText(0, tr("Firmware Upgrade")); - - _uncheckAllButtons(); - _ui->firmwareButton->setChecked(true); + setSource(QUrl::fromUserInput("qrc:qml/SetupViewDisconnected.qml")); + _setViewConnections(); } -void SetupView::_componentButtonClicked(void) +void SetupView::_setConnectedView(void) { - // Clear previous tab widgets - _clearWidgets(); - - // Create new tab widgets - - VehicleComponentButton* componentButton = dynamic_cast(sender()); - Q_ASSERT(componentButton); - - VehicleComponent* component = componentButton->component(); - Q_ASSERT(component); + Q_ASSERT(_uasCurrent); + Q_ASSERT(_autoPilotPlugin); - _setupWidget = component->setupWidget(); - Q_ASSERT(_setupWidget); - _ui->setupLayout->addWidget(_setupWidget); + setAutoPilot(_autoPilotPlugin); - _parameterWidget = new ParameterEditor(_uasCurrent, component->paramFilterList(), this); - _ui->parameterLayout->addWidget(_parameterWidget); + setSource(QUrl::fromUserInput("qrc:qml/SetupViewConnected.qml")); + disconnect(_autoPilotPlugin); + _setViewConnections(); - _showBothTabs(); - _ui->tabWidget->setTabText(0, tr("%1 Setup").arg(component->name())); - _ui->tabWidget->setTabText(1, tr("%1 Parameters").arg(component->name())); - - _uncheckAllButtons(); - componentButton->setChecked(true); + connect((QObject*)rootObject(), SIGNAL(buttonClicked(QVariant)), this, SLOT(_setupButtonClicked(QVariant))); } -void SetupView::_parametersReady(void) +void SetupView::_firmwareButtonClicked(void) { - // When parameters become ready for the first time, setup the rest of the ui. - - if (_initComplete) { - return; - } - - _initComplete = true; - - disconnect(_uasCurrent->getParamManager(), SIGNAL(parameterListUpToDate()), this, SLOT(_parametersReady())); - - _ui->summaryButton->setVisible(true); + SetupWidgetHolder* dialog = new SetupWidgetHolder(MainWindow::instance()); + dialog->setModal(true); + dialog->setWindowTitle("Firmware Upgrade"); - _components = AutoPilotPluginManager::instance()->getInstanceForAutoPilotPlugin(_uasCurrent)->getVehicleComponents(); - - foreach(VehicleComponent* component, _components) { - VehicleComponentButton* button = new VehicleComponentButton(component, _ui->navBarWidget); - - button->setCheckable(true); - - button->setObjectName(component->name() + "Button"); - button->setText(component->name()); - - QIcon icon; - icon.addFile(component->icon()); - button->setIcon(icon); - button->setIconSize(_ui->firmwareButton->iconSize()); - - connect(button, &VehicleComponentButton::clicked, this, &SetupView::_componentButtonClicked); - - _ui->componentButtonLayout->addWidget(button); - } - - _summaryButtonClicked(); -} - -void SetupView::_showOnlySetupTab(void) -{ - _ui->tabWidget->setCurrentIndex(0); - _ui->tabWidget->removeTab(1); + PX4FirmwareUpgrade* setup = new PX4FirmwareUpgrade(dialog); + dialog->setInnerWidget(setup); + dialog->exec(); } -void SetupView::_showBothTabs(void) +void SetupView::_parametersButtonClicked(void) { - _ui->tabWidget->setCurrentIndex(0); - if (_ui->tabWidget->count() == 1) { - _ui->tabWidget->insertTab(1, _ui->parameterTab, QString()); - } -} - -void SetupView::_uncheckAllButtons(void) -{ - _ui->firmwareButton->setChecked(false); - _ui->summaryButton->setChecked(false); + SetupWidgetHolder* dialog = new SetupWidgetHolder(MainWindow::instance()); + dialog->setModal(true); + dialog->setWindowTitle("Parameter Editor"); - int i = 0; - QLayoutItem* item; - while ((item = _ui->componentButtonLayout->itemAt(i++))) { - VehicleComponentButton* componentButton = dynamic_cast(item->widget()); - if (componentButton != NULL) { - componentButton->setChecked(false); - } - } -} - -void SetupView::_uasConnected(void) -{ - qDebug() << "UAS connected"; - // FIXME: We should re-connect the UI + ParameterEditor* setup = new ParameterEditor(_uasCurrent, QStringList(), dialog); + dialog->setInnerWidget(setup); + dialog->exec(); } -void SetupView::_uasDisconnected(void) +void SetupView::_setupButtonClicked(const QVariant& component) { - qDebug() << "UAS disconnected"; - // FIXME: We should disconnect the UI + VehicleComponent* vehicle = qobject_cast(component.value()); + Q_ASSERT(vehicle); + + SetupWidgetHolder* dialog = new SetupWidgetHolder(MainWindow::instance()); + dialog->setModal(true); + dialog->setWindowTitle(vehicle->name()); + + QWidget* setupWidget = vehicle->setupWidget(); + qDebug() << setupWidget->minimumSize(); + dialog->resize(setupWidget->minimumSize()); + dialog->setInnerWidget(setupWidget); + dialog->exec(); } diff --git a/src/VehicleSetup/SetupView.h b/src/VehicleSetup/SetupView.h index 29462f835..24f974eba 100644 --- a/src/VehicleSetup/SetupView.h +++ b/src/VehicleSetup/SetupView.h @@ -24,21 +24,18 @@ #ifndef SETUPVIEW_H #define SETUPVIEW_H -#include #include "UASInterface.h" #include "ParameterEditor.h" #include "VehicleComponent.h" +#include "QGCQuickWidget.h" +#include "AutoPilotPlugin.h" /// @file /// @brief This class is used to display the UI for the VehicleComponent objects. /// @author Don Gagne -namespace Ui { -class SetupView; -} - -class SetupView : public QWidget +class SetupView : public QGCQuickWidget { Q_OBJECT @@ -48,26 +45,19 @@ public: private slots: void _setActiveUAS(UASInterface* uas); - void _summaryButtonClicked(void); + void _pluginReady(void); void _firmwareButtonClicked(void); - void _componentButtonClicked(void); - void _parametersReady(void); - void _uasConnected(void); - void _uasDisconnected(void); + void _parametersButtonClicked(void); + void _setupButtonClicked(const QVariant& component); private: - void _clearWidgets(void); - void _clearComponentButtons(void); - void _showOnlySetupTab(void); - void _showBothTabs(void); - void _uncheckAllButtons(void); + void _setConnectedView(void); + void _setDisconnectedView(void); + void _setViewConnections(void); - UASInterface* _uasCurrent; ///< Currently active UAS - QList _components; ///< VehicleComponents for active UAS - QWidget* _setupWidget; ///< Currently active setup widget - ParameterEditor* _parameterWidget; ///< Currently active parameter editor wdiget - bool _initComplete; ///< true: parameters are ready and ui has been setup - Ui::SetupView* _ui; + UASInterface* _uasCurrent; ///< Currently active UAS + bool _initComplete; ///< true: parameters are ready and ui has been setup + AutoPilotPlugin* _autoPilotPlugin; }; #endif diff --git a/src/VehicleSetup/SetupView.ui b/src/VehicleSetup/SetupView.ui deleted file mode 100644 index 7712fcc60..000000000 --- a/src/VehicleSetup/SetupView.ui +++ /dev/null @@ -1,148 +0,0 @@ - - - SetupView - - - - 0 - 0 - 493 - 419 - - - - Form - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - QLayout::SetMinAndMaxSize - - - 12 - - - 12 - - - 24 - - - 12 - - - - - Firmware -Upgrade - - - - :/files/images/px4/menu/firmware_upgrade.png:/files/images/px4/menu/firmware_upgrade.png - - - - 60 - 60 - - - - true - - - - - - - Vehicle -Summary - - - - :/files/images/px4/menu/plane.png:/files/images/px4/menu/plane.png - - - - 60 - 60 - - - - true - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - - - - 0 - - - - Setup - - - - - - Parameters - - - - - - - - - - - - VehicleSetupButton - QPushButton -
VehicleSetupButton.h
-
-
- - - - -
diff --git a/src/VehicleSetup/SetupViewConnected.qml b/src/VehicleSetup/SetupViewConnected.qml new file mode 100644 index 000000000..7a33f71e6 --- /dev/null +++ b/src/VehicleSetup/SetupViewConnected.qml @@ -0,0 +1,134 @@ +import QtQuick 2.2 +import QtQuick.Controls 1.2 +import QtQuick.Controls.Styles 1.2 + +Rectangle { + id: topLevel + objectName: "topLevel" + + anchors.fill: parent + color: "#222" + + signal buttonClicked(variant component); + + Image { + anchors.fill: parent + fillMode: Image.PreserveAspectFit + smooth: true + source: autopilot.setupBackgroundImage; + } + + Column { + anchors.margins: 20 + anchors.fill: parent + spacing: 5 + + Rectangle { id: header; color: "lightblue"; radius: 10.0; width: parent.width; height: titleText.height + 20; opacity: 0.8; + Text { id: titleText; anchors.centerIn: parent; font.pointSize: 24; text: "Vehicle Summary" } + } + + Flow { + width: parent.width; + height: parent.height - header.height - footer.height + spacing: 5 + + Repeater { + model: autopilot.components + + Button { + width: 250 + height: 200 + + property var summaryModel: modelData.summaryItems + text: modelData.name + property bool setupComplete: modelData.setupComplete + + style: ButtonStyle { + id: buttonStyle + background: Rectangle { + id: innerRect + readonly property real titleHeight: 30 + + border.color: "#888" + radius: 10 + + color: control.activeFocus ? "#47b" : "white" + opacity: control.hovered || control.activeFocus ? 1 : 0.8 + Behavior on opacity {NumberAnimation{ duration: 100 }} + + Text { + id: titleBar + + width: parent.width + height: parent.titleHeight + + verticalAlignment: TextEdit.AlignVCenter + horizontalAlignment: TextEdit.AlignHCenter + + text: control.text + font.pixelSize: 12 + + Rectangle { + id: setupIndicator + + property bool setupComplete: true + readonly property real indicatorRadius: 6 + + x: parent.width - (indicatorRadius * 2) - 5 + y: (parent.height - (indicatorRadius * 2)) / 2 + width: indicatorRadius * 2 + height: indicatorRadius * 2 + + radius: indicatorRadius + color: control.setupComplete ? "green" : "red" + } + } + + Rectangle { + width: parent.width + height: parent.height - parent.titleHeight + + y: parent.titleHeight + + border.color: "#888" + + gradient: Gradient { + GradientStop { position: 0; color: "#ffffff" } + GradientStop { position: 1; color: "#000000" } + } + + ListView { + id: summaryList + anchors.fill: parent + anchors.margins: 4 + model: control.summaryModel + delegate: Row { width: parent.width + Text { id: firstCol; text: modelData.name } + Text { horizontalAlignment: Text.AlignRight; width: parent.width - firstCol.contentWidth; text: modelData.state } + } + } + } + } + + label: Item {} + } + + onClicked: topLevel.buttonClicked(modelData) + } + } + } + + Rectangle { id: footer; color: "lightblue"; radius: 10.0; width: parent.width; height: titleText.height + 20; opacity: 0.8; + + property real spacing: (width - firmwareButton.width - parametersButton.width) / 3 + + Button { id: firmwareButton; objectName: "firmwareButton"; + x: parent.spacing; anchors.verticalCenter: parent.verticalCenter; + text: "Firmware Upgrade" } + Button { id: parametersButton; objectName: "parametersButton" + x: firmwareButton.width + (parent.spacing*2); anchors.verticalCenter: parent.verticalCenter; + text: "Parameters" } + } + + } +} diff --git a/src/VehicleSetup/SetupViewDisconnected.qml b/src/VehicleSetup/SetupViewDisconnected.qml new file mode 100644 index 000000000..74624a55e --- /dev/null +++ b/src/VehicleSetup/SetupViewDisconnected.qml @@ -0,0 +1,32 @@ +import QtQuick 2.2 +import QtQuick.Controls 1.2 +import QtQuick.Controls.Styles 1.2 + +Rectangle { + anchors.fill: parent + color: "#222" + + Item { + anchors.margins: 20 + anchors.fill: parent + + Rectangle { id: header; color: "lightblue"; radius: 10.0; width: parent.width; height: titleText.height + 20; opacity: 0.8; + Text { id: titleText; anchors.centerIn: parent; font.pointSize: 24; text: "Vehicle Summary" } + } + + Text { width: parent.width; height: parent.height - header.height - footer.height; + anchors.top: header.bottom + color: "white" + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + text: "No vehicle currently connected. Vehicle Setup is only available while vehicle is connected." } + + Rectangle { id: footer; anchors.bottom: parent.bottom; color: "lightblue"; radius: 10.0; width: parent.width; height: titleText.height + 20; opacity: 0.8; + + Button { id: firmwareButton; objectName: "firmwareButton"; + anchors.horizontalCenter: parent.horizontalCenter; anchors.verticalCenter: parent.verticalCenter; + text: "Firmware Upgrade" + } + } + } +} diff --git a/src/VehicleSetup/SetupWidgetHolder.cc b/src/VehicleSetup/SetupWidgetHolder.cc new file mode 100644 index 000000000..4e7e58c0e --- /dev/null +++ b/src/VehicleSetup/SetupWidgetHolder.cc @@ -0,0 +1,19 @@ +#include "SetupWidgetHolder.h" +#include "ui_SetupWidgetHolder.h" + +SetupWidgetHolder::SetupWidgetHolder(QWidget *parent) : + QDialog(parent), + ui(new Ui::SetupWidgetHolder) +{ + ui->setupUi(this); +} + +SetupWidgetHolder::~SetupWidgetHolder() +{ + delete ui; +} + +void SetupWidgetHolder::setInnerWidget(QWidget* widget) +{ + ui->setupWidgetLayout->addWidget(widget); +} diff --git a/src/VehicleSetup/SetupWidgetHolder.h b/src/VehicleSetup/SetupWidgetHolder.h new file mode 100644 index 000000000..be2f3f2d1 --- /dev/null +++ b/src/VehicleSetup/SetupWidgetHolder.h @@ -0,0 +1,24 @@ +#ifndef SETUPWIDGETHOLDER_H +#define SETUPWIDGETHOLDER_H + +#include + +namespace Ui { +class SetupWidgetHolder; +} + +class SetupWidgetHolder : public QDialog +{ + Q_OBJECT + +public: + explicit SetupWidgetHolder(QWidget *parent = 0); + ~SetupWidgetHolder(); + + void setInnerWidget(QWidget* widget); + +private: + Ui::SetupWidgetHolder *ui; +}; + +#endif // SETUPWIDGETHOLDER_H diff --git a/src/VehicleSetup/SetupWidgetHolder.ui b/src/VehicleSetup/SetupWidgetHolder.ui new file mode 100644 index 000000000..05e3a0b9b --- /dev/null +++ b/src/VehicleSetup/SetupWidgetHolder.ui @@ -0,0 +1,40 @@ + + + SetupWidgetHolder + + + + 0 + 0 + 400 + 300 + + + + Form + + + true + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + diff --git a/src/ui/px4_configuration/PX4FirmwareUpgrade.ui b/src/ui/px4_configuration/PX4FirmwareUpgrade.ui index ad460b87d..048eceb77 100644 --- a/src/ui/px4_configuration/PX4FirmwareUpgrade.ui +++ b/src/ui/px4_configuration/PX4FirmwareUpgrade.ui @@ -2,17 +2,35 @@ PX4FirmwareUpgrade + + Qt::ApplicationModal + 0 0 - 1562 - 1286 + 727 + 527 + + + 0 + 0 + + + + + 727 + 527 + + Form + + 1.000000000000000 + diff --git a/src/ui/px4_configuration/PX4RCCalibration.ui b/src/ui/px4_configuration/PX4RCCalibration.ui index a2231c6d9..2babb5fea 100644 --- a/src/ui/px4_configuration/PX4RCCalibration.ui +++ b/src/ui/px4_configuration/PX4RCCalibration.ui @@ -6,16 +6,22 @@ 0 0 - 831 - 1286 + 720 + 501 - + 0 0 + + + 720 + 501 + + Form diff --git a/src/ui/px4_configuration/QGCPX4AirframeConfig.ui b/src/ui/px4_configuration/QGCPX4AirframeConfig.ui index 4bb1c874d..0194fc072 100644 --- a/src/ui/px4_configuration/QGCPX4AirframeConfig.ui +++ b/src/ui/px4_configuration/QGCPX4AirframeConfig.ui @@ -6,10 +6,22 @@ 0 0 - 803 - 416 + 802 + 471 + + + 0 + 0 + + + + + 802 + 471 + + Form @@ -39,9 +51,9 @@ 0 - -282 - 762 - 638 + 0 + 761 + 611 diff --git a/src/ui/px4_configuration/QGCPX4SensorCalibration.cc b/src/ui/px4_configuration/QGCPX4SensorCalibration.cc index 57aa46aec..2107f1dc2 100644 --- a/src/ui/px4_configuration/QGCPX4SensorCalibration.cc +++ b/src/ui/px4_configuration/QGCPX4SensorCalibration.cc @@ -258,7 +258,9 @@ void QGCPX4SensorCalibration::setInstructionImage(const QString &path) void QGCPX4SensorCalibration::setAutopilotImage(int index) { - setAutopilotImage(QString(":/files/images/px4/calibration/pixhawk_%1.png").arg(index, 2, 10, QChar('0'))); + Q_UNUSED(index); + // FIXME: This was referencing a non-existent png. Need to figure out what this was trying to do. + //setAutopilotImage(QString(":/files/images/px4/calibration/pixhawk_%1.png").arg(index, 2, 10, QChar('0'))); } void QGCPX4SensorCalibration::setGpsImage(int index) -- 2.22.0