mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-02 10:24:11 +01:00
OP-39 Added reset of stabilization data to default values when wizard writes its configuration.
This commit is contained in:
parent
5199d9e738
commit
8e66133b2d
@ -33,6 +33,7 @@
|
|||||||
#include "mixersettings.h"
|
#include "mixersettings.h"
|
||||||
#include "systemsettings.h"
|
#include "systemsettings.h"
|
||||||
#import "manualcontrolsettings.h"
|
#import "manualcontrolsettings.h"
|
||||||
|
#import "stabilizationsettings.h"
|
||||||
|
|
||||||
VehicleConfigurationHelper::VehicleConfigurationHelper(VehicleConfigurationSource *configSource)
|
VehicleConfigurationHelper::VehicleConfigurationHelper(VehicleConfigurationSource *configSource)
|
||||||
: m_configSource(configSource), m_uavoManager(0),
|
: m_configSource(configSource), m_uavoManager(0),
|
||||||
@ -61,6 +62,7 @@ bool VehicleConfigurationHelper::setupVehicle()
|
|||||||
applyOutputConfiguration();
|
applyOutputConfiguration();
|
||||||
applyFlighModeConfiguration();
|
applyFlighModeConfiguration();
|
||||||
applyLevellingConfiguration();
|
applyLevellingConfiguration();
|
||||||
|
applyStabilizationConfiguration();
|
||||||
|
|
||||||
bool result = saveChangesToController();
|
bool result = saveChangesToController();
|
||||||
if(result) {
|
if(result) {
|
||||||
@ -282,10 +284,21 @@ void VehicleConfigurationHelper::applyLevellingConfiguration()
|
|||||||
data.GyroBias[2] = -bias.m_gyroZBias;
|
data.GyroBias[2] = -bias.m_gyroZBias;
|
||||||
|
|
||||||
attitudeSettings->setData(data);
|
attitudeSettings->setData(data);
|
||||||
addModifiedObject(attitudeSettings, tr("Writing levelling bias settings"));
|
addModifiedObject(attitudeSettings, tr("Writing gyro and accelerometer bias settings"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VehicleConfigurationHelper::applyStabilizationConfiguration()
|
||||||
|
{
|
||||||
|
StabilizationSettings *stabSettings = StabilizationSettings::GetInstance(m_uavoManager);
|
||||||
|
Q_ASSERT(stabSettings);
|
||||||
|
StabilizationSettings::DataFields data = stabSettings->getData();
|
||||||
|
|
||||||
|
StabilizationSettings defaultSettings;
|
||||||
|
stabSettings->setData(defaultSettings.getData());
|
||||||
|
addModifiedObject(stabSettings, tr("Writing stabilization settings"));
|
||||||
|
}
|
||||||
|
|
||||||
void VehicleConfigurationHelper::applyMixerConfiguration(mixerSettings mixer)
|
void VehicleConfigurationHelper::applyMixerConfiguration(mixerSettings mixer)
|
||||||
{
|
{
|
||||||
// Set all mixer data
|
// Set all mixer data
|
||||||
|
@ -72,7 +72,7 @@ private:
|
|||||||
static const int MIXER_TYPE_MOTOR = 1;
|
static const int MIXER_TYPE_MOTOR = 1;
|
||||||
static const int MIXER_TYPE_SERVO = 2;
|
static const int MIXER_TYPE_SERVO = 2;
|
||||||
|
|
||||||
static const int PROGRESS_STEPS = 9;
|
static const int PROGRESS_STEPS = 10;
|
||||||
|
|
||||||
VehicleConfigurationSource *m_configSource;
|
VehicleConfigurationSource *m_configSource;
|
||||||
UAVObjectManager *m_uavoManager;
|
UAVObjectManager *m_uavoManager;
|
||||||
@ -86,6 +86,7 @@ private:
|
|||||||
void applyOutputConfiguration();
|
void applyOutputConfiguration();
|
||||||
void applyFlighModeConfiguration();
|
void applyFlighModeConfiguration();
|
||||||
void applyLevellingConfiguration();
|
void applyLevellingConfiguration();
|
||||||
|
void applyStabilizationConfiguration();
|
||||||
|
|
||||||
void applyMixerConfiguration(mixerSettings mixer);
|
void applyMixerConfiguration(mixerSettings mixer);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user