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
+21
-63
@@ -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
|
||||
|
||||
Reference in new issue
Block a user