From ee16284dc763a8899bdabd59448997f6cfcfc07b Mon Sep 17 00:00:00 2001 From: Michael Carpenter Date: Mon, 1 Jul 2013 09:43:58 -0400 Subject: [PATCH] Addition of baud rate combo box on the toolbar --- src/ui/QGCToolBar.cc | 18 ++++++++++++++++++ src/ui/QGCToolBar.h | 1 + 2 files changed, 19 insertions(+) diff --git a/src/ui/QGCToolBar.cc b/src/ui/QGCToolBar.cc index 777a70aa1..649072640 100644 --- a/src/ui/QGCToolBar.cc +++ b/src/ui/QGCToolBar.cc @@ -166,6 +166,22 @@ void QGCToolBar::createUI() portComboBox->setEnabled(true); portComboBox->setMinimumWidth(200); addWidget(portComboBox); + + baudcomboBox = new QComboBox(this); + baudcomboBox->setToolTip(tr("Choose what baud rate to use")); + baudcomboBox->setEnabled(true); + baudcomboBox->setMinimumWidth(80); + baudcomboBox->addItem("9600"); + baudcomboBox->addItem("14400"); + baudcomboBox->addItem("19200"); + baudcomboBox->addItem("38400"); + baudcomboBox->addItem("57600"); + baudcomboBox->addItem("115200"); + baudcomboBox->setCurrentIndex(5); + addWidget(baudcomboBox); + + + connectButton = new QPushButton(tr("Connect"), this); connectButton->setToolTip(tr("Connect wireless link to MAV")); connectButton->setCheckable(true); @@ -610,6 +626,8 @@ void QGCToolBar::connectLink(bool connect) QString portname = portComboBox->currentText().split(":")[2]; link->setPortName(portname.trimmed()); } + int baud = baudcomboBox->currentText().toInt(); + link->setBaudRate(baud); link->connect(); } else diff --git a/src/ui/QGCToolBar.h b/src/ui/QGCToolBar.h index 887c73e83..8f268d349 100644 --- a/src/ui/QGCToolBar.h +++ b/src/ui/QGCToolBar.h @@ -105,6 +105,7 @@ protected: QLabel* toolBarBatteryVoltageLabel; QGCMAVLinkLogPlayer* player; QComboBox *portComboBox; + QComboBox *baudcomboBox; bool changed; float batteryPercent; float batteryVoltage; -- 2.22.0