From 3e87388bccbbdca00403cb0da18093f58834b456 Mon Sep 17 00:00:00 2001 From: andrew Date: Mon, 28 Jun 2010 00:28:30 +0000 Subject: [PATCH] OP-87 Rename TCPtelemetryconnection to ipconnection to reflect recent changes and ability to connect via TCP or UDP git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@912 ebee16cc-31ac-478f-84a7-5cbb03baadba --- .../ipconnection.pluginspec} | 2 +- .../src/plugins/ipconnection/ipconnection.pri | 3 ++ .../src/plugins/ipconnection/ipconnection.pro | 16 +++++++ .../ipconnection_dependencies.pri} | 0 .../ipconnection_global.h} | 16 +++---- .../ipconnectionconfiguration.cpp} | 22 +++++----- .../ipconnectionconfiguration.h} | 14 +++--- .../ipconnectionoptionspage.cpp} | 20 ++++----- .../ipconnectionoptionspage.h} | 24 +++++----- .../ipconnectionoptionspage.ui} | 4 +- .../ipconnectionplugin.cpp} | 38 ++++++++-------- .../ipconnectionplugin.h} | 39 ++++++++-------- .../ui_ipconnectionoptionspage.h} | 44 +++++++++---------- ground/src/plugins/plugins.pro | 8 ++-- .../tcptelemetryconnection/tcptelemetry.pri | 3 -- .../tcptelemetryconnection.pro | 16 ------- 16 files changed, 133 insertions(+), 136 deletions(-) rename ground/src/plugins/{tcptelemetryconnection/TCPtelemetry.pluginspec => ipconnection/ipconnection.pluginspec} (84%) create mode 100644 ground/src/plugins/ipconnection/ipconnection.pri create mode 100644 ground/src/plugins/ipconnection/ipconnection.pro rename ground/src/plugins/{tcptelemetryconnection/tcptelemetry_dependencies.pri => ipconnection/ipconnection_dependencies.pri} (100%) rename ground/src/plugins/{tcptelemetryconnection/tcptelemetry_global.h => ipconnection/ipconnection_global.h} (79%) rename ground/src/plugins/{tcptelemetryconnection/tcptelemetryconfiguration.cpp => ipconnection/ipconnectionconfiguration.cpp} (79%) rename ground/src/plugins/{tcptelemetryconnection/tcptelemetryconfiguration.h => ipconnection/ipconnectionconfiguration.h} (86%) rename ground/src/plugins/{tcptelemetryconnection/tcptelemetryoptionspage.cpp => ipconnection/ipconnectionoptionspage.cpp} (80%) rename ground/src/plugins/{tcptelemetryconnection/tcptelemetryoptionspage.h => ipconnection/ipconnectionoptionspage.h} (76%) rename ground/src/plugins/{tcptelemetryconnection/tcptelemetryoptionspage.ui => ipconnection/ipconnectionoptionspage.ui} (94%) rename ground/src/plugins/{tcptelemetryconnection/tcptelemetryplugin.cpp => ipconnection/ipconnectionplugin.cpp} (81%) rename ground/src/plugins/{tcptelemetryconnection/tcptelemetryplugin.h => ipconnection/ipconnectionplugin.h} (72%) rename ground/src/plugins/{tcptelemetryconnection/ui_tcptelemetryoptionspage.h => ipconnection/ui_ipconnectionoptionspage.h} (61%) delete mode 100644 ground/src/plugins/tcptelemetryconnection/tcptelemetry.pri delete mode 100644 ground/src/plugins/tcptelemetryconnection/tcptelemetryconnection.pro diff --git a/ground/src/plugins/tcptelemetryconnection/TCPtelemetry.pluginspec b/ground/src/plugins/ipconnection/ipconnection.pluginspec similarity index 84% rename from ground/src/plugins/tcptelemetryconnection/TCPtelemetry.pluginspec rename to ground/src/plugins/ipconnection/ipconnection.pluginspec index b41d03080..65848952c 100644 --- a/ground/src/plugins/tcptelemetryconnection/TCPtelemetry.pluginspec +++ b/ground/src/plugins/ipconnection/ipconnection.pluginspec @@ -1,4 +1,4 @@ - + The OpenPilot Project (C) 2010 OpenPilot Project GNU Public License (GPL) Version 3 diff --git a/ground/src/plugins/ipconnection/ipconnection.pri b/ground/src/plugins/ipconnection/ipconnection.pri new file mode 100644 index 000000000..fc15b3efc --- /dev/null +++ b/ground/src/plugins/ipconnection/ipconnection.pri @@ -0,0 +1,3 @@ +include(ipconnection_dependencies.pri) + +LIBS *= -l$$qtLibraryTarget(IPconnection) diff --git a/ground/src/plugins/ipconnection/ipconnection.pro b/ground/src/plugins/ipconnection/ipconnection.pro new file mode 100644 index 000000000..6447529b8 --- /dev/null +++ b/ground/src/plugins/ipconnection/ipconnection.pro @@ -0,0 +1,16 @@ +TEMPLATE = lib +TARGET = IPconnection +include(../../openpilotgcsplugin.pri) +include(ipconnection_dependencies.pri) +HEADERS += ipconnectionplugin.h \ + ipconnection_global.h \ + ipconnectionconfiguration.h \ + ipconnectionoptionspage.h +SOURCES += ipconnectionplugin.cpp \ + ipconnectionconfiguration.cpp \ + ipconnectionoptionspage.cpp +FORMS += ipconnectionoptionspage.ui +RESOURCES += +DEFINES += IPconnection_LIBRARY +OTHER_FILES += IPconnection.pluginspec +QT += network diff --git a/ground/src/plugins/tcptelemetryconnection/tcptelemetry_dependencies.pri b/ground/src/plugins/ipconnection/ipconnection_dependencies.pri similarity index 100% rename from ground/src/plugins/tcptelemetryconnection/tcptelemetry_dependencies.pri rename to ground/src/plugins/ipconnection/ipconnection_dependencies.pri diff --git a/ground/src/plugins/tcptelemetryconnection/tcptelemetry_global.h b/ground/src/plugins/ipconnection/ipconnection_global.h similarity index 79% rename from ground/src/plugins/tcptelemetryconnection/tcptelemetry_global.h rename to ground/src/plugins/ipconnection/ipconnection_global.h index 1a8c0f234..0dd7bee9f 100644 --- a/ground/src/plugins/tcptelemetryconnection/tcptelemetry_global.h +++ b/ground/src/plugins/ipconnection/ipconnection_global.h @@ -1,11 +1,11 @@ /** ****************************************************************************** * - * @file TCPtelemetry_global.h + * @file IPconnection_global.h * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @brief * @see The GNU Public License (GPL) Version 3 - * @defgroup TCPtelemetry_plugin + * @defgroup IPconnection_plugin * @{ * *****************************************************************************/ @@ -25,15 +25,15 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef TCPtelemetry_GLOBAL_H -#define TCPtelemetry_GLOBAL_H +#ifndef IPconnection_GLOBAL_H +#define IPconnection_GLOBAL_H #include -#if defined(TCPtelemetry_LIBRARY) -# define TCPtelemetry_EXPORT Q_DECL_EXPORT +#if defined(IPconnection_LIBRARY) +# define IPconnection_EXPORT Q_DECL_EXPORT #else -# define TCPtelemetry_EXPORT Q_DECL_IMPORT +# define IPconnection_EXPORT Q_DECL_IMPORT #endif -#endif // TCPtelemetry_GLOBAL_H +#endif // IPconnection_GLOBAL_H diff --git a/ground/src/plugins/tcptelemetryconnection/tcptelemetryconfiguration.cpp b/ground/src/plugins/ipconnection/ipconnectionconfiguration.cpp similarity index 79% rename from ground/src/plugins/tcptelemetryconnection/tcptelemetryconfiguration.cpp rename to ground/src/plugins/ipconnection/ipconnectionconfiguration.cpp index 862192d27..91a1b2ced 100644 --- a/ground/src/plugins/tcptelemetryconnection/tcptelemetryconfiguration.cpp +++ b/ground/src/plugins/ipconnection/ipconnectionconfiguration.cpp @@ -1,7 +1,7 @@ /** ****************************************************************************** * - * @file TCPtelemetryconfiguration.cpp + * @file IPconnectionconfiguration.cpp * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @brief * @see The GNU Public License (GPL) Version 3 @@ -25,11 +25,11 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "tcptelemetryconfiguration.h" +#include "ipconnectionconfiguration.h" #include #include -TCPtelemetryConfiguration::TCPtelemetryConfiguration(QString classId, const QByteArray &state, QObject *parent) : +IPconnectionConfiguration::IPconnectionConfiguration(QString classId, const QByteArray &state, QObject *parent) : IUAVGadgetConfiguration(classId, parent), m_HostName("127.0.0.1"), m_Port(1000), @@ -37,19 +37,19 @@ TCPtelemetryConfiguration::TCPtelemetryConfiguration(QString classId, const QByt { settings = Core::ICore::instance()->settings(); } -TCPtelemetryConfiguration::~TCPtelemetryConfiguration() +IPconnectionConfiguration::~IPconnectionConfiguration() { } -IUAVGadgetConfiguration *TCPtelemetryConfiguration::clone() +IUAVGadgetConfiguration *IPconnectionConfiguration::clone() { - TCPtelemetryConfiguration *m = new TCPtelemetryConfiguration(this->classId()); + IPconnectionConfiguration *m = new IPconnectionConfiguration(this->classId()); m->m_Port = m_Port; m->m_HostName = m_HostName; m->m_UseTCP = m_UseTCP; return m; } -QByteArray TCPtelemetryConfiguration::saveState() const +QByteArray IPconnectionConfiguration::saveState() const { QByteArray bytes; QDataStream stream(&bytes, QIODevice::WriteOnly); @@ -61,9 +61,9 @@ QByteArray TCPtelemetryConfiguration::saveState() const } -void TCPtelemetryConfiguration::savesettings() const +void IPconnectionConfiguration::savesettings() const { - settings->beginGroup(QLatin1String("TCPtelemetryconnection")); + settings->beginGroup(QLatin1String("IPconnection")); settings->beginWriteArray("Current"); settings->setArrayIndex(0); @@ -75,9 +75,9 @@ void TCPtelemetryConfiguration::savesettings() const } -void TCPtelemetryConfiguration::restoresettings() +void IPconnectionConfiguration::restoresettings() { - settings->beginGroup(QLatin1String("TCPtelemetryconnection")); + settings->beginGroup(QLatin1String("IPconnection")); settings->beginReadArray("Current"); settings->setArrayIndex(0); diff --git a/ground/src/plugins/tcptelemetryconnection/tcptelemetryconfiguration.h b/ground/src/plugins/ipconnection/ipconnectionconfiguration.h similarity index 86% rename from ground/src/plugins/tcptelemetryconnection/tcptelemetryconfiguration.h rename to ground/src/plugins/ipconnection/ipconnectionconfiguration.h index 0d80de29d..ed89f699d 100644 --- a/ground/src/plugins/tcptelemetryconnection/tcptelemetryconfiguration.h +++ b/ground/src/plugins/ipconnection/ipconnectionconfiguration.h @@ -1,7 +1,7 @@ /** ****************************************************************************** * - * @file TCPtelemetryconfiguration.h + * @file IPconnectionconfiguration.h * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @brief * @see The GNU Public License (GPL) Version 3 @@ -25,8 +25,8 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef TCPtelemetryCONFIGURATION_H -#define TCPtelemetryCONFIGURATION_H +#ifndef IPconnectionCONFIGURATION_H +#define IPconnectionCONFIGURATION_H #include #include @@ -34,7 +34,7 @@ using namespace Core; -class TCPtelemetryConfiguration : public IUAVGadgetConfiguration +class IPconnectionConfiguration : public IUAVGadgetConfiguration { Q_OBJECT Q_PROPERTY(QString HostName READ HostName WRITE setHostName) @@ -42,8 +42,8 @@ Q_PROPERTY(int Port READ Port WRITE setPort) Q_PROPERTY(int UseTCP READ UseTCP WRITE setUseTCP) public: - explicit TCPtelemetryConfiguration(QString classId, const QByteArray &state = 0, QObject *parent = 0); - virtual ~TCPtelemetryConfiguration(); + explicit IPconnectionConfiguration(QString classId, const QByteArray &state = 0, QObject *parent = 0); + virtual ~IPconnectionConfiguration(); QByteArray saveState() const; //void savesettings(QSettings* settings) const; //void restoresettings(QSettings* settings); @@ -70,4 +70,4 @@ private: }; -#endif // TCPtelemetryCONFIGURATION_H +#endif // IPconnectionCONFIGURATION_H diff --git a/ground/src/plugins/tcptelemetryconnection/tcptelemetryoptionspage.cpp b/ground/src/plugins/ipconnection/ipconnectionoptionspage.cpp similarity index 80% rename from ground/src/plugins/tcptelemetryconnection/tcptelemetryoptionspage.cpp rename to ground/src/plugins/ipconnection/ipconnectionoptionspage.cpp index 92f5deb55..f44abb3bb 100644 --- a/ground/src/plugins/tcptelemetryconnection/tcptelemetryoptionspage.cpp +++ b/ground/src/plugins/ipconnection/ipconnectionoptionspage.cpp @@ -1,7 +1,7 @@ /** ****************************************************************************** * - * @file TCPtelemetryoptionspage.cpp + * @file IPconnectionoptionspage.cpp * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @brief * @see The GNU Public License (GPL) Version 3 @@ -25,8 +25,8 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "tcptelemetryoptionspage.h" -#include "tcptelemetryconfiguration.h" +#include "ipconnectionoptionspage.h" +#include "ipconnectionconfiguration.h" #include #include #include @@ -35,22 +35,22 @@ #include #include -#include "ui_tcptelemetryoptionspage.h" +#include "ui_ipconnectionoptionspage.h" -TCPtelemetryOptionsPage::TCPtelemetryOptionsPage(TCPtelemetryConfiguration *config, QObject *parent) : +IPconnectionOptionsPage::IPconnectionOptionsPage(IPconnectionConfiguration *config, QObject *parent) : IOptionsPage(parent), m_config(config) { } -TCPtelemetryOptionsPage::~TCPtelemetryOptionsPage() +IPconnectionOptionsPage::~IPconnectionOptionsPage() { } -QWidget *TCPtelemetryOptionsPage::createPage(QWidget *parent) +QWidget *IPconnectionOptionsPage::createPage(QWidget *parent) { - m_page = new Ui::TCPtelemetryOptionsPage(); + m_page = new Ui::IPconnectionOptionsPage(); QWidget *w = new QWidget(parent); m_page->setupUi(w); @@ -62,7 +62,7 @@ QWidget *TCPtelemetryOptionsPage::createPage(QWidget *parent) return w; } -void TCPtelemetryOptionsPage::apply() +void IPconnectionOptionsPage::apply() { m_config->setPort(m_page->Port->value()); m_config->setHostName(m_page->HostName->text()); @@ -75,7 +75,7 @@ void TCPtelemetryOptionsPage::apply() } -void TCPtelemetryOptionsPage::finish() +void IPconnectionOptionsPage::finish() { delete m_page; } diff --git a/ground/src/plugins/tcptelemetryconnection/tcptelemetryoptionspage.h b/ground/src/plugins/ipconnection/ipconnectionoptionspage.h similarity index 76% rename from ground/src/plugins/tcptelemetryconnection/tcptelemetryoptionspage.h rename to ground/src/plugins/ipconnection/ipconnectionoptionspage.h index fab4104b9..83c3db1e2 100644 --- a/ground/src/plugins/tcptelemetryconnection/tcptelemetryoptionspage.h +++ b/ground/src/plugins/ipconnection/ipconnectionoptionspage.h @@ -1,7 +1,7 @@ /** ****************************************************************************** * - * @file TCPtelemetryoptionspage.h + * @file IPconnectionoptionspage.h * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @brief * @see The GNU Public License (GPL) Version 3 @@ -25,30 +25,29 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef TCPtelemetryOPTIONSPAGE_H -#define TCPtelemetryOPTIONSPAGE_H +#ifndef IPconnectionOPTIONSPAGE_H +#define IPconnectionOPTIONSPAGE_H #include "coreplugin/dialogs/ioptionspage.h" -//#include -class TCPtelemetryConfiguration; +class IPconnectionConfiguration; namespace Core { class IUAVGadgetConfiguration; } namespace Ui { - class TCPtelemetryOptionsPage; + class IPconnectionOptionsPage; } using namespace Core; -class TCPtelemetryOptionsPage : public IOptionsPage +class IPconnectionOptionsPage : public IOptionsPage { Q_OBJECT public: - explicit TCPtelemetryOptionsPage(TCPtelemetryConfiguration *config, QObject *parent = 0); - virtual ~TCPtelemetryOptionsPage(); + explicit IPconnectionOptionsPage(IPconnectionConfiguration *config, QObject *parent = 0); + virtual ~IPconnectionOptionsPage(); QString id() const { return QLatin1String("settings"); } QString trName() const { return tr("settings"); } @@ -64,10 +63,9 @@ signals: public slots: private: - TCPtelemetryConfiguration *m_config; - Ui::TCPtelemetryOptionsPage *m_page; - //QSettings* settings; + IPconnectionConfiguration *m_config; + Ui::IPconnectionOptionsPage *m_page; }; -#endif // TCPtelemetryOPTIONSPAGE_H +#endif // IPconnectionOPTIONSPAGE_H diff --git a/ground/src/plugins/tcptelemetryconnection/tcptelemetryoptionspage.ui b/ground/src/plugins/ipconnection/ipconnectionoptionspage.ui similarity index 94% rename from ground/src/plugins/tcptelemetryconnection/tcptelemetryoptionspage.ui rename to ground/src/plugins/ipconnection/ipconnectionoptionspage.ui index 97a8c9f8c..e02a15577 100644 --- a/ground/src/plugins/tcptelemetryconnection/tcptelemetryoptionspage.ui +++ b/ground/src/plugins/ipconnection/ipconnectionoptionspage.ui @@ -1,7 +1,7 @@ - TCPtelemetryOptionsPage - + IPconnectionOptionsPage + 0 diff --git a/ground/src/plugins/tcptelemetryconnection/tcptelemetryplugin.cpp b/ground/src/plugins/ipconnection/ipconnectionplugin.cpp similarity index 81% rename from ground/src/plugins/tcptelemetryconnection/tcptelemetryplugin.cpp rename to ground/src/plugins/ipconnection/ipconnectionplugin.cpp index 9cb5f8cb4..f39fc662c 100644 --- a/ground/src/plugins/tcptelemetryconnection/tcptelemetryplugin.cpp +++ b/ground/src/plugins/ipconnection/ipconnectionplugin.cpp @@ -1,11 +1,11 @@ /** ****************************************************************************** * - * @file TCPtelemetryplugin.cpp + * @file IPconnectionplugin.cpp * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @brief Register connection object for the core connection manager * @see The GNU Public License (GPL) Version 3 - * @defgroup TCPtelemetry_plugin + * @defgroup IPconnection_plugin * @{ * *****************************************************************************/ @@ -27,7 +27,7 @@ //The core of this plugin has been directly copied from the serial plugin and converted to work over a TCP link instead of a direct serial link -#include "tcptelemetryplugin.h" +#include "ipconnectionplugin.h" #include @@ -42,13 +42,13 @@ #include -TCPtelemetryConnection::TCPtelemetryConnection() +IPconnectionConnection::IPconnectionConnection() { //create all our objects - m_config = new TCPtelemetryConfiguration("IP Network Telemetry", NULL, this); + m_config = new IPconnectionConfiguration("IP Network Telemetry", NULL, this); m_config->restoresettings(); - m_optionspage = new TCPtelemetryOptionsPage(m_config,this); + m_optionspage = new IPconnectionOptionsPage(m_config,this); //just signal whenever we have a device event... QMainWindow *mw = Core::ICore::instance()->mainWindow(); @@ -58,20 +58,20 @@ TCPtelemetryConnection::TCPtelemetryConnection() this, SLOT(onEnumerationChanged())); } -TCPtelemetryConnection::~TCPtelemetryConnection() +IPconnectionConnection::~IPconnectionConnection() { //tcpSocket->close (); //delete(tcpSocket); } -void TCPtelemetryConnection::onEnumerationChanged() +void IPconnectionConnection::onEnumerationChanged() {//no change from serial plugin emit availableDevChanged(this); } -QStringList TCPtelemetryConnection::availableDevices() +QStringList IPconnectionConnection::availableDevices() { QStringList list; @@ -81,7 +81,7 @@ QStringList TCPtelemetryConnection::availableDevices() return list; } -QIODevice *TCPtelemetryConnection::openDevice(const QString &deviceName) +QIODevice *IPconnectionConnection::openDevice(const QString &deviceName) { const int Timeout = 5 * 1000; int state; @@ -123,7 +123,7 @@ QIODevice *TCPtelemetryConnection::openDevice(const QString &deviceName) return tcpSocket; } -void TCPtelemetryConnection::closeDevice(const QString &deviceName) +void IPconnectionConnection::closeDevice(const QString &deviceName) { //still having problems with the app crashing when we reference the tcpsocket outside the openDevice function... //tcpSocket->close (); @@ -134,12 +134,12 @@ void TCPtelemetryConnection::closeDevice(const QString &deviceName) } -QString TCPtelemetryConnection::connectionName() +QString IPconnectionConnection::connectionName() {//updated from serial plugin return QString("Network telemetry port"); } -QString TCPtelemetryConnection::shortName() +QString IPconnectionConnection::shortName() {//updated from serial plugin if (m_config->UseTCP()) { return QString("TCP"); @@ -149,25 +149,25 @@ QString TCPtelemetryConnection::shortName() } -TCPtelemetryPlugin::TCPtelemetryPlugin() +IPconnectionPlugin::IPconnectionPlugin() {//no change from serial plugin } -TCPtelemetryPlugin::~TCPtelemetryPlugin() +IPconnectionPlugin::~IPconnectionPlugin() {//manually remove the options page object removeObject(m_connection->Optionspage()); } -void TCPtelemetryPlugin::extensionsInitialized() +void IPconnectionPlugin::extensionsInitialized() { addAutoReleasedObject(m_connection); } -bool TCPtelemetryPlugin::initialize(const QStringList &arguments, QString *errorString) +bool IPconnectionPlugin::initialize(const QStringList &arguments, QString *errorString) { Q_UNUSED(arguments); Q_UNUSED(errorString); - m_connection = new TCPtelemetryConnection(); + m_connection = new IPconnectionConnection(); //must manage this registration of child object ourselves //if we use an autorelease here it causes the GCS to crash //as it is deleting objects as the app closes... @@ -176,4 +176,4 @@ bool TCPtelemetryPlugin::initialize(const QStringList &arguments, QString *error return true; } -Q_EXPORT_PLUGIN(TCPtelemetryPlugin) +Q_EXPORT_PLUGIN(IPconnectionPlugin) diff --git a/ground/src/plugins/tcptelemetryconnection/tcptelemetryplugin.h b/ground/src/plugins/ipconnection/ipconnectionplugin.h similarity index 72% rename from ground/src/plugins/tcptelemetryconnection/tcptelemetryplugin.h rename to ground/src/plugins/ipconnection/ipconnectionplugin.h index 2d495b9a5..c319bc808 100644 --- a/ground/src/plugins/tcptelemetryconnection/tcptelemetryplugin.h +++ b/ground/src/plugins/ipconnection/ipconnectionplugin.h @@ -1,11 +1,11 @@ /** ****************************************************************************** * - * @file TCPtelemetryplugin.h + * @file IPconnectionplugin.h * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @brief * @see The GNU Public License (GPL) Version 3 - * @defgroup TCPtelemetry_plugin + * @defgroup IPconnection_plugin * @{ * *****************************************************************************/ @@ -25,13 +25,12 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef TCPtelemetryPLUGIN_H -#define TCPtelemetryPLUGIN_H +#ifndef IPconnectionPLUGIN_H +#define IPconnectionPLUGIN_H -#include "tcptelemetry_global.h" -#include "tcptelemetryoptionspage.h" -#include "tcptelemetryconfiguration.h" -//#include "tcptelemetryfactory.h" +#include "ipconnection_global.h" +#include "ipconnectionoptionspage.h" +#include "ipconnectionconfiguration.h" #include "coreplugin/iconnection.h" #include //#include @@ -47,13 +46,13 @@ class IConnection; * Plugin will add a instance of this class to the pool, * so the connection manager can use it. */ -class TCPtelemetry_EXPORT TCPtelemetryConnection +class IPconnection_EXPORT IPconnectionConnection : public Core::IConnection { Q_OBJECT public: - TCPtelemetryConnection(); - virtual ~TCPtelemetryConnection(); + IPconnectionConnection(); + virtual ~IPconnectionConnection(); virtual QStringList availableDevices(); virtual QIODevice *openDevice(const QString &deviceName); @@ -62,8 +61,8 @@ public: virtual QString connectionName(); virtual QString shortName(); - TCPtelemetryConfiguration * Config() const { return m_config; } - TCPtelemetryOptionsPage * Optionspage() const { return m_optionspage; } + IPconnectionConfiguration * Config() const { return m_config; } + IPconnectionOptionsPage * Optionspage() const { return m_optionspage; } @@ -71,29 +70,29 @@ protected slots: void onEnumerationChanged(); private: QAbstractSocket *tcpSocket; - TCPtelemetryConfiguration *m_config; - TCPtelemetryOptionsPage *m_optionspage; + IPconnectionConfiguration *m_config; + IPconnectionOptionsPage *m_optionspage; //QSettings* settings; }; -class TCPtelemetry_EXPORT TCPtelemetryPlugin +class IPconnection_EXPORT IPconnectionPlugin : public ExtensionSystem::IPlugin { Q_OBJECT public: - TCPtelemetryPlugin(); - ~TCPtelemetryPlugin(); + IPconnectionPlugin(); + ~IPconnectionPlugin(); virtual bool initialize(const QStringList &arguments, QString *error_message); virtual void extensionsInitialized(); private: - TCPtelemetryConnection *m_connection; + IPconnectionConnection *m_connection; }; -#endif // TCPtelemetryPLUGIN_H +#endif // IPconnectionPLUGIN_H diff --git a/ground/src/plugins/tcptelemetryconnection/ui_tcptelemetryoptionspage.h b/ground/src/plugins/ipconnection/ui_ipconnectionoptionspage.h similarity index 61% rename from ground/src/plugins/tcptelemetryconnection/ui_tcptelemetryoptionspage.h rename to ground/src/plugins/ipconnection/ui_ipconnectionoptionspage.h index f19c8368e..4e3058063 100644 --- a/ground/src/plugins/tcptelemetryconnection/ui_tcptelemetryoptionspage.h +++ b/ground/src/plugins/ipconnection/ui_ipconnectionoptionspage.h @@ -1,5 +1,5 @@ /******************************************************************************** -** Form generated from reading UI file 'TCPtelemetryoptionspage.ui' +** Form generated from reading UI file 'IPconnectionoptionspage.ui' ** ** Created: Sun Jun 27 12:45:24 2010 ** by: Qt User Interface Compiler version 4.6.2 @@ -25,7 +25,7 @@ QT_BEGIN_NAMESPACE -class Ui_TCPtelemetryOptionsPage +class Ui_IPconnectionOptionsPage { public: QGridLayout *gridLayout; @@ -37,69 +37,69 @@ public: QLineEdit *HostName; QLabel *label_2; - void setupUi(QWidget *TCPtelemetryOptionsPage) + void setupUi(QWidget *IPconnectionOptionsPage) { - if (TCPtelemetryOptionsPage->objectName().isEmpty()) - TCPtelemetryOptionsPage->setObjectName(QString::fromUtf8("TCPtelemetryOptionsPage")); - TCPtelemetryOptionsPage->resize(388, 300); - gridLayout = new QGridLayout(TCPtelemetryOptionsPage); + if (IPconnectionOptionsPage->objectName().isEmpty()) + IPconnectionOptionsPage->setObjectName(QString::fromUtf8("IPconnectionOptionsPage")); + IPconnectionOptionsPage->resize(388, 300); + gridLayout = new QGridLayout(IPconnectionOptionsPage); gridLayout->setContentsMargins(0, 0, 0, 0); gridLayout->setObjectName(QString::fromUtf8("gridLayout")); horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); gridLayout->addItem(horizontalSpacer, 0, 3, 1, 1); - UseTCP = new QRadioButton(TCPtelemetryOptionsPage); + UseTCP = new QRadioButton(IPconnectionOptionsPage); UseTCP->setObjectName(QString::fromUtf8("UseTCP")); gridLayout->addWidget(UseTCP, 2, 2, 1, 1); - UseUDP = new QRadioButton(TCPtelemetryOptionsPage); + UseUDP = new QRadioButton(IPconnectionOptionsPage); UseUDP->setObjectName(QString::fromUtf8("UseUDP")); gridLayout->addWidget(UseUDP, 3, 2, 1, 1); - Port = new QSpinBox(TCPtelemetryOptionsPage); + Port = new QSpinBox(IPconnectionOptionsPage); Port->setObjectName(QString::fromUtf8("Port")); Port->setMinimum(1); Port->setMaximum(999999); gridLayout->addWidget(Port, 4, 2, 1, 1); - label_3 = new QLabel(TCPtelemetryOptionsPage); + label_3 = new QLabel(IPconnectionOptionsPage); label_3->setObjectName(QString::fromUtf8("label_3")); gridLayout->addWidget(label_3, 4, 1, 1, 1); - HostName = new QLineEdit(TCPtelemetryOptionsPage); + HostName = new QLineEdit(IPconnectionOptionsPage); HostName->setObjectName(QString::fromUtf8("HostName")); gridLayout->addWidget(HostName, 0, 2, 1, 1); - label_2 = new QLabel(TCPtelemetryOptionsPage); + label_2 = new QLabel(IPconnectionOptionsPage); label_2->setObjectName(QString::fromUtf8("label_2")); gridLayout->addWidget(label_2, 0, 1, 1, 1); - retranslateUi(TCPtelemetryOptionsPage); + retranslateUi(IPconnectionOptionsPage); - QMetaObject::connectSlotsByName(TCPtelemetryOptionsPage); + QMetaObject::connectSlotsByName(IPconnectionOptionsPage); } // setupUi - void retranslateUi(QWidget *TCPtelemetryOptionsPage) + void retranslateUi(QWidget *IPconnectionOptionsPage) { - TCPtelemetryOptionsPage->setWindowTitle(QApplication::translate("TCPtelemetryOptionsPage", "Form", 0, QApplication::UnicodeUTF8)); - UseTCP->setText(QApplication::translate("TCPtelemetryOptionsPage", "TCP connection", 0, QApplication::UnicodeUTF8)); - UseUDP->setText(QApplication::translate("TCPtelemetryOptionsPage", "UDP connection", 0, QApplication::UnicodeUTF8)); - label_3->setText(QApplication::translate("TCPtelemetryOptionsPage", "Port", 0, QApplication::UnicodeUTF8)); - label_2->setText(QApplication::translate("TCPtelemetryOptionsPage", "Host Name/Number", 0, QApplication::UnicodeUTF8)); + IPconnectionOptionsPage->setWindowTitle(QApplication::translate("IPconnectionOptionsPage", "Form", 0, QApplication::UnicodeUTF8)); + UseTCP->setText(QApplication::translate("IPconnectionOptionsPage", "TCP connection", 0, QApplication::UnicodeUTF8)); + UseUDP->setText(QApplication::translate("IPconnectionOptionsPage", "UDP connection", 0, QApplication::UnicodeUTF8)); + label_3->setText(QApplication::translate("IPconnectionOptionsPage", "Port", 0, QApplication::UnicodeUTF8)); + label_2->setText(QApplication::translate("IPconnectionOptionsPage", "Host Name/Number", 0, QApplication::UnicodeUTF8)); } // retranslateUi }; namespace Ui { - class TCPtelemetryOptionsPage: public Ui_TCPtelemetryOptionsPage {}; + class IPconnectionOptionsPage: public Ui_IPconnectionOptionsPage {}; } // namespace Ui QT_END_NAMESPACE diff --git a/ground/src/plugins/plugins.pro b/ground/src/plugins/plugins.pro index 5222f01ea..520c8ce50 100644 --- a/ground/src/plugins/plugins.pro +++ b/ground/src/plugins/plugins.pro @@ -129,7 +129,7 @@ plugin_pfd.depends = plugin_uavobjects SUBDIRS += plugin_pfd -#TCPtelemetry connection plugin -plugin_tcptelemetry.subdir = tcptelemetryconnection -plugin_tcptelemetry.depends = plugin_coreplugin -SUBDIRS += plugin_tcptelemetry +#IP connection plugin +plugin_ipconnection.subdir = ipconnection +plugin_ipconnection.depends = plugin_coreplugin +SUBDIRS += plugin_ipconnection diff --git a/ground/src/plugins/tcptelemetryconnection/tcptelemetry.pri b/ground/src/plugins/tcptelemetryconnection/tcptelemetry.pri deleted file mode 100644 index 5d927c981..000000000 --- a/ground/src/plugins/tcptelemetryconnection/tcptelemetry.pri +++ /dev/null @@ -1,3 +0,0 @@ -include(tcptelemetry_dependencies.pri) - -LIBS *= -l$$qtLibraryTarget(TCPtelemetry) diff --git a/ground/src/plugins/tcptelemetryconnection/tcptelemetryconnection.pro b/ground/src/plugins/tcptelemetryconnection/tcptelemetryconnection.pro deleted file mode 100644 index 8be9a6c13..000000000 --- a/ground/src/plugins/tcptelemetryconnection/tcptelemetryconnection.pro +++ /dev/null @@ -1,16 +0,0 @@ -TEMPLATE = lib -TARGET = TCPtelemetry -include(../../openpilotgcsplugin.pri) -include(tcptelemetry_dependencies.pri) -HEADERS += tcptelemetryplugin.h \ - tcptelemetry_global.h \ - tcptelemetryconfiguration.h \ - tcptelemetryoptionspage.h -SOURCES += tcptelemetryplugin.cpp \ - tcptelemetryconfiguration.cpp \ - tcptelemetryoptionspage.cpp -FORMS += tcptelemetryoptionspage.ui -RESOURCES += -DEFINES += TCPtelemetry_LIBRARY -OTHER_FILES += TCPtelemetry.pluginspec -QT += network