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:
commit
a78766c7b2
@ -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,
|
||||
|
@ -46,6 +46,7 @@ private:
|
||||
Ui_CameraStabilizationWidget *m_camerastabilization;
|
||||
void refreshWidgetsValues(UAVObject *obj);
|
||||
void updateObjectsFromWidgets();
|
||||
|
||||
private slots:
|
||||
void defaultRequestedSlot(int group);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user