Browse Source

Merge branch 'refs/heads/master' into qtserialport

QGC4.4
Bill Bonney 12 years ago
parent
commit
d4e21f98c9
  1. 18
      src/ui/QGCToolBar.cc
  2. 1
      src/ui/QGCToolBar.h

18
src/ui/QGCToolBar.cc

@ -166,6 +166,22 @@ void QGCToolBar::createUI() @@ -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) @@ -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

1
src/ui/QGCToolBar.h

@ -105,6 +105,7 @@ protected: @@ -105,6 +105,7 @@ protected:
QLabel* toolBarBatteryVoltageLabel;
QGCMAVLinkLogPlayer* player;
QComboBox *portComboBox;
QComboBox *baudcomboBox;
bool changed;
float batteryPercent;
float batteryVoltage;

Loading…
Cancel
Save