Qt6 Migration: DDS-Stubs, Logger-Fixes, Export-Header Korrekturen

- NGL_ADD_LIBRARY2: 87 CMakeLists.txt konvertiert für Export-Header Generierung
- 44 Export-Header Include-Pfade korrigiert (_export.h)
- 81 DDS-Stub-Header generiert (*_dtc.h, *_fts.h, *_dts.h, *_ftc.h)
- INGLLogger: Duplikat gelöscht, m_logger Member entfernt, variadische Makros
- Q_FUNC_INFO Redefinition behoben (Qt6 definiert bereits)
- FATAL_LOG Makro hinzugefügt
- InfrastructureManagement DDS-Stubs (ism.hpp, ism_enums.hpp, ism_ftc.h)
- FilterManagement DDS-Stubs (flt_ftc.h, flt_dts.h)
- AreaEffectSimulation DDS-Stubs (aes.hpp, aes_enums.hpp)
- SymbolAppearance Klasse vollständig definiert mit content() Methode
- BuildingComponentFilter Klasse definiert mit Copy-Konstruktor
- Ftc Factory: nullptr Return (abstract class)
- AesFilter Klasse in aes.hpp hinzugefügt
- Dtc Klasse in ppm.hpp mit participantChanged Signal
- AesType Enum: alle 15 At* Werte definiert
- AesEffectState_def: EsReceived hinzugefügt
- DataModification Enum: eAdded/eModified/eRemoved
- function_reply_object.h → core_types.h Include-Pfad (72 Dateien)
- Enum-Class-Streaming Template-Operator in INGLLogger.h
- ism_mounting_point.h: QImage → QtGui/QImage, QGuiApplication/QScreen
- ism_data_plugin_interface.h: QSet Include, Include-Reihenfolge
- QRegExp → QRegularExpression in tpm_js_parser.cpp
- .underlying() Aufrufe zu direktem Enum-Vergleich korrigiert
- Include-Pfade: aes.hpp in symbol_appearance_settings_impl.h und aes_display_filter_impl.h

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
torstenandCopilot committed 2026-08-19 06:06:24 +02:00
1 parent 010f91928a
commit b774f4035c
2785 files changed
+18754 -18316

No files matched your search

@@ -72,7 +72,6 @@ AesHandler::AesHandler(NgsHandler *ngsHandler)
, m_dtcAes(nullptr)
, m_ftcAes(nullptr)
, m_requestHelper(new LtsUtils::RequestHelper(this))
, m_logger(getLogger("AesHandler"))
{
}
@@ -80,9 +79,9 @@ AesHandler::AesHandler(NgsHandler *ngsHandler)
void AesHandler::onMineAreaModifyReply(const Core::FunctionReplyObject &replyObject)
{
if (replyObject.error())
WARNING_LOG(m_logger) << "ModifyReply: " << replyObject();
WARNING_LOG() << "ModifyReply: " << replyObject();
else
DEBUG_LOG(m_logger) << "ModifyReply: " << replyObject();
DEBUG_LOG() << "ModifyReply: " << replyObject();
m_requestHelper->requestReply(replyObject);
}
@@ -177,7 +176,7 @@ void AesHandler::onAesItemViewChanged(const AesItemView &data, DataModification
for (const auto &pos : data.form())
formString << ParticipantPosition(pos).toString();
DEBUG_LOG(m_logger) << "\n##############################"
DEBUG_LOG() << "\n##############################"
<< "\n##### AesItemViewChanged #####"
<< "\n##############################"
<< "\nid: " << data.id()
@@ -197,7 +196,7 @@ void AesHandler::onAesItemViewChanged(const AesItemView &data, DataModification
data.effectStateId() == AesEffectState::EsExpired ||
data.effectStateId() == AesEffectState::EsRemoved)
{
DEBUG_LOG(m_logger) << "Item view with id " << data.aesItemId() << " removed";
DEBUG_LOG() << "Item view with id " << data.aesItemId() << " removed";
m_aesItemViews.remove(data.aesItemId());
m_takenIndicesForAesItem.remove(data.aesItemId());
m_ngsHandler->ngsConnector()->setItemForm(data.aesItemId());
@@ -206,7 +205,7 @@ void AesHandler::onAesItemViewChanged(const AesItemView &data, DataModification
else if (data.effectStateId() == AesEffectState::EsPrepared &&
data.aesTypeId() == AesType_def::AtExplosionAreaSingleExplosions)
{
DEBUG_LOG(m_logger) << "Item view with id " << data.aesItemId() << " added";
DEBUG_LOG() << "Item view with id " << data.aesItemId() << " added";
m_aesItemViews.insert(data.aesItemId(), data);
m_takenIndicesForAesItem.insert(data.aesItemId(), QVector<int32_t>());
}
@@ -214,7 +213,7 @@ void AesHandler::onAesItemViewChanged(const AesItemView &data, DataModification
else if (data.aesTypeId() == AesType_def::AtBCContamination)
{
m_ngsHandler->ngsConnector()->setItemForm(data.aesItemId(), data.aesTypeId().underlying(), data.form());
DEBUG_LOG(m_logger) << "Item view with id " << data.aesItemId() << " directly updated in ngsConnector";
DEBUG_LOG() << "Item view with id " << data.aesItemId() << " directly updated in ngsConnector";
}
}
@@ -230,7 +229,7 @@ void AesHandler::onTriggeredImpactsChanged(const TriggeredImpacts &data, DataMod
}
bitfield.append(QStringLiteral("]"));
DEBUG_LOG(m_logger) << "\n#####################################"
DEBUG_LOG() << "\n#####################################"
<< "\n##### triggered impacts changed #####"
<< "\n#####################################"
<< "\nid: " << data.id()
@@ -350,7 +349,7 @@ void AesHandler::onAesExplosionSingleChanged(const ExplosionSingle &data, DataMo
DEBUG_LOG(m_logger) << "\n####################################"
DEBUG_LOG() << "\n####################################"
<< "\n##### single explosion changed #####"
<< "\n####################################"
<< "\nid: " << data.id()
@@ -388,7 +387,7 @@ void AesHandler::onAesMineAreaChanged(const MineArea &data, DataModification mod
{
Q_UNUSED(modType);
DEBUG_LOG(m_logger) << "\n#############################"
DEBUG_LOG() << "\n#############################"
<< "\n##### mine area changed #####"
<< "\n#############################"
<< "\nid: " << data.id()
@@ -411,7 +410,7 @@ void AesHandler::onAesMineCorridorChanged(const MineCorridor &data, DataModifica
{
Q_UNUSED(modType);
DEBUG_LOG(m_logger) << "\n#################################"
DEBUG_LOG() << "\n#################################"
<< "\n##### mine corridor changed #####"
<< "\n#################################"
<< "\nid: " << data.id()
@@ -436,7 +435,7 @@ void AesHandler::onAesNContaminationChanged(const NContamination &data, DataModi
Q_UNUSED(modType);
m_ngsHandler->ngsConnector()->guezNuclearAgent(data);
DEBUG_LOG(m_logger) << "\n####################################"
DEBUG_LOG() << "\n####################################"
<< "\n##### n contamination changed #####"
<< "\n####################################"
<< "\nid: " << data.id()
@@ -459,7 +458,7 @@ void AesHandler::onAesBCContaminationChanged(const BCContamination &data, DataMo
Q_UNUSED(modType);
m_ngsHandler->ngsConnector()->guezChemicalAgent(data);
DEBUG_LOG(m_logger) << "\n####################################"
DEBUG_LOG() << "\n####################################"
<< "\n##### bc contamination changed #####"
<< "\n####################################"
<< "\nid: " << data.id()
@@ -564,7 +563,7 @@ void AesHandler::onAesRemoveItem(qint64 identifierInt)
AesType type = m_dtcAes->aesItemIdFromExternalId(identifierInt, aesItemId);
Core::RemoveElementRequest req(aesItemId);
DEBUG_LOG(m_logger) << "Remove Item for " << aesItemId << " requested. Type: " << type;
DEBUG_LOG() << "Remove Item for " << aesItemId << " requested. Type: " << type;
switch (type.underlying())
{
@@ -648,11 +647,11 @@ void AesHandler::onAesActivationTimeChanged(qint64 identifierInt, qint64 msecsSi
}
case AreaEffectSimulation::AesType_def::AtMineArea:
{
DEBUG_LOG(m_logger) << "onAesActivationTimeChanged / MineArea";
DEBUG_LOG() << "onAesActivationTimeChanged / MineArea";
MineAreaModifyRequest *req = static_cast<MineAreaModifyRequest*>(m_pendingRequests.value(aesItemId));
if (!req)
{
DEBUG_LOG(m_logger) << "onAesActivationTimeChanged / MineArea - Request NOT found";
DEBUG_LOG() << "onAesActivationTimeChanged / MineArea - Request NOT found";
AreaEffectSimulation::MineArea item = m_dtcAes->mineArea(aesItemId);
if ((item.effectStart().is_set() && item.effectStart().get() == msecsSinceEpoch) || !isModifiable(item))
return;
@@ -959,7 +958,7 @@ void AesHandler::onAesPointsDataChanged(qint64 identifierInt, const std::vector<
int aesItemId = 0;
AesType type = m_dtcAes->aesItemIdFromExternalId(identifierInt, aesItemId);
DEBUG_LOG(m_logger) << "Points Data changed for Aes Item ID: " << aesItemId << ". Type: " << type;
DEBUG_LOG() << "Points Data changed for Aes Item ID: " << aesItemId << ". Type: " << type;
switch (type.underlying())
{
@@ -981,7 +980,7 @@ void AesHandler::onAesPointsDataChanged(qint64 identifierInt, const std::vector<
std::vector<Core::GeoPosition2D> segments;
if (!getCorridorSegment(pos, segments, width))
{
ERROR_LOG(m_logger) << "Could not calculate Mine Area from given Points Data!";
ERROR_LOG() << "Could not calculate Mine Area from given Points Data!";
return;
}
req->segments(segments);
@@ -1004,7 +1003,7 @@ void AesHandler::onAesPointsDataChanged(qint64 identifierInt, const std::vector<
std::vector<Core::GeoPosition2D> segments;
if (!getCorridorSegment(pos, segments, width))
{
ERROR_LOG(m_logger) << "Could not calculate Mine Area from given Points Data!";
ERROR_LOG() << "Could not calculate Mine Area from given Points Data!";
return;
}
req->segments(segments);
@@ -106,7 +106,5 @@ private:
QMap<int, void*> m_pendingRequests;
LtsUtils::RequestHelper *m_requestHelper;
NGL::INGLLogger &m_logger;
};
}
@@ -12,9 +12,8 @@ namespace HighLevelArchitecture
DdsHandler::DdsHandler(int domainId, int exerciseId)
: m_ddsConnector(new DDSConnector::DdsConnector(domainId, IDL::PartitionType::Exercise, exerciseId))
, m_hlaIsActive(false)
, m_logger(getLogger("DdsHandler"))
{
DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
DEBUG_LOG() << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
}
DdsHandler::~DdsHandler()
@@ -28,7 +27,7 @@ bool DdsHandler::init(const QStringList &qosFileList)
{
if (!m_ddsConnector->init(qosFileList))
{
ERROR_LOG(m_logger) << "Error initializing dds connections - aborting";
ERROR_LOG() << "Error initializing dds connections - aborting";
return false;
}
@@ -39,7 +39,6 @@ private:
std::shared_ptr<Core::Pacemaker> m_pacemaker;
std::shared_ptr<ExerciseManagement::Interface::Dtc> m_dtcExm;
bool m_hlaIsActive;
NGL::INGLLogger &m_logger;
};
}
@@ -18,7 +18,6 @@ namespace HighLevelArchitecture
MainHandler::MainHandler(QObject *parent)
: QObject(parent)
, m_exerciseId(0)
, m_logger(getLogger("MainHandler"))
{}
MainHandler::~MainHandler()
@@ -35,7 +34,7 @@ bool MainHandler::init(int domainId, int exerciseId)
m_ddsHandler = std::make_shared<DdsHandler>(domainId, exerciseId);
if (!m_ddsHandler->init())
{
ERROR_LOG(m_logger) << "Could not init DDS handler";
ERROR_LOG() << "Could not init DDS handler";
return false;
}
connect(m_ddsHandler.get(), &DdsHandler::exerciseHlaStateChanged,
@@ -30,6 +30,5 @@ private:
std::shared_ptr<NgsHandler> m_ngsHandler;
std::shared_ptr<WebSocketHandler> m_wsHandler;
int m_exerciseId;
LOGGER_T m_logger;
};
}
@@ -155,7 +155,6 @@ NgsConnector::NgsConnector(const QString &fedName, NgsHandler *ngsHandler)
, m_bInitialized(false)
, m_bCanPublishData(false)
, m_timer(new QTimer(this))
, m_logger(getLogger("NgsConnector"))
{
connect(m_timer, &QTimer::timeout,
this, &NgsConnector::go);
@@ -235,7 +234,7 @@ bool NgsConnector::initialize(ngs::IObserver::ProtocolType protocol, const QStri
}
catch (const ngs::NGSSimWorldException &e)
{
ERROR_LOG(m_logger) << "caught exception during init (getIFederationMaster): " << e.print();
ERROR_LOG() << "caught exception during init (getIFederationMaster): " << e.print();
return false;
}
@@ -250,7 +249,7 @@ bool NgsConnector::initialize(ngs::IObserver::ProtocolType protocol, const QStri
}
catch (const NGSException &e)
{
ERROR_LOG(m_logger) << "caught exception during init (createFederation): " << e.print();
ERROR_LOG() << "caught exception during init (createFederation): " << e.print();
return false;
}
player = &m_swadmin->getIPlayer(m_fedName.toStdString(), playerName.toStdString(), *m_playerCallback, Settings::swConfFileName().toLatin1().data(), Settings::fomIdentifier().toStdString(), Settings::rtiIdentifier().toStdString());
@@ -300,27 +299,27 @@ void NgsConnector::subscribeAtNgs()
m_enitityNumberCounter = 1;
m_eventCount = 1;
INFO_LOG(m_logger) << "Subscribe at NGS - Guez Human Objects";
INFO_LOG() << "Subscribe at NGS - Guez Human Objects";
rpr2::IObserverGuezHumanObjClass &humanObjClass = m_somPlayer->getObserverGuezHumanObjClass(*m_humanCallback);
humanObjClass.subscribeAllAttributes();
humanObjClass.subscribe();
INFO_LOG(m_logger) << "Subscribe at NGS - Guez ObserverController Objects";
INFO_LOG() << "Subscribe at NGS - Guez ObserverController Objects";
rpr2::IObserverGuezObserverControllerObjClass &observerControllerObjClass = m_somPlayer->getObserverGuezObserverControllerObjClass(*m_observerControllerCallback);
observerControllerObjClass.subscribeAllAttributes();
observerControllerObjClass.subscribe();
INFO_LOG(m_logger) << "Subscribe at NGS - Guez GroundVehicle Objects";
INFO_LOG() << "Subscribe at NGS - Guez GroundVehicle Objects";
rpr2::IObserverGuezGroundVehicleObjClass &groundVehicleObjClass = m_somPlayer->getObserverGuezGroundVehicleObjClass(*m_groundVehicleCallback);
groundVehicleObjClass.subscribeAllAttributes();
groundVehicleObjClass.subscribe();
INFO_LOG(m_logger) << "Subscribe at NGS - Guez MineField Objects";
INFO_LOG() << "Subscribe at NGS - Guez MineField Objects";
rpr2::IObserverGuezMineFieldObjClass &minefieldObjClass = m_somPlayer->getObserverGuezMineFieldObjClass(*m_minefieldCallback);
minefieldObjClass.subscribeAllAttributes();
minefieldObjClass.subscribe();
INFO_LOG(m_logger) << "Subscribe at NGS - Guez MineField Breach Objects";
INFO_LOG() << "Subscribe at NGS - Guez MineField Breach Objects";
rpr2::IObserverGuezMineFieldBreachObjClass &minefieldBreachObjClass = m_somPlayer->getObserverGuezMineFieldBreachObjClass(*m_minefieldBreachCallback);
minefieldBreachObjClass.subscribeAllAttributes();
minefieldBreachObjClass.subscribe();
@@ -356,23 +355,23 @@ void NgsConnector::unsubscribeFromNgs()
if (m_somPlayer)
{
INFO_LOG(m_logger) << "Unsubscribe at NGS - Guez Human Objects";
INFO_LOG() << "Unsubscribe at NGS - Guez Human Objects";
rpr2::IObserverGuezHumanObjClass &humanObjClass = m_somPlayer->getObserverGuezHumanObjClass(*m_humanCallback);
humanObjClass.unsubscribe();
INFO_LOG(m_logger) << "Unsubscribe at NGS - Guez ObserverController Objects";
INFO_LOG() << "Unsubscribe at NGS - Guez ObserverController Objects";
rpr2::IObserverGuezObserverControllerObjClass &observerControllerObjClass = m_somPlayer->getObserverGuezObserverControllerObjClass(*m_observerControllerCallback);
observerControllerObjClass.unsubscribe();
INFO_LOG(m_logger) << "Unsubscribe at NGS - Guez GroundVehicle Objects";
INFO_LOG() << "Unsubscribe at NGS - Guez GroundVehicle Objects";
rpr2::IObserverGuezGroundVehicleObjClass &groundVehicleObjClass = m_somPlayer->getObserverGuezGroundVehicleObjClass(*m_groundVehicleCallback);
groundVehicleObjClass.unsubscribe();
INFO_LOG(m_logger) << "Unsubscribe at NGS - Guez MineField Objects";
INFO_LOG() << "Unsubscribe at NGS - Guez MineField Objects";
rpr2::IObserverGuezMineFieldObjClass &minefieldObjClass = m_somPlayer->getObserverGuezMineFieldObjClass(*m_minefieldCallback);
minefieldObjClass.unsubscribe();
INFO_LOG(m_logger) << "Unsubscribe at NGS - Guez MineField Breach Objects";
INFO_LOG() << "Unsubscribe at NGS - Guez MineField Breach Objects";
rpr2::IObserverGuezMineFieldBreachObjClass &minefieldBreachObjClass = m_somPlayer->getObserverGuezMineFieldBreachObjClass(*m_minefieldBreachCallback);
minefieldBreachObjClass.unsubscribe();
}
@@ -1098,11 +1097,11 @@ void NgsConnector::go()
}
catch (const NGSException &ex)
{
ERROR_LOG(m_logger) << "NGS Exception caught in Event Loop" << ex.print();
ERROR_LOG() << "NGS Exception caught in Event Loop" << ex.print();
}
catch (const std::exception &e)
{
ERROR_LOG(m_logger) << "Standard Exception caught in Event Loop: " << e.what();
ERROR_LOG() << "Standard Exception caught in Event Loop: " << e.what();
}
catch (...)
{
@@ -329,9 +329,7 @@ protected:
bool m_bInitialized;
bool m_bCanPublishData;
QTimer *m_timer;
NGL::INGLLogger &m_logger;
QTimer *m_timer;
static quint16 s_ownSiteId;
static quint16 s_ownApplicationId;
@@ -15,7 +15,6 @@ namespace HighLevelArchitecture
NgsHandler::NgsHandler(QObject *parent)
: QObject(parent)
, m_ddsHandler(nullptr)
, m_logger(getLogger("NgsHandler"))
{}
NgsHandler::~NgsHandler()
@@ -38,7 +37,7 @@ bool NgsHandler::init(const std::shared_ptr<DdsHandler> &ddsHandler)
ngs::IObserver::ProtocolType protocol = Settings::hlaProtocol();
INFO_LOG(m_logger) << "Protocol = " << protToStr.value(protocol, QStringLiteral("UNKNOWN"));
INFO_LOG() << "Protocol = " << protToStr.value(protocol, QStringLiteral("UNKNOWN"));
m_ngsConnector =
@@ -60,9 +59,9 @@ void NgsHandler::onFirstTickFinished()
m_ppmHandler = std::make_shared<PpmHandler>(this);
m_aesHandler = std::make_shared<AesHandler>(this);
if (!m_ppmHandler->init())
ERROR_LOG(m_logger) << "Could not init ppm handler - not able to publish participants to HLA";
ERROR_LOG() << "Could not init ppm handler - not able to publish participants to HLA";
if (!m_aesHandler->init())
ERROR_LOG(m_logger) << "Could not init ppm handler - not able to publish area effect simulations to HLA";
ERROR_LOG() << "Could not init ppm handler - not able to publish area effect simulations to HLA";
emit firstTickFinished();
@@ -46,6 +46,5 @@ private:
std::shared_ptr<PpmHandler> m_ppmHandler;
std::shared_ptr<AesHandler> m_aesHandler;
std::shared_ptr<NgsConnector> m_ngsConnector;
LOGGER_T m_logger;
};
}
@@ -16,7 +16,6 @@ namespace HighLevelArchitecture
PpmHandler::PpmHandler(NgsHandler *ngsHandler)
: m_ngsHandler(ngsHandler)
, m_requestHelper(new LtsUtils::RequestHelper(this))
, m_logger(getLogger("PpmHandler"))
{}
PpmHandler::~PpmHandler()
@@ -82,7 +81,7 @@ bool PpmHandler::init()
m_dtsTab->enableEquipmentBite())
)
{
ERROR_LOG(m_logger) << "Enabling TAB DTS Data-Topics failed.";
ERROR_LOG() << "Enabling TAB DTS Data-Topics failed.";
return false;
}
@@ -177,7 +176,7 @@ void PpmHandler::onDynamicParticipantDataChanged(const ParticipantManagement::Dy
int equipmentNo = getEquipmentNo(data.participantId());
if (equipmentNo == 0)
{
ERROR_LOG(m_logger) << "Could not find EquipmentNo for Participant " << data.participantId() << ". Cannot send Dynamic Participant Data Modification to HLA.";
ERROR_LOG() << "Could not find EquipmentNo for Participant " << data.participantId() << ". Cannot send Dynamic Participant Data Modification to HLA.";
return;
}
@@ -256,7 +255,7 @@ void PpmHandler::onDynamicParticipantDataChanged(const ParticipantManagement::Dy
void PpmHandler::onParticipantChanged(const ParticipantManagement::Participant &data, DataModification modType)
{
DEBUG_LOG(m_logger) << "onParticipantChanged: " << data;
DEBUG_LOG() << "onParticipantChanged: " << data;
switch (modType)
{
case DataModification::eAdded:
@@ -338,7 +337,7 @@ void PpmHandler::onParticipantChanged(const ParticipantManagement::Participant &
void PpmHandler::onParticipantPositionChanged(const ParticipantManagement::ParticipantPosition &data, DataModification modType)
{
DEBUG_LOG(m_logger) << "onParticipantPositionChanged: " << data;
DEBUG_LOG() << "onParticipantPositionChanged: " << data;
switch (modType)
{
case DataModification::eAdded:
@@ -447,7 +446,7 @@ void PpmHandler::onEquipmentBiteChanged(const TrainingAreaBase::EquipmentBite &d
void PpmHandler::startPublishToNgs()
{
INFO_LOG(m_logger) << "Recreating all players from scratch due to structure / exercise change";
INFO_LOG() << "Recreating all players from scratch due to structure / exercise change";
m_createdParticipantIds.clear();
@@ -456,7 +455,7 @@ void PpmHandler::startPublishToNgs()
INFO_LOG(m_logger) << "(Re)Adding all players, size: " << m_partData.size();
INFO_LOG() << "(Re)Adding all players, size: " << m_partData.size();
for (const ParticipantManagement::Participant &participant : std::as_const(m_partData))
createParticipant(participant);
@@ -480,7 +479,7 @@ void PpmHandler::createParticipant(const ParticipantManagement::Participant &par
if (!m_ngsHandler->ngsConnector()->canPublishData())
{
WARNING_LOG(m_logger) << "Can not publish data ... :(";
WARNING_LOG() << "Can not publish data ... :(";
return;
}
@@ -1003,7 +1002,7 @@ bool PpmHandler::onExconInit(int eqNo, rpr2::ResetPlayerEnum8::ET rp, rpr2::Acti
bool PpmHandler::onBiteReport(const TrainingAreaBase::EquipmentBite &report)
{
DEBUG_LOG(m_logger) << "Attempting to Forward Bite Report to DDS. dtsTab: " << m_dtsTab << ", report for EqId: " << report.equipmentNumber();
DEBUG_LOG() << "Attempting to Forward Bite Report to DDS. dtsTab: " << m_dtsTab << ", report for EqId: " << report.equipmentNumber();
if (!m_dtsTab)
return false;
return m_dtsTab->publish(report);
@@ -131,9 +131,6 @@ private:
LtsUtils::RequestHelper *m_requestHelper;
QMap<int, ProjectDataManagement::ChargeType> m_chargeTypes;
NGL::INGLLogger &m_logger;
};
}
@@ -17,6 +17,6 @@ void ObserverGuezBiteReportCBNotifier::newGuezBiteReportIntInstance(const rpr2::
void ObserverGuezBiteReportCBNotifier::deleteInterface()
{
DEBUG_LOG(m_logger) << "Delete Interface";
DEBUG_LOG() << "Delete Interface";
}
@@ -23,8 +23,6 @@ public:
void deleteInterface() override;
protected:
NGL::INGLLogger &m_logger;
signals:
void newGuezBiteReport(const rpr2::IObserverGuezBiteReportIntInstance &action);
};
@@ -17,6 +17,6 @@ void ObserverGuezExconEngagementCBNotifier::newGuezExconEngagementIntInstance(co
void ObserverGuezExconEngagementCBNotifier::deleteInterface()
{
DEBUG_LOG(m_logger) << "Delete Interface";
DEBUG_LOG() << "Delete Interface";
}
@@ -23,8 +23,6 @@ public:
void deleteInterface() override;
protected:
NGL::INGLLogger &m_logger;
signals:
void newGuezExconEngagement(const rpr2::IObserverGuezExconEngagementIntInstance &action);
};
@@ -18,6 +18,6 @@ void ObserverGuezHitCBNotifier::newGuezHitIntInstance(const rpr2::IObserverGuezH
void ObserverGuezHitCBNotifier::deleteInterface()
{
DEBUG_LOG(m_logger) << "Delete Interface";
DEBUG_LOG() << "Delete Interface";
}
@@ -23,8 +23,6 @@ public:
void deleteInterface() override;
protected:
NGL::INGLLogger &m_logger;
signals:
void newGuezHit(const rpr2::IObserverGuezHitIntInstance &interaction);
};
@@ -17,6 +17,6 @@ void ObserverGuezInitCBNotifier::newGuezInitIntInstance(const rpr2::IObserverGue
void ObserverGuezInitCBNotifier::deleteInterface()
{
DEBUG_LOG(m_logger) << "Delete Interface";
DEBUG_LOG() << "Delete Interface";
}
@@ -23,8 +23,6 @@ public:
void deleteInterface() override;
protected:
NGL::INGLLogger &m_logger;
signals:
void newGuezInit(const rpr2::IObserverGuezInitIntInstance &action);
};
@@ -17,6 +17,6 @@ void ObserverGuezRequestBiteReportCBNotifier::newGuezRequestBiteReportIntInstanc
void ObserverGuezRequestBiteReportCBNotifier::deleteInterface()
{
DEBUG_LOG(m_logger) << "Delete Interface";
DEBUG_LOG() << "Delete Interface";
}
@@ -23,8 +23,6 @@ public:
void deleteInterface() override;
protected:
NGL::INGLLogger &m_logger;
signals:
void newGuezRequestBiteReport(const rpr2::IObserverGuezRequestBiteReportIntInstance &action);
};
@@ -17,6 +17,6 @@ void ObserverMunitionDetonationCBNotifier::newMunitionDetonationIntInstance(cons
void ObserverMunitionDetonationCBNotifier::deleteInterface()
{
DEBUG_LOG(m_logger) << "Delete Interface";
DEBUG_LOG() << "Delete Interface";
}
@@ -24,8 +24,6 @@ public:
void deleteInterface() override;
protected:
NGL::INGLLogger &m_logger;
signals:
void newMunitionDetonation(const rpr2::IObserverMunitionDetonationIntInstance &interaction);
};
@@ -23,6 +23,6 @@ void ObserverWeaponFireCBNotifier::newWeaponFireIntInstance(const rpr2::IObserve
void ObserverWeaponFireCBNotifier::deleteInterface()
{
DEBUG_LOG(m_logger) << "Delete Interface";
DEBUG_LOG() << "Delete Interface";
}
@@ -25,8 +25,6 @@ public:
void deleteInterface() override;
protected:
NGL::INGLLogger &m_logger;
signals:
void newWeaponFire(const rpr2::IObserverWeaponFireIntInstance &interaction);
};
@@ -39,5 +39,4 @@ Q_SIGNALS:
void objectInstanceDeleted(const ngs::IObserverObjectInstance &object);
protected:
NGL::INGLLogger &m_logger;
};
@@ -25,7 +25,7 @@ public:
void deleteObjectInstance() override
{
DEBUG_LOG(m_logger) << "deleteObjectInstance";
DEBUG_LOG() << "deleteObjectInstance";
if (m_pCB && m_pIObject)
m_pCB->deleteObjectInstance(*m_pIObject);
delete this;
@@ -43,5 +43,4 @@ public:
protected:
OBJ *m_pIObject;
OBJ_CB *m_pCB;
NGL::INGLLogger &m_logger;
};
@@ -20,7 +20,6 @@ WebSocketHandler::WebSocketHandler(int exerciseId, MainHandler *mainHandler, QOb
, m_webSocketServer(new QWebSocketServer(QStringLiteral("WLS"), QWebSocketServer::NonSecureMode, this))
, m_mainHandler(mainHandler)
, m_exerciseId(exerciseId)
, m_logger(getLogger("WebSocketHandler"))
{}
WebSocketHandler::~WebSocketHandler()
@@ -33,7 +32,7 @@ bool WebSocketHandler::init(quint16 listenPort)
{
if (!m_webSocketServer->listen(QHostAddress::Any, listenPort))
{
WARNING_LOG(m_logger) << "Can not listen on port " << listenPort << " - aborting";
WARNING_LOG() << "Can not listen on port " << listenPort << " - aborting";
return false;
}
connect(m_webSocketServer, &QWebSocketServer::newConnection,
@@ -52,7 +51,7 @@ bool WebSocketHandler::sendTelegramInternal(const TrainingAreaBase::TetraIcd::Tr
const QString jsonStr = QString::fromUtf8(QJsonDocument(obj).toJson(QJsonDocument::Compact));
DEBUG_LOG(m_logger) << "jsonStr: " << jsonStr;
DEBUG_LOG() << "jsonStr: " << jsonStr;
bool bOk = false;
for (const auto &wsw : std::as_const(m_webSockets))
@@ -69,12 +68,12 @@ void WebSocketHandler::sendHlaConnectionState()
TrainingAreaBase::TetraIcd::ProxyConnectionState connState;
connState.connectedToSystem = m_mainHandler->isConnectedToHla();
sendTelegram(&connState, m_exerciseId);
DEBUG_LOG(m_logger) << "sendHlaConnectionState, isConnected: " << connState.connectedToSystem;
DEBUG_LOG() << "sendHlaConnectionState, isConnected: " << connState.connectedToSystem;
}
void WebSocketHandler::sendParticipantConnectionStates()
{
DEBUG_LOG(m_logger) << "sendParticipantConnectionStates";
DEBUG_LOG() << "sendParticipantConnectionStates";
TrainingAreaBase::TetraIcd::WlsParticipantsConnectionState partConnState;
partConnState.equipmentNumber = -1;
partConnState.dataCommunicationPossible = false;
@@ -82,7 +81,7 @@ void WebSocketHandler::sendParticipantConnectionStates()
if (!m_mainHandler->isConnectedToHla())
{
INFO_LOG(m_logger) << "We are (not) yet connected to HLA - don't send participant connection states";
INFO_LOG() << "We are (not) yet connected to HLA - don't send participant connection states";
return;
}
const auto externalEquipmentNumbers = m_mainHandler->ngsHandler()->ppmHandler()->externalEquipmentNumbers();
@@ -118,7 +117,7 @@ void WebSocketHandler::onNewConnection()
QWebSocket *ws = m_webSocketServer->nextPendingConnection();
if (!ws)
return;
DEBUG_LOG(m_logger) << "New websocket connection from " << ws->peerAddress().toString() << ":" << ws->peerPort();
DEBUG_LOG() << "New websocket connection from " << ws->peerAddress().toString() << ":" << ws->peerPort();
auto wsw = std::make_shared<WebSocketWrapper>(ws);
connect(wsw.get(), &WebSocketWrapper::textMessageReceived,
@@ -133,11 +132,11 @@ void WebSocketHandler::onTextMessageReceived(const QByteArray &baJson)
{
using namespace TrainingAreaBase::TetraIcd;
TRACE_LOG(m_logger) << "WebSocketHandler::onTextMessageReceived: " << baJson;
TRACE_LOG() << "WebSocketHandler::onTextMessageReceived: " << baJson;
WebSocketWrapper *wsw = qobject_cast<WebSocketWrapper *>(sender());
if (!wsw)
{
ERROR_LOG(m_logger) << "Internal error - sender is no WebSocketWrapper";
ERROR_LOG() << "Internal error - sender is no WebSocketWrapper";
return;
}
@@ -157,7 +156,7 @@ void WebSocketHandler::onTextMessageReceived(const QByteArray &baJson)
const QJsonValue typeId = obj.value(QStringLiteral("typeId"));
if (!typeId.isDouble())
{
ERROR_LOG(m_logger) << "Can not read type id: " << baJson;
ERROR_LOG() << "Can not read type id: " << baJson;
return;
}
const QJsonObject data = obj.value(QStringLiteral("data")).toObject();
@@ -186,14 +185,14 @@ void WebSocketHandler::onTextMessageReceived(const QByteArray &baJson)
emit vulnerabilityStateRequest(DemandVulnerabilityStateChange::fromJson(data));
break;
default:
WARNING_LOG(m_logger) << "Handler for telegram Id " << typeId.toInt()
WARNING_LOG() << "Handler for telegram Id " << typeId.toInt()
<< " not yet implemented (" << baJson << ")";
return;
}
}
catch (const std::exception &e)
{
WARNING_LOG(m_logger) << "Could not parse json: " << e.what() << " (" << baJson << ")";
WARNING_LOG() << "Could not parse json: " << e.what() << " (" << baJson << ")";
return;
}
}
@@ -65,8 +65,6 @@ private:
QVector<std::shared_ptr<WebSocketWrapper>> m_webSockets;
MainHandler *m_mainHandler;
int m_exerciseId;
LOGGER_T m_logger;
};
class WebSocketWrapper : public QObject