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>
This commit is contained in:
18662 files changed
+4115092
-5435
No files matched your search
@@ -0,0 +1,214 @@
|
||||
/**
|
||||
* MainHandler for VideoOverlayManagement
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by hjl, SLSE, 2016-06-23
|
||||
*/
|
||||
|
||||
#include "main_handler.h"
|
||||
#include "settings.h"
|
||||
|
||||
#include <QTimer>
|
||||
|
||||
#include <DDS/Core/pacemaker.h>
|
||||
|
||||
using namespace VideoOverlayManagement;
|
||||
|
||||
MainHandler::MainHandler(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_exerciseId(0)
|
||||
, m_avsIf(new AvsInterface(true, this))
|
||||
, m_avsConnectionState(AvsIfConnectionState::Undefined)
|
||||
, m_ddsHandler(nullptr)
|
||||
, m_handlerParticipantData(nullptr)
|
||||
, m_handlerInfrastructureData(nullptr)
|
||||
, m_handlerOverlays(nullptr)
|
||||
, m_checkConnectTimer(new QTimer(this))
|
||||
, m_keepAliveTriggerTimer(new QTimer(this))
|
||||
, m_bAvsSocketWarnedOnce(false)
|
||||
, m_logger(getLogger("MainHandler"))
|
||||
{
|
||||
} // end of ctor()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
MainHandler::~MainHandler()
|
||||
{
|
||||
m_ddsHandler.reset();
|
||||
} // end of dtor()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool MainHandler::init(int domainId, int exerciseId)
|
||||
{
|
||||
INFO_LOG(m_logger) << "Start VideoOverlayManagement MainHandler.";
|
||||
|
||||
m_exerciseId = exerciseId;
|
||||
|
||||
// init AVS-Interface
|
||||
QString hostName = Settings::getAvsHostname();
|
||||
quint16 port = Settings::getAvsAvaPort();
|
||||
INFO_LOG(m_logger) << "Init AVS-Interface Hostname/Ip:" << hostName
|
||||
<< " Port: " << port;
|
||||
|
||||
m_avsIf->start(hostName, port);
|
||||
|
||||
connect(m_avsIf, &AvsInterface::avsIfConnectionState,
|
||||
this, &MainHandler::onAvsIfConnectionState);
|
||||
|
||||
connect(m_avsIf, &AvsInterface::avsCmdState,
|
||||
this, &MainHandler::onAvsCmdState);
|
||||
|
||||
connect(m_avsIf, &AvsInterface::avsKeepAliveTimeout,
|
||||
this, &MainHandler::onAvsKeepAliveTimeout);
|
||||
|
||||
connect(m_keepAliveTriggerTimer, &QTimer::timeout,
|
||||
this, &MainHandler::onSendKeepAlive);
|
||||
|
||||
// initialize DDS
|
||||
// for VideoOverlayManagement => exerciseId = partitionId
|
||||
m_ddsHandler.reset(new DdsHandler(domainId, exerciseId));
|
||||
if (!m_ddsHandler->init())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Initialisation DdsHandler failed.";
|
||||
if (m_ddsHandler->pacemaker())
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError);
|
||||
return false;
|
||||
}
|
||||
|
||||
// initialize handlerParticipantData
|
||||
m_handlerParticipantData.reset(new HandlerParticipantData(m_ddsHandler, this));
|
||||
|
||||
if (!m_handlerParticipantData->init())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Initialisation HandlerPlayerData failed.";
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError);
|
||||
return false;
|
||||
}
|
||||
|
||||
// initialize handlerInfraStructureData
|
||||
m_handlerInfrastructureData.reset(new HandlerInfrastructureData(m_ddsHandler, this));
|
||||
|
||||
if (!m_handlerInfrastructureData->init(m_exerciseId))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Initialisation HandlerInfrastructreData failed.";
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Initialisation of OverlayHandler wait until AVS is connected
|
||||
connect(m_checkConnectTimer, &QTimer::timeout,
|
||||
this, &MainHandler::onTryToInitOverlayHandler);
|
||||
m_checkConnectTimer->start(1000);
|
||||
|
||||
INFO_LOG(m_logger) << "VOM Handler initialized. (Connection to AVS may be still pending) ";
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::Starting);
|
||||
|
||||
return true;
|
||||
} // end of init()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool MainHandler::onTryToInitOverlayHandler()
|
||||
{
|
||||
m_avsConnectionState = m_avsIf->getAvsIfState();
|
||||
if (m_avsConnectionState != AvsIfConnectionState::Connected)
|
||||
{
|
||||
if (!m_bAvsSocketWarnedOnce)
|
||||
{
|
||||
m_bAvsSocketWarnedOnce = true;
|
||||
WARNING_LOG(m_logger) << "MainHandler::onTryToInitOverlayHandler()"
|
||||
<< " Wait for AvsIfConnectionState::Connected... ";
|
||||
}
|
||||
return false;
|
||||
}
|
||||
m_bAvsSocketWarnedOnce = true; // reset
|
||||
|
||||
m_checkConnectTimer->stop();
|
||||
|
||||
// initialize handlerOverlays
|
||||
m_handlerOverlays.reset(new HandlerOverlays(m_avsIf, m_handlerParticipantData, m_handlerInfrastructureData, m_exerciseId, this));
|
||||
|
||||
if (!m_handlerOverlays->init())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Initialisation HandlerOverlays failed.";
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StoppedError);
|
||||
return false;
|
||||
}
|
||||
|
||||
INFO_LOG(m_logger) << "VOM Handler initialized. (Connection to AVS established) ";
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::Running);
|
||||
|
||||
return true;
|
||||
} // end of onTryToInitOverlayHandler()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void MainHandler::onAvsIfConnectionState(AvsIfConnectionState state)
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
case AvsIfConnectionState::Connected:
|
||||
INFO_LOG(m_logger) << "AvsIfConnectionState::Connected ... start keepAliveTriggerTimer";
|
||||
m_keepAliveTriggerTimer->start(Settings::getAvsKeepAliveTriggerRequestTime());
|
||||
break;
|
||||
case AvsIfConnectionState::Disconnected:
|
||||
m_keepAliveTriggerTimer->stop();
|
||||
break;
|
||||
case AvsIfConnectionState::TryReconnect:
|
||||
m_keepAliveTriggerTimer->stop();
|
||||
break;
|
||||
case AvsIfConnectionState::ConnectionError:
|
||||
ERROR_LOG(m_logger) << "AvsIfConnectionState::ConnectionError !";
|
||||
m_keepAliveTriggerTimer->stop();
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StoppedError);
|
||||
break;
|
||||
case AvsIfConnectionState::Undefined:
|
||||
default:
|
||||
WARNING_LOG(m_logger) << "Undefined AvsIfConnectionState !";
|
||||
break;
|
||||
}
|
||||
} // end of onAvsIfConnectionState()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void MainHandler::onAvsCmdState(AvsCmdState state)
|
||||
{
|
||||
bool bOk = false;
|
||||
switch (state)
|
||||
{
|
||||
case AvsCmdState::Ok:
|
||||
INFO_LOG(m_logger) << "AvsCmdState::Ok";
|
||||
bOk = true;
|
||||
break;
|
||||
case AvsCmdState::BadArguments:
|
||||
WARNING_LOG(m_logger) << "AvsCmdState::BadArguments";
|
||||
break;
|
||||
case AvsCmdState::CommandNotStateValid:
|
||||
WARNING_LOG(m_logger) << "AvsCmdState::CommandNotStateValid";
|
||||
break;
|
||||
case AvsCmdState::KeepAlive:
|
||||
DEBUG_LOG(m_logger) << "AvsCmdState::KeepAlive";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (!bOk)
|
||||
{
|
||||
// ToDo: Fehlermeldung an ServiceManagement senden
|
||||
}
|
||||
} // end of onAvsCmdState()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void MainHandler::onAvsKeepAliveTimeout()
|
||||
{
|
||||
// ToDo: Fehlermeldung an ServiceManagement senden
|
||||
WARNING_LOG(m_logger) << "AVS KeepAlive timeout !";
|
||||
} // end of onAvsKeepAliveTimeout()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void MainHandler::onSendKeepAlive()
|
||||
{
|
||||
QString cmd(QLatin1String("KEEPALIVE"));
|
||||
QByteArray qba = cmd.toLatin1();
|
||||
qba += "\r\n";
|
||||
m_avsIf->sendCommand(qba);
|
||||
} // end of onSendKeepAlive()
|
||||
//-----------------------------------------------------------------------------
|
||||
Reference in new issue
Block a user