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:
1 parent
c143ff8a4f
commit
d5af8b9764
1244 files changed
+4266
-4633
No files matched your search
@@ -32,13 +32,12 @@ CODEGEN_TOPIC_TYPEDEFS(SRCS_common ${xml_FILE})
|
||||
# generate exm_[d|f]tc.h
|
||||
CODEGEN_CLIENT_TOPICS_IFC(SRCS_common ${xml_FILE})
|
||||
|
||||
NGL_ADD_LIBRARY2(AAR SV WS HLA svcExmCommon SHARED ${SRCS_common})
|
||||
NGL_ADD_LIBRARY(AAR SV WS HLA svcExmCommon SHARED ${SRCS_common})
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(svcExmCommon
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
${CMAKE_CURRENT_BINARY_DIR}/../
|
||||
)
|
||||
IF(BUILD_RTI)
|
||||
NGL_TARGET_LINK_LIBRARIES(svcExmCommon
|
||||
PRIVATE
|
||||
RTI::nddscpp2
|
||||
@@ -49,7 +48,6 @@ NGL_TARGET_LINK_LIBRARIES(svcExmCommon
|
||||
ngldb
|
||||
LtsUtilsCore
|
||||
)
|
||||
ENDIF(BUILD_RTI)
|
||||
NGL_INSTALL_TARGET(svcExmCommon)
|
||||
|
||||
#
|
||||
@@ -61,14 +59,13 @@ SET(SRCS_client
|
||||
# generate exm_ftc_impl.[cpp|h]
|
||||
CODEGEN_CLIENT_TOPICS_IMPL(SRCS_client ${xml_FILE})
|
||||
|
||||
NGL_ADD_LIBRARY2(AAR SV WS HLA svcExmClient SHARED ${SRCS_client})
|
||||
NGL_ADD_LIBRARY(AAR SV WS HLA svcExmClient SHARED ${SRCS_client})
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(svcExmClient
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
${CMAKE_CURRENT_BINARY_DIR}/../
|
||||
)
|
||||
|
||||
IF(BUILD_RTI)
|
||||
NGL_TARGET_LINK_LIBRARIES(svcExmClient
|
||||
PRIVATE
|
||||
RTI::nddscpp2
|
||||
@@ -77,7 +74,6 @@ NGL_TARGET_LINK_LIBRARIES(svcExmClient
|
||||
svcExmCommon
|
||||
ddsftc
|
||||
)
|
||||
ENDIF(BUILD_RTI)
|
||||
NGL_INSTALL_TARGET(svcExmClient)
|
||||
|
||||
#
|
||||
@@ -90,14 +86,13 @@ SET(SRCS_server
|
||||
# generate exm_[d|f]ts.h, exm_[d|f]ts_impl.[cpp|h]
|
||||
CODEGEN_SERVER_TOPICS(SRCS_server ${xml_FILE})
|
||||
|
||||
NGL_ADD_LIBRARY2(WS AAR SV svcExmServer SHARED ${SRCS_server})
|
||||
NGL_ADD_LIBRARY(WS AAR SV svcExmServer SHARED ${SRCS_server})
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(svcExmServer
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
${CMAKE_CURRENT_BINARY_DIR}/../
|
||||
)
|
||||
|
||||
IF(BUILD_RTI)
|
||||
NGL_TARGET_LINK_LIBRARIES(svcExmServer
|
||||
PRIVATE
|
||||
RTI::nddscpp2
|
||||
@@ -108,7 +103,6 @@ NGL_TARGET_LINK_LIBRARIES(svcExmServer
|
||||
svcExmCommon
|
||||
ngldb
|
||||
)
|
||||
ENDIF(BUILD_RTI)
|
||||
NGL_INSTALL_TARGET(svcExmServer)
|
||||
|
||||
#
|
||||
|
||||
+3
-3
@@ -19,10 +19,10 @@
|
||||
#include <ExerciseManagement/settings.h>
|
||||
#include <ExerciseManagement/logger.h>
|
||||
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QCoreApplication>
|
||||
#include <QDebug>
|
||||
#include <QSignalSpy>
|
||||
#include <QtTest/QTest>
|
||||
#include <QTest>
|
||||
#include <nglapplication/nglcoreapplication.h>
|
||||
#include <ngltools/ngltools_filesystem.h>
|
||||
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QObject>
|
||||
#include <memory>
|
||||
#include <ExerciseManagement/exm_db.h>
|
||||
#include <ngldb/db_service_handler.h>
|
||||
|
||||
+3
-2
@@ -11,8 +11,8 @@
|
||||
|
||||
#include <nglapplication/nglcoreapplication.h>
|
||||
#include <LtsCommandLineParser/LtsCommandLineParser.h>
|
||||
#include <QtCore/QTimer>
|
||||
#include <QtTest/QTest>
|
||||
#include <QTimer>
|
||||
#include <QTest>
|
||||
|
||||
#include <ExerciseManagement/exm_ftc.h>
|
||||
#include <AssetManagement/asm_ftc.h>
|
||||
@@ -39,6 +39,7 @@ ExmTests::ExmTests(QObject *parent)
|
||||
, m_phaseId(0)
|
||||
, m_testId(0)
|
||||
, m_bTestsSuccessful(true)
|
||||
, m_logger(getLogger("Test"))
|
||||
{
|
||||
qRegisterMetaType<Core::FunctionReply>("Core::FunctionReply");
|
||||
}
|
||||
|
||||
+7
-6
@@ -12,17 +12,18 @@
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
#include <DDS/QosProfile/DDS_DefaultQos.h>
|
||||
#include <Lts/Common/ProjectConfig/project_defines.h>
|
||||
#include <Common/ProjectConfig/project_defines.h>
|
||||
#include <DDS/DTS/generic_dts_impl.h>
|
||||
#include <DDS/DTC/generic_dtc_impl.h>
|
||||
|
||||
#include <QtTest/QTest>
|
||||
#include <QtCore/QVariant>
|
||||
#include <QtCore/QThread>
|
||||
#include <QVariant>
|
||||
#include <QThread>
|
||||
|
||||
|
||||
|
||||
DataTopicTests::DataTopicTests() : m_domainParticipantPub(nullptr)
|
||||
DataTopicTests::DataTopicTests()
|
||||
: m_domainParticipantPub(nullptr)
|
||||
, m_domainParticipantSub(nullptr)
|
||||
, m_domainId(0)
|
||||
, m_ddsPublisher(nullptr)
|
||||
@@ -32,8 +33,8 @@ DataTopicTests::DataTopicTests() : m_domainParticipantPub(nullptr)
|
||||
, m_subscriberListenerBinder(nullptr)
|
||||
, m_dtcExercise(nullptr)
|
||||
, m_mainThreadId(QThread::currentThreadId())
|
||||
.getNGLLogger("UnitTests.DataTopicTests")),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("UnitTests.DataTopicTests"))
|
||||
{
|
||||
if (!DDS::QosProfile::setDefault())
|
||||
ERROR_LOG(m_logger) << "Error setting default QoS from xml-file ";
|
||||
|
||||
|
||||
+4
-3
@@ -8,13 +8,13 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QObject>
|
||||
#include <DDS/Generic/subscriber_listener.h>
|
||||
|
||||
// For Topic Exercise
|
||||
#include <ExerciseManagement/exm_dtc_types.h>
|
||||
#include <ExerciseManagement/exm_dts_types.h>
|
||||
#include <LtsUtils/LtsUtilsCore/data_modification_enum.h>
|
||||
#include <LtsUtilsCore/data_modification_enum.h>
|
||||
|
||||
#include <ExerciseManagement/exm.hpp>
|
||||
#include <rti/core/ListenerBinder.hpp>
|
||||
@@ -42,7 +42,6 @@ public:
|
||||
ExerciseManagement::Exercise getReceivedExerciseData() const { return m_receivedExerciseData; }
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
// Subscriber Methods
|
||||
void processData(const ExerciseManagement::Exercise& instance, DataModification modType);
|
||||
|
||||
@@ -68,6 +67,8 @@ private:
|
||||
Qt::HANDLE m_mainThreadId;
|
||||
// For returning TestData
|
||||
ExerciseManagement::Exercise m_receivedExerciseData;
|
||||
|
||||
NGL::INGLLogger& m_logger;
|
||||
};
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
|
||||
#include <QtTest/QTest>
|
||||
|
||||
#include <Lts/Common/ProjectConfig/project_defines.h>
|
||||
#include <Common/ProjectConfig/project_defines.h>
|
||||
#include <nglapplication/nglcoreapplication.h>
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
|
||||
+3
-2
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QObject>
|
||||
#include <QSignalSpy>
|
||||
#include <ExerciseManagement/exm_dts_types.h>
|
||||
|
||||
@@ -35,11 +35,12 @@ private Q_SLOTS:
|
||||
|
||||
protected:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
private:
|
||||
ExerciseManagement::Exercise m_sentExerciseData;
|
||||
QSignalSpy *m_exerciseDataArrivedSpy = nullptr;
|
||||
DataTopicTests *m_dtTest = nullptr;
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
+6
-4
@@ -11,18 +11,20 @@
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
#include <DDS/QosProfile/DDS_DefaultQos.h>
|
||||
#include <Lts/Common/ProjectConfig/project_defines.h>
|
||||
#include <Common/ProjectConfig/project_defines.h>
|
||||
|
||||
|
||||
Initialisation::Initialisation() : m_domainParticipant(nullptr)
|
||||
Initialisation::Initialisation()
|
||||
: m_domainParticipant(nullptr)
|
||||
, m_domainParticipantSub(nullptr)
|
||||
, m_domainId(0)
|
||||
, m_partitionId(-1)
|
||||
, m_ddsPublisher(nullptr)
|
||||
, m_ddsSubscriber(nullptr)
|
||||
, m_subListener(new DTC::SubscriberListener)
|
||||
.getNGLLogger("UnitTests.Initialisation")),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("UnitTests.Initialisation"))
|
||||
|
||||
{
|
||||
DDS::DefaultQos defaultQos;
|
||||
|
||||
//if (!defaultQos.setDefaultQos(QStringList("/shd/CTC/SV/.default_dds_profile.xml")))
|
||||
|
||||
+2
-1
@@ -38,7 +38,6 @@ public:
|
||||
DTC::SubscriberListener *getSubscriberListener() { return m_subListener; }
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
dds::domain::DomainParticipant m_domainParticipant;
|
||||
dds::domain::DomainParticipant m_domainParticipantSub;
|
||||
int m_domainId;
|
||||
@@ -47,6 +46,8 @@ private:
|
||||
dds::sub::Subscriber m_ddsSubscriber;
|
||||
|
||||
DTC::SubscriberListener *m_subListener;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -10,8 +10,8 @@
|
||||
|
||||
#include <LtsWebSocket/reply_message.h>
|
||||
|
||||
#include <QtCore/QJsonArray>
|
||||
#include <QtCore/QString>
|
||||
#include <QJsonArray>
|
||||
#include <QString>
|
||||
#include <QtCore/QVector>
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QString>
|
||||
#include <QString>
|
||||
|
||||
#include <OcBaseDownload/WebSocketInterface/json_keys.h>
|
||||
|
||||
|
||||
+1
@@ -24,6 +24,7 @@ WebSocketInterfaceHandler::WebSocketInterfaceHandler(MainHandler *mainHandler, Q
|
||||
, m_messageFactory(nullptr)
|
||||
, m_dataManager(nullptr)
|
||||
, m_mainHandler(mainHandler)
|
||||
, m_logger(getLogger("WebSocketInterfaceHandler"))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
#include <ExerciseManagement/exm_db.h>
|
||||
#include <ExerciseManagement/exm.hpp>
|
||||
|
||||
#include <Lts/Common/ProjectConfig/project_defines.h>
|
||||
#include <LtsUtils/LtsUtilsCore/dds_vector.h>
|
||||
#include <Common/ProjectConfig/project_defines.h>
|
||||
#include <LtsUtilsCore/dds_vector.h>
|
||||
|
||||
namespace ExerciseManagement
|
||||
{
|
||||
|
||||
@@ -15,6 +15,7 @@ namespace ExerciseManagement
|
||||
|
||||
DdsHandler::DdsHandler(int domainId)
|
||||
: m_ddsConnector(std::make_shared<DDSConnector::DdsConnector>(domainId, IDL::PartitionType::Any))
|
||||
, m_logger(getLogger("DdsHandler"))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <ExerciseManagement/exm_dts.h>
|
||||
#include <ExerciseManagement/exm_fts.h>
|
||||
#include <ServiceManagement/scm_ftc.h>
|
||||
#include <ParticipantManagement/ppm.hpp> // for checkEquipmentNumbersOnAllExercises
|
||||
#include <ParticipantManagement/ppm_dtc.h> // for checkEquipmentNumbersOnAllExercises
|
||||
#include <AudioVideoManagement/avm_dtc.h> // for checking double cnrconfigs in linked exercise
|
||||
|
||||
#include "logger.h"
|
||||
@@ -42,7 +42,6 @@ public:
|
||||
std::shared_ptr<DDSConnector::DdsConnector> ddsConnector() const { return m_ddsConnector; }
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
|
||||
std::shared_ptr<Core::Pacemaker> m_pacemaker;
|
||||
std::shared_ptr<Core::TopicLockMaster> m_topicLockMaster;
|
||||
@@ -52,6 +51,8 @@ private:
|
||||
|
||||
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_ppmDtc;
|
||||
std::shared_ptr<AudioVideoManagement::Interface::Dtc> m_avmDtc;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
}
|
||||
+3
-6
@@ -24,15 +24,15 @@ namespace ExerciseManagement
|
||||
ExerciseManagement::ExerciseState exerciseState() const { return m_exerciseState; }
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
ExerciseStateBase(const QString &objectName, const ExerciseState &exerciseState, ObjectExercise* objExe);
|
||||
void onEntry(QEvent *event);
|
||||
|
||||
int exerciseId() const { return m_exercise ? m_exercise->id() : -1; }
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
ObjectExercise *m_exercise;
|
||||
ObjectExercise *m_exercise;
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
private:
|
||||
const ExerciseManagement::ExerciseState m_exerciseState;
|
||||
};
|
||||
@@ -50,7 +50,6 @@ namespace ExerciseManagement
|
||||
public:
|
||||
explicit Creation(ObjectExercise *objExe);
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onEntry(QEvent *event);
|
||||
};
|
||||
|
||||
@@ -60,7 +59,6 @@ namespace ExerciseManagement
|
||||
public:
|
||||
explicit Start(ObjectExercise *objExe);
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onEntry(QEvent *event);
|
||||
void onExit(QEvent *event);
|
||||
};
|
||||
@@ -78,7 +76,6 @@ namespace ExerciseManagement
|
||||
public:
|
||||
explicit Stop(ObjectExercise *objExe);
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onEntry(QEvent *event);
|
||||
};
|
||||
|
||||
|
||||
+2
-2
@@ -7,7 +7,6 @@
|
||||
*/
|
||||
|
||||
#include "exercise_state_machine.h"
|
||||
#include <utility>
|
||||
#include "exercise_state_manager.h"
|
||||
#include "exercise_state_base.h"
|
||||
|
||||
@@ -23,6 +22,7 @@ ExerciseStateMachine::ExerciseStateMachine(ObjectExercise* objExe, QObject *pare
|
||||
, m_stateManager(new ExerciseStateManager(objExe, this))
|
||||
, m_stateMachine(new QStateMachine(this))
|
||||
, m_exercise(objExe)
|
||||
, m_logger(getLogger("ExerciseStateMachine"))
|
||||
{
|
||||
qRegisterMetaType<ExerciseManagement::ExerciseState>("ExerciseManagement::ExerciseState");
|
||||
|
||||
@@ -77,7 +77,7 @@ ExerciseStateMachine::ExerciseStateMachine(ObjectExercise* objExe, QObject *pare
|
||||
// ----------------------------------------------------------------------------------------------------------
|
||||
|
||||
//States zur StateMachine hinzufügen
|
||||
for (ExerciseStateBase *state : std::as_const(m_exerciseStates))
|
||||
for (ExerciseStateBase *state : qAsConst(m_exerciseStates))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Ex " << exerciseId() << ": state: " << state->exerciseState();
|
||||
m_stateMachine->addState(state);
|
||||
|
||||
+3
-2
@@ -10,7 +10,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QObject>
|
||||
#include <QStateMachine>
|
||||
|
||||
#include <ExerciseManagement/exm_enums.hpp>
|
||||
@@ -45,7 +45,6 @@ namespace ExerciseManagement
|
||||
void onEnteredState();
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
ExerciseStateBase *getStateFromId(ExerciseManagement::ExerciseState exerciseState);
|
||||
int exerciseId() const;
|
||||
|
||||
@@ -54,6 +53,8 @@ namespace ExerciseManagement
|
||||
QMap<ExerciseManagement::ExerciseState, ExerciseStateBase*> m_exerciseStates;
|
||||
|
||||
ObjectExercise *m_exercise;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
} // namespace ExerciseManagement
|
||||
+1
@@ -19,6 +19,7 @@ namespace ExerciseManagement
|
||||
: QObject(parent)
|
||||
, m_exerciseState(ExerciseState::Unknown)
|
||||
, m_exercise(objExe)
|
||||
, m_logger(getLogger("ExerciseStateManager"))
|
||||
{
|
||||
m_stateSignals[ExerciseState::Unknown] = [&]() { emit stateUnknown(); };
|
||||
m_stateSignals[ExerciseState::Created] = [&]() { emit stateCreated(); };
|
||||
|
||||
+3
-4
@@ -8,9 +8,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QObject>
|
||||
#include <functional>
|
||||
#include <QtCore/QMap>
|
||||
#include <QMap>
|
||||
|
||||
#include <ExerciseManagement/exm_enums.hpp>
|
||||
|
||||
@@ -46,8 +46,6 @@ namespace ExerciseManagement
|
||||
void stateFalse();
|
||||
|
||||
private:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
void setStateInternal(ExerciseManagement::ExerciseState state);
|
||||
int exerciseId() const;
|
||||
|
||||
@@ -55,6 +53,7 @@ namespace ExerciseManagement
|
||||
|
||||
ExerciseManagement::ExerciseState m_exerciseState;
|
||||
ObjectExercise *m_exercise;
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
} // namespace ExerciseManagement
|
||||
+19
-19
@@ -7,21 +7,20 @@
|
||||
*/
|
||||
|
||||
#include "handler_exercise.h"
|
||||
#include <utility>
|
||||
#include "exm_db.h"
|
||||
#include "handler_exercise_phase.h"
|
||||
#include "main_handler.h"
|
||||
#include "object_exercise.h"
|
||||
#include "settings.h"
|
||||
|
||||
//#include <QtGui/QPixmap>
|
||||
#include <QtCore/QTimer>
|
||||
//#include <QPixmap>
|
||||
#include <QTimer>
|
||||
#include <vector>
|
||||
|
||||
#include <LtsUtils/dds_vector_to_pixmap.h>
|
||||
#include <LtsUtilsCore/dds_vector_to_pixmap.h>
|
||||
#include <DBAdministration/exercise_table_generator.h>
|
||||
#include <ngldb/dbtransaction.h>
|
||||
#include <LtsUtils/LtsUtilsCore/dds_vector.h>
|
||||
#include <LtsUtilsCore/dds_vector.h>
|
||||
|
||||
namespace ExerciseManagement
|
||||
{
|
||||
@@ -42,6 +41,7 @@ HandlerExercise::HandlerExercise(MainHandler *mainHandler,
|
||||
, m_db(db)
|
||||
, m_exTblGen(exTableGenerator)
|
||||
, m_startupExerciseTimer(new QTimer(this))
|
||||
, m_logger(getLogger("HandlerExercise"))
|
||||
{
|
||||
//m_imageCache.setMaxCost(15);
|
||||
m_startupExerciseTimer->setSingleShot(false);
|
||||
@@ -70,7 +70,7 @@ bool HandlerExercise::init()
|
||||
QVector<QPair<int, ExerciseState>> exerciseStates;
|
||||
exerciseStates.reserve(dataVec.size());
|
||||
// create exercise objects
|
||||
for (const Database::ExmExercise &data : std::as_const(dataVec))
|
||||
for (const Database::ExmExercise &data : qAsConst(dataVec))
|
||||
{
|
||||
ObjectExercise *ifs(new ObjectExercise(m_ddsHandler, m_db, m_exTblGen, this));
|
||||
Core::FunctionReplyObject ret = ifs->createObject(data);
|
||||
@@ -106,7 +106,7 @@ bool HandlerExercise::init()
|
||||
return a.first < b.first;
|
||||
});
|
||||
|
||||
for (const auto &p : std::as_const(exerciseStates))
|
||||
for (const auto &p : qAsConst(exerciseStates))
|
||||
m_exercisesToStart.enqueue(p.first);
|
||||
m_startupExerciseTimer->start();
|
||||
|
||||
@@ -211,7 +211,7 @@ Core::FunctionReplyObject HandlerExercise::exerciseCreateRequest(const ExerciseC
|
||||
|
||||
int iCnt = 0;
|
||||
QSet<int> linkedExerciseIds;
|
||||
for (const ObjectExercise *ex : std::as_const(m_exeObjMap))
|
||||
for (const ObjectExercise *ex : qAsConst(m_exeObjMap))
|
||||
{
|
||||
const auto state = ex->exerciseState();
|
||||
|
||||
@@ -313,7 +313,7 @@ Core::FunctionReplyObject HandlerExercise::exerciseModifyRequest(const ExerciseM
|
||||
int iCntRunningExercises = 0;
|
||||
QSet<int> linkedExerciseIds;
|
||||
|
||||
for (const ObjectExercise *ex : std::as_const(m_exeObjMap))
|
||||
for (const ObjectExercise *ex : qAsConst(m_exeObjMap))
|
||||
{
|
||||
const auto state = ex->exerciseState();
|
||||
|
||||
@@ -350,7 +350,7 @@ Core::FunctionReplyObject HandlerExercise::exerciseModifyRequest(const ExerciseM
|
||||
if (request.newState() == ExerciseState::Stopped)
|
||||
{
|
||||
int iCnt = 0;
|
||||
for (const ObjectExercise *ex : std::as_const(m_exeObjMap))
|
||||
for (const ObjectExercise *ex : qAsConst(m_exeObjMap))
|
||||
{
|
||||
const auto state = ex->exerciseState();
|
||||
if (ex->id() != request.id() && state == ExerciseState::Stopped)
|
||||
@@ -365,7 +365,7 @@ Core::FunctionReplyObject HandlerExercise::exerciseModifyRequest(const ExerciseM
|
||||
request.newState() == ExerciseState::Paused))
|
||||
{
|
||||
int iCnt = 0;
|
||||
for (const ObjectExercise *ex : std::as_const(m_exeObjMap))
|
||||
for (const ObjectExercise *ex : qAsConst(m_exeObjMap))
|
||||
{
|
||||
if (ex->id() != request.id() && ex->data().hasHlaInterface && (ex->exerciseState() == ExerciseState::Started ||
|
||||
ex->exerciseState() == ExerciseState::Paused))
|
||||
@@ -663,7 +663,7 @@ void HandlerExercise::onStartGroupReply(const Core::FunctionReplyObject &replyOb
|
||||
|
||||
bool HandlerExercise::checkEquipmentNumbersOnAllExercises(int exerciseIdToBeStarted, QString &mesgOut)
|
||||
{
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO <<" START, exerciseIdTobeStarted: " << exerciseIdToBeStarted;
|
||||
INFO_LOG(m_logger) << LOGFUNCTION <<" START, exerciseIdTobeStarted: " << exerciseIdToBeStarted;
|
||||
|
||||
// only one exercise, about to start
|
||||
if (m_exeObjMap.size() <= 1)
|
||||
@@ -684,7 +684,7 @@ bool HandlerExercise::checkEquipmentNumbersOnAllExercises(int exerciseIdToBeStar
|
||||
|
||||
if (!ppmDtcForEx)
|
||||
{
|
||||
WARNING_LOG(m_logger) << Q_FUNC_INFO << " no ppmDtcForEx (" << exerciseIdToBeStarted << ")";
|
||||
WARNING_LOG(m_logger) << LOGFUNCTION << " no ppmDtcForEx (" << exerciseIdToBeStarted << ")";
|
||||
return true;
|
||||
}
|
||||
ppmDtcForEx->enableParticipant();
|
||||
@@ -704,7 +704,7 @@ bool HandlerExercise::checkEquipmentNumbersOnAllExercises(int exerciseIdToBeStar
|
||||
std::shared_ptr<ParticipantManagement::Interface::Dtc> ppmDtc = m_ddsHandler->ppmDtc();
|
||||
if (!ppmDtc)
|
||||
{
|
||||
WARNING_LOG(m_logger) << Q_FUNC_INFO << " no ppmDtc";
|
||||
WARNING_LOG(m_logger) << LOGFUNCTION << " no ppmDtc";
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -723,17 +723,17 @@ bool HandlerExercise::checkEquipmentNumbersOnAllExercises(int exerciseIdToBeStar
|
||||
ObjectExercise *ifs = m_exeObjMap.value(exerciseId);
|
||||
if (!ifs)
|
||||
{
|
||||
ERROR_LOG(m_logger) << Q_FUNC_INFO << " Exercise not found, exId = " << exerciseId;
|
||||
ERROR_LOG(m_logger) << LOGFUNCTION << " Exercise not found, exId = " << exerciseId;
|
||||
return;
|
||||
}
|
||||
if ((ifs->exerciseState() == ExerciseState::Started) ||
|
||||
(ifs->exerciseState() == ExerciseState::Paused))
|
||||
{
|
||||
const std::vector<ParticipantManagement::Equipment2ParticipantId> &mapping = equipmentExerciseMapping.mapping();
|
||||
for (const auto &eq2p : std::as_const(mapping))
|
||||
for (const auto &eq2p : qAsConst(mapping))
|
||||
if (eqNoForEx.contains(eq2p.equipmentNumber()))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " !!! eq = " << eq2p.equipmentNumber() << " is already used in exercise =" << exerciseId;
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " !!! eq = " << eq2p.equipmentNumber() << " is already used in exercise =" << exerciseId;
|
||||
usedEqNumbers[exerciseId].insert(eq2p.equipmentNumber());
|
||||
}
|
||||
}
|
||||
@@ -767,7 +767,7 @@ bool HandlerExercise::checkEquipmentNumbersOnAllExercises(int exerciseIdToBeStar
|
||||
}
|
||||
} // while
|
||||
|
||||
WARNING_LOG(m_logger) << Q_FUNC_INFO << " state change request not allowed: mesgOut:" << mesgOut;
|
||||
WARNING_LOG(m_logger) << LOGFUNCTION << " state change request not allowed: mesgOut:" << mesgOut;
|
||||
|
||||
// limit length:
|
||||
if (mesgOut.size()>200)
|
||||
@@ -811,7 +811,7 @@ QStringList HandlerExercise::doubleChannels(int exerciseAId, int exerciseBId) co
|
||||
|
||||
doubleChannelNames.reserve(exerciseAChannelIds.size());
|
||||
|
||||
for (int exerciseAChannelId : std::as_const(exerciseAChannelIds))
|
||||
for (int exerciseAChannelId : qAsConst(exerciseAChannelIds))
|
||||
{
|
||||
if (exerciseBChannelIds.contains(exerciseAChannelId))
|
||||
doubleChannelNames.append(QString::fromStdString(m_ddsHandler->avmDtc()->cnrChannel(exerciseAChannelId).name()));
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QObject>
|
||||
#include <QQueue>
|
||||
#include <QtCore/QHash>
|
||||
#include <QHash>
|
||||
#include <QCache>
|
||||
#include <QtCore/QSize>
|
||||
#include <QSize>
|
||||
|
||||
#include <DBAdministration/exercise_table_generator.h>
|
||||
#include "dds_handler.h"
|
||||
@@ -73,10 +73,8 @@ public:
|
||||
// }
|
||||
// };
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onStartNextExercise();
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
/**
|
||||
* @brief HandlerExercise::hasError
|
||||
* checks if there is an error in the replyObject and, if given, deletes
|
||||
@@ -109,7 +107,6 @@ private:
|
||||
QStringList doubleChannels(int exerciseAId, int exerciseBId) const;
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
QHash<int, ObjectExercise*> m_exeObjMap;
|
||||
MainHandler *m_mainHandler;
|
||||
std::shared_ptr<DdsHandler> m_ddsHandler;
|
||||
@@ -118,5 +115,7 @@ private:
|
||||
QTimer *m_startupExerciseTimer;
|
||||
QQueue<int> m_exercisesToStart;
|
||||
//QCache<ImageKey, QByteArray> m_imageCache;
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
};
|
||||
}
|
||||
+3
-2
@@ -7,8 +7,8 @@
|
||||
|
||||
#include "handler_exercise_phase.h"
|
||||
|
||||
#include <QtCore/QDateTime>
|
||||
#include <QtCore/QString>
|
||||
#include <QDateTime>
|
||||
#include <QString>
|
||||
|
||||
#include "dds_handler.h"
|
||||
#include "exm_db.h"
|
||||
@@ -29,6 +29,7 @@ HandlerExercisePhase::HandlerExercisePhase(MainHandler *mainHandler,
|
||||
, m_mainHandler(mainHandler)
|
||||
, m_ddsHandler(ddsHandler)
|
||||
, m_db(db)
|
||||
, m_logger(getLogger("HandlerExercisePhase"))
|
||||
{}
|
||||
|
||||
HandlerExercisePhase::~HandlerExercisePhase()
|
||||
|
||||
+2
-3
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QMap>
|
||||
#include <QMap>
|
||||
|
||||
#include "logger.h"
|
||||
#include "exm_fts.h"
|
||||
@@ -36,7 +36,6 @@ public:
|
||||
Core::FunctionReplyObject removeAllPhasesByExerciseId(qint64 exerciseId);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onExercisePhaseCreateRequest(const rti::core::SampleIdentity &cookie,
|
||||
const ExercisePhaseCreateRequest &request) override final;
|
||||
void onExercisePhaseModifyRequest(const rti::core::SampleIdentity &cookie,
|
||||
@@ -45,11 +44,11 @@ private:
|
||||
const Core::RemoveElementRequest &request) override final;
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
QMap<int, ObjectExercisePhase *> m_exercisePhaseObjMap;
|
||||
MainHandler *m_mainHandler;
|
||||
std::shared_ptr<DdsHandler> m_ddsHandler;
|
||||
std::shared_ptr<DatabaseInterface> m_db;
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
} // namespace ExerciseManagement
|
||||
@@ -9,7 +9,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <NGLLogger/INGLLogger.h>
|
||||
#include "svcexmcommon_export.h"
|
||||
#include "exm_export.h"
|
||||
|
||||
namespace ExerciseManagement
|
||||
{
|
||||
|
||||
@@ -19,8 +19,10 @@
|
||||
namespace ExerciseManagement
|
||||
{
|
||||
|
||||
MainHandler::MainHandler(QObject *parent) : QObject(parent),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {}
|
||||
MainHandler::MainHandler(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_logger(getLogger("MainHandler"))
|
||||
{}
|
||||
|
||||
MainHandler::~MainHandler()
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QObject>
|
||||
#include <memory>
|
||||
#include "dds_handler.h"
|
||||
#include "exm_db.h"
|
||||
@@ -39,7 +39,6 @@ public:
|
||||
std::shared_ptr<DdsHandler> dds() const { return m_ddsHandler; }
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
bool initDbAdminstration();
|
||||
bool initExerciseHandler();
|
||||
bool initExercisePhaseHandler();
|
||||
@@ -47,12 +46,14 @@ private:
|
||||
void sendKeepAlive();
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<HandlerExercise> m_handlerExercise;
|
||||
std::shared_ptr<HandlerExercisePhase> m_handlerExercisePhases;
|
||||
std::shared_ptr<DdsHandler> m_ddsHandler;
|
||||
std::shared_ptr<DbHandler> m_dbHandler;
|
||||
std::shared_ptr<DBAdministration::ExerciseTableGenerator> m_exTblGen;
|
||||
std::shared_ptr<WebSocketInterface::WebSocketInterfaceHandler> m_websocketHandler;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
};
|
||||
} // namespace ExerciseManagement
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
#include <DBAdministration/copy_exercise.h>
|
||||
#include <DBAdministration/exercise_table_generator.h>
|
||||
#include <Lts/Common/ProjectConfig/project_defines.h>
|
||||
#include <QtCore/QDateTime>
|
||||
#include <Common/ProjectConfig/project_defines.h>
|
||||
#include <QDateTime>
|
||||
|
||||
namespace ExerciseManagement
|
||||
{
|
||||
@@ -32,6 +32,7 @@ ObjectExercise::ObjectExercise(const std::shared_ptr<DdsHandler> &ddsHandler,
|
||||
, m_exTblGen(exTblGen)
|
||||
, m_exerciseHandler(exHandler)
|
||||
, m_copyExercise(nullptr)
|
||||
, m_logger(getLogger("ObjectExercise"))
|
||||
{
|
||||
m_stateMachine = new ExerciseStateMachine(this);
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QObject>
|
||||
#include "dds_handler.h"
|
||||
#include <Core/core_types.h>
|
||||
#include <DDS/Core/function_reply_object.h>
|
||||
|
||||
// Generated
|
||||
#include <ExerciseManagement/exm_db.h>
|
||||
@@ -68,14 +68,12 @@ namespace ExerciseManagement
|
||||
bool transferExerciseToEvaluationDb();
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onPublishData();
|
||||
void fixupTimeZone();
|
||||
void onErrorOccured();
|
||||
void onTransferDbFinished();
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<DdsHandler> m_ddsHandler;
|
||||
std::shared_ptr<DatabaseInterface> m_db;
|
||||
const std::shared_ptr<DBAdministration::ExerciseTableGenerator> m_exTblGen;
|
||||
@@ -83,5 +81,7 @@ namespace ExerciseManagement
|
||||
ExerciseStateMachine *m_stateMachine;
|
||||
HandlerExercise *m_exerciseHandler;
|
||||
DBAdministration::CopyExercise *m_copyExercise;
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
};
|
||||
}
|
||||
+5
-3
@@ -16,9 +16,11 @@ namespace ExerciseManagement
|
||||
{
|
||||
|
||||
ObjectExercisePhase::ObjectExercisePhase(const std::shared_ptr<DdsHandler> &ddsHandler,
|
||||
const std::shared_ptr<DatabaseInterface> &db) : m_ddsHandler(ddsHandler)
|
||||
, m_db(db),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {}
|
||||
const std::shared_ptr<DatabaseInterface> &db)
|
||||
: m_ddsHandler(ddsHandler)
|
||||
, m_db(db)
|
||||
, m_logger(getLogger("ObjectExercisePhase"))
|
||||
{}
|
||||
|
||||
ObjectExercisePhase::~ObjectExercisePhase ()
|
||||
{}
|
||||
|
||||
+3
-2
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <Core/core_types.h>
|
||||
#include <DDS/Core/function_reply_object.h>
|
||||
|
||||
// Generated
|
||||
#include <ExerciseManagement/exm_db.h>
|
||||
@@ -33,12 +33,13 @@ public:
|
||||
bool isValid() const;
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onPublishData();
|
||||
|
||||
private:
|
||||
std::shared_ptr<DdsHandler> m_ddsHandler;
|
||||
std::shared_ptr<DatabaseInterface> m_db;
|
||||
Database::ExmExercisePhase m_data;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
} // namepace ExerciseManagement
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <nglsettings/nglsettings_settings.h>
|
||||
#include <ngltools/ngltools_filesystem.h>
|
||||
|
||||
#include "LtsUtils/LtsUtilsCore/lts_portrange.h"
|
||||
#include "LtsUtilsCore/lts_portrange.h"
|
||||
|
||||
namespace ExerciseManagement
|
||||
{
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QPair>
|
||||
#include <QString>
|
||||
#include <QPair>
|
||||
|
||||
namespace NGL
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user