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

Merge branch 'steve/OP-1903_Add_TxPID_controls_for_AttitudeSettings' into steve/OP-1904_Display_current_TxPID_settings_on_OSD

This commit is contained in:
Steve Evans 2015-05-23 22:24:48 +01:00
commit 1cdc1635bd

View File

@ -28,6 +28,7 @@
#include "configtxpidwidget.h" #include "configtxpidwidget.h"
#include "txpidsettings.h" #include "txpidsettings.h"
#include "hwsettings.h" #include "hwsettings.h"
#include "attitudesettings.h"
#include "stabilizationsettings.h" #include "stabilizationsettings.h"
#include "stabilizationsettingsbank1.h" #include "stabilizationsettingsbank1.h"
#include "stabilizationsettingsbank2.h" #include "stabilizationsettingsbank2.h"
@ -305,6 +306,15 @@ float ConfigTxPIDWidget::getDefaultValueForPidOption(int pidOption)
if (pidOption == TxPIDSettings::PIDS_GYROTAU) { if (pidOption == TxPIDSettings::PIDS_GYROTAU) {
StabilizationSettings *stab = qobject_cast<StabilizationSettings *>(getObject(QString("StabilizationSettings"))); StabilizationSettings *stab = qobject_cast<StabilizationSettings *>(getObject(QString("StabilizationSettings")));
return stab->getGyroTau(); return stab->getGyroTau();
} else if (pidOption == TxPIDSettings::PIDS_ACCELTAU) {
AttitudeSettings *att = qobject_cast<AttitudeSettings *>(getObject(QString("AttitudeSettings")));
return att->getAccelTau();
} else if (pidOption == TxPIDSettings::PIDS_ACCELKP) {
AttitudeSettings *att = qobject_cast<AttitudeSettings *>(getObject(QString("AttitudeSettings")));
return att->getAccelKp();
} else if (pidOption == TxPIDSettings::PIDS_ACCELKI) {
AttitudeSettings *att = qobject_cast<AttitudeSettings *>(getObject(QString("AttitudeSettings")));
return att->getAccelKi();
} }
int pidBankIndex = m_txpid->pidBank->currentIndex(); int pidBankIndex = m_txpid->pidBank->currentIndex();