mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +01:00
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
This commit is contained in:
parent
b121af6e95
commit
3e87388bcc
@ -1,4 +1,4 @@
|
|||||||
<plugin name="TCPtelemetry" version="1.0.0" compatVersion="1.0.0">
|
<plugin name="IPconnection" version="1.0.1" compatVersion="1.0.1">
|
||||||
<vendor>The OpenPilot Project</vendor>
|
<vendor>The OpenPilot Project</vendor>
|
||||||
<copyright>(C) 2010 OpenPilot Project</copyright>
|
<copyright>(C) 2010 OpenPilot Project</copyright>
|
||||||
<license>GNU Public License (GPL) Version 3</license>
|
<license>GNU Public License (GPL) Version 3</license>
|
3
ground/src/plugins/ipconnection/ipconnection.pri
Normal file
3
ground/src/plugins/ipconnection/ipconnection.pri
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
include(ipconnection_dependencies.pri)
|
||||||
|
|
||||||
|
LIBS *= -l$$qtLibraryTarget(IPconnection)
|
16
ground/src/plugins/ipconnection/ipconnection.pro
Normal file
16
ground/src/plugins/ipconnection/ipconnection.pro
Normal file
@ -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
|
@ -1,11 +1,11 @@
|
|||||||
/**
|
/**
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
*
|
*
|
||||||
* @file TCPtelemetry_global.h
|
* @file IPconnection_global.h
|
||||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||||
* @brief
|
* @brief
|
||||||
* @see The GNU Public License (GPL) Version 3
|
* @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
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TCPtelemetry_GLOBAL_H
|
#ifndef IPconnection_GLOBAL_H
|
||||||
#define TCPtelemetry_GLOBAL_H
|
#define IPconnection_GLOBAL_H
|
||||||
|
|
||||||
#include <QtCore/qglobal.h>
|
#include <QtCore/qglobal.h>
|
||||||
|
|
||||||
#if defined(TCPtelemetry_LIBRARY)
|
#if defined(IPconnection_LIBRARY)
|
||||||
# define TCPtelemetry_EXPORT Q_DECL_EXPORT
|
# define IPconnection_EXPORT Q_DECL_EXPORT
|
||||||
#else
|
#else
|
||||||
# define TCPtelemetry_EXPORT Q_DECL_IMPORT
|
# define IPconnection_EXPORT Q_DECL_IMPORT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // TCPtelemetry_GLOBAL_H
|
#endif // IPconnection_GLOBAL_H
|
@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
*
|
*
|
||||||
* @file TCPtelemetryconfiguration.cpp
|
* @file IPconnectionconfiguration.cpp
|
||||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||||
* @brief
|
* @brief
|
||||||
* @see The GNU Public License (GPL) Version 3
|
* @see The GNU Public License (GPL) Version 3
|
||||||
@ -25,11 +25,11 @@
|
|||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "tcptelemetryconfiguration.h"
|
#include "ipconnectionconfiguration.h"
|
||||||
#include <QtCore/QDataStream>
|
#include <QtCore/QDataStream>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
|
|
||||||
TCPtelemetryConfiguration::TCPtelemetryConfiguration(QString classId, const QByteArray &state, QObject *parent) :
|
IPconnectionConfiguration::IPconnectionConfiguration(QString classId, const QByteArray &state, QObject *parent) :
|
||||||
IUAVGadgetConfiguration(classId, parent),
|
IUAVGadgetConfiguration(classId, parent),
|
||||||
m_HostName("127.0.0.1"),
|
m_HostName("127.0.0.1"),
|
||||||
m_Port(1000),
|
m_Port(1000),
|
||||||
@ -37,19 +37,19 @@ TCPtelemetryConfiguration::TCPtelemetryConfiguration(QString classId, const QByt
|
|||||||
{
|
{
|
||||||
settings = Core::ICore::instance()->settings();
|
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_Port = m_Port;
|
||||||
m->m_HostName = m_HostName;
|
m->m_HostName = m_HostName;
|
||||||
m->m_UseTCP = m_UseTCP;
|
m->m_UseTCP = m_UseTCP;
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray TCPtelemetryConfiguration::saveState() const
|
QByteArray IPconnectionConfiguration::saveState() const
|
||||||
{
|
{
|
||||||
QByteArray bytes;
|
QByteArray bytes;
|
||||||
QDataStream stream(&bytes, QIODevice::WriteOnly);
|
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->beginWriteArray("Current");
|
||||||
settings->setArrayIndex(0);
|
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->beginReadArray("Current");
|
||||||
settings->setArrayIndex(0);
|
settings->setArrayIndex(0);
|
@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
*
|
*
|
||||||
* @file TCPtelemetryconfiguration.h
|
* @file IPconnectionconfiguration.h
|
||||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||||
* @brief
|
* @brief
|
||||||
* @see The GNU Public License (GPL) Version 3
|
* @see The GNU Public License (GPL) Version 3
|
||||||
@ -25,8 +25,8 @@
|
|||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TCPtelemetryCONFIGURATION_H
|
#ifndef IPconnectionCONFIGURATION_H
|
||||||
#define TCPtelemetryCONFIGURATION_H
|
#define IPconnectionCONFIGURATION_H
|
||||||
|
|
||||||
#include <coreplugin/iuavgadgetconfiguration.h>
|
#include <coreplugin/iuavgadgetconfiguration.h>
|
||||||
#include <QtCore/QString>
|
#include <QtCore/QString>
|
||||||
@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
|
|
||||||
class TCPtelemetryConfiguration : public IUAVGadgetConfiguration
|
class IPconnectionConfiguration : public IUAVGadgetConfiguration
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(QString HostName READ HostName WRITE setHostName)
|
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)
|
Q_PROPERTY(int UseTCP READ UseTCP WRITE setUseTCP)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit TCPtelemetryConfiguration(QString classId, const QByteArray &state = 0, QObject *parent = 0);
|
explicit IPconnectionConfiguration(QString classId, const QByteArray &state = 0, QObject *parent = 0);
|
||||||
virtual ~TCPtelemetryConfiguration();
|
virtual ~IPconnectionConfiguration();
|
||||||
QByteArray saveState() const;
|
QByteArray saveState() const;
|
||||||
//void savesettings(QSettings* settings) const;
|
//void savesettings(QSettings* settings) const;
|
||||||
//void restoresettings(QSettings* settings);
|
//void restoresettings(QSettings* settings);
|
||||||
@ -70,4 +70,4 @@ private:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // TCPtelemetryCONFIGURATION_H
|
#endif // IPconnectionCONFIGURATION_H
|
@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
*
|
*
|
||||||
* @file TCPtelemetryoptionspage.cpp
|
* @file IPconnectionoptionspage.cpp
|
||||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||||
* @brief
|
* @brief
|
||||||
* @see The GNU Public License (GPL) Version 3
|
* @see The GNU Public License (GPL) Version 3
|
||||||
@ -25,8 +25,8 @@
|
|||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "tcptelemetryoptionspage.h"
|
#include "ipconnectionoptionspage.h"
|
||||||
#include "tcptelemetryconfiguration.h"
|
#include "ipconnectionconfiguration.h"
|
||||||
#include <QtGui/QLabel>
|
#include <QtGui/QLabel>
|
||||||
#include <QtGui/QComboBox>
|
#include <QtGui/QComboBox>
|
||||||
#include <QtGui/QSpinBox>
|
#include <QtGui/QSpinBox>
|
||||||
@ -35,22 +35,22 @@
|
|||||||
#include <QtGui/QHBoxLayout>
|
#include <QtGui/QHBoxLayout>
|
||||||
#include <QtGui/QVBoxLayout>
|
#include <QtGui/QVBoxLayout>
|
||||||
|
|
||||||
#include "ui_tcptelemetryoptionspage.h"
|
#include "ui_ipconnectionoptionspage.h"
|
||||||
|
|
||||||
|
|
||||||
TCPtelemetryOptionsPage::TCPtelemetryOptionsPage(TCPtelemetryConfiguration *config, QObject *parent) :
|
IPconnectionOptionsPage::IPconnectionOptionsPage(IPconnectionConfiguration *config, QObject *parent) :
|
||||||
IOptionsPage(parent),
|
IOptionsPage(parent),
|
||||||
m_config(config)
|
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);
|
QWidget *w = new QWidget(parent);
|
||||||
m_page->setupUi(w);
|
m_page->setupUi(w);
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ QWidget *TCPtelemetryOptionsPage::createPage(QWidget *parent)
|
|||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TCPtelemetryOptionsPage::apply()
|
void IPconnectionOptionsPage::apply()
|
||||||
{
|
{
|
||||||
m_config->setPort(m_page->Port->value());
|
m_config->setPort(m_page->Port->value());
|
||||||
m_config->setHostName(m_page->HostName->text());
|
m_config->setHostName(m_page->HostName->text());
|
||||||
@ -75,7 +75,7 @@ void TCPtelemetryOptionsPage::apply()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TCPtelemetryOptionsPage::finish()
|
void IPconnectionOptionsPage::finish()
|
||||||
{
|
{
|
||||||
delete m_page;
|
delete m_page;
|
||||||
}
|
}
|
@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
*
|
*
|
||||||
* @file TCPtelemetryoptionspage.h
|
* @file IPconnectionoptionspage.h
|
||||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||||
* @brief
|
* @brief
|
||||||
* @see The GNU Public License (GPL) Version 3
|
* @see The GNU Public License (GPL) Version 3
|
||||||
@ -25,30 +25,29 @@
|
|||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TCPtelemetryOPTIONSPAGE_H
|
#ifndef IPconnectionOPTIONSPAGE_H
|
||||||
#define TCPtelemetryOPTIONSPAGE_H
|
#define IPconnectionOPTIONSPAGE_H
|
||||||
|
|
||||||
#include "coreplugin/dialogs/ioptionspage.h"
|
#include "coreplugin/dialogs/ioptionspage.h"
|
||||||
//#include <QtCore/QSettings>
|
|
||||||
|
|
||||||
class TCPtelemetryConfiguration;
|
class IPconnectionConfiguration;
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
class IUAVGadgetConfiguration;
|
class IUAVGadgetConfiguration;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class TCPtelemetryOptionsPage;
|
class IPconnectionOptionsPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
|
|
||||||
class TCPtelemetryOptionsPage : public IOptionsPage
|
class IPconnectionOptionsPage : public IOptionsPage
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit TCPtelemetryOptionsPage(TCPtelemetryConfiguration *config, QObject *parent = 0);
|
explicit IPconnectionOptionsPage(IPconnectionConfiguration *config, QObject *parent = 0);
|
||||||
virtual ~TCPtelemetryOptionsPage();
|
virtual ~IPconnectionOptionsPage();
|
||||||
|
|
||||||
QString id() const { return QLatin1String("settings"); }
|
QString id() const { return QLatin1String("settings"); }
|
||||||
QString trName() const { return tr("settings"); }
|
QString trName() const { return tr("settings"); }
|
||||||
@ -64,10 +63,9 @@ signals:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
private:
|
private:
|
||||||
TCPtelemetryConfiguration *m_config;
|
IPconnectionConfiguration *m_config;
|
||||||
Ui::TCPtelemetryOptionsPage *m_page;
|
Ui::IPconnectionOptionsPage *m_page;
|
||||||
//QSettings* settings;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // TCPtelemetryOPTIONSPAGE_H
|
#endif // IPconnectionOPTIONSPAGE_H
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>TCPtelemetryOptionsPage</class>
|
<class>IPconnectionOptionsPage</class>
|
||||||
<widget class="QWidget" name="TCPtelemetryOptionsPage">
|
<widget class="QWidget" name="IPconnectionOptionsPage">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
@ -1,11 +1,11 @@
|
|||||||
/**
|
/**
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
*
|
*
|
||||||
* @file TCPtelemetryplugin.cpp
|
* @file IPconnectionplugin.cpp
|
||||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||||
* @brief Register connection object for the core connection manager
|
* @brief Register connection object for the core connection manager
|
||||||
* @see The GNU Public License (GPL) Version 3
|
* @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
|
//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 <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
@ -42,13 +42,13 @@
|
|||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
TCPtelemetryConnection::TCPtelemetryConnection()
|
IPconnectionConnection::IPconnectionConnection()
|
||||||
{
|
{
|
||||||
//create all our objects
|
//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_config->restoresettings();
|
||||||
|
|
||||||
m_optionspage = new TCPtelemetryOptionsPage(m_config,this);
|
m_optionspage = new IPconnectionOptionsPage(m_config,this);
|
||||||
|
|
||||||
//just signal whenever we have a device event...
|
//just signal whenever we have a device event...
|
||||||
QMainWindow *mw = Core::ICore::instance()->mainWindow();
|
QMainWindow *mw = Core::ICore::instance()->mainWindow();
|
||||||
@ -58,20 +58,20 @@ TCPtelemetryConnection::TCPtelemetryConnection()
|
|||||||
this, SLOT(onEnumerationChanged()));
|
this, SLOT(onEnumerationChanged()));
|
||||||
}
|
}
|
||||||
|
|
||||||
TCPtelemetryConnection::~TCPtelemetryConnection()
|
IPconnectionConnection::~IPconnectionConnection()
|
||||||
{
|
{
|
||||||
//tcpSocket->close ();
|
//tcpSocket->close ();
|
||||||
//delete(tcpSocket);
|
//delete(tcpSocket);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TCPtelemetryConnection::onEnumerationChanged()
|
void IPconnectionConnection::onEnumerationChanged()
|
||||||
{//no change from serial plugin
|
{//no change from serial plugin
|
||||||
emit availableDevChanged(this);
|
emit availableDevChanged(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
QStringList TCPtelemetryConnection::availableDevices()
|
QStringList IPconnectionConnection::availableDevices()
|
||||||
{
|
{
|
||||||
QStringList list;
|
QStringList list;
|
||||||
|
|
||||||
@ -81,7 +81,7 @@ QStringList TCPtelemetryConnection::availableDevices()
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
QIODevice *TCPtelemetryConnection::openDevice(const QString &deviceName)
|
QIODevice *IPconnectionConnection::openDevice(const QString &deviceName)
|
||||||
{
|
{
|
||||||
const int Timeout = 5 * 1000;
|
const int Timeout = 5 * 1000;
|
||||||
int state;
|
int state;
|
||||||
@ -123,7 +123,7 @@ QIODevice *TCPtelemetryConnection::openDevice(const QString &deviceName)
|
|||||||
return tcpSocket;
|
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...
|
//still having problems with the app crashing when we reference the tcpsocket outside the openDevice function...
|
||||||
//tcpSocket->close ();
|
//tcpSocket->close ();
|
||||||
@ -134,12 +134,12 @@ void TCPtelemetryConnection::closeDevice(const QString &deviceName)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QString TCPtelemetryConnection::connectionName()
|
QString IPconnectionConnection::connectionName()
|
||||||
{//updated from serial plugin
|
{//updated from serial plugin
|
||||||
return QString("Network telemetry port");
|
return QString("Network telemetry port");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString TCPtelemetryConnection::shortName()
|
QString IPconnectionConnection::shortName()
|
||||||
{//updated from serial plugin
|
{//updated from serial plugin
|
||||||
if (m_config->UseTCP()) {
|
if (m_config->UseTCP()) {
|
||||||
return QString("TCP");
|
return QString("TCP");
|
||||||
@ -149,25 +149,25 @@ QString TCPtelemetryConnection::shortName()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TCPtelemetryPlugin::TCPtelemetryPlugin()
|
IPconnectionPlugin::IPconnectionPlugin()
|
||||||
{//no change from serial plugin
|
{//no change from serial plugin
|
||||||
}
|
}
|
||||||
|
|
||||||
TCPtelemetryPlugin::~TCPtelemetryPlugin()
|
IPconnectionPlugin::~IPconnectionPlugin()
|
||||||
{//manually remove the options page object
|
{//manually remove the options page object
|
||||||
removeObject(m_connection->Optionspage());
|
removeObject(m_connection->Optionspage());
|
||||||
}
|
}
|
||||||
|
|
||||||
void TCPtelemetryPlugin::extensionsInitialized()
|
void IPconnectionPlugin::extensionsInitialized()
|
||||||
{
|
{
|
||||||
addAutoReleasedObject(m_connection);
|
addAutoReleasedObject(m_connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TCPtelemetryPlugin::initialize(const QStringList &arguments, QString *errorString)
|
bool IPconnectionPlugin::initialize(const QStringList &arguments, QString *errorString)
|
||||||
{
|
{
|
||||||
Q_UNUSED(arguments);
|
Q_UNUSED(arguments);
|
||||||
Q_UNUSED(errorString);
|
Q_UNUSED(errorString);
|
||||||
m_connection = new TCPtelemetryConnection();
|
m_connection = new IPconnectionConnection();
|
||||||
//must manage this registration of child object ourselves
|
//must manage this registration of child object ourselves
|
||||||
//if we use an autorelease here it causes the GCS to crash
|
//if we use an autorelease here it causes the GCS to crash
|
||||||
//as it is deleting objects as the app closes...
|
//as it is deleting objects as the app closes...
|
||||||
@ -176,4 +176,4 @@ bool TCPtelemetryPlugin::initialize(const QStringList &arguments, QString *error
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_EXPORT_PLUGIN(TCPtelemetryPlugin)
|
Q_EXPORT_PLUGIN(IPconnectionPlugin)
|
@ -1,11 +1,11 @@
|
|||||||
/**
|
/**
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
*
|
*
|
||||||
* @file TCPtelemetryplugin.h
|
* @file IPconnectionplugin.h
|
||||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||||
* @brief
|
* @brief
|
||||||
* @see The GNU Public License (GPL) Version 3
|
* @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
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TCPtelemetryPLUGIN_H
|
#ifndef IPconnectionPLUGIN_H
|
||||||
#define TCPtelemetryPLUGIN_H
|
#define IPconnectionPLUGIN_H
|
||||||
|
|
||||||
#include "tcptelemetry_global.h"
|
#include "ipconnection_global.h"
|
||||||
#include "tcptelemetryoptionspage.h"
|
#include "ipconnectionoptionspage.h"
|
||||||
#include "tcptelemetryconfiguration.h"
|
#include "ipconnectionconfiguration.h"
|
||||||
//#include "tcptelemetryfactory.h"
|
|
||||||
#include "coreplugin/iconnection.h"
|
#include "coreplugin/iconnection.h"
|
||||||
#include <extensionsystem/iplugin.h>
|
#include <extensionsystem/iplugin.h>
|
||||||
//#include <QtCore/QSettings>
|
//#include <QtCore/QSettings>
|
||||||
@ -47,13 +46,13 @@ class IConnection;
|
|||||||
* Plugin will add a instance of this class to the pool,
|
* Plugin will add a instance of this class to the pool,
|
||||||
* so the connection manager can use it.
|
* so the connection manager can use it.
|
||||||
*/
|
*/
|
||||||
class TCPtelemetry_EXPORT TCPtelemetryConnection
|
class IPconnection_EXPORT IPconnectionConnection
|
||||||
: public Core::IConnection
|
: public Core::IConnection
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
TCPtelemetryConnection();
|
IPconnectionConnection();
|
||||||
virtual ~TCPtelemetryConnection();
|
virtual ~IPconnectionConnection();
|
||||||
|
|
||||||
virtual QStringList availableDevices();
|
virtual QStringList availableDevices();
|
||||||
virtual QIODevice *openDevice(const QString &deviceName);
|
virtual QIODevice *openDevice(const QString &deviceName);
|
||||||
@ -62,8 +61,8 @@ public:
|
|||||||
virtual QString connectionName();
|
virtual QString connectionName();
|
||||||
virtual QString shortName();
|
virtual QString shortName();
|
||||||
|
|
||||||
TCPtelemetryConfiguration * Config() const { return m_config; }
|
IPconnectionConfiguration * Config() const { return m_config; }
|
||||||
TCPtelemetryOptionsPage * Optionspage() const { return m_optionspage; }
|
IPconnectionOptionsPage * Optionspage() const { return m_optionspage; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -71,29 +70,29 @@ protected slots:
|
|||||||
void onEnumerationChanged();
|
void onEnumerationChanged();
|
||||||
private:
|
private:
|
||||||
QAbstractSocket *tcpSocket;
|
QAbstractSocket *tcpSocket;
|
||||||
TCPtelemetryConfiguration *m_config;
|
IPconnectionConfiguration *m_config;
|
||||||
TCPtelemetryOptionsPage *m_optionspage;
|
IPconnectionOptionsPage *m_optionspage;
|
||||||
//QSettings* settings;
|
//QSettings* settings;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class TCPtelemetry_EXPORT TCPtelemetryPlugin
|
class IPconnection_EXPORT IPconnectionPlugin
|
||||||
: public ExtensionSystem::IPlugin
|
: public ExtensionSystem::IPlugin
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TCPtelemetryPlugin();
|
IPconnectionPlugin();
|
||||||
~TCPtelemetryPlugin();
|
~IPconnectionPlugin();
|
||||||
|
|
||||||
virtual bool initialize(const QStringList &arguments, QString *error_message);
|
virtual bool initialize(const QStringList &arguments, QString *error_message);
|
||||||
virtual void extensionsInitialized();
|
virtual void extensionsInitialized();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TCPtelemetryConnection *m_connection;
|
IPconnectionConnection *m_connection;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif // TCPtelemetryPLUGIN_H
|
#endif // IPconnectionPLUGIN_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
|
** Created: Sun Jun 27 12:45:24 2010
|
||||||
** by: Qt User Interface Compiler version 4.6.2
|
** by: Qt User Interface Compiler version 4.6.2
|
||||||
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
class Ui_TCPtelemetryOptionsPage
|
class Ui_IPconnectionOptionsPage
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QGridLayout *gridLayout;
|
QGridLayout *gridLayout;
|
||||||
@ -37,69 +37,69 @@ public:
|
|||||||
QLineEdit *HostName;
|
QLineEdit *HostName;
|
||||||
QLabel *label_2;
|
QLabel *label_2;
|
||||||
|
|
||||||
void setupUi(QWidget *TCPtelemetryOptionsPage)
|
void setupUi(QWidget *IPconnectionOptionsPage)
|
||||||
{
|
{
|
||||||
if (TCPtelemetryOptionsPage->objectName().isEmpty())
|
if (IPconnectionOptionsPage->objectName().isEmpty())
|
||||||
TCPtelemetryOptionsPage->setObjectName(QString::fromUtf8("TCPtelemetryOptionsPage"));
|
IPconnectionOptionsPage->setObjectName(QString::fromUtf8("IPconnectionOptionsPage"));
|
||||||
TCPtelemetryOptionsPage->resize(388, 300);
|
IPconnectionOptionsPage->resize(388, 300);
|
||||||
gridLayout = new QGridLayout(TCPtelemetryOptionsPage);
|
gridLayout = new QGridLayout(IPconnectionOptionsPage);
|
||||||
gridLayout->setContentsMargins(0, 0, 0, 0);
|
gridLayout->setContentsMargins(0, 0, 0, 0);
|
||||||
gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
|
gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
|
||||||
horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||||
|
|
||||||
gridLayout->addItem(horizontalSpacer, 0, 3, 1, 1);
|
gridLayout->addItem(horizontalSpacer, 0, 3, 1, 1);
|
||||||
|
|
||||||
UseTCP = new QRadioButton(TCPtelemetryOptionsPage);
|
UseTCP = new QRadioButton(IPconnectionOptionsPage);
|
||||||
UseTCP->setObjectName(QString::fromUtf8("UseTCP"));
|
UseTCP->setObjectName(QString::fromUtf8("UseTCP"));
|
||||||
|
|
||||||
gridLayout->addWidget(UseTCP, 2, 2, 1, 1);
|
gridLayout->addWidget(UseTCP, 2, 2, 1, 1);
|
||||||
|
|
||||||
UseUDP = new QRadioButton(TCPtelemetryOptionsPage);
|
UseUDP = new QRadioButton(IPconnectionOptionsPage);
|
||||||
UseUDP->setObjectName(QString::fromUtf8("UseUDP"));
|
UseUDP->setObjectName(QString::fromUtf8("UseUDP"));
|
||||||
|
|
||||||
gridLayout->addWidget(UseUDP, 3, 2, 1, 1);
|
gridLayout->addWidget(UseUDP, 3, 2, 1, 1);
|
||||||
|
|
||||||
Port = new QSpinBox(TCPtelemetryOptionsPage);
|
Port = new QSpinBox(IPconnectionOptionsPage);
|
||||||
Port->setObjectName(QString::fromUtf8("Port"));
|
Port->setObjectName(QString::fromUtf8("Port"));
|
||||||
Port->setMinimum(1);
|
Port->setMinimum(1);
|
||||||
Port->setMaximum(999999);
|
Port->setMaximum(999999);
|
||||||
|
|
||||||
gridLayout->addWidget(Port, 4, 2, 1, 1);
|
gridLayout->addWidget(Port, 4, 2, 1, 1);
|
||||||
|
|
||||||
label_3 = new QLabel(TCPtelemetryOptionsPage);
|
label_3 = new QLabel(IPconnectionOptionsPage);
|
||||||
label_3->setObjectName(QString::fromUtf8("label_3"));
|
label_3->setObjectName(QString::fromUtf8("label_3"));
|
||||||
|
|
||||||
gridLayout->addWidget(label_3, 4, 1, 1, 1);
|
gridLayout->addWidget(label_3, 4, 1, 1, 1);
|
||||||
|
|
||||||
HostName = new QLineEdit(TCPtelemetryOptionsPage);
|
HostName = new QLineEdit(IPconnectionOptionsPage);
|
||||||
HostName->setObjectName(QString::fromUtf8("HostName"));
|
HostName->setObjectName(QString::fromUtf8("HostName"));
|
||||||
|
|
||||||
gridLayout->addWidget(HostName, 0, 2, 1, 1);
|
gridLayout->addWidget(HostName, 0, 2, 1, 1);
|
||||||
|
|
||||||
label_2 = new QLabel(TCPtelemetryOptionsPage);
|
label_2 = new QLabel(IPconnectionOptionsPage);
|
||||||
label_2->setObjectName(QString::fromUtf8("label_2"));
|
label_2->setObjectName(QString::fromUtf8("label_2"));
|
||||||
|
|
||||||
gridLayout->addWidget(label_2, 0, 1, 1, 1);
|
gridLayout->addWidget(label_2, 0, 1, 1, 1);
|
||||||
|
|
||||||
|
|
||||||
retranslateUi(TCPtelemetryOptionsPage);
|
retranslateUi(IPconnectionOptionsPage);
|
||||||
|
|
||||||
QMetaObject::connectSlotsByName(TCPtelemetryOptionsPage);
|
QMetaObject::connectSlotsByName(IPconnectionOptionsPage);
|
||||||
} // setupUi
|
} // setupUi
|
||||||
|
|
||||||
void retranslateUi(QWidget *TCPtelemetryOptionsPage)
|
void retranslateUi(QWidget *IPconnectionOptionsPage)
|
||||||
{
|
{
|
||||||
TCPtelemetryOptionsPage->setWindowTitle(QApplication::translate("TCPtelemetryOptionsPage", "Form", 0, QApplication::UnicodeUTF8));
|
IPconnectionOptionsPage->setWindowTitle(QApplication::translate("IPconnectionOptionsPage", "Form", 0, QApplication::UnicodeUTF8));
|
||||||
UseTCP->setText(QApplication::translate("TCPtelemetryOptionsPage", "TCP connection", 0, QApplication::UnicodeUTF8));
|
UseTCP->setText(QApplication::translate("IPconnectionOptionsPage", "TCP connection", 0, QApplication::UnicodeUTF8));
|
||||||
UseUDP->setText(QApplication::translate("TCPtelemetryOptionsPage", "UDP connection", 0, QApplication::UnicodeUTF8));
|
UseUDP->setText(QApplication::translate("IPconnectionOptionsPage", "UDP connection", 0, QApplication::UnicodeUTF8));
|
||||||
label_3->setText(QApplication::translate("TCPtelemetryOptionsPage", "Port", 0, QApplication::UnicodeUTF8));
|
label_3->setText(QApplication::translate("IPconnectionOptionsPage", "Port", 0, QApplication::UnicodeUTF8));
|
||||||
label_2->setText(QApplication::translate("TCPtelemetryOptionsPage", "Host Name/Number", 0, QApplication::UnicodeUTF8));
|
label_2->setText(QApplication::translate("IPconnectionOptionsPage", "Host Name/Number", 0, QApplication::UnicodeUTF8));
|
||||||
} // retranslateUi
|
} // retranslateUi
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class TCPtelemetryOptionsPage: public Ui_TCPtelemetryOptionsPage {};
|
class IPconnectionOptionsPage: public Ui_IPconnectionOptionsPage {};
|
||||||
} // namespace Ui
|
} // namespace Ui
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
@ -129,7 +129,7 @@ plugin_pfd.depends = plugin_uavobjects
|
|||||||
SUBDIRS += plugin_pfd
|
SUBDIRS += plugin_pfd
|
||||||
|
|
||||||
|
|
||||||
#TCPtelemetry connection plugin
|
#IP connection plugin
|
||||||
plugin_tcptelemetry.subdir = tcptelemetryconnection
|
plugin_ipconnection.subdir = ipconnection
|
||||||
plugin_tcptelemetry.depends = plugin_coreplugin
|
plugin_ipconnection.depends = plugin_coreplugin
|
||||||
SUBDIRS += plugin_tcptelemetry
|
SUBDIRS += plugin_ipconnection
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
include(tcptelemetry_dependencies.pri)
|
|
||||||
|
|
||||||
LIBS *= -l$$qtLibraryTarget(TCPtelemetry)
|
|
@ -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
|
|
Loading…
x
Reference in New Issue
Block a user