1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-17 02:52:12 +01:00

Merge branch 'os/CameraStab-use-ConfigTaskWidget' of ssh://git.openpilot.org/OpenPilot into CameraStab-use-ConfigTaskWidget

This commit is contained in:
PT_Dreamer 2012-08-15 12:52:51 +01:00
commit a78766c7b2
2 changed files with 12 additions and 1 deletions

View File

@ -65,8 +65,10 @@ ConfigCameraStabilizationWidget::ConfigCameraStabilizationWidget(QWidget *parent
addUAVObject("HwSettings");
addUAVObject("MixerSettings");
// To set special widgets to defaults when requested
connect(this, SIGNAL(defaultRequested(int)), this, SLOT(defaultRequestedSlot(int)));
disableMouseWheelEvents();
connect(this,SIGNAL(defaultRequested(int)),this,SLOT(defaultRequestedSlot(int)));
}
ConfigCameraStabilizationWidget::~ConfigCameraStabilizationWidget()
@ -215,13 +217,21 @@ void ConfigCameraStabilizationWidget::updateObjectsFromWidgets()
ConfigTaskWidget::updateObjectsFromWidgets();
}
/*
* This slot function is called when "Default" button is clicked.
* All special widgets which belong to the group passed should be set here.
*/
void ConfigCameraStabilizationWidget::defaultRequestedSlot(int group)
{
Q_UNUSED(group);
HwSettings *hwSettings = HwSettings::GetInstance(getObjectManager());
HwSettings *hwSettingsDefault=(HwSettings*)hwSettings->dirtyClone();
HwSettings::DataFields hwSettingsData = hwSettingsDefault->getData();
m_camerastabilization->enableCameraStabilization->setChecked(
hwSettingsData.OptionalModules[HwSettings::OPTIONALMODULES_CAMERASTAB] == HwSettings::OPTIONALMODULES_ENABLED);
QComboBox *outputs[] = {
m_camerastabilization->rollChannel,
m_camerastabilization->pitchChannel,

View File

@ -46,6 +46,7 @@ private:
Ui_CameraStabilizationWidget *m_camerastabilization;
void refreshWidgetsValues(UAVObject *obj);
void updateObjectsFromWidgets();
private slots:
void defaultRequestedSlot(int group);
};