mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-01 09:24:10 +01:00
small fix and some cleaning
This commit is contained in:
parent
5e43f85cc4
commit
761da06b6f
@ -148,6 +148,7 @@ QIODevice *SerialConnection::openDevice(const QString &deviceName)
|
|||||||
//we need to handle port settings here...
|
//we need to handle port settings here...
|
||||||
PortSettings set;
|
PortSettings set;
|
||||||
set.BaudRate = stringToBaud(m_config->speed());
|
set.BaudRate = stringToBaud(m_config->speed());
|
||||||
|
qDebug()<<"Serial telemetry running at "<<m_config->speed();
|
||||||
set.DataBits = DATA_8;
|
set.DataBits = DATA_8;
|
||||||
set.Parity = PAR_NONE;
|
set.Parity = PAR_NONE;
|
||||||
set.StopBits = STOP_1;
|
set.StopBits = STOP_1;
|
||||||
@ -227,6 +228,8 @@ BaudRateType SerialConnection::stringToBaud(QString str)
|
|||||||
return BAUD460800;
|
return BAUD460800;
|
||||||
else if(str== "921600")
|
else if(str== "921600")
|
||||||
return BAUD921600;
|
return BAUD921600;
|
||||||
|
else
|
||||||
|
return BAUD56000;
|
||||||
}
|
}
|
||||||
|
|
||||||
SerialPlugin::SerialPlugin()
|
SerialPlugin::SerialPlugin()
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
/**
|
/**
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
*
|
*
|
||||||
* @file dialpluginconfiguration.cpp
|
* @file serialpluginconfiguration.cpp
|
||||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||||
* @see The GNU Public License (GPL) Version 3
|
* @see The GNU Public License (GPL) Version 3
|
||||||
* @addtogroup GCSPlugins GCS Plugins
|
* @addtogroup GCSPlugins GCS Plugins
|
||||||
* @{
|
* @{
|
||||||
* @addtogroup DialPlugin Dial Plugin
|
* @addtogroup SerialPlugin Serial Connection Plugin
|
||||||
* @{
|
* @{
|
||||||
* @brief Plots flight information rotary style dials
|
* @brief Impliments serial connection to the flight hardware for Telemetry
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
/*
|
/*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -62,13 +62,12 @@ void SerialPluginConfiguration::saveConfig(QSettings* settings) const {
|
|||||||
void SerialPluginConfiguration::restoresettings()
|
void SerialPluginConfiguration::restoresettings()
|
||||||
{
|
{
|
||||||
settings->beginGroup(QLatin1String("SerialConnection"));
|
settings->beginGroup(QLatin1String("SerialConnection"));
|
||||||
|
QString str=(settings->value(QLatin1String("speed"), tr("")).toString());
|
||||||
QString str=(settings->value(QLatin1String("speed"), tr("")).toString());
|
if(str.isEmpty())
|
||||||
if(str.isEmpty())
|
m_speed="57600";
|
||||||
m_speed="57600";
|
else
|
||||||
else
|
m_speed=str;
|
||||||
m_speed=str;
|
settings->endGroup();
|
||||||
settings->endGroup();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
void SerialPluginConfiguration::savesettings() const
|
void SerialPluginConfiguration::savesettings() const
|
||||||
@ -77,3 +76,6 @@ void SerialPluginConfiguration::savesettings() const
|
|||||||
settings->setValue(QLatin1String("speed"), m_speed);
|
settings->setValue(QLatin1String("speed"), m_speed);
|
||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
}
|
}
|
||||||
|
SerialPluginConfiguration::~SerialPluginConfiguration()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
* @see The GNU Public License (GPL) Version 3
|
* @see The GNU Public License (GPL) Version 3
|
||||||
* @addtogroup GCSPlugins GCS Plugins
|
* @addtogroup GCSPlugins GCS Plugins
|
||||||
* @{
|
* @{
|
||||||
* @addtogroup SerialPlugin Serial Plugin
|
* @addtogroup SerialPlugin Serial Connection Plugin
|
||||||
* @{
|
* @{
|
||||||
* @brief Plots flight information rotary style Serials
|
* @brief Impliments serial connection to the flight hardware for Telemetry
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
/*
|
/*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -46,7 +46,7 @@ public:
|
|||||||
IUAVGadgetConfiguration *clone();
|
IUAVGadgetConfiguration *clone();
|
||||||
void savesettings() const;
|
void savesettings() const;
|
||||||
void restoresettings();
|
void restoresettings();
|
||||||
|
virtual ~SerialPluginConfiguration();
|
||||||
private:
|
private:
|
||||||
QString m_speed;
|
QString m_speed;
|
||||||
QSettings* settings;
|
QSettings* settings;
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
/**
|
/**
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
*
|
*
|
||||||
* @file dialpluginoptionspage.cpp
|
* @file serialpluginoptionspage.cpp
|
||||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||||
* @see The GNU Public License (GPL) Version 3
|
* @see The GNU Public License (GPL) Version 3
|
||||||
* @addtogroup GCSPlugins GCS Plugins
|
* @addtogroup GCSPlugins GCS Plugins
|
||||||
* @{
|
* @{
|
||||||
* @addtogroup DialPlugin Dial Plugin
|
* @addtogroup SerialPlugin Serial Connection Plugin
|
||||||
* @{
|
* @{
|
||||||
* @brief Plots flight information rotary style dials
|
* @brief Impliments serial connection to the flight hardware for Telemetry
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
/*
|
/*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 3 of the License, or
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
@ -67,5 +67,5 @@ void SerialPluginOptionsPage::apply()
|
|||||||
|
|
||||||
void SerialPluginOptionsPage::finish()
|
void SerialPluginOptionsPage::finish()
|
||||||
{
|
{
|
||||||
delete m_config;
|
delete options_page;
|
||||||
}
|
}
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
/**
|
/**
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
*
|
*
|
||||||
* @file Serialpluginoptionspage.h
|
* @file serialpluginoptionspage.h
|
||||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||||
* @see The GNU Public License (GPL) Version 3
|
* @see The GNU Public License (GPL) Version 3
|
||||||
* @addtogroup GCSPlugins GCS Plugins
|
* @addtogroup GCSPlugins GCS Plugins
|
||||||
* @{
|
* @{
|
||||||
* @addtogroup SerialPlugin Serial Plugin
|
* @addtogroup SerialPlugin Serial Connection Plugin
|
||||||
* @{
|
* @{
|
||||||
* @brief Plots flight information rotary style Serials
|
* @brief Impliments serial connection to the flight hardware for Telemetry
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
/*
|
/*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 3 of the License, or
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
Loading…
Reference in New Issue
Block a user