mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +01:00
LP-245 config: add exportMode() method to ConfigTaskPanel
This commit is contained in:
parent
27c9fa2372
commit
d21b5e3b42
@ -31,7 +31,6 @@
|
||||
#include "ui_cc_hw_settings.h"
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <coreplugin/generalsettings.h>
|
||||
|
||||
#include "hwsettings.h"
|
||||
|
||||
@ -58,13 +57,10 @@ ConfigCCHWWidget::ConfigCCHWWidget(QWidget *parent) : ConfigTaskWidget(parent)
|
||||
|
||||
addApplySaveButtons(m_telemetry->saveTelemetryToRAM, m_telemetry->saveTelemetryToSD);
|
||||
|
||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||
Core::Internal::GeneralSettings *settings = pm->getObject<Core::Internal::GeneralSettings>();
|
||||
if (!settings->useExpertMode()) {
|
||||
m_telemetry->saveTelemetryToRAM->setVisible(false);
|
||||
}
|
||||
m_telemetry->saveTelemetryToRAM->setVisible(expertMode());
|
||||
|
||||
UAVObjectUtilManager *utilMngr = pm->getObject<UAVObjectUtilManager>();
|
||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||
UAVObjectUtilManager *utilMngr = pm->getObject<UAVObjectUtilManager>();
|
||||
int id = utilMngr->getBoardModel();
|
||||
switch (id) {
|
||||
case 0x0101:
|
||||
|
@ -38,9 +38,6 @@
|
||||
|
||||
#include "ui_camerastabilization.h"
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <coreplugin/generalsettings.h>
|
||||
|
||||
#include "camerastabsettings.h"
|
||||
#include "hwsettings.h"
|
||||
#include "mixersettings.h"
|
||||
@ -60,11 +57,7 @@ ConfigCameraStabilizationWidget::ConfigCameraStabilizationWidget(QWidget *parent
|
||||
|
||||
addApplySaveButtons(ui->camerastabilizationSaveRAM, ui->camerastabilizationSaveSD);
|
||||
|
||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||
Core::Internal::GeneralSettings *settings = pm->getObject<Core::Internal::GeneralSettings>();
|
||||
if (!settings->useExpertMode()) {
|
||||
ui->camerastabilizationSaveRAM->setVisible(false);
|
||||
}
|
||||
ui->camerastabilizationSaveRAM->setVisible(expertMode());
|
||||
|
||||
// These widgets don't have direct relation to UAVObjects
|
||||
// and need special processing
|
||||
|
@ -30,8 +30,6 @@
|
||||
#include "ui_ccattitude.h"
|
||||
|
||||
#include "utils/coordinateconversions.h"
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <coreplugin/generalsettings.h>
|
||||
#include <calibration/calibrationutils.h>
|
||||
|
||||
#include "attitudesettings.h"
|
||||
@ -60,11 +58,7 @@ ConfigCCAttitudeWidget::ConfigCCAttitudeWidget(QWidget *parent) :
|
||||
|
||||
addApplySaveButtons(ui->applyButton, ui->saveButton);
|
||||
|
||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||
Core::Internal::GeneralSettings *settings = pm->getObject<Core::Internal::GeneralSettings>();
|
||||
if (!settings->useExpertMode()) {
|
||||
ui->applyButton->setVisible(false);
|
||||
}
|
||||
ui->applyButton->setVisible(expertMode());
|
||||
|
||||
addUAVObject("AttitudeSettings");
|
||||
addUAVObject("AccelGyroSettings");
|
||||
|
@ -28,11 +28,6 @@
|
||||
|
||||
#include "configinputwidget.h"
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <coreplugin/generalsettings.h>
|
||||
#include <utils/stylehelper.h>
|
||||
#include <uavobjecthelper.h>
|
||||
|
||||
#include "ui_input.h"
|
||||
#include "ui_input_wizard.h"
|
||||
|
||||
@ -42,6 +37,9 @@
|
||||
#include "failsafechannelform.h"
|
||||
#include "ui_failsafechannelform.h"
|
||||
|
||||
#include <utils/stylehelper.h>
|
||||
#include <uavobjecthelper.h>
|
||||
|
||||
#include <systemalarms.h>
|
||||
|
||||
#include <QDebug>
|
||||
@ -96,12 +94,7 @@ ConfigInputWidget::ConfigInputWidget(QWidget *parent) :
|
||||
connect(ui->inputHelp, SIGNAL(clicked()), this, SLOT(openHelp()));
|
||||
|
||||
addApplySaveButtons(ui->saveRCInputToRAM, ui->saveRCInputToSD);
|
||||
|
||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||
Core::Internal::GeneralSettings *settings = pm->getObject<Core::Internal::GeneralSettings>();
|
||||
if (!settings->useExpertMode()) {
|
||||
ui->saveRCInputToRAM->setVisible(false);
|
||||
}
|
||||
ui->saveRCInputToRAM->setVisible(expertMode());
|
||||
|
||||
manualCommandObj = ManualControlCommand::GetInstance(getObjectManager());
|
||||
manualSettingsObj = ManualControlSettings::GetInstance(getObjectManager());
|
||||
|
@ -30,8 +30,6 @@
|
||||
|
||||
#include "ui_oplink.h"
|
||||
|
||||
#include <coreplugin/generalsettings.h>
|
||||
|
||||
#include <uavobjectutilmanager.h>
|
||||
|
||||
#include <oplinksettings.h>
|
||||
@ -59,12 +57,7 @@ ConfigOPLinkWidget::ConfigOPLinkWidget(QWidget *parent) : ConfigTaskWidget(paren
|
||||
disableMouseWheelEvents();
|
||||
|
||||
addApplySaveButtons(m_oplink->Apply, m_oplink->Save);
|
||||
|
||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||
Core::Internal::GeneralSettings *settings = pm->getObject<Core::Internal::GeneralSettings>();
|
||||
if (!settings->useExpertMode()) {
|
||||
m_oplink->Apply->setVisible(false);
|
||||
}
|
||||
m_oplink->Apply->setVisible(expertMode());
|
||||
|
||||
oplinkStatusObj = dynamic_cast<OPLinkStatus *>(getObject("OPLinkStatus"));
|
||||
Q_ASSERT(oplinkStatusObj);
|
||||
|
@ -36,7 +36,6 @@
|
||||
|
||||
#include "uavsettingsimportexport/uavsettingsimportexportfactory.h"
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <coreplugin/generalsettings.h>
|
||||
#include <uavobjecthelper.h>
|
||||
|
||||
#include "mixersettings.h"
|
||||
@ -70,15 +69,11 @@ ConfigOutputWidget::ConfigOutputWidget(QWidget *parent) : ConfigTaskWidget(paren
|
||||
connect(m_ui->outputHelp, SIGNAL(clicked()), this, SLOT(openHelp()));
|
||||
|
||||
addApplySaveButtons(m_ui->saveRCOutputToRAM, m_ui->saveRCOutputToSD);
|
||||
|
||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||
Core::Internal::GeneralSettings *settings = pm->getObject<Core::Internal::GeneralSettings>();
|
||||
if (!settings->useExpertMode()) {
|
||||
m_ui->saveRCOutputToRAM->setVisible(false);
|
||||
}
|
||||
m_ui->saveRCOutputToRAM->setVisible(expertMode());
|
||||
|
||||
m_ui->gvFrame->setVisible(false);
|
||||
|
||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||
UAVSettingsImportExportFactory *importexportplugin = pm->getObject<UAVSettingsImportExportFactory>();
|
||||
connect(importexportplugin, SIGNAL(importAboutToBegin()), this, SLOT(stopTests()));
|
||||
|
||||
|
@ -29,8 +29,6 @@
|
||||
|
||||
#include "ui_configrevohwwidget.h"
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <coreplugin/generalsettings.h>
|
||||
#include <uavobjecthelper.h>
|
||||
|
||||
#include "hwsettings.h"
|
||||
@ -53,13 +51,7 @@ ConfigRevoHWWidget::ConfigRevoHWWidget(QWidget *parent) : ConfigTaskWidget(paren
|
||||
connect(m_ui->cchwHelp, SIGNAL(clicked()), this, SLOT(openHelp()));
|
||||
|
||||
addApplySaveButtons(m_ui->saveTelemetryToRAM, m_ui->saveTelemetryToSD);
|
||||
|
||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||
Core::Internal::GeneralSettings *settings = pm->getObject<Core::Internal::GeneralSettings>();
|
||||
if (!settings->useExpertMode()) {
|
||||
m_ui->saveTelemetryToRAM->setEnabled(false);
|
||||
m_ui->saveTelemetryToRAM->setVisible(false);
|
||||
}
|
||||
m_ui->saveTelemetryToRAM->setVisible(expertMode());
|
||||
|
||||
addWidgetBinding("HwSettings", "RM_FlexiPort", m_ui->cbFlexi);
|
||||
addWidgetBinding("HwSettings", "RM_MainPort", m_ui->cbMain);
|
||||
|
@ -29,8 +29,6 @@
|
||||
|
||||
#include "ui_configrevonanohwwidget.h"
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <coreplugin/generalsettings.h>
|
||||
#include <uavobjecthelper.h>
|
||||
|
||||
#include "hwsettings.h"
|
||||
@ -53,13 +51,7 @@ ConfigRevoNanoHWWidget::ConfigRevoNanoHWWidget(QWidget *parent) : ConfigTaskWidg
|
||||
connect(m_ui->cchwHelp, SIGNAL(clicked()), this, SLOT(openHelp()));
|
||||
|
||||
addApplySaveButtons(m_ui->saveTelemetryToRAM, m_ui->saveTelemetryToSD);
|
||||
|
||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||
Core::Internal::GeneralSettings *settings = pm->getObject<Core::Internal::GeneralSettings>();
|
||||
if (!settings->useExpertMode()) {
|
||||
m_ui->saveTelemetryToRAM->setEnabled(false);
|
||||
m_ui->saveTelemetryToRAM->setVisible(false);
|
||||
}
|
||||
m_ui->saveTelemetryToRAM->setVisible(expertMode());
|
||||
|
||||
addWidgetBinding("HwSettings", "RM_FlexiPort", m_ui->cbFlexi);
|
||||
addWidgetBinding("HwSettings", "RM_MainPort", m_ui->cbMain);
|
||||
|
@ -38,9 +38,6 @@
|
||||
#include <accelstate.h>
|
||||
#include <magstate.h>
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <coreplugin/generalsettings.h>
|
||||
|
||||
#include "assertions.h"
|
||||
#include "calibration.h"
|
||||
#include "calibration/calibrationutils.h"
|
||||
@ -93,12 +90,7 @@ ConfigRevoWidget::ConfigRevoWidget(QWidget *parent) :
|
||||
connect(m_ui->attitudeHelp, SIGNAL(clicked()), this, SLOT(openHelp()));
|
||||
|
||||
addApplySaveButtons(m_ui->revoCalSettingsSaveRAM, m_ui->revoCalSettingsSaveSD);
|
||||
|
||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||
Core::Internal::GeneralSettings *settings = pm->getObject<Core::Internal::GeneralSettings>();
|
||||
if (!settings->useExpertMode()) {
|
||||
m_ui->revoCalSettingsSaveRAM->setVisible(false);
|
||||
}
|
||||
m_ui->revoCalSettingsSaveRAM->setVisible(expertMode());
|
||||
|
||||
// Initialization of the visual help
|
||||
m_ui->calibrationVisualHelp->setScene(new QGraphicsScene(this));
|
||||
|
@ -29,8 +29,6 @@
|
||||
|
||||
#include "ui_configsparky2hwwidget.h"
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <coreplugin/generalsettings.h>
|
||||
#include <uavobjecthelper.h>
|
||||
|
||||
#include "hwsettings.h"
|
||||
@ -53,13 +51,7 @@ ConfigSparky2HWWidget::ConfigSparky2HWWidget(QWidget *parent) : ConfigTaskWidget
|
||||
connect(m_ui->cchwHelp, SIGNAL(clicked()), this, SLOT(openHelp()));
|
||||
|
||||
addApplySaveButtons(m_ui->saveTelemetryToRAM, m_ui->saveTelemetryToSD);
|
||||
|
||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||
Core::Internal::GeneralSettings *settings = pm->getObject<Core::Internal::GeneralSettings>();
|
||||
if (!settings->useExpertMode()) {
|
||||
m_ui->saveTelemetryToRAM->setEnabled(false);
|
||||
m_ui->saveTelemetryToRAM->setVisible(false);
|
||||
}
|
||||
m_ui->saveTelemetryToRAM->setVisible(expertMode());
|
||||
|
||||
addWidgetBinding("HwSettings", "SPK2_FlexiPort", m_ui->cbFlexi);
|
||||
addWidgetBinding("HwSettings", "SPK2_MainPort", m_ui->cbMain);
|
||||
|
@ -29,9 +29,6 @@
|
||||
|
||||
#include "ui_stabilization.h"
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <coreplugin/generalsettings.h>
|
||||
|
||||
#include "objectpersistence.h"
|
||||
#include "altitudeholdsettings.h"
|
||||
#include "stabilizationsettings.h"
|
||||
@ -70,11 +67,7 @@ ConfigStabilizationWidget::ConfigStabilizationWidget(QWidget *parent) : ConfigTa
|
||||
|
||||
disableMouseWheelEvents();
|
||||
|
||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||
Core::Internal::GeneralSettings *settings = pm->getObject<Core::Internal::GeneralSettings>();
|
||||
if (!settings->useExpertMode()) {
|
||||
ui->saveStabilizationToRAM_6->setVisible(false);
|
||||
}
|
||||
ui->saveStabilizationToRAM_6->setVisible(expertMode());
|
||||
|
||||
setupExpoPlot();
|
||||
|
||||
|
@ -30,9 +30,6 @@
|
||||
|
||||
#include "ui_txpid.h"
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <coreplugin/generalsettings.h>
|
||||
|
||||
#include "txpidsettings.h"
|
||||
#include "hwsettings.h"
|
||||
#include "attitudesettings.h"
|
||||
@ -54,12 +51,7 @@ ConfigTxPIDWidget::ConfigTxPIDWidget(QWidget *parent) : ConfigTaskWidget(parent)
|
||||
disableMouseWheelEvents();
|
||||
|
||||
addApplySaveButtons(m_txpid->Apply, m_txpid->Save);
|
||||
|
||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||
Core::Internal::GeneralSettings *settings = pm->getObject<Core::Internal::GeneralSettings>();
|
||||
if (!settings->useExpertMode()) {
|
||||
m_txpid->Apply->setVisible(false);
|
||||
}
|
||||
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
|
||||
|
@ -31,7 +31,6 @@
|
||||
|
||||
#include "configgadgetfactory.h"
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <coreplugin/generalsettings.h>
|
||||
|
||||
#include "systemsettings.h"
|
||||
#include "actuatorsettings.h"
|
||||
@ -130,13 +129,9 @@ ConfigVehicleTypeWidget::ConfigVehicleTypeWidget(QWidget *parent) : ConfigTaskWi
|
||||
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();
|
||||
Core::Internal::GeneralSettings *settings = pm->getObject<Core::Internal::GeneralSettings>();
|
||||
if (!settings->useExpertMode()) {
|
||||
m_aircraft->saveAircraftToRAM->setVisible(false);
|
||||
}
|
||||
|
||||
ConfigGadgetFactory *configGadgetFactory = pm->getObject<ConfigGadgetFactory>();
|
||||
connect(m_aircraft->vehicleSetupWizardButton, SIGNAL(clicked()), configGadgetFactory, SIGNAL(onOpenVehicleConfigurationWizard()));
|
||||
|
||||
@ -258,7 +253,7 @@ void ConfigVehicleTypeWidget::updateObjectsFromWidgetsImpl()
|
||||
UAVDataObject *system = dynamic_cast<UAVDataObject *>(getObjectManager()->getObject(QString("SystemSettings")));
|
||||
Q_ASSERT(system);
|
||||
|
||||
QPointer<UAVObjectField> field = system->getField(QString("AirframeType"));
|
||||
UAVObjectField *field = system->getField(QString("AirframeType"));
|
||||
if (field) {
|
||||
field->setValue(airframeType);
|
||||
}
|
||||
|
@ -27,6 +27,7 @@
|
||||
*/
|
||||
#include "configtaskwidget.h"
|
||||
|
||||
#include <coreplugin/generalsettings.h>
|
||||
#include "uavobjectmanager.h"
|
||||
#include "uavobject.h"
|
||||
#include "uavobjectutilmanager.h"
|
||||
@ -89,6 +90,14 @@ ConfigTaskWidget::~ConfigTaskWidget()
|
||||
}
|
||||
}
|
||||
|
||||
bool ConfigTaskWidget::expertMode() const
|
||||
{
|
||||
Core::Internal::GeneralSettings *settings = m_pluginManager->getObject<Core::Internal::GeneralSettings>();
|
||||
|
||||
return settings->useExpertMode();
|
||||
}
|
||||
|
||||
|
||||
void ConfigTaskWidget::addWidget(QWidget *widget)
|
||||
{
|
||||
addWidgetBinding("", "", widget);
|
||||
|
@ -173,10 +173,11 @@ signals:
|
||||
void enableControlsChanged(bool enable);
|
||||
|
||||
protected:
|
||||
int boardModel()
|
||||
int boardModel() const
|
||||
{
|
||||
return m_currentBoardId;
|
||||
}
|
||||
bool expertMode() const;
|
||||
virtual void enableControls(bool enable);
|
||||
virtual QString mapObjectName(const QString objectName);
|
||||
virtual UAVObject *getObject(const QString name, quint32 instId = 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user