Commit ca053bd0 authored by Michael Carpenter's avatar Michael Carpenter

Addition of pitch/roll/yaw P value locking in ArduCopter Pid Config

parent 365a330c
......@@ -3,6 +3,11 @@
ArduCopterPidConfig::ArduCopterPidConfig(QWidget *parent) : AP2ConfigWidget(parent)
{
ui.setupUi(this);
m_pitchRollLocked = false;
connect(ui.checkBox,SIGNAL(clicked(bool)),this,SLOT(lockCheckBoxClicked(bool)));
connect(ui.stabilPitchPSpinBox,SIGNAL(valueChanged(double)),this,SLOT(stabilLockedChanged(double)));
connect(ui.stabilRollPSpinBox,SIGNAL(valueChanged(double)),this,SLOT(stabilLockedChanged(double)));
connect(ui.stabilYawPSpinBox,SIGNAL(valueChanged(double)),this,SLOT(stabilLockedChanged(double)));
m_nameToBoxMap["STB_RLL_P"] = ui.stabilPitchPSpinBox;
m_nameToBoxMap["STB_PIT_P"] = ui.stabilRollPSpinBox;
m_nameToBoxMap["STB_YAW_P"] = ui.stabilYawPSpinBox;
......@@ -109,6 +114,25 @@ ArduCopterPidConfig::ArduCopterPidConfig(QWidget *parent) : AP2ConfigWidget(pare
}
initConnections();
}
void ArduCopterPidConfig::lockCheckBoxClicked(bool checked)
{
m_pitchRollLocked = checked;
}
void ArduCopterPidConfig::stabilLockedChanged(double value)
{
if (m_pitchRollLocked)
{
disconnect(ui.stabilPitchPSpinBox,SIGNAL(valueChanged(double)),this,SLOT(stabilLockedChanged(double)));
disconnect(ui.stabilRollPSpinBox,SIGNAL(valueChanged(double)),this,SLOT(stabilLockedChanged(double)));
disconnect(ui.stabilYawPSpinBox,SIGNAL(valueChanged(double)),this,SLOT(stabilLockedChanged(double)));
ui.stabilPitchPSpinBox->setValue(value);
ui.stabilRollPSpinBox->setValue(value);
ui.stabilYawPSpinBox->setValue(value);
connect(ui.stabilPitchPSpinBox,SIGNAL(valueChanged(double)),this,SLOT(stabilLockedChanged(double)));
connect(ui.stabilRollPSpinBox,SIGNAL(valueChanged(double)),this,SLOT(stabilLockedChanged(double)));
connect(ui.stabilYawPSpinBox,SIGNAL(valueChanged(double)),this,SLOT(stabilLockedChanged(double)));
}
}
ArduCopterPidConfig::~ArduCopterPidConfig()
{
......
......@@ -17,7 +17,10 @@ private slots:
void writeButtonClicked();
void refreshButtonClicked();
void parameterChanged(int uas, int component, QString parameterName, QVariant value);
void lockCheckBoxClicked(bool checked);
void stabilLockedChanged(double value);
private:
bool m_pitchRollLocked;
QList<QPair<int,QString> > m_ch6ValueToTextList;
QList<QPair<int,QString> > m_ch78ValueToTextList;
QMap<QString,QDoubleSpinBox*> m_nameToBoxMap;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment