diff --git a/src/ui/configuration/CompassConfig.cc b/src/ui/configuration/CompassConfig.cc index 5c37b0cbf6a0ca5ad7900d35aace8e5f219f8d73..43da906fd809e3115c260055a9d088c776b9da9c 100644 --- a/src/ui/configuration/CompassConfig.cc +++ b/src/ui/configuration/CompassConfig.cc @@ -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); } diff --git a/src/ui/configuration/CompassConfig.ui b/src/ui/configuration/CompassConfig.ui index 7ac1ede4fa0c325327b60794af9f79e8e3b4b875..95b9362b441dc7279f45a2c26adf80606b89d7ea 100644 --- a/src/ui/configuration/CompassConfig.ui +++ b/src/ui/configuration/CompassConfig.ui @@ -55,9 +55,9 @@ - 300 + 290 180 - 91 + 101 23 @@ -70,7 +70,7 @@ 390 180 - 91 + 101 23 @@ -118,7 +118,7 @@ 10 70 - 201 + 211 111 diff --git a/src/ui/configuration/SonarConfig.ui b/src/ui/configuration/SonarConfig.ui index 6bce3475ae776af46200c947cb29004b44b9e676..7c40d028ce6c772db234b8972473c3ed906b7019 100644 --- a/src/ui/configuration/SonarConfig.ui +++ b/src/ui/configuration/SonarConfig.ui @@ -58,7 +58,7 @@ - CheckBox + Enable