Files
qt-migration-legatus/qt5-before/dlbo/Lts/Services/VideoOverlayManagement/avs_interface.h
T
torstenandCopilot 7173785915 Qt6 Migration: Complete migration with DDS/RTI support and build validation
Major Changes:
- Merged latest Qt5 devel content from dlbo (292 files changed, 7 new dirs)
- Consolidated forward-declarations and include folders
- Removed unneeded modules per Niklas' repo check list

Build System Fixes:
- Fixed CMake VERSION_GREATER syntax in ParticipantManagement/CMakeLists.txt
- Added VLC packages (libvlc-dev, vlc-plugin-base) to docker_build.sh
- Added PostgreSQL dev packages (libpq-dev, postgresql-server-dev-all) to Dockerfile
- Fixed locale warnings (ANSI_X3.4-1968 → C.UTF-8)
- Fixed ArcGIS SDK path warnings when BUILD_ARCGIS=OFF

Code Generation Fixes:
- Fixed IDL enum collisions (PortType→CorePortType/DdsutPortType, PdmEventType)
- Fixed Grantlee template svc_translation.cpp.grantlee:
  - Changed {{ idl_enum.name }}_def:: to {{ idl_enum.name }}::
  - Fixed .underlying() calls for C++11 scoped enums (enum class)
- Removed generated files from repo (moc_*, *_dtc.h, *_ftc.h)

Validation:
- BUILD_RTI=ON: SUCCESS
- BUILD_RTI=OFF: SUCCESS
- C++17 standard maintained for RTI 7.7 compatibility
- Ubuntu 26.04 Docker environment verified

Remaining Warnings (expected):
- BgViewer, KDChart, KDReports, Poppler-Qt6 not found (optional features)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-09-15 18:20:26 +00:00

125 lines
2.9 KiB
C++

/**
* AVS-Interface for VideoOverlayManagement
* $Id$
* $HeadURL$
* $Author$
* Created by hjl, SLSE, 2016-06-24
*/
#pragma once
#include <QtCore/QObject>
#include <QtNetwork/QHostAddress>
#include "logger.h"
// Forwarddeclarations
class QTcpSocket;
class QTimer;
namespace VideoOverlayManagement
{
enum class AvsIfConnectionState
{
Undefined = 0,
Connected,
Disconnected,
TryReconnect,
ConnectionError,
};
enum class AvsCmdState
{
Ok = 200,
KeepAlive = 298,
BadArguments = 402,
CommandNotStateValid = 455
};
class AvsInterface
: public QObject
{
Q_OBJECT
public:
/**
* Constructor connect to plugboard
* @param[in] enableTryReconnect if true, try reconnection
* @param[in] parent Pointer to parent qObject
*/
AvsInterface(bool enableTryReconnect, QObject *parent = nullptr);
~AvsInterface();
/**
* Connect to AVS RCP_AVA
* @param[in] hostName Hostname or Ip address to get access to AVS
* @param[in] port Ip port to get access to AVS
*/
void start(const QString &hostName, quint16 port);
AvsIfConnectionState getAvsIfState()
{
return m_avsIfConnectionState;
}
/**
* Send data to connected TcpSocket
* @param[in] qba Data to be transfered completed with "\r\n"
*/
bool sendCommand(const QByteArray &qba);
Q_SIGNALS:
/**
* Signals current AVS connection state
*/
void avsIfConnectionState(AvsIfConnectionState);
/**
* Signals current AVS command state
*/
void avsCmdState(AvsCmdState);
/**
* Signals an missing AVS keep-alive
* If the parameter 'enableTryReconnect' is set
* the connection attempting to restore automatically
*/
void avsKeepAliveTimeout();
/**
* Define the signal/slots connects uesd for TcpSocket
*/
protected Q_SLOTS:
void doConnect();
void onConnected();
void onDisonnected();
void onError(QAbstractSocket::SocketError);
void onReadyRead();
void onAvsKeepAliveTimeout();
private: // methode
void tryReconnect();
private: // attributes
QString m_hostName; ///< Hostname or Ip address to get access to AVS
QString m_ipAddressDNS; ///< DNS IP address of AVS
quint16 m_hostPort; ///< Ip port to get access to AVS
qint32 m_waitTime; ///< delay before try reconnection
bool m_enableTryReconnect; ///< if true, enables try reconnection
bool m_tryReconnect; ///< if true, try reconnection
QTimer *m_avsKeepAliveTimer; ///< AVS keep-alive timer
qint32 m_keepAliveTime; ///< AVS keep-alive time intervall in msec
AvsIfConnectionState m_avsIfConnectionState; ///< AVS Interface connection state
QTcpSocket *m_socket; ///< pointer to tcpsocket object
QByteArray m_buffer; ///< data buffer to hold incoming data form tcpsocket
NGL::INGLLogger &m_logger; ///< Interface to the Logging-Facility
};
} // namespace VideoOverlayManagement