Files
qt-migration-legatus/qt5-before/dlbo/Lts/Services/AreaEffectSimulation/handler_effector.cpp
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

88 lines
2.7 KiB
C++

/**
* Object class for HandlerEffector
* $Id$
* $HeadURL$
* $Author$
*/
#include "handler_effector.h"
#include "main_handler.h"
#include "object_charge_effect.h"
#include "object_effector.h"
namespace AreaEffectSimulation
{
HandlerEffector::HandlerEffector(AreaEffectSimulation::MainHandler *mainhandler, QObject *parent)
: QObject(parent)
, m_mainHandler(mainhandler)
, m_logger(getLogger(QStringLiteral("HandlerEffector")))
{
m_ppmDtc = m_mainHandler->dds()->ppmDtc();
m_ppmDtc->enableType(true);
m_ppmDtc->waitForHistoricalDataType(100);
m_ppmDtc->enableParticipant(true);
m_ppmDtc->waitForHistoricalDataParticipant(100);
}
//-----------------------------------------------------------------------------
bool HandlerEffector::init()
{
DEBUG_LOG(m_logger) << "HandlerEffector::init";
connect(m_ppmDtc.get(), &ParticipantManagement::Interface::Dtc::participantChanged,
this, &HandlerEffector::onParticipantChanged);
{
auto cb = [this](const ParticipantManagement::Participant & data)
{
onParticipantChanged(data, DataModification::eAdded);
};
m_ppmDtc->participants(cb);
}
return true;
}
// TODO Wird aufgerufen, wenn zur Laufzeit ein neuer Effektor angelegt werden muss. (Topic PPM Participant)
// und von createEffector
void HandlerEffector::createEffector(int participantId)
{
if (m_effectors.contains(participantId))
return;
DEBUG_LOG(m_logger)<<"createEffector participantId:" << participantId;
ObjectEffector* objectEffector = new ObjectEffector(m_mainHandler, this);
objectEffector->init(participantId);
m_effectors.insert(participantId, objectEffector);
}
// TODO Wird aufgerufen, wenn zur Laufzeit ein Effektor geloescht wird. (Topic?)
void HandlerEffector::deleteEffector(int participantId)
{
DEBUG_LOG(m_logger)<<"deleteEffector participantId:" << participantId;
delete m_effectors[participantId];
m_effectors.remove(participantId);
}
void HandlerEffector::onParticipantChanged(const ParticipantManagement::Participant &data, DataModification modType)
{
//DEBUG_LOG(m_logger)<<"onParticipantChanged participantId:" << data.id();
if (modType == DataModification::eRemoved)
{
DEBUG_LOG(m_logger) << "m_participantsOutsideMap.remove participantId: " << data.id();
if (m_effectors.contains(data.id()))
deleteEffector(data.id());
return;
}
if (m_ppmDtc->isArtilleryType(data.typeId()))
{
// Filter TypeClass Unit
ParticipantManagement::Type type = m_ppmDtc->type(data.typeId());
if (type.typeClass() != ParticipantManagement::TypeClass_def::Unit)
createEffector(data.id());
}
else
if (m_effectors.contains(data.id()))
deleteEffector(data.id());
}
}