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

@@ -35,13 +35,12 @@ CODEGEN_TOPIC_TYPEDEFS(SRCS_common ${xml_FILE})
# generate ism_[d|f]tc.h
CODEGEN_CLIENT_TOPICS_IFC(SRCS_common ${xml_FILE})
NGL_ADD_LIBRARY2(AAR SV WS HLA svcIsmCommon SHARED ${SRCS_common})
NGL_ADD_LIBRARY(AAR SV WS HLA svcIsmCommon SHARED ${SRCS_common})
NGL_TARGET_INCLUDE_DIRECTORIES(svcIsmCommon
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../
${CMAKE_CURRENT_BINARY_DIR}/../
)
IF(BUILD_RTI)
NGL_TARGET_LINK_LIBRARIES(svcIsmCommon
PRIVATE
RTI::nddscpp2
@@ -52,7 +51,6 @@ NGL_TARGET_LINK_LIBRARIES(svcIsmCommon
ngldb
NGLLogger
)
ENDIF(BUILD_RTI)
NGL_INSTALL_TARGET(svcIsmCommon)
#
@@ -68,14 +66,13 @@ SET(SRCS_client
# generate ism_[d|f]tc_impl.[cpp|h]
CODEGEN_CLIENT_TOPICS_IMPL(SRCS_client ${xml_FILE})
NGL_ADD_LIBRARY2(AAR SV WS HLA svcIsmClient SHARED ${SRCS_client})
NGL_ADD_LIBRARY(AAR SV WS HLA svcIsmClient SHARED ${SRCS_client})
NGL_TARGET_INCLUDE_DIRECTORIES(svcIsmClient
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../
${CMAKE_CURRENT_BINARY_DIR}/../
)
IF(BUILD_RTI)
NGL_TARGET_LINK_LIBRARIES(svcIsmClient
PRIVATE
RTI::nddscpp2
@@ -87,7 +84,6 @@ NGL_TARGET_LINK_LIBRARIES(svcIsmClient
LtsCoordTrans
Qt6::Gui
)
ENDIF(BUILD_RTI)
NGL_INSTALL_TARGET(svcIsmClient)
#
@@ -102,14 +98,13 @@ SET(SRCS_server
# generate ism_[d|f]ts.h, ism_[d|f]ts_impl.[cpp|h]
CODEGEN_SERVER_TOPICS(SRCS_server ${xml_FILE})
NGL_ADD_LIBRARY2(WS AAR SV svcIsmServer SHARED ${SRCS_server})
NGL_ADD_LIBRARY(WS AAR SV svcIsmServer SHARED ${SRCS_server})
NGL_TARGET_INCLUDE_DIRECTORIES(svcIsmServer
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../
${CMAKE_CURRENT_BINARY_DIR}/../
)
IF(BUILD_RTI)
NGL_TARGET_LINK_LIBRARIES(svcIsmServer
PRIVATE
RTI::nddscpp2
@@ -121,7 +116,6 @@ NGL_TARGET_LINK_LIBRARIES(svcIsmServer
LtsUtilsCore
LtsWebSocketServer
)
ENDIF(BUILD_RTI)
NGL_INSTALL_TARGET(svcIsmServer)
#
@@ -9,7 +9,6 @@ SET(SRCS_IMPORT_BUILDINGS
ism_import_buildings.h
)
NGL_ADD_EXECUTABLE(AAR SV WS ismImportBuildings ${SRCS_IMPORT_BUILDINGS})
IF(BUILD_RTI)
NGL_TARGET_LINK_LIBRARIES(ismImportBuildings
Qt6::Core
RTI::nddscpp2
@@ -20,6 +19,5 @@ NGL_TARGET_LINK_LIBRARIES(ismImportBuildings
LtsUtilsCoreHeaderOnly
Qt6::WebSockets
)
ENDIF(BUILD_RTI)
NGL_INSTALL_TARGET(ismImportBuildings)
@@ -13,16 +13,16 @@
#include <nglapplication/nglcoreapplication.h>
#include <LtsCommandLineParser/LtsCommandLineParser.h>
#include <QtCore/QFile>
#include <QtCore/QTextStream>
#include <QtCore/QTimer>
#include <QtCore/QJsonDocument>
#include <QtCore/QJsonObject>
#include <QtCore/QJsonArray>
#include <QFile>
#include <QTextStream>
#include <QTimer>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
#include <QtWebSockets/QWebSocket>
#include <QtCore/QUrl>
#include <QUrl>
#include <QtCore/QThread>
#include <QThread>
#include <InfrastructureManagement/ism_ftc.h>
#include <InfrastructureManagement/ism_dtc.h>
@@ -34,6 +34,7 @@ using namespace InfrastructureManagement;
// ------------------------------------------------------------------------------
IsmImportBuildings::IsmImportBuildings(QObject *parent)
: QObject(parent)
, m_logger(getLogger("ImportXml"))
{
qRegisterMetaType<Core::FunctionReply>("Core::FunctionReply");
connect(this, &IsmImportBuildings::importDone, this, &IsmImportBuildings::importNext);
@@ -13,7 +13,7 @@
#include <InfrastructureManagement/ism_dtc.h>
#include <DDS/DDSConnector/dds_connector.h>
#include <InfrastructureManagement/logger.h>
#include <QtCore/QVector>
#include <QVector>
//----------------------------------------------------------------------------------------------
namespace InfrastructureManagement
@@ -8,21 +8,20 @@
*/
#include "ism_tests.h"
#include <utility>
#include <nglapplication/nglcoreapplication.h>
#include <LtsCommandLineParser/LtsCommandLineParser.h>
#include <QtCore/QTimer>
#include <QtCore/QDateTime>
#include <QtTest/QTest>
#include <QtCore/QSet>
#include <QtCore/QVector>
#include <QtCore/QJsonObject>
#include <QtCore/QJsonDocument>
#include <QTimer>
#include <QDateTime>
#include <QTest>
#include <QSet>
#include <QVector>
#include <QJsonObject>
#include <QJsonDocument>
#include <LtsUtils/pgarray.h>
#include <LtsUtils/LtsUtilsCore/dds_vector.h>
#include <LtsUtilsCore/pgarray.h>
#include <LtsUtilsCore/dds_vector.h>
#include <InfrastructureManagement/ism_ftc.h>
#include <InfrastructureManagement/ism_dtc.h>
#include <InfrastructureManagement/ism_enums.hpp>
@@ -51,6 +50,7 @@ IsmTests::IsmTests(QObject *parent)
, m_structureElementId(0)
, m_indexNo(0)
, m_bTestsSuccessful(true)
, m_logger(getLogger("Test"))
{
qRegisterMetaType<Core::FunctionReply>("Core::FunctionReply");
}
@@ -1052,7 +1052,7 @@ void IsmTests::checkSchedule()
else
{
ERROR_LOG(m_logger) << "Instrumentation plan not complete !!!";
for (const MountingPointPlan &mpp : std::as_const(diff))
for (const MountingPointPlan &mpp : qAsConst(diff))
ERROR_LOG(m_logger) << "Diff - # mpp.structureElementId() = " << mpp.structureElementId();
}
@@ -14,7 +14,7 @@
#include <QtCore/QJsonDocument>
#include <QtCore/QUuid>
#include <QtCore/QSet>
#include <QSet>
namespace InfrastructureManagement
{
@@ -24,8 +24,8 @@
#include <InfrastructureManagement/ism_translation.h>
#include <AssetManagement/asm_dtc.h>
#include <QtCore/QJsonDocument>
#include <QtCore/QJsonObject>
#include <QJsonDocument>
#include <QJsonObject>
#include <LtsCoordTrans/lts_coord_trans.h>
using namespace InfrastructureManagement;
@@ -25,6 +25,7 @@ WebSocketInterfaceHandler::WebSocketInterfaceHandler(MainHandler *mainHandler, Q
, m_messageFactory(nullptr)
, m_dataManager(nullptr)
, m_mainHandler(mainHandler)
, m_logger(getLogger("WebSocketInterfaceHandler"))
{
}
@@ -21,7 +21,6 @@ class Base : public QObject
{
Q_OBJECT
protected:
NGL::INGLLogger &m_logger;
explicit Base(MainHandler *mainHandler, NGL::INGLLogger &logger);
virtual ~Base();
@@ -31,5 +30,6 @@ NGL::INGLLogger &m_logger;
protected:
MainHandler *m_mainHandler;
LOGGER_T m_logger;
};
}
@@ -9,15 +9,14 @@
#include "dds_handler.h"
#if BUILD_RTI
#include <DDS/Core/pacemaker.h>
#endif
namespace InfrastructureManagement
{
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();
}
@@ -30,7 +29,6 @@ bool DdsHandler::init(const QStringList &qosFileList)
return false;
}
#if BUILD_RTI
// default initialize Publisher and Subscriber
m_ddsConnector->initPublisherSubscriber();
@@ -60,9 +58,6 @@ bool DdsHandler::init(const QStringList &qosFileList)
}
return bRet;
#else
return true;
#endif
}
} // Namespace PDM
@@ -50,13 +50,14 @@ public:
}
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;
std::shared_ptr<InfrastructureManagement::Interface::Dts> m_ddsDts;
std::shared_ptr<InfrastructureManagement::Interface::Fts> m_ddsFts;
NGL::INGLLogger &m_logger;
};
}
@@ -8,17 +8,16 @@
*/
#include "handler_effect_area.h"
#include <utility>
#include "handler_main_structure_element.h"
#include "handler_mounting_point_asset.h"
#include "object_main_structure_element.h"
#include "object_effect_area.h"
#include "main_handler.h"
#include <QtCore/QDebug>
#include <QtCore/QJsonObject>
#include <QtCore/QJsonDocument>
#include <QtCore/QJsonArray>
#include <QDebug>
#include <QJsonObject>
#include <QJsonDocument>
#include <QJsonArray>
namespace InfrastructureManagement
@@ -42,7 +41,7 @@ HandlerEffectArea::~HandlerEffectArea()
bool HandlerEffectArea::init()
{
const QHash<int, ObjectMainStructureElement *> &objMseMap = m_mainHandler->getHandlerMainStructureElement()->getMainStructureElementsMap();
for (const auto &objMse : std::as_const(objMseMap))
for (const auto &objMse : qAsConst(objMseMap))
{
ObjectEffectArea *effectAreaObj = createEffectAreaForMse(objMse->getData());
if (effectAreaObj)
@@ -52,7 +51,7 @@ bool HandlerEffectArea::init()
if (m_logger.isDebugEnabled())
{
DEBUG_LOG(m_logger) << "number of EffectAreas: " << m_objectEffectAreaMap.size();
for (const auto &EffectAreaObj : std::as_const(m_objectEffectAreaMap))
for (const auto &EffectAreaObj : qAsConst(m_objectEffectAreaMap))
DEBUG_LOG(m_logger) << "EffectArea ID: " << EffectAreaObj->getId()
<< " | area EGCU ID: " << EffectAreaObj->getAreaEgcuId();
}
@@ -129,7 +128,7 @@ std::vector<int32_t> HandlerEffectArea::egcuIdsFromJsonObject(const QJsonObject
const QJsonArray &egcuMountPoints = jsonObj.value(QStringLiteral("egcuMountpoints")).toArray(); // qAsConst does not work with r-value
DEBUG_LOG(m_logger) << "egcuMountPoints.size=" << egcuMountPoints.size();
for (const auto &egcuMountPnt : std::as_const(egcuMountPoints))
for (const auto &egcuMountPnt : qAsConst(egcuMountPoints))
{
QJsonObject element = egcuMountPnt.toObject();
int mountingPointId = element.value(QStringLiteral("id")).toInt();
@@ -9,7 +9,7 @@
#pragma once
#include <QtCore/QHash>
#include <QHash>
#include "base.h"
@@ -9,7 +9,7 @@
#pragma once
#include <QtCore/QHash>
#include <QHash>
#include "base.h"
@@ -9,7 +9,7 @@
#pragma once
#include <QtCore/QHash>
#include <QHash>
#include "base.h"
@@ -8,7 +8,6 @@
*/
#include "handler_main_structure_element.h"
#include <utility>
#include "handler_mounting_point_asset.h"
#include "handler_instrumentation_asset.h"
#include "object_main_structure_element.h"
@@ -16,8 +15,8 @@
#include "object_instrumentation_asset.h"
#include <ngldb/dbtransaction.h>
#include "convert_db_to_dds.h"
#include <QtCore/QJsonObject>
#include <QtCore/QJsonDocument>
#include <QJsonObject>
#include <QJsonDocument>
namespace InfrastructureManagement
{
@@ -67,7 +66,7 @@ bool HandlerMainStructureElement::init()
std::sort(dataVecSE.begin(), dataVecSE.end(), sortSE);
// create MSE objects
for (const Database::IsmMainStructureElement &dbData : std::as_const(dataVec))
for (const Database::IsmMainStructureElement &dbData : qAsConst(dataVec))
{
ObjectMainStructureElement *ifs(new ObjectMainStructureElement(dbData, m_mainHandler));
m_objectMainStructureElementMap.insert(ifs->getId(), ifs);
@@ -75,7 +74,7 @@ bool HandlerMainStructureElement::init()
DEBUG_LOG(m_logger) << "m_objectMainStructureElementMap.size() = " << m_objectMainStructureElementMap.size();
// create SE objects, add them to MSE
for (const Database::IsmStructureElement &dbData : std::as_const(dataVecSE))
for (const Database::IsmStructureElement &dbData : qAsConst(dataVecSE))
{
ObjectMainStructureElement *objMse = m_objectMainStructureElementMap.value(dbData.mainStructureElementId);
if (!objMse || !objMse->isValid())
@@ -94,7 +93,7 @@ bool HandlerMainStructureElement::init()
}
// add structure elements to global map for lookup (e.g. in 'add Footprints to MSE objects')
for (ObjectMainStructureElement *objMse : std::as_const(m_objectMainStructureElementMap))
for (ObjectMainStructureElement *objMse : qAsConst(m_objectMainStructureElementMap))
m_objectStructureElementMap.unite(objMse->getStructureElements());
// add Footprints to MSE objects
@@ -112,7 +111,7 @@ bool HandlerMainStructureElement::init()
}
}
for (const QMap<int, Database::IsmStructureElementFootprint> &cont : std::as_const(footprintSorted))
for (const QMap<int, Database::IsmStructureElementFootprint> &cont : qAsConst(footprintSorted))
{
if (cont.empty())
continue;
@@ -582,7 +581,7 @@ void HandlerMainStructureElement::onExerciseStateChanged(const ExerciseManagemen
if (data.state().underlying() != ExerciseManagement::ExerciseState::Terminated)
return;
for (auto mseObj : std::as_const(m_objectMainStructureElementMap))
for (auto mseObj : qAsConst(m_objectMainStructureElementMap))
{
const MainStructureElement &mse = mseObj->getData();
QJsonObject obj = QJsonDocument::fromJson(QByteArray::fromStdString(mse.properties())).object();
@@ -602,7 +601,7 @@ void HandlerMainStructureElement::onExerciseStateChanged(const ExerciseManagemen
modReq.modelId(mse.modelId());
modReq.name(mse.name());
std::vector<InfrastructureManagement::StructureElement> resElements;
for (auto element : std::as_const(mse.elements()))
for (auto element : qAsConst(mse.elements()))
{
QJsonDocument doc = QJsonDocument::fromJson(QByteArray::fromStdString(element.properties()));
QJsonObject objEle = doc.object();
@@ -9,8 +9,8 @@
#pragma once
#include <QtCore/QMap>
#include <QtCore/QSet>
#include <QMap>
#include <QSet>
#include "main_handler.h"
#include "base.h"
@@ -9,7 +9,7 @@
#pragma once
#include <QtCore/QHash>
#include <QHash>
#include "base.h"
@@ -9,7 +9,7 @@
#pragma once
#include <QtCore/QHash>
#include <QHash>
#include "base.h"
@@ -8,7 +8,6 @@
*/
#include "ism_dtc_impl_custom.h"
#include <utility>
#include "ism_dtc_impl_custom_p.h"
#include <DDS/DTC/generic_dtc.h>
@@ -17,20 +16,20 @@
#include <LtsCoordTrans/lts_coord_trans.h>
#include <QtCore/QSet>
#include <QtCore/QVector>
#include <QtCore/QJsonArray>
#include <QtCore/QJsonDocument>
#include <QtCore/QJsonObject>
#include <QSet>
#include <QVector>
#include <QJsonArray>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonParseError>
#include <QtGui/QPolygonF>
#include <QtGui/QTransform>
#include <unordered_map>
#include <algorithm>
#include <QtCore/QFile>
#include <QFile>
#include <QtCore/QMutex>
#include <QtCore/QMutexLocker>
#include <QMutex>
#include <QMutexLocker>
//---------------------------------------------------------------------------------------------------------------------------------------------
namespace InfrastructureManagement
@@ -285,7 +284,6 @@ int DtcImplCustom::getOpticalCodeFromAssetId(int assetId) const
}
#if BUILD_RTI
int DtcImplCustom::getAssetIdFromOpticalCode(int opticalCode) const
{
DEBUG_LOG(m_logger) << "getAssetIdFromOpticalCode: opticalCode=" << opticalCode;
@@ -331,7 +329,6 @@ int DtcImplCustom::getAssetIdFromMountingPointId(int mainStructureElementId, in
return -1;
}
#endif
//---------------------------------------------------------------------------------------------------------------------------------------------
@@ -476,7 +473,6 @@ bool DtcImplCustom::getStructureElementByBuildingIdAndMountingPointId(int mainSt
}
//---------------------------------------------------------------------------------------------------------------------------------------------
#if BUILD_RTI
bool DtcImplCustom::getAllAssetsPerRoom(const std::function<bool(const InstrumentationAsset &)> &predicate,
QMap<int, QVector<InstrumentationAsset> > &allAssets)
{
@@ -526,6 +522,7 @@ bool DtcImplCustom::getAllAssetsPerRoom(const std::function<bool(const Instrumen
return true;
}
//---------------------------------------------------------------------------------------------------------------------------------------------
bool DtcImplCustom::getAllAssetsPerBuilding(const std::function<bool(const InstrumentationAsset &)> &predicate,
QMap<int, QVector<InstrumentationAsset> > &allAssets) const
{
@@ -564,6 +561,7 @@ bool DtcImplCustom::getAllAssetsPerBuilding(const std::function<bool(const Instr
}
//---------------------------------------------------------------------------------------------------------------------------------------------
bool DtcImplCustom::getBuildingId(int structureElementId, int &buildingId) const
{
for (const auto &sample : m_dtcMainStructureElement->readAlive())
@@ -580,11 +578,8 @@ bool DtcImplCustom::getBuildingId(int structureElementId, int &buildingId) const
buildingId = 0;
return false;
}
#endif
}
//---------------------------------------------------------------------------------------------------------------------------------------------
#if BUILD_RTI
QList<int> DtcImplCustom::getSections()
{
QList<int> sections;
@@ -595,7 +590,6 @@ QList<int> DtcImplCustom::getSections()
}
return sections;
}
#endif
//---------------------------------------------------------------------------------------------------------------------------------------------
QString DtcImplCustom::getBuildingDisplayName(int buildingId)
@@ -619,7 +613,6 @@ QString DtcImplCustom::getBuildingDisplayName(const MainStructureElement &mse) c
}
#if BUILD_RTI
MountingPointPlan DtcImplCustom::getMountingPointPlan(int scheduleId, int structureElementId) const
{
for (const auto &sample : m_dtcMainSchedule->readAlive())
@@ -635,7 +628,6 @@ MountingPointPlan DtcImplCustom::getMountingPointPlan(int scheduleId, int struct
}
return MountingPointPlan();
}
#endif
//---------------------------------------------------------------------------------------------------------------------------------------------
int DtcImplCustom::getBuildingRoomsCount(int buildingId)
@@ -673,7 +665,6 @@ BridgeStatus DtcImplCustom::getBridgeStatus(int buildingId)
// this is just a quicker method to determine if a plan is complete or not
//---------------------------------------------------------------------------------------------------------------------------------------------
#if BUILD_RTI
bool DtcImplCustom::checkSchedule(int scheduleId)
{
const MainSchedule schedule = mainSchedule(scheduleId);
@@ -707,10 +698,8 @@ bool DtcImplCustom::getScheduleDifferences(int scheduleId, QList<MountingPointPl
}
return diffList.isEmpty();
}
#endif
//---------------------------------------------------------------------------------------------------------
#if BUILD_RTI
int DtcImplCustom::getMountedAssetId(int structureElementId) const
{
// Norbert Thoden, 12.12.2022:
@@ -731,6 +720,7 @@ int DtcImplCustom::getMountedAssetId(int structureElementId) const
return -1;
}
//---------------------------------------------------------------------------------------------------------
int DtcImplCustom::getStructueElementIdFromAssetId(int assetId) const
{
@@ -748,10 +738,8 @@ int DtcImplCustom::getStructueElementIdFromAssetId(int assetId) const
}
return -1;
}
#endif
//---------------------------------------------------------------------------------------------------------
#if BUILD_RTI
QMap<int, MainFootprint> DtcImplCustom::getFootprintsByExerciseId(int exerciseId)
{
QMap<int, MainFootprint> footprints;
@@ -766,10 +754,7 @@ QMap<int, MainFootprint> DtcImplCustom::getFootprintsByExerciseId(int exerciseId
return footprints;
}
#endif
//---------------------------------------------------------------------------------------------------------
#if BUILD_RTI
QMap<int, QPolygonF> DtcImplCustom::getUtmFootprintsByExerciseId(int exerciseId, int &zone, bool isGroundLevel)
{
QMap<int, QPolygonF> footprints;
@@ -810,7 +795,6 @@ QMap<int, QPolygonF> DtcImplCustom::getUtmFootprintsByExerciseId(int exerciseId,
DEBUG_LOG(m_logger) << "getUtmFootprintsByExerciseId footprints.size=" << footprints.size();
return footprints;
}
#endif
// returns absolut utm positions of the footprint
QPolygonF DtcImplCustom::getUtmFootprintById(int mseId, int &zoneOut, bool isGroundLevel)
@@ -834,7 +818,7 @@ QPolygonF DtcImplCustom::getUtmFootprintById(int mseId, int &zoneOut, bool isGro
// QPolygonF poly;
// poly.reserve(mfElements.size());
// DEBUG_LOG(m_logger) << "mseId: " << mseId << " isGroundLevel: " << isGroundLevel;
// for (const InfrastructureManagement::FootprintElement &element : std::as_const(mfElements))
// for (const InfrastructureManagement::FootprintElement &element : qAsConst(mfElements))
// {
// // maybe this is easier?
// // // if different, continue
@@ -855,7 +839,7 @@ QPolygonF DtcImplCustom::getUtmFootprintById(int mseId, int &zoneOut, bool isGro
// // Get other footprint if groundLevel footprint is not available
// if (poly.isEmpty() && isGroundLevel)
// {
// for (const InfrastructureManagement::FootprintElement &element : std::as_const(mfElements))
// for (const InfrastructureManagement::FootprintElement &element : qAsConst(mfElements))
// {
// const auto &relPos = element.relPosition();
// poly.push_back(QPointF(relPos.offsetX(), relPos.offsetY()));
@@ -873,7 +857,7 @@ QPolygonF DtcImplCustom::getUtmFootprintById(int mseId, int &zoneOut, bool isGro
// QPolygonF retPolyUtm;
// retPolyUtm.reserve(poly.size());
// for (const QPointF &point : std::as_const(poly))
// for (const QPointF &point : qAsConst(poly))
// {
// const QPointF finalUtmPoint(utmFpPosition + point);
// retPolyUtm.push_back(finalUtmPoint);
@@ -882,10 +866,8 @@ QPolygonF DtcImplCustom::getUtmFootprintById(int mseId, int &zoneOut, bool isGro
// return retPolyUtm;
}
#endif
//---------------------------------------------------------------------------------------------------------
#if BUILD_RTI
// returns all building IDs that have an intersection with the area under the polygon and are assigned to the specified exercise.
// Parameter: completeEnclosed true = Only buildings that are completely enclosed by the polygon are taken into account.
// false = All buildings that are completely enclosed by the polygon and that have an overlap with the polygon are taken into account.
@@ -901,7 +883,7 @@ QVector <int> DtcImplCustom::getBuildingByPolygon(int exerciseId, const QPolygon
// Convert Form to UTM
int zone = -1;
for (const QPointF &point : std::as_const(polygon))
for (const QPointF &point : qAsConst(polygon))
{
auto utm = LtsCoordTrans::UtmCoordinate::fromGeographic(point, zone);
DEBUG_LOG(m_logger) << "geo=" << point.x() << "/" << point.y()
@@ -930,7 +912,7 @@ QVector <int> DtcImplCustom::getBuildingByPolygon(int exerciseId, const QPolygon
if (completeEnclosed)
{
const QPolygonF &footprintPolygonRef = footprintPolygon.value();
for (const QPointF &fpPoint : std::as_const(footprintPolygonRef))
for (const QPointF &fpPoint : qAsConst(footprintPolygonRef))
{
if (!polygonUtm.containsPoint(fpPoint, Qt::OddEvenFill))
{
@@ -953,10 +935,7 @@ QVector <int> DtcImplCustom::getBuildingByPolygon(int exerciseId, const QPolygon
return result;
}
#endif
//---------------------------------------------------------------------------------------------------------
#if BUILD_RTI
// returns building ID surrounds the polygon and is assigned to the specified exercise.
// returns -1 if no building found
int DtcImplCustom::getSurroundingBuildingByPolygon(int exerciseId, const QPolygonF &polygon, bool isGroundLevel)
@@ -970,7 +949,7 @@ int DtcImplCustom::getSurroundingBuildingByPolygon(int exerciseId, const QPolygo
// Convert Form to UTM
int zone = -1;
for (const QPointF &point : std::as_const(polygon))
for (const QPointF &point : qAsConst(polygon))
{
auto utm = LtsCoordTrans::UtmCoordinate::fromGeographic(point, zone);
DEBUG_LOG(m_logger) << "geo=" << point.x() << "/" << point.y()
@@ -997,7 +976,7 @@ int DtcImplCustom::getSurroundingBuildingByPolygon(int exerciseId, const QPolygo
DEBUG_LOG(m_logger) << "getBuildingByPolygon Append Building id=" << footprintPolygon.key();
if (completeEnclosed)
{
for (const QPointF &fpPoint : std::as_const(polygonUtm))
for (const QPointF &fpPoint : qAsConst(polygonUtm))
{
if (!footprintPolygon.value().containsPoint(fpPoint, Qt::OddEvenFill))
{
@@ -1020,10 +999,7 @@ int DtcImplCustom::getSurroundingBuildingByPolygon(int exerciseId, const QPolygo
return -1;
}
#endif
//---------------------------------------------------------------------------------------------------------
#if BUILD_RTI
/*!
* \brief DtcImplCustom::getBuildingIdAtPosition
* \param exerciseId
@@ -1047,12 +1023,7 @@ int DtcImplCustom::getBuildingIdAtPosition(int exerciseId, const QPointF &utmPos
}
return bldId;
}
#endif
#endif
//---------------------------------------------------------------------------------------------------------
#if BUILD_RTI
// The floors list is sorted according to height.
QVector <int> DtcImplCustom::getFloorIdsFromBuilding(int buildingId)
{
@@ -1092,10 +1063,7 @@ QList <StructureElement> DtcImplCustom::getFloorsFromBuilding(int buildingId)
std::sort(floors.begin(), floors.end(), structureElementHeightComparator);
return floors;
}
#endif
//---------------------------------------------------------------------------------------------------------
#if BUILD_RTI
double DtcImplCustom::getHalfFloorHeight(int buildingId, int floorId)
{
QList <StructureElement> floorHeights = getFloorsFromBuilding(buildingId);
@@ -1121,10 +1089,7 @@ double DtcImplCustom::getHalfFloorHeight(int buildingId, int floorId)
return 0.0;
}
#endif
//---------------------------------------------------------------------------------------------------------
#if BUILD_RTI
QVector <int> DtcImplCustom::getRoomIdsFromFloorId(int buildingId, int floorId)
{
DEBUG_LOG(m_logger) << "getRoomIdsFromFloorId "
@@ -1151,10 +1116,7 @@ QVector <int> DtcImplCustom::getRoomIdsFromFloorId(int buildingId, int floorId)
}
return rooms;
}
#endif
//---------------------------------------------------------------------------------------------------------
#if BUILD_RTI
QVector <int> DtcImplCustom::getBuildingIdsByExercise ( int exerciseId)
{
QVector <int> result;
@@ -1169,10 +1131,7 @@ QVector <int> DtcImplCustom::getBuildingIdsByExercise ( int exerciseId)
return result;
}
#endif
//---------------------------------------------------------------------------------------------------------
#if BUILD_RTI
QByteArray DtcImplCustom::getVulnerabilityModelData( int buildingId)
{
const MainStructureElement &mse = mainStructureElement(buildingId);
@@ -1188,13 +1147,12 @@ QByteArray DtcImplCustom::getVulnerabilityModelData( int buildingId)
QFile f(vulnerabilityModelFilename);
if (!f.open(QIODevice::ReadOnly))
{
WARNING_LOG(m_logger) << "Could not open file '" << vulnerabilityModelModelFilename << "' for reading: " << f.errorString();
WARNING_LOG(m_logger) << "Could not open file '" << vulnerabilityModelFilename << "' for reading: " << f.errorString();
}
QByteArray dataBa = f.readAll();
return dataBa;
}
#endif
} // namespace Interface
@@ -36,31 +36,27 @@ public:
bool getAssetIdFromMountingPoint(int structureElementId, int mountingPointAssetId, int &assetId) const override;
int getOpsCodeFromJSon(const std::string &s) const;
int getOpticalCodeFromAssetId(int assetId) const override;
#if BUILD_RTI
int getAssetIdFromOpticalCode(int opticalCode) const override;
int getAssetIdFromMountingPointId(int mainStructureElementId, int mountingPointId) const override;
bool getAllAssetsPerRoom(const std::function<bool(const InstrumentationAsset &)> &predicate,
QMap<int, QVector<InstrumentationAsset> > &allAssets) override;
bool getAllAssetsPerBuilding(const std::function<bool(const InstrumentationAsset &)> &predicate,
QMap<int, QVector<InstrumentationAsset> > &allAssets) const override;
int getStructueElementIdFromAssetId(int assetId) const override;
#endif
bool getOpsDataFromMseIdAndSeId(int mainStructureElementId, int structureElementId, int &roomId, Core::GeoPosition &geoPosition) const override;
bool getStructureElementById(int structureElementId, StructureElement &structureElement) const override;
bool getStructureElementInMntPointAssetByAssetId(int assetId, StructureElement &structureElement) const override;
bool getStructureElementByBuildingIdAndMountingPointId(int mainStructureElementId, int mountingPointId, StructureElement &structureElement) override;
bool getAllAssetsPerRoom(const std::function<bool(const InstrumentationAsset &)> &predicate,
QMap<int, QVector<InstrumentationAsset> > &allAssets) override;
bool getAllAssetsPerBuilding(const std::function<bool(const InstrumentationAsset &)> &predicate,
QMap<int, QVector<InstrumentationAsset> > &allAssets) const override;
bool getBuildingId(int structureElementId, int &buildingId) const override;
QString getBuildingDisplayName(int buildingId) override;
QString getBuildingDisplayName(const MainStructureElement &mse) const override;
MountingPointPlan getMountingPointPlan(int scheduleId, int structureElementId) const override;
int getBuildingRoomsCount(int buildingId) override;
BridgeStatus getBridgeStatus(int buildingId) override;
#if BUILD_RTI
bool checkSchedule(int scheduleId) override;
bool getScheduleDifferences(int scheduleId, QList<MountingPointPlan> &diffList) override;
int getMountedAssetId(int structureElementId) const override;
int getStructueElementIdFromAssetId(int assetId) const override;
QList<int> getSections() override;
#endif
QMap<int, MainFootprint> getFootprintsByExerciseId(int exerciseId) override;
QMap<int, QPolygonF> getUtmFootprintsByExerciseId(int exerciseId, int &zone, bool isGroundLevel) override;
QPolygonF getUtmFootprintById(int mseId, int &zoneOut, bool isGroundLevel) override;
@@ -9,10 +9,9 @@
#pragma once
#include "ism_dtc_impl_custom.h"
#include <utility>
#include <LtsCoordinate/lts_coord_vector.h>
#include <QtCore/QHash>
#include <QHash>
#include <QPolygonF>
#include <QTransform>
@@ -67,7 +66,7 @@ public:
const std::vector<InfrastructureManagement::FootprintElement> &mfElements = mf.elements();
QPolygonF poly;
poly.reserve(mfElements.size());
for (const InfrastructureManagement::FootprintElement &element : std::as_const(mfElements))
for (const InfrastructureManagement::FootprintElement &element : qAsConst(mfElements))
{
// if different, continue
if (isGroundLevel != element.isGroundLevel())
@@ -79,7 +78,7 @@ public:
// Get other footprint if groundLevel footprint is not available
if (poly.isEmpty() && isGroundLevel)
{
for (const InfrastructureManagement::FootprintElement &element : std::as_const(mfElements))
for (const InfrastructureManagement::FootprintElement &element : qAsConst(mfElements))
{
const auto &relPos = element.relPosition();
poly.push_back(QPointF(relPos.offsetX(), relPos.offsetY()));
@@ -100,7 +99,7 @@ public:
// QPolygonF retPolyUtm;
// retPolyUtm.reserve(poly.size());
// for (const QPointF &point : std::as_const(poly))
// for (const QPointF &point : qAsConst(poly))
// {
// const QPointF finalUtmPoint(utmFpPosition + point);
// retPolyUtm.push_back(finalUtmPoint);
@@ -10,7 +10,7 @@
#pragma once
#include <NGLLogger/INGLLogger.h>
#include "svcismcommon_export.h"
#include "ism_export.h"
namespace InfrastructureManagement
{
@@ -74,8 +74,6 @@ public:
int exerciseId() const;
private: // attributes
NGL::INGLLogger &m_logger;
std::shared_ptr<DbHandler> m_dbHandler;
std::shared_ptr<DdsHandler> m_ddsHandler;
std::shared_ptr<HandlerMainStructureElement> m_handlerMainStructureElement;
@@ -86,6 +84,8 @@ NGL::INGLLogger &m_logger;
std::shared_ptr<HandlerSpecialArea> m_handlerSpecialArea;
std::shared_ptr<WebSocketInterface::WebSocketInterfaceHandler> m_handlerWebSocketInterface;
std::shared_ptr<ExerciseManagement::Interface::Dtc> m_exmDtc;
NGL::INGLLogger &m_logger;
};
QPointF rotatePoint(const double xIn, const double yIn, double angleDegree);
@@ -10,7 +10,7 @@
#pragma once
#include "base.h"
#include <Core/core_types.h>
#include <DDS/Core/function_reply_object.h>
#include <InfrastructureManagement/ism_db.h>
@@ -10,7 +10,7 @@
#pragma once
#include "base.h"
#include <Core/core_types.h>
#include <DDS/Core/function_reply_object.h>
#include <InfrastructureManagement/ism_db.h>
@@ -9,7 +9,7 @@
#include "object_main_schedule.h"
#include <ngldb/dbtransaction.h>
#include <QtCore/QTimer>
#include <QTimer>
using namespace InfrastructureManagement;
//----------------------------------------------------------------------------------------------------
@@ -10,7 +10,7 @@
#pragma once
#include "base.h"
#include <Core/core_types.h>
#include <DDS/Core/function_reply_object.h>
#include <InfrastructureManagement/ism_db.h>
@@ -8,19 +8,18 @@
*/
#include "object_main_structure_element.h"
#include <utility>
#include "handler_main_structure_element.h"
#include "object_structure_element.h"
#include "main_handler.h"
#include "handler_mounting_point_asset.h"
#include "convert_db_to_dds.h"
#include <ngldb/dbtransaction.h>
#include <LtsUtils/LtsUtilsCore/dds_vector.h>
#include <LtsUtilsCore/dds_vector.h>
#include <LtsUtilsCore/json_object.h>
#include <LtsCoordTrans/lts_coord_trans.h>
#include <QtCore/QJsonObject>
#include <QtCore/QTimer>
#include <QJsonObject>
#include <QTimer>
namespace
{
@@ -440,7 +439,7 @@ Core::FunctionReplyObject ObjectMainStructureElement::updateObject(const MainStr
m_mainHandler->getHandlerMainStructureElement()->removedStructureElements(oldStructureElements);
m_mainHandler->getHandlerMainStructureElement()->addedStructureElements(m_objectStructureElements);
QMap<int, ObjectStructureElement*> newObjectStructureElements;
for (ObjectStructureElement *ose : std::as_const(m_objectStructureElements))
for (ObjectStructureElement *ose : qAsConst(m_objectStructureElements))
{
// only delete the old ones
// and also not the one for the mse and bcu
@@ -489,7 +488,7 @@ Core::FunctionReplyObject ObjectMainStructureElement::removeObject()
dts()->removeMainStructureElementByKey(m_data.id());
dts()->removeMainFootprintByKey(m_footprint.id());
for (ObjectStructureElement *ose : std::as_const(m_objectStructureElements))
for (ObjectStructureElement *ose : qAsConst(m_objectStructureElements))
{
ose->removeObject();
delete ose;
@@ -9,10 +9,10 @@
#pragma once
#include <QtCore/QMap>
#include <QtCore/QJsonArray>
#include <QMap>
#include <QJsonArray>
#include "base.h"
#include <Core/core_types.h>
#include <DDS/Core/function_reply_object.h>
#include <InfrastructureManagement/ism_db.h>
@@ -10,7 +10,7 @@
#pragma once
#include "base.h"
#include <Core/core_types.h>
#include <DDS/Core/function_reply_object.h>
#include <InfrastructureManagement/ism_db.h>
@@ -8,9 +8,8 @@
*/
#include "object_special_area.h"
#include <utility>
#include <QtCore/QJsonDocument>
#include <QJsonDocument>
#include <QPolygonF>
namespace InfrastructureManagement
@@ -90,7 +89,7 @@ SpecialArea ObjectSpecialArea::toDdsData(const Database::IsmSpecialArea &dbData)
QPolygonF tmp;
tmp.reserve(ddsData.polygon().size());
for (const Core::GeoPosition2D &pos : std::as_const(ddsData.polygon()))
for (const Core::GeoPosition2D &pos : qAsConst(ddsData.polygon()))
tmp.push_back(QPointF(pos.lon(),pos.lat()));
QRectF boundingBox = tmp.boundingRect();
@@ -10,12 +10,12 @@
#pragma once
#include "base.h"
#include <Core/core_types.h>
#include <DDS/Core/function_reply_object.h>
#include <InfrastructureManagement/ism_db.h>
#include <QtCore/QPointF>
#include <QtCore/QString>
#include <QString>
#include <LtsCoordTrans/lts_coord_trans.h>
namespace InfrastructureManagement
@@ -10,7 +10,7 @@
#pragma once
#include "base.h"
#include <Core/core_types.h>
#include <DDS/Core/function_reply_object.h>
#include <InfrastructureManagement/ism_db.h>
#include <InfrastructureManagement/object_main_structure_element.h>
@@ -8,15 +8,15 @@
*/
#include "parse_building_xml.h"
#include <QtXml/QDomDocument>
#include <QtCore/QFile>
#include <QtCore/QPointF>
#include <QDomDocument>
#include <QFile>
#include <QPointF>
#include <QtCore/QJsonArray>
#include <QtCore/QJsonObject>
#include <QtCore/QJsonDocument>
#include <QJsonArray>
#include <QJsonObject>
#include <QJsonDocument>
#include <LtsUtils/LtsUtilsCore/dds_vector.h>
#include <LtsUtilsCore/dds_vector.h>
//-------------------------------------------------------------------------------------------------------------
namespace InfrastructureManagement
@@ -59,6 +59,7 @@ ParseBuildingXml::ParseBuildingXml(const QString &xmlFilename,
, m_soundAreaFilename(soundAreaFilename)
, m_geoPosition(geoPosition)
, m_rotationAngleDegree(rotationAngleDegree)
, m_logger(getLogger("ParseBuildingXml"))
{
DEBUG_LOG(m_logger) << "m_soundAreaFilename=" << m_soundAreaFilename;
}
@@ -8,10 +8,10 @@
*/
#pragma once
#include "svcismclient_export.h"
#include "ism_export.h"
#include <QtCore/QObject>
#include <QtCore/QVector>
#include <QObject>
#include <QVector>
#include <InfrastructureManagement/ism_dtc.h>
#include "logger.h"
@@ -55,7 +55,6 @@ public:
QVector<BuildingMetaInfo> parseMetaXml(const QString &metaXml) const;
const MainStructureElementModifyRequest &parsedRequest() const { return m_request; }
private:
NGL::INGLLogger &m_logger;
QDomDocument openXml(const QString &fileName) const;
void parseXmlInternal();
Egcu parseEgcu(const QDomElement &domEgcu);
@@ -80,7 +79,6 @@ private:
QDomElement getChildElement(const T &parent, const QString &childTag, bool bThrow = true) const;
int getInteger(const QDomElement &element, const QString &attribute) const;
private:
NGL::INGLLogger &m_logger;
QString m_xmlFilename;
QString m_vulnerabilityFilename;
QString m_egcuToRoomFilename;
@@ -92,6 +90,8 @@ private:
QString m_lastError;
QVector<Egcu> m_egcus;
SoundArea m_soundArea;
LOGGER_T m_logger;
};
} // namespace InfraStructureManagement
@@ -22,15 +22,15 @@ namespace InfrastructureManagement
InfrastructureManagement::ScheduleStatus scheduleStatus() const { return m_scheduleStatus; }
protected:
NGL::INGLLogger &m_logger;
ScheduleStatusBase(const QString &objectName, const ScheduleStatus &scheduleStatus, ObjectMainSchedule* objSchedule);
void onEntry(QEvent *event);
int scheduleId() const { return m_schedule ? m_schedule->getId() : -1; }
protected:
NGL::INGLLogger &m_logger;
ObjectMainSchedule *m_schedule;
NGL::INGLLogger &m_logger;
private:
const InfrastructureManagement::ScheduleStatus m_scheduleStatus;
};
@@ -48,7 +48,6 @@ namespace InfrastructureManagement
public:
explicit Creation(ObjectMainSchedule *objSchedule);
protected:
NGL::INGLLogger &m_logger;
void onEntry(QEvent *event);
};
@@ -65,7 +64,6 @@ namespace InfrastructureManagement
public:
explicit Activation(ObjectMainSchedule *objSchedule);
protected:
NGL::INGLLogger &m_logger;
void onEntry(QEvent *event);
};
@@ -75,7 +73,6 @@ namespace InfrastructureManagement
public:
explicit Expiration(ObjectMainSchedule *objSchedule);
protected:
NGL::INGLLogger &m_logger;
void onEntry(QEvent *event);
};
@@ -19,6 +19,7 @@ namespace InfrastructureManagement
: QObject(parent)
, m_ScheduleStatus(ScheduleStatus::Unknown)
, m_schedule(objSchedule)
, m_logger(getLogger("ScheduleStatusManager"))
{
m_stateSignals[ScheduleStatus::Unknown] = [&]() { emit stateUnknown(); };
m_stateSignals[ScheduleStatus::Created] = [&]() { emit stateCreated(); };
@@ -8,8 +8,8 @@
#pragma once
#include <QtCore/QObject>
#include <QtCore/QMap>
#include <QObject>
#include <QMap>
#include <InfrastructureManagement/ism_enums.hpp>
@@ -45,8 +45,6 @@ namespace InfrastructureManagement
void stateFalse();
private:
NGL::INGLLogger &m_logger;
void setStateInternal(InfrastructureManagement::ScheduleStatus state);
int scheduleId() const;
@@ -54,6 +52,7 @@ namespace InfrastructureManagement
InfrastructureManagement::ScheduleStatus m_ScheduleStatus;
ObjectMainSchedule *m_schedule;
NGL::INGLLogger &m_logger;
};
} // namespace InfrastructureManagement
@@ -7,7 +7,6 @@
*/
#include "schedule_status_state_machine.h"
#include <utility>
#include "schedule_status_manager.h"
#include "schedule_status_base.h"
@@ -23,6 +22,7 @@ ScheduleStatusMachine::ScheduleStatusMachine(ObjectMainSchedule* objSchedule, QO
, m_stateManager(new ScheduleStatusManager(objSchedule, this))
, m_stateMachine(new QStateMachine(this))
, m_schedule(objSchedule)
, m_logger(getLogger("ScheduleStatusMachine"))
{
qRegisterMetaType<InfrastructureManagement::ScheduleStatus>("InfrastructureManagement::ScheduleStatus");
@@ -74,7 +74,7 @@ ScheduleStatusMachine::ScheduleStatusMachine(ObjectMainSchedule* objSchedule, QO
// ----------------------------------------------------------------------------------------------------------
//States zur StateMachine hinzufügen
for (ScheduleStatusBase *state : std::as_const(m_ScheduleStatuses))
for (ScheduleStatusBase *state : qAsConst(m_ScheduleStatuses))
{
DEBUG_LOG(m_logger) << "Schedule " << scheduleId() << ": state: " << state->scheduleStatus();
m_stateMachine->addState(state);
@@ -10,7 +10,7 @@
#pragma once
#include <QtCore/QObject>
#include <QObject>
#include <QStateMachine>
#include <InfrastructureManagement/ism_enums.hpp>
@@ -45,8 +45,6 @@ namespace InfrastructureManagement
void onEnteredState();
private:
NGL::INGLLogger &m_logger;
ScheduleStatusBase *getStateFromId(InfrastructureManagement::ScheduleStatus ScheduleStatus);
int scheduleId() const;
@@ -55,6 +53,8 @@ namespace InfrastructureManagement
QMap<InfrastructureManagement::ScheduleStatus, ScheduleStatusBase*> m_ScheduleStatuses;
ObjectMainSchedule *m_schedule;
NGL::INGLLogger &m_logger;
};
} // namespace InfrastructureManagement
@@ -9,8 +9,8 @@
#include "settings.h"
#include <QtCore/QSettings>
#include <QtCore/QVariant>
#include <QSettings>
#include <QVariant>
#include <nglsettings/nglsettings_settings.h>
#include <ngltools/ngltools_filesystem.h>
@@ -8,7 +8,7 @@
*/
#pragma once
#include <QtCore/QString>
#include <QString>
namespace NGL
{