mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-11 19:24:10 +01:00
Fixes BT telemetry not working on non Windows OSs
Signed-off-by: James Cotton <peabody124@gmail.com>
This commit is contained in:
parent
213a915f67
commit
35fb0b3c6a
@ -205,31 +205,43 @@ void SerialConnection::resumePolling()
|
||||
}
|
||||
|
||||
BaudRateType SerialConnection::stringToBaud(QString str)
|
||||
{
|
||||
{
|
||||
if(str=="1200")
|
||||
return BAUD1200;
|
||||
if(str=="1800")
|
||||
return BAUD1800;
|
||||
else if(str=="2400")
|
||||
return BAUD1200;
|
||||
else if(str== "4800")
|
||||
return BAUD2400;
|
||||
else if(str== "4800")
|
||||
return BAUD4800;
|
||||
else if(str== "9600")
|
||||
return BAUD9600;
|
||||
else if(str== "14400")
|
||||
return BAUD14400;
|
||||
else if(str== "19200")
|
||||
return BAUD19200;
|
||||
else if(str== "38400")
|
||||
return BAUD38400;
|
||||
else if(str== "57600")
|
||||
else if(str== "56000")
|
||||
return BAUD56000;
|
||||
else if(str== "57600")
|
||||
return BAUD57600;
|
||||
else if(str== "76800")
|
||||
return BAUD76800;
|
||||
else if(str== "115200")
|
||||
return BAUD115200;
|
||||
else if(str== "128000")
|
||||
return BAUD128000;
|
||||
else if(str== "230400")
|
||||
return BAUD230400;
|
||||
else if(str== "256000")
|
||||
return BAUD256000;
|
||||
else if(str== "460800")
|
||||
return BAUD460800;
|
||||
else if(str== "921600")
|
||||
return BAUD921600;
|
||||
else
|
||||
return BAUD56000;
|
||||
return BAUD57600;
|
||||
}
|
||||
|
||||
SerialPlugin::SerialPlugin()
|
||||
|
@ -22,63 +22,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="cb_speed">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>1200</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>2400</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>4800</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>9600</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>19200</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>38400</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>57600</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>115200</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>230400</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>460800</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>921600</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
<widget class="QComboBox" name="cb_speed"/>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
|
@ -47,6 +47,38 @@ QWidget *SerialPluginOptionsPage::createPage(QWidget *parent)
|
||||
QWidget *optionsPageWidget = new QWidget;
|
||||
//main layout
|
||||
options_page->setupUi(optionsPageWidget);
|
||||
QStringList allowedSpeeds;
|
||||
allowedSpeeds<<"1200"
|
||||
#ifdef Q_OS_UNIX
|
||||
<<"1800" //POSIX ONLY
|
||||
#endif
|
||||
<<"2400"
|
||||
<<"4800"
|
||||
<<"9600"
|
||||
#ifdef Q_OS_WIN
|
||||
<<"14400" //WINDOWS ONLY
|
||||
#endif
|
||||
<<"19200"
|
||||
<<"38400"
|
||||
#ifdef Q_OS_WIN
|
||||
<<"56000" //WINDOWS ONLY
|
||||
#endif
|
||||
<<"57600"
|
||||
#ifdef Q_OS_UNIX
|
||||
<<"76800" //POSIX ONLY
|
||||
#endif
|
||||
<<"115200"
|
||||
#ifdef Q_OS_WIN
|
||||
<<"128000" //WINDOWS ONLY
|
||||
<<"230400" //WINDOWS ONLY
|
||||
<<"256000" //WINDOWS ONLY
|
||||
<<"460800" //WINDOWS ONLY
|
||||
<<"921600" //WINDOWS ONLY
|
||||
#endif
|
||||
;
|
||||
|
||||
|
||||
options_page->cb_speed->addItems(allowedSpeeds);
|
||||
options_page->cb_speed->setCurrentIndex(options_page->cb_speed->findText(m_config->speed()));
|
||||
return optionsPageWidget;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user