diff --git a/ground/gcs/src/plugins/config/config.pro b/ground/gcs/src/plugins/config/config.pro index 4dc77156d..5abce9edb 100644 --- a/ground/gcs/src/plugins/config/config.pro +++ b/ground/gcs/src/plugins/config/config.pro @@ -25,8 +25,7 @@ HEADERS += \ configccattitudewidget.h \ configstabilizationwidget.h \ assertions.h \ - defaultattitudewidget.h \ - defaulthwsettingswidget.h \ + defaultconfigwidget.h \ channelform.h \ inputchannelform.h \ configcamerastabilizationwidget.h \ @@ -74,8 +73,7 @@ SOURCES += \ config_cc_hw_widget.cpp \ configccattitudewidget.cpp \ configstabilizationwidget.cpp \ - defaultattitudewidget.cpp \ - defaulthwsettingswidget.cpp \ + defaultconfigwidget.cpp \ channelform.cpp \ inputchannelform.cpp \ configcamerastabilizationwidget.cpp \ @@ -118,8 +116,7 @@ FORMS += \ input_wizard.ui \ output.ui \ ccattitude.ui \ - defaultattitude.ui \ - defaulthwsettings.ui \ + defaultconfig.ui \ inputchannelform.ui \ camerastabilization.ui \ outputchannelform.ui \ diff --git a/ground/gcs/src/plugins/config/configgadgetwidget.cpp b/ground/gcs/src/plugins/config/configgadgetwidget.cpp index 92208069b..8b6340a61 100644 --- a/ground/gcs/src/plugins/config/configgadgetwidget.cpp +++ b/ground/gcs/src/plugins/config/configgadgetwidget.cpp @@ -41,8 +41,7 @@ #include "configrevowidget.h" #include "configrevonanohwwidget.h" #include "configsparky2hwwidget.h" -#include "defaultattitudewidget.h" -#include "defaulthwsettingswidget.h" +#include "defaultconfigwidget.h" #include #include @@ -56,7 +55,7 @@ #include #include -#define ALWAYS_SHOW_OPLM 1 +#define OPLINK_TIMEOUT 2000 ConfigGadgetWidget::ConfigGadgetWidget(QWidget *parent) : QWidget(parent) { @@ -78,7 +77,7 @@ ConfigGadgetWidget::ConfigGadgetWidget(QWidget *parent) : QWidget(parent) icon = new QIcon(); icon->addFile(":/configgadget/images/hardware_normal.png", QSize(), QIcon::Normal, QIcon::Off); icon->addFile(":/configgadget/images/hardware_selected.png", QSize(), QIcon::Selected, QIcon::Off); - widget = new DefaultHwSettingsWidget(this); + widget = new DefaultConfigWidget(this, tr("Hardware")); stackWidget->insertTab(ConfigGadgetWidget::Hardware, widget, *icon, QString("Hardware")); icon = new QIcon(); @@ -105,7 +104,7 @@ ConfigGadgetWidget::ConfigGadgetWidget(QWidget *parent) : QWidget(parent) icon = new QIcon(); icon->addFile(":/configgadget/images/ins_normal.png", QSize(), QIcon::Normal, QIcon::Off); icon->addFile(":/configgadget/images/ins_selected.png", QSize(), QIcon::Selected, QIcon::Off); - widget = new DefaultAttitudeWidget(this); + widget = new DefaultConfigWidget(this, tr("Attitude")); stackWidget->insertTab(ConfigGadgetWidget::Sensors, widget, *icon, QString("Attitude")); icon = new QIcon(); @@ -129,14 +128,11 @@ ConfigGadgetWidget::ConfigGadgetWidget(QWidget *parent) : QWidget(parent) static_cast(widget)->bind(); stackWidget->insertTab(ConfigGadgetWidget::TxPid, widget, *icon, QString("TxPID")); -#ifdef ALWAYS_SHOW_OPLM icon = new QIcon(); icon->addFile(":/configgadget/images/pipx-normal.png", QSize(), QIcon::Normal, QIcon::Off); icon->addFile(":/configgadget/images/pipx-selected.png", QSize(), QIcon::Selected, QIcon::Off); - widget = new ConfigOPLinkWidget(this); - static_cast(widget)->bind(); + widget = new DefaultConfigWidget(this, tr("OPLink Configuration")); stackWidget->insertTab(ConfigGadgetWidget::OPLink, widget, *icon, QString("OPLink")); -#endif stackWidget->setCurrentIndex(ConfigGadgetWidget::Hardware); @@ -232,10 +228,10 @@ void ConfigGadgetWidget::onAutopilotDisconnect() qDebug() << "ConfigGadgetWidget::onAutopilotDiconnect"; QWidget *widget; - widget = new DefaultAttitudeWidget(this); + widget = new DefaultConfigWidget(this, tr("Attitude")); stackWidget->replaceTab(ConfigGadgetWidget::Sensors, widget); - widget = new DefaultHwSettingsWidget(this); + widget = new DefaultConfigWidget(this, tr("Hardware")); stackWidget->replaceTab(ConfigGadgetWidget::Hardware, widget); } @@ -243,34 +239,22 @@ void ConfigGadgetWidget::onOPLinkConnect() { qDebug() << "ConfigGadgetWidget::onOPLinkConnect"; -#ifndef ALWAYS_SHOW_OPLM - ConfigTaskWidget *widget; - QIcon *icon; - - icon = new QIcon(); - icon->addFile(":/configgadget/images/pipx-normal.png", QSize(), QIcon::Normal, QIcon::Off); - icon->addFile(":/configgadget/images/pipx-selected.png", QSize(), QIcon::Selected, QIcon::Off); - widget = new ConfigOPLinkWidget(this); + ConfigTaskWidget *widget = new ConfigOPLinkWidget(this); widget->bind(); - stackWidget->insertTab(ConfigGadgetWidget::OPLink, widget, *icon, QString("OPLink")); -#endif + stackWidget->replaceTab(ConfigGadgetWidget::OPLink, widget); } void ConfigGadgetWidget::onOPLinkDisconnect() { qDebug() << "ConfigGadgetWidget::onOPLinkDisconnect"; -#ifndef ALWAYS_SHOW_OPLM - if (stackWidget->currentIndex() == ConfigGadgetWidget::OPLink) { - stackWidget->setCurrentIndex(0); - } - stackWidget->removeTab(ConfigGadgetWidget::OPLink); -#endif + QWidget *widget = new DefaultConfigWidget(this, tr("OPLink Configuration")); + stackWidget->replaceTab(ConfigGadgetWidget::OPLink, widget); } -void ConfigGadgetWidget::tabAboutToChange(int i, bool *proceed) +void ConfigGadgetWidget::tabAboutToChange(int index, bool *proceed) { - Q_UNUSED(i); + Q_UNUSED(index); *proceed = true; ConfigTaskWidget *wid = qobject_cast(stackWidget->currentWidget()); if (!wid) { diff --git a/ground/gcs/src/plugins/config/configgadgetwidget.h b/ground/gcs/src/plugins/config/configgadgetwidget.h index 9d951e6b4..d52add1c8 100644 --- a/ground/gcs/src/plugins/config/configgadgetwidget.h +++ b/ground/gcs/src/plugins/config/configgadgetwidget.h @@ -52,7 +52,7 @@ private slots: void onAutopilotDisconnect(); void onOPLinkConnect(); void onOPLinkDisconnect(); - void tabAboutToChange(int i, bool *); + void tabAboutToChange(int index, bool *proceed); private: MyTabbedStackWidget *stackWidget; diff --git a/ground/gcs/src/plugins/config/defaultattitude.ui b/ground/gcs/src/plugins/config/defaultattitude.ui deleted file mode 100644 index 06676035e..000000000 --- a/ground/gcs/src/plugins/config/defaultattitude.ui +++ /dev/null @@ -1,77 +0,0 @@ - - - defaultattitude - - - - 0 - 0 - 400 - 300 - - - - Form - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - <!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=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:11pt; font-weight:600;">Attitude Calibration</span></p> -<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:'Ubuntu'; font-size:11pt; font-weight:600;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:11pt;">This panel will be updated to provide the relevant controls to let you calibrate your flight controller, depending on the board which is detected once telemetry is connected and running.</span></p> -<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:'Ubuntu'; font-size:11pt;"><br /></p></body></html> - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - diff --git a/ground/gcs/src/plugins/config/defaultconfig.ui b/ground/gcs/src/plugins/config/defaultconfig.ui new file mode 100644 index 000000000..979b8bc72 --- /dev/null +++ b/ground/gcs/src/plugins/config/defaultconfig.ui @@ -0,0 +1,267 @@ + + + defaultconfig + + + + 0 + 0 + 646 + 596 + + + + Form + + + + + + 0 + + + + <place holder - do not translate> + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + 255 + 255 + 255 + + + + + + + 232 + 232 + 232 + + + + + + + + + 255 + 255 + 255 + + + + + + + 232 + 232 + 232 + + + + + + + + + 232 + 232 + 232 + + + + + + + 232 + 232 + 232 + + + + + + + + QFrame::NoFrame + + + QFrame::Plain + + + true + + + + + 0 + 0 + 622 + 519 + + + + + 12 + + + 12 + + + 12 + + + 12 + + + + + Qt::Vertical + + + + 20 + 25 + + + + + + + + + 0 + 0 + + + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff + + + QAbstractScrollArea::AdjustToContents + + + QTextEdit::WidgetWidth + + + <!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=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">This panel will be updated to provide the relevant controls to let you configure your device once it is connected and running.</span></p></body></html> + + + + + + + + + + + + + + + 4 + + + + + Qt::Horizontal + + + + 369 + 20 + + + + + + + + + 0 + 0 + + + + + 25 + 25 + + + + + 25 + 25 + + + + Takes you to the wiki page + + + + + + + :/core/images/helpicon.svg:/core/images/helpicon.svg + + + + 25 + 25 + + + + true + + + + + + + Apply + + + + + + + Save + + + + + + + + + + + + diff --git a/ground/gcs/src/plugins/config/defaultattitudewidget.cpp b/ground/gcs/src/plugins/config/defaultconfigwidget.cpp similarity index 75% rename from ground/gcs/src/plugins/config/defaultattitudewidget.cpp rename to ground/gcs/src/plugins/config/defaultconfigwidget.cpp index 59ef9ba52..be8a8b315 100644 --- a/ground/gcs/src/plugins/config/defaultattitudewidget.cpp +++ b/ground/gcs/src/plugins/config/defaultconfigwidget.cpp @@ -24,22 +24,25 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "defaultattitudewidget.h" +#include "defaultconfigwidget.h" -#include "ui_defaultattitude.h" +#include "ui_defaultconfig.h" -#include -#include -#include - -DefaultAttitudeWidget::DefaultAttitudeWidget(QWidget *parent) : +DefaultConfigWidget::DefaultConfigWidget(QWidget *parent, QString title) : QWidget(parent), - ui(new Ui_defaultattitude) + ui(new Ui_defaultconfig) { ui->setupUi(this); + + ui->tabWidget->setTabText(0, title); + + ui->helpButton->setEnabled(false); + ui->saveButton->setEnabled(false); + ui->applyButton->setVisible(false); + ui->applyButton->setEnabled(false); } -DefaultAttitudeWidget::~DefaultAttitudeWidget() +DefaultConfigWidget::~DefaultConfigWidget() { delete ui; } diff --git a/ground/gcs/src/plugins/config/defaultattitudewidget.h b/ground/gcs/src/plugins/config/defaultconfigwidget.h similarity index 80% rename from ground/gcs/src/plugins/config/defaultattitudewidget.h rename to ground/gcs/src/plugins/config/defaultconfigwidget.h index c98ccad15..bd0e35713 100644 --- a/ground/gcs/src/plugins/config/defaultattitudewidget.h +++ b/ground/gcs/src/plugins/config/defaultconfigwidget.h @@ -24,24 +24,22 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef DEFAULTATTITUDEWIDGET_H -#define DEFAULTATTITUDEWIDGET_H +#ifndef DEFAULTCONFIGWIDGET_H +#define DEFAULTCONFIGWIDGET_H #include -class Ui_defaultattitude; +class Ui_defaultconfig; -class DefaultAttitudeWidget : public QWidget { +class DefaultConfigWidget : public QWidget { Q_OBJECT public: - explicit DefaultAttitudeWidget(QWidget *parent = 0); - ~DefaultAttitudeWidget(); - -private slots: + explicit DefaultConfigWidget(QWidget *parent, QString title); + ~DefaultConfigWidget(); private: - Ui_defaultattitude *ui; + Ui_defaultconfig *ui; }; -#endif // DEFAULTATTITUDEWIDGET_H +#endif // DEFAULTCONFIGWIDGET_H diff --git a/ground/gcs/src/plugins/config/defaulthwsettings.ui b/ground/gcs/src/plugins/config/defaulthwsettings.ui deleted file mode 100644 index b4272ab22..000000000 --- a/ground/gcs/src/plugins/config/defaulthwsettings.ui +++ /dev/null @@ -1,80 +0,0 @@ - - - defaulthwsettings - - - - 0 - 0 - 400 - 300 - - - - Form - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - 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=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:11pt; font-weight:600;">Hardware Configuration</span></p> -<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:'Ubuntu'; font-size:11pt; font-weight:600;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:11pt;">This panel will be updated to provide the relevant controls to let you configure your hardware once telemetry is connected and running.</span></p> -<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:'Ubuntu'; font-size:11pt;"><br /></p></body></html> - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - diff --git a/ground/gcs/src/plugins/config/defaulthwsettingswidget.cpp b/ground/gcs/src/plugins/config/defaulthwsettingswidget.cpp deleted file mode 100644 index 8bc35228c..000000000 --- a/ground/gcs/src/plugins/config/defaulthwsettingswidget.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/** - ****************************************************************************** - * - * @file DefaultHwSettingsWidget.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @addtogroup GCSPlugins GCS Plugins - * @{ - * @addtogroup ConfigPlugin Config Plugin - * @{ - * @brief Placeholder for attitude panel until board is connected. - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include "defaulthwsettingswidget.h" - -#include "ui_defaulthwsettings.h" - -#include -#include -#include - -DefaultHwSettingsWidget::DefaultHwSettingsWidget(QWidget *parent) : - QWidget(parent), - ui(new Ui_defaulthwsettings) -{ - ui->setupUi(this); -} - -DefaultHwSettingsWidget::~DefaultHwSettingsWidget() -{ - delete ui; -} diff --git a/ground/gcs/src/plugins/config/defaulthwsettingswidget.h b/ground/gcs/src/plugins/config/defaulthwsettingswidget.h deleted file mode 100644 index 9294e455e..000000000 --- a/ground/gcs/src/plugins/config/defaulthwsettingswidget.h +++ /dev/null @@ -1,47 +0,0 @@ -/** - ****************************************************************************** - * - * @file defaultccattitudewidget.h - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @addtogroup GCSPlugins GCS Plugins - * @{ - * @addtogroup ConfigPlugin Config Plugin - * @{ - * @brief Placeholder for attitude settings widget until board connected. - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef DEFAULTHWSETTINGSt_H -#define DEFAULTHWSETTINGSt_H - -#include - -class Ui_defaulthwsettings; - -class DefaultHwSettingsWidget : public QWidget { - Q_OBJECT - -public: - explicit DefaultHwSettingsWidget(QWidget *parent = 0); - ~DefaultHwSettingsWidget(); - -private slots: - -private: - Ui_defaulthwsettings *ui; -}; - -#endif // DEFAULTHWSETTINGSt_H