From f930e8517528ca57bc6a6dd36585ffd4021a351f Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Tue, 20 Sep 2016 01:05:13 +0200 Subject: [PATCH] LP-245: config: all buttons (help, apply, save, ...) are now handled through autobinding --- ground/gcs/src/plugins/config/airframe.ui | 21 +++- ground/gcs/src/plugins/config/autotune.ui | 118 ++++++++++++++++-- .../src/plugins/config/camerastabilization.ui | 20 +-- .../gcs/src/plugins/config/cc_hw_settings.ui | 15 ++- ground/gcs/src/plugins/config/ccattitude.ui | 13 +- .../cfg_vehicletypes/configccpmwidget.cpp | 13 ++ .../cfg_vehicletypes/configccpmwidget.h | 2 + .../plugins/config/config_cc_hw_widget.cpp | 32 +---- .../src/plugins/config/config_cc_hw_widget.h | 11 +- .../configcamerastabilizationwidget.cpp | 7 +- .../config/configcamerastabilizationwidget.h | 3 +- .../plugins/config/configccattitudewidget.cpp | 19 +-- .../plugins/config/configccattitudewidget.h | 5 +- .../src/plugins/config/configinputwidget.cpp | 31 ++--- .../src/plugins/config/configinputwidget.h | 4 +- .../src/plugins/config/configoplinkwidget.cpp | 3 - .../src/plugins/config/configoutputwidget.cpp | 18 +-- .../src/plugins/config/configoutputwidget.h | 1 - .../src/plugins/config/configrevohwwidget.cpp | 16 +-- .../src/plugins/config/configrevohwwidget.h | 1 - .../src/plugins/config/configrevohwwidget.ui | 21 +++- .../plugins/config/configrevonanohwwidget.cpp | 16 +-- .../plugins/config/configrevonanohwwidget.h | 1 - .../plugins/config/configrevonanohwwidget.ui | 17 ++- .../src/plugins/config/configrevowidget.cpp | 35 ++---- .../gcs/src/plugins/config/configrevowidget.h | 4 +- .../plugins/config/configsparky2hwwidget.cpp | 16 +-- .../plugins/config/configsparky2hwwidget.h | 1 - .../plugins/config/configsparky2hwwidget.ui | 23 ++-- .../config/configstabilizationwidget.cpp | 14 +-- .../config/configstabilizationwidget.h | 5 +- .../src/plugins/config/configtxpidwidget.cpp | 83 ++++++------ .../src/plugins/config/configtxpidwidget.h | 9 +- .../config/configvehicletypewidget.cpp | 20 +-- .../plugins/config/configvehicletypewidget.h | 1 - ground/gcs/src/plugins/config/input.ui | 37 +++--- ground/gcs/src/plugins/config/oplink.ui | 20 +-- ground/gcs/src/plugins/config/output.ui | 21 +++- ground/gcs/src/plugins/config/revosensors.ui | 87 ++++++------- .../gcs/src/plugins/config/stabilization.ui | 32 ++--- ground/gcs/src/plugins/config/txpid.ui | 22 ++-- .../uavobjectwidgetutils/configtaskwidget.cpp | 67 ++++------ .../uavobjectwidgetutils/configtaskwidget.h | 19 +-- .../uavobjectwidgetutils/smartsavebutton.cpp | 7 -- .../uavobjectwidgetutils/smartsavebutton.h | 1 - 45 files changed, 467 insertions(+), 465 deletions(-) diff --git a/ground/gcs/src/plugins/config/airframe.ui b/ground/gcs/src/plugins/config/airframe.ui index 92353fbd4..8f4449393 100644 --- a/ground/gcs/src/plugins/config/airframe.ui +++ b/ground/gcs/src/plugins/config/airframe.ui @@ -218,7 +218,7 @@ - + 0 @@ -250,26 +250,35 @@ true + + button:help + - + Send to board, but don't save permanently (flash or SD). Apply + + button:apply + - + Applies and Saves all settings to flash or SD depending on board. Save + + button:save + @@ -287,9 +296,9 @@ nameEdit vehicleSetupWizardButton - airframeHelp - saveAircraftToRAM - saveAircraftToSD + helpButton + applyButton + saveButton diff --git a/ground/gcs/src/plugins/config/autotune.ui b/ground/gcs/src/plugins/config/autotune.ui index 595096a2c..e890b48ee 100644 --- a/ground/gcs/src/plugins/config/autotune.ui +++ b/ground/gcs/src/plugins/config/autotune.ui @@ -23,7 +23,16 @@ 6 - + + 12 + + + 12 + + + 12 + + 12 @@ -36,11 +45,38 @@ Pre-Autotune - + + 12 + + + 12 + + + 12 + + 12 + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + QFrame::StyledPanel @@ -51,9 +87,9 @@ <!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;"> +</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"> <p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Lucida Grande'; font-size:20pt; font-weight:600; color:#ff0000;">WARNING:</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:'Lucida Grande'; font-size:13pt;"></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:'Lucida Grande'; font-size:13pt;"><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:'Lucida Grande'; font-size:13pt;"><br /></span></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:'Lucida Grande'; font-size:13pt;"><br /></span></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:'Lucida Grande'; font-size:13pt;">This is an experimental plugin for the GCS that is going to make your aircraft shake, etc, so test with lots of space and be </span><span style=" font-family:'Lucida Grande'; font-size:13pt; font-weight:600;">very very wary</span><span style=" font-family:'Lucida Grande'; font-size:13pt;"> for it creating bad tuning values.  Basically there is no reason to think this will work at all.<br /><br />To use autotuning, here are the steps:<br /></span></p> @@ -99,7 +135,16 @@ p, li { white-space: pre-wrap; } Autotune Setup - + + 0 + + + 0 + + + 0 + + 0 @@ -182,8 +227,8 @@ p, li { white-space: pre-wrap; } 0 0 - 709 - 605 + 526 + 510 @@ -199,7 +244,16 @@ p, li { white-space: pre-wrap; } 12 - + + 12 + + + 12 + + + 12 + + 12 @@ -601,7 +655,45 @@ will alter settings for the next autotuning flight - + + + + 0 + 0 + + + + + 25 + 25 + + + + + 25 + 25 + + + + + + + + :/core/images/helpicon.svg:/core/images/helpicon.svg + + + + 25 + 25 + + + + button:help + + + + + 0 @@ -627,7 +719,7 @@ Useful if you have accidentally changed some settings. - + 0 @@ -651,7 +743,7 @@ Useful if you have accidentally changed some settings. - + 0 @@ -678,6 +770,8 @@ Useful if you have accidentally changed some settings. - + + + diff --git a/ground/gcs/src/plugins/config/camerastabilization.ui b/ground/gcs/src/plugins/config/camerastabilization.ui index 388d147fc..91e5746de 100644 --- a/ground/gcs/src/plugins/config/camerastabilization.ui +++ b/ground/gcs/src/plugins/config/camerastabilization.ui @@ -72,7 +72,7 @@ 0 - -103 + 0 748 811 @@ -1321,7 +1321,7 @@ The same value is used for all axes. - + 0 @@ -1369,7 +1369,7 @@ The same value is used for all axes. - + 0 @@ -1400,7 +1400,7 @@ Apply or Save button afterwards. - + 0 @@ -1433,7 +1433,7 @@ Apply or Save button afterwards. - + 0 @@ -1460,7 +1460,7 @@ Apply or Save button afterwards. - + 0 @@ -1528,10 +1528,10 @@ Apply or Save button afterwards. yawDecelTime gimbalType maxAccel - camerastabilizationResetToDefaults - pushButton - camerastabilizationSaveRAM - camerastabilizationSaveSD + defaultButton + reloadButton + applyButton + saveButton diff --git a/ground/gcs/src/plugins/config/cc_hw_settings.ui b/ground/gcs/src/plugins/config/cc_hw_settings.ui index f5f5ad792..11aeece7d 100644 --- a/ground/gcs/src/plugins/config/cc_hw_settings.ui +++ b/ground/gcs/src/plugins/config/cc_hw_settings.ui @@ -456,7 +456,7 @@ - + 0 @@ -494,10 +494,13 @@ true + + button:help + - + 0 @@ -596,10 +599,13 @@ Beware of not locking yourself out! false + + button:apply + - + 0 @@ -625,6 +631,9 @@ Beware of not locking yourself out! Save + + button:save + diff --git a/ground/gcs/src/plugins/config/ccattitude.ui b/ground/gcs/src/plugins/config/ccattitude.ui index f200b1382..5365ea837 100644 --- a/ground/gcs/src/plugins/config/ccattitude.ui +++ b/ground/gcs/src/plugins/config/ccattitude.ui @@ -117,7 +117,7 @@ 0 0 758 - 486 + 480 @@ -550,7 +550,7 @@ A setting of 0.00 disables the filter. - + 0 @@ -582,6 +582,9 @@ A setting of 0.00 disables the filter. true + + button:help + @@ -595,6 +598,9 @@ A setting of 0.00 disables the filter. Apply + + button:apply + @@ -611,6 +617,9 @@ A setting of 0.00 disables the filter. Save + + button:save + diff --git a/ground/gcs/src/plugins/config/cfg_vehicletypes/configccpmwidget.cpp b/ground/gcs/src/plugins/config/cfg_vehicletypes/configccpmwidget.cpp index e88e33595..44a259c85 100644 --- a/ground/gcs/src/plugins/config/cfg_vehicletypes/configccpmwidget.cpp +++ b/ground/gcs/src/plugins/config/cfg_vehicletypes/configccpmwidget.cpp @@ -29,6 +29,9 @@ #include "ui_airframe_ccpm.h" +#include +#include + #include "mixersettings.h" #include "systemsettings.h" #include "actuatorcommand.h" @@ -1417,6 +1420,16 @@ void ConfigCcpmWidget::SwashLvlFinishButtonPressed() ccpmSwashplateUpdate(); } +void ConfigCcpmWidget::saveObjectToSD(UAVObject *obj) +{ + // saveObjectToSD is now handled by the UAVUtils plugin in one + // central place (and one central queue) + ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); + UAVObjectUtilManager *utilMngr = pm->getObject(); + + utilMngr->saveObjectToSD(obj); +} + int ConfigCcpmWidget::ShowDisclaimer(int messageID) { QMessageBox msgBox; diff --git a/ground/gcs/src/plugins/config/cfg_vehicletypes/configccpmwidget.h b/ground/gcs/src/plugins/config/cfg_vehicletypes/configccpmwidget.h index c302d5392..1763f4c65 100644 --- a/ground/gcs/src/plugins/config/cfg_vehicletypes/configccpmwidget.h +++ b/ground/gcs/src/plugins/config/cfg_vehicletypes/configccpmwidget.h @@ -112,6 +112,8 @@ private: QString updateConfigObjects(); + void saveObjectToSD(UAVObject *obj); + private slots: virtual void setupUI(QString airframeType); virtual bool throwConfigError(int typeInt); diff --git a/ground/gcs/src/plugins/config/config_cc_hw_widget.cpp b/ground/gcs/src/plugins/config/config_cc_hw_widget.cpp index 6aa155cc7..5677c2fd3 100644 --- a/ground/gcs/src/plugins/config/config_cc_hw_widget.cpp +++ b/ground/gcs/src/plugins/config/config_cc_hw_widget.cpp @@ -31,17 +31,14 @@ #include "ui_cc_hw_settings.h" #include +#include #include "hwsettings.h" #include #include #include -#include -#include -#include -#include -#include +#include ConfigCCHWWidget::ConfigCCHWWidget(QWidget *parent) : ConfigTaskWidget(parent) { @@ -49,16 +46,10 @@ ConfigCCHWWidget::ConfigCCHWWidget(QWidget *parent) : ConfigTaskWidget(parent) m_telemetry->setupUi(this); // must be done before auto binding ! - // setWikiURL(""); + setWikiURL("CC+Hardware+Configuration"); addAutoBindings(); - connect(m_telemetry->cchwHelp, SIGNAL(clicked()), this, SLOT(openHelp())); - - addApplySaveButtons(m_telemetry->saveTelemetryToRAM, m_telemetry->saveTelemetryToSD); - - m_telemetry->saveTelemetryToRAM->setVisible(expertMode()); - ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); UAVObjectUtilManager *utilMngr = pm->getObject(); int id = utilMngr->getBoardModel(); @@ -101,8 +92,6 @@ ConfigCCHWWidget::ConfigCCHWWidget(QWidget *parent) : ConfigTaskWidget(parent) } else { addWidgetBinding("GPSSettings", "DataProtocol", m_telemetry->gpsProtocol); } - - enableSaveButtons(false); } ConfigCCHWWidget::~ConfigCCHWWidget() @@ -145,17 +134,6 @@ void ConfigCCHWWidget::widgetsContentsChanged() void ConfigCCHWWidget::enableSaveButtons(bool enable) { - m_telemetry->saveTelemetryToRAM->setEnabled(enable); - m_telemetry->saveTelemetryToSD->setEnabled(enable); + m_telemetry->applyButton->setEnabled(enable); + m_telemetry->saveButton->setEnabled(enable); } - -void ConfigCCHWWidget::openHelp() -{ - QDesktopServices::openUrl(QUrl(QString(WIKI_URL_ROOT) + QString("CC+Hardware+Configuration"), - QUrl::StrictMode)); -} - -/** - * @} - * @} - */ diff --git a/ground/gcs/src/plugins/config/config_cc_hw_widget.h b/ground/gcs/src/plugins/config/config_cc_hw_widget.h index 194521a25..be0da4994 100644 --- a/ground/gcs/src/plugins/config/config_cc_hw_widget.h +++ b/ground/gcs/src/plugins/config/config_cc_hw_widget.h @@ -29,16 +29,10 @@ #define CONFIGCCHWWIDGET_H #include "../uavobjectwidgetutils/configtaskwidget.h" -#include "extensionsystem/pluginmanager.h" -#include "uavobjectmanager.h" -#include "uavobject.h" -#include "smartsavebutton.h" - -#include -#include -#include class Ui_CC_HW_Widget; +class QWidget; +class QSvgRenderer; class ConfigCCHWWidget : public ConfigTaskWidget { Q_OBJECT @@ -47,7 +41,6 @@ public: ConfigCCHWWidget(QWidget *parent = 0); ~ConfigCCHWWidget(); private slots: - void openHelp(); void refreshValues(); void widgetsContentsChanged(); void enableSaveButtons(bool enable); diff --git a/ground/gcs/src/plugins/config/configcamerastabilizationwidget.cpp b/ground/gcs/src/plugins/config/configcamerastabilizationwidget.cpp index 48caebac2..2240e1a3d 100644 --- a/ground/gcs/src/plugins/config/configcamerastabilizationwidget.cpp +++ b/ground/gcs/src/plugins/config/configcamerastabilizationwidget.cpp @@ -55,10 +55,6 @@ ConfigCameraStabilizationWidget::ConfigCameraStabilizationWidget(QWidget *parent disableMouseWheelEvents(); - addApplySaveButtons(ui->camerastabilizationSaveRAM, ui->camerastabilizationSaveSD); - - ui->camerastabilizationSaveRAM->setVisible(expertMode()); - // These widgets don't have direct relation to UAVObjects // and need special processing QComboBox *outputs[] = { ui->rollChannel, ui->pitchChannel, ui->yawChannel, }; @@ -163,8 +159,7 @@ void ConfigCameraStabilizationWidget::refreshWidgetsValuesImpl(UAVObject *obj) void ConfigCameraStabilizationWidget::updateObjectsFromWidgetsImpl() { // Save state of the module enable checkbox first. - // Do not use setData() member on whole object, if possible, since it triggers - // unnessesary UAVObect update. + // Do not use setData() member on whole object, if possible, since it triggers unnecessary UAVObect update. quint8 enableModule = ui->enableCameraStabilization->isChecked() ? HwSettings::OPTIONALMODULES_ENABLED : HwSettings::OPTIONALMODULES_DISABLED; HwSettings *hwSettings = HwSettings::GetInstance(getObjectManager()); diff --git a/ground/gcs/src/plugins/config/configcamerastabilizationwidget.h b/ground/gcs/src/plugins/config/configcamerastabilizationwidget.h index f4c7036d8..cb94725b5 100644 --- a/ground/gcs/src/plugins/config/configcamerastabilizationwidget.h +++ b/ground/gcs/src/plugins/config/configcamerastabilizationwidget.h @@ -28,8 +28,7 @@ #define CONFIGCAMERASTABILIZATIONWIDGET_H #include "../uavobjectwidgetutils/configtaskwidget.h" -#include "extensionsystem/pluginmanager.h" -#include "uavobjectmanager.h" + #include "uavobject.h" #include "camerastabsettings.h" diff --git a/ground/gcs/src/plugins/config/configccattitudewidget.cpp b/ground/gcs/src/plugins/config/configccattitudewidget.cpp index e0480e15c..5b0397d49 100644 --- a/ground/gcs/src/plugins/config/configccattitudewidget.cpp +++ b/ground/gcs/src/plugins/config/configccattitudewidget.cpp @@ -29,7 +29,7 @@ #include "ui_ccattitude.h" -#include "utils/coordinateconversions.h" +#include #include #include "attitudesettings.h" @@ -37,11 +37,8 @@ #include "accelgyrosettings.h" #include "gyrostate.h" -#include #include #include -#include -#include ConfigCCAttitudeWidget::ConfigCCAttitudeWidget(QWidget *parent) : ConfigTaskWidget(parent), accelUpdates(0), gyroUpdates(0) @@ -50,16 +47,10 @@ ConfigCCAttitudeWidget::ConfigCCAttitudeWidget(QWidget *parent) : ui->setupUi(this); // must be done before auto binding ! - // setWikiURL(""); + setWikiURL("CC+Attitude+Configuration"); addAutoBindings(); - connect(ui->ccAttitudeHelp, SIGNAL(clicked()), this, SLOT(openHelp())); - - addApplySaveButtons(ui->applyButton, ui->saveButton); - - ui->applyButton->setVisible(expertMode()); - addUAVObject("AttitudeSettings"); addUAVObject("AccelGyroSettings"); @@ -218,12 +209,6 @@ void ConfigCCAttitudeWidget::startAccelCalibration() connect(&timer, SIGNAL(timeout()), this, SLOT(timeout())); } -void ConfigCCAttitudeWidget::openHelp() -{ - QDesktopServices::openUrl(QUrl(QString(WIKI_URL_ROOT) + QString("CC+Attitude+Configuration"), - QUrl::StrictMode)); -} - void ConfigCCAttitudeWidget::setAccelFiltering(bool active) { Q_UNUSED(active); diff --git a/ground/gcs/src/plugins/config/configccattitudewidget.h b/ground/gcs/src/plugins/config/configccattitudewidget.h index 2a029aad0..7f56ea586 100644 --- a/ground/gcs/src/plugins/config/configccattitudewidget.h +++ b/ground/gcs/src/plugins/config/configccattitudewidget.h @@ -28,8 +28,7 @@ #define CCATTITUDEWIDGET_H #include "../uavobjectwidgetutils/configtaskwidget.h" -#include "extensionsystem/pluginmanager.h" -#include "uavobjectmanager.h" + #include "uavobject.h" #include @@ -51,7 +50,6 @@ private slots: void sensorsUpdated(UAVObject *obj); void timeout(); void startAccelCalibration(); - void openHelp(); void setAccelFiltering(bool active); private: @@ -67,6 +65,7 @@ private: QList x_gyro_accum, y_gyro_accum, z_gyro_accum; static const int NUM_SENSOR_UPDATES = 300; + protected: virtual void enableControls(bool enable); }; diff --git a/ground/gcs/src/plugins/config/configinputwidget.cpp b/ground/gcs/src/plugins/config/configinputwidget.cpp index 9234e4847..4ad96c107 100644 --- a/ground/gcs/src/plugins/config/configinputwidget.cpp +++ b/ground/gcs/src/plugins/config/configinputwidget.cpp @@ -37,21 +37,15 @@ #include "failsafechannelform.h" #include "ui_failsafechannelform.h" -#include +#include #include +#include #include #include -#include #include -#include -#include -#include -#include -#include #include -#include #include #include @@ -87,15 +81,10 @@ ConfigInputWidget::ConfigInputWidget(QWidget *parent) : ui->setupUi(this); // must be done before auto binding ! - // setWikiURL(""); + setWikiURL("Input+Configuration"); addAutoBindings(); - connect(ui->inputHelp, SIGNAL(clicked()), this, SLOT(openHelp())); - - addApplySaveButtons(ui->saveRCInputToRAM, ui->saveRCInputToSD); - ui->saveRCInputToRAM->setVisible(expertMode()); - connect(this, SIGNAL(enableControlsChanged(bool)), this, SLOT(enableControlsChanged(bool))); manualCommandObj = ManualControlCommand::GetInstance(getObjectManager()); @@ -493,12 +482,6 @@ void ConfigInputWidget::resizeEvent(QResizeEvent *event) wizardUi->graphicsView->fitInView(m_txBackground, Qt::KeepAspectRatio); } -void ConfigInputWidget::openHelp() -{ - QDesktopServices::openUrl(QUrl(QString(WIKI_URL_ROOT) + QString("Input+Configuration"), - QUrl::StrictMode)); -} - void ConfigInputWidget::goToWizard() { QMessageBox msgBox; @@ -1953,8 +1936,8 @@ void ConfigInputWidget::simpleCalibration(bool enable) { if (enable) { ui->configurationWizard->setEnabled(false); - ui->saveRCInputToRAM->setEnabled(false); - ui->saveRCInputToSD->setEnabled(false); + ui->applyButton->setEnabled(false); + ui->saveButton->setEnabled(false); ui->runCalibration->setText(tr("Stop Manual Calibration")); throttleError = false; @@ -2031,8 +2014,8 @@ void ConfigInputWidget::simpleCalibration(bool enable) actuatorSettingsObj->setData(memento.actuatorSettingsData); ui->configurationWizard->setEnabled(true); - ui->saveRCInputToRAM->setEnabled(true); - ui->saveRCInputToSD->setEnabled(true); + ui->applyButton->setEnabled(true); + ui->saveButton->setEnabled(true); ui->runCalibration->setText(tr("Start Manual Calibration")); disconnect(manualCommandObj, SIGNAL(objectUnpacked(UAVObject *)), this, SLOT(updateCalibration())); diff --git a/ground/gcs/src/plugins/config/configinputwidget.h b/ground/gcs/src/plugins/config/configinputwidget.h index c33b6409e..c55de2e1c 100644 --- a/ground/gcs/src/plugins/config/configinputwidget.h +++ b/ground/gcs/src/plugins/config/configinputwidget.h @@ -29,8 +29,7 @@ #define CONFIGINPUTWIDGET_H #include "uavobjectwidgetutils/configtaskwidget.h" -#include "extensionsystem/pluginmanager.h" -#include "uavobjectmanager.h" + #include "uavobject.h" #include "manualcontrolcommand.h" @@ -212,7 +211,6 @@ private slots: void wzCancel(); void goToWizard(); void disableWizardButton(int); - void openHelp(); void identifyControls(); void identifyLimits(); void moveTxControls(); diff --git a/ground/gcs/src/plugins/config/configoplinkwidget.cpp b/ground/gcs/src/plugins/config/configoplinkwidget.cpp index 3f96f37bd..abb13f172 100644 --- a/ground/gcs/src/plugins/config/configoplinkwidget.cpp +++ b/ground/gcs/src/plugins/config/configoplinkwidget.cpp @@ -56,9 +56,6 @@ ConfigOPLinkWidget::ConfigOPLinkWidget(QWidget *parent) : ConfigTaskWidget(paren disableMouseWheelEvents(); - addApplySaveButtons(m_oplink->Apply, m_oplink->Save); - m_oplink->Apply->setVisible(expertMode()); - connect(this, SIGNAL(connected()), this, SLOT(connected())); oplinkStatusObj = dynamic_cast(getObject("OPLinkStatus")); diff --git a/ground/gcs/src/plugins/config/configoutputwidget.cpp b/ground/gcs/src/plugins/config/configoutputwidget.cpp index 0b0db96e9..0c7613f5b 100644 --- a/ground/gcs/src/plugins/config/configoutputwidget.cpp +++ b/ground/gcs/src/plugins/config/configoutputwidget.cpp @@ -49,11 +49,7 @@ #include #include #include -#include -#include #include -#include -#include ConfigOutputWidget::ConfigOutputWidget(QWidget *parent) : ConfigTaskWidget(parent) { @@ -61,16 +57,10 @@ ConfigOutputWidget::ConfigOutputWidget(QWidget *parent) : ConfigTaskWidget(paren m_ui->setupUi(this); // must be done before auto binding ! - // setWikiURL(""); + setWikiURL("Output+Configuration"); addAutoBindings(); - // Connect the help button - connect(m_ui->outputHelp, SIGNAL(clicked()), this, SLOT(openHelp())); - - addApplySaveButtons(m_ui->saveRCOutputToRAM, m_ui->saveRCOutputToSD); - m_ui->saveRCOutputToRAM->setVisible(expertMode()); - m_ui->gvFrame->setVisible(false); ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); @@ -490,12 +480,6 @@ void ConfigOutputWidget::updateAlwaysStabilizeStatus() } } -void ConfigOutputWidget::openHelp() -{ - QDesktopServices::openUrl(QUrl(QString(WIKI_URL_ROOT) + QString("Output+Configuration"), - QUrl::StrictMode)); -} - void ConfigOutputWidget::onBankTypeChange() { QComboBox *bankModeCombo = qobject_cast(sender()); diff --git a/ground/gcs/src/plugins/config/configoutputwidget.h b/ground/gcs/src/plugins/config/configoutputwidget.h index 64301d871..bca11ddb0 100644 --- a/ground/gcs/src/plugins/config/configoutputwidget.h +++ b/ground/gcs/src/plugins/config/configoutputwidget.h @@ -112,7 +112,6 @@ private slots: void stopTests(); void runChannelTests(bool state); void sendChannelTest(int index, int value); - void openHelp(); void onBankTypeChange(); }; diff --git a/ground/gcs/src/plugins/config/configrevohwwidget.cpp b/ground/gcs/src/plugins/config/configrevohwwidget.cpp index a61b3ab5d..3b72dddcd 100644 --- a/ground/gcs/src/plugins/config/configrevohwwidget.cpp +++ b/ground/gcs/src/plugins/config/configrevohwwidget.cpp @@ -34,9 +34,6 @@ #include "hwsettings.h" #include -#include -#include -#include ConfigRevoHWWidget::ConfigRevoHWWidget(QWidget *parent) : ConfigTaskWidget(parent) { @@ -44,14 +41,11 @@ ConfigRevoHWWidget::ConfigRevoHWWidget(QWidget *parent) : ConfigTaskWidget(paren m_ui->setupUi(this); // must be done before auto binding ! - // setWikiURL(""); + setWikiURL("Revolution+Configuration"); addAutoBindings(); - connect(m_ui->cchwHelp, SIGNAL(clicked()), this, SLOT(openHelp())); - - addApplySaveButtons(m_ui->saveTelemetryToRAM, m_ui->saveTelemetryToSD); - m_ui->saveTelemetryToRAM->setVisible(expertMode()); + addUAVObject("HwSettings"); addWidgetBinding("HwSettings", "RM_FlexiPort", m_ui->cbFlexi); addWidgetBinding("HwSettings", "RM_MainPort", m_ui->cbMain); @@ -476,9 +470,3 @@ void ConfigRevoHWWidget::rcvrPortChanged(int index) break; } } - -void ConfigRevoHWWidget::openHelp() -{ - QDesktopServices::openUrl(QUrl(QString(WIKI_URL_ROOT) + QString("Revolution+Configuration"), - QUrl::StrictMode)); -} diff --git a/ground/gcs/src/plugins/config/configrevohwwidget.h b/ground/gcs/src/plugins/config/configrevohwwidget.h index 181184710..6f50b809b 100644 --- a/ground/gcs/src/plugins/config/configrevohwwidget.h +++ b/ground/gcs/src/plugins/config/configrevohwwidget.h @@ -58,7 +58,6 @@ private slots: void flexiPortChanged(int index); void mainPortChanged(int index); void rcvrPortChanged(int index); - void openHelp(); }; #endif // CONFIGREVOHWWIDGET_H diff --git a/ground/gcs/src/plugins/config/configrevohwwidget.ui b/ground/gcs/src/plugins/config/configrevohwwidget.ui index 1b11c41d2..1f5f0d4a6 100644 --- a/ground/gcs/src/plugins/config/configrevohwwidget.ui +++ b/ground/gcs/src/plugins/config/configrevohwwidget.ui @@ -121,9 +121,9 @@ 0 - -148 + 0 796 - 804 + 807 @@ -548,7 +548,7 @@ - :/configgadget/images/revolution_top.png + :/configgadget/images/revolution_top.png false @@ -739,7 +739,7 @@ - + 0 @@ -777,10 +777,13 @@ true + + button:help + - + 0 @@ -879,10 +882,13 @@ Beware of not locking yourself out! false + + button:apply + - + 0 @@ -908,6 +914,9 @@ Beware of not locking yourself out! Save + + button:save + diff --git a/ground/gcs/src/plugins/config/configrevonanohwwidget.cpp b/ground/gcs/src/plugins/config/configrevonanohwwidget.cpp index b3dfd5a27..c406aae0c 100644 --- a/ground/gcs/src/plugins/config/configrevonanohwwidget.cpp +++ b/ground/gcs/src/plugins/config/configrevonanohwwidget.cpp @@ -34,9 +34,6 @@ #include "hwsettings.h" #include -#include -#include -#include ConfigRevoNanoHWWidget::ConfigRevoNanoHWWidget(QWidget *parent) : ConfigTaskWidget(parent) { @@ -44,14 +41,11 @@ ConfigRevoNanoHWWidget::ConfigRevoNanoHWWidget(QWidget *parent) : ConfigTaskWidg m_ui->setupUi(this); // must be done before auto binding ! - // setWikiURL(""); + setWikiURL("Revo+Nano+Configuration"); addAutoBindings(); - connect(m_ui->cchwHelp, SIGNAL(clicked()), this, SLOT(openHelp())); - - addApplySaveButtons(m_ui->saveTelemetryToRAM, m_ui->saveTelemetryToSD); - m_ui->saveTelemetryToRAM->setVisible(expertMode()); + addUAVObject("HwSettings"); addWidgetBinding("HwSettings", "RM_FlexiPort", m_ui->cbFlexi); addWidgetBinding("HwSettings", "RM_MainPort", m_ui->cbMain); @@ -266,9 +260,3 @@ void ConfigRevoNanoHWWidget::rcvrPortChanged(int index) Q_UNUSED(index); /* Nano has no USART at rcvrPort */ } - -void ConfigRevoNanoHWWidget::openHelp() -{ - QDesktopServices::openUrl(QUrl(QString(WIKI_URL_ROOT) + QString("Revo+Nano+Configuration"), - QUrl::StrictMode)); -} diff --git a/ground/gcs/src/plugins/config/configrevonanohwwidget.h b/ground/gcs/src/plugins/config/configrevonanohwwidget.h index ad5afdb39..7ded26532 100644 --- a/ground/gcs/src/plugins/config/configrevonanohwwidget.h +++ b/ground/gcs/src/plugins/config/configrevonanohwwidget.h @@ -58,7 +58,6 @@ private slots: void flexiPortChanged(int index); void mainPortChanged(int index); void rcvrPortChanged(int index); - void openHelp(); }; #endif // CONFIGREVONANOHWWIDGET_H diff --git a/ground/gcs/src/plugins/config/configrevonanohwwidget.ui b/ground/gcs/src/plugins/config/configrevonanohwwidget.ui index dc73e8c65..b62adeac9 100644 --- a/ground/gcs/src/plugins/config/configrevonanohwwidget.ui +++ b/ground/gcs/src/plugins/config/configrevonanohwwidget.ui @@ -254,7 +254,7 @@ - :/configgadget/images/nano_top.png + :/configgadget/images/nano_top.png false @@ -459,7 +459,7 @@ - + 0 @@ -497,10 +497,13 @@ true + + button:help + - + 0 @@ -599,10 +602,13 @@ Beware of not locking yourself out! false + + button:apply + - + 0 @@ -628,6 +634,9 @@ Beware of not locking yourself out! Save + + button:save + diff --git a/ground/gcs/src/plugins/config/configrevowidget.cpp b/ground/gcs/src/plugins/config/configrevowidget.cpp index 5e74dae45..2fb72481e 100644 --- a/ground/gcs/src/plugins/config/configrevowidget.cpp +++ b/ground/gcs/src/plugins/config/configrevowidget.cpp @@ -29,7 +29,9 @@ #include "ui_revosensors.h" +#include #include + #include #include #include @@ -42,22 +44,13 @@ #include "calibration.h" #include "calibration/calibrationutils.h" -#include "math.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include +#include +#include +#include +#include // #define DEBUG @@ -82,16 +75,10 @@ ConfigRevoWidget::ConfigRevoWidget(QWidget *parent) : m_ui->tabWidget->setCurrentIndex(0); // must be done before auto binding ! - // setWikiURL(""); + setWikiURL("Revo+Attitude+Configuration"); addAutoBindings(); - // Connect the help button - connect(m_ui->attitudeHelp, SIGNAL(clicked()), this, SLOT(openHelp())); - - addApplySaveButtons(m_ui->revoCalSettingsSaveRAM, m_ui->revoCalSettingsSaveSD); - m_ui->revoCalSettingsSaveRAM->setVisible(expertMode()); - // Initialization of the visual help m_ui->calibrationVisualHelp->setScene(new QGraphicsScene(this)); m_ui->calibrationVisualHelp->setRenderHint(QPainter::HighQualityAntialiasing, true); @@ -701,9 +688,3 @@ void ConfigRevoWidget::updateMagStatus() m_ui->magStatusSource->setToolTip(""); } } - -void ConfigRevoWidget::openHelp() -{ - QDesktopServices::openUrl(QUrl(QString(WIKI_URL_ROOT) + QString("Revo+Attitude+Configuration"), - QUrl::StrictMode)); -} diff --git a/ground/gcs/src/plugins/config/configrevowidget.h b/ground/gcs/src/plugins/config/configrevowidget.h index c153ae844..896cabd60 100644 --- a/ground/gcs/src/plugins/config/configrevowidget.h +++ b/ground/gcs/src/plugins/config/configrevowidget.h @@ -29,8 +29,7 @@ #define CONFIGREVOWIDGET_H #include "configtaskwidget.h" -#include "extensionsystem/pluginmanager.h" -#include "uavobjectmanager.h" + #include "uavobject.h" #include "calibration/thermal/thermalcalibrationmodel.h" @@ -102,7 +101,6 @@ private slots: float getMagError(float mag[3]); void updateVisualHelp(); - void openHelp(); protected: void showEvent(QShowEvent *event); diff --git a/ground/gcs/src/plugins/config/configsparky2hwwidget.cpp b/ground/gcs/src/plugins/config/configsparky2hwwidget.cpp index f0286b414..1f6d51a63 100644 --- a/ground/gcs/src/plugins/config/configsparky2hwwidget.cpp +++ b/ground/gcs/src/plugins/config/configsparky2hwwidget.cpp @@ -34,9 +34,6 @@ #include "hwsettings.h" #include -#include -#include -#include ConfigSparky2HWWidget::ConfigSparky2HWWidget(QWidget *parent) : ConfigTaskWidget(parent) { @@ -44,14 +41,11 @@ ConfigSparky2HWWidget::ConfigSparky2HWWidget(QWidget *parent) : ConfigTaskWidget m_ui->setupUi(this); // must be done before auto binding ! - // setWikiURL(""); + setWikiURL("Sparky2+Configuration"); addAutoBindings(); - connect(m_ui->cchwHelp, SIGNAL(clicked()), this, SLOT(openHelp())); - - addApplySaveButtons(m_ui->saveTelemetryToRAM, m_ui->saveTelemetryToSD); - m_ui->saveTelemetryToRAM->setVisible(expertMode()); + addUAVObject("HwSettings"); addWidgetBinding("HwSettings", "SPK2_FlexiPort", m_ui->cbFlexi); addWidgetBinding("HwSettings", "SPK2_MainPort", m_ui->cbMain); @@ -263,9 +257,3 @@ void ConfigSparky2HWWidget::mainPortChanged(int index) break; } } - -void ConfigSparky2HWWidget::openHelp() -{ - QDesktopServices::openUrl(QUrl(QString(WIKI_URL_ROOT) + QString("Sparky2+Configuration"), - QUrl::StrictMode)); -} diff --git a/ground/gcs/src/plugins/config/configsparky2hwwidget.h b/ground/gcs/src/plugins/config/configsparky2hwwidget.h index 5822fd0ef..f4e484500 100644 --- a/ground/gcs/src/plugins/config/configsparky2hwwidget.h +++ b/ground/gcs/src/plugins/config/configsparky2hwwidget.h @@ -57,7 +57,6 @@ private slots: void usbHIDPortChanged(int index); void flexiPortChanged(int index); void mainPortChanged(int index); - void openHelp(); }; #endif // CONFIGSPARKY2HWWIDGET_H diff --git a/ground/gcs/src/plugins/config/configsparky2hwwidget.ui b/ground/gcs/src/plugins/config/configsparky2hwwidget.ui index f8dd08250..538fb36d4 100644 --- a/ground/gcs/src/plugins/config/configsparky2hwwidget.ui +++ b/ground/gcs/src/plugins/config/configsparky2hwwidget.ui @@ -121,9 +121,9 @@ 0 - -258 - 794 - 927 + 0 + 796 + 731 @@ -434,7 +434,7 @@ - :/configgadget/images/sparky2_top.png + :/configgadget/images/sparky2_top.png false @@ -555,7 +555,7 @@ - + 0 @@ -593,10 +593,13 @@ true + + button:help + - + 0 @@ -695,10 +698,13 @@ Beware of not locking yourself out! false + + button:apply + - + 0 @@ -724,6 +730,9 @@ Beware of not locking yourself out! Save + + button:save + diff --git a/ground/gcs/src/plugins/config/configstabilizationwidget.cpp b/ground/gcs/src/plugins/config/configstabilizationwidget.cpp index a61524ece..f4691a9cc 100644 --- a/ground/gcs/src/plugins/config/configstabilizationwidget.cpp +++ b/ground/gcs/src/plugins/config/configstabilizationwidget.cpp @@ -29,7 +29,9 @@ #include "ui_stabilization.h" +#include #include "objectpersistence.h" + #include "altitudeholdsettings.h" #include "stabilizationsettings.h" @@ -41,14 +43,8 @@ #include #include #include -#include -#include -#include -#include -#include #include #include -#include #include #include #include @@ -60,15 +56,14 @@ ConfigStabilizationWidget::ConfigStabilizationWidget(QWidget *parent) : ConfigTa ui->setupUi(this); // must be done before auto binding ! - setupStabBanksGUI(); setWikiURL("Stabilization+Configuration"); + setupStabBanksGUI(); + addAutoBindings(); disableMouseWheelEvents(); - ui->saveStabilizationToRAM_6->setVisible(expertMode()); - connect(this, SIGNAL(enableControlsChanged(bool)), this, SLOT(enableControlsChanged(bool))); setupExpoPlot(); @@ -113,7 +108,6 @@ ConfigStabilizationWidget::ConfigStabilizationWidget(QWidget *parent) : ConfigTa addWidget(ui->pushButton_20); addWidget(ui->pushButton_21); addWidget(ui->pushButton_22); - addWidget(ui->pushButton_23); addWidget(ui->basicResponsivenessGroupBox); addWidget(ui->basicResponsivenessCheckBox); diff --git a/ground/gcs/src/plugins/config/configstabilizationwidget.h b/ground/gcs/src/plugins/config/configstabilizationwidget.h index 259f2b736..f0a12b451 100644 --- a/ground/gcs/src/plugins/config/configstabilizationwidget.h +++ b/ground/gcs/src/plugins/config/configstabilizationwidget.h @@ -29,11 +29,8 @@ #define CONFIGSTABILIZATIONWIDGET_H #include "../uavobjectwidgetutils/configtaskwidget.h" -#include "extensionsystem/pluginmanager.h" -#include "uavobjectmanager.h" -#include "uavobject.h" -#include "stabilizationsettings.h" +#include "uavobject.h" #include "qwt/src/qwt_plot_curve.h" #include "qwt/src/qwt_plot_grid.h" diff --git a/ground/gcs/src/plugins/config/configtxpidwidget.cpp b/ground/gcs/src/plugins/config/configtxpidwidget.cpp index ba4c8a600..9718ed2e9 100644 --- a/ground/gcs/src/plugins/config/configtxpidwidget.cpp +++ b/ground/gcs/src/plugins/config/configtxpidwidget.cpp @@ -50,19 +50,7 @@ ConfigTxPIDWidget::ConfigTxPIDWidget(QWidget *parent) : ConfigTaskWidget(parent) disableMouseWheelEvents(); - addApplySaveButtons(m_txpid->Apply, m_txpid->Save); - m_txpid->Apply->setVisible(expertMode()); - - // Cannot use addUAVObjectToWidgetRelation() for OptionaModules enum because - // QCheckBox returns bool (0 or -1) and this value is then set to enum instead - // or enum options - connect(HwSettings::GetInstance(getObjectManager()), SIGNAL(objectUpdated(UAVObject *)), this, SLOT(refreshValues())); - connect(m_txpid->Apply, SIGNAL(clicked()), this, SLOT(applySettings())); - connect(m_txpid->Save, SIGNAL(clicked()), this, SLOT(saveSettings())); - - connect(m_txpid->PID1, SIGNAL(currentIndexChanged(int)), this, SLOT(updateSpinBoxProperties(int))); - connect(m_txpid->PID2, SIGNAL(currentIndexChanged(int)), this, SLOT(updateSpinBoxProperties(int))); - connect(m_txpid->PID3, SIGNAL(currentIndexChanged(int)), this, SLOT(updateSpinBoxProperties(int))); + addUAVObject("HwSettings"); addWidgetBinding("TxPIDSettings", "BankNumber", m_txpid->pidBank, 0, 1, true); @@ -92,10 +80,14 @@ ConfigTxPIDWidget::ConfigTxPIDWidget(QWidget *parent) : ConfigTaskWidget(parent) addWidgetBinding("TxPIDSettings", "UpdateMode", m_txpid->UpdateMode); - connect(this, SIGNAL(widgetContentsChanged(QWidget *)), this, SLOT(processLinkedWidgets(QWidget *))); - addWidget(m_txpid->TxPIDEnable); addWidget(m_txpid->enableAutoCalcYaw); + + connect(m_txpid->PID1, SIGNAL(currentIndexChanged(int)), this, SLOT(updateSpinBoxProperties(int))); + connect(m_txpid->PID2, SIGNAL(currentIndexChanged(int)), this, SLOT(updateSpinBoxProperties(int))); + connect(m_txpid->PID3, SIGNAL(currentIndexChanged(int)), this, SLOT(updateSpinBoxProperties(int))); + + connect(this, SIGNAL(widgetContentsChanged(QWidget *)), this, SLOT(processLinkedWidgets(QWidget *))); } ConfigTxPIDWidget::~ConfigTxPIDWidget() @@ -103,6 +95,41 @@ ConfigTxPIDWidget::~ConfigTxPIDWidget() // Do nothing } +/* + * This overridden function refreshes widgets which have no direct relation + * to any of UAVObjects. It saves their dirty state first because update comes + * from UAVObjects, and then restores it. + */ +void ConfigTxPIDWidget::refreshWidgetsValuesImpl(UAVObject *obj) +{ + Q_UNUSED(obj); + + // Set module enable checkbox from OptionalModules UAVObject item. + // It needs special processing because ConfigTaskWidget uses TRUE/FALSE + // for QCheckBox, but OptionalModules uses Enabled/Disabled enum values. + HwSettings *hwSettings = HwSettings::GetInstance(getObjectManager()); + HwSettings::DataFields hwSettingsData = hwSettings->getData(); + + m_txpid->TxPIDEnable->setChecked( + hwSettingsData.OptionalModules[HwSettings::OPTIONALMODULES_TXPID] == HwSettings::OPTIONALMODULES_ENABLED); +} + +/* + * This overridden function updates UAVObjects which have no direct relation + * to any of widgets. + */ +void ConfigTxPIDWidget::updateObjectsFromWidgetsImpl() +{ + // Save state of the module enable checkbox first. + // Do not use setData() member on whole object, if possible, since it triggers unnecessary UAVObect update. + quint8 enableModule = m_txpid->TxPIDEnable->isChecked() ? + HwSettings::OPTIONALMODULES_ENABLED : HwSettings::OPTIONALMODULES_DISABLED; + HwSettings *hwSettings = HwSettings::GetInstance(getObjectManager()); + + hwSettings->setOptionalModules(HwSettings::OPTIONALMODULES_TXPID, enableModule); +} + + static bool isResponsivenessOption(int pidOption) { switch (pidOption) { @@ -437,32 +464,6 @@ void ConfigTxPIDWidget::updateSpinBoxProperties(int selectedPidOption) maxPID->setValue(value); } -void ConfigTxPIDWidget::refreshValues() -{ - HwSettings *hwSettings = HwSettings::GetInstance(getObjectManager()); - HwSettings::DataFields hwSettingsData = hwSettings->getData(); - - m_txpid->TxPIDEnable->setChecked( - hwSettingsData.OptionalModules[HwSettings::OPTIONALMODULES_TXPID] == HwSettings::OPTIONALMODULES_ENABLED); -} - -void ConfigTxPIDWidget::applySettings() -{ - HwSettings *hwSettings = HwSettings::GetInstance(getObjectManager()); - HwSettings::DataFields hwSettingsData = hwSettings->getData(); - - hwSettingsData.OptionalModules[HwSettings::OPTIONALMODULES_TXPID] = - m_txpid->TxPIDEnable->isChecked() ? HwSettings::OPTIONALMODULES_ENABLED : HwSettings::OPTIONALMODULES_DISABLED; - hwSettings->setData(hwSettingsData); -} - -void ConfigTxPIDWidget::saveSettings() -{ - applySettings(); - UAVObject *obj = HwSettings::GetInstance(getObjectManager()); - saveObjectToSD(obj); -} - void ConfigTxPIDWidget::processLinkedWidgets(QWidget *widget) { Q_UNUSED(widget); diff --git a/ground/gcs/src/plugins/config/configtxpidwidget.h b/ground/gcs/src/plugins/config/configtxpidwidget.h index f1dd40315..87e0a2513 100644 --- a/ground/gcs/src/plugins/config/configtxpidwidget.h +++ b/ground/gcs/src/plugins/config/configtxpidwidget.h @@ -37,15 +37,18 @@ class ConfigTxPIDWidget : public ConfigTaskWidget { public: ConfigTxPIDWidget(QWidget *parent = 0); ~ConfigTxPIDWidget(); + +protected: + virtual void refreshWidgetsValuesImpl(UAVObject *obj); + virtual void updateObjectsFromWidgetsImpl(); + private: Ui_TxPIDWidget *m_txpid; + private slots: void processLinkedWidgets(QWidget *widget); void updateSpinBoxProperties(int selectedPidOption); float getDefaultValueForPidOption(int pidOption); - void refreshValues(); - void applySettings(); - void saveSettings(); }; #endif // CONFIGTXPIDWIDGET_H diff --git a/ground/gcs/src/plugins/config/configvehicletypewidget.cpp b/ground/gcs/src/plugins/config/configvehicletypewidget.cpp index 2f0a59016..69ec26829 100644 --- a/ground/gcs/src/plugins/config/configvehicletypewidget.cpp +++ b/ground/gcs/src/plugins/config/configvehicletypewidget.cpp @@ -46,11 +46,7 @@ #include #include #include -#include -#include #include -#include -#include /** Static function to get currently assigned channelDescriptions @@ -120,17 +116,12 @@ ConfigVehicleTypeWidget::ConfigVehicleTypeWidget(QWidget *parent) : ConfigTaskWi m_aircraft->setupUi(this); // must be done before auto binding ! - setWikiURL("TxPID"); + setWikiURL("Vehicle+Configuration"); addAutoBindings(); disableMouseWheelEvents(); - connect(m_aircraft->airframeHelp, SIGNAL(clicked()), this, SLOT(openHelp())); - - addApplySaveButtons(m_aircraft->saveAircraftToRAM, m_aircraft->saveAircraftToSD); - m_aircraft->saveAircraftToRAM->setVisible(expertMode()); - ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); ConfigGadgetFactory *configGadgetFactory = pm->getObject(); connect(m_aircraft->vehicleSetupWizardButton, SIGNAL(clicked()), configGadgetFactory, SIGNAL(onOpenVehicleConfigurationWizard())); @@ -351,12 +342,3 @@ VehicleConfig *ConfigVehicleTypeWidget::createVehicleConfigWidget(int frameCateg } return vehicleConfig; } - -/** - Opens the wiki from the user's default browser - */ -void ConfigVehicleTypeWidget::openHelp() -{ - QDesktopServices::openUrl(QUrl(QString(WIKI_URL_ROOT) + QString("Vehicle+Configuration"), - QUrl::StrictMode)); -} diff --git a/ground/gcs/src/plugins/config/configvehicletypewidget.h b/ground/gcs/src/plugins/config/configvehicletypewidget.h index 4bd7204a4..1885cdbb7 100644 --- a/ground/gcs/src/plugins/config/configvehicletypewidget.h +++ b/ground/gcs/src/plugins/config/configvehicletypewidget.h @@ -80,7 +80,6 @@ private: private slots: void switchAirframeType(int index); - void openHelp(); }; #endif // CONFIGVEHICLETYPEWIDGET_H diff --git a/ground/gcs/src/plugins/config/input.ui b/ground/gcs/src/plugins/config/input.ui index dd45d70bf..04f3faed3 100644 --- a/ground/gcs/src/plugins/config/input.ui +++ b/ground/gcs/src/plugins/config/input.ui @@ -116,8 +116,8 @@ 0 0 - 1220 - 655 + 1228 + 669 @@ -547,8 +547,8 @@ font:bold; 0 0 - 1220 - 655 + 773 + 587 @@ -2319,8 +2319,8 @@ font:bold; 0 0 - 1220 - 655 + 616 + 351 @@ -2591,8 +2591,8 @@ The failsafe is triggered differently for different receivers. Failsafe should a 0 0 - 1220 - 655 + 564 + 159 @@ -2761,7 +2761,7 @@ Set to 0 to disable (recommended for soaring fixed wings). - + 0 @@ -2793,10 +2793,13 @@ Set to 0 to disable (recommended for soaring fixed wings). true + + button:help + - + 0 @@ -2819,10 +2822,13 @@ Be sure to set the Neutral position on all sliders before sending! Apply + + button:apply + - + 0 @@ -2845,6 +2851,9 @@ Applies and Saves all settings to SD Save + + button:save + @@ -2856,9 +2865,9 @@ Applies and Saves all settings to SD deadband armControl armTimeout - inputHelp - saveRCInputToRAM - saveRCInputToSD + helpButton + applyButton + saveButton diff --git a/ground/gcs/src/plugins/config/oplink.ui b/ground/gcs/src/plugins/config/oplink.ui index 1e62bcda5..f1f2329fc 100644 --- a/ground/gcs/src/plugins/config/oplink.ui +++ b/ground/gcs/src/plugins/config/oplink.ui @@ -49,8 +49,8 @@ 0 0 - 947 - 575 + 949 + 566 @@ -1874,7 +1874,7 @@ Leave blank to use autogenerated Device ID. - + 0 @@ -1917,17 +1917,20 @@ Leave blank to use autogenerated Device ID. - + Send settings to the board but do not save to the non-volatile memory. Apply + + button:apply + - + Send settings to the board and save to the non-volatile memory. @@ -1937,6 +1940,9 @@ Leave blank to use autogenerated Device ID. false + + button:save + @@ -1946,8 +1952,8 @@ Leave blank to use autogenerated Device ID. FirmwareVersion SerialNumber - Apply - Save + applyButton + saveButton diff --git a/ground/gcs/src/plugins/config/output.ui b/ground/gcs/src/plugins/config/output.ui index 7bdf484e3..d99402496 100644 --- a/ground/gcs/src/plugins/config/output.ui +++ b/ground/gcs/src/plugins/config/output.ui @@ -123,7 +123,7 @@ 0 0 743 - 662 + 668 @@ -969,7 +969,7 @@ - + 0 @@ -1007,10 +1007,13 @@ true + + button:help + - + 0 @@ -1033,10 +1036,13 @@ Be sure to set the Neutral position on all sliders before sending! Apply + + button:apply + - + 0 @@ -1059,6 +1065,9 @@ Applies and Saves all settings to SD Save + + button:save + @@ -1066,8 +1075,8 @@ Applies and Saves all settings to SD - saveRCOutputToRAM - saveRCOutputToSD + applyButton + saveButton diff --git a/ground/gcs/src/plugins/config/revosensors.ui b/ground/gcs/src/plugins/config/revosensors.ui index da76a6d3e..479798395 100644 --- a/ground/gcs/src/plugins/config/revosensors.ui +++ b/ground/gcs/src/plugins/config/revosensors.ui @@ -6,7 +6,7 @@ 0 0 - 935 + 954 726 @@ -438,8 +438,8 @@ <!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:10pt; 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-weight:600;"><br /></p></body></html> +</style></head><body style=" font-family:'Ubuntu'; font-size:10pt; 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-weight:600;"><br /></p></body></html> Qt::NoTextInteraction @@ -1157,10 +1157,10 @@ font:bold; <!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:'Cantarell'; font-size:11pt; 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;">The bargraphs show the difference between the onboard and auxiliary magnetometer measurements. </p> -<p align="justify" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">When the auxiliary magnetometer rotation is set correctlly, all bargraphs should show all zero (bargraph centered) <a name="result_box"></a>whatever the vehicle's orientation.</p> -<p align="justify" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">This assumes both magnetometers are calibrated and without alarm.</p></body></html> +</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; 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:'Cantarell';">The bargraphs show the difference between the onboard and auxiliary magnetometer measurements. </span></p> +<p align="justify" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Cantarell';">When the auxiliary magnetometer rotation is set correctlly, all bargraphs should show all zero (bargraph centered) </span><a name="result_box"></a><span style=" font-family:'Cantarell';">w</span><span style=" font-family:'Cantarell';">hatever the vehicle's orientation.</span></p> +<p align="justify" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Cantarell';">This assumes both magnetometers are calibrated and without alarm.</span></p></body></html> Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse @@ -1707,38 +1707,38 @@ font:bold; <!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-size:14pt; font-weight:600;">Help</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-size:11pt;"><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-size:11pt;">Steps 1, 2 and 3 are necessary.</span></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-size:11pt;">Step 4 is optional but may help achieve the best possible results.</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-size:11pt;"><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-size:12pt; font-weight:600; font-style:italic;">Step 1: Accelerometer and Magnetometer 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-size:11pt;"><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-size:11pt;">This step will calibrate the scale for the Magnetometer and the Accelerometer sensors. </span></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-size:11pt;">Press </span><span style=" font-size:11pt; font-style:italic;">Start</span><span style=" font-size:11pt;"> to begin, and follow the instructions for each step. </span></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-size:11pt;">For best results with the accelerometer calibration, it is advised that it be performed with a free unmounted flight controller as this allows one to accurately position the board for each orientation in the sequence.</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-size:11pt;"><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-size:11pt;">The magnetometer calibration must be performed with the board mounted in the airframe in order for the measurements to incorporate any bias produced by local onboard metal/magnetic elements.</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-size:11pt;"><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-size:11pt;">Note 1: Before the magnetometer or the accelerometer calibration is performed your Home Location must be set. This step is needed in order to determine the local magnetic field vector (Be) and acceleration due to gravity (g_e).</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-size:11pt;"><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-size:11pt;">Note 2: There is no need to align the airframe exactly south, north, east or west during the individual steps. The directions indicated serve only to tell you in which direction the airframe should be positioned relative to some point. One can simply assume that North is in front of you, East is to the right, West is to the left and South is pointing at you.</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-size:11pt;"><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-size:12pt; font-weight:600; font-style:italic;">Step 2: Board level 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-size:11pt;"><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-size:11pt;">This step will ensure that board leveling is accurate. Place the airframe as horizontally as possible (use a spirit level if necessary), then press </span><span style=" font-size:11pt; font-style:italic;">Start</span><span style=" font-size:11pt;">. Do not move the airframe at all until the end of the 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-size:11pt;"><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-size:12pt; font-weight:600; font-style:italic;">Step 3: Gyro bias calculation</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-size:11pt;"><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-size:11pt;">This step will allow you to calibrate the gyro measured value when the board is steady. To perform the calibration leave the board/airframe completely stationary and press </span><span style=" font-size:11pt; font-style:italic;">Start</span><span style=" font-size:11pt;">. </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-size:11pt;"><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-size:12pt; font-weight:600; font-style:italic;">Step 4: Thermal 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-size:11pt;"><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-size:11pt;">The calibration will compute sensors bias variations at different temperatures while the board warms up.</span></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-size:11pt;">This allows a certain amount of correction of those bias variations against temperature changes. It improves altitude hold accuracy and reduces yaw drift.</span></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-size:11pt;">To perform this calibration disconnect any power from the board and leave it to cool down at room temperature for 15-20 minutes. Then attach the usb connector to the board and press </span><span style=" font-size:11pt; font-style:italic;">Start</span><span style=" font-size:11pt;">, leaving the board completely stationary. Wait until complete.</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-size:11pt;"><br /></p></body></html> +</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; 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:'MS Shell Dlg 2'; font-size:14pt; font-weight:600;">Help</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:'MS Shell Dlg 2';"><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:'MS Shell Dlg 2';">Steps 1, 2 and 3 are necessary.</span></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:'MS Shell Dlg 2';">Step 4 is optional but may help achieve the best possible results.</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:'MS Shell Dlg 2';"><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:'MS Shell Dlg 2'; font-size:12pt; font-weight:600; font-style:italic;">Step 1: Accelerometer and Magnetometer 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:'MS Shell Dlg 2';"><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:'MS Shell Dlg 2';">This step will calibrate the scale for the Magnetometer and the Accelerometer sensors. </span></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:'MS Shell Dlg 2';">Press </span><span style=" font-family:'MS Shell Dlg 2'; font-style:italic;">Start</span><span style=" font-family:'MS Shell Dlg 2';"> to begin, and follow the instructions for each step. </span></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:'MS Shell Dlg 2';">For best results with the accelerometer calibration, it is advised that it be performed with a free unmounted flight controller as this allows one to accurately position the board for each orientation in the sequence.</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:'MS Shell Dlg 2';"><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:'MS Shell Dlg 2';">The magnetometer calibration must be performed with the board mounted in the airframe in order for the measurements to incorporate any bias produced by local onboard metal/magnetic elements.</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:'MS Shell Dlg 2';"><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:'MS Shell Dlg 2';">Note 1: Before the magnetometer or the accelerometer calibration is performed your Home Location must be set. This step is needed in order to determine the local magnetic field vector (Be) and acceleration due to gravity (g_e).</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:'MS Shell Dlg 2';"><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:'MS Shell Dlg 2';">Note 2: There is no need to align the airframe exactly south, north, east or west during the individual steps. The directions indicated serve only to tell you in which direction the airframe should be positioned relative to some point. One can simply assume that North is in front of you, East is to the right, West is to the left and South is pointing at you.</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:'MS Shell Dlg 2';"><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:'MS Shell Dlg 2'; font-size:12pt; font-weight:600; font-style:italic;">Step 2: Board level 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:'MS Shell Dlg 2';"><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:'MS Shell Dlg 2';">This step will ensure that board leveling is accurate. Place the airframe as horizontally as possible (use a spirit level if necessary), then press </span><span style=" font-family:'MS Shell Dlg 2'; font-style:italic;">Start</span><span style=" font-family:'MS Shell Dlg 2';">. Do not move the airframe at all until the end of the 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:'MS Shell Dlg 2';"><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:'MS Shell Dlg 2'; font-size:12pt; font-weight:600; font-style:italic;">Step 3: Gyro bias calculation</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:'MS Shell Dlg 2';"><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:'MS Shell Dlg 2';">This step will allow you to calibrate the gyro measured value when the board is steady. To perform the calibration leave the board/airframe completely stationary and press </span><span style=" font-family:'MS Shell Dlg 2'; font-style:italic;">Start</span><span style=" font-family:'MS Shell Dlg 2';">. </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:'MS Shell Dlg 2';"><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:'MS Shell Dlg 2'; font-size:12pt; font-weight:600; font-style:italic;">Step 4: Thermal 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:'MS Shell Dlg 2';"><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:'MS Shell Dlg 2';">The calibration will compute sensors bias variations at different temperatures while the board warms up.</span></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:'MS Shell Dlg 2';">This allows a certain amount of correction of those bias variations against temperature changes. It improves altitude hold accuracy and reduces yaw drift.</span></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:'MS Shell Dlg 2';">To perform this calibration disconnect any power from the board and leave it to cool down at room temperature for 15-20 minutes. Then attach the usb connector to the board and press </span><span style=" font-family:'MS Shell Dlg 2'; font-style:italic;">Start</span><span style=" font-family:'MS Shell Dlg 2';">, leaving the board completely stationary. Wait until complete.</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:'MS Shell Dlg 2';"><br /></p></body></html> Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse @@ -1768,7 +1768,7 @@ p, li { white-space: pre-wrap; } - + 0 @@ -1808,10 +1808,13 @@ p, li { white-space: pre-wrap; } true + + button:help + - + Save settings to the board (RAM only). @@ -1827,7 +1830,7 @@ specific calibration button on top of the screen. - + Send settings to the board, and save to the non-volatile memory. diff --git a/ground/gcs/src/plugins/config/stabilization.ui b/ground/gcs/src/plugins/config/stabilization.ui index a06315d51..34492e626 100644 --- a/ground/gcs/src/plugins/config/stabilization.ui +++ b/ground/gcs/src/plugins/config/stabilization.ui @@ -136,8 +136,8 @@ 0 0 - 877 - 764 + 863 + 821 @@ -7932,8 +7932,8 @@ border-radius: 5; 0 0 - 877 - 765 + 776 + 706 @@ -17354,8 +17354,8 @@ border-radius: 5; 0 0 - 877 - 671 + 797 + 604 @@ -23200,8 +23200,8 @@ font:bold; 0 0 - 877 - 671 + 500 + 600 @@ -26214,7 +26214,7 @@ border-radius: 5; - + 0 @@ -26263,7 +26263,7 @@ border-radius: 5; - + 0 @@ -26307,7 +26307,7 @@ Useful if you have accidentally changed some settings. - + 0 @@ -26343,7 +26343,7 @@ Useful if you have accidentally changed some settings. - + 0 @@ -26520,10 +26520,10 @@ Useful if you have accidentally changed some settings. AltThrRateSlider_2 AltThrRate_2 realTimeUpdates_7 - pushButton_23 - stabilizationReloadBoardData_6 - saveStabilizationToRAM_6 - saveStabilizationToSD_6 + helpButton + reloadButton + applyButton + saveButton checkBoxLinkAcroFactors tabWidget AttitudeResponsivenessSlider diff --git a/ground/gcs/src/plugins/config/txpid.ui b/ground/gcs/src/plugins/config/txpid.ui index b21172b5d..b0cd6cba2 100644 --- a/ground/gcs/src/plugins/config/txpid.ui +++ b/ground/gcs/src/plugins/config/txpid.ui @@ -118,9 +118,9 @@ 0 - -317 - 748 - 724 + 0 + 751 + 768 @@ -1426,7 +1426,7 @@ font:bold; - + 0 @@ -1484,7 +1484,7 @@ font:bold; - + 0 @@ -1500,10 +1500,13 @@ font:bold; Apply + + button:apply + - + 0 @@ -1522,6 +1525,9 @@ font:bold; false + + button:save + @@ -1529,8 +1535,8 @@ font:bold; - Apply - Save + applyButton + saveButton scrollArea PID1 Input1 diff --git a/ground/gcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp b/ground/gcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp index 6e0d826c2..3e80a4381 100644 --- a/ground/gcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp +++ b/ground/gcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp @@ -60,6 +60,12 @@ ConfigTaskWidget::ConfigTaskWidget(QWidget *parent, bool autopilot) : QWidget(pa UAVSettingsImportExportFactory *importexportplugin = m_pluginManager->getObject(); connect(importexportplugin, SIGNAL(importAboutToBegin()), this, SLOT(invalidateObjects())); + m_saveButton = new SmartSaveButton(this); + connect(m_saveButton, SIGNAL(preProcessOperations()), this, SLOT(updateObjectsFromWidgets())); + connect(m_saveButton, SIGNAL(saveSuccessfull()), this, SLOT(clearDirty())); + connect(m_saveButton, SIGNAL(beginOp()), this, SLOT(disableObjectUpdates())); + connect(m_saveButton, SIGNAL(endOp()), this, SLOT(enableObjectUpdates())); + if (m_autopilot) { // connect to telemetry manager TelemetryManager *tm = m_pluginManager->getObject(); @@ -286,20 +292,9 @@ void ConfigTaskWidget::enableComboBoxOptionItem(QComboBox *combo, int optionValu !enable ? QVariant(0) : QVariant(1 | 32), Qt::UserRole - 1); } -void ConfigTaskWidget::saveObjectToSD(UAVObject *obj) -{ - // saveObjectToSD is now handled by the UAVUtils plugin in one - // central place (and one central queue) - ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); - UAVObjectUtilManager *utilMngr = pm->getObject(); - - utilMngr->saveObjectToSD(obj); -} - UAVObjectManager *ConfigTaskWidget::getObjectManager() { - ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); - UAVObjectManager *objMngr = pm->getObject(); + UAVObjectManager *objMngr = m_pluginManager->getObject(); Q_ASSERT(objMngr); return objMngr; @@ -409,27 +404,15 @@ void ConfigTaskWidget::helpButtonPressed() } } -void ConfigTaskWidget::addApplySaveButtons(QPushButton *update, QPushButton *save) +void ConfigTaskWidget::addApplyButton(QPushButton *button) { - if (!m_saveButton) { - m_saveButton = new SmartSaveButton(this); - connect(m_saveButton, SIGNAL(preProcessOperations()), this, SLOT(updateObjectsFromWidgets())); - connect(m_saveButton, SIGNAL(saveSuccessfull()), this, SLOT(clearDirty())); - connect(m_saveButton, SIGNAL(beginOp()), this, SLOT(disableObjectUpdates())); - connect(m_saveButton, SIGNAL(endOp()), this, SLOT(enableObjectUpdates())); - } - if (update && save) { - m_saveButton->addButtons(save, update); - } else if (update) { - m_saveButton->addApplyButton(update); - } else if (save) { - m_saveButton->addSaveButton(save); - } - foreach(WidgetBinding * binding, m_widgetBindingsPerWidget) { - if (binding->object()) { - m_saveButton->addObject((UAVDataObject *)binding->object()); - } - } + m_saveButton->addApplyButton(button); + button->setVisible(expertMode()); +} + +void ConfigTaskWidget::addSaveButton(QPushButton *button) +{ + m_saveButton->addSaveButton(button); } void ConfigTaskWidget::enableControls(bool enable) @@ -636,9 +619,6 @@ void ConfigTaskWidget::addAutoBindings() { // qDebug() << "ConfigTaskWidget::addAutoBindings() - auto binding" << this; - QPushButton *saveButtonWidget = NULL; - QPushButton *applyButtonWidget = NULL; - foreach(QWidget * widget, this->findChildren()) { QVariant info = widget->property("objrelation"); @@ -697,15 +677,15 @@ void ConfigTaskWidget::addAutoBindings() QPushButton *button = NULL; switch (uiRelation.buttonType) { case save_button: - saveButtonWidget = qobject_cast(widget); - if (saveButtonWidget) { - addApplySaveButtons(NULL, saveButtonWidget); + button = qobject_cast(widget); + if (button) { + addSaveButton(button); } break; case apply_button: - applyButtonWidget = qobject_cast(widget); - if (applyButtonWidget) { - addApplySaveButtons(applyButtonWidget, NULL); + button = qobject_cast(widget); + if (button) { + addApplyButton(button); } break; case default_button: @@ -741,6 +721,11 @@ void ConfigTaskWidget::addAutoBindings() } } } + foreach(WidgetBinding * binding, m_widgetBindingsPerWidget) { + if (binding->object()) { + m_saveButton->addObject((UAVDataObject *)binding->object()); + } + } } // qDebug() << "ConfigTaskWidget::addAutoBindings() - auto binding done for" << this; } diff --git a/ground/gcs/src/plugins/uavobjectwidgetutils/configtaskwidget.h b/ground/gcs/src/plugins/uavobjectwidgetutils/configtaskwidget.h index 3cd1a1a8b..b0f0cc7eb 100644 --- a/ground/gcs/src/plugins/uavobjectwidgetutils/configtaskwidget.h +++ b/ground/gcs/src/plugins/uavobjectwidgetutils/configtaskwidget.h @@ -29,12 +29,13 @@ #include "uavobjectwidgetutils_global.h" -#include "extensionsystem/pluginmanager.h" - #include #include #include +namespace ExtensionSystem { +class PluginManager; +} class UAVObject; class UAVObjectField; class UAVObjectManager; @@ -120,7 +121,6 @@ protected: void disableMouseWheelEvents(); bool eventFilter(QObject *obj, QEvent *evt); - void saveObjectToSD(UAVObject *obj); UAVObjectManager *getObjectManager(); void addUAVObject(QString objectName, QList *reloadGroups = NULL); @@ -146,10 +146,6 @@ protected: void addWidgetBinding(QString objectName, QString fieldName, QWidget *widget, QString elementName); void addWidgetBinding(UAVObject *object, UAVObjectField *field, QWidget *widget, QString elementName); - void addApplySaveButtons(QPushButton *update, QPushButton *save); - void addReloadButton(QPushButton *button, int buttonGroup); - void addDefaultButton(QPushButton *button, int buttonGroup); - void addWidgetToReloadGroups(QWidget *widget, QList *reloadGroupIDs); bool addShadowWidgetBinding(QString objectName, QString fieldName, QWidget *widget, int index = 0, double scale = 1, @@ -259,8 +255,10 @@ private: ExtensionSystem::PluginManager *m_pluginManager; UAVObjectUtilManager *m_objectUtilManager; - SmartSaveButton *m_saveButton; + QHash m_updatedObjects; + + SmartSaveButton *m_saveButton; QHash m_helpButtons; QList m_reloadButtons; @@ -287,6 +285,11 @@ private: void doAddWidgetBinding(QString objectName, QString fieldName, QWidget *widget, int index = 0, double scale = 1, bool isLimited = false, QList *reloadGroupIDs = 0, quint32 instID = 0); + + void addApplyButton(QPushButton *button); + void addSaveButton(QPushButton *button); + void addReloadButton(QPushButton *button, int buttonGroup); + void addDefaultButton(QPushButton *button, int buttonGroup); }; #endif // CONFIGTASKWIDGET_H diff --git a/ground/gcs/src/plugins/uavobjectwidgetutils/smartsavebutton.cpp b/ground/gcs/src/plugins/uavobjectwidgetutils/smartsavebutton.cpp index 4c6aa15d5..41fbfb60a 100644 --- a/ground/gcs/src/plugins/uavobjectwidgetutils/smartsavebutton.cpp +++ b/ground/gcs/src/plugins/uavobjectwidgetutils/smartsavebutton.cpp @@ -30,13 +30,6 @@ SmartSaveButton::SmartSaveButton(ConfigTaskWidget *configTaskWidget) : configWidget(configTaskWidget) {} -void SmartSaveButton::addButtons(QPushButton *save, QPushButton *apply) -{ - buttonList.insert(save, save_button); - buttonList.insert(apply, apply_button); - connect(save, SIGNAL(clicked()), this, SLOT(processClick())); - connect(apply, SIGNAL(clicked()), this, SLOT(processClick())); -} void SmartSaveButton::addApplyButton(QPushButton *apply) { buttonList.insert(apply, apply_button); diff --git a/ground/gcs/src/plugins/uavobjectwidgetutils/smartsavebutton.h b/ground/gcs/src/plugins/uavobjectwidgetutils/smartsavebutton.h index eb9339458..9bdf6736f 100644 --- a/ground/gcs/src/plugins/uavobjectwidgetutils/smartsavebutton.h +++ b/ground/gcs/src/plugins/uavobjectwidgetutils/smartsavebutton.h @@ -46,7 +46,6 @@ public: public: SmartSaveButton(ConfigTaskWidget *configTaskWidget); - void addButtons(QPushButton *save, QPushButton *apply); void setObjects(QList); void addObject(UAVDataObject *); void clearObjects();