Commit e3afbf8b authored by Michael Carpenter's avatar Michael Carpenter

Addition of orientation combo box for compass config

parent 1bd6a3e6
......@@ -16,6 +16,33 @@ CompassConfig::CompassConfig(QWidget *parent) : QWidget(parent)
connect(UASManager::instance(),SIGNAL(activeUASSet(UASInterface*)),this,SLOT(activeUASSet(UASInterface*)));
activeUASSet(UASManager::instance()->getActiveUAS());
ui.orientationComboBox->addItem("ROTATION_NONE");
ui.orientationComboBox->addItem("ROTATION_YAW_45");
ui.orientationComboBox->addItem("ROTATION_YAW_90");
ui.orientationComboBox->addItem("ROTATION_YAW_135");
ui.orientationComboBox->addItem("ROTATION_YAW_180");
ui.orientationComboBox->addItem("ROTATION_YAW_225");
ui.orientationComboBox->addItem("ROTATION_YAW_270");
ui.orientationComboBox->addItem("ROTATION_YAW_315");
ui.orientationComboBox->addItem("ROTATION_ROLL_180");
ui.orientationComboBox->addItem("ROTATION_ROLL_180_YAW_45");
ui.orientationComboBox->addItem("ROTATION_ROLL_180_YAW_90");
ui.orientationComboBox->addItem("ROTATION_ROLL_180_YAW_135");
ui.orientationComboBox->addItem("ROTATION_PITCH_180");
ui.orientationComboBox->addItem("ROTATION_ROLL_180_YAW_225");
ui.orientationComboBox->addItem("ROTATION_ROLL_180_YAW_270");
ui.orientationComboBox->addItem("ROTATION_ROLL_180_YAW_315");
ui.orientationComboBox->addItem("ROTATION_ROLL_90");
ui.orientationComboBox->addItem("ROTATION_ROLL_90_YAW_45");
ui.orientationComboBox->addItem("ROTATION_ROLL_90_YAW_90");
ui.orientationComboBox->addItem("ROTATION_ROLL_90_YAW_135");
ui.orientationComboBox->addItem("ROTATION_ROLL_270");
ui.orientationComboBox->addItem("ROTATION_ROLL_270_YAW_45");
ui.orientationComboBox->addItem("ROTATION_ROLL_270_YAW_90");
ui.orientationComboBox->addItem("ROTATION_ROLL_270_YAW_135");
ui.orientationComboBox->addItem("ROTATION_PITCH_90");
ui.orientationComboBox->addItem("ROTATION_PITCH_270");
ui.orientationComboBox->addItem("ROTATION_MAX");
}
CompassConfig::~CompassConfig()
{
......@@ -39,12 +66,14 @@ void CompassConfig::parameterChanged(int uas, int component, QString parameterNa
ui.enableCheckBox->setChecked(false);
ui.autoDecCheckBox->setEnabled(false);
ui.declinationLineEdit->setEnabled(false);
ui.orientationComboBox->setEnabled(false);
}
else
{
ui.enableCheckBox->setChecked(true);
ui.autoDecCheckBox->setEnabled(true);
ui.declinationLineEdit->setEnabled(true);
ui.orientationComboBox->setEnabled(true);
}
ui.enableCheckBox->setEnabled(true);
}
......@@ -63,6 +92,12 @@ void CompassConfig::parameterChanged(int uas, int component, QString parameterNa
{
ui.declinationLineEdit->setText(QString::number(value.toDouble()));
}
else if (parameterName == "COMPASS_ORIENT")
{
disconnect(ui.orientationComboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(orientationComboChanged(int)));
ui.orientationComboBox->setCurrentIndex(value.toInt());
connect(ui.orientationComboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(orientationComboChanged(int)));
}
}
void CompassConfig::enableClicked(bool enabled)
......@@ -104,5 +139,11 @@ void CompassConfig::autoDecClicked(bool enabled)
void CompassConfig::orientationComboChanged(int index)
{
//COMPASS_ORIENT
if (!m_uas)
{
return;
}
m_uas->getParamManager()->setParameter(1,"COMPASS_ORIENT",index);
}
......@@ -55,9 +55,9 @@
<widget class="QPushButton" name="pushButton">
<property name="geometry">
<rect>
<x>300</x>
<x>290</x>
<y>180</y>
<width>91</width>
<width>101</width>
<height>23</height>
</rect>
</property>
......@@ -70,7 +70,7 @@
<rect>
<x>390</x>
<y>180</y>
<width>91</width>
<width>101</width>
<height>23</height>
</rect>
</property>
......@@ -118,7 +118,7 @@
<rect>
<x>10</x>
<y>70</y>
<width>201</width>
<width>211</width>
<height>111</height>
</rect>
</property>
......
......@@ -58,7 +58,7 @@
</rect>
</property>
<property name="text">
<string>CheckBox</string>
<string>Enable</string>
</property>
</widget>
<widget class="QComboBox" name="sonarTypeComboBox">
......
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