diff --git a/files/styles/style-indoor.css b/files/styles/style-indoor.css index 301738be345f6d33d1182961dc3bb6bd3d414af6..595fcf8d740203c338d95261b2e7ffc5fadbe24e 100644 --- a/files/styles/style-indoor.css +++ b/files/styles/style-indoor.css @@ -178,8 +178,8 @@ QDoubleSpinBox::down-button { } QPushButton { - min-height: 20px; - max-height: 20px; + /*min-height: 20px;*/ + /*max-height: 20px;*/ border: 1px solid #465158; margin: 1px; border-radius: 2px; diff --git a/files/styles/style-outdoor.css b/files/styles/style-outdoor.css index c153f62f2d0ac6ae45e41bb8fa2747aa38637e50..e6893c6d88f1f0dec1d7fbad48574f76895a7fee 100644 --- a/files/styles/style-outdoor.css +++ b/files/styles/style-outdoor.css @@ -184,8 +184,8 @@ QDoubleSpinBox::down-button { QPushButton { font-weight: bold; - min-height: 18px; - max-height: 18px; + /*min-height: 18px;*/ + /*max-height: 18px;*/ border: 2px solid #4A4A4F; border-radius: 5px; padding-left: 10px; diff --git a/src/ui/QGCVehicleConfig.cc b/src/ui/QGCVehicleConfig.cc index 181daba3eaf0341cc327a48555867624dedd183c..2c68c6afa505f7dacd25a61bbb6e891daf97e1ab 100644 --- a/src/ui/QGCVehicleConfig.cc +++ b/src/ui/QGCVehicleConfig.cc @@ -45,6 +45,12 @@ QGCVehicleConfig::QGCVehicleConfig(QWidget *parent) : setObjectName("QGC_VEHICLECONFIG"); ui->setupUi(this); + connect(ui->rcMenuButton,SIGNAL(clicked()),this,SLOT(rcMenuButtonClicked())); + connect(ui->sensorMenuButton,SIGNAL(clicked()),this,SLOT(sensorMenuButtonClicked())); + connect(ui->generalMenuButton,SIGNAL(clicked()),this,SLOT(generalMenuButtonClicked())); + connect(ui->advancedMenuButton,SIGNAL(clicked()),this,SLOT(advancedMenuButtonClicked())); + + requestCalibrationRC(); if (mav) mav->requestParameter(0, "RC_TYPE"); @@ -90,6 +96,25 @@ QGCVehicleConfig::QGCVehicleConfig(QWidget *parent) : connect(&updateTimer, SIGNAL(timeout()), this, SLOT(updateView())); updateTimer.start(); } +void QGCVehicleConfig::rcMenuButtonClicked() +{ + ui->stackedWidget->setCurrentIndex(0); +} + +void QGCVehicleConfig::sensorMenuButtonClicked() +{ + ui->stackedWidget->setCurrentIndex(1); +} + +void QGCVehicleConfig::generalMenuButtonClicked() +{ + ui->stackedWidget->setCurrentIndex(ui->stackedWidget->count()-2); +} + +void QGCVehicleConfig::advancedMenuButtonClicked() +{ + ui->stackedWidget->setCurrentIndex(ui->stackedWidget->count()-1); +} QGCVehicleConfig::~QGCVehicleConfig() { @@ -249,8 +274,18 @@ void QGCVehicleConfig::loadQgcConfig(bool primary) //Load tabs for general configuration foreach (QString dir,generaldir.entryList(QDir::Dirs | QDir::NoDotAndDotDot)) { - QWidget *tab = new QWidget(ui->tabWidget); - ui->tabWidget->insertTab(2,tab,dir); + QPushButton *button = new QPushButton(ui->scrollAreaWidgetContents_3); + connect(button,SIGNAL(clicked()),this,SLOT(menuButtonClicked())); + ui->navBarLayout->insertWidget(2,button); + button->setMinimumHeight(100); + button->setMinimumWidth(100); + button->show(); + button->setText(dir); + //QWidget *tab = new QWidget(ui->tabWidget); + //ui->tabWidget->insertTab(2,tab,dir); + QWidget *tab = new QWidget(ui->stackedWidget); + ui->stackedWidget->insertWidget(2,tab); + buttonToWidgetMap[button] = tab; tab->setLayout(new QVBoxLayout()); tab->show(); QScrollArea *area = new QScrollArea(); @@ -285,8 +320,20 @@ void QGCVehicleConfig::loadQgcConfig(bool primary) //Load tabs for vehicle specific configuration foreach (QString dir,vehicledir.entryList(QDir::Dirs | QDir::NoDotAndDotDot)) { - QWidget *tab = new QWidget(ui->tabWidget); - ui->tabWidget->insertTab(2,tab,dir); + //QWidget *tab = new QWidget(ui->tabWidget); + //ui->tabWidget->insertTab(2,tab,dir); + QPushButton *button = new QPushButton(ui->scrollAreaWidgetContents_3); + connect(button,SIGNAL(clicked()),this,SLOT(menuButtonClicked())); + ui->navBarLayout->insertWidget(2,button); + + QWidget *tab = new QWidget(ui->stackedWidget); + ui->stackedWidget->insertWidget(2,tab); + buttonToWidgetMap[button] = tab; + + button->setMinimumHeight(100); + button->setMinimumWidth(100); + button->show(); + button->setText(dir); tab->setLayout(new QVBoxLayout()); tab->show(); QScrollArea *area = new QScrollArea(); @@ -358,6 +405,19 @@ void QGCVehicleConfig::loadQgcConfig(bool primary) ui->sensorTips->setHtml(sensortipsfile.readAll()); sensortipsfile.close(); } +void QGCVehicleConfig::menuButtonClicked() +{ + QPushButton *button = qobject_cast(sender()); + if (!button) + { + return; + } + if (buttonToWidgetMap.contains(button)) + { + ui->stackedWidget->setCurrentWidget(buttonToWidgetMap[button]); + } + +} void QGCVehicleConfig::loadConfig() { diff --git a/src/ui/QGCVehicleConfig.h b/src/ui/QGCVehicleConfig.h index 242c11b20233cda7c2d3523db943b266ace17feb..44e864b155274f6cbf79b4d7f92c4b59ebea31b0 100644 --- a/src/ui/QGCVehicleConfig.h +++ b/src/ui/QGCVehicleConfig.h @@ -5,6 +5,7 @@ #include #include #include +#include #include "QGCToolWidget.h" #include "UASInterface.h" @@ -29,6 +30,11 @@ public: }; public slots: + void rcMenuButtonClicked(); + void sensorMenuButtonClicked(); + void generalMenuButtonClicked(); + void advancedMenuButtonClicked(); + /** Set the MAV currently being calibrated */ void setActiveUAS(UASInterface* active); /** Fallback function, automatically called by loadConfig() upon failure to find and xml file*/ @@ -125,6 +131,7 @@ public slots: } protected slots: + void menuButtonClicked(); /** Reset the RC calibration */ void resetCalibrationRC(); /** Write the RC calibration */ @@ -183,7 +190,7 @@ protected: private: Ui::QGCVehicleConfig *ui; - + QMap buttonToWidgetMap; signals: void visibilityChanged(bool visible); }; diff --git a/src/ui/QGCVehicleConfig.ui b/src/ui/QGCVehicleConfig.ui index 9e3fccb66804c109c32a8262e2d7554c668dce25..e2cb8c8364cb14840983e36cb15e3ff64e1837dc 100644 --- a/src/ui/QGCVehicleConfig.ui +++ b/src/ui/QGCVehicleConfig.ui @@ -6,8 +6,8 @@ 0 0 - 774 - 846 + 1151 + 602 @@ -19,1057 +19,1077 @@ Form - - - 6 - + - - - false + + + + 125 + 0 + - - - 0 - 0 - + + + 125 + 16777215 + - - 3 + + true - - - - 0 - 0 - + + + + 0 + 0 + 123 + 582 + - - RC Calibration - - - - 20 - - - - - 0 - - - 100 - - - 0 - - - Qt::Vertical - - - - - - - Qt::Vertical - - - - 598 - 5 - - - - - - - - 0 - - - 100 - - - 0 - - - Qt::Vertical - - - - - - - 0 - - - 100 - - - Qt::Vertical + + + + + QLayout::SetMinAndMaxSize - - - - - - - - false - - - false - - - - Select transmitter model - - - - - - - false - - - - Mode 1 - - - - - Mode 2 - - - - - Mode 3 - - - - - Mode 4 - - - - - - - - - - Qt::Horizontal - - - - 22 - 122 - - - - - - - - Qt::Vertical - - - QSizePolicy::MinimumExpanding - - - - 20 - 10 - - - - - - - - - - - - - - - Qt::Vertical - - - - 598 - 17 - - - - - - - - Set Trim - - - - - - - - - - :/files/images/rc_stick.svg - - - true - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 1 - 1 - - - - - 10 - 10 - - - - - 100 - 100 - - - - - - - :/files/images/rc_stick.svg - - - true - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - 0 - - - 100 - - - Qt::Vertical - - - - - - - 0 - - - 100 - - - Qt::Vertical - - - - - - - 0 - - - 100 - - - Qt::Vertical - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - 0 - - - 100 - - - 0 - - - Qt::Horizontal - - - - - - - 0 - - - 100 - - - 0 - - - Qt::Horizontal - - - - - - - Start Calibration - - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Aux 3 - - - - - - - 0000 - - - Qt::AlignCenter - - - - - - - 0000 - - - Qt::AlignCenter - - - - - - - Pitch / Elevator - - - - - - - 0000 - - - Qt::AlignCenter - - - - - - - Aux 2 - - - - - - - Qt::Horizontal - - + + - 40 - 20 + 100 + 100 - - - - - - 0000 - - - Qt::AlignCenter - - - - - - - false - - - Invert - - - - - - - 1 - - - 8 - - - - - - - 1 - - - 8 - - - - - - - Qt::Horizontal - - + - 40 - 20 + 100 + 100 - - - - - - Throttle - - - - - - - Invert - - - - - - - 1 - - - 8 - - - - - - - 1 - - - 8 - - - - - - - Mode Switch - - - - - - - 0000 - - - Qt::AlignCenter - - - - - - - 1 - - - 8 - - - - - - - 1 - - - 8 - - - - - - Aux 1 + RC +Calibration - - - - 1 + + + + + 100 + 100 + - - 8 + + + 100 + 100 + - - - - - 0000 - - - Qt::AlignCenter - - - - - - - 1 - - - 8 + Sensor +Calibration - - - - Roll / Ailerons + + + + + 100 + 100 + - - - - - - false + + + 100 + 100 + - Invert + General +Config - - - - false + + + + + 100 + 100 + - - Invert + + + 100 + 100 + - - - - - Invert + Advanced +Config - - + + + + + + + + + + + + 0 + + + + + - 0000 - - - Qt::AlignCenter + RC Calibration - - - - Invert - - + + + + + + false + + + false + + + + Select transmitter model + + + + + + + + true + + + + Mode 1 + + + + + Mode 2 + + + + + Mode 3 + + + + + Mode 4 + + + + + - - + + - Qt::Horizontal + Qt::Vertical - 40 - 20 + 20 + 40 - - - - Yaw / Rudder - - + + + + + + 0000 + + + Qt::AlignCenter + + + + + + + Invert + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Yaw / Rudder + + + + + + + 0000 + + + Qt::AlignCenter + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Invert + + + + + + + Invert + + + + + + + 1 + + + 8 + + + + + + + 0000 + + + Qt::AlignCenter + + + + + + + 0000 + + + Qt::AlignCenter + + + + + + + Pitch / Elevator + + + + + + + 0000 + + + Qt::AlignCenter + + + + + + + Aux 2 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + 0000 + + + Qt::AlignCenter + + + + + + + Invert + + + + + + + 1 + + + 8 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Throttle + + + + + + + Invert + + + + + + + 1 + + + 8 + + + + + + + 1 + + + 8 + + + + + + + Mode Switch + + + + + + + 0000 + + + Qt::AlignCenter + + + + + + + 1 + + + 8 + + + + + + + 1 + + + 8 + + + + + + + Aux 1 + + + + + + + 1 + + + 8 + + + + + + + 0000 + + + Qt::AlignCenter + + + + + + + Aux 3 + + + + + + + Invert + + + + + + + 1 + + + 8 + + + + + + + Invert + + + + + + + Invert + + + + + + + Roll / Ailerons + + + + - - - - 0000 - - - Qt::AlignCenter - - + + + + + + + + + 200 + 200 + + + + + + + :/files/images/rc_stick.svg + + + true + + + Qt::AlignCenter + + + + + + + 0 + + + 100 + + + 0 + + + Qt::Horizontal + + + + + + + 0 + + + 100 + + + 0 + + + Qt::Vertical + + + + + + + + + + + + 1 + 1 + + + + + 200 + 200 + + + + + 10 + 10 + + + + + 100 + 100 + + + + + + + :/files/images/rc_stick.svg + + + true + + + Qt::AlignCenter + + + + + + + 0 + + + 100 + + + 0 + + + Qt::Horizontal + + + + + + + 0 + + + 100 + + + 0 + + + Qt::Vertical + + + + + + + + + + + + + 0 + + + 100 + + + Qt::Vertical + + + + + + + 0 + + + 100 + + + Qt::Vertical + + + + + + + 0 + + + 100 + + + Qt::Vertical + + + + + + + 0 + + + 100 + + + Qt::Vertical + + + + + + + + + + + Start Calibration + + + + + + + Set Trim + + + + + + + + - - + + - Qt::Horizontal + Qt::Vertical - 40 - 20 + 20 + 40 - - - - Invert - - - - - - - false - - - Invert - - - - - - - - - - 0 - 0 - - - - Sensor Calibration - - - - + + + - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:8pt;"><br /></p></body></html> + + + Sensor Calibration - + - - - true + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p></body></html> - - - - 0 - 0 - 362 - 489 - - - - - - - - + + + + + + true + + + + + 0 + 0 + 314 + 508 + + + + + + + + + + + + - - - - - - - 0 - 0 - - - - General Config - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - + + + - - - false + + + General Config - - - false - - - Load Platform Defaults - - + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + Load Platform Defaults + + + + - - - - - - - Configuration - - - - 0 - - - - - true + + + + + Configuration + + + + 0 - - - - 0 - 0 - 356 - 438 - - - - - 0 + + + + true - - - - - - - - - - - - - - Configuration - - - - 0 - - - - - true + + + + 0 + 0 + 314 + 434 + + + + + 0 + + + + + + + + + + + + + + + Configuration + + + + 0 - - - - 0 - 0 - 356 - 438 - - - - - 0 + + + + true - - - - - - - - - + + + + 0 + 0 + 313 + 434 + + + + + 0 + + + + + + + + + + + + - - - - - - - 0 - 0 - - - - Advanced Config - - - - + + + - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - false + + + Advanced Config - - - false - - - Load Platform Defaults - - + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + Load Platform Defaults + + + + - - - - - - - - 0 - 0 - - - - Configuration - - - - QLayout::SetNoConstraint - - - 0 - - - - - true + + + + + Configuration + + + + 0 - - - - 0 - 0 - 356 - 438 - - - - - 0 - 0 - - - - - 0 + + + + true - - - + + + + 0 + 0 + 161 + 446 + + + + 0 + + + - - - - - - - - - - - - - 0 - 0 - - - - Configuration - - - - 0 - - - - - true + + + + + + + + + + Configuration + + + + 0 - - - - 0 - 0 - 356 - 438 - - - - - 0 - 0 - - - - - 0 + + + + true - - - - - - - - - + + + + 0 + 0 + 160 + 446 + + + + + 0 + + + + + + + + + + + + + + + + + + + + + No pending changes + + + + + + + Store to EEPROM + + - - + + + + + + + Qt::Horizontal + + + + 40 + 20 + + +