From e3afbf8b7578b7a8f55ac06199e02f7bef1e4857 Mon Sep 17 00:00:00 2001 From: Michael Carpenter Date: Fri, 12 Jul 2013 10:10:31 -0400 Subject: [PATCH] Addition of orientation combo box for compass config --- src/ui/configuration/CompassConfig.cc | 41 +++++++++++++++++++++++++++ src/ui/configuration/CompassConfig.ui | 8 +++--- src/ui/configuration/SonarConfig.ui | 2 +- 3 files changed, 46 insertions(+), 5 deletions(-) diff --git a/src/ui/configuration/CompassConfig.cc b/src/ui/configuration/CompassConfig.cc index 5c37b0cbf..43da906fd 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 7ac1ede4f..95b9362b4 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 6bce3475a..7c40d028c 100644 --- a/src/ui/configuration/SonarConfig.ui +++ b/src/ui/configuration/SonarConfig.ui @@ -58,7 +58,7 @@ - CheckBox + Enable -- 2.22.0