From deac94253e2fdd5fac1686e949bc4b16e0455c8e Mon Sep 17 00:00:00 2001 From: zedamota Date: Fri, 11 Nov 2011 23:42:36 +0000 Subject: [PATCH] small fix and some cleaning --- .../plugins/serialconnection/serialplugin.cpp | 3 +++ .../serialpluginconfiguration.cpp | 22 ++++++++++--------- .../serialpluginconfiguration.h | 6 ++--- .../serialpluginoptionspage.cpp | 10 ++++----- .../serialpluginoptionspage.h | 8 +++---- 5 files changed, 27 insertions(+), 22 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/serialconnection/serialplugin.cpp b/ground/openpilotgcs/src/plugins/serialconnection/serialplugin.cpp index bae5a885a..23bb8f9f9 100644 --- a/ground/openpilotgcs/src/plugins/serialconnection/serialplugin.cpp +++ b/ground/openpilotgcs/src/plugins/serialconnection/serialplugin.cpp @@ -148,6 +148,7 @@ QIODevice *SerialConnection::openDevice(const QString &deviceName) //we need to handle port settings here... PortSettings set; set.BaudRate = stringToBaud(m_config->speed()); + qDebug()<<"Serial telemetry running at "<speed(); set.DataBits = DATA_8; set.Parity = PAR_NONE; set.StopBits = STOP_1; @@ -227,6 +228,8 @@ BaudRateType SerialConnection::stringToBaud(QString str) return BAUD460800; else if(str== "921600") return BAUD921600; + else + return BAUD56000; } SerialPlugin::SerialPlugin() diff --git a/ground/openpilotgcs/src/plugins/serialconnection/serialpluginconfiguration.cpp b/ground/openpilotgcs/src/plugins/serialconnection/serialpluginconfiguration.cpp index 49bcf2ae8..789085596 100644 --- a/ground/openpilotgcs/src/plugins/serialconnection/serialpluginconfiguration.cpp +++ b/ground/openpilotgcs/src/plugins/serialconnection/serialpluginconfiguration.cpp @@ -1,14 +1,14 @@ /** ****************************************************************************** * - * @file dialpluginconfiguration.cpp + * @file serialpluginconfiguration.cpp * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @see The GNU Public License (GPL) Version 3 * @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 @@ -62,13 +62,12 @@ void SerialPluginConfiguration::saveConfig(QSettings* settings) const { void SerialPluginConfiguration::restoresettings() { settings->beginGroup(QLatin1String("SerialConnection")); - - QString str=(settings->value(QLatin1String("speed"), tr("")).toString()); - if(str.isEmpty()) - m_speed="57600"; - else - m_speed=str; - settings->endGroup(); + QString str=(settings->value(QLatin1String("speed"), tr("")).toString()); + if(str.isEmpty()) + m_speed="57600"; + else + m_speed=str; + settings->endGroup(); } void SerialPluginConfiguration::savesettings() const @@ -77,3 +76,6 @@ void SerialPluginConfiguration::savesettings() const settings->setValue(QLatin1String("speed"), m_speed); settings->endGroup(); } +SerialPluginConfiguration::~SerialPluginConfiguration() +{ +} diff --git a/ground/openpilotgcs/src/plugins/serialconnection/serialpluginconfiguration.h b/ground/openpilotgcs/src/plugins/serialconnection/serialpluginconfiguration.h index 968595fb2..793ad102b 100644 --- a/ground/openpilotgcs/src/plugins/serialconnection/serialpluginconfiguration.h +++ b/ground/openpilotgcs/src/plugins/serialconnection/serialpluginconfiguration.h @@ -6,9 +6,9 @@ * @see The GNU Public License (GPL) Version 3 * @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 @@ -46,7 +46,7 @@ public: IUAVGadgetConfiguration *clone(); void savesettings() const; void restoresettings(); - + virtual ~SerialPluginConfiguration(); private: QString m_speed; QSettings* settings; diff --git a/ground/openpilotgcs/src/plugins/serialconnection/serialpluginoptionspage.cpp b/ground/openpilotgcs/src/plugins/serialconnection/serialpluginoptionspage.cpp index b861a5cee..29d8b3784 100644 --- a/ground/openpilotgcs/src/plugins/serialconnection/serialpluginoptionspage.cpp +++ b/ground/openpilotgcs/src/plugins/serialconnection/serialpluginoptionspage.cpp @@ -1,16 +1,16 @@ /** ****************************************************************************** * - * @file dialpluginoptionspage.cpp + * @file serialpluginoptionspage.cpp * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @see The GNU Public License (GPL) Version 3 * @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 * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or @@ -67,5 +67,5 @@ void SerialPluginOptionsPage::apply() void SerialPluginOptionsPage::finish() { - delete m_config; + delete options_page; } diff --git a/ground/openpilotgcs/src/plugins/serialconnection/serialpluginoptionspage.h b/ground/openpilotgcs/src/plugins/serialconnection/serialpluginoptionspage.h index 97ea604c8..6ce23b743 100644 --- a/ground/openpilotgcs/src/plugins/serialconnection/serialpluginoptionspage.h +++ b/ground/openpilotgcs/src/plugins/serialconnection/serialpluginoptionspage.h @@ -1,16 +1,16 @@ /** ****************************************************************************** * - * @file Serialpluginoptionspage.h + * @file serialpluginoptionspage.h * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @see The GNU Public License (GPL) Version 3 * @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 * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or