TrainingAreaBase: - Add BUILD_RTI guards to dds_handler.cpp (entire file) - Add BUILD_RTI guards to recv_from_dds_aes.h for tab_db.h include - Add BUILD_RTI guards to main_handler.h for tab_db.h include - Remove duplicate m_logger declaration in main_handler.h - Add stub headers for RTI types (tab_db_stub.hpp, tab_enums_stub.hpp, etc.) VideoOverlayManagement: - Fix member initialization order in handler_overlays.h - Fix member initialization order in avs_interface.h - Fix member initialization order in main_handler.h - Change logger.cpp include from NGLLogger.h to INGLLogger.h - Add BUILD_RTI guard to handler_overlays.cpp for RTI signal connection Plugins: - Migrate QDesktopWidget → QScreen in Light/Dark style plugins - Fix CMakeLists.txt for SituationReplayManagement (BUILD_RTI guards) - Fix CMakeLists.txt for CombatNetRadio (Qt6::Core linking) - Remove QDesktopWidget includes in multiple plugin files Infrastructure: - Remove duplicate INGLLogger.h include directory - Add stub headers for ProjectDataManagement (pdm.hpp, etc.) - Add stub headers for RoutingServiceNG BUILD_RTI=OFF build now compiles successfully (1112 targets).
128 lines
2.9 KiB
C++
Executable File
128 lines
2.9 KiB
C++
Executable File
/**
|
|
* 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
|
|
|
|
NGL::INGLLogger &m_logger;
|
|
|
|
QByteArray m_buffer; ///< data buffer to hold incoming data form tcpsocket
|
|
|
|
|
|
};
|
|
|
|
} // namespace VideoOverlayManagement
|