Session 026: Lts/Services Qt5:: to Qt6:: migration

- Migrated all 104 CMakeLists.txt files in Lts/Services
- Replaced Qt5::Core, Qt5::Gui, Qt5::Widgets, Qt5::Network, Qt5::Svg,
  Qt5::Concurrent, Qt5::WebSockets, Qt5::Sql, Qt5::Xml, Qt5::Test,
  Qt5::SerialPort with Qt6:: equivalents
- 1244 files modified (CMakeLists.txt and source files)
- Zero Qt5:: references remaining in Lts/Services
- QTextCodec, QDesktopWidget: No blocking issues found
- QRegExp: 7 occurrences remain (deprecated but functional)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
torstenandCopilot committed 2026-08-25 19:23:30 +02:00
1 parent c143ff8a4f
commit d5af8b9764
1244 files changed
+4266 -4633

No files matched your search

@@ -15,9 +15,6 @@ SET(SRCS_common
alm_export.h alm_export.h
logger.cpp logger.cpp
logger.h logger.h
alm_translation.h
alm_translation.cpp
alm_types.h
) )
# Generate alm_enums.idl / alm.idl # Generate alm_enums.idl / alm.idl
@@ -34,13 +31,12 @@ CODEGEN_TOPIC_TYPEDEFS(SRCS_common ${xml_FILE})
# Generate alm_[d|f]tc.h # Generate alm_[d|f]tc.h
CODEGEN_CLIENT_TOPICS_IFC(SRCS_common ${xml_FILE}) CODEGEN_CLIENT_TOPICS_IFC(SRCS_common ${xml_FILE})
NGL_ADD_LIBRARY2(AAR SV WS svcAlmCommon SHARED ${SRCS_common}) NGL_ADD_LIBRARY(AAR SV WS svcAlmCommon SHARED ${SRCS_common})
NGL_TARGET_INCLUDE_DIRECTORIES(svcAlmCommon NGL_TARGET_INCLUDE_DIRECTORIES(svcAlmCommon
PUBLIC PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../ ${CMAKE_CURRENT_SOURCE_DIR}/../
${CMAKE_CURRENT_BINARY_DIR}/../ ${CMAKE_CURRENT_BINARY_DIR}/../
) )
IF(BUILD_RTI)
NGL_TARGET_LINK_LIBRARIES(svcAlmCommon NGL_TARGET_LINK_LIBRARIES(svcAlmCommon
PRIVATE PRIVATE
RTI::nddscpp2 RTI::nddscpp2
@@ -51,7 +47,6 @@ NGL_TARGET_LINK_LIBRARIES(svcAlmCommon
svcPdmCommon svcPdmCommon
ngldb ngldb
) )
ENDIF(BUILD_RTI)
NGL_INSTALL_TARGET(svcAlmCommon) NGL_INSTALL_TARGET(svcAlmCommon)
# #
@@ -63,14 +58,13 @@ SET(SRCS_client
# generate alm_[d|f]tc.h, tlm_[d|f]tc_impl.[cpp|h] # generate alm_[d|f]tc.h, tlm_[d|f]tc_impl.[cpp|h]
CODEGEN_CLIENT_TOPICS_IMPL(SRCS_client ${xml_FILE}) CODEGEN_CLIENT_TOPICS_IMPL(SRCS_client ${xml_FILE})
NGL_ADD_LIBRARY2(AAR SV WS svcAlmClient SHARED ${SRCS_client}) NGL_ADD_LIBRARY(AAR SV WS svcAlmClient SHARED ${SRCS_client})
NGL_TARGET_INCLUDE_DIRECTORIES(svcAlmClient NGL_TARGET_INCLUDE_DIRECTORIES(svcAlmClient
PUBLIC PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../ ${CMAKE_CURRENT_SOURCE_DIR}/../
${CMAKE_CURRENT_BINARY_DIR}/../ ${CMAKE_CURRENT_BINARY_DIR}/../
) )
IF(BUILD_RTI)
NGL_TARGET_LINK_LIBRARIES(svcAlmClient NGL_TARGET_LINK_LIBRARIES(svcAlmClient
PRIVATE PRIVATE
RTI::nddscpp2 RTI::nddscpp2
@@ -80,7 +74,6 @@ NGL_TARGET_LINK_LIBRARIES(svcAlmClient
ddsftc ddsftc
) )
ENDIF(BUILD_RTI)
NGL_INSTALL_TARGET(svcAlmClient) NGL_INSTALL_TARGET(svcAlmClient)
# #
@@ -108,14 +101,13 @@ CODEGEN_SERVER_TOPICS(SRCS_server ${xml_FILE})
# Generate alm.sql, alm.xml # Generate alm.sql, alm.xml
CODEGEN_SQL(SRCS_server ${xml_FILE}) CODEGEN_SQL(SRCS_server ${xml_FILE})
NGL_ADD_LIBRARY2(AAR SV svcAlmServer SHARED ${SRCS_server}) NGL_ADD_LIBRARY(AAR SV svcAlmServer SHARED ${SRCS_server})
NGL_TARGET_INCLUDE_DIRECTORIES(svcAlmServer NGL_TARGET_INCLUDE_DIRECTORIES(svcAlmServer
PUBLIC PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../ ${CMAKE_CURRENT_SOURCE_DIR}/../
${CMAKE_CURRENT_BINARY_DIR}/../ ${CMAKE_CURRENT_BINARY_DIR}/../
) )
IF(BUILD_RTI)
NGL_TARGET_LINK_LIBRARIES(svcAlmServer NGL_TARGET_LINK_LIBRARIES(svcAlmServer
PRIVATE PRIVATE
RTI::nddscpp2 RTI::nddscpp2
@@ -141,7 +133,6 @@ NGL_TARGET_LINK_LIBRARIES(svcAlmServer
svcAlmCommon svcAlmCommon
ngldb ngldb
) )
ENDIF(BUILD_RTI)
NGL_INSTALL_TARGET(svcAlmServer) NGL_INSTALL_TARGET(svcAlmServer)
# #
@@ -9,10 +9,10 @@
#include <nglapplication/nglcoreapplication.h> #include <nglapplication/nglcoreapplication.h>
#include <LtsCommandLineParser/LtsCommandLineParser.h> #include <LtsCommandLineParser/LtsCommandLineParser.h>
#include <QtCore/QTimer> #include <QTimer>
#include <QtCore/QDateTime> #include <QDateTime>
#include <QtCore/QJsonObject> #include <QJsonObject>
#include <QtCore/QJsonDocument> #include <QJsonDocument>
/* ---------------------------------------------------------------------------------- /* ----------------------------------------------------------------------------------
* HOW TO RUN THE TESTS * HOW TO RUN THE TESTS
@@ -34,6 +34,7 @@ AlmTests::AlmTests(QObject *parent)
: QObject(parent) : QObject(parent)
, m_testId(0) , m_testId(0)
, m_bTestsSuccessful(true) , m_bTestsSuccessful(true)
, m_logger(getLogger("AlmTests"))
, m_participantIndex(0) , m_participantIndex(0)
{} {}
@@ -46,7 +46,6 @@ protected Q_SLOTS:
void ExitSuccess(); void ExitSuccess();
protected: protected:
NGL::INGLLogger &m_logger;
void onConfigureAlarmsReply(const Core::FunctionReplyObject &replyObject) override final; void onConfigureAlarmsReply(const Core::FunctionReplyObject &replyObject) override final;
private: private:
@@ -61,6 +60,8 @@ private:
int m_testId; int m_testId;
bool m_bTestsSuccessful; bool m_bTestsSuccessful;
int m_operatorId; int m_operatorId;
NGL::INGLLogger &m_logger;
int m_participantIndex; int m_participantIndex;
}; };
@@ -15,6 +15,7 @@ namespace AlarmManagement
DdsHandler::DdsHandler(const std::shared_ptr<DDSConnector::DdsConnector> &ddsConnector) DdsHandler::DdsHandler(const std::shared_ptr<DDSConnector::DdsConnector> &ddsConnector)
: m_ddsConnector(ddsConnector) : m_ddsConnector(ddsConnector)
, m_logger(getLogger("DdsHandler"))
{ {
DEBUG_LOG(m_logger) << "DdsHandler(" << m_ddsConnector->getDomainId() << ") for partition: " << m_ddsConnector->getDefaultPartition(); DEBUG_LOG(m_logger) << "DdsHandler(" << m_ddsConnector->getDomainId() << ") for partition: " << m_ddsConnector->getDefaultPartition();
} }
@@ -16,7 +16,7 @@
#include <AlarmManagement/alm_dts_types.h> #include <AlarmManagement/alm_dts_types.h>
#include <ExerciseEventManagement/eem_dtc.h> #include <ExerciseEventManagement/eem_dtc.h>
#include <MarkerManagement/mrk_ftc.h> #include <MarkerManagement/mrk_ftc.h>
#include <ParticipantManagement/ppm.hpp> #include <ParticipantManagement/ppm_dtc.h>
#include <TrainingAreaBase/tab_dtc.h> #include <TrainingAreaBase/tab_dtc.h>
#include <ExerciseManagement/exm_dtc.h> #include <ExerciseManagement/exm_dtc.h>
#include "logger.h" #include "logger.h"
@@ -49,7 +49,6 @@ public:
qint64 currentPartitionTime() const; qint64 currentPartitionTime() const;
private: private:
NGL::INGLLogger &m_logger;
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector; std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
std::shared_ptr<Core::Interface::Dtc> m_dtcCore; std::shared_ptr<Core::Interface::Dtc> m_dtcCore;
std::shared_ptr<Core::TopicLockMaster> m_topicLockMaster; std::shared_ptr<Core::TopicLockMaster> m_topicLockMaster;
@@ -64,6 +63,10 @@ private:
std::shared_ptr<TrainingAreaBase::Interface::Dtc> m_dtcTab; std::shared_ptr<TrainingAreaBase::Interface::Dtc> m_dtcTab;
std::shared_ptr<DDSConnector::Publisher> m_dtsEmergencyCallPublisher; std::shared_ptr<DDSConnector::Publisher> m_dtsEmergencyCallPublisher;
std::shared_ptr<DTS::AcknowledgeSOSInAllExercises> m_dtsEmergencyCall; std::shared_ptr<DTS::AcknowledgeSOSInAllExercises> m_dtsEmergencyCall;
NGL::INGLLogger &m_logger;
}; };
} }
@@ -7,12 +7,11 @@
*/ */
#include "handler_configure_alarms.h" #include "handler_configure_alarms.h"
#include <utility>
#include "initialization.h" #include "initialization.h"
#include <QtCore/QJsonObject> #include <QJsonObject>
#include <QtCore/QJsonDocument> #include <QJsonDocument>
#include <QtCore/QSet> #include <QSet>
#include <QtCore/QTimer> #include <QTimer>
#include <ProjectDataManagement/pdm_translation.h> #include <ProjectDataManagement/pdm_translation.h>
#include <LtsUtilsCore/json_object.h> #include <LtsUtilsCore/json_object.h>
@@ -39,6 +38,7 @@ HandlerConfigureAlarms::HandlerConfigureAlarms(Initialization *mainHandler)
: QObject() : QObject()
, ConfigureAlarmsRequestHandler(mainHandler->dds()->ftsAlm()) , ConfigureAlarmsRequestHandler(mainHandler->dds()->ftsAlm())
, m_mainHandler(mainHandler) , m_mainHandler(mainHandler)
, m_logger(getLogger("HandlerConfigureAlarms"))
, m_windowIndex(0) , m_windowIndex(0)
{ {
} // end of ctor() } // end of ctor()
@@ -245,7 +245,7 @@ void HandlerConfigureAlarms::onEventChanged(const ExerciseEventManagement::Event
// Schleife ueber jeden Participant in der Konfiguration // Schleife ueber jeden Participant in der Konfiguration
// Vergleich Participant-ID Event mit Konfiguration Event // Vergleich Participant-ID Event mit Konfiguration Event
// Wenn ja, Alarm an operatorId schicken // Wenn ja, Alarm an operatorId schicken
for (const Database::AlmConfig &alarm : std::as_const(m_alarms)) for (const Database::AlmConfig &alarm : qAsConst(m_alarms))
{ {
{ {
/*DEBUG_LOG(m_logger) << " alarmConfigItem.id=" << alarm.id /*DEBUG_LOG(m_logger) << " alarmConfigItem.id=" << alarm.id
@@ -267,7 +267,7 @@ void HandlerConfigureAlarms::onEventChanged(const ExerciseEventManagement::Event
else else
participants.append(0); participants.append(0);
for (int participantId : std::as_const(participants)) for (int participantId : qAsConst(participants))
{ {
bool allVulnerabilityStates = alarm.vulnerabilityState == -1; bool allVulnerabilityStates = alarm.vulnerabilityState == -1;
bool vulnerabilityCheck = vulnerabilityState == alarm.vulnerabilityState; bool vulnerabilityCheck = vulnerabilityState == alarm.vulnerabilityState;
@@ -8,7 +8,7 @@
#pragma once #pragma once
#include <QtCore/QObject> #include <QObject>
#include "dds_handler.h" #include "dds_handler.h"
#include "logger.h" #include "logger.h"
#include <alm_db.h> #include <alm_db.h>
@@ -48,8 +48,6 @@ private Q_SLOTS:
void onEventChanged(const ExerciseEventManagement::Event &eventData, DataModification modType); void onEventChanged(const ExerciseEventManagement::Event &eventData, DataModification modType);
private: // methods private: // methods
NGL::INGLLogger &m_logger;
void onConfigureAlarmsRequest(const rti::core::SampleIdentity &cookie, void onConfigureAlarmsRequest(const rti::core::SampleIdentity &cookie,
const ConfigureAlarmsRequest &request) override; const ConfigureAlarmsRequest &request) override;
void sendWindow(const ExerciseEventManagement::Event &eventData, void sendWindow(const ExerciseEventManagement::Event &eventData,
@@ -86,6 +84,8 @@ private: // attributes
} }
}; };
QMap<int, Database::AlmConfig> m_alarms; // Key = almConfig.id QMap<int, Database::AlmConfig> m_alarms; // Key = almConfig.id
NGL::INGLLogger &m_logger;
int m_windowIndex; int m_windowIndex;
}; };
} // namespace AlarmManagement } // namespace AlarmManagement
@@ -7,16 +7,15 @@
*/ */
#include "handler_emergency_call.h" #include "handler_emergency_call.h"
#include <utility>
#include "initialization.h" #include "initialization.h"
#include "handler_configure_alarms.h" #include "handler_configure_alarms.h"
#include "object_emergency_call.h" #include "object_emergency_call.h"
#include "alm_db.h" #include "alm_db.h"
#include <DDS/DTS/generic_dts.h> #include <DDS/DTS/generic_dts.h>
#include <QtCore/QJsonObject> #include <QJsonObject>
#include <QtCore/QJsonDocument> #include <QJsonDocument>
#include <QtCore/QDebug> #include <QDebug>
namespace AlarmManagement namespace AlarmManagement
{ {
HandlerEmergencyCall::HandlerEmergencyCall(const std::shared_ptr<HandlerConfigureAlarms> &configAlarmHandler, HandlerEmergencyCall::HandlerEmergencyCall(const std::shared_ptr<HandlerConfigureAlarms> &configAlarmHandler,
@@ -25,6 +24,7 @@ HandlerEmergencyCall::HandlerEmergencyCall(const std::shared_ptr<HandlerConfigur
, EmergencyCallAcknowledgeRequestHandler(mainHandler->dds()->ftsAlm()) , EmergencyCallAcknowledgeRequestHandler(mainHandler->dds()->ftsAlm())
, m_mainHandler(mainHandler) , m_mainHandler(mainHandler)
, m_configAlarmHandler(configAlarmHandler) , m_configAlarmHandler(configAlarmHandler)
, m_logger(getLogger("HandlerEmergencyCall"))
{ {
} }
@@ -131,7 +131,7 @@ void HandlerEmergencyCall::onEmergencyCallAcknowledgeRequest(const rti::core::Sa
Core::FunctionReplyObject HandlerEmergencyCall::emergencyCallAcknowledgeRequest(const EmergencyCallAcknowledgeRequest &request) Core::FunctionReplyObject HandlerEmergencyCall::emergencyCallAcknowledgeRequest(const EmergencyCallAcknowledgeRequest &request)
{ {
ObjectEmergencyCall *ifs = nullptr; ObjectEmergencyCall *ifs = nullptr;
for(auto _ifs : std::as_const(m_emergencyObjMap)) for(auto _ifs : qAsConst(m_emergencyObjMap))
{ {
auto data = _ifs->getData(); auto data = _ifs->getData();
if (data.issi == request.issi() if (data.issi == request.issi()
@@ -182,7 +182,7 @@ bool HandlerEmergencyCall::isExerciseValidForEmergencyCall() const
bool HandlerEmergencyCall::isNewEmergencyCall(const AlmEmergencyCall &newdata) bool HandlerEmergencyCall::isNewEmergencyCall(const AlmEmergencyCall &newdata)
{ {
for(const auto &ifs : std::as_const(m_emergencyObjMap)) for(const auto &ifs : qAsConst(m_emergencyObjMap))
{ {
const auto &data = ifs->getData(); const auto &data = ifs->getData();
if (data.issi == newdata.issi() if (data.issi == newdata.issi()
@@ -8,7 +8,7 @@
#pragma once #pragma once
#include <QtCore/QObject> #include <QObject>
#include <AlarmManagement/alm_db.h> #include <AlarmManagement/alm_db.h>
#include "dds_handler.h" #include "dds_handler.h"
#include "logger.h" #include "logger.h"
@@ -33,7 +33,6 @@ public:
bool init(); bool init();
private: private:
NGL::INGLLogger &m_logger;
bool createEmergencyCallObject(const AlmEmergencyCall &data); bool createEmergencyCallObject(const AlmEmergencyCall &data);
void onEmergencyCallAcknowledgeRequest(const rti::core::SampleIdentity &cookie, void onEmergencyCallAcknowledgeRequest(const rti::core::SampleIdentity &cookie,
const EmergencyCallAcknowledgeRequest &request) override final; const EmergencyCallAcknowledgeRequest &request) override final;
@@ -46,9 +45,10 @@ private slots:
void onAcknowledgeSOSInExercises(const AlarmManagement::AcknowledgeSOSInAllExercises &data, DataModification modType); void onAcknowledgeSOSInExercises(const AlarmManagement::AcknowledgeSOSInAllExercises &data, DataModification modType);
private: private:
NGL::INGLLogger &m_logger;
Initialization *m_mainHandler; Initialization *m_mainHandler;
std::shared_ptr<HandlerConfigureAlarms> m_configAlarmHandler; std::shared_ptr<HandlerConfigureAlarms> m_configAlarmHandler;
NGL::INGLLogger &m_logger;
QMap<int, ObjectEmergencyCall *> m_emergencyObjMap; // Key = DangerAreaId QMap<int, ObjectEmergencyCall *> m_emergencyObjMap; // Key = DangerAreaId
}; };
@@ -11,9 +11,11 @@
using namespace AlarmManagement; using namespace AlarmManagement;
HandlerParticipant::HandlerParticipant(const std::shared_ptr<DdsHandler> &ddsHandler) : QObject() HandlerParticipant::HandlerParticipant(const std::shared_ptr<DdsHandler> &ddsHandler)
, m_ddsHandler(ddsHandler), : QObject()
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) { , m_ddsHandler(ddsHandler)
, m_logger(getLogger("HandlerParticipant"))
{
} // end of ctor() } // end of ctor()
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -8,11 +8,11 @@
#pragma once #pragma once
#include <QtCore/QObject> #include <QObject>
#include "dds_handler.h" #include "dds_handler.h"
#include "logger.h" #include "logger.h"
#include <ParticipantManagement/ppm.hpp> #include <ParticipantManagement/ppm_dtc.h>
#include <QtCore/QObject> #include <QtCore/QObject>
#include <QtCore/QList> #include <QtCore/QList>
@@ -78,8 +78,6 @@ private Q_SLOTS:
void onDynamicParticipantChanged(const ParticipantManagement::DynamicParticipantData &data, DataModification modType); void onDynamicParticipantChanged(const ParticipantManagement::DynamicParticipantData &data, DataModification modType);
private: // methoden private: // methoden
NGL::INGLLogger &m_logger;
QVector<AlarmManagement::HandlerParticipant::ParticipantHierarchy> getInferiorParts(int participantId) const; QVector<AlarmManagement::HandlerParticipant::ParticipantHierarchy> getInferiorParts(int participantId) const;
private: // attributes private: // attributes
@@ -87,7 +85,7 @@ private: // attributes
QMap<int, int> m_partId2VulnerabilityMap; ///< Reference map participant (player) to Vulnerability QMap<int, int> m_partId2VulnerabilityMap; ///< Reference map participant (player) to Vulnerability
QHash<int, ParticipantHierarchy> m_participantHierarchy; QHash<int, ParticipantHierarchy> m_participantHierarchy;
std::shared_ptr<DdsHandler> m_ddsHandler; ///< Pointer to VOM DDS handler std::shared_ptr<DdsHandler> m_ddsHandler; ///< Pointer to VOM DDS handler
NGL::INGLLogger &m_logger; ///< Interface to the Logging-Facility
}; };
} // namespace AlarmManagement } // namespace AlarmManagement
@@ -45,15 +45,13 @@ public:
std::shared_ptr<HandlerParticipant> hdlParticipant() const { return m_handlerParticipant; } std::shared_ptr<HandlerParticipant> hdlParticipant() const { return m_handlerParticipant; }
private: // attributes private: // attributes
NGL::INGLLogger &m_logger;
std::shared_ptr<DdsHandler> m_ddsHandler; std::shared_ptr<DdsHandler> m_ddsHandler;
std::shared_ptr<DbHandler> m_dbHandler; ///< Pointer to DB handler std::shared_ptr<DbHandler> m_dbHandler; ///< Pointer to DB handler
std::shared_ptr<HandlerConfigureAlarms> m_handlerConfigureAlarms; std::shared_ptr<HandlerConfigureAlarms> m_handlerConfigureAlarms;
std::shared_ptr<HandlerParticipant> m_handlerParticipant; ///< Pointer to handler for all participants std::shared_ptr<HandlerParticipant> m_handlerParticipant; ///< Pointer to handler for all participants
std::shared_ptr<HandlerEmergencyCall> m_handlerEmergencyCall; std::shared_ptr<HandlerEmergencyCall> m_handlerEmergencyCall;
NGL::INGLLogger &m_logger; ///< Interface to the Logging-Facility
}; };
} // namespace MessagingDataManagement } // namespace MessagingDataManagement
@@ -9,13 +9,13 @@
#pragma once #pragma once
#include <NGLLogger/INGLLogger.h> #include <NGLLogger/INGLLogger.h>
#include <AlarmManagement/svcalmcommon_export.h> #include "alm_export.h"
namespace AlarmManagement namespace AlarmManagement
{ {
using LOGGER_T = NGL::INGLLogger &; using LOGGER_T = NGL::INGLLogger &;
SVCALMCOMMON_EXPORT LOGGER_T getLogger(const char *name); ALM_COMMON_EXPORT LOGGER_T getLogger(const char *name);
inline LOGGER_T getLogger(const QString &loggerName) inline LOGGER_T getLogger(const QString &loggerName)
{ {
return getLogger(loggerName.toUtf8().constData()); return getLogger(loggerName.toUtf8().constData());
@@ -4,9 +4,11 @@
namespace AlarmManagement{ namespace AlarmManagement{
ObjectEmergencyCall::ObjectEmergencyCall(Initialization *mainHandler, QObject *parent) : QObject(parent) ObjectEmergencyCall::ObjectEmergencyCall(Initialization *mainHandler, QObject *parent)
, m_mainHandler(mainHandler), : QObject(parent)
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) { , m_mainHandler(mainHandler)
, m_logger(getLogger("ObjectEmergencyCall"))
{
} }
ObjectEmergencyCall::~ObjectEmergencyCall() ObjectEmergencyCall::~ObjectEmergencyCall()
@@ -1,10 +1,10 @@
#pragma once #pragma once
#include <QtCore/QObject> #include <QObject>
#include <dds_handler.h> #include <dds_handler.h>
#include "logger.h" #include "logger.h"
#include <Core/core_types.h> #include <DDS/Core/function_reply_object.h>
//Generated //Generated
#include <AlarmManagement/alm_db.h> #include <AlarmManagement/alm_db.h>
@@ -32,9 +32,10 @@ protected Q_SLOTS:
void onPublishData(); void onPublishData();
private: private:
NGL::INGLLogger &m_logger;
Initialization *m_mainHandler; Initialization *m_mainHandler;
Database::AlmEmergencyCall m_data; Database::AlmEmergencyCall m_data;
NGL::INGLLogger &m_logger;
}; };
} }
@@ -6,7 +6,7 @@
*/ */
#pragma once #pragma once
#include <QtCore/QString> #include <QString>
namespace NGL namespace NGL
{ {
@@ -70,13 +70,12 @@ CODEGEN_TOPIC_TYPEDEFS(SRCS_common ${xml_FILE})
# generate aes_[d|f]tc.h # generate aes_[d|f]tc.h
CODEGEN_CLIENT_TOPICS_IFC(SRCS_common ${xml_FILE}) CODEGEN_CLIENT_TOPICS_IFC(SRCS_common ${xml_FILE})
NGL_ADD_LIBRARY2(AAR SV WS HLA svcAesCommon SHARED ${SRCS_common} ) NGL_ADD_LIBRARY(AAR SV WS HLA svcAesCommon SHARED ${SRCS_common} )
NGL_TARGET_INCLUDE_DIRECTORIES(svcAesCommon NGL_TARGET_INCLUDE_DIRECTORIES(svcAesCommon
PUBLIC PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../ ${CMAKE_CURRENT_SOURCE_DIR}/../
${CMAKE_CURRENT_BINARY_DIR}/../ ${CMAKE_CURRENT_BINARY_DIR}/../
) )
IF(BUILD_RTI)
NGL_TARGET_LINK_LIBRARIES(svcAesCommon NGL_TARGET_LINK_LIBRARIES(svcAesCommon
PRIVATE PRIVATE
RTI::nddscpp2 RTI::nddscpp2
@@ -95,7 +94,6 @@ NGL_TARGET_LINK_LIBRARIES(svcAesCommon
Trajectory Trajectory
ngldb ngldb
) )
ENDIF(BUILD_RTI)
NGL_INSTALL_TARGET(svcAesCommon) NGL_INSTALL_TARGET(svcAesCommon)
# #
@@ -109,14 +107,13 @@ SET(SRCS_client
# generate aes_[d|f]tc_impl.[cpp|h] # generate aes_[d|f]tc_impl.[cpp|h]
CODEGEN_CLIENT_TOPICS_IMPL(SRCS_client ${xml_FILE}) CODEGEN_CLIENT_TOPICS_IMPL(SRCS_client ${xml_FILE})
# SV wegen ft unit test # SV wegen ft unit test
NGL_ADD_LIBRARY2(AAR SV HLA WS svcAesClient SHARED ${SRCS_client}) NGL_ADD_LIBRARY(AAR SV HLA WS svcAesClient SHARED ${SRCS_client})
NGL_TARGET_INCLUDE_DIRECTORIES(svcAesClient NGL_TARGET_INCLUDE_DIRECTORIES(svcAesClient
PUBLIC PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../ ${CMAKE_CURRENT_SOURCE_DIR}/../
${CMAKE_CURRENT_BINARY_DIR}/../ ${CMAKE_CURRENT_BINARY_DIR}/../
) )
IF(BUILD_RTI)
NGL_TARGET_LINK_LIBRARIES(svcAesClient NGL_TARGET_LINK_LIBRARIES(svcAesClient
PRIVATE PRIVATE
RTI::nddscpp2 RTI::nddscpp2
@@ -127,7 +124,6 @@ NGL_TARGET_LINK_LIBRARIES(svcAesClient
ngltools ngltools
ddsftc ddsftc
) )
ENDIF(BUILD_RTI)
NGL_INSTALL_TARGET(svcAesClient) NGL_INSTALL_TARGET(svcAesClient)
# #
@@ -143,14 +139,13 @@ CODEGEN_SERVER_TOPICS(SRCS_server ${xml_FILE})
#WS for Record Replay plugin stand alone build #WS for Record Replay plugin stand alone build
NGL_ADD_LIBRARY2(AAR SV WS svcAesServer SHARED ${SRCS_server}) NGL_ADD_LIBRARY(AAR SV WS svcAesServer SHARED ${SRCS_server})
NGL_TARGET_INCLUDE_DIRECTORIES(svcAesServer NGL_TARGET_INCLUDE_DIRECTORIES(svcAesServer
PUBLIC PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../ ${CMAKE_CURRENT_SOURCE_DIR}/../
${CMAKE_CURRENT_BINARY_DIR}/../ ${CMAKE_CURRENT_BINARY_DIR}/../
) )
IF(BUILD_RTI)
NGL_TARGET_LINK_LIBRARIES(svcAesServer NGL_TARGET_LINK_LIBRARIES(svcAesServer
PRIVATE PRIVATE
RTI::nddscpp2 RTI::nddscpp2
@@ -160,7 +155,6 @@ NGL_TARGET_LINK_LIBRARIES(svcAesServer
svcAesCommon svcAesCommon
ngldb ngldb
) )
ENDIF(BUILD_RTI)
NGL_INSTALL_TARGET(svcAesServer) NGL_INSTALL_TARGET(svcAesServer)
# #
@@ -324,7 +318,6 @@ CODEGEN_SQL(SRCS_exe ${xml_FILE})
NGL_ADD_SVC_ICON(SRCS_exe) NGL_ADD_SVC_ICON(SRCS_exe)
NGL_ADD_EXECUTABLE(AAR SV svcAreaEffectSimulation ${SRCS_exe}) NGL_ADD_EXECUTABLE(AAR SV svcAreaEffectSimulation ${SRCS_exe})
IF(BUILD_RTI)
NGL_TARGET_LINK_LIBRARIES(svcAreaEffectSimulation NGL_TARGET_LINK_LIBRARIES(svcAreaEffectSimulation
svcAesServer svcAesServer
svcCesClient svcCesClient
@@ -352,7 +345,6 @@ NGL_TARGET_LINK_LIBRARIES(svcAreaEffectSimulation
ngltools ngltools
saaTelegrams saaTelegrams
) )
ENDIF(BUILD_RTI)
NGL_INSTALL_TARGET(svcAreaEffectSimulation) NGL_INSTALL_TARGET(svcAreaEffectSimulation)
NGL_INSTALL(AAR SV FILES log4cxx_aes.props DESTINATION bin) NGL_INSTALL(AAR SV FILES log4cxx_aes.props DESTINATION bin)
NGL_ADD_TARGET_LINK(svcAreaEffectSimulation sAES) NGL_ADD_TARGET_LINK(svcAreaEffectSimulation sAES)
@@ -410,7 +402,6 @@ NGL_ADD_EXECUTABLE(AAR SV NO_TRANSLATION aes_utils_test
Utils/test_main.cpp Utils/test_main.cpp
) )
IF(BUILD_RTI)
NGL_TARGET_LINK_LIBRARIES(aes_utils_test NGL_TARGET_LINK_LIBRARIES(aes_utils_test
Qt6::Core Qt6::Core
Qt6::Widgets Qt6::Widgets
@@ -418,9 +409,9 @@ NGL_TARGET_LINK_LIBRARIES(aes_utils_test
svcAesCommon svcAesCommon
ProjectConfig ProjectConfig
ddsconnector ddsconnector
nglapplication
LtsCoordTrans LtsCoordTrans
) )
ENDIF(BUILD_RTI)
NGL_INSTALL(AAR SV TARGETS aes_utils_test DESTINATION bin/test) NGL_INSTALL(AAR SV TARGETS aes_utils_test DESTINATION bin/test)
# #
@@ -430,7 +421,6 @@ NGL_ADD_EXECUTABLE(SV NO_TRANSLATION aes_convert_mine_area
ModuleTests/aes_convert_mine_area.cpp ModuleTests/aes_convert_mine_area.cpp
) )
IF(BUILD_RTI)
NGL_TARGET_LINK_LIBRARIES(aes_convert_mine_area NGL_TARGET_LINK_LIBRARIES(aes_convert_mine_area
Qt6::Core Qt6::Core
# Qt6::Widgets # Qt6::Widgets
@@ -445,7 +435,6 @@ NGL_TARGET_LINK_LIBRARIES(aes_convert_mine_area
nglsettings nglsettings
ngltools ngltools
) )
ENDIF(BUILD_RTI)
NGL_INSTALL(SV TARGETS aes_convert_mine_area DESTINATION bin/test) NGL_INSTALL(SV TARGETS aes_convert_mine_area DESTINATION bin/test)
@@ -7,7 +7,6 @@
*/ */
#include "abstract_firing_strategy.h" #include "abstract_firing_strategy.h"
#include <utility>
#include "object_effector.h" #include "object_effector.h"
#include "main_handler.h" #include "main_handler.h"
@@ -16,9 +15,9 @@
#include <ParticipantManagement/ppm.hpp> #include <ParticipantManagement/ppm.hpp>
#include "Trajectory/trajectory_transform.h" #include "Trajectory/trajectory_transform.h"
#include <LtsCoordTrans/lts_coord_trans.h> #include <LtsCoordTrans/lts_coord_trans.h>
#include <LtsUtils/LtsUtilsCore/qpoint3d.h> #include <LtsUtilsCore/qpoint3d.h>
#include <QtCore/QJsonDocument> #include <QJsonDocument>
#include <QRandomGenerator> #include <QRandomGenerator>
namespace AreaEffectSimulation namespace AreaEffectSimulation
@@ -26,17 +25,19 @@ namespace AreaEffectSimulation
AbstractFiringStrategy::AbstractFiringStrategy(ObjectEffector *parent) : QObject(parent) AbstractFiringStrategy::AbstractFiringStrategy(ObjectEffector *parent)
, m_effector(parent), : QObject(parent)
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) { , m_effector(parent)
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; , m_logger(getLogger("FiringStrategy"))
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; {
TRACE_LOG(m_logger) << LOGFUNCTION << " START";
TRACE_LOG(m_logger) << LOGFUNCTION << " END";
} }
AbstractFiringStrategy::~AbstractFiringStrategy() AbstractFiringStrategy::~AbstractFiringStrategy()
{ {
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; TRACE_LOG(m_logger) << LOGFUNCTION << " START";
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; TRACE_LOG(m_logger) << LOGFUNCTION << " END";
} }
void AbstractFiringStrategy::calculateDispersionTrajectory() void AbstractFiringStrategy::calculateDispersionTrajectory()
@@ -49,7 +50,7 @@ void AbstractFiringStrategy::calculateDispersionTrajectory()
// sanity check: // sanity check:
if (intendendTrajectory.size() < 2) if (intendendTrajectory.size() < 2)
{ {
ERROR_LOG(m_logger) << Q_FUNC_INFO ERROR_LOG(m_logger) << LOGFUNCTION
<< " size of intendendTrajectory not sufficiant, size=" << intendendTrajectory.size(); << " size of intendendTrajectory not sufficiant, size=" << intendendTrajectory.size();
return; return;
} }
@@ -72,7 +73,7 @@ std::vector<Core::GeoPositionRelativeTime> AbstractFiringStrategy::buildTrajecto
// sanity check: // sanity check:
if (relativeTrajectory.size() < 2) if (relativeTrajectory.size() < 2)
{ {
ERROR_LOG(m_logger) << Q_FUNC_INFO ERROR_LOG(m_logger) << LOGFUNCTION
<< " size of relativeTrajectory not sufficiant, size=" << relativeTrajectory.size(); << " size of relativeTrajectory not sufficiant, size=" << relativeTrajectory.size();
return {}; return {};
} }
@@ -86,7 +87,7 @@ std::vector<Core::GeoPositionRelativeTime> AbstractFiringStrategy::buildTrajecto
geometry.reserve(relativeTrajectory.size()); geometry.reserve(relativeTrajectory.size());
// Aehnlich wie Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/aes_handler.cpp Zeile 365 // Aehnlich wie Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/aes_handler.cpp Zeile 365
for (const TrajectoryPoint &trajPntRelPos : std::as_const(relativeTrajectory)) for (const TrajectoryPoint &trajPntRelPos : qAsConst(relativeTrajectory))
{ {
DEBUG_LOG(m_logger) << "Flugbahnpunkt: trajPntRelPos :" << trajPntRelPos; // benefit from operator<<: DEBUG_LOG(m_logger) << "Flugbahnpunkt: trajPntRelPos :" << trajPntRelPos; // benefit from operator<<:
@@ -114,7 +115,7 @@ TrajectoryTimeAware AbstractFiringStrategy::buildTrajectoryTimeAware(const std::
// sanity check: // sanity check:
if (trajectoryGeometry.size() < 2) if (trajectoryGeometry.size() < 2)
{ {
ERROR_LOG(m_logger) << Q_FUNC_INFO ERROR_LOG(m_logger) << LOGFUNCTION
<< " size of trajectoryGeometry not sufficiant, size=" << trajectoryGeometry.size(); << " size of trajectoryGeometry not sufficiant, size=" << trajectoryGeometry.size();
return {}; return {};
} }
@@ -139,7 +140,7 @@ int AbstractFiringStrategy::sendChargeEffect(const TrajectoryTimeAware &trajecto
// sanity check: // sanity check:
if (trajGeometry.size() < 2) if (trajGeometry.size() < 2)
{ {
ERROR_LOG(m_logger) << Q_FUNC_INFO ERROR_LOG(m_logger) << LOGFUNCTION
<< " size of trajectoryTimeAware.geometry not sufficiant, size=" << trajGeometry.size(); << " size of trajectoryTimeAware.geometry not sufficiant, size=" << trajGeometry.size();
return -1; return -1;
} }
@@ -186,7 +187,7 @@ int32_t AbstractFiringStrategy::gearTypeId(int chargeTypeId, int participantId)
DEBUG_LOG(m_logger) << "gearSize " << dynamicParticipantData.gear().size(); DEBUG_LOG(m_logger) << "gearSize " << dynamicParticipantData.gear().size();
const auto& participantData_gear = dynamicParticipantData.gear(); const auto& participantData_gear = dynamicParticipantData.gear();
for (const auto &gear : std::as_const(participantData_gear)) for (const auto &gear : qAsConst(participantData_gear))
{ {
DEBUG_LOG(m_logger) << "gear.chargeTypeId(): " << gear.chargeTypeId() << ", chargeTypeId:" << chargeTypeId; DEBUG_LOG(m_logger) << "gear.chargeTypeId(): " << gear.chargeTypeId() << ", chargeTypeId:" << chargeTypeId;
if (gear.chargeTypeId() == chargeTypeId) if (gear.chargeTypeId() == chargeTypeId)
@@ -21,9 +21,9 @@
#pragma once #pragma once
#include <AreaEffectSimulation/logger.h> #include <AreaEffectSimulation/logger.h>
#include <QtCore/QObject> #include <QObject>
#include <Core/core.hpp> #include <Core/core.hpp>
#include <QtCore/QJsonObject> #include <QJsonObject>
namespace Core namespace Core
{ {
@@ -7,7 +7,6 @@
*/ */
#include "dm72_firing_strategy.h" #include "dm72_firing_strategy.h"
#include <utility>
#include "main_handler.h" #include "main_handler.h"
#include "object_effector.h" #include "object_effector.h"
@@ -16,10 +15,10 @@
#include <TrainingAreaBase/Plugins/AdlerJson/telegrams.h> #include <TrainingAreaBase/Plugins/AdlerJson/telegrams.h>
#include <Trajectory/trajectory_transform.h> #include <Trajectory/trajectory_transform.h>
#include <QtCore/QJsonArray> #include <QJsonArray>
#include <QtCore/QJsonDocument> #include <QJsonDocument>
#include <QtCore/QJsonObject> #include <QJsonObject>
#include <QtCore/QJsonValue> #include <QJsonValue>
#include <QTransform> #include <QTransform>
namespace AreaEffectSimulation namespace AreaEffectSimulation
@@ -73,7 +72,7 @@ void Dm72FiringStrategy::init()
QVector<UtmWithHeight> tempUtmTreffpunkte; QVector<UtmWithHeight> tempUtmTreffpunkte;
tempUtmTreffpunkte.reserve(wirkmittel.geschoss.anzahl); tempUtmTreffpunkte.reserve(wirkmittel.geschoss.anzahl);
for (const Treffpunkt &treffpunkt : std::as_const(wirkmittel.treffpunkte)) for (const Treffpunkt &treffpunkt : qAsConst(wirkmittel.treffpunkte))
{ {
const UtmCoordinate utmTreffpunkt = UtmCoordinate::fromGeographic(treffpunkt.koordinate.koordinate.longitude * deg2rad(), const UtmCoordinate utmTreffpunkt = UtmCoordinate::fromGeographic(treffpunkt.koordinate.koordinate.longitude * deg2rad(),
treffpunkt.koordinate.koordinate.latitude * deg2rad(), treffpunkt.koordinate.koordinate.latitude * deg2rad(),
@@ -7,15 +7,14 @@
*/ */
#include "gmlrs_firing_strategy.h" #include "gmlrs_firing_strategy.h"
#include <utility>
#include "object_effector.h" #include "object_effector.h"
#include <TrainingAreaBase/Plugins/AdlerJson/telegrams.h> #include <TrainingAreaBase/Plugins/AdlerJson/telegrams.h>
#include <Trajectory/trajectory_transform.h> #include <Trajectory/trajectory_transform.h>
#include <LtsCoordTrans/lts_coord_trans.h> #include <LtsCoordTrans/lts_coord_trans.h>
#include <QtCore/QJsonDocument> #include <QJsonDocument>
#include <QtCore/QJsonObject> #include <QJsonObject>
namespace AreaEffectSimulation namespace AreaEffectSimulation
{ {
@@ -69,7 +68,7 @@ void GmlrsFiringStrategy::init()
WirkmittelFeuerkommandoRakete wirkmittel; WirkmittelFeuerkommandoRakete wirkmittel;
wirkmittelFeuerkommandoRaketeFromJson(properties, wirkmittel, bOk); wirkmittelFeuerkommandoRaketeFromJson(properties, wirkmittel, bOk);
for (const Treffpunkt &treffpunkt : std::as_const(wirkmittel.treffpunkte)) for (const Treffpunkt &treffpunkt : qAsConst(wirkmittel.treffpunkte))
{ {
const LtsCoordTrans::UtmCoordinate utmTreffpunkt = const LtsCoordTrans::UtmCoordinate utmTreffpunkt =
LtsCoordTrans::UtmCoordinate::fromGeographic(treffpunkt.koordinate.koordinate.longitude * LtsCoordTrans::deg2rad(), LtsCoordTrans::UtmCoordinate::fromGeographic(treffpunkt.koordinate.koordinate.longitude * LtsCoordTrans::deg2rad(),
@@ -9,7 +9,7 @@
#pragma once #pragma once
#include "abstract_firing_strategy.h" #include "abstract_firing_strategy.h"
#include <LtsUtils/LtsUtilsCore/qpoint3d.h> #include <LtsUtilsCore/qpoint3d.h>
namespace Core namespace Core
{ {
@@ -13,8 +13,8 @@
#include <TrainingAreaBase/Plugins/AdlerJson/telegrams.h> #include <TrainingAreaBase/Plugins/AdlerJson/telegrams.h>
#include <TrajectorySplitter/trajectory_splitter.h> #include <TrajectorySplitter/trajectory_splitter.h>
#include <QtCore/QJsonDocument> #include <QJsonDocument>
#include <QtCore/QJsonObject> #include <QJsonObject>
namespace AreaEffectSimulation namespace AreaEffectSimulation
{ {
@@ -13,12 +13,6 @@ SET(UnitTestSources
IF(BUILD_TESTING) IF(BUILD_TESTING)
ADD_EXECUTABLE(aesModuleTestEffectCluster ${LinkedSources} ${UnitTestSources} ) ADD_EXECUTABLE(aesModuleTestEffectCluster ${LinkedSources} ${UnitTestSources} )
NGL_TARGET_INCLUDE_DIRECTORIES(aesModuleTestEffectCluster
PUBLIC
${CMAKE_SOURCE_DIR}/Lts/
${CMAKE_SOURCE_DIR}/Lts/Services/
)
TARGET_LINK_LIBRARIES(aesModuleTestEffectCluster TARGET_LINK_LIBRARIES(aesModuleTestEffectCluster
NGLLogger NGLLogger
nglcoreapplication nglcoreapplication
@@ -7,7 +7,6 @@
*/ */
#include "effect_cluster_module_test.h" #include "effect_cluster_module_test.h"
#include <utility>
#include <LtsCoordTrans/lts_coord_trans.h> #include <LtsCoordTrans/lts_coord_trans.h>
#include <nglapplication/nglcoreapplication.h> #include <nglapplication/nglcoreapplication.h>
@@ -18,14 +17,14 @@
// PPM // PPM
#include "ParticipantManagement/ppm_ftc_types.h" #include "ParticipantManagement/ppm_ftc_types.h"
#include "TrainingAreaBase/tab.hpp" #include "TrainingAreaBase/tab.hpp"
#include <QtCore/QDateTime> #include <QDateTime>
#include <QtCore/QDebug> #include <QDebug>
#include <QtCore/QFile> #include <QFile>
#include <QtCore/QJsonArray> #include <QJsonArray>
#include <QtCore/QJsonDocument> #include <QJsonDocument>
#include <QtCore/QTimer> #include <QTimer>
#include <QtCore/QVector> #include <QVector>
#include <QtCore/QXmlStreamReader> #include <QXmlStreamReader>
#include <iostream> #include <iostream>
@@ -75,6 +74,7 @@ double distanceMeter(const Core::GeoPosition2D &geoPos2D, const LtsCoordTrans::U
ModuleTestEffectCluster::ModuleTestEffectCluster(int domainId, int exerciseId) ModuleTestEffectCluster::ModuleTestEffectCluster(int domainId, int exerciseId)
: m_domainId(domainId) : m_domainId(domainId)
, m_exerciseId(exerciseId) , m_exerciseId(exerciseId)
, m_logger(getLogger("ModuleTestEffectCluster"))
{ {
m_timer = new QTimer(this); m_timer = new QTimer(this);
m_timer->setSingleShot(true); m_timer->setSingleShot(true);
@@ -241,7 +241,7 @@ void ModuleTestEffectCluster::onTrajectoryTimeAwareChanged(const TrajectoryTimeA
void ModuleTestEffectCluster::dumpCnt() void ModuleTestEffectCluster::dumpCnt()
{ {
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " Counter: " DEBUG_LOG(m_logger) << LOGFUNCTION << " Counter: "
<< " cntEffectCluster = " << m_counterDds.cntEffectCluster << ", cntAtEffectCluster = " << m_counterDds.cntAtEffectCluster << " cntEffectCluster = " << m_counterDds.cntEffectCluster << ", cntAtEffectCluster = " << m_counterDds.cntAtEffectCluster
<< ", cntGunToTargetLine = " << m_counterDds.cntAtEffectClusterGunToTargetLine << ", cntClusterEffects = " << m_counterDds.cntEffectClusterEffects << ", cntGunToTargetLine = " << m_counterDds.cntAtEffectClusterGunToTargetLine << ", cntClusterEffects = " << m_counterDds.cntEffectClusterEffects
<< ", cntTrajectory = " << m_counterDds.cntTrajectory; << ", cntTrajectory = " << m_counterDds.cntTrajectory;
@@ -507,7 +507,7 @@ void ModuleTestEffectCluster::waitForEffectStates(int lineNumber, int durPrep, i
return; return;
} }
INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for EsPrepared..."; INFO_LOG(m_logger) << LOGFUNCTION << " waiting for EsPrepared...";
if (!waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsPrepared; }, durPrep)) if (!waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsPrepared; }, durPrep))
{ {
ERROR_LOG(m_logger) << "Timeout waiting for EsPrepared of explosion cluster with id " << m_data.id() << ", lineNumber = " << lineNumber; ERROR_LOG(m_logger) << "Timeout waiting for EsPrepared of explosion cluster with id " << m_data.id() << ", lineNumber = " << lineNumber;
@@ -515,7 +515,7 @@ void ModuleTestEffectCluster::waitForEffectStates(int lineNumber, int durPrep, i
return; return;
} }
INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for EsActivated..."; INFO_LOG(m_logger) << LOGFUNCTION << " waiting for EsActivated...";
if (!waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated; }, durAct)) if (!waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated; }, durAct))
{ {
ERROR_LOG(m_logger) << "Timeout waiting for EsActivated of explosion cluster with id " << m_data.id() << ", lineNumber = " << lineNumber; ERROR_LOG(m_logger) << "Timeout waiting for EsActivated of explosion cluster with id " << m_data.id() << ", lineNumber = " << lineNumber;
@@ -523,7 +523,7 @@ void ModuleTestEffectCluster::waitForEffectStates(int lineNumber, int durPrep, i
return; return;
} }
INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for EsExpired..."; INFO_LOG(m_logger) << LOGFUNCTION << " waiting for EsExpired...";
if (!waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired; }, durExp)) if (!waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired; }, durExp))
{ {
ERROR_LOG(m_logger) << "Timeout waiting for EsExpired of explosion cluster with id " << m_data.id() << ", lineNumber = " << lineNumber; ERROR_LOG(m_logger) << "Timeout waiting for EsExpired of explosion cluster with id " << m_data.id() << ", lineNumber = " << lineNumber;
@@ -934,7 +934,7 @@ int main(int argc, char *argv[])
--argc; --argc;
const QStringList &slPositionalArgs = options.positionalArguments(); const QStringList &slPositionalArgs = options.positionalArguments();
for (const QString &item : std::as_const(slPositionalArgs)) for (const QString &item : qAsConst(slPositionalArgs))
std::cout << " item = " << item << std::endl; std::cout << " item = " << item << std::endl;
ModuleTestEffectCluster tc(options.domainId(), options.exerciseId()); ModuleTestEffectCluster tc(options.domainId(), options.exerciseId());
@@ -25,12 +25,12 @@
#include <Plugins/ProjectDataManagement/pdm_data_plugin_interface.h> #include <Plugins/ProjectDataManagement/pdm_data_plugin_interface.h>
#include <ExerciseManagement/exm_dtc.h> #include <ExerciseManagement/exm_dtc.h>
#include <ParticipantManagement/ppm.hpp> #include <ParticipantManagement/ppm_dtc.h>
#include <ParticipantManagement/ppm_ftc.h> #include <ParticipantManagement/ppm_ftc.h>
#include <TrainingAreaBase/tab_dts.h> #include <TrainingAreaBase/tab_dts.h>
#include <QtCore/QCoreApplication> #include <QCoreApplication>
#include <QtTest/QTest> #include <QtTest/QTest>
@@ -61,8 +61,6 @@ public:
ModuleTestEffectCluster(int domainId, int exerciseId); ModuleTestEffectCluster(int domainId, int exerciseId);
protected: protected:
NGL::INGLLogger &m_logger;
void onEffectClusterModifyReply(const Core::FunctionReplyObject &replyObject) override; void onEffectClusterModifyReply(const Core::FunctionReplyObject &replyObject) override;
void onAcknowledgeExternalAesItemReply(const Core::FunctionReplyObject &replyObject) override; void onAcknowledgeExternalAesItemReply(const Core::FunctionReplyObject &replyObject) override;
void onModifyPartyDataReply(const Core::FunctionReplyObject &replyObject) override; void onModifyPartyDataReply(const Core::FunctionReplyObject &replyObject) override;
@@ -187,6 +185,8 @@ private:
} }
} }
m_counterDds; m_counterDds;
LOGGER_T m_logger;
}; };
@@ -13,12 +13,6 @@ SET(UnitTestSources
IF(BUILD_TESTING) IF(BUILD_TESTING)
ADD_EXECUTABLE(aesModuleTestExplosionCluster ${LinkedSources} ${UnitTestSources} ) ADD_EXECUTABLE(aesModuleTestExplosionCluster ${LinkedSources} ${UnitTestSources} )
NGL_TARGET_INCLUDE_DIRECTORIES(aesModuleTestExplosionCluster
PUBLIC
${CMAKE_SOURCE_DIR}/Lts/
${CMAKE_SOURCE_DIR}/Lts/Services/
)
TARGET_LINK_LIBRARIES(aesModuleTestExplosionCluster TARGET_LINK_LIBRARIES(aesModuleTestExplosionCluster
NGLLogger NGLLogger
nglcoreapplication nglcoreapplication
@@ -7,7 +7,6 @@
*/ */
#include "explosion_cluster_module_test.h" #include "explosion_cluster_module_test.h"
#include <utility>
#include <nglapplication/nglcoreapplication.h> #include <nglapplication/nglcoreapplication.h>
#include <LtsCoordTrans/lts_coord_trans.h> #include <LtsCoordTrans/lts_coord_trans.h>
@@ -20,8 +19,8 @@
#include <Buildings/bld_ftc.h> #include <Buildings/bld_ftc.h>
#include <QtCore/QTimer> #include <QTimer>
#include <QtCore/QDebug> #include <QDebug>
#include <iostream> #include <iostream>
@@ -95,6 +94,7 @@ double distanceMeter(const Core::GeoPosition2D &geoPos2D , const LtsCoordTrans::
ModuleTestExplosionCluster::ModuleTestExplosionCluster(int domainId, int exerciseId) ModuleTestExplosionCluster::ModuleTestExplosionCluster(int domainId, int exerciseId)
: m_domainId(domainId) : m_domainId(domainId)
, m_exerciseId(exerciseId) , m_exerciseId(exerciseId)
, m_logger(getLogger("ModuleTestExplosionCluster"))
{ {
} }
@@ -253,7 +253,7 @@ void ModuleTestExplosionCluster::onTrajectoryTimeAwareChanged(const TrajectoryTi
void ModuleTestExplosionCluster::dumpCnt() void ModuleTestExplosionCluster::dumpCnt()
{ {
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " Counter: " NOTICE_LOG(m_logger) << LOGFUNCTION << " Counter: "
<< " cntExplosionCluster = " << m_counterDds.cntExplosionCluster << " cntExplosionCluster = " << m_counterDds.cntExplosionCluster
<< ", cntAtExplosionCluster = " << m_counterDds.cntAtExplosionCluster << ", cntAtExplosionCluster = " << m_counterDds.cntAtExplosionCluster
<< ", cntGunToTargetLine = " << m_counterDds.cntAtExplosionClusterGunToTargetLine << ", cntGunToTargetLine = " << m_counterDds.cntAtExplosionClusterGunToTargetLine
@@ -265,7 +265,7 @@ void ModuleTestExplosionCluster::dumpCnt()
void ModuleTestExplosionCluster::dumpBldgStates() void ModuleTestExplosionCluster::dumpBldgStates()
{ {
NOTICE_LOG(m_logger) << " m_buildingStateVec.size() = " << m_buildingStateVec.size(); NOTICE_LOG(m_logger) << " m_buildingStateVec.size() = " << m_buildingStateVec.size();
for (const Buildings::BuildingState &bldgState : std::as_const(m_buildingStateVec)) for (const Buildings::BuildingState &bldgState : qAsConst(m_buildingStateVec))
NOTICE_LOG(m_logger) << " bldgState: " NOTICE_LOG(m_logger) << " bldgState: "
<< ", id = " << bldgState.id() << ", id = " << bldgState.id()
<< ", damagePercent = " << bldgState.damagePercent() << ", damagePercent = " << bldgState.damagePercent()
@@ -336,7 +336,7 @@ bool ModuleTestExplosionCluster::checkBldgStates(const QVector<int> &damagePerce
QVector<int> damagePercentIst; QVector<int> damagePercentIst;
damagePercentIst.reserve(m_buildingStateVec.size()); damagePercentIst.reserve(m_buildingStateVec.size());
for (const Buildings::BuildingState &bldgState : std::as_const(m_buildingStateVec)) for (const Buildings::BuildingState &bldgState : qAsConst(m_buildingStateVec))
damagePercentIst.append(bldgState.damagePercent()); damagePercentIst.append(bldgState.damagePercent());
bool same = damagePercentIst == damagePercent; bool same = damagePercentIst == damagePercent;
@@ -715,7 +715,7 @@ void ModuleTestExplosionCluster::waitForEffectStates(int lineNumber, int durPrep
return; return;
} }
INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for EsPrepared..."; INFO_LOG(m_logger) << LOGFUNCTION << " waiting for EsPrepared...";
if (!waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsPrepared;}, durPrep)) if (!waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsPrepared;}, durPrep))
{ {
ERROR_LOG(m_logger) << "Timeout waiting for EsPrepared of explosion cluster with id " << m_data.id() ERROR_LOG(m_logger) << "Timeout waiting for EsPrepared of explosion cluster with id " << m_data.id()
@@ -724,7 +724,7 @@ void ModuleTestExplosionCluster::waitForEffectStates(int lineNumber, int durPrep
return; return;
} }
INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for EsActivated..."; INFO_LOG(m_logger) << LOGFUNCTION << " waiting for EsActivated...";
if (!waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated;}, durAct)) if (!waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated;}, durAct))
{ {
ERROR_LOG(m_logger) << "Timeout waiting for EsActivated of explosion cluster with id " << m_data.id() ERROR_LOG(m_logger) << "Timeout waiting for EsActivated of explosion cluster with id " << m_data.id()
@@ -733,7 +733,7 @@ void ModuleTestExplosionCluster::waitForEffectStates(int lineNumber, int durPrep
return; return;
} }
INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for EsExpired..."; INFO_LOG(m_logger) << LOGFUNCTION << " waiting for EsExpired...";
if (!waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired;}, durExp)) if (!waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired;}, durExp))
{ {
ERROR_LOG(m_logger) << "Timeout waiting for EsExpired of explosion cluster with id " << m_data.id() ERROR_LOG(m_logger) << "Timeout waiting for EsExpired of explosion cluster with id " << m_data.id()
@@ -877,7 +877,7 @@ bool ModuleTestExplosionCluster::checkParticipant_89()
const LtsUtils::QPoint3D &centerCoordGeo = Polygons::calculateFiringUnitCenterNonRecursive(m_ppmDtc, partId, singlePositionsOut_unused, m_logger); const LtsUtils::QPoint3D &centerCoordGeo = Polygons::calculateFiringUnitCenterNonRecursive(m_ppmDtc, partId, singlePositionsOut_unused, m_logger);
if (centerCoordGeo.isNull() || std::isnan(centerCoordGeo.x())) if (centerCoordGeo.isNull() || std::isnan(centerCoordGeo.x()))
{ {
WARNING_LOG(m_logger) << Q_FUNC_INFO << " calculateFiringUnitCenterNonRecursive failed, partId = " << partId; WARNING_LOG(m_logger) << LOGFUNCTION << " calculateFiringUnitCenterNonRecursive failed, partId = " << partId;
return false; return false;
} }
@@ -896,7 +896,7 @@ bool ModuleTestExplosionCluster::checkParticipant_99()
const LtsUtils::QPoint3D &centerCoordGeo = Polygons::calculateFiringUnitCenterNonRecursive(m_ppmDtc, partId, singlePositionsOut_unused, m_logger); const LtsUtils::QPoint3D &centerCoordGeo = Polygons::calculateFiringUnitCenterNonRecursive(m_ppmDtc, partId, singlePositionsOut_unused, m_logger);
if (centerCoordGeo.isNull() || std::isnan(centerCoordGeo.x())) if (centerCoordGeo.isNull() || std::isnan(centerCoordGeo.x()))
{ {
WARNING_LOG(m_logger) << Q_FUNC_INFO << " calculateFiringUnitCenterNonRecursive failed, partId = " << partId; WARNING_LOG(m_logger) << LOGFUNCTION << " calculateFiringUnitCenterNonRecursive failed, partId = " << partId;
return false; return false;
} }
@@ -935,7 +935,7 @@ void ModuleTestExplosionCluster::resetBldgs()
std::vector<Buildings::Building> buildingsVec; std::vector<Buildings::Building> buildingsVec;
buildingsVec.reserve(m_bldgIdToName.size()); buildingsVec.reserve(m_bldgIdToName.size());
auto bldgIds = m_bldgIdToName.keys(); auto bldgIds = m_bldgIdToName.keys();
for (int bldgId : std::as_const(bldgIds)) for (int bldgId : qAsConst(bldgIds))
buildingsVec.push_back( Buildings::Building(bldgId, {}) ); buildingsVec.push_back( Buildings::Building(bldgId, {}) );
Buildings::SetBuildingStatesRequest requestData; Buildings::SetBuildingStatesRequest requestData;
@@ -951,7 +951,7 @@ void ModuleTestExplosionCluster::resetBldgs()
QTest::qWait(100); QTest::qWait(100);
// check states: // check states:
for (int bldgId : std::as_const(bldgIds)) for (int bldgId : qAsConst(bldgIds))
{ {
const ProjectDataManagement::VulnerabilityState& bldgState = m_bldDtc->buildingState(bldgId).vulnerabilityState(); const ProjectDataManagement::VulnerabilityState& bldgState = m_bldDtc->buildingState(bldgId).vulnerabilityState();
INFO_LOG(m_logger) << "resetBldgs: bldgId " << bldgId INFO_LOG(m_logger) << "resetBldgs: bldgId " << bldgId
@@ -1175,19 +1175,19 @@ void ModuleTestExplosionCluster::init()
void ModuleTestExplosionCluster::test_justSetupParticipants() void ModuleTestExplosionCluster::test_justSetupParticipants()
{ {
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " START"; NOTICE_LOG(m_logger) << LOGFUNCTION << " START";
setupParticipants(); setupParticipants();
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " END"; NOTICE_LOG(m_logger) << LOGFUNCTION << " END";
} }
void ModuleTestExplosionCluster::test_TneVerificationBremen_00() void ModuleTestExplosionCluster::test_TneVerificationBremen_00()
{ {
if (m_traingAreaId != s_TraingAreaId_Bremen) if (m_traingAreaId != s_TraingAreaId_Bremen)
{ {
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " skip testcase due to m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " skip testcase due to m_traingAreaId = " << m_traingAreaId;
return; return;
} }
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " START, m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " START, m_traingAreaId = " << m_traingAreaId;
// AXXX Zentrale/DDS ToSFM (compassDegree + 90.0) // AXXX Zentrale/DDS ToSFM (compassDegree + 90.0)
@@ -1231,11 +1231,11 @@ void ModuleTestExplosionCluster::test_TneVerificationBremen_01()
{ {
if (m_traingAreaId != s_TraingAreaId_Bremen) if (m_traingAreaId != s_TraingAreaId_Bremen)
{ {
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " skip testcase due to m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " skip testcase due to m_traingAreaId = " << m_traingAreaId;
return; return;
} }
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " START, m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " START, m_traingAreaId = " << m_traingAreaId;
// //
// !!!!! ModuleTest_TneVerification -> randomNumber = 32767; !!!!!!!!!!! // !!!!! ModuleTest_TneVerification -> randomNumber = 32767; !!!!!!!!!!!
@@ -1292,7 +1292,7 @@ void ModuleTestExplosionCluster::test_TneVerificationBremen_01()
<< ", m_data.mhPoints().size()=" << m_data.mhPoints().size(); << ", m_data.mhPoints().size()=" << m_data.mhPoints().size();
const std::vector<Core::GeoPosition> &formRef = itemView.form(); const std::vector<Core::GeoPosition> &formRef = itemView.form();
for (const Core::GeoPosition &geoCoord : std::as_const(formRef)) for (const Core::GeoPosition &geoCoord : qAsConst(formRef))
{ {
const LtsCoordTrans::UtmCoordinate &utm = LtsCoordTrans::UtmCoordinate::fromGeographic(geoCoord.lon(), geoCoord.lat()); const LtsCoordTrans::UtmCoordinate &utm = LtsCoordTrans::UtmCoordinate::fromGeographic(geoCoord.lon(), geoCoord.lat());
INFO_LOG(m_logger) << " TNE VERIFICATION: CHECK:" << " utm: " << utm.mgrs() << ", item=" << geoCoord; INFO_LOG(m_logger) << " TNE VERIFICATION: CHECK:" << " utm: " << utm.mgrs() << ", item=" << geoCoord;
@@ -1323,17 +1323,17 @@ void ModuleTestExplosionCluster::test_TneVerificationBremen_01()
QVERIFY2(distanceMeter(formRef[i++], LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32U MD 97002 78004"))) < 1, "ERROR, distanceMeter failed!!"); QVERIFY2(distanceMeter(formRef[i++], LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32U MD 97002 78004"))) < 1, "ERROR, distanceMeter failed!!");
dumpCnt(); dumpCnt();
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " END"; NOTICE_LOG(m_logger) << LOGFUNCTION << " END";
} }
void ModuleTestExplosionCluster::test_TneVerificationBremen_02() void ModuleTestExplosionCluster::test_TneVerificationBremen_02()
{ {
if (m_traingAreaId != s_TraingAreaId_Bremen) if (m_traingAreaId != s_TraingAreaId_Bremen)
{ {
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " skip testcase due to m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " skip testcase due to m_traingAreaId = " << m_traingAreaId;
return; return;
} }
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " START, m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " START, m_traingAreaId = " << m_traingAreaId;
// //
// !!!!! ModuleTest_TneVerification -> randomNumber = 32767; !!!!!!!!!!! // !!!!! ModuleTest_TneVerification -> randomNumber = 32767; !!!!!!!!!!!
@@ -1391,7 +1391,7 @@ void ModuleTestExplosionCluster::test_TneVerificationBremen_02()
<< ", m_data.mhPoints().size()=" << m_data.mhPoints().size(); << ", m_data.mhPoints().size()=" << m_data.mhPoints().size();
const std::vector<Core::GeoPosition> &formRef = itemView.form(); const std::vector<Core::GeoPosition> &formRef = itemView.form();
for (const Core::GeoPosition &geoCoord : std::as_const(formRef)) for (const Core::GeoPosition &geoCoord : qAsConst(formRef))
{ {
const LtsCoordTrans::UtmCoordinate &utm = LtsCoordTrans::UtmCoordinate::fromGeographic(geoCoord.lon(), geoCoord.lat()); const LtsCoordTrans::UtmCoordinate &utm = LtsCoordTrans::UtmCoordinate::fromGeographic(geoCoord.lon(), geoCoord.lat());
INFO_LOG(m_logger) << " TNE VERIFICATION: CHECK:" << " utm: " << utm.mgrs() << ", item=" << geoCoord; INFO_LOG(m_logger) << " TNE VERIFICATION: CHECK:" << " utm: " << utm.mgrs() << ", item=" << geoCoord;
@@ -1431,7 +1431,7 @@ void ModuleTestExplosionCluster::test_bldg_1104_Proximity()
{ {
if (m_traingAreaId != s_TraingAreaId_Altmark) if (m_traingAreaId != s_TraingAreaId_Altmark)
{ {
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " skip testcase due to m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " skip testcase due to m_traingAreaId = " << m_traingAreaId;
return; return;
} }
@@ -1441,7 +1441,7 @@ void ModuleTestExplosionCluster::test_bldg_1104_Proximity()
const QString bldgName(QStringLiteral("bldg_1104")); const QString bldgName(QStringLiteral("bldg_1104"));
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " START, m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " START, m_traingAreaId = " << m_traingAreaId;
QVERIFY2(checkParticipant_5(), "ERROR, checkParticipant_5 failed!!"); QVERIFY2(checkParticipant_5(), "ERROR, checkParticipant_5 failed!!");
setFilterForBldgState(bldgName); setFilterForBldgState(bldgName);
@@ -1484,17 +1484,17 @@ void ModuleTestExplosionCluster::test_bldg_1104_Proximity()
QVERIFY2(bOk, "ERROR, checkBldgStates failed!!"); QVERIFY2(bOk, "ERROR, checkBldgStates failed!!");
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " END"; NOTICE_LOG(m_logger) << LOGFUNCTION << " END";
} }
void ModuleTestExplosionCluster::test_bldg_1104_Impact() void ModuleTestExplosionCluster::test_bldg_1104_Impact()
{ {
if (m_traingAreaId != s_TraingAreaId_Altmark) if (m_traingAreaId != s_TraingAreaId_Altmark)
{ {
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " skip testcase due to m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " skip testcase due to m_traingAreaId = " << m_traingAreaId;
return; return;
} }
const QString bldgName(QStringLiteral("bldg_1104")); const QString bldgName(QStringLiteral("bldg_1104"));
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " START, m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " START, m_traingAreaId = " << m_traingAreaId;
QVERIFY2(checkParticipant_5(), "ERROR, checkParticipant_5 failed!!"); QVERIFY2(checkParticipant_5(), "ERROR, checkParticipant_5 failed!!");
setFilterForBldgState(bldgName); setFilterForBldgState(bldgName);
@@ -1522,17 +1522,17 @@ void ModuleTestExplosionCluster::test_bldg_1104_Impact()
// UNABHÄNGIG von [GUEZE-2766] Zünderarten Freifläche: // UNABHÄNGIG von [GUEZE-2766] Zünderarten Freifläche:
QVERIFY2(checkBldgStates({14, 32, 49, 63}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!"); QVERIFY2(checkBldgStates({14, 32, 49, 63}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!");
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " END"; NOTICE_LOG(m_logger) << LOGFUNCTION << " END";
} }
void ModuleTestExplosionCluster::test_bldg_1104_Delay() void ModuleTestExplosionCluster::test_bldg_1104_Delay()
{ {
if (m_traingAreaId != s_TraingAreaId_Altmark) if (m_traingAreaId != s_TraingAreaId_Altmark)
{ {
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " skip testcase due to m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " skip testcase due to m_traingAreaId = " << m_traingAreaId;
return; return;
} }
const QString bldgName(QStringLiteral("bldg_1104")); const QString bldgName(QStringLiteral("bldg_1104"));
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " START, m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " START, m_traingAreaId = " << m_traingAreaId;
QVERIFY2(checkParticipant_5(), "ERROR, checkParticipant_5 failed!!"); QVERIFY2(checkParticipant_5(), "ERROR, checkParticipant_5 failed!!");
setFilterForBldgState(bldgName); setFilterForBldgState(bldgName);
@@ -1562,7 +1562,7 @@ void ModuleTestExplosionCluster::test_bldg_1104_Delay()
// UNABHÄNGIG von [GUEZE-2766] Zünderarten Freifläche: // UNABHÄNGIG von [GUEZE-2766] Zünderarten Freifläche:
QVERIFY2(checkBldgStates({30, 56, 74, 90}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!"); QVERIFY2(checkBldgStates({30, 56, 74, 90}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!");
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " END"; NOTICE_LOG(m_logger) << LOGFUNCTION << " END";
} }
@@ -1573,12 +1573,12 @@ void ModuleTestExplosionCluster::test_bldg_1106_Proximity()
{ {
if (m_traingAreaId != s_TraingAreaId_Altmark) if (m_traingAreaId != s_TraingAreaId_Altmark)
{ {
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " skip testcase due to m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " skip testcase due to m_traingAreaId = " << m_traingAreaId;
return; return;
} }
const QString bldgName(QStringLiteral("bldg_1106")); const QString bldgName(QStringLiteral("bldg_1106"));
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " START, m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " START, m_traingAreaId = " << m_traingAreaId;
QVERIFY2(checkParticipant_6(), "ERROR, checkParticipant_6 failed!!"); QVERIFY2(checkParticipant_6(), "ERROR, checkParticipant_6 failed!!");
setFilterForBldgState(bldgName); setFilterForBldgState(bldgName);
@@ -1599,7 +1599,7 @@ void ModuleTestExplosionCluster::test_bldg_1106_Proximity()
// Maybe Kanaele cover bldg_1106 from impact due to very simple algorithm: // Maybe Kanaele cover bldg_1106 from impact due to very simple algorithm:
// CES/Plugins/Buildings/handler_aes_data.cpp:674 / findBuildingsBetween(impactPos, footprint) // CES/Plugins/Buildings/handler_aes_data.cpp:674 / findBuildingsBetween(impactPos, footprint)
const bool bIsKanaeleAssigned = isKanaeleAssigned(); const bool bIsKanaeleAssigned = isKanaeleAssigned();
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " bIsKanaeleAssigned = " << bIsKanaeleAssigned; NOTICE_LOG(m_logger) << LOGFUNCTION << " bIsKanaeleAssigned = " << bIsKanaeleAssigned;
if (bIsKanaeleAssigned) if (bIsKanaeleAssigned)
// QVERIFY2(checkBldgStates({14, 22, 29, 37}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!"); // QVERIFY2(checkBldgStates({14, 22, 29, 37}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!");
// since 13.11.2024 ; [GUEZE-2766] Zünderarten Freifläche: // since 13.11.2024 ; [GUEZE-2766] Zünderarten Freifläche:
@@ -1607,18 +1607,18 @@ void ModuleTestExplosionCluster::test_bldg_1106_Proximity()
else else
QVERIFY2(checkBldgStates({14, 30, 45, 61}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!"); QVERIFY2(checkBldgStates({14, 30, 45, 61}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!");
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " END"; NOTICE_LOG(m_logger) << LOGFUNCTION << " END";
} }
void ModuleTestExplosionCluster::test_bldg_1106_Impact() void ModuleTestExplosionCluster::test_bldg_1106_Impact()
{ {
if (m_traingAreaId != s_TraingAreaId_Altmark) if (m_traingAreaId != s_TraingAreaId_Altmark)
{ {
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " skip testcase due to m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " skip testcase due to m_traingAreaId = " << m_traingAreaId;
return; return;
} }
const QString bldgName(QStringLiteral("bldg_1106")); const QString bldgName(QStringLiteral("bldg_1106"));
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " START, m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " START, m_traingAreaId = " << m_traingAreaId;
QVERIFY2(checkParticipant_6(), "ERROR, checkParticipant_6 failed!!"); QVERIFY2(checkParticipant_6(), "ERROR, checkParticipant_6 failed!!");
setFilterForBldgState(bldgName); setFilterForBldgState(bldgName);
@@ -1640,23 +1640,23 @@ void ModuleTestExplosionCluster::test_bldg_1106_Impact()
// Maybe Kanaele cover bldg_1106 from impact due to very simple algorithm: // Maybe Kanaele cover bldg_1106 from impact due to very simple algorithm:
// CES/Plugins/Buildings/handler_aes_data.cpp:674 / findBuildingsBetween(impactPos, footprint) // CES/Plugins/Buildings/handler_aes_data.cpp:674 / findBuildingsBetween(impactPos, footprint)
const bool bIsKanaeleAssigned = isKanaeleAssigned(); const bool bIsKanaeleAssigned = isKanaeleAssigned();
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " bIsKanaeleAssigned = " << bIsKanaeleAssigned; NOTICE_LOG(m_logger) << LOGFUNCTION << " bIsKanaeleAssigned = " << bIsKanaeleAssigned;
if (bIsKanaeleAssigned) if (bIsKanaeleAssigned)
QVERIFY2(checkBldgStates({14, 28, 41, 56}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!"); QVERIFY2(checkBldgStates({14, 28, 41, 56}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!");
else else
QVERIFY2(checkBldgStates({14, 41, 68, 88}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!"); QVERIFY2(checkBldgStates({14, 41, 68, 88}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!");
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " END"; NOTICE_LOG(m_logger) << LOGFUNCTION << " END";
} }
void ModuleTestExplosionCluster::test_bldg_1106_Delay() void ModuleTestExplosionCluster::test_bldg_1106_Delay()
{ {
if (m_traingAreaId != s_TraingAreaId_Altmark) if (m_traingAreaId != s_TraingAreaId_Altmark)
{ {
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " skip testcase due to m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " skip testcase due to m_traingAreaId = " << m_traingAreaId;
return; return;
} }
const QString bldgName(QStringLiteral("bldg_1106")); const QString bldgName(QStringLiteral("bldg_1106"));
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " START, m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " START, m_traingAreaId = " << m_traingAreaId;
QVERIFY2(checkParticipant_6(), "ERROR, checkParticipant_6 failed!!"); QVERIFY2(checkParticipant_6(), "ERROR, checkParticipant_6 failed!!");
setFilterForBldgState(bldgName); setFilterForBldgState(bldgName);
@@ -1678,24 +1678,24 @@ void ModuleTestExplosionCluster::test_bldg_1106_Delay()
// Maybe Kanaele cover bldg_1106 from impact due to very simple algorithm: // Maybe Kanaele cover bldg_1106 from impact due to very simple algorithm:
// CES/Plugins/Buildings/handler_aes_data.cpp:674 / findBuildingsBetween(impactPos, footprint) // CES/Plugins/Buildings/handler_aes_data.cpp:674 / findBuildingsBetween(impactPos, footprint)
const bool bIsKanaeleAssigned = isKanaeleAssigned(); const bool bIsKanaeleAssigned = isKanaeleAssigned();
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " bIsKanaeleAssigned = " << bIsKanaeleAssigned; NOTICE_LOG(m_logger) << LOGFUNCTION << " bIsKanaeleAssigned = " << bIsKanaeleAssigned;
if (bIsKanaeleAssigned) if (bIsKanaeleAssigned)
QVERIFY2(checkBldgStates({14, 43, 72, 86 }, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!"); QVERIFY2(checkBldgStates({14, 43, 72, 86 }, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!");
else else
QVERIFY2(checkBldgStates({14, 71, 90, 99}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!"); QVERIFY2(checkBldgStates({14, 71, 90, 99}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!");
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " END"; NOTICE_LOG(m_logger) << LOGFUNCTION << " END";
} }
void ModuleTestExplosionCluster::test_bldg_UBAHN_Proximity() void ModuleTestExplosionCluster::test_bldg_UBAHN_Proximity()
{ {
if (m_traingAreaId != s_TraingAreaId_Altmark) if (m_traingAreaId != s_TraingAreaId_Altmark)
{ {
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " skip testcase due to m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " skip testcase due to m_traingAreaId = " << m_traingAreaId;
return; return;
} }
const QString bldgName(QStringLiteral("bldg_U_Bahn")); const QString bldgName(QStringLiteral("bldg_U_Bahn"));
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " START, m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " START, m_traingAreaId = " << m_traingAreaId;
QVERIFY2(checkParticipant_5(), "ERROR, checkParticipant_5 failed!!"); QVERIFY2(checkParticipant_5(), "ERROR, checkParticipant_5 failed!!");
setFilterForBldgState(bldgName); setFilterForBldgState(bldgName);
@@ -1717,7 +1717,7 @@ void ModuleTestExplosionCluster::test_bldg_UBAHN_Proximity()
// since 13.11.2024 ; [GUEZE-2766] Zünderarten Freifläche: // since 13.11.2024 ; [GUEZE-2766] Zünderarten Freifläche:
QVERIFY2(checkBldgStates({2, 4, 7, 7}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!"); QVERIFY2(checkBldgStates({2, 4, 7, 7}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!");
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " END"; NOTICE_LOG(m_logger) << LOGFUNCTION << " END";
// participantId(5) // participantId(5)
// Schuss 1: nearestWall.roomId = 2303 // Schuss 1: nearestWall.roomId = 2303
@@ -1731,11 +1731,11 @@ void ModuleTestExplosionCluster::test_bldg_UBAHN_Impact()
{ {
if (m_traingAreaId != s_TraingAreaId_Altmark) if (m_traingAreaId != s_TraingAreaId_Altmark)
{ {
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " skip testcase due to m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " skip testcase due to m_traingAreaId = " << m_traingAreaId;
return; return;
} }
const QString bldgName(QStringLiteral("bldg_U_Bahn")); const QString bldgName(QStringLiteral("bldg_U_Bahn"));
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " START, m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " START, m_traingAreaId = " << m_traingAreaId;
QVERIFY2(checkParticipant_5(), "ERROR, checkParticipant_5 failed!!"); QVERIFY2(checkParticipant_5(), "ERROR, checkParticipant_5 failed!!");
setFilterForBldgState(bldgName); setFilterForBldgState(bldgName);
@@ -1761,7 +1761,7 @@ void ModuleTestExplosionCluster::test_bldg_UBAHN_Impact()
QVERIFY2(bCheckBldgOk, "ERROR, checkBldgStates failed!!"); QVERIFY2(bCheckBldgOk, "ERROR, checkBldgStates failed!!");
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " END"; NOTICE_LOG(m_logger) << LOGFUNCTION << " END";
// participantId(5) // participantId(5)
// Schuss 1: nearestWall.roomId = 2303 // Schuss 1: nearestWall.roomId = 2303
@@ -1775,11 +1775,11 @@ void ModuleTestExplosionCluster::test_bldg_UBAHN_Delay()
{ {
if (m_traingAreaId != s_TraingAreaId_Altmark) if (m_traingAreaId != s_TraingAreaId_Altmark)
{ {
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " skip testcase due to m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " skip testcase due to m_traingAreaId = " << m_traingAreaId;
return; return;
} }
const QString bldgName(QStringLiteral("bldg_U_Bahn")); const QString bldgName(QStringLiteral("bldg_U_Bahn"));
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " START, m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " START, m_traingAreaId = " << m_traingAreaId;
QVERIFY2(checkParticipant_5(), "ERROR, checkParticipant_5 failed!!"); QVERIFY2(checkParticipant_5(), "ERROR, checkParticipant_5 failed!!");
setFilterForBldgState(bldgName); setFilterForBldgState(bldgName);
@@ -1800,7 +1800,7 @@ void ModuleTestExplosionCluster::test_bldg_UBAHN_Delay()
QVERIFY2(checkBldgStates({8, 11, 13, 13}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!"); QVERIFY2(checkBldgStates({8, 11, 13, 13}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!");
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " END"; NOTICE_LOG(m_logger) << LOGFUNCTION << " END";
// participantId(5) // participantId(5)
// Schuss 1: nearestWall.roomId = 2132 // Schuss 1: nearestWall.roomId = 2132
@@ -1814,11 +1814,11 @@ void ModuleTestExplosionCluster::test_bldg_3101_Proximity()
{ {
if (m_traingAreaId != s_TraingAreaId_Altmark) if (m_traingAreaId != s_TraingAreaId_Altmark)
{ {
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " skip testcase due to m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " skip testcase due to m_traingAreaId = " << m_traingAreaId;
return; return;
} }
const QString bldgName(QStringLiteral("bldg_3101")); const QString bldgName(QStringLiteral("bldg_3101"));
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " START, m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " START, m_traingAreaId = " << m_traingAreaId;
QVERIFY2(checkParticipant_89(), "ERROR, checkParticipant_89 failed!!"); QVERIFY2(checkParticipant_89(), "ERROR, checkParticipant_89 failed!!");
setFilterForBldgState(bldgName); setFilterForBldgState(bldgName);
@@ -1841,7 +1841,7 @@ void ModuleTestExplosionCluster::test_bldg_3101_Proximity()
// since 13.11.2024 ; [GUEZE-2766] Zünderarten Freifläche: // since 13.11.2024 ; [GUEZE-2766] Zünderarten Freifläche:
QVERIFY2(checkBldgStates({7, 14, 21, 28}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!"); QVERIFY2(checkBldgStates({7, 14, 21, 28}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!");
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " END"; NOTICE_LOG(m_logger) << LOGFUNCTION << " END";
// participantId(89) // participantId(89)
@@ -1856,11 +1856,11 @@ void ModuleTestExplosionCluster::test_bldg_3101_Impact()
{ {
if (m_traingAreaId != s_TraingAreaId_Altmark) if (m_traingAreaId != s_TraingAreaId_Altmark)
{ {
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " skip testcase due to m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " skip testcase due to m_traingAreaId = " << m_traingAreaId;
return; return;
} }
const QString bldgName(QStringLiteral("bldg_3101")); const QString bldgName(QStringLiteral("bldg_3101"));
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " START, m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " START, m_traingAreaId = " << m_traingAreaId;
QVERIFY2(checkParticipant_89(), "ERROR, checkParticipant_89 failed!!"); QVERIFY2(checkParticipant_89(), "ERROR, checkParticipant_89 failed!!");
setFilterForBldgState(bldgName); setFilterForBldgState(bldgName);
@@ -1881,7 +1881,7 @@ void ModuleTestExplosionCluster::test_bldg_3101_Impact()
QVERIFY2(checkBldgStates({7, 13, 25, 36}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!"); QVERIFY2(checkBldgStates({7, 13, 25, 36}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!");
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " END"; NOTICE_LOG(m_logger) << LOGFUNCTION << " END";
// participantId(89) // participantId(89)
// Schuss 1: // Schuss 1:
@@ -1895,11 +1895,11 @@ void ModuleTestExplosionCluster::test_bldg_3101_Delay()
{ {
if (m_traingAreaId != s_TraingAreaId_Altmark) if (m_traingAreaId != s_TraingAreaId_Altmark)
{ {
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " skip testcase due to m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " skip testcase due to m_traingAreaId = " << m_traingAreaId;
return; return;
} }
const QString bldgName(QStringLiteral("bldg_3101")); const QString bldgName(QStringLiteral("bldg_3101"));
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " START, m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " START, m_traingAreaId = " << m_traingAreaId;
QVERIFY2(checkParticipant_89(), "ERROR, checkParticipant_89 failed!!"); QVERIFY2(checkParticipant_89(), "ERROR, checkParticipant_89 failed!!");
setFilterForBldgState(bldgName); setFilterForBldgState(bldgName);
@@ -1920,7 +1920,7 @@ void ModuleTestExplosionCluster::test_bldg_3101_Delay()
QVERIFY2(checkBldgStates({7, 13, 37, 58}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!"); QVERIFY2(checkBldgStates({7, 13, 37, 58}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!");
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " END"; NOTICE_LOG(m_logger) << LOGFUNCTION << " END";
// participantId(89) // participantId(89)
// Schuss 1: // Schuss 1:
@@ -1934,10 +1934,10 @@ void ModuleTestExplosionCluster::test_remove_effect_start()
{ {
if (m_traingAreaId != s_TraingAreaId_Altmark) if (m_traingAreaId != s_TraingAreaId_Altmark)
{ {
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " skip testcase due to m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " skip testcase due to m_traingAreaId = " << m_traingAreaId;
return; return;
} }
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " START, m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " START, m_traingAreaId = " << m_traingAreaId;
QVERIFY2(checkParticipant_5(), "ERROR, checkParticipant_5 failed!!"); QVERIFY2(checkParticipant_5(), "ERROR, checkParticipant_5 failed!!");
AreaEffectSimulation::ExplosionCluster eaData = getEcFor1104(QStringLiteral("ModuleTest_RemoveEffectStart_ec__")); AreaEffectSimulation::ExplosionCluster eaData = getEcFor1104(QStringLiteral("ModuleTest_RemoveEffectStart_ec__"));
@@ -1964,7 +1964,7 @@ void ModuleTestExplosionCluster::test_remove_effect_start()
return; return;
} }
INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for EsPrepared..."; INFO_LOG(m_logger) << LOGFUNCTION << " waiting for EsPrepared...";
if (!waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsPrepared;}, 2)) if (!waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsPrepared;}, 2))
{ {
ERROR_LOG(m_logger) << "Timeout waiting for EsPrepared of explosion cluster with id " << m_data.id(); ERROR_LOG(m_logger) << "Timeout waiting for EsPrepared of explosion cluster with id " << m_data.id();
@@ -1979,19 +1979,19 @@ void ModuleTestExplosionCluster::test_remove_effect_start()
QTimer::singleShot(waitSec*1000, this, [this, eaData] QTimer::singleShot(waitSec*1000, this, [this, eaData]
{ {
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " ACTION: prepared back to created ... "; NOTICE_LOG(m_logger) << LOGFUNCTION << " ACTION: prepared back to created ... ";
AreaEffectSimulation::ExplosionCluster copy = eaData; AreaEffectSimulation::ExplosionCluster copy = eaData;
copy.id(m_data.id()); copy.id(m_data.id());
copy.effectStart().reset(); // 'remove' -> prepared back to created copy.effectStart().reset(); // 'remove' -> prepared back to created
int ret = doExplosionClusterModifyRequest(copy); int ret = doExplosionClusterModifyRequest(copy);
QVERIFY2(ret != 0, "ERROR, explosionClusterModifyRequest failed!!"); QVERIFY2(ret != 0, "ERROR, explosionClusterModifyRequest failed!!");
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " ACTION: prepared back to created ... DONE"; NOTICE_LOG(m_logger) << LOGFUNCTION << " ACTION: prepared back to created ... DONE";
}); });
} }
INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting to make sure, that next step is never reached:"; INFO_LOG(m_logger) << LOGFUNCTION << " waiting to make sure, that next step is never reached:";
if (waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated;}, 60)) if (waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated;}, 60))
{ {
ERROR_LOG(m_logger) << "Next step is accidentically reached of explosion cluster with id " << m_data.id(); ERROR_LOG(m_logger) << "Next step is accidentically reached of explosion cluster with id " << m_data.id();
@@ -1999,27 +1999,27 @@ void ModuleTestExplosionCluster::test_remove_effect_start()
return; return;
} }
INFO_LOG(m_logger) << Q_FUNC_INFO << " object effectState: " << m_data.effectStateId(); INFO_LOG(m_logger) << LOGFUNCTION << " object effectState: " << m_data.effectStateId();
QVERIFY2(m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsCreated, "ERROR, ExplosionCluster in wrong state"); QVERIFY2(m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsCreated, "ERROR, ExplosionCluster in wrong state");
dumpCnt(); dumpCnt();
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " END"; NOTICE_LOG(m_logger) << LOGFUNCTION << " END";
} }
void ModuleTestExplosionCluster::test_create_bulk() void ModuleTestExplosionCluster::test_create_bulk()
{ {
if (!ModuleTestExplosionCluster::m_enable_create_bulk) if (!ModuleTestExplosionCluster::m_enable_create_bulk)
{ {
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " skip testcase, has to be call explicitly called by user"; NOTICE_LOG(m_logger) << LOGFUNCTION << " skip testcase, has to be call explicitly called by user";
return; return;
} }
if (m_traingAreaId != s_TraingAreaId_Altmark) if (m_traingAreaId != s_TraingAreaId_Altmark)
{ {
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " skip testcase due to m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " skip testcase due to m_traingAreaId = " << m_traingAreaId;
return; return;
} }
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " START, m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " START, m_traingAreaId = " << m_traingAreaId;
QVERIFY2(checkParticipant_89(), "ERROR, checkParticipant_89 failed!!"); QVERIFY2(checkParticipant_89(), "ERROR, checkParticipant_89 failed!!");
@@ -2048,19 +2048,19 @@ void ModuleTestExplosionCluster::test_create_bulk()
QVERIFY2(m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired, "ERROR, effectStateId failed!!"); QVERIFY2(m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired, "ERROR, effectStateId failed!!");
dumpCnt(); dumpCnt();
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " END"; NOTICE_LOG(m_logger) << LOGFUNCTION << " END";
} }
void ModuleTestExplosionCluster::test_point_geometry_bldg_1104() void ModuleTestExplosionCluster::test_point_geometry_bldg_1104()
{ {
if (m_traingAreaId != s_TraingAreaId_Altmark) if (m_traingAreaId != s_TraingAreaId_Altmark)
{ {
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " skip testcase due to m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " skip testcase due to m_traingAreaId = " << m_traingAreaId;
return; return;
} }
const QString bldgName(QStringLiteral("bldg_1104")); const QString bldgName(QStringLiteral("bldg_1104"));
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " START, m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " START, m_traingAreaId = " << m_traingAreaId;
QVERIFY2(checkParticipant_5(), "ERROR, checkParticipant_5 failed!!"); QVERIFY2(checkParticipant_5(), "ERROR, checkParticipant_5 failed!!");
setFilterForBldgState(bldgName); setFilterForBldgState(bldgName);
@@ -2099,7 +2099,7 @@ void ModuleTestExplosionCluster::test_point_geometry_bldg_1104()
QVERIFY2(checkBldgStates({29}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!"); QVERIFY2(checkBldgStates({29}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!");
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " END"; NOTICE_LOG(m_logger) << LOGFUNCTION << " END";
} }
void ModuleTestExplosionCluster::test_point_geometry_bldg_1104_SMArt_Proximity() void ModuleTestExplosionCluster::test_point_geometry_bldg_1104_SMArt_Proximity()
@@ -2111,12 +2111,12 @@ void ModuleTestExplosionCluster::test_point_geometry_bldg_1104_SMArt_Proximity()
if (m_traingAreaId != s_TraingAreaId_Altmark) if (m_traingAreaId != s_TraingAreaId_Altmark)
{ {
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " skip testcase due to m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " skip testcase due to m_traingAreaId = " << m_traingAreaId;
return; return;
} }
const QString bldgName(QStringLiteral("bldg_1104_SMArt")); const QString bldgName(QStringLiteral("bldg_1104_SMArt"));
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " START, m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " START, m_traingAreaId = " << m_traingAreaId;
QVERIFY2(checkParticipant_5(), "ERROR, checkParticipant_5 failed!!"); QVERIFY2(checkParticipant_5(), "ERROR, checkParticipant_5 failed!!");
setFilterForBldgState(bldgName); setFilterForBldgState(bldgName);
@@ -2126,10 +2126,10 @@ void ModuleTestExplosionCluster::test_point_geometry_bldg_1104_SMArt_Proximity()
eaData.chargeStruct().igniterTypeId(s_IgniterTypeImpact); eaData.chargeStruct().igniterTypeId(s_IgniterTypeImpact);
eaData.chargeStruct().chargeTypeId(374); // 374: isSMArt=true ; radius == 25, diameter == 50m eaData.chargeStruct().chargeTypeId(374); // 374: isSMArt=true ; radius == 25, diameter == 50m
NOTICE_LOG(m_logger) << Q_FUNC_INFO << "Vor eaData.flightCurve().is_set()"; NOTICE_LOG(m_logger) << LOGFUNCTION << "Vor eaData.flightCurve().is_set()";
QVERIFY2(eaData.flightCurve().is_set(), "ERROR, flightCurve() not set !!"); QVERIFY2(eaData.flightCurve().is_set(), "ERROR, flightCurve() not set !!");
NOTICE_LOG(m_logger) << Q_FUNC_INFO << "Nach eaData.flightCurve().is_set()"; NOTICE_LOG(m_logger) << LOGFUNCTION << "Nach eaData.flightCurve().is_set()";
eaData.flightCurve().get().requestedRelativePeakHeight(500); eaData.flightCurve().get().requestedRelativePeakHeight(500);
@@ -2163,19 +2163,19 @@ void ModuleTestExplosionCluster::test_point_geometry_bldg_1104_SMArt_Proximity()
QVERIFY2(checkBldgStates({29}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!"); QVERIFY2(checkBldgStates({29}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!");
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " END"; NOTICE_LOG(m_logger) << LOGFUNCTION << " END";
} }
void ModuleTestExplosionCluster::test_bldg_1104_OC() void ModuleTestExplosionCluster::test_bldg_1104_OC()
{ {
if (m_traingAreaId != s_TraingAreaId_Altmark) if (m_traingAreaId != s_TraingAreaId_Altmark)
{ {
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " skip testcase due to m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " skip testcase due to m_traingAreaId = " << m_traingAreaId;
return; return;
} }
const QString bldgName(QStringLiteral("bldg_1104")); const QString bldgName(QStringLiteral("bldg_1104"));
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " START, m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " START, m_traingAreaId = " << m_traingAreaId;
// QVERIFY2(checkParticipant_5(), "ERROR, checkParticipant_5 failed!!"); // QVERIFY2(checkParticipant_5(), "ERROR, checkParticipant_5 failed!!");
// setFilterForBldgState(bldgName); // setFilterForBldgState(bldgName);
@@ -2209,7 +2209,7 @@ void ModuleTestExplosionCluster::test_bldg_1104_OC()
waitForEffectStates(__LINE__, 5, 60, 30); waitForEffectStates(__LINE__, 5, 60, 30);
QVERIFY2(m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired, "ERROR, effectStateId failed!!"); QVERIFY2(m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired, "ERROR, effectStateId failed!!");
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " END"; NOTICE_LOG(m_logger) << LOGFUNCTION << " END";
} }
// light -> no curve // light -> no curve
@@ -2217,12 +2217,12 @@ void ModuleTestExplosionCluster::test_point_geometry_bldg_1104_light()
{ {
if (m_traingAreaId != s_TraingAreaId_Altmark) if (m_traingAreaId != s_TraingAreaId_Altmark)
{ {
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " skip testcase due to m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " skip testcase due to m_traingAreaId = " << m_traingAreaId;
return; return;
} }
const QString bldgName(QStringLiteral("bldg_1104")); const QString bldgName(QStringLiteral("bldg_1104"));
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " START, m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " START, m_traingAreaId = " << m_traingAreaId;
QVERIFY2(checkParticipant_5(), "ERROR, checkParticipant_5 failed!!"); QVERIFY2(checkParticipant_5(), "ERROR, checkParticipant_5 failed!!");
setFilterForBldgState(bldgName); setFilterForBldgState(bldgName);
@@ -2267,19 +2267,19 @@ void ModuleTestExplosionCluster::test_point_geometry_bldg_1104_light()
// QVERIFY2(checkBldgStates({29}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!"); // QVERIFY2(checkBldgStates({29}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!");
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " END"; NOTICE_LOG(m_logger) << LOGFUNCTION << " END";
} }
void ModuleTestExplosionCluster:: test_point_geometry_bldg_1104_single_effect_only() void ModuleTestExplosionCluster:: test_point_geometry_bldg_1104_single_effect_only()
{ {
if (m_traingAreaId != s_TraingAreaId_Altmark) if (m_traingAreaId != s_TraingAreaId_Altmark)
{ {
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " skip testcase due to m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " skip testcase due to m_traingAreaId = " << m_traingAreaId;
return; return;
} }
const QString bldgName(QStringLiteral("bldg_1104")); const QString bldgName(QStringLiteral("bldg_1104"));
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " START, m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " START, m_traingAreaId = " << m_traingAreaId;
// // QVERIFY2(checkParticipant_5(), "ERROR, checkParticipant_5 failed!!"); // // QVERIFY2(checkParticipant_5(), "ERROR, checkParticipant_5 failed!!");
setFilterForBldgState(bldgName); setFilterForBldgState(bldgName);
@@ -2298,7 +2298,7 @@ void ModuleTestExplosionCluster:: test_point_geometry_bldg_1104_single_effect_on
const QPointF impactPointF(0.20256382834808495, 0.9161105453111705); const QPointF impactPointF(0.20256382834808495, 0.9161105453111705);
request.impactPosition(Core::GeoPosition2D(impactPointF.x(), impactPointF.y())); request.impactPosition(Core::GeoPosition2D(impactPointF.x(), impactPointF.y()));
INFO_LOG(m_logger) << Q_FUNC_INFO << " requested impact position = " << LtsCoordTrans::UtmCoordinate::fromGeographic(impactPointF).mgrs(); INFO_LOG(m_logger) << LOGFUNCTION << " requested impact position = " << LtsCoordTrans::UtmCoordinate::fromGeographic(impactPointF).mgrs();
request.chargeTypeId(371); request.chargeTypeId(371);
request.externalId(815); request.externalId(815);
@@ -2313,19 +2313,19 @@ void ModuleTestExplosionCluster:: test_point_geometry_bldg_1104_single_effect_on
QVERIFY2(checkBldgStates({29}, QString::fromStdString(request.name())), "ERROR, checkBldgStates failed!!"); QVERIFY2(checkBldgStates({29}, QString::fromStdString(request.name())), "ERROR, checkBldgStates failed!!");
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " END"; NOTICE_LOG(m_logger) << LOGFUNCTION << " END";
} }
void ModuleTestExplosionCluster::test_bldg_1104_effects_only() void ModuleTestExplosionCluster::test_bldg_1104_effects_only()
{ {
if (m_traingAreaId != s_TraingAreaId_Altmark) if (m_traingAreaId != s_TraingAreaId_Altmark)
{ {
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " skip testcase due to m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " skip testcase due to m_traingAreaId = " << m_traingAreaId;
return; return;
} }
const QString bldgName(QStringLiteral("bldg_1104")); const QString bldgName(QStringLiteral("bldg_1104"));
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " START, m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " START, m_traingAreaId = " << m_traingAreaId;
// QVERIFY2(checkParticipant_5(), "ERROR, checkParticipant_5 failed!!"); // QVERIFY2(checkParticipant_5(), "ERROR, checkParticipant_5 failed!!");
setFilterForBldgState(bldgName); setFilterForBldgState(bldgName);
@@ -2364,7 +2364,7 @@ void ModuleTestExplosionCluster::test_bldg_1104_effects_only()
QVERIFY2(m_counterDds.cntTrajectory == 0, "ERROR, cnt failed!!"); // 4 impacts -> 4 trajectory QVERIFY2(m_counterDds.cntTrajectory == 0, "ERROR, cnt failed!!"); // 4 impacts -> 4 trajectory
std::vector<AreaEffectSimulation::SingleEffect>&singleEffects = m_effects.singleEffects(); std::vector<AreaEffectSimulation::SingleEffect>&singleEffects = m_effects.singleEffects();
for (const AreaEffectSimulation::SingleEffect &se : std::as_const(singleEffects)) for (const AreaEffectSimulation::SingleEffect &se : qAsConst(singleEffects))
{ {
// Since there is no trajectory, no intersection is calculated. // Since there is no trajectory, no intersection is calculated.
// Therefore the impacts are on the ground. // Therefore the impacts are on the ground.
@@ -2376,7 +2376,7 @@ void ModuleTestExplosionCluster::test_bldg_1104_effects_only()
QVERIFY2(checkBldgStates({29, 59, 82, 94}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!"); QVERIFY2(checkBldgStates({29, 59, 82, 94}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!");
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " END"; NOTICE_LOG(m_logger) << LOGFUNCTION << " END";
} }
@@ -2385,12 +2385,12 @@ void ModuleTestExplosionCluster::test_vulcano_bldg_1104()
{ {
if (m_traingAreaId != s_TraingAreaId_Altmark) if (m_traingAreaId != s_TraingAreaId_Altmark)
{ {
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " skip testcase due to m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " skip testcase due to m_traingAreaId = " << m_traingAreaId;
return; return;
} }
const QString bldgName(QStringLiteral("bldg_1104_VULCANO")); const QString bldgName(QStringLiteral("bldg_1104_VULCANO"));
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " START, m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " START, m_traingAreaId = " << m_traingAreaId;
QVERIFY2(checkParticipant_99(), "ERROR, checkParticipant_99 failed!!"); QVERIFY2(checkParticipant_99(), "ERROR, checkParticipant_99 failed!!");
@@ -2435,19 +2435,19 @@ void ModuleTestExplosionCluster::test_vulcano_bldg_1104()
QVERIFY2(m_counterDds.cntAtExplosionClusterGunToTargetLine == 1, "ERROR, cnt failed!!"); QVERIFY2(m_counterDds.cntAtExplosionClusterGunToTargetLine == 1, "ERROR, cnt failed!!");
QVERIFY2(m_counterDds.cntExplosionClusterEffects == 1, "ERROR, cnt failed!!"); QVERIFY2(m_counterDds.cntExplosionClusterEffects == 1, "ERROR, cnt failed!!");
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " END"; NOTICE_LOG(m_logger) << LOGFUNCTION << " END";
} }
void ModuleTestExplosionCluster::test_vulcano_bldg_1104_withTargetModify() void ModuleTestExplosionCluster::test_vulcano_bldg_1104_withTargetModify()
{ {
if (m_traingAreaId != s_TraingAreaId_Altmark) if (m_traingAreaId != s_TraingAreaId_Altmark)
{ {
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " skip testcase due to m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " skip testcase due to m_traingAreaId = " << m_traingAreaId;
return; return;
} }
const QString bldgName(QStringLiteral("bldg_1104_VULCANO")); const QString bldgName(QStringLiteral("bldg_1104_VULCANO"));
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " START, m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " START, m_traingAreaId = " << m_traingAreaId;
QVERIFY2(checkParticipant_99(), "ERROR, checkParticipant_99 failed!!"); QVERIFY2(checkParticipant_99(), "ERROR, checkParticipant_99 failed!!");
@@ -2494,7 +2494,7 @@ void ModuleTestExplosionCluster::test_vulcano_bldg_1104_withTargetModify()
const qint64 nowMsec = QDateTime::currentMSecsSinceEpoch(); const qint64 nowMsec = QDateTime::currentMSecsSinceEpoch();
const qint64 distMsec = startTimeMsec - nowMsec; const qint64 distMsec = startTimeMsec - nowMsec;
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " TIMER 1 " NOTICE_LOG(m_logger) << LOGFUNCTION << " TIMER 1 "
<< ", effectStart (impactTime) = " << startTimeMsec << ", effectStart (impactTime) = " << startTimeMsec
<< ", nowMsec = " << nowMsec << ", nowMsec = " << nowMsec
<< ", distMsec = " << distMsec; << ", distMsec = " << distMsec;
@@ -2503,7 +2503,7 @@ void ModuleTestExplosionCluster::test_vulcano_bldg_1104_withTargetModify()
int delayMsec = 5000; // distMsec - 5000; int delayMsec = 5000; // distMsec - 5000;
QTimer::singleShot(distMsec - delayMsec, this, [this] () { // local static is captured implicit by gcc and for MSVS QTimer::singleShot(distMsec - delayMsec, this, [this] () { // local static is captured implicit by gcc and for MSVS
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " TIMER 2 "; NOTICE_LOG(m_logger) << LOGFUNCTION << " TIMER 2 ";
QPointF newTargetPosGeo = s_newTargetPosUtm_1.geographic(); QPointF newTargetPosGeo = s_newTargetPosUtm_1.geographic();
@@ -2511,9 +2511,9 @@ void ModuleTestExplosionCluster::test_vulcano_bldg_1104_withTargetModify()
request.aesItemId(m_data.id()); request.aesItemId(m_data.id());
request.positions().emplace_back(Core::GeoPosition(newTargetPosGeo.x(), newTargetPosGeo.y(), 123)); request.positions().emplace_back(Core::GeoPosition(newTargetPosGeo.x(), newTargetPosGeo.y(), 123));
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " TIMER 2, doExplosionClusterTargetPositionsModify ..."; NOTICE_LOG(m_logger) << LOGFUNCTION << " TIMER 2, doExplosionClusterTargetPositionsModify ...";
doExplosionClusterTargetPositionsModify(request); doExplosionClusterTargetPositionsModify(request);
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " TIMER 2, doExplosionClusterTargetPositionsModify ... DONE"; NOTICE_LOG(m_logger) << LOGFUNCTION << " TIMER 2, doExplosionClusterTargetPositionsModify ... DONE";
}); });
}); });
@@ -2536,22 +2536,22 @@ void ModuleTestExplosionCluster::test_vulcano_bldg_1104_withTargetModify()
const LtsCoordTrans::UtmCoordinate &seUtmPos = LtsCoordTrans::UtmCoordinate::fromGeographic(seGeoPos.lon(), seGeoPos.lat()); const LtsCoordTrans::UtmCoordinate &seUtmPos = LtsCoordTrans::UtmCoordinate::fromGeographic(seGeoPos.lon(), seGeoPos.lat());
int dist = LtsCoordTrans::distance(s_newTargetPosUtm_1, seUtmPos); int dist = LtsCoordTrans::distance(s_newTargetPosUtm_1, seUtmPos);
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " dist = " << dist; NOTICE_LOG(m_logger) << LOGFUNCTION << " dist = " << dist;
} }
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " END"; NOTICE_LOG(m_logger) << LOGFUNCTION << " END";
} }
void ModuleTestExplosionCluster::test_vulcano_bldg_1104_withTargetModify2() void ModuleTestExplosionCluster::test_vulcano_bldg_1104_withTargetModify2()
{ {
if (m_traingAreaId != s_TraingAreaId_Altmark) if (m_traingAreaId != s_TraingAreaId_Altmark)
{ {
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " skip testcase due to m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " skip testcase due to m_traingAreaId = " << m_traingAreaId;
return; return;
} }
const QString bldgName(QStringLiteral("bldg_1104_VULCANO")); const QString bldgName(QStringLiteral("bldg_1104_VULCANO"));
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " START, m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " START, m_traingAreaId = " << m_traingAreaId;
QVERIFY2(checkParticipant_99(), "ERROR, checkParticipant_99 failed!!"); QVERIFY2(checkParticipant_99(), "ERROR, checkParticipant_99 failed!!");
@@ -2601,7 +2601,7 @@ void ModuleTestExplosionCluster::test_vulcano_bldg_1104_withTargetModify2()
const qint64 nowMsec = QDateTime::currentMSecsSinceEpoch(); const qint64 nowMsec = QDateTime::currentMSecsSinceEpoch();
const qint64 distMsec = startTimeMsec - nowMsec; const qint64 distMsec = startTimeMsec - nowMsec;
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " TIMER 1 " NOTICE_LOG(m_logger) << LOGFUNCTION << " TIMER 1 "
<< ", effectStart (impactTime) = " << startTimeMsec << ", effectStart (impactTime) = " << startTimeMsec
<< ", nowMsec = " << nowMsec << ", nowMsec = " << nowMsec
<< ", distMsec = " << distMsec; << ", distMsec = " << distMsec;
@@ -2612,7 +2612,7 @@ void ModuleTestExplosionCluster::test_vulcano_bldg_1104_withTargetModify2()
// Timer _BEFORE_ EffectStart // Timer _BEFORE_ EffectStart
const int delayMsec_1 = distMsec - offset; const int delayMsec_1 = distMsec - offset;
QTimer::singleShot(delayMsec_1, this, [this] () { // local static is captured implicit by gcc and for MSVS QTimer::singleShot(delayMsec_1, this, [this] () { // local static is captured implicit by gcc and for MSVS
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " TIMER 2 "; NOTICE_LOG(m_logger) << LOGFUNCTION << " TIMER 2 ";
QPointF newTargetPosGeo = s_newTargetPosUtm_1.geographic(); QPointF newTargetPosGeo = s_newTargetPosUtm_1.geographic();
// ^ // ^
@@ -2621,15 +2621,15 @@ void ModuleTestExplosionCluster::test_vulcano_bldg_1104_withTargetModify2()
request.aesItemId(m_data.id()); request.aesItemId(m_data.id());
request.positions().emplace_back(Core::GeoPosition(newTargetPosGeo.x(), newTargetPosGeo.y(), 123)); request.positions().emplace_back(Core::GeoPosition(newTargetPosGeo.x(), newTargetPosGeo.y(), 123));
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " TIMER 2, doExplosionClusterTargetPositionsModify ..."; NOTICE_LOG(m_logger) << LOGFUNCTION << " TIMER 2, doExplosionClusterTargetPositionsModify ...";
doExplosionClusterTargetPositionsModify(request); doExplosionClusterTargetPositionsModify(request);
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " TIMER 2, doExplosionClusterTargetPositionsModify ... DONE"; NOTICE_LOG(m_logger) << LOGFUNCTION << " TIMER 2, doExplosionClusterTargetPositionsModify ... DONE";
}); });
// Timer _AFTER_ EffectStart // Timer _AFTER_ EffectStart
const int delayMsec_2 = distMsec + offset; const int delayMsec_2 = distMsec + offset;
QTimer::singleShot(delayMsec_2, this, [this] () { // local static is captured implicit by gcc and for MSVS QTimer::singleShot(delayMsec_2, this, [this] () { // local static is captured implicit by gcc and for MSVS
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " TIMER 3 "; NOTICE_LOG(m_logger) << LOGFUNCTION << " TIMER 3 ";
QPointF newTargetPosGeo = s_newTargetPosUtm_2.geographic(); QPointF newTargetPosGeo = s_newTargetPosUtm_2.geographic();
// ^ // ^
@@ -2638,9 +2638,9 @@ void ModuleTestExplosionCluster::test_vulcano_bldg_1104_withTargetModify2()
request.aesItemId(m_data.id()); request.aesItemId(m_data.id());
request.positions().emplace_back(Core::GeoPosition(newTargetPosGeo.x(), newTargetPosGeo.y(), 124)); request.positions().emplace_back(Core::GeoPosition(newTargetPosGeo.x(), newTargetPosGeo.y(), 124));
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " TIMER 3, doExplosionClusterTargetPositionsModify ..."; NOTICE_LOG(m_logger) << LOGFUNCTION << " TIMER 3, doExplosionClusterTargetPositionsModify ...";
doExplosionClusterTargetPositionsModify(request); doExplosionClusterTargetPositionsModify(request);
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " TIMER 3, doExplosionClusterTargetPositionsModify ... DONE"; NOTICE_LOG(m_logger) << LOGFUNCTION << " TIMER 3, doExplosionClusterTargetPositionsModify ... DONE";
}); });
}); });
@@ -2670,7 +2670,7 @@ void ModuleTestExplosionCluster::test_vulcano_bldg_1104_withTargetModify2()
// compare with s_newTargetPosUtm_1, not s_newTargetPosUtm_2: // compare with s_newTargetPosUtm_1, not s_newTargetPosUtm_2:
int dist = LtsCoordTrans::distance(s_newTargetPosUtm_1, seUtmPos); int dist = LtsCoordTrans::distance(s_newTargetPosUtm_1, seUtmPos);
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " dist = " << dist; NOTICE_LOG(m_logger) << LOGFUNCTION << " dist = " << dist;
QVERIFY2(dist < 100, "ERROR, m_effects failed"); QVERIFY2(dist < 100, "ERROR, m_effects failed");
} }
@@ -2687,11 +2687,11 @@ void ModuleTestExplosionCluster::test_vulcano_bldg_1104_withTargetModify2()
const LtsCoordTrans::UtmCoordinate &bottomLeftUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(bottomLeftGeo.lon(), bottomLeftGeo.lat()); const LtsCoordTrans::UtmCoordinate &bottomLeftUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(bottomLeftGeo.lon(), bottomLeftGeo.lat());
const int distBL = LtsCoordTrans::distance(s_newTargetPosUtm_1, bottomLeftUtm); const int distBL = LtsCoordTrans::distance(s_newTargetPosUtm_1, bottomLeftUtm);
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " itemViewBoundary.dist = " << distBL; NOTICE_LOG(m_logger) << LOGFUNCTION << " itemViewBoundary.dist = " << distBL;
QVERIFY2(distBL < 100, "ERROR, itemViewBoundary failed"); QVERIFY2(distBL < 100, "ERROR, itemViewBoundary failed");
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " END"; NOTICE_LOG(m_logger) << LOGFUNCTION << " END";
} }
@@ -2741,7 +2741,7 @@ int main(int argc, char *argv[])
--argc; --argc;
const QStringList &slPositionalArgs = options.positionalArguments(); const QStringList &slPositionalArgs = options.positionalArguments();
for (const QString &item : std::as_const(slPositionalArgs)) for (const QString &item : qAsConst(slPositionalArgs))
std::cout << " item = " << item << std::endl; std::cout << " item = " << item << std::endl;
// enable_create_bulk only if it´s explicitly called by user: // enable_create_bulk only if it´s explicitly called by user:
@@ -21,11 +21,11 @@
#include <Plugins/ProjectDataManagement/pdm_data_plugin_interface.h> #include <Plugins/ProjectDataManagement/pdm_data_plugin_interface.h>
#include <ExerciseManagement/exm_dtc.h> #include <ExerciseManagement/exm_dtc.h>
#include <ParticipantManagement/ppm.hpp> #include <ParticipantManagement/ppm_dtc.h>
#include <ParticipantManagement/ppm_ftc.h> #include <ParticipantManagement/ppm_ftc.h>
#include <QtCore/QCoreApplication> #include <QCoreApplication>
#include <QtTest/QTest> #include <QtTest/QTest>
#include <memory> #include <memory>
@@ -59,8 +59,6 @@ public:
ModuleTestExplosionCluster(int domainId, int exerciseId); ModuleTestExplosionCluster(int domainId, int exerciseId);
protected: protected:
NGL::INGLLogger &m_logger;
void onSetSimulatedPositionReply(const Core::FunctionReplyObject &replyObject) override; void onSetSimulatedPositionReply(const Core::FunctionReplyObject &replyObject) override;
void onSetSimulatedParticipantFormationReply(const Core::FunctionReplyObject &replyObject) override; void onSetSimulatedParticipantFormationReply(const Core::FunctionReplyObject &replyObject) override;
void onExplosionClusterModifyReply(const Core::FunctionReplyObject &replyObject) override; void onExplosionClusterModifyReply(const Core::FunctionReplyObject &replyObject) override;
@@ -241,4 +239,6 @@ private:
} }
} }
m_counterDds; m_counterDds;
LOGGER_T m_logger;
}; };
@@ -12,12 +12,6 @@ SET(UnitTestSources
NGL_ADD_EXECUTABLE(SV aesModuleTestLimits ${LinkedSources} ${UnitTestSources} ) NGL_ADD_EXECUTABLE(SV aesModuleTestLimits ${LinkedSources} ${UnitTestSources} )
NGL_TARGET_INCLUDE_DIRECTORIES(aesModuleTestLimits
PUBLIC
${CMAKE_SOURCE_DIR}/Lts/
${CMAKE_SOURCE_DIR}/Lts/Services/
)
NGL_TARGET_LINK_LIBRARIES(aesModuleTestLimits NGL_TARGET_LINK_LIBRARIES(aesModuleTestLimits
NGLLogger NGLLogger
nglcoreapplication nglcoreapplication
@@ -7,19 +7,18 @@
*/ */
#include "limits_module_test.h" #include "limits_module_test.h"
#include <utility>
#include "qtestcase.h" #include "qtestcase.h"
#include <nglapplication/nglcoreapplication.h> #include <nglapplication/nglcoreapplication.h>
#include <LtsCoordTrans/lts_coord_trans.h> #include <LtsCoordTrans/lts_coord_trans.h>
// AES // AES
#include <AreaEffectSimulation/Utils/polygons.h> #include <AreaEffectSimulation/Utils/polygons.h>
#include <Core/core_types.h> #include <DDS/Core/function_reply_object.h>
#include <Core/core.hpp> #include <Core/core.hpp>
#include <QtCore/QTimer> #include <QTimer>
#include <QtCore/QDebug> #include <QDebug>
#include <iostream> #include <iostream>
@@ -39,6 +38,7 @@ static const int s_pauseTimeInSec = 5;
ModuleTestLimits::ModuleTestLimits(int domainId, int exerciseId) ModuleTestLimits::ModuleTestLimits(int domainId, int exerciseId)
: m_domainId(domainId) : m_domainId(domainId)
, m_exerciseId(exerciseId) , m_exerciseId(exerciseId)
, m_logger(getLogger("ModuleTestLimits"))
{ {
} }
@@ -71,7 +71,7 @@ void ModuleTestLimits::testExplosionClusterCentral()
int counter = 0; int counter = 0;
const auto &items = m_aesDtc->explosionClusters(); const auto &items = m_aesDtc->explosionClusters();
for (const auto &item : std::as_const(items)) for (const auto &item : qAsConst(items))
{ {
if (item.effectStateId() == AesEffectState::EsPrepared && item.isCentral() == true) if (item.effectStateId() == AesEffectState::EsPrepared && item.isCentral() == true)
++counter; ++counter;
@@ -104,7 +104,7 @@ void ModuleTestLimits::testExplosionClusterDecentral()
int counter = 0; int counter = 0;
const auto &items = m_aesDtc->explosionClusters(); const auto &items = m_aesDtc->explosionClusters();
for (const auto &item : std::as_const(items)) for (const auto &item : qAsConst(items))
{ {
if ((item.effectStateId() == AesEffectState::EsPrepared) && (item.isCentral() == false)) if ((item.effectStateId() == AesEffectState::EsPrepared) && (item.isCentral() == false))
++counter; ++counter;
@@ -140,7 +140,7 @@ void ModuleTestLimits::testAirSupports()
int counter = 0; int counter = 0;
const auto &items = m_aesDtc->explosionClusters(); const auto &items = m_aesDtc->explosionClusters();
for (const auto &item : std::as_const(items)) for (const auto &item : qAsConst(items))
{ {
if (item.effectStateId() == AesEffectState::EsPrepared && item.isCentral() && m_pdmDtc->gearClassFromChargeTypeId(item.chargeStruct().chargeTypeId()) == ProjectDataManagement::GearClass::AirSupport) if (item.effectStateId() == AesEffectState::EsPrepared && item.isCentral() && m_pdmDtc->gearClassFromChargeTypeId(item.chargeStruct().chargeTypeId()) == ProjectDataManagement::GearClass::AirSupport)
++counter; ++counter;
@@ -173,7 +173,7 @@ void ModuleTestLimits::testMineAreaCentral()
int counter = 0; int counter = 0;
const auto &items = m_aesDtc->mineAreas(); const auto &items = m_aesDtc->mineAreas();
for (const auto &item : std::as_const(items)) for (const auto &item : qAsConst(items))
{ {
if ((item.effectStateId() == AesEffectState::EsPrepared) && (item.isCentral() == true)) if ((item.effectStateId() == AesEffectState::EsPrepared) && (item.isCentral() == true))
++counter; ++counter;
@@ -207,7 +207,7 @@ void ModuleTestLimits::testMineAreaDecentral()
int counter = 0; int counter = 0;
const auto &items = m_aesDtc->mineAreas(); const auto &items = m_aesDtc->mineAreas();
for (const auto &curMineArea : std::as_const(items)) for (const auto &curMineArea : qAsConst(items))
{ {
if ((curMineArea.effectStateId() == AesEffectState::EsPrepared) && (curMineArea.isCentral() == false)) if ((curMineArea.effectStateId() == AesEffectState::EsPrepared) && (curMineArea.isCentral() == false))
++counter; ++counter;
@@ -234,7 +234,7 @@ void ModuleTestLimits::testMineAreaDecentral()
int counter2 = 0; int counter2 = 0;
const auto &mineAreas = m_aesDtc->mineAreas(); const auto &mineAreas = m_aesDtc->mineAreas();
for (const auto &item : std::as_const(mineAreas)) for (const auto &item : qAsConst(mineAreas))
{ {
if ((item.effectStateId() == AesEffectState::EsPrepared) && if ((item.effectStateId() == AesEffectState::EsPrepared) &&
!item.isCentral() && !item.isCentral() &&
@@ -270,7 +270,7 @@ void ModuleTestLimits::testNBCCentral()
int counter = 0; int counter = 0;
const auto &items = m_aesDtc->nContaminations(); const auto &items = m_aesDtc->nContaminations();
for (const auto &item : std::as_const(items)) for (const auto &item : qAsConst(items))
{ {
if (item.effectStateId() == AesEffectState::EsPrepared && item.isCentral() == true) if (item.effectStateId() == AesEffectState::EsPrepared && item.isCentral() == true)
++counter; ++counter;
@@ -305,7 +305,7 @@ void ModuleTestLimits::testNBCDecentral()
int counter = 0; int counter = 0;
const auto &items = m_aesDtc->nContaminations(); const auto &items = m_aesDtc->nContaminations();
for (const auto &item : std::as_const(items)) for (const auto &item : qAsConst(items))
{ {
if (item.effectStateId() == AesEffectState::EsPrepared && item.isCentral() == false) if (item.effectStateId() == AesEffectState::EsPrepared && item.isCentral() == false)
++counter; ++counter;
@@ -337,7 +337,7 @@ void ModuleTestLimits::testOffRouteMines()
int counter = 0; int counter = 0;
const auto &items = m_aesDtc->offRouteMines(); const auto &items = m_aesDtc->offRouteMines();
for (const auto &item : std::as_const(items)) for (const auto &item : qAsConst(items))
{ {
if (item.effectStateId() == AesEffectState::EsPrepared && item.isCentral() == true) if (item.effectStateId() == AesEffectState::EsPrepared && item.isCentral() == true)
++counter; ++counter;
@@ -369,7 +369,7 @@ void ModuleTestLimits::testBoobyTraps()
int counter = 0; int counter = 0;
const auto &items = m_aesDtc->boobyTraps(); const auto &items = m_aesDtc->boobyTraps();
for (const auto &item : std::as_const(items)) for (const auto &item : qAsConst(items))
{ {
if (item.effectStateId() == AesEffectState::EsPrepared && item.isCentral() == true) if (item.effectStateId() == AesEffectState::EsPrepared && item.isCentral() == true)
++counter; ++counter;
@@ -404,7 +404,7 @@ void ModuleTestLimits::testBCCCentral()
int counter = 0; int counter = 0;
const auto &items = m_aesDtc->bCContaminations(); const auto &items = m_aesDtc->bCContaminations();
for (const auto &item : std::as_const(items)) for (const auto &item : qAsConst(items))
{ {
if (item.effectStateId() == AesEffectState::EsPrepared && item.isCentral() == true) if (item.effectStateId() == AesEffectState::EsPrepared && item.isCentral() == true)
++counter; ++counter;
@@ -439,7 +439,7 @@ void ModuleTestLimits::testBCCDecentral()
int counter = 0; int counter = 0;
const auto &items = m_aesDtc->bCContaminations(); const auto &items = m_aesDtc->bCContaminations();
for (const auto &item : std::as_const(items)) for (const auto &item : qAsConst(items))
{ {
if (item.effectStateId() == AesEffectState::EsPrepared && item.isCentral() == false) if (item.effectStateId() == AesEffectState::EsPrepared && item.isCentral() == false)
++counter; ++counter;
@@ -474,7 +474,7 @@ void ModuleTestLimits::testFADecentral()
int counter = 0; int counter = 0;
const auto &items = m_aesDtc->functionalAreas(); const auto &items = m_aesDtc->functionalAreas();
for (const auto &item : std::as_const(items)) for (const auto &item : qAsConst(items))
{ {
if (item.effectStateId() == AesEffectState::EsPrepared && item.isCentral() == false) if (item.effectStateId() == AesEffectState::EsPrepared && item.isCentral() == false)
++counter; ++counter;
@@ -511,7 +511,7 @@ void ModuleTestLimits::testFACentral()
int counter = 0; int counter = 0;
const auto &items = m_aesDtc->functionalAreas(); const auto &items = m_aesDtc->functionalAreas();
for (const auto &item : std::as_const(items)) for (const auto &item : qAsConst(items))
{ {
if (item.effectStateId() == AesEffectState::EsPrepared && item.isCentral() == true) if (item.effectStateId() == AesEffectState::EsPrepared && item.isCentral() == true)
++counter; ++counter;
@@ -1192,7 +1192,7 @@ void ModuleTestLimits::deleteAesAreas()
const QVector<AesEffectState::type> sts = {AesEffectState::EsExpired, AesEffectState::EsRemoved, AesEffectState::EsActivated}; const QVector<AesEffectState::type> sts = {AesEffectState::EsExpired, AesEffectState::EsRemoved, AesEffectState::EsActivated};
auto clusters = m_aesDtc->explosionClusters(); auto clusters = m_aesDtc->explosionClusters();
for (auto cluster : std::as_const(clusters)) for (auto cluster : qAsConst(clusters))
{ {
if (!sts.contains(cluster.effectStateId().underlying())) if (!sts.contains(cluster.effectStateId().underlying()))
{ {
@@ -1202,7 +1202,7 @@ void ModuleTestLimits::deleteAesAreas()
} }
} }
auto nbcs = m_aesDtc->nContaminations(); auto nbcs = m_aesDtc->nContaminations();
for (auto nbc : std::as_const(nbcs)) for (auto nbc : qAsConst(nbcs))
{ {
if (!sts.contains(nbc.effectStateId().underlying())) if (!sts.contains(nbc.effectStateId().underlying()))
{ {
@@ -1212,7 +1212,7 @@ void ModuleTestLimits::deleteAesAreas()
} }
} }
auto orms = m_aesDtc->offRouteMines(); auto orms = m_aesDtc->offRouteMines();
for (auto orm : std::as_const(orms)) for (auto orm : qAsConst(orms))
{ {
if (!sts.contains(orm.effectStateId().underlying())) if (!sts.contains(orm.effectStateId().underlying()))
{ {
@@ -1222,7 +1222,7 @@ void ModuleTestLimits::deleteAesAreas()
} }
} }
auto bts = m_aesDtc->boobyTraps(); auto bts = m_aesDtc->boobyTraps();
for (auto bt : std::as_const(bts)) for (auto bt : qAsConst(bts))
{ {
if (!sts.contains(bt.effectStateId().underlying())) if (!sts.contains(bt.effectStateId().underlying()))
{ {
@@ -1232,7 +1232,7 @@ void ModuleTestLimits::deleteAesAreas()
} }
} }
auto mas = m_aesDtc->mineAreas(); auto mas = m_aesDtc->mineAreas();
for (auto ma : std::as_const(mas)) for (auto ma : qAsConst(mas))
{ {
if (!sts.contains(ma.effectStateId().underlying())) if (!sts.contains(ma.effectStateId().underlying()))
{ {
@@ -1242,7 +1242,7 @@ void ModuleTestLimits::deleteAesAreas()
} }
} }
auto bccs = m_aesDtc->bCContaminations(); auto bccs = m_aesDtc->bCContaminations();
for (auto bcc : std::as_const(bccs)) for (auto bcc : qAsConst(bccs))
{ {
if (!sts.contains(bcc.effectStateId().underlying())) if (!sts.contains(bcc.effectStateId().underlying()))
{ {
@@ -1252,7 +1252,7 @@ void ModuleTestLimits::deleteAesAreas()
} }
} }
auto fas = m_aesDtc->functionalAreas(); auto fas = m_aesDtc->functionalAreas();
for (auto fa : std::as_const(fas)) for (auto fa : qAsConst(fas))
{ {
if (!sts.contains(fa.effectStateId().underlying())) if (!sts.contains(fa.effectStateId().underlying()))
{ {
@@ -1262,7 +1262,7 @@ void ModuleTestLimits::deleteAesAreas()
} }
} }
auto tas = m_aesDtc->technicalAreas(); auto tas = m_aesDtc->technicalAreas();
for (auto ta : std::as_const(tas)) for (auto ta : qAsConst(tas))
{ {
if (!sts.contains(ta.effectStateId().underlying())) if (!sts.contains(ta.effectStateId().underlying()))
{ {
@@ -1273,7 +1273,7 @@ void ModuleTestLimits::deleteAesAreas()
} }
auto eas = m_aesDtc->explosionAreas(); auto eas = m_aesDtc->explosionAreas();
for (auto ea : std::as_const(eas)) for (auto ea : qAsConst(eas))
{ {
if (!sts.contains(ea.effectStateId().underlying())) if (!sts.contains(ea.effectStateId().underlying()))
{ {
@@ -1284,7 +1284,7 @@ void ModuleTestLimits::deleteAesAreas()
} }
auto ess = m_aesDtc->explosionSingles(); auto ess = m_aesDtc->explosionSingles();
for (auto es : std::as_const(ess)) for (auto es : qAsConst(ess))
{ {
if (!sts.contains(es.effectStateId().underlying())) if (!sts.contains(es.effectStateId().underlying()))
{ {
@@ -1360,7 +1360,7 @@ int main(int argc, char *argv[])
const QStringList &slPositionalArgs = options.positionalArguments(); const QStringList &slPositionalArgs = options.positionalArguments();
for (const QString &item : std::as_const(slPositionalArgs)) for (const QString &item : qAsConst(slPositionalArgs))
std::cout << " item = " << item << std::endl; std::cout << " item = " << item << std::endl;
// enable_create_bulk only if it´s explicitly called by user: // enable_create_bulk only if it´s explicitly called by user:
@@ -19,12 +19,12 @@
#include <ExerciseManagement/exm_dtc.h> #include <ExerciseManagement/exm_dtc.h>
#include <InfrastructureManagement/ism_dtc.h> #include <InfrastructureManagement/ism_dtc.h>
#include <ParticipantManagement/ppm.hpp> #include <ParticipantManagement/ppm_dtc.h>
#include <ProjectDataManagement/pdm_dtc.h> #include <ProjectDataManagement/pdm_dtc.h>
#include <ParticipantManagement/ppm_ftc.h> #include <ParticipantManagement/ppm_ftc.h>
#include <QtCore/QCoreApplication> #include <QCoreApplication>
#include <QtTest/QTest> #include <QtTest/QTest>
#include <memory> #include <memory>
@@ -224,6 +224,9 @@ private:
} }
} }
m_counterDds; m_counterDds;
LOGGER_T m_logger;
public: public:
void onMineAreaModifyReply(const Core::FunctionReplyObject &reply) override { Q_UNUSED(reply);} void onMineAreaModifyReply(const Core::FunctionReplyObject &reply) override { Q_UNUSED(reply);}
void onExplosionAreaModifyReply(const Core::FunctionReplyObject &reply) override { Q_UNUSED(reply);} void onExplosionAreaModifyReply(const Core::FunctionReplyObject &reply) override { Q_UNUSED(reply);}
@@ -13,12 +13,6 @@ SET(UnitTestSources
IF(BUILD_TESTING) IF(BUILD_TESTING)
ADD_EXECUTABLE(aesModuleTestOthers ${LinkedSources} ${UnitTestSources} ) ADD_EXECUTABLE(aesModuleTestOthers ${LinkedSources} ${UnitTestSources} )
NGL_TARGET_INCLUDE_DIRECTORIES(aesModuleTestOthers
PUBLIC
${CMAKE_SOURCE_DIR}/Lts/
${CMAKE_SOURCE_DIR}/Lts/Services/
)
TARGET_LINK_LIBRARIES(aesModuleTestOthers TARGET_LINK_LIBRARIES(aesModuleTestOthers
NGLLogger NGLLogger
nglcoreapplication nglcoreapplication
@@ -7,7 +7,6 @@
*/ */
#include "aes_others_module_test.h" #include "aes_others_module_test.h"
#include <utility>
#include <nglapplication/nglcoreapplication.h> #include <nglapplication/nglcoreapplication.h>
#include <LtsCoordTrans/lts_coord_trans.h> #include <LtsCoordTrans/lts_coord_trans.h>
@@ -17,8 +16,8 @@
#include <AreaEffectSimulation/Utils/polygons.h> #include <AreaEffectSimulation/Utils/polygons.h>
#include <QtCore/QTimer> #include <QTimer>
#include <QtCore/QDebug> #include <QDebug>
#include <iostream> #include <iostream>
@@ -73,6 +72,7 @@ double distanceMeter(const Core::GeoPosition2D &geoPos2D, const LtsCoordTrans::U
ModuleTestAesOthers::ModuleTestAesOthers(int domainId, int exerciseId) ModuleTestAesOthers::ModuleTestAesOthers(int domainId, int exerciseId)
: m_domainId(domainId) : m_domainId(domainId)
, m_exerciseId(exerciseId) , m_exerciseId(exerciseId)
, m_logger(getLogger("ModuleTestAesOthers"))
{ {
} }
@@ -177,7 +177,7 @@ void ModuleTestAesOthers::onAesItemViewChanged(const AesItemView &aesItemView, D
void ModuleTestAesOthers::dumpCnt() void ModuleTestAesOthers::dumpCnt()
{ {
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " Counter: " NOTICE_LOG(m_logger) << LOGFUNCTION << " Counter: "
<< " cntBoobyTrap = " << m_counterDds.cntBoobyTrap << " cntBoobyTrap = " << m_counterDds.cntBoobyTrap
<< " cntOffRouteMine = " << m_counterDds.cntOffRouteMine << " cntOffRouteMine = " << m_counterDds.cntOffRouteMine
<< ", cntItemView = " << m_counterDds.cntItemView; << ", cntItemView = " << m_counterDds.cntItemView;
@@ -214,7 +214,7 @@ void ModuleTestAesOthers::waitForEffectStatesBT(int lineNumber, int durPrep, int
return; return;
} }
INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for EsPrepared..."; INFO_LOG(m_logger) << LOGFUNCTION << " waiting for EsPrepared...";
if (!waitForData([this]() { return m_dataBoobyTrap.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsPrepared;}, durPrep)) if (!waitForData([this]() { return m_dataBoobyTrap.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsPrepared;}, durPrep))
{ {
ERROR_LOG(m_logger) << "Timeout waiting for EsPrepared of m_dataBoobyTrap with id " << m_dataBoobyTrap.id() ERROR_LOG(m_logger) << "Timeout waiting for EsPrepared of m_dataBoobyTrap with id " << m_dataBoobyTrap.id()
@@ -223,7 +223,7 @@ void ModuleTestAesOthers::waitForEffectStatesBT(int lineNumber, int durPrep, int
return; return;
} }
INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for EsActivated..."; INFO_LOG(m_logger) << LOGFUNCTION << " waiting for EsActivated...";
if (!waitForData([this]() { return m_dataBoobyTrap.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated;}, durAct)) if (!waitForData([this]() { return m_dataBoobyTrap.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated;}, durAct))
{ {
ERROR_LOG(m_logger) << "Timeout waiting for EsActivated of m_dataBoobyTrapr with id " << m_dataBoobyTrap.id() ERROR_LOG(m_logger) << "Timeout waiting for EsActivated of m_dataBoobyTrapr with id " << m_dataBoobyTrap.id()
@@ -234,7 +234,7 @@ void ModuleTestAesOthers::waitForEffectStatesBT(int lineNumber, int durPrep, int
if (durExp > 0) if (durExp > 0)
{ {
INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for EsExpired..."; INFO_LOG(m_logger) << LOGFUNCTION << " waiting for EsExpired...";
if (!waitForData([this]() { return m_dataBoobyTrap.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired;}, durExp)) if (!waitForData([this]() { return m_dataBoobyTrap.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired;}, durExp))
{ {
ERROR_LOG(m_logger) << "Timeout waiting for EsExpired of m_dataBoobyTrap with id " << m_dataBoobyTrap.id() ERROR_LOG(m_logger) << "Timeout waiting for EsExpired of m_dataBoobyTrap with id " << m_dataBoobyTrap.id()
@@ -254,7 +254,7 @@ void ModuleTestAesOthers::waitForEffectStatesORM(int lineNumber, int durPrep, in
return; return;
} }
INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for EsPrepared..."; INFO_LOG(m_logger) << LOGFUNCTION << " waiting for EsPrepared...";
if (!waitForData([this]() { return m_dataOffRouteMine.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsPrepared;}, durPrep)) if (!waitForData([this]() { return m_dataOffRouteMine.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsPrepared;}, durPrep))
{ {
ERROR_LOG(m_logger) << "Timeout waiting for EsPrepared of m_dataOffRouteMine with id " << m_dataOffRouteMine.id() ERROR_LOG(m_logger) << "Timeout waiting for EsPrepared of m_dataOffRouteMine with id " << m_dataOffRouteMine.id()
@@ -263,7 +263,7 @@ void ModuleTestAesOthers::waitForEffectStatesORM(int lineNumber, int durPrep, in
return; return;
} }
INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for EsActivated..."; INFO_LOG(m_logger) << LOGFUNCTION << " waiting for EsActivated...";
if (!waitForData([this]() { return m_dataOffRouteMine.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated;}, durAct)) if (!waitForData([this]() { return m_dataOffRouteMine.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated;}, durAct))
{ {
ERROR_LOG(m_logger) << "Timeout waiting for EsActivated of m_dataOffRouteMine with id " << m_dataOffRouteMine.id() ERROR_LOG(m_logger) << "Timeout waiting for EsActivated of m_dataOffRouteMine with id " << m_dataOffRouteMine.id()
@@ -274,7 +274,7 @@ void ModuleTestAesOthers::waitForEffectStatesORM(int lineNumber, int durPrep, in
if (durExp > 0) if (durExp > 0)
{ {
INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for EsExpired..."; INFO_LOG(m_logger) << LOGFUNCTION << " waiting for EsExpired...";
if (!waitForData([this]() { return m_dataOffRouteMine.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired;}, durExp)) if (!waitForData([this]() { return m_dataOffRouteMine.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired;}, durExp))
{ {
ERROR_LOG(m_logger) << "Timeout waiting for EsExpired of m_dataOffRouteMine with id " << m_dataOffRouteMine.id() ERROR_LOG(m_logger) << "Timeout waiting for EsExpired of m_dataOffRouteMine with id " << m_dataOffRouteMine.id()
@@ -529,9 +529,9 @@ void ModuleTestAesOthers::init()
void ModuleTestAesOthers::test_justSetupParticipants() void ModuleTestAesOthers::test_justSetupParticipants()
{ {
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " START"; NOTICE_LOG(m_logger) << LOGFUNCTION << " START";
setupParticipants(); setupParticipants();
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " END"; NOTICE_LOG(m_logger) << LOGFUNCTION << " END";
} }
// //
@@ -541,11 +541,11 @@ void ModuleTestAesOthers::test_boobyTrap_01()
{ {
if (m_traingAreaId != s_TraingAreaId_Altmark) if (m_traingAreaId != s_TraingAreaId_Altmark)
{ {
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " skip testcase due to m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " skip testcase due to m_traingAreaId = " << m_traingAreaId;
return; return;
} }
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " START, m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " START, m_traingAreaId = " << m_traingAreaId;
QVERIFY2(checkParticipant_18(), "ERROR, checkParticipant_5 failed!!"); QVERIFY2(checkParticipant_18(), "ERROR, checkParticipant_5 failed!!");
AreaEffectSimulation::BoobyTrap bt; AreaEffectSimulation::BoobyTrap bt;
@@ -595,7 +595,7 @@ void ModuleTestAesOthers::test_boobyTrap_01()
// wait to let it disappear: // wait to let it disappear:
waitForData([]() { return false; }, 15); waitForData([]() { return false; }, 15);
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " END"; NOTICE_LOG(m_logger) << LOGFUNCTION << " END";
} }
@@ -606,11 +606,11 @@ void ModuleTestAesOthers::test_boobyTrap_02_IMPL(const QString &name,
{ {
if (m_traingAreaId != s_TraingAreaId_Altmark) if (m_traingAreaId != s_TraingAreaId_Altmark)
{ {
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " skip testcase due to m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " skip testcase due to m_traingAreaId = " << m_traingAreaId;
return; return;
} }
INFO_LOG(m_logger) << Q_FUNC_INFO << " START, m_traingAreaId = " << m_traingAreaId INFO_LOG(m_logger) << LOGFUNCTION << " START, m_traingAreaId = " << m_traingAreaId
<< ", name =" << name << "'" << ", name =" << name << "'"
<< ", impactCoord= " << impactCoord.mgrs() << ", impactCoord= " << impactCoord.mgrs()
<< ", rotationAngle = " << rotationAngle << ", rotationAngle = " << rotationAngle
@@ -666,7 +666,7 @@ void ModuleTestAesOthers::test_boobyTrap_02_IMPL(const QString &name,
// wait to let it disappear: // wait to let it disappear:
waitForData([]() { return false; }, 15); waitForData([]() { return false; }, 15);
INFO_LOG(m_logger) << Q_FUNC_INFO << " END" INFO_LOG(m_logger) << LOGFUNCTION << " END"
<< ", name =" << name << "'" << ", name =" << name << "'"
<< ", impactCoord= " << impactCoord.mgrs() << ", impactCoord= " << impactCoord.mgrs()
<< ", rotationAngle = " << rotationAngle << ", rotationAngle = " << rotationAngle
@@ -709,11 +709,11 @@ void ModuleTestAesOthers::test_offRouteMine_02()
{ {
if (m_traingAreaId != s_TraingAreaId_Altmark) if (m_traingAreaId != s_TraingAreaId_Altmark)
{ {
NOTICE_LOG(m_logger) << Q_FUNC_INFO << " skip testcase due to m_traingAreaId = " << m_traingAreaId; NOTICE_LOG(m_logger) << LOGFUNCTION << " skip testcase due to m_traingAreaId = " << m_traingAreaId;
return; return;
} }
INFO_LOG(m_logger) << Q_FUNC_INFO << " START, m_traingAreaId = " << m_traingAreaId; INFO_LOG(m_logger) << LOGFUNCTION << " START, m_traingAreaId = " << m_traingAreaId;
QVERIFY2(checkParticipant_18(), "ERROR, checkParticipant_5 failed!!"); QVERIFY2(checkParticipant_18(), "ERROR, checkParticipant_5 failed!!");
@@ -767,7 +767,7 @@ void ModuleTestAesOthers::test_offRouteMine_02()
// wait to let it disappear: // wait to let it disappear:
waitForData([]() { return false; }, 15); waitForData([]() { return false; }, 15);
INFO_LOG(m_logger) << Q_FUNC_INFO << " END" << ", name =" << orm.name() << "'"; INFO_LOG(m_logger) << LOGFUNCTION << " END" << ", name =" << orm.name() << "'";
} }
void ModuleTestAesOthers::cleanupTestCase() void ModuleTestAesOthers::cleanupTestCase()
@@ -812,7 +812,7 @@ int main(int argc, char *argv[])
--argc; --argc;
const QStringList &slPositionalArgs = options.positionalArguments(); const QStringList &slPositionalArgs = options.positionalArguments();
for (const QString &item : std::as_const(slPositionalArgs)) for (const QString &item : qAsConst(slPositionalArgs))
std::cout << " item = " << item << std::endl; std::cout << " item = " << item << std::endl;
// // enable_create_bulk only if it´s explicitly called by user: // // enable_create_bulk only if it´s explicitly called by user:
@@ -19,11 +19,11 @@
#include <Plugins/ProjectDataManagement/pdm_data_plugin_interface.h> #include <Plugins/ProjectDataManagement/pdm_data_plugin_interface.h>
#include <ExerciseManagement/exm_dtc.h> #include <ExerciseManagement/exm_dtc.h>
#include <ParticipantManagement/ppm.hpp> #include <ParticipantManagement/ppm_dtc.h>
#include <ParticipantManagement/ppm_ftc.h> #include <ParticipantManagement/ppm_ftc.h>
#include <QtCore/QCoreApplication> #include <QCoreApplication>
#include <QtTest/QTest> #include <QtTest/QTest>
#include <memory> #include <memory>
@@ -54,8 +54,6 @@ public:
ModuleTestAesOthers(int domainId, int exerciseId); ModuleTestAesOthers(int domainId, int exerciseId);
protected: protected:
NGL::INGLLogger &m_logger;
void onSetSimulatedPositionReply(const Core::FunctionReplyObject &replyObject) override; void onSetSimulatedPositionReply(const Core::FunctionReplyObject &replyObject) override;
void onBoobyTrapModifyReply(const Core::FunctionReplyObject &replyObject) override; void onBoobyTrapModifyReply(const Core::FunctionReplyObject &replyObject) override;
@@ -171,4 +169,6 @@ private:
} }
} }
m_counterDds; m_counterDds;
LOGGER_T m_logger;
}; };
@@ -7,8 +7,8 @@
#include "aes_convert_mine_area.h" #include "aes_convert_mine_area.h"
#include <QtCore/QTimer> #include <QTimer>
#include <QtCore/QLineF> #include <QLineF>
#include <nglapplication/nglcoreapplication.h> #include <nglapplication/nglcoreapplication.h>
#include <LtsCommandLineParser/LtsCommandLineParser.h> #include <LtsCommandLineParser/LtsCommandLineParser.h>
@@ -17,7 +17,7 @@
#include <ngldb/dbconnection.h> #include <ngldb/dbconnection.h>
#include <ngldb/sql_query_janitor.h> #include <ngldb/sql_query_janitor.h>
#include <QtSql/QSqlError> #include <QtSql/QSqlError>
#include <QtCore/QVariant> #include <QVariant>
#include <AreaEffectSimulation/aes_db_structs.h> #include <AreaEffectSimulation/aes_db_structs.h>
@@ -9,8 +9,8 @@
#include "aes_test_base.h" #include "aes_test_base.h"
#include <QtSql/QSqlDriver> #include <QSqlDriver>
#include <QtSql/QSqlDatabase> #include <QSqlDatabase>
#include <QtSql/QSqlError> #include <QtSql/QSqlError>
#include <AreaEffectSimulation/aes_enums.hpp> #include <AreaEffectSimulation/aes_enums.hpp>
@@ -47,8 +47,6 @@ public:
QSqlError getLastError() const; QSqlError getLastError() const;
private: private:
NGL::INGLLogger &m_logger;
QSqlDatabase m_dbConnection; QSqlDatabase m_dbConnection;
NSqlQuery *m_query; NSqlQuery *m_query;
QSqlError m_lastError; QSqlError m_lastError;
@@ -56,6 +54,10 @@ NGL::INGLLogger &m_logger;
bool m_bEmitMessageOnError; bool m_bEmitMessageOnError;
bool m_bCanHandleSchemas; bool m_bCanHandleSchemas;
bool m_ownDatabaseConnection; bool m_ownDatabaseConnection;
LOGGER_T m_logger;
}; };
} // namespace AreaEffectSimulation } // namespace AreaEffectSimulation
@@ -6,9 +6,9 @@
*/ */
#include "aes_test_air_support_impact.h" #include "aes_test_air_support_impact.h"
#include <QtCore/QCoreApplication> #include <QCoreApplication>
#include <QtTest/QTest> #include <QTest>
#include <QtCore/QTimer> #include <QTimer>
namespace AreaEffectSimulation namespace AreaEffectSimulation
{ {
@@ -8,7 +8,7 @@
#include "aes_test_base.h" #include "aes_test_base.h"
#include <nglapplication/nglcoreapplication.h> #include <nglapplication/nglcoreapplication.h>
#include <LtsCommandLineParser/LtsCommandLineParser.h> #include <LtsCommandLineParser/LtsCommandLineParser.h>
#include <QtCore/QTimer> #include <QTimer>
#include <QtTest/QTest> #include <QtTest/QTest>
namespace AreaEffectSimulation namespace AreaEffectSimulation
@@ -10,11 +10,11 @@
#include <AreaEffectSimulation/aes_ftc.h> #include <AreaEffectSimulation/aes_ftc.h>
#include <AreaEffectSimulation/aes_dtc.h> #include <AreaEffectSimulation/aes_dtc.h>
#include <AreaEffectSimulation/logger.h> #include <AreaEffectSimulation/logger.h>
#include <QtCore/QObject> #include <QObject>
#include <DDS/DDSConnector/dds_connector.h> #include <DDS/DDSConnector/dds_connector.h>
#include <memory> #include <memory>
#include "aes_test_base_export.h" #include <AreaEffectSimulation/aes_test_base_export.h>
namespace AreaEffectSimulation namespace AreaEffectSimulation
{ {
@@ -73,6 +73,8 @@ protected:
bool m_bTestsSuccessful; bool m_bTestsSuccessful;
int m_testId; int m_testId;
QString m_aesTypeName; QString m_aesTypeName;
LOGGER_T m_logger;
}; };
int AES_TEST_BASE_EXPORT mainBase(int argc, char **argv, int AES_TEST_BASE_EXPORT mainBase(int argc, char **argv,
@@ -6,9 +6,9 @@
*/ */
#include "aes_test_bccontamination.h" #include "aes_test_bccontamination.h"
#include <QtCore/QCoreApplication> #include <QCoreApplication>
#include <QtTest/QTest> #include <QTest>
#include <QtCore/QTimer> #include <QTimer>
namespace AreaEffectSimulation namespace AreaEffectSimulation
{ {
@@ -6,9 +6,9 @@
*/ */
#include "aes_test_booby_trap.h" #include "aes_test_booby_trap.h"
#include <QtCore/QCoreApplication> #include <QCoreApplication>
#include <QtTest/QTest> #include <QTest>
#include <QtCore/QTimer> #include <QTimer>
namespace AreaEffectSimulation namespace AreaEffectSimulation
{ {
@@ -6,9 +6,9 @@
*/ */
#include "aes_test_charge_administration.h" #include "aes_test_charge_administration.h"
#include <QtCore/QCoreApplication> #include <QCoreApplication>
#include <QtTest/QTest> #include <QTest>
#include <QtCore/QTimer> #include <QTimer>
namespace AreaEffectSimulation namespace AreaEffectSimulation
{ {
@@ -6,9 +6,9 @@
*/ */
#include "aes_test_danger_area.h" #include "aes_test_danger_area.h"
#include <QtCore/QCoreApplication> #include <QCoreApplication>
#include <QtTest/QTest> #include <QTest>
#include <QtCore/QTimer> #include <QTimer>
namespace AreaEffectSimulation namespace AreaEffectSimulation
{ {
@@ -6,9 +6,9 @@
*/ */
#include "aes_test_explosion_area.h" #include "aes_test_explosion_area.h"
#include <QtCore/QCoreApplication> #include <QCoreApplication>
#include <QtCore/QTimer> #include <QTimer>
#include <QtTest/QTest> #include <QTest>
namespace AreaEffectSimulation namespace AreaEffectSimulation
{ {
@@ -7,9 +7,9 @@
*/ */
#include "aes_test_explosion_area_bulk.h" #include "aes_test_explosion_area_bulk.h"
#include <QtCore/QCoreApplication> #include <QCoreApplication>
#include <QtCore/QTimer> #include <QTimer>
#include <QtTest/QTest> #include <QTest>
namespace AreaEffectSimulation namespace AreaEffectSimulation
{ {
@@ -8,9 +8,9 @@
#include "aes_test_explosion_cluster.h" #include "aes_test_explosion_cluster.h"
#include <ProjectDataManagement/pdm.hpp> #include <ProjectDataManagement/pdm.hpp>
#include <QtCore/QCoreApplication> #include <QCoreApplication>
#include <QtCore/QTimer> #include <QTimer>
#include <QtTest/QTest> #include <QTest>
namespace AreaEffectSimulation namespace AreaEffectSimulation
{ {
@@ -6,9 +6,9 @@
*/ */
#include "aes_test_explosion_single.h" #include "aes_test_explosion_single.h"
#include <QtCore/QCoreApplication> #include <QCoreApplication>
#include <QtTest/QTest> #include <QTest>
#include <QtCore/QTimer> #include <QTimer>
namespace AreaEffectSimulation namespace AreaEffectSimulation
{ {
@@ -6,9 +6,9 @@
*/ */
#include "aes_test_gas_pipe.h" #include "aes_test_gas_pipe.h"
#include <QtCore/QCoreApplication> #include <QCoreApplication>
#include <QtTest/QTest> #include <QTest>
#include <QtCore/QTimer> #include <QTimer>
namespace AreaEffectSimulation namespace AreaEffectSimulation
{ {
@@ -9,7 +9,7 @@
#include "aes_test_base.h" #include "aes_test_base.h"
#include <LtsCoordTrans/lts_coord_trans.h> #include <LtsCoordTrans/lts_coord_trans.h>
#include <QtCore/QPointF> #include <QPointF>
namespace AreaEffectSimulation namespace AreaEffectSimulation
{ {
@@ -8,10 +8,10 @@
#include "aes_test_mine_area.h" #include "aes_test_mine_area.h"
#include "Utils/polygons.h" #include "Utils/polygons.h"
#include "qjsonobject.h" #include "qjsonobject.h"
#include <QtCore/QCoreApplication> #include <QCoreApplication>
#include <QtCore/QJsonDocument> #include <QJsonDocument>
#include <QtTest/QTest> #include <QTest>
#include <QtCore/QTimer> #include <QTimer>
#include <LtsCoordTrans/lts_coord_trans.h> #include <LtsCoordTrans/lts_coord_trans.h>
namespace AreaEffectSimulation namespace AreaEffectSimulation
@@ -6,9 +6,9 @@
*/ */
#include "aes_test_ncontamination.h" #include "aes_test_ncontamination.h"
#include <QtCore/QCoreApplication> #include <QCoreApplication>
#include <QtTest/QTest> #include <QTest>
#include <QtCore/QTimer> #include <QTimer>
namespace AreaEffectSimulation namespace AreaEffectSimulation
{ {
@@ -6,9 +6,9 @@
*/ */
#include "aes_test_off_route_mine.h" #include "aes_test_off_route_mine.h"
#include <QtCore/QCoreApplication> #include <QCoreApplication>
#include <QtTest/QTest> #include <QTest>
#include <QtCore/QTimer> #include <QTimer>
namespace AreaEffectSimulation namespace AreaEffectSimulation
{ {
@@ -20,7 +20,6 @@ NGL_ADD_LIBRARY2(WS SV HLA Trajectory SHARED
) )
NGL_TARGET_INCLUDE_DIRECTORIES(Trajectory NGL_TARGET_INCLUDE_DIRECTORIES(Trajectory
INTERFACE INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}/../../
${CMAKE_CURRENT_SOURCE_DIR}/../ ${CMAKE_CURRENT_SOURCE_DIR}/../
) )
NGL_TARGET_LINK_LIBRARIES(Trajectory NGL_TARGET_LINK_LIBRARIES(Trajectory
@@ -15,22 +15,12 @@ SET(UnitTestSources
) )
IF(BUILD_TESTING) IF(BUILD_TESTING)
NGL_ADD_EXECUTABLE(SV aesUnitTestTrajectory ${LinkedSources} ${UnitTestSources} ) ADD_EXECUTABLE(aesUnitTestTrajectory ${LinkedSources} ${UnitTestSources} )
NGL_TARGET_INCLUDE_DIRECTORIES(aesUnitTestTrajectory
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/../../
${CMAKE_SOURCE_DIR}/Lts/Services/AreaEffectSimulation
${CMAKE_SOURCE_DIR}/Lts/
${CMAKE_SOURCE_DIR}/Lts/Services/
${CMAKE_BINARY_DIR}/Lts/
)
TARGET_LINK_LIBRARIES(aesUnitTestTrajectory TARGET_LINK_LIBRARIES(aesUnitTestTrajectory
NGLLogger NGLLogger
nglcoreapplication nglcoreapplication
svcAesCommon svcAesCommon
Trajectory
Qt6::Core Qt6::Core
Qt6::Gui Qt6::Gui
Qt6::Test) Qt6::Test)
@@ -7,7 +7,6 @@
*/ */
#include "trajectory_unit_test.h" #include "trajectory_unit_test.h"
#include <utility>
#include <Trajectory/trajectory_helper.h> #include <Trajectory/trajectory_helper.h>
#include <Trajectory/trajectory_generator.h> #include <Trajectory/trajectory_generator.h>
#include <Trajectory/trajectory_generator_vulcano.h> #include <Trajectory/trajectory_generator_vulcano.h>
@@ -16,7 +15,7 @@
#include <nglapplication/nglcoreapplication.h> #include <nglapplication/nglcoreapplication.h>
#include <NGLLogger/NGLLoggerBootstrap.h> #include <NGLLogger/NGLLoggerBootstrap.h>
#include <QtTest/QTest> #include <QtTest/QTest>
#include <LtsUtils/LtsUtilsCore/qpoint3d.h> #include <LtsUtilsCore/qpoint3d.h>
#include <LtsCoordTrans/lts_coord_trans.h> #include <LtsCoordTrans/lts_coord_trans.h>
#include <iostream> #include <iostream>
@@ -992,7 +991,7 @@ void UnitTestTrajectory::test_vulcano_trajectory()
} }
int i=0; int i=0;
for (auto &item : std::as_const(trajectoryOut)) for (auto &item : qAsConst(trajectoryOut))
INFO_LOG(m_logger) << "i = " << i++ << ", item " << item; INFO_LOG(m_logger) << "i = " << i++ << ", item " << item;
} }
@@ -8,7 +8,7 @@
#pragma once #pragma once
#include <QtCore/QCoreApplication> #include <QCoreApplication>
#include <QtTest/QTest> #include <QtTest/QTest>
#include <NGLLogger/INGLLogger.h> #include <NGLLogger/INGLLogger.h>
@@ -78,5 +78,6 @@ private Q_SLOTS:
private: private:
NGL::INGLLogger &m_logger; LOGGER_T m_logger;
}; };
@@ -8,14 +8,13 @@
*/ */
#include "trajectory_generator.h" #include "trajectory_generator.h"
#include <utility>
#include "trajectory_generator_vulcano.h" #include "trajectory_generator_vulcano.h"
#include <Plugins/ExerciseManagement/exm_data_plugin_interface.h> #include <Plugins/ExerciseManagement/exm_data_plugin_interface.h>
#include <Plugins/AssetManagement/asm_data_plugin_interface.h> #include <Plugins/AssetManagement/asm_data_plugin_interface.h>
#include <LtsCoordTrans/lts_coord_trans.h> #include <LtsCoordTrans/lts_coord_trans.h>
#include <LtsUtils/LtsUtilsCore/qpoint3d.h> #include <LtsUtilsCore/qpoint3d.h>
#ifdef NEVER // for csv file #ifdef NEVER // for csv file
# include <QFile> # include <QFile>
@@ -61,7 +60,7 @@ TrajectoryGenerator *TrajectoryGenerator::getInstance(int exerciseId,
if (ltsElevationManager) if (ltsElevationManager)
{ {
ltsElevationManager->waitForInitialization(); ltsElevationManager->waitForInitialization();
DEBUG_LOG(logger) << Q_FUNC_INFO << ", ltsElevationManager->waitForInitialization() ... DONE, isValid = " << ltsElevationManager->isValid(); DEBUG_LOG(logger) << LOGFUNCTION << ", ltsElevationManager->waitForInitialization() ... DONE, isValid = " << ltsElevationManager->isValid();
} }
s_trajectoryGenerator->initElevation(ltsElevationManager); s_trajectoryGenerator->initElevation(ltsElevationManager);
} }
@@ -85,22 +84,22 @@ void TrajectoryGenerator::cleanup()
void TrajectoryGenerator::initElevation(LtsElevation::LtsElevationManager *ltsElevationManager) void TrajectoryGenerator::initElevation(LtsElevation::LtsElevationManager *ltsElevationManager)
{ {
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; TRACE_LOG(m_logger) << LOGFUNCTION << " START";
m_ltsElevationManager = ltsElevationManager; m_ltsElevationManager = ltsElevationManager;
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; TRACE_LOG(m_logger) << LOGFUNCTION << " END";
} }
LtsElevation::LtsElevationManager *TrajectoryGenerator::getElevationManager() LtsElevation::LtsElevationManager *TrajectoryGenerator::getElevationManager()
{ {
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; TRACE_LOG(m_logger) << LOGFUNCTION << " START";
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; TRACE_LOG(m_logger) << LOGFUNCTION << " END";
return m_ltsElevationManager; return m_ltsElevationManager;
} }
bool TrajectoryGenerator::hasElevationManager() const bool TrajectoryGenerator::hasElevationManager() const
{ {
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; TRACE_LOG(m_logger) << LOGFUNCTION << " START";
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; TRACE_LOG(m_logger) << LOGFUNCTION << " END";
return m_ltsElevationManager; return m_ltsElevationManager;
} }
@@ -200,7 +199,7 @@ bool TrajectoryGenerator::generateTrajectoryVulcano(const QPoint3D &originatorPo
{ {
QPoint4D startPoint = trajectoryMetricOut.first(); QPoint4D startPoint = trajectoryMetricOut.first();
for (const QPoint4D &p4D : std::as_const(trajectoryMetricOut)) for (const QPoint4D &p4D : qAsConst(trajectoryMetricOut))
{ {
output << p4D.x() - startPoint.x() << ";" output << p4D.x() - startPoint.x() << ";"
<< p4D.y() - startPoint.y() << ";" << p4D.y() - startPoint.y() << ";"
@@ -232,7 +231,7 @@ bool TrajectoryGenerator::generateTrajectoryVulcano(const QPoint3D &originatorPo
trajectoryTimeAwareOut.clear(); trajectoryTimeAwareOut.clear();
trajectoryTimeAwareOut.reserve(trajectoryMetricOut.size()); trajectoryTimeAwareOut.reserve(trajectoryMetricOut.size());
for (const QPoint4D& pnt4d : std::as_const(trajectoryMetricOut)) for (const QPoint4D& pnt4d : qAsConst(trajectoryMetricOut))
{ {
LtsCoordTrans::UtmCoordinate pntUtm(idealHitUtm.zone, pnt4d.x(), pnt4d.y()); LtsCoordTrans::UtmCoordinate pntUtm(idealHitUtm.zone, pnt4d.x(), pnt4d.y());
const QPointF &pntGeo = pntUtm.geographic(); const QPointF &pntGeo = pntUtm.geographic();
@@ -13,11 +13,11 @@
#include "trajectory_generator_vulcano.h" #include "trajectory_generator_vulcano.h"
#include <Core/core.hpp> // Lts/DDS/Core/core.hpp for Core::GeoPosition #include <Core/core.hpp> // Lts/DDS/Core/core.hpp for Core::GeoPosition
#include <LtsElevation/lts_elevation_manager.h> #include <LtsElevation/lts_elevation_manager.h>
#include <LtsUtils/LtsUtilsCore/qpoint3d.h> #include <LtsUtilsCore/qpoint3d.h>
#include "trajectory_export.h" #include <Trajectory/trajectory_export.h>
#include <QtCore/QObject> #include <QObject>
#include <QtCore/QPair> #include <QPair>
#include <QPolygonF> #include <QPolygonF>
#include <vector> #include <vector>
@@ -89,7 +89,6 @@ class TRAJECTORY_EXPORT TrajectoryGenerator : public QObject
QString *reasonOut); QString *reasonOut);
protected: protected:
NGL::INGLLogger &m_logger;
/*! \name Ideal trajectory */ /*! \name Ideal trajectory */
template <typename CONT_T> template <typename CONT_T>
bool generateTrajectoryBiedziak(const LtsUtils::QPoint3D &originatorPosition_geo, bool generateTrajectoryBiedziak(const LtsUtils::QPoint3D &originatorPosition_geo,
@@ -98,7 +97,6 @@ class TRAJECTORY_EXPORT TrajectoryGenerator : public QObject
CONT_T &trajectoryOut); CONT_T &trajectoryOut);
protected: protected:
NGL::INGLLogger &m_logger;
explicit TrajectoryGenerator(); explicit TrajectoryGenerator();
public: public:
@@ -111,6 +109,7 @@ class TRAJECTORY_EXPORT TrajectoryGenerator : public QObject
static const QString string4poly(const QPair<QPolygonF, QVector<double>> &pair); static const QString string4poly(const QPair<QPolygonF, QVector<double>> &pair);
LtsElevation::LtsElevationManager *m_ltsElevationManager{nullptr}; LtsElevation::LtsElevationManager *m_ltsElevationManager{nullptr};
LOGGER_T m_logger;
}; };
} // namespace AreaEffectSimulation } // namespace AreaEffectSimulation
@@ -8,10 +8,9 @@
*/ */
#include "trajectory_generator_vulcano.h" #include "trajectory_generator_vulcano.h"
#include <utility>
#include <QtCore/QObject> #include <QObject>
#include <QtCore/QPointF> #include <QPointF>
namespace AreaEffectSimulation namespace AreaEffectSimulation
{ {
@@ -172,7 +171,7 @@ bool TrajectoryGeneratorVulcano::trajectoryVulcano(const QPoint3D &origin, const
trajectoryOut.reserve(phase1_bal.size()+5); trajectoryOut.reserve(phase1_bal.size()+5);
int cnt = 0; int cnt = 0;
for (const QPointF &xyVertex : std::as_const(phase1_bal)) for (const QPointF &xyVertex : qAsConst(phase1_bal))
{ {
// translate from XY to XYZ // translate from XY to XYZ
const QPoint3D p3d_offset(xyVertex.x() * factorX, // xyVertex.x() const QPoint3D p3d_offset(xyVertex.x() * factorX, // xyVertex.x()
@@ -11,11 +11,11 @@
#pragma once #pragma once
#include "../logger.h" #include "../logger.h"
#include "trajectory_export.h" #include <Trajectory/trajectory_export.h>
#include <LtsCoordTrans/lts_coord_trans.h> #include <LtsCoordTrans/lts_coord_trans.h>
#include <LtsUtils/LtsUtilsCore/qpoint3d.h> #include <LtsUtilsCore/qpoint3d.h>
#include <QtCore/QVector> #include <QVector>
#include <QVector2D> #include <QVector2D>
#include <cmath> #include <cmath>
@@ -10,11 +10,11 @@
#include "trajectory_helper.h" #include "trajectory_helper.h"
#include "../logger.h" #include "../logger.h"
#include <LtsUtils/LtsUtilsCore/qpoint3d.h> #include <LtsUtilsCore/qpoint3d.h>
#include <QtCore/QObject> #include <QObject>
#include <QtCore/QString> #include <QString>
#include <QtCore/QDebug> #include <QDebug>
#include <iostream> #include <iostream>
#include <cmath> #include <cmath>
@@ -10,8 +10,8 @@
#pragma once #pragma once
#include "trajectory_export.h" #include <AreaEffectSimulation/aes_export.h>
#include "trajectory_export.h" #include <Trajectory/trajectory_export.h>
// Forward // Forward
namespace LtsUtils { namespace LtsUtils {
@@ -7,9 +7,9 @@
#pragma once #pragma once
#include <QtCore/QVector> #include <QVector>
#include <LtsUtils/LtsUtilsCore/qpoint3d.h> #include <LtsUtilsCore/qpoint3d.h>
#include "trajectory_export.h" #include <Trajectory/trajectory_export.h>
namespace AreaEffectSimulation namespace AreaEffectSimulation
{ {
@@ -1,10 +1,10 @@
#pragma once #pragma once
#include "trajectory_point.h" #include "trajectory_point.h"
#include "trajectory_export.h" #include <Trajectory/trajectory_export.h>
#include <QtCore/QVector> #include <QVector>
#include <LtsUtils/LtsUtilsCore/qpoint3d.h> #include <LtsUtilsCore/qpoint3d.h>
namespace AreaEffectSimulation namespace AreaEffectSimulation
{ {
@@ -15,14 +15,7 @@ SET(UnitTestSources
SOURCE_GROUP( UnitTestSources FILES ${UnitTestSources} ) SOURCE_GROUP( UnitTestSources FILES ${UnitTestSources} )
IF(BUILD_TESTING) IF(BUILD_TESTING)
NGL_ADD_EXECUTABLE(SV aesUnitTestTrajectorySplitter ${LinkedSources} ${UnitTestSources} ) ADD_EXECUTABLE(aesUnitTestTrajectorySplitter ${LinkedSources} ${UnitTestSources} )
NGL_TARGET_INCLUDE_DIRECTORIES(aesUnitTestTrajectorySplitter
PUBLIC
${CMAKE_SOURCE_DIR}/Lts/
${CMAKE_SOURCE_DIR}/Lts/Services/
${CMAKE_BINARY_DIR}/Lts/
)
TARGET_LINK_LIBRARIES(aesUnitTestTrajectorySplitter TARGET_LINK_LIBRARIES(aesUnitTestTrajectorySplitter
NGLLogger NGLLogger
@@ -8,7 +8,7 @@
#pragma once #pragma once
#include <QtCore/QCoreApplication> #include <QCoreApplication>
#include <QtTest/QTest> #include <QtTest/QTest>
#include <Core/core.hpp> #include <Core/core.hpp>
@@ -10,7 +10,7 @@
#include "trajectory_splitter.h" #include "trajectory_splitter.h"
#include <QtCore/QVector> #include <QVector>
namespace AreaEffectSimulation namespace AreaEffectSimulation
{ {
@@ -9,10 +9,10 @@
#pragma once #pragma once
//#include "svcaescommon_export.h" //#include <LtsCoordinate/ltscoordinate_export.h>
#include <Core/core.hpp> #include <Core/core.hpp>
#include <QtCore/QVector> #include <QVector>
namespace AreaEffectSimulation namespace AreaEffectSimulation
@@ -11,14 +11,7 @@ SET(UnitTestSources
) )
IF(BUILD_TESTING) IF(BUILD_TESTING)
NGL_ADD_EXECUTABLE(SV aesUnitTestFireAutomaton ${LinkedSources} ${UnitTestSources} ) ADD_EXECUTABLE(aesUnitTestFireAutomaton ${LinkedSources} ${UnitTestSources} )
NGL_TARGET_INCLUDE_DIRECTORIES(aesUnitTestFireAutomaton
PUBLIC
${CMAKE_SOURCE_DIR}/Lts/
${CMAKE_SOURCE_DIR}/Lts/Services/
${CMAKE_BINARY_DIR}/Lts/
)
TARGET_LINK_LIBRARIES(aesUnitTestFireAutomaton TARGET_LINK_LIBRARIES(aesUnitTestFireAutomaton
NGLLogger NGLLogger
@@ -6,11 +6,11 @@
*/ */
#include <QtCore/QCoreApplication> #include <QCoreApplication>
#include <QtCore/QTimer> #include <QTimer>
#include <QtCore/QDateTime> #include <QDateTime>
#include <QtTest/QTest> #include <QTest>
#include <QtCore/QVector> #include <QVector>
#include <QSignalSpy> #include <QSignalSpy>
#include <nglapplication/nglcoreapplication.h> #include <nglapplication/nglcoreapplication.h>
@@ -9,7 +9,7 @@
#include <cstdint> #include <cstdint>
#include <QtCore> #include <QtCore>
#include <QtCore/QMetaType> #include <QMetaType>
#include <AreaEffectSimulation/Utils/fire_automaton.h> #include <AreaEffectSimulation/Utils/fire_automaton.h>
@@ -19,9 +19,6 @@ NGL_ADD_EXECUTABLE(AAR SV NO_TRANSLATION aes_statemachine_test
NGL_TARGET_INCLUDE_DIRECTORIES( aes_statemachine_test NGL_TARGET_INCLUDE_DIRECTORIES( aes_statemachine_test
PUBLIC PUBLIC
${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_BINARY_DIR}/..
${CMAKE_SOURCE_DIR}/Lts/
${CMAKE_SOURCE_DIR}/Lts/Services/
${CMAKE_BINARY_DIR}/Lts/
) )
@@ -13,14 +13,7 @@ SET(UnitTestSources
SOURCE_GROUP( UnitTestSources FILES ${UnitTestSources} ) SOURCE_GROUP( UnitTestSources FILES ${UnitTestSources} )
IF(BUILD_TESTING) IF(BUILD_TESTING)
NGL_ADD_EXECUTABLE(SV aesUnitTestBasics ${LinkedSources} ${UnitTestSources} ) ADD_EXECUTABLE(aesUnitTestBasics ${LinkedSources} ${UnitTestSources} )
NGL_TARGET_INCLUDE_DIRECTORIES(aesUnitTestBasics
PUBLIC
${CMAKE_SOURCE_DIR}/Lts/
${CMAKE_SOURCE_DIR}/Lts/Services/
${CMAKE_BINARY_DIR}/Lts/
)
TARGET_LINK_LIBRARIES(aesUnitTestBasics TARGET_LINK_LIBRARIES(aesUnitTestBasics
NGLLogger NGLLogger
@@ -7,13 +7,12 @@
*/ */
#include "basics_unit_test.h" #include "basics_unit_test.h"
#include <utility>
#include <nglapplication/nglcoreapplication.h> #include <nglapplication/nglcoreapplication.h>
#include <AreaEffectSimulation/aes.hpp> #include <AreaEffectSimulation/aes.hpp>
#include <QtTest/QTest> #include <QtTest/QTest>
#include <QtCore/QTimer> #include <QTimer>
#include <QtCore/QDebug> #include <QDebug>
#include <QtTest/QSignalSpy> #include <QtTest/QSignalSpy>
#include <iostream> #include <iostream>
@@ -247,7 +246,7 @@ void UnitTestBasics::test_fireTimer10()
QStringList logSl1 = ft.getLogHistorie(); QStringList logSl1 = ft.getLogHistorie();
QVERIFY2(logSl1.size() == 1, "getCommandHistorie failed"); QVERIFY2(logSl1.size() == 1, "getCommandHistorie failed");
for (const auto &log : std::as_const(logSl1)) for (const auto &log : qAsConst(logSl1))
NOTICE_LOG(m_logger) << "log ='" << log << "'"; NOTICE_LOG(m_logger) << "log ='" << log << "'";
} }
@@ -320,7 +319,7 @@ void UnitTestBasics::test_fireTimer20()
// QList<QVariant> arguments = spyStateChanged.takeFirst(); // take the first signal // QList<QVariant> arguments = spyStateChanged.takeFirst(); // take the first signal
// NOTICE_LOG(m_logger) << " spyStateChanged.count() " << spyStateChanged.count(); // NOTICE_LOG(m_logger) << " spyStateChanged.count() " << spyStateChanged.count();
// for (const QList<QVariant> &argument : std::as_const(spyStateChanged)) // for (const QList<QVariant> &argument : qAsConst(spyStateChanged))
// NOTICE_LOG(m_logger) << " spyStateChanged . argument " << argument.first().toInt(); // NOTICE_LOG(m_logger) << " spyStateChanged . argument " << argument.first().toInt();
// check order of signal paramter: // check order of signal paramter:
@@ -9,7 +9,7 @@
#pragma once #pragma once
#include <../../logger.h> #include <../../logger.h>
#include <QtCore/QCoreApplication> #include <QCoreApplication>
#include <QtTest/QTest> #include <QtTest/QTest>
#include <AreaEffectSimulation/Utils/firing_timer.h> #include <AreaEffectSimulation/Utils/firing_timer.h>
@@ -13,14 +13,7 @@ SET(UnitTestSources
SOURCE_GROUP( UnitTestSources FILES ${UnitTestSources} ) SOURCE_GROUP( UnitTestSources FILES ${UnitTestSources} )
IF(BUILD_TESTING) IF(BUILD_TESTING)
NGL_ADD_EXECUTABLE(SV aesUnitTestPolygons ${LinkedSources} ${UnitTestSources} ) ADD_EXECUTABLE(aesUnitTestPolygons ${LinkedSources} ${UnitTestSources} )
NGL_TARGET_INCLUDE_DIRECTORIES(aesUnitTestPolygons
PUBLIC
${CMAKE_SOURCE_DIR}/Lts/
${CMAKE_SOURCE_DIR}/Lts/Services/
${CMAKE_BINARY_DIR}/Lts/
)
TARGET_LINK_LIBRARIES(aesUnitTestPolygons TARGET_LINK_LIBRARIES(aesUnitTestPolygons
NGLLogger NGLLogger
@@ -7,15 +7,14 @@
*/ */
#include "polygons_unit_test.h" #include "polygons_unit_test.h"
#include <utility>
#include <Services/AreaEffectSimulation/Utils/polygons.h> #include <Services/AreaEffectSimulation/Utils/polygons.h>
#include <nglapplication/nglcoreapplication.h> #include <nglapplication/nglcoreapplication.h>
#include <LtsCoordTrans/lts_coord_trans.h> #include <LtsCoordTrans/lts_coord_trans.h>
#include <QTransform> #include <QTransform>
#include <QtCore/QTextStream> // #include <QTextStream> //
#include <QtTest/QTest> #include <QtTest/QTest>
#include <QtCore/QDebug> #include <QDebug>
#include <iostream> #include <iostream>
@@ -211,7 +210,7 @@ void UnitTestPolygons::test_explosionClusterSingleExplosionsGAUSS_Mtp()
qCritical() << "rotation_deg = " << rotation_deg qCritical() << "rotation_deg = " << rotation_deg
<< ", mtpRotationNorthDegree = " << mtpRotationNorthDegree << ", mtpRotationNorthDegree = " << mtpRotationNorthDegree
<< ", explosionClusterDb = " << singleExplosions; << ", explosionClusterDb = " << singleExplosions;
for (const auto &singleExplosion : std::as_const(singleExplosions)) for (const auto &singleExplosion : qAsConst(singleExplosions))
qDebug() << "singleExUtm: " << LtsCoordTrans::UtmCoordinate::fromGeographic(singleExplosion).mgrs(); qDebug() << "singleExUtm: " << LtsCoordTrans::UtmCoordinate::fromGeographic(singleExplosion).mgrs();
size_t i = 0; size_t i = 0;
@@ -243,7 +242,7 @@ void UnitTestPolygons::test_explosionClusterSingleExplosionsGAUSS_Mtp()
qCritical() << "rotation_deg = " << rotation_deg qCritical() << "rotation_deg = " << rotation_deg
<< ", mtpRotationNorthDegree = " << mtpRotationNorthDegree << ", mtpRotationNorthDegree = " << mtpRotationNorthDegree
<< " explosionClusterDb = " << singleExplosions; << " explosionClusterDb = " << singleExplosions;
for (const auto &singleExplosion : std::as_const(singleExplosions)) for (const auto &singleExplosion : qAsConst(singleExplosions))
qCritical() << "singleExUtm: " << LtsCoordTrans::UtmCoordinate::fromGeographic(singleExplosion).mgrs(); qCritical() << "singleExUtm: " << LtsCoordTrans::UtmCoordinate::fromGeographic(singleExplosion).mgrs();
size_t i = 0; size_t i = 0;
@@ -280,7 +279,7 @@ void UnitTestPolygons::test_explosionClusterSingleExplosionsGAUSS_Mtp()
<< ", zog = " << zog << ", zog = " << zog
<< ", mtpRotationNorthDegree = " << mtpRotationNorthDegree << ", mtpRotationNorthDegree = " << mtpRotationNorthDegree
<< " explosionClusterDb = " << singleExplosions; << " explosionClusterDb = " << singleExplosions;
for (const auto &singleExplosion : std::as_const(singleExplosions)) for (const auto &singleExplosion : qAsConst(singleExplosions))
qCritical() << "singleExUtm: " << LtsCoordTrans::UtmCoordinate::fromGeographic(singleExplosion).mgrs(); qCritical() << "singleExUtm: " << LtsCoordTrans::UtmCoordinate::fromGeographic(singleExplosion).mgrs();
size_t i = 0; size_t i = 0;
@@ -8,7 +8,7 @@
#pragma once #pragma once
#include <QtCore/QCoreApplication> #include <QCoreApplication>
#include <QtTest/QTest> #include <QtTest/QTest>
@@ -13,14 +13,7 @@ SET(UnitTestSources
SOURCE_GROUP( UnitTestSources FILES ${UnitTestSources} ) SOURCE_GROUP( UnitTestSources FILES ${UnitTestSources} )
IF(BUILD_TESTING) IF(BUILD_TESTING)
NGL_ADD_EXECUTABLE(SV aesUnitTestTneAlgorithmen ${UnitTestSources} ) ADD_EXECUTABLE(aesUnitTestTneAlgorithmen ${LinkedSources} ${UnitTestSources} )
NGL_TARGET_INCLUDE_DIRECTORIES(aesUnitTestTneAlgorithmen
PUBLIC
${CMAKE_SOURCE_DIR}/Lts/
${CMAKE_SOURCE_DIR}/Lts/Services/
${CMAKE_BINARY_DIR}/Lts/
)
TARGET_LINK_LIBRARIES(aesUnitTestTneAlgorithmen TARGET_LINK_LIBRARIES(aesUnitTestTneAlgorithmen
NGLLogger NGLLogger
@@ -11,8 +11,8 @@
#include <nglapplication/nglcoreapplication.h> #include <nglapplication/nglcoreapplication.h>
#include <QtTest/QTest> #include <QtTest/QTest>
#include <QtCore/QFile> #include <QFile>
#include <QtCore/QDir> #include <QDir>
#include <iostream> #include <iostream>
@@ -8,7 +8,7 @@
#pragma once #pragma once
#include <QtCore/QCoreApplication> #include <QCoreApplication>
#include <QtTest/QTest> #include <QtTest/QTest>
@@ -6,9 +6,9 @@
*/ */
#include "aes_statemachine_test.h" #include "aes_statemachine_test.h"
#include <QtCore/QDebug> #include <QDebug>
#include <QSignalSpy> #include <QSignalSpy>
#include <QtTest/QTest> #include <QTest>
#include <nglapplication/nglcoreapplication.h> #include <nglapplication/nglcoreapplication.h>
using namespace AreaEffectSimulation; using namespace AreaEffectSimulation;
@@ -8,8 +8,8 @@
#include "aes_helper.h" #include "aes_helper.h"
#include <QtCore/QHash> #include <QHash>
#include <QtCore/QSet> #include <QSet>
namespace AreaEffectSimulation namespace AreaEffectSimulation
@@ -8,16 +8,16 @@
#pragma once #pragma once
#include "svcaescommon_export.h" #include <AreaEffectSimulation/aes_export.h>
#include <math.h> #include <math.h>
#include <LtsCoordTrans/lts_coord_trans.h> #include <LtsCoordTrans/lts_coord_trans.h>
#include <QtCore/QPointF> #include <QPointF>
#include <QtCore/QString> #include <QString>
#include <QtCore/QJsonDocument> #include <QJsonDocument>
#include <QtCore/QJsonObject> #include <QJsonObject>
#include <QtCore/QJsonArray> #include <QJsonArray>
#include <LtsUtils/dds_bitarray.h> #include <LtsUtilsCore/dds_bitarray.h>
#include <LtsUtils/LtsUtilsCore/qpoint3d.h> #include <LtsUtilsCore/qpoint3d.h>
#include "aes_db.h" #include "aes_db.h"
namespace AreaEffectSimulation namespace AreaEffectSimulation
@@ -6,9 +6,9 @@
*/ */
#include <QtGlobal> #include <QtGlobal>
#include <QtCore/QTimer> #include <QTimer>
#include <QtCore/QStringList> #include <QStringList>
#include <QtCore/QVector> #include <QVector>
#include <AreaEffectSimulation/logger.h> #include <AreaEffectSimulation/logger.h>
#include <AreaEffectSimulation/settings.h> #include <AreaEffectSimulation/settings.h>
@@ -26,6 +26,7 @@ FireAutomaton::FireAutomaton(QObject *parent)
, m_intervalMSecs(0) , m_intervalMSecs(0)
, m_remainingTickMSecs(0) , m_remainingTickMSecs(0)
, m_state(State::Uninitialized) , m_state(State::Uninitialized)
, m_logger(getLogger("Utils.FireAutomaton"))
{ {
m_timer.setSingleShot(true); m_timer.setSingleShot(true);
connect(&m_timer, &QTimer::timeout, this, &FireAutomaton::nextTick, Qt::UniqueConnection); connect(&m_timer, &QTimer::timeout, this, &FireAutomaton::nextTick, Qt::UniqueConnection);
@@ -6,10 +6,10 @@
*/ */
#include <QtCore> #include <QtCore>
#include <QtCore/QObject> #include <QObject>
#include <QtCore/QTimer> #include <QTimer>
#include <QtCore/QString> #include <QString>
#include <QtCore/QVector> #include <QVector>
#include "../logger.h" #include "../logger.h"
@@ -72,7 +72,6 @@ private slots:
void nextTick(); void nextTick();
private: private:
NGL::INGLLogger &m_logger;
enum class PatternElement { enum class PatternElement {
All, All,
AllFill, AllFill,
@@ -90,7 +89,6 @@ private:
QVector<int32_t> getEffectorIds(int32_t tick) const; QVector<int32_t> getEffectorIds(int32_t tick) const;
private: private:
NGL::INGLLogger &m_logger;
QVector<int32_t> m_effectorIds; QVector<int32_t> m_effectorIds;
QVector<FireAutomaton::PatternElement> m_pattern; QVector<FireAutomaton::PatternElement> m_pattern;
QVector<QVector<int32_t>> m_schedule; QVector<QVector<int32_t>> m_schedule;
@@ -101,6 +99,8 @@ private:
int32_t m_intervalMSecs; int32_t m_intervalMSecs;
int32_t m_remainingTickMSecs; int32_t m_remainingTickMSecs;
State m_state; State m_state;
LOGGER_T m_logger;
}; };
} // namespace AreaEffectSimulation } // namespace AreaEffectSimulation
@@ -10,13 +10,13 @@
#include "firing_timer.h" #include "firing_timer.h"
#include "../logger.h" #include "../logger.h"
#include <LtsUtils/LtsUtilsCore/qpoint3d.h> #include <LtsUtilsCore/qpoint3d.h>
#include <QtCore/QString> #include <QString>
#include <QtCore/QTimer> #include <QTimer>
#include <QElapsedTimer> #include <QElapsedTimer>
#include <QtCore/QDateTime> #include <QDateTime>
#include <QtCore/QDebug> #include <QDebug>
#include <iostream> #include <iostream>
#include <cmath> #include <cmath>
@@ -27,7 +27,7 @@ namespace AreaEffectSimulation
// To be able to aesily differentiate between different instances: // To be able to aesily differentiate between different instances:
#define MY_Q_FUNC_INFO "debugInfo='" << d->m_debugInfo << "' " << Q_FUNC_INFO #define MY_LOGFUNCTION "debugInfo='" << d->m_debugInfo << "' " << Q_FUNC_INFO
static long s_counter{0}; static long s_counter{0};
@@ -129,21 +129,22 @@ public:
FiringTimer::FiringTimer(const QString &debugInfo) FiringTimer::FiringTimer(const QString &debugInfo)
: BaseClass(nullptr) : BaseClass(nullptr)
, d(new Private) , d(new Private)
, m_logger(getLogger("Utils.FiringTimer"))
{ {
++s_counter; ++s_counter;
d->m_debugInfo = debugInfo; d->m_debugInfo = debugInfo;
DEBUG_LOG(m_logger) << MY_Q_FUNC_INFO << " START, s_counter=" << s_counter << " this=" << this; DEBUG_LOG(m_logger) << MY_LOGFUNCTION << " START, s_counter=" << s_counter << " this=" << this;
DEBUG_LOG(m_logger) << MY_Q_FUNC_INFO << " END, s_counter=" << s_counter << " this=" << this; DEBUG_LOG(m_logger) << MY_LOGFUNCTION << " END, s_counter=" << s_counter << " this=" << this;
} }
FiringTimer::~FiringTimer() FiringTimer::~FiringTimer()
{ {
--s_counter; --s_counter;
DEBUG_LOG(m_logger) << MY_Q_FUNC_INFO << " START, s_counter=" << s_counter << " this=" << this; DEBUG_LOG(m_logger) << MY_LOGFUNCTION << " START, s_counter=" << s_counter << " this=" << this;
QString debugInfoSave = d->m_debugInfo; QString debugInfoSave = d->m_debugInfo;
delete d; delete d;
//DEBUG_LOG(m_logger) << MY_Q_FUNC_INFO << " END, s_counter=" << s_counter << " this=" << this; //DEBUG_LOG(m_logger) << MY_LOGFUNCTION << " END, s_counter=" << s_counter << " this=" << this;
DEBUG_LOG(m_logger) << "debugInfo='" << debugInfoSave << "'" << Q_FUNC_INFO << " END, s_counter=" << s_counter << " this=" << this; DEBUG_LOG(m_logger) << "debugInfo='" << debugInfoSave << "'" << LOGFUNCTION << " END, s_counter=" << s_counter << " this=" << this;
} }
void FiringTimer::setDebugInfo(const QString &debugInfo) void FiringTimer::setDebugInfo(const QString &debugInfo)
@@ -153,14 +154,14 @@ void FiringTimer::setDebugInfo(const QString &debugInfo)
void FiringTimer::reset() void FiringTimer::reset()
{ {
TRACE_LOG(m_logger) << MY_Q_FUNC_INFO << " START"; TRACE_LOG(m_logger) << MY_LOGFUNCTION << " START";
d->reset(); d->reset();
TRACE_LOG(m_logger) << MY_Q_FUNC_INFO << " END"; TRACE_LOG(m_logger) << MY_LOGFUNCTION << " END";
} }
bool FiringTimer::init(long effectDurationMsec, int ammoCount, long ammoFlightDurationMsec) bool FiringTimer::init(long effectDurationMsec, int ammoCount, long ammoFlightDurationMsec)
{ {
TRACE_LOG(m_logger) << MY_Q_FUNC_INFO << " START," TRACE_LOG(m_logger) << MY_LOGFUNCTION << " START,"
<< ", effectDurationMsec=" << effectDurationMsec << ", effectDurationMsec=" << effectDurationMsec
<< ", ammoCount=" << ammoCount << ", ammoCount=" << ammoCount
<< ", ammoFlightDurationMsec=" << ammoFlightDurationMsec; << ", ammoFlightDurationMsec=" << ammoFlightDurationMsec;
@@ -170,7 +171,7 @@ bool FiringTimer::init(long effectDurationMsec, int ammoCount, long ammoFlightDu
d->m_ammoCount = ammoCount; d->m_ammoCount = ammoCount;
d->m_ammoFlightDurationMsec = ammoFlightDurationMsec; d->m_ammoFlightDurationMsec = ammoFlightDurationMsec;
d->m_intervallMsec = static_cast<double>(d->m_effectDurationMsec) / d->m_ammoCount; // ensure float calculation d->m_intervallMsec = static_cast<double>(d->m_effectDurationMsec) / d->m_ammoCount; // ensure float calculation
DEBUG_LOG(m_logger) << MY_Q_FUNC_INFO << " m_intervallMsec " << d->m_intervallMsec; DEBUG_LOG(m_logger) << MY_LOGFUNCTION << " m_intervallMsec " << d->m_intervallMsec;
d->m_firingTimer->stop(); d->m_firingTimer->stop();
d->m_firingTimer->setSingleShot(false); d->m_firingTimer->setSingleShot(false);
@@ -178,24 +179,24 @@ bool FiringTimer::init(long effectDurationMsec, int ammoCount, long ammoFlightDu
connect(d->m_firingTimer, &QTimer::timeout, connect(d->m_firingTimer, &QTimer::timeout,
this, &FiringTimer::onFiringTimout, Qt::UniqueConnection); this, &FiringTimer::onFiringTimout, Qt::UniqueConnection);
TRACE_LOG(m_logger) << MY_Q_FUNC_INFO << " END"; TRACE_LOG(m_logger) << MY_LOGFUNCTION << " END";
return true; return true;
} }
bool FiringTimer::startFiring() bool FiringTimer::startFiring()
{ {
TRACE_LOG(m_logger) << MY_Q_FUNC_INFO << " START"; TRACE_LOG(m_logger) << MY_LOGFUNCTION << " START";
if ((d->m_currentFiringMode != FiringMode::FM_Undefined) && if ((d->m_currentFiringMode != FiringMode::FM_Undefined) &&
(d->m_currentFiringMode != FiringMode::FM_Paused)) (d->m_currentFiringMode != FiringMode::FM_Paused))
{ {
ERROR_LOG(m_logger) << MY_Q_FUNC_INFO << " wrong firingMode, cur = " << (int)d->m_currentFiringMode; ERROR_LOG(m_logger) << MY_LOGFUNCTION << " wrong firingMode, cur = " << (int)d->m_currentFiringMode;
return false; return false;
} }
if (remainingAmmoCount() <= 0) if (remainingAmmoCount() <= 0)
{ {
ERROR_LOG(m_logger) << MY_Q_FUNC_INFO << " no ammo left" ERROR_LOG(m_logger) << MY_LOGFUNCTION << " no ammo left"
<< " (total ammoCount was: " << d->m_ammoCount << " (total ammoCount was: " << d->m_ammoCount
<< " cur firingMode = " << (int)d->m_currentFiringMode; << " cur firingMode = " << (int)d->m_currentFiringMode;
return false; return false;
@@ -213,7 +214,7 @@ bool FiringTimer::startFiring()
#endif // SUPPORT_STATE_CHANGE_DELAYED #endif // SUPPORT_STATE_CHANGE_DELAYED
DEBUG_LOG(m_logger) << MY_Q_FUNC_INFO << " start firing with m_firedAmmoCount = " << d->m_firedAmmoCount; DEBUG_LOG(m_logger) << MY_LOGFUNCTION << " start firing with m_firedAmmoCount = " << d->m_firedAmmoCount;
d->m_firingTimer->start(); d->m_firingTimer->start();
d->m_currentFiringMode = FiringMode::FM_Active; d->m_currentFiringMode = FiringMode::FM_Active;
@@ -227,7 +228,7 @@ bool FiringTimer::startFiring()
d->m_pausedMsec += pausedElapsedMsec; d->m_pausedMsec += pausedElapsedMsec;
d->m_etPaused->invalidate(); d->m_etPaused->invalidate();
} }
DEBUG_LOG(m_logger) << MY_Q_FUNC_INFO << " start firing after [ms]: " << pausedElapsedMsec DEBUG_LOG(m_logger) << MY_LOGFUNCTION << " start firing after [ms]: " << pausedElapsedMsec
<< ", m_activeMsec in total = " << d->m_activeMsec << ", m_activeMsec in total = " << d->m_activeMsec
<< ", m_pausedMsec in total = " << d->m_pausedMsec; << ", m_pausedMsec in total = " << d->m_pausedMsec;
@@ -256,7 +257,7 @@ bool FiringTimer::startFiring()
// to fire at the beginning of the interval: // to fire at the beginning of the interval:
onFiringTimout(); onFiringTimout();
TRACE_LOG(m_logger) << MY_Q_FUNC_INFO << " END"; TRACE_LOG(m_logger) << MY_LOGFUNCTION << " END";
return true; return true;
} }
@@ -270,17 +271,17 @@ bool FiringTimer::startFiringDelay(qint64 delayMsec)
bool FiringTimer::pauseFiring() bool FiringTimer::pauseFiring()
{ {
TRACE_LOG(m_logger) << MY_Q_FUNC_INFO << " START"; TRACE_LOG(m_logger) << MY_LOGFUNCTION << " START";
if (d->m_currentFiringMode != FiringMode::FM_Active) if (d->m_currentFiringMode != FiringMode::FM_Active)
{ {
ERROR_LOG(m_logger) << MY_Q_FUNC_INFO << " wrong firingMode"; ERROR_LOG(m_logger) << MY_LOGFUNCTION << " wrong firingMode";
return false; return false;
} }
if (remainingAmmoCount() <= 0) if (remainingAmmoCount() <= 0)
{ {
ERROR_LOG(m_logger) << MY_Q_FUNC_INFO << " no ammo left" ERROR_LOG(m_logger) << MY_LOGFUNCTION << " no ammo left"
<< " (total ammoCount was: " << d->m_ammoCount; << " (total ammoCount was: " << d->m_ammoCount;
return false; return false;
} }
@@ -293,7 +294,7 @@ bool FiringTimer::pauseFiring()
#endif // SUPPORT_STATE_CHANGE_DELAYED #endif // SUPPORT_STATE_CHANGE_DELAYED
DEBUG_LOG(m_logger) << MY_Q_FUNC_INFO << " stop firing at m_firedAmmoCount = " << d->m_firedAmmoCount; DEBUG_LOG(m_logger) << MY_LOGFUNCTION << " stop firing at m_firedAmmoCount = " << d->m_firedAmmoCount;
d->m_firingTimer->stop(); d->m_firingTimer->stop();
d->m_currentFiringMode = FiringMode::FM_Paused; d->m_currentFiringMode = FiringMode::FM_Paused;
d->m_etPaused->start(); d->m_etPaused->start();
@@ -305,14 +306,14 @@ bool FiringTimer::pauseFiring()
const qint64 activeElapsedMsec = d->m_etActive->elapsed(); const qint64 activeElapsedMsec = d->m_etActive->elapsed();
d->m_activeMsec += activeElapsedMsec; d->m_activeMsec += activeElapsedMsec;
d->m_etActive->invalidate(); d->m_etActive->invalidate();
DEBUG_LOG(m_logger) << MY_Q_FUNC_INFO << " stop firing after [ms]: " << activeElapsedMsec DEBUG_LOG(m_logger) << MY_LOGFUNCTION << " stop firing after [ms]: " << activeElapsedMsec
<< ", m_activeMsec in total = " << d->m_activeMsec << ", m_activeMsec in total = " << d->m_activeMsec
<< ", m_pausedMsec in total = " << d->m_pausedMsec; << ", m_pausedMsec in total = " << d->m_pausedMsec;
QString log = QString(QStringLiteral("pauseFiring_at_%1")).arg(QDateTime::currentMSecsSinceEpoch()) ; QString log = QString(QStringLiteral("pauseFiring_at_%1")).arg(QDateTime::currentMSecsSinceEpoch()) ;
d->m_logHistorie.append(log); d->m_logHistorie.append(log);
TRACE_LOG(m_logger) << MY_Q_FUNC_INFO << " END"; TRACE_LOG(m_logger) << MY_LOGFUNCTION << " END";
return true; return true;
} }
@@ -346,7 +347,7 @@ long FiringTimer::intervallMsec() const
#ifdef SUPPORT_STATE_CHANGE_DELAYED #ifdef SUPPORT_STATE_CHANGE_DELAYED
void FiringTimer::emitStateChangeDelayed(AreaEffectSimulation::FiringTimer::CMD cmd, int firedAmmoCount) void FiringTimer::emitStateChangeDelayed(AreaEffectSimulation::FiringTimer::CMD cmd, int firedAmmoCount)
{ {
DEBUG_LOG(m_logger) << MY_Q_FUNC_INFO << " SUPPORT_STATE_CHANGE_DELAYED: " << cmd DEBUG_LOG(m_logger) << MY_LOGFUNCTION << " SUPPORT_STATE_CHANGE_DELAYED: " << cmd
<< ", firedAmmoCount = " << firedAmmoCount; << ", firedAmmoCount = " << firedAmmoCount;
emit stateChangeDelayedAsInt(static_cast<int>(cmd), firedAmmoCount); emit stateChangeDelayedAsInt(static_cast<int>(cmd), firedAmmoCount);
} }
@@ -380,11 +381,11 @@ QString FiringTimer::toString(const CMD cmd)
void FiringTimer::onFiringTimout() void FiringTimer::onFiringTimout()
{ {
TRACE_LOG(m_logger) << MY_Q_FUNC_INFO << " START"; TRACE_LOG(m_logger) << MY_LOGFUNCTION << " START";
++d->m_firedAmmoCount; ++d->m_firedAmmoCount;
INFO_LOG(m_logger) << MY_Q_FUNC_INFO << " emit firing with: " << d->m_firedAmmoCount INFO_LOG(m_logger) << MY_LOGFUNCTION << " emit firing with: " << d->m_firedAmmoCount
<< " of total ammoCount = " << d->m_ammoCount; << " of total ammoCount = " << d->m_ammoCount;
emit firing(d->m_firedAmmoCount, d->m_ammoCount); emit firing(d->m_firedAmmoCount, d->m_ammoCount);
@@ -396,7 +397,7 @@ void FiringTimer::onFiringTimout()
int currentFiringNumber = d->m_firedAmmoCount; int currentFiringNumber = d->m_firedAmmoCount;
int totalFiringNumber = d->m_ammoCount; int totalFiringNumber = d->m_ammoCount;
DEBUG_LOG(m_logger) << MY_Q_FUNC_INFO << " XXXXXXXXX schedule 'emit impact' " << currentFiringNumber; DEBUG_LOG(m_logger) << MY_LOGFUNCTION << " XXXXXXXXX schedule 'emit impact' " << currentFiringNumber;
QTimer::singleShot(d->m_ammoFlightDurationMsec, this, [this, currentFiringNumber, totalFiringNumber]() QTimer::singleShot(d->m_ammoFlightDurationMsec, this, [this, currentFiringNumber, totalFiringNumber]()
{ {
@@ -408,7 +409,7 @@ void FiringTimer::onFiringTimout()
} }
#endif // SUPPORT_STATE_CHANGE_DELAYED #endif // SUPPORT_STATE_CHANGE_DELAYED
INFO_LOG(m_logger) << MY_Q_FUNC_INFO << " emit impact " << currentFiringNumber INFO_LOG(m_logger) << MY_LOGFUNCTION << " emit impact " << currentFiringNumber
<< " of total = " << totalFiringNumber; << " of total = " << totalFiringNumber;
emit impact(currentFiringNumber, totalFiringNumber); emit impact(currentFiringNumber, totalFiringNumber);
@@ -430,7 +431,7 @@ void FiringTimer::onFiringTimout()
if (d->m_firedAmmoCount >= d->m_ammoCount) if (d->m_firedAmmoCount >= d->m_ammoCount)
{ {
INFO_LOG(m_logger) << MY_Q_FUNC_INFO << " no ammo left, finishing firing" INFO_LOG(m_logger) << MY_LOGFUNCTION << " no ammo left, finishing firing"
<< ", " << d->m_firedAmmoCount << " of total ammoCount = " << d->m_ammoCount << " are fired"; << ", " << d->m_firedAmmoCount << " of total ammoCount = " << d->m_ammoCount << " are fired";
d->m_firingTimer->stop(); d->m_firingTimer->stop();
@@ -440,7 +441,7 @@ void FiringTimer::onFiringTimout()
// !! Attention: do pauseFiring() WITHIN the intervall will reduce amount of time the firing is active !! // !! Attention: do pauseFiring() WITHIN the intervall will reduce amount of time the firing is active !!
DEBUG_LOG(m_logger) << MY_Q_FUNC_INFO << " stop firing after [ms]: " << activeElapsedMsec DEBUG_LOG(m_logger) << MY_LOGFUNCTION << " stop firing after [ms]: " << activeElapsedMsec
<< ", m_activeMsec in total = " << d->m_activeMsec << ", m_activeMsec in total = " << d->m_activeMsec
<< ", m_pausedMsec in total = " << d->m_pausedMsec << ", m_pausedMsec in total = " << d->m_pausedMsec
<< " now FiringTimoutExpiredPlus ..."; << " now FiringTimoutExpiredPlus ...";
@@ -465,12 +466,12 @@ void FiringTimer::onFiringTimout()
d->m_firingTimer->start(); d->m_firingTimer->start();
} }
TRACE_LOG(m_logger) << MY_Q_FUNC_INFO << " END" << ", m_firedAmmoCount " << d->m_firedAmmoCount; TRACE_LOG(m_logger) << MY_LOGFUNCTION << " END" << ", m_firedAmmoCount " << d->m_firedAmmoCount;
} }
void FiringTimer::onFiringTimoutExpiredPlus() void FiringTimer::onFiringTimoutExpiredPlus()
{ {
TRACE_LOG(m_logger) << MY_Q_FUNC_INFO << " START"; TRACE_LOG(m_logger) << MY_LOGFUNCTION << " START";
d->m_currentFiringMode = FiringMode::FM_ExpiredPlus; d->m_currentFiringMode = FiringMode::FM_ExpiredPlus;
@@ -480,7 +481,7 @@ void FiringTimer::onFiringTimoutExpiredPlus()
// !! Attention: do pauseFiring() WITHIN the intervall will reduce amount of time the firing is active !! // !! Attention: do pauseFiring() WITHIN the intervall will reduce amount of time the firing is active !!
DEBUG_LOG(m_logger) << MY_Q_FUNC_INFO << " stop firing2 after [ms]: " << activeElapsedMsec DEBUG_LOG(m_logger) << MY_LOGFUNCTION << " stop firing2 after [ms]: " << activeElapsedMsec
<< ", m_activeMsec in total = " << d->m_activeMsec << ", m_activeMsec in total = " << d->m_activeMsec
<< ", m_pausedMsec in total = " << d->m_pausedMsec; << ", m_pausedMsec in total = " << d->m_pausedMsec;
@@ -488,7 +489,7 @@ void FiringTimer::onFiringTimoutExpiredPlus()
emit firingFinishedPlus(); emit firingFinishedPlus();
TRACE_LOG(m_logger) << MY_Q_FUNC_INFO << " END"; TRACE_LOG(m_logger) << MY_LOGFUNCTION << " END";
} }
@@ -9,11 +9,11 @@
#pragma once #pragma once
#include "svcaescommon_export.h" #include "aes_export.h"
#include "../logger.h" #include "../logger.h"
#include <QtCore/QObject> #include <QObject>
#include <QtCore/QString> #include <QString>
#include <iosfwd> #include <iosfwd>
@@ -6,15 +6,14 @@
*/ */
#include "icons.h" #include "icons.h"
#include <utility>
#include "polygons.h" #include "polygons.h"
#include <AreaEffectSimulation/aes.hpp> #include <AreaEffectSimulation/aes.hpp>
#include <LtsCoordTrans/lts_coord_trans.h> #include <LtsCoordTrans/lts_coord_trans.h>
#include <QtGui/QGuiApplication> #include <QGuiApplication>
#include <QtGui/QIcon> #include <QIcon>
#include <QtGui/QPainter> #include <QPainter>
#include <QtGui/QPixmap> #include <QPixmap>
#include <QTransform> #include <QTransform>
namespace AreaEffectSimulation namespace AreaEffectSimulation
@@ -55,7 +54,7 @@ static QPixmap pixmapFromPolygons(const QVector<PolygonData> &datas,
for (const PolygonData &data : datas) for (const PolygonData &data : datas)
{ {
polyUtm.clear(); polyUtm.clear();
for (const QPointF &point : std::as_const(data.poly)) for (const QPointF &point : qAsConst(data.poly))
{ {
LtsCoordTrans::UtmCoordinate pointUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(point, zone); LtsCoordTrans::UtmCoordinate pointUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(point, zone);
polyUtm << QPointF(pointUtm.x, pointUtm.y); polyUtm << QPointF(pointUtm.x, pointUtm.y);
@@ -67,7 +66,7 @@ static QPixmap pixmapFromPolygons(const QVector<PolygonData> &datas,
bounding.reserve(4 * datas.size()); bounding.reserve(4 * datas.size());
// Does not matter, how the total polygon looks as we just need the bounding rect. // Does not matter, how the total polygon looks as we just need the bounding rect.
// << is cheaper than .united() // << is cheaper than .united()
for (const QPolygonF &polyUtmLocal : std::as_const(polysUtm)) for (const QPolygonF &polyUtmLocal : qAsConst(polysUtm))
bounding << polyUtmLocal; bounding << polyUtmLocal;
// center to center / Todo:: Does it always work? // center to center / Todo:: Does it always work?
@@ -90,7 +89,7 @@ static QPixmap pixmapFromPolygons(const QVector<PolygonData> &datas,
QPainter p(&pix); QPainter p(&pix);
int i = 0; int i = 0;
for (const PolygonData &d : std::as_const(datas)) for (const PolygonData &d : qAsConst(datas))
{ {
QPolygonF mPoly = mTrans.map(polysUtm.at(i++)); QPolygonF mPoly = mTrans.map(polysUtm.at(i++));
mPoly = mScale.map(mPoly); mPoly = mScale.map(mPoly);
@@ -6,7 +6,6 @@
*/ */
#include "polygons.h" #include "polygons.h"
#include <utility>
#include "tne_algorithmen.h" #include "tne_algorithmen.h"
#include <aes.hpp> #include <aes.hpp>
@@ -15,8 +14,8 @@
#include <LtsCoordTrans/lts_coord_trans.h> #include <LtsCoordTrans/lts_coord_trans.h>
#include <LtsCoordinate/lts_coord_vector.h> #include <LtsCoordinate/lts_coord_vector.h>
#include <LtsCoordinate/lts_coordinate.h> #include <LtsCoordinate/lts_coordinate.h>
#include <LtsUtils/LtsUtilsCore/qpoint3d.h> #include <LtsUtilsCore/qpoint3d.h>
#include <ParticipantManagement/ppm.hpp> #include <ParticipantManagement/ppm_dtc.h>
#include <ProjectDataManagement/pdm_db_structs.h> #include <ProjectDataManagement/pdm_db_structs.h>
#include <Trajectory/trajectory_helper.h> #include <Trajectory/trajectory_helper.h>
@@ -113,7 +112,7 @@ static QPolygonF utmToGeogrphic(const QPolygonF &polyUtm, const LtsCoordTrans::U
{ {
QPolygonF poly; QPolygonF poly;
poly.reserve(polyUtm.size()); poly.reserve(polyUtm.size());
for (const QPointF &point : std::as_const(polyUtm)) for (const QPointF &point : qAsConst(polyUtm))
poly << base.geographic(point); poly << base.geographic(point);
return poly; return poly;
} }
@@ -477,7 +476,7 @@ QVector<QPointF> effectClusterSingleExplosionsGAUSS(const Database::AesEffectClu
vec.reserve(impactCount); vec.reserve(impactCount);
const QTransform trans(fromRotation(-effectCluster.rotationAngle)); // Compass, not mathematical! const QTransform trans(fromRotation(-effectCluster.rotationAngle)); // Compass, not mathematical!
for (const QPointF &point : std::as_const(impactsGAUSS)) for (const QPointF &point : qAsConst(impactsGAUSS))
{ {
QPointF p = impactPositionUtm.geographic(trans.map(point)); QPointF p = impactPositionUtm.geographic(trans.map(point));
DEBUG_LOG(logger) << "Point = " << p; DEBUG_LOG(logger) << "Point = " << p;
@@ -553,7 +552,7 @@ QVector<QPointF> effectClusterSingleExplosionsGAUSS_Mtp(const Database::AesEffec
QVector<LtsCoordTrans::UtmCoordinate> mtps_asRealUtm; QVector<LtsCoordTrans::UtmCoordinate> mtps_asRealUtm;
mtps_asRealUtm.reserve(mtps_asUtm.size()); mtps_asRealUtm.reserve(mtps_asUtm.size());
for (const QPointF &mtp_asUtm : std::as_const(mtps_asUtm)) for (const QPointF &mtp_asUtm : qAsConst(mtps_asUtm))
{ {
// convert QPointF back to UtmCoordinate: pay attention to order!!! // convert QPointF back to UtmCoordinate: pay attention to order!!!
const LtsCoordTrans::UtmCoordinate mtpUtm(impactPositionUtm.zone, mtp_asUtm.x(), mtp_asUtm.y()); const LtsCoordTrans::UtmCoordinate mtpUtm(impactPositionUtm.zone, mtp_asUtm.x(), mtp_asUtm.y());
@@ -592,7 +591,7 @@ QVector<QPointF> effectClusterSingleExplosionsGAUSS_Mtp(const Database::AesEffec
int idx = 0; int idx = 0;
const QTransform transform(fromRotation(-mtpRotationNorthDegree)); // Compass, not mathematical! const QTransform transform(fromRotation(-mtpRotationNorthDegree)); // Compass, not mathematical!
for (const QPointF &point : std::as_const(impactsGAUSS)) for (const QPointF &point : qAsConst(impactsGAUSS))
{ {
// which mtp: // which mtp:
int mtpIdx = (idx++ % mtps_asUtm.size()); // modulo int mtpIdx = (idx++ % mtps_asUtm.size()); // modulo
@@ -607,7 +606,7 @@ QVector<QPointF> effectClusterSingleExplosionsGAUSS_Mtp(const Database::AesEffec
<< ", randomNumber=" << randomNumber << " singleWidthOut=" << singleWidthOut << " singleHeightOut=" << singleHeightOut << ", randomNumber=" << randomNumber << " singleWidthOut=" << singleWidthOut << " singleHeightOut=" << singleHeightOut
<< " rot=" << explosionCluster.rotationAngle; << " rot=" << explosionCluster.rotationAngle;
for (auto item : std::as_const(finalVec)) for (auto item : qAsConst(finalVec))
{ {
const LtsCoordTrans::UtmCoordinate &utm = LtsCoordTrans::UtmCoordinate::fromGeographic(item); const LtsCoordTrans::UtmCoordinate &utm = LtsCoordTrans::UtmCoordinate::fromGeographic(item);
qCritical() << " TNE VERIFICATION: CHECK:" qCritical() << " TNE VERIFICATION: CHECK:"
@@ -901,7 +900,7 @@ QVector<QPointF> explosionClusterSingleExplosionsGAUSS(const Database::AesExplos
vec.reserve(impactCount); vec.reserve(impactCount);
const QTransform trans(fromRotation(-explosionCluster.rotationAngle)); // Compass, not mathematical! const QTransform trans(fromRotation(-explosionCluster.rotationAngle)); // Compass, not mathematical!
for (const QPointF &point : std::as_const(impactsGAUSS)) for (const QPointF &point : qAsConst(impactsGAUSS))
{ {
QPointF p = impactPositionUtm.geographic(trans.map(point)); QPointF p = impactPositionUtm.geographic(trans.map(point));
DEBUG_LOG(logger) << "Point = " << p; DEBUG_LOG(logger) << "Point = " << p;
@@ -978,7 +977,7 @@ QVector<QPointF> explosionClusterSingleExplosionsGAUSS_Mtp(const Database::AesEx
QVector<LtsCoordTrans::UtmCoordinate> mtps_asRealUtm; QVector<LtsCoordTrans::UtmCoordinate> mtps_asRealUtm;
mtps_asRealUtm.reserve(mtps_asUtm.size()); mtps_asRealUtm.reserve(mtps_asUtm.size());
for (const QPointF &mtp_asUtm : std::as_const(mtps_asUtm)) for (const QPointF &mtp_asUtm : qAsConst(mtps_asUtm))
{ {
// convert QPointF back to UtmCoordinate: pay attention to order!!! // convert QPointF back to UtmCoordinate: pay attention to order!!!
const LtsCoordTrans::UtmCoordinate mtpUtm(impactPositionUtm.zone, mtp_asUtm.x(), mtp_asUtm.y()); const LtsCoordTrans::UtmCoordinate mtpUtm(impactPositionUtm.zone, mtp_asUtm.x(), mtp_asUtm.y());
@@ -1017,7 +1016,7 @@ QVector<QPointF> explosionClusterSingleExplosionsGAUSS_Mtp(const Database::AesEx
int idx = 0; int idx = 0;
const QTransform transform(fromRotation(-mtpRotationNorthDegree)); // Compass, not mathematical! const QTransform transform(fromRotation(-mtpRotationNorthDegree)); // Compass, not mathematical!
for (const QPointF &point : std::as_const(impactsGAUSS)) for (const QPointF &point : qAsConst(impactsGAUSS))
{ {
// which mtp: // which mtp:
int mtpIdx = (idx++ % mtps_asUtm.size()); // modulo int mtpIdx = (idx++ % mtps_asUtm.size()); // modulo
@@ -1032,7 +1031,7 @@ QVector<QPointF> explosionClusterSingleExplosionsGAUSS_Mtp(const Database::AesEx
<< ", randomNumber=" << randomNumber << " singleWidthOut=" << singleWidthOut << " singleHeightOut=" << singleHeightOut << ", randomNumber=" << randomNumber << " singleWidthOut=" << singleWidthOut << " singleHeightOut=" << singleHeightOut
<< " rot=" << explosionCluster.rotationAngle; << " rot=" << explosionCluster.rotationAngle;
for (auto item : std::as_const(finalVec)) for (auto item : qAsConst(finalVec))
{ {
const LtsCoordTrans::UtmCoordinate &utm = LtsCoordTrans::UtmCoordinate::fromGeographic(item); const LtsCoordTrans::UtmCoordinate &utm = LtsCoordTrans::UtmCoordinate::fromGeographic(item);
qCritical() << " TNE VERIFICATION: CHECK:" qCritical() << " TNE VERIFICATION: CHECK:"
@@ -1649,7 +1648,7 @@ LtsUtils::QPoint3D calculateFiringUnitCenterNonRecursive(const std::shared_ptr<P
std::vector<Core::GeoPosition> &singlePositionsOut, std::vector<Core::GeoPosition> &singlePositionsOut,
NGL::INGLLogger &logger) NGL::INGLLogger &logger)
{ {
TRACE_LOG(logger) << Q_FUNC_INFO << " START, participantId=" << unitParticipantId; TRACE_LOG(logger) << LOGFUNCTION << " START, participantId=" << unitParticipantId;
static const LtsUtils::QPoint3D s_invalidPos(std::nan(""), std::nan(""), std::nan("")); static const LtsUtils::QPoint3D s_invalidPos(std::nan(""), std::nan(""), std::nan(""));
@@ -1657,7 +1656,7 @@ LtsUtils::QPoint3D calculateFiringUnitCenterNonRecursive(const std::shared_ptr<P
// See also GUEZE-2309 // See also GUEZE-2309
if (!ppmDtc) if (!ppmDtc)
{ {
ERROR_LOG(logger) << Q_FUNC_INFO << " ERROR, no ppmDtc"; ERROR_LOG(logger) << LOGFUNCTION << " ERROR, no ppmDtc";
return s_invalidPos; return s_invalidPos;
} }
ppmDtc->waitForHistoricalDataParticipant(1000); ppmDtc->waitForHistoricalDataParticipant(1000);
@@ -1665,7 +1664,7 @@ LtsUtils::QPoint3D calculateFiringUnitCenterNonRecursive(const std::shared_ptr<P
const ParticipantManagement::Participant &partData = ppmDtc->participant(unitParticipantId); const ParticipantManagement::Participant &partData = ppmDtc->participant(unitParticipantId);
if (partData.id() != unitParticipantId) if (partData.id() != unitParticipantId)
{ {
ERROR_LOG(logger) << Q_FUNC_INFO << " ERROR, participant failed for id =" << unitParticipantId; ERROR_LOG(logger) << LOGFUNCTION << " ERROR, participant failed for id =" << unitParticipantId;
return s_invalidPos; return s_invalidPos;
} }
ppmDtc->waitForHistoricalDataParticipantPosition(1000); ppmDtc->waitForHistoricalDataParticipantPosition(1000);
@@ -1679,13 +1678,13 @@ LtsUtils::QPoint3D calculateFiringUnitCenterNonRecursive(const std::shared_ptr<P
int childCount = 0; int childCount = 0;
LtsUtils::QPoint3D pos; LtsUtils::QPoint3D pos;
for (int childId : std::as_const(childIds)) for (int childId : qAsConst(childIds))
{ {
const ParticipantManagement::ParticipantPosition &childPos = ppmDtc->participantPosition(childId); const ParticipantManagement::ParticipantPosition &childPos = ppmDtc->participantPosition(childId);
if (childPos.participantId() != childId) if (childPos.participantId() != childId)
{ {
// may happen in real life: so ERROR_LOG to DEBUG_LOG // may happen in real life: so ERROR_LOG to DEBUG_LOG
DEBUG_LOG(logger) << Q_FUNC_INFO << " ERROR, participantPosition failed for id =" << childId; DEBUG_LOG(logger) << LOGFUNCTION << " ERROR, participantPosition failed for id =" << childId;
return s_invalidPos; return s_invalidPos;
} }
const Core::GeoPosition &childGeoPos = childPos.pos(); const Core::GeoPosition &childGeoPos = childPos.pos();
@@ -1710,7 +1709,7 @@ LtsUtils::QPoint3D calculateFiringUnitCenterNonRecursive(const std::shared_ptr<P
} }
DEBUG_LOG(logger) << "Participant " << unitParticipantId << ": Mean position: " << centerPosToReturn << " #relevant children: " << childCount; DEBUG_LOG(logger) << "Participant " << unitParticipantId << ": Mean position: " << centerPosToReturn << " #relevant children: " << childCount;
TRACE_LOG(logger) << Q_FUNC_INFO << " END, participantId=" << unitParticipantId; TRACE_LOG(logger) << LOGFUNCTION << " END, participantId=" << unitParticipantId;
return centerPosToReturn; return centerPosToReturn;
} }
@@ -1732,7 +1731,7 @@ std::vector<Core::GeoPosition2D> dangerAreaDefaultSegments(const QPointF &center
// polyUtm = QTransform().rotate(0).map(polyUtm); // polyUtm = QTransform().rotate(0).map(polyUtm);
LtsCoordTrans::UtmCoordinate impactPositionUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(centerPos); LtsCoordTrans::UtmCoordinate impactPositionUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(centerPos);
const QPolygonF poly(utmToGeogrphic(polyUtm, impactPositionUtm)); const QPolygonF poly(utmToGeogrphic(polyUtm, impactPositionUtm));
for (const auto &p : std::as_const(poly)) for (const auto &p : qAsConst(poly))
segments.push_back(Core::GeoPosition2D(p.x(), p.y())); segments.push_back(Core::GeoPosition2D(p.x(), p.y()));
return segments; return segments;
@@ -10,9 +10,9 @@
#include <AreaEffectSimulation/aes_db_structs.h> #include <AreaEffectSimulation/aes_db_structs.h>
#include <ProjectDataManagement/pdm_enums.hpp> #include <ProjectDataManagement/pdm_enums.hpp>
#include <QtGui/QColor> #include <QColor>
#include <QPolygonF> #include <QPolygonF>
#include <QtCore/QRectF> #include <QRectF>
class QPointF; class QPointF;
@@ -12,9 +12,9 @@
#include "icons.h" #include "icons.h"
#include "polygons.h" #include "polygons.h"
#include <QtWidgets/QWidget> #include <QWidget>
#include <QtWidgets/QLabel> #include <QLabel>
#include <QtGui/QIcon> #include <QIcon>
#include <LtsCoordTrans/lts_coord_trans.h> #include <LtsCoordTrans/lts_coord_trans.h>
@@ -8,10 +8,10 @@
#pragma once #pragma once
#include "svcaescommon_export.h" #include <AreaEffectSimulation/aes_export.h>
#include <QtCore/QVector> #include <QVector>
#include <QtCore/QPointF> #include <QPointF>
namespace AreaEffectSimulation namespace AreaEffectSimulation
@@ -6,14 +6,13 @@
*/ */
#include "handler_explosion_single_central.h" #include "handler_explosion_single_central.h"
#include <utility>
#include "main_handler.h" #include "main_handler.h"
#include <LtsCoordTrans/lts_coord_trans.h> #include <LtsCoordTrans/lts_coord_trans.h>
#include <QPolygonF> #include <QPolygonF>
#include <QTransform> #include <QTransform>
#include <QtCore/QFileInfo> #include <QFileInfo>
namespace AreaEffectSimulation namespace AreaEffectSimulation
@@ -36,7 +35,7 @@ bool HandlerExplosionSingleCentral::init()
return true; return true;
} }
// create indirect fire single objects // create indirect fire single objects
for (const Database::AesExplosionSingleCentral &dbData : std::as_const(dataVec)) for (const Database::AesExplosionSingleCentral &dbData : qAsConst(dataVec))
{ {
ObjectExplosionSingleCentral *ifs(new ObjectExplosionSingleCentral(m_mainHandler, this)); ObjectExplosionSingleCentral *ifs(new ObjectExplosionSingleCentral(m_mainHandler, this));
connect(ifs, &ObjectExplosionSingleCentral::effectStateChanged, this, &HandlerExplosionSingleCentral::onEffectStateChanged); connect(ifs, &ObjectExplosionSingleCentral::effectStateChanged, this, &HandlerExplosionSingleCentral::onEffectStateChanged);
@@ -12,8 +12,8 @@
#include <Viewer/SituationMap/ElevationMap/elevation_map.h> #include <Viewer/SituationMap/ElevationMap/elevation_map.h>
#include <QtCore/QMap> #include <QMap>
#include <QtCore/QTimer> #include <QTimer>
namespace SituationMap namespace SituationMap
@@ -10,9 +10,9 @@
#include "object_base.h" #include "object_base.h"
#include <CentralEffectSimulation/ces_ftc.h> #include <CentralEffectSimulation/ces_ftc.h>
#include <LtsUtils/LtsUtilsCore/qpoint3d.h> #include <LtsUtilsCore/qpoint3d.h>
#include <QtCore/QObject> #include <QObject>
using Trajectory = QPair<QPolygonF, QVector<double>>; using Trajectory = QPair<QPolygonF, QVector<double>>;
@@ -6,7 +6,6 @@
* $Author$ * $Author$
*/ */
#include "aes_dtc_impl_custom.h" #include "aes_dtc_impl_custom.h"
#include <utility>
#include <DDS/DTC/generic_dtc.h> #include <DDS/DTC/generic_dtc.h>
#include <DDS/Generic/generic_data_reader.h> #include <DDS/Generic/generic_data_reader.h>
#include <QElapsedTimer> #include <QElapsedTimer>
@@ -121,7 +120,7 @@ AreaEffectSimulation::AesType DtcImplCustom::aesItemIdFromExternalId(long long e
QMap<qint32, AreaEffectSimulation::BCContamination> bcConts = bCContaminations(); QMap<qint32, AreaEffectSimulation::BCContamination> bcConts = bCContaminations();
aesItemId = 0; aesItemId = 0;
for (const AreaEffectSimulation::BCContamination &bcCont : std::as_const(bcConts)) for (const AreaEffectSimulation::BCContamination &bcCont : qAsConst(bcConts))
{ {
if (bcCont.externalId() == externalId) if (bcCont.externalId() == externalId)
{ {
@@ -133,7 +132,7 @@ AreaEffectSimulation::AesType DtcImplCustom::aesItemIdFromExternalId(long long e
return AreaEffectSimulation::AesType_def::AtBCContamination; return AreaEffectSimulation::AesType_def::AtBCContamination;
QMap<qint32, AreaEffectSimulation::NContamination> nConts = nContaminations(); QMap<qint32, AreaEffectSimulation::NContamination> nConts = nContaminations();
for (const AreaEffectSimulation::NContamination &nCont: std::as_const(nConts)) for (const AreaEffectSimulation::NContamination &nCont: qAsConst(nConts))
{ {
if (nCont.externalId() == externalId) if (nCont.externalId() == externalId)
{ {
@@ -145,7 +144,7 @@ AreaEffectSimulation::AesType DtcImplCustom::aesItemIdFromExternalId(long long e
return AreaEffectSimulation::AesType_def::AtNContamination; return AreaEffectSimulation::AesType_def::AtNContamination;
QMap<qint32, AreaEffectSimulation::ExplosionArea> explAreas = explosionAreas(); QMap<qint32, AreaEffectSimulation::ExplosionArea> explAreas = explosionAreas();
for (const AreaEffectSimulation::ExplosionArea &explArea : std::as_const(explAreas)) for (const AreaEffectSimulation::ExplosionArea &explArea : qAsConst(explAreas))
{ {
if (explArea.externalId() == externalId) if (explArea.externalId() == externalId)
{ {
@@ -157,7 +156,7 @@ AreaEffectSimulation::AesType DtcImplCustom::aesItemIdFromExternalId(long long e
return AreaEffectSimulation::AesType_def::AtExplosionArea; return AreaEffectSimulation::AesType_def::AtExplosionArea;
QMap<qint32, AreaEffectSimulation::ExplosionSingle> explSingles = explosionSingles(); QMap<qint32, AreaEffectSimulation::ExplosionSingle> explSingles = explosionSingles();
for (const AreaEffectSimulation::ExplosionSingle &explSingle : std::as_const(explSingles)) for (const AreaEffectSimulation::ExplosionSingle &explSingle : qAsConst(explSingles))
{ {
if (explSingle.externalId() == externalId) if (explSingle.externalId() == externalId)
{ {
@@ -169,7 +168,7 @@ AreaEffectSimulation::AesType DtcImplCustom::aesItemIdFromExternalId(long long e
return AreaEffectSimulation::AesType_def::AtExplosionSingle; return AreaEffectSimulation::AesType_def::AtExplosionSingle;
QMap<qint32, AreaEffectSimulation::MineArea> mAreas = mineAreas(); QMap<qint32, AreaEffectSimulation::MineArea> mAreas = mineAreas();
for(const AreaEffectSimulation::MineArea &mArea : std::as_const(mAreas)) for(const AreaEffectSimulation::MineArea &mArea : qAsConst(mAreas))
{ {
if (mArea.externalId() == externalId) if (mArea.externalId() == externalId)
{ {
@@ -181,7 +180,7 @@ AreaEffectSimulation::AesType DtcImplCustom::aesItemIdFromExternalId(long long e
return AreaEffectSimulation::AesType_def::AtMineArea; return AreaEffectSimulation::AesType_def::AtMineArea;
QMap<qint32, AreaEffectSimulation::MineCorridor> mCorridors = mineCorridors(); QMap<qint32, AreaEffectSimulation::MineCorridor> mCorridors = mineCorridors();
for (const AreaEffectSimulation::MineCorridor &mCorridor : std::as_const(mCorridors)) for (const AreaEffectSimulation::MineCorridor &mCorridor : qAsConst(mCorridors))
{ {
if (mCorridor.externalId() == externalId) if (mCorridor.externalId() == externalId)
{ {
@@ -353,7 +352,7 @@ QVector<TrajectoryTimeAware> DtcImplCustom::trajectoriesTimeAwareFromOriginatorI
const QMap<qint32, AreaEffectSimulation::TrajectoryTimeAware> &trajectoryTimeAwareMap = trajectoryTimeAwares(); const QMap<qint32, AreaEffectSimulation::TrajectoryTimeAware> &trajectoryTimeAwareMap = trajectoryTimeAwares();
for (const AreaEffectSimulation::TrajectoryTimeAware &trajectoryTimeAware : std::as_const(trajectoryTimeAwareMap)) for (const AreaEffectSimulation::TrajectoryTimeAware &trajectoryTimeAware : qAsConst(trajectoryTimeAwareMap))
{ {
// be aware of: [E01562-259] use originatorId, originatorTypeId (instead of aesItemId, aesTypeId) // be aware of: [E01562-259] use originatorId, originatorTypeId (instead of aesItemId, aesTypeId)
if ((trajectoryTimeAware.originatorId() == originatorId) && if ((trajectoryTimeAware.originatorId() == originatorId) &&
@@ -402,7 +401,7 @@ void DtcImplCustom::initDAO()
// // We don´t realy know, how many to reserve: // // We don´t realy know, how many to reserve:
// trajectoriesFromAesIdVec.reserve(120); // 2024-09 N.Thoden: 120 ist maximum per area // trajectoriesFromAesIdVec.reserve(120); // 2024-09 N.Thoden: 120 ist maximum per area
// for (const AreaEffectSimulation::TrajectoryTimeAware &trajectoryTimeAware : std::as_const(trajectoryTimeAwareMap)) // for (const AreaEffectSimulation::TrajectoryTimeAware &trajectoryTimeAware : qAsConst(trajectoryTimeAwareMap))
// { // {
// if (trajectoryTimeAware.aesItemId() == aesId) // if (trajectoryTimeAware.aesItemId() == aesId)
// trajectoriesFromAesIdVec.push_back(trajectoryTimeAware); // trajectoriesFromAesIdVec.push_back(trajectoryTimeAware);
@@ -12,16 +12,18 @@
#include <DDS/Core/pacemaker.h> #include <DDS/Core/pacemaker.h>
#include <DDS/Core/core_dtc.h> #include <DDS/Core/core_dtc.h>
#include <TrainingAreaBase/tab_dtc.h> #include <TrainingAreaBase/tab_dtc.h>
#include <QtCore/QCoreApplication> #include <QCoreApplication>
#include <QtCore/QThread> #include <QThread>
namespace AreaEffectSimulation namespace AreaEffectSimulation
{ {
DdsHandler::DdsHandler(int domainId, int exerciseId, QObject *parent) : QObject(parent) DdsHandler::DdsHandler(int domainId, int exerciseId, QObject *parent)
: QObject(parent)
, m_ddsConnector(std::make_shared<DDSConnector::DdsConnector>(domainId, IDL::PartitionType::Exercise, exerciseId)) , m_ddsConnector(std::make_shared<DDSConnector::DdsConnector>(domainId, IDL::PartitionType::Exercise, exerciseId))
, m_currentTimeMSec(-1), , m_currentTimeMSec(-1)
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) { , m_logger(getLogger("DdsInterface"))
{
DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition(); DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
} }
@@ -12,7 +12,7 @@
#include <DDS/Core/core_dtc.h> #include <DDS/Core/core_dtc.h>
#include <DDS/Core/topic_lock_master.h> #include <DDS/Core/topic_lock_master.h>
#include <ProjectDataManagement/pdm_dtc.h> #include <ProjectDataManagement/pdm_dtc.h>
#include <ParticipantManagement/ppm.hpp> #include <ParticipantManagement/ppm_dtc.h>
#include <TrainingAreaBase/tab_ftc.h> #include <TrainingAreaBase/tab_ftc.h>
#include <CentralEffectSimulation/ces_ftc.h> #include <CentralEffectSimulation/ces_ftc.h>
#include <AssetManagement/asm_dtc.h> // For Elevation #include <AssetManagement/asm_dtc.h> // For Elevation
@@ -20,7 +20,7 @@
#include <InfrastructureManagement/ism_dtc.h> #include <InfrastructureManagement/ism_dtc.h>
#include "logger.h" #include "logger.h"
#include <QtCore/QDateTime> #include <QDateTime>
#include <QElapsedTimer> #include <QElapsedTimer>
namespace Core namespace Core
@@ -78,7 +78,6 @@ private slots:
void onPartitionTimeChanged(const Core::PartitionTime &currentTime); void onPartitionTimeChanged(const Core::PartitionTime &currentTime);
private: private:
NGL::INGLLogger &m_logger;
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector; std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
std::shared_ptr<Core::Interface::Dtc> m_dtcCore; std::shared_ptr<Core::Interface::Dtc> m_dtcCore;
std::shared_ptr<Core::Pacemaker> m_pacemaker; std::shared_ptr<Core::Pacemaker> m_pacemaker;
@@ -96,6 +95,8 @@ private:
QElapsedTimer m_elapsedTimer; QElapsedTimer m_elapsedTimer;
qint64 m_currentTimeMSec; qint64 m_currentTimeMSec;
NGL::INGLLogger &m_logger;
}; };
} }
Loaded 100 of 1244 files, more files were not shown because too many files have changed in this diff. Show more