Qt6 migration: LtsWidgets API fixes, LtsWebSocket logger init, RTI Docker install
- LtsWidgets: Fixed Qt6 API compatibility issues - QWheelEvent::delta() → angleDelta().y() - QStyleOption::init() → initFrom() - QComboBox activated signal signature change - QTextCodec removal (UTF-8 default in Qt6) - Missing widget includes added - LtsWebSocket: Fixed m_logger reference initialization - Added NGLLoggerBootstrap includes - Proper initialization in constructor initializer lists - CMake: Added BUILD_LTSWEBSOCKET option for temporary exclusion - Docker: RTI Connext permanent installation script added - ci/install-rti-in-docker.sh for persistent RTI setup - Removes need for volume mounting RTI into container - BUILD options: FilterManagement, RTI, Codification, Grantlee, LtsWebSocket can be disabled for partial builds during migration Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
69 files changed
+12765
-14202
No files matched your search
Executable → Regular
+6
-9
@@ -1,19 +1,16 @@
|
||||
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "commandinterface.h"
|
||||
#include "sv_export.h"
|
||||
|
||||
|
||||
#include "tcpserver_export.h"
|
||||
|
||||
class TCPSERVER_EXPORT CBI_Help : public CommandInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit CBI_Help(unsigned short port);
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit CBI_Help(unsigned short port);
|
||||
|
||||
void handleCommandInternal(const QVector<QByteArray> &args) override;
|
||||
QString help() const override;
|
||||
void handleCommandInternal(const QVector<QByteArray>& args) override;
|
||||
QString help() const override;
|
||||
};
|
||||
Executable → Regular
+6
-9
@@ -1,19 +1,16 @@
|
||||
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "commandinterface.h"
|
||||
#include "sv_export.h"
|
||||
|
||||
|
||||
#include "tcpserver_export.h"
|
||||
|
||||
class CBI_PingPong : public CommandInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit CBI_PingPong(unsigned short port);
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit CBI_PingPong(unsigned short port);
|
||||
|
||||
void handleCommandInternal(const QVector<QByteArray> &args) override;
|
||||
QString help() const override;
|
||||
void handleCommandInternal(const QVector<QByteArray>& args) override;
|
||||
QString help() const override;
|
||||
};
|
||||
Executable → Regular
+6
-9
@@ -1,19 +1,16 @@
|
||||
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "commandinterface.h"
|
||||
#include "sv_export.h"
|
||||
|
||||
|
||||
#include "tcpserver_export.h"
|
||||
|
||||
class TCPSERVER_EXPORT CBI_Quit : public CommandInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit CBI_Quit(unsigned short port);
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit CBI_Quit(unsigned short port);
|
||||
|
||||
void handleCommandInternal(const QVector<QByteArray> &args) override;
|
||||
QString help() const override;
|
||||
void handleCommandInternal(const QVector<QByteArray>& args) override;
|
||||
QString help() const override;
|
||||
};
|
||||
Executable → Regular
+12
-10
@@ -1,23 +1,25 @@
|
||||
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "commandinterface.h"
|
||||
#include "sv_export.h"
|
||||
#include "tcpserver_export.h"
|
||||
|
||||
#include <QMap>
|
||||
#include <QPair>
|
||||
|
||||
class QIODevice;
|
||||
|
||||
class CBI_Recvfile : public CommandInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit CBI_Recvfile(unsigned short port);
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit CBI_Recvfile(unsigned short port);
|
||||
|
||||
void handleCommandInternal(const QVector<QByteArray> &args) override;
|
||||
QString help() const override;
|
||||
void newPlainData() override;
|
||||
protected:
|
||||
QMap<WorkerBase*, QPair<QIODevice*, int> > m_wbMap;
|
||||
void handleCommandInternal(const QVector<QByteArray>& args) override;
|
||||
QString help() const override;
|
||||
void newPlainData() override;
|
||||
|
||||
protected:
|
||||
QMap<WorkerBase*, QPair<QIODevice*, int>> m_wbMap;
|
||||
};
|
||||
Executable → Regular
+6
-7
@@ -1,17 +1,16 @@
|
||||
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "commandinterface.h"
|
||||
#include "sv_export.h"
|
||||
#include "tcpserver_export.h"
|
||||
|
||||
class CBI_Sendfile : public CommandInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit CBI_Sendfile(unsigned short port);
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit CBI_Sendfile(unsigned short port);
|
||||
|
||||
void handleCommandInternal(const QVector<QByteArray> &args) override;
|
||||
QString help() const override;
|
||||
void handleCommandInternal(const QVector<QByteArray>& args) override;
|
||||
QString help() const override;
|
||||
};
|
||||
Executable → Regular
+10
-13
@@ -1,25 +1,22 @@
|
||||
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "commandinterface.h"
|
||||
#include "sv_export.h"
|
||||
|
||||
|
||||
#include "tcpserver_export.h"
|
||||
|
||||
class TCPSERVER_EXPORT CBI_Shutdown : public CommandInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit CBI_Shutdown(unsigned short port);
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit CBI_Shutdown(unsigned short port);
|
||||
|
||||
void handleCommandInternal(const QVector<QByteArray> &args) override;
|
||||
QString help() const override;
|
||||
void handleCommandInternal(const QVector<QByteArray>& args) override;
|
||||
QString help() const override;
|
||||
|
||||
Q_SIGNALS:
|
||||
|
||||
Q_SIGNALS:
|
||||
|
||||
void shutdownRequest();
|
||||
private:
|
||||
void shutdownRequest();
|
||||
|
||||
private:
|
||||
};
|
||||
Executable → Regular
+51
-102
@@ -1,158 +1,107 @@
|
||||
|
||||
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "tcpserver_export.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QVector>
|
||||
|
||||
#include "sv_export.h"
|
||||
|
||||
class QAbstractSocket;
|
||||
class QByteArray;
|
||||
class WorkerBase;
|
||||
|
||||
|
||||
class TCPSERVER_EXPORT CommandInterface : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit CommandInterface(unsigned short port, const QByteArray& command = QByteArray());
|
||||
|
||||
explicit CommandInterface(unsigned short port, const QByteArray &command = QByteArray());
|
||||
virtual ~CommandInterface();
|
||||
|
||||
|
||||
void handleCommand(const QVector<QByteArray>& args);
|
||||
|
||||
virtual ~CommandInterface();
|
||||
|
||||
virtual void newPlainData();
|
||||
|
||||
void handleCommand(const QVector<QByteArray> &args);
|
||||
|
||||
virtual QString help() const = 0;
|
||||
|
||||
virtual void newPlainData();
|
||||
|
||||
QByteArray command() const;
|
||||
|
||||
virtual QString help() const = 0;
|
||||
|
||||
void setAutoWriteEOL(bool newAutoWriteEOL);
|
||||
|
||||
QByteArray command() const;
|
||||
bool autoWriteEOL() const;
|
||||
|
||||
|
||||
bool errorOccured() const;
|
||||
|
||||
void setAutoWriteEOL(bool newAutoWriteEOL);
|
||||
static void setDefaultSuccessMessage(const QString& msg);
|
||||
|
||||
|
||||
static void setDefaultErrorMessage(const QString& msg);
|
||||
|
||||
bool autoWriteEOL() const;
|
||||
template <class T> static CommandInterface* factory(unsigned short port)
|
||||
{
|
||||
return new T(port);
|
||||
}
|
||||
|
||||
|
||||
virtual void aboutToDestroy() {}
|
||||
|
||||
bool errorOccured() const;
|
||||
protected:
|
||||
virtual void handleCommandInternal(const QVector<QByteArray>& args) = 0;
|
||||
|
||||
|
||||
void setWriteTimeout(int iMS);
|
||||
|
||||
static void setDefaultSuccessMessage(const QString &msg);
|
||||
void writeData(const QByteArray& payload);
|
||||
|
||||
|
||||
void writeData(const char* payload);
|
||||
|
||||
static void setDefaultErrorMessage(const QString &msg);
|
||||
void writeData(const QString& payload);
|
||||
|
||||
template<class T>
|
||||
static CommandInterface *factory(unsigned short port) { return new T(port); }
|
||||
void writeData(const QStringList& payload);
|
||||
|
||||
|
||||
void writeData(const QList<QByteArray>& payload);
|
||||
|
||||
virtual void aboutToDestroy() {}
|
||||
protected:
|
||||
|
||||
void writeOk(const QString& additionalMsg = QString());
|
||||
|
||||
virtual void handleCommandInternal(const QVector<QByteArray> &args) = 0;
|
||||
|
||||
void writeError(const QString& additionalMsg = QString());
|
||||
|
||||
void setWriteTimeout(int iMS);
|
||||
|
||||
void writeEOL();
|
||||
|
||||
void writeData(const QByteArray &payload);
|
||||
|
||||
QByteArray quote(const QByteArray& payload);
|
||||
|
||||
void writeData(const char *payload);
|
||||
|
||||
QAbstractSocket* socket();
|
||||
|
||||
void writeData(const QString &payload);
|
||||
|
||||
void setSocket(QAbstractSocket* socket);
|
||||
|
||||
void writeData(const QStringList &payload);
|
||||
|
||||
WorkerBase* workerBase();
|
||||
|
||||
void writeData(const QList<QByteArray> &payload);
|
||||
|
||||
void setWorkerBase(WorkerBase* wb);
|
||||
|
||||
void writeOk(const QString &additionalMsg = QString());
|
||||
|
||||
void conversionError(const QByteArray& arg, const QByteArray& type);
|
||||
|
||||
void writeError(const QString &additionalMsg = QString());
|
||||
|
||||
bool getValue(const QByteArray& arg, bool& value);
|
||||
|
||||
void writeEOL();
|
||||
|
||||
bool getValue(const QByteArray& arg, long& value);
|
||||
|
||||
QByteArray quote(const QByteArray &payload);
|
||||
|
||||
bool getValue(const QByteArray& arg, unsigned long& value);
|
||||
|
||||
QAbstractSocket *socket();
|
||||
|
||||
bool getValue(const QByteArray& arg, int& value);
|
||||
|
||||
void setSocket(QAbstractSocket *socket);
|
||||
|
||||
bool getValue(const QByteArray& arg, unsigned int& value);
|
||||
|
||||
WorkerBase *workerBase();
|
||||
|
||||
bool getValue(const QByteArray& arg, float& value);
|
||||
|
||||
void setWorkerBase(WorkerBase *wb);
|
||||
|
||||
bool getValue(const QByteArray& arg, double& value);
|
||||
|
||||
void conversionError(const QByteArray &arg, const QByteArray &type);
|
||||
|
||||
unsigned short port() const;
|
||||
|
||||
bool getValue(const QByteArray &arg, bool &value);
|
||||
|
||||
void closeConnection();
|
||||
|
||||
bool getValue(const QByteArray &arg, long &value);
|
||||
|
||||
bool socketIsOpen() const;
|
||||
|
||||
bool getValue(const QByteArray &arg, unsigned long &value);
|
||||
|
||||
private:
|
||||
friend class WorkerBase;
|
||||
|
||||
bool getValue(const QByteArray &arg, int &value);
|
||||
|
||||
class Private;
|
||||
|
||||
bool getValue(const QByteArray &arg, unsigned int &value);
|
||||
|
||||
|
||||
bool getValue(const QByteArray &arg, float &value);
|
||||
|
||||
|
||||
bool getValue(const QByteArray &arg, double &value);
|
||||
|
||||
|
||||
|
||||
unsigned short port() const;
|
||||
|
||||
|
||||
|
||||
void closeConnection();
|
||||
|
||||
|
||||
|
||||
bool socketIsOpen() const;
|
||||
|
||||
private:
|
||||
friend class WorkerBase;
|
||||
|
||||
class Private;
|
||||
|
||||
|
||||
Private *const d;
|
||||
Private* const d;
|
||||
};
|
||||
Executable → Regular
+30
-62
@@ -1,96 +1,64 @@
|
||||
|
||||
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QTcpServer>
|
||||
#include "tcpserver_export.h"
|
||||
|
||||
#include "sv_export.h"
|
||||
#include <QTcpServer>
|
||||
|
||||
class WorkerInstance;
|
||||
class CommandInterface;
|
||||
|
||||
|
||||
|
||||
class TCPSERVER_EXPORT TcpServer : public QTcpServer
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
typedef QVector<CommandInterface*(*)(unsigned short) > CommandInterfaceList;
|
||||
public:
|
||||
|
||||
Q_OBJECT
|
||||
public:
|
||||
typedef QVector<CommandInterface* (*)(unsigned short)> CommandInterfaceList;
|
||||
|
||||
virtual ~TcpServer();
|
||||
|
||||
public:
|
||||
virtual ~TcpServer();
|
||||
|
||||
static TcpServer *instance(unsigned short port);
|
||||
static TcpServer* instance(unsigned short port);
|
||||
|
||||
|
||||
bool listen(const QHostAddress& address = QHostAddress::Any);
|
||||
|
||||
bool listen(const QHostAddress &address = QHostAddress::Any);
|
||||
void setUseWorkerThreads(bool bEnable);
|
||||
|
||||
|
||||
bool useWorkerThreads() const;
|
||||
|
||||
void setUseWorkerThreads(bool bEnable);
|
||||
QVector<WorkerInstance*> workers() const;
|
||||
|
||||
|
||||
unsigned short getListenPort() const;
|
||||
|
||||
bool useWorkerThreads() const;
|
||||
static bool registerCommand(unsigned short port, CommandInterface* (*factory)(unsigned short));
|
||||
|
||||
|
||||
static bool unregisterCommand(unsigned short port, CommandInterface* (*factory)(unsigned short));
|
||||
|
||||
QVector<WorkerInstance *> workers() const;
|
||||
static CommandInterfaceList registeredCommands(unsigned short port);
|
||||
|
||||
|
||||
void setUserData(void* userData);
|
||||
|
||||
unsigned short getListenPort() const;
|
||||
void* userData() const;
|
||||
|
||||
|
||||
Q_SIGNALS:
|
||||
|
||||
static bool registerCommand(unsigned short port, CommandInterface * (*factory)(unsigned short));
|
||||
void aboutToQuit(unsigned short port);
|
||||
|
||||
|
||||
public Q_SLOTS:
|
||||
|
||||
static bool unregisterCommand(unsigned short port, CommandInterface * (*factory)(unsigned short));
|
||||
void shutdownRequest();
|
||||
|
||||
|
||||
void workerFinished();
|
||||
|
||||
static CommandInterfaceList registeredCommands(unsigned short port);
|
||||
protected:
|
||||
void incomingConnection(qintptr socketDescriptor);
|
||||
|
||||
|
||||
private:
|
||||
class Private;
|
||||
|
||||
void setUserData(void *userData);
|
||||
Private* const d;
|
||||
|
||||
|
||||
explicit TcpServer(unsigned short port);
|
||||
|
||||
void *userData() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
|
||||
|
||||
void aboutToQuit(unsigned short port);
|
||||
|
||||
public Q_SLOTS:
|
||||
|
||||
|
||||
void shutdownRequest();
|
||||
|
||||
|
||||
void workerFinished();
|
||||
|
||||
protected:
|
||||
void incomingConnection(qintptr socketDescriptor);
|
||||
|
||||
private:
|
||||
class Private;
|
||||
|
||||
|
||||
Private *const d;
|
||||
|
||||
explicit TcpServer(unsigned short port);
|
||||
|
||||
|
||||
|
||||
bool listen(const QHostAddress &address, quint16 port);
|
||||
bool listen(const QHostAddress& address, quint16 port);
|
||||
};
|
||||
Executable → Regular
+41
-82
@@ -1,128 +1,87 @@
|
||||
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "tcpserver_export.h"
|
||||
|
||||
#include <QByteArray>
|
||||
#include <QMap>
|
||||
#include <QPointer>
|
||||
#include <QObject>
|
||||
|
||||
#include "sv_export.h"
|
||||
#include <QPointer>
|
||||
|
||||
class QAbstractSocket;
|
||||
class CommandInterface;
|
||||
|
||||
|
||||
|
||||
class TCPSERVER_EXPORT WorkerBase
|
||||
{
|
||||
public:
|
||||
typedef QMap< QByteArray, CommandInterface *> CommandMap;
|
||||
public:
|
||||
|
||||
public:
|
||||
typedef QMap<QByteArray, CommandInterface*> CommandMap;
|
||||
|
||||
WorkerBase(qintptr sd, unsigned short port);
|
||||
|
||||
public:
|
||||
WorkerBase(qintptr sd, unsigned short port);
|
||||
|
||||
virtual ~WorkerBase() = default;
|
||||
|
||||
virtual ~WorkerBase() = default;
|
||||
|
||||
QAbstractSocket *connection();
|
||||
QAbstractSocket* connection();
|
||||
|
||||
|
||||
const QAbstractSocket* connection() const;
|
||||
|
||||
const QAbstractSocket *connection() const;
|
||||
void redirectDataHandling(bool bDoRedirect, CommandInterface* newDataHandler = nullptr);
|
||||
|
||||
|
||||
static QByteArray formatForDebug(const QByteArray& data);
|
||||
|
||||
void redirectDataHandling(bool bDoRedirect, CommandInterface *newDataHandler = nullptr);
|
||||
static QByteArray formatForDebug(const QAbstractSocket* dev);
|
||||
|
||||
|
||||
CommandMap getCommands() const;
|
||||
|
||||
static QByteArray formatForDebug(const QByteArray &data);
|
||||
protected:
|
||||
void newDataInternal();
|
||||
|
||||
|
||||
int initCommands(unsigned short port);
|
||||
|
||||
static QByteArray formatForDebug(const QAbstractSocket *dev);
|
||||
void cleanupCommands();
|
||||
|
||||
|
||||
qintptr m_socketDescriptor;
|
||||
|
||||
CommandMap getCommands() const;
|
||||
QPointer<QAbstractSocket> m_connection;
|
||||
|
||||
protected:
|
||||
|
||||
unsigned short m_port;
|
||||
|
||||
void newDataInternal();
|
||||
|
||||
QByteArray m_connString;
|
||||
|
||||
int initCommands(unsigned short port);
|
||||
bool m_bRedirectIncomingData;
|
||||
|
||||
|
||||
CommandInterface* m_bRedirectDataHandler;
|
||||
|
||||
void cleanupCommands();
|
||||
|
||||
|
||||
|
||||
qintptr m_socketDescriptor;
|
||||
|
||||
|
||||
QPointer<QAbstractSocket> m_connection;
|
||||
|
||||
|
||||
unsigned short m_port;
|
||||
|
||||
|
||||
QByteArray m_connString;
|
||||
|
||||
|
||||
bool m_bRedirectIncomingData;
|
||||
|
||||
|
||||
CommandInterface *m_bRedirectDataHandler;
|
||||
|
||||
|
||||
|
||||
CommandMap m_registeredCommands;
|
||||
CommandMap m_registeredCommands;
|
||||
};
|
||||
|
||||
|
||||
|
||||
class WorkerInstance final : public QObject, public WorkerBase
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
WorkerInstance(qintptr sd, unsigned short port, QObject *parent = nullptr);
|
||||
virtual ~WorkerInstance();
|
||||
Q_OBJECT
|
||||
public:
|
||||
WorkerInstance(qintptr sd, unsigned short port, QObject* parent = nullptr);
|
||||
virtual ~WorkerInstance();
|
||||
|
||||
|
||||
bool isRunning() const;
|
||||
|
||||
bool isRunning() const;
|
||||
|
||||
bool isFinished() const;
|
||||
|
||||
bool isFinished() const;
|
||||
public Q_SLOTS:
|
||||
|
||||
public Q_SLOTS:
|
||||
|
||||
void quit();
|
||||
|
||||
void quit();
|
||||
void doWork();
|
||||
|
||||
|
||||
protected Q_SLOTS:
|
||||
|
||||
void doWork();
|
||||
void newData();
|
||||
|
||||
protected Q_SLOTS:
|
||||
|
||||
void connectionDisconnected();
|
||||
|
||||
void newData();
|
||||
|
||||
Q_SIGNALS:
|
||||
void finished();
|
||||
|
||||
void connectionDisconnected();
|
||||
|
||||
Q_SIGNALS:
|
||||
void finished();
|
||||
|
||||
private:
|
||||
bool m_bFinished;
|
||||
private:
|
||||
bool m_bFinished;
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user