Qt6 Migration: Complete migration with DDS/RTI support and build validation
Major Changes:
- Merged latest Qt5 devel content from dlbo (292 files changed, 7 new dirs)
- Consolidated forward-declarations and include folders
- Removed unneeded modules per Niklas' repo check list
Build System Fixes:
- Fixed CMake VERSION_GREATER syntax in ParticipantManagement/CMakeLists.txt
- Added VLC packages (libvlc-dev, vlc-plugin-base) to docker_build.sh
- Added PostgreSQL dev packages (libpq-dev, postgresql-server-dev-all) to Dockerfile
- Fixed locale warnings (ANSI_X3.4-1968 → C.UTF-8)
- Fixed ArcGIS SDK path warnings when BUILD_ARCGIS=OFF
Code Generation Fixes:
- Fixed IDL enum collisions (PortType→CorePortType/DdsutPortType, PdmEventType)
- Fixed Grantlee template svc_translation.cpp.grantlee:
- Changed {{ idl_enum.name }}_def:: to {{ idl_enum.name }}::
- Fixed .underlying() calls for C++11 scoped enums (enum class)
- Removed generated files from repo (moc_*, *_dtc.h, *_ftc.h)
Validation:
- BUILD_RTI=ON: SUCCESS
- BUILD_RTI=OFF: SUCCESS
- C++17 standard maintained for RTI 7.7 compatibility
- Ubuntu 26.04 Docker environment verified
Remaining Warnings (expected):
- BgViewer, KDChart, KDReports, Poppler-Qt6 not found (optional features)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
18662 files changed
+4115092
-5435
No files matched your search
@@ -0,0 +1,150 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Some helper classes / functions for AES
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AreaEffectSimulation/aes_export.h>
|
||||
#include <math.h>
|
||||
#include <LtsCoordTrans/lts_coord_trans.h>
|
||||
#include <QPointF>
|
||||
#include <QString>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonObject>
|
||||
#include <QJsonArray>
|
||||
#include <LtsUtilsCore/dds_bitarray.h>
|
||||
#include <LtsUtilsCore/qpoint3d.h>
|
||||
#include "aes_db.h"
|
||||
|
||||
namespace AreaEffectSimulation
|
||||
{
|
||||
inline bool chargeTypeIdIsVulcano(int chargeTypeId) { return /*(chargeTypeId == 376) ||*/ (chargeTypeId == 393) ; } // 376=Artillery ; 393=Rocket
|
||||
inline Core::GeoPosition toCoreGeoPosition(const LtsUtils::QPoint3D &point)
|
||||
{
|
||||
return Core::GeoPosition(point.x(), point.y(), point.z());
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Helper namespace TrajectoryRelative (ADLER / SAA_Trajectory)
|
||||
//------------------------------------------------------------------------------
|
||||
namespace TrajectoryRelative
|
||||
{
|
||||
|
||||
// keyword used for encoding/decoding, or in other words: for toString/fromString
|
||||
static const QString TRAJECTORY_RELATIVE_KEYWORD = QStringLiteral("trajectoryRelative");
|
||||
|
||||
inline std::string toString(const std::vector<Core::RelativePositionRelativeTime> &trajectoryRelative)
|
||||
{
|
||||
if (trajectoryRelative.empty())
|
||||
return {};
|
||||
|
||||
QJsonObject obj;
|
||||
QJsonArray arr;
|
||||
|
||||
for (const auto &coordinate : trajectoryRelative)
|
||||
{
|
||||
QJsonObject coordObj;
|
||||
coordObj[QStringLiteral("offsetX")] = coordinate.offsetX();
|
||||
coordObj[QStringLiteral("offsetY")] = coordinate.offsetY();
|
||||
coordObj[QStringLiteral("offsetZ")] = coordinate.offsetZ();
|
||||
coordObj[QStringLiteral("relativeTime")] = coordinate.relativeTime();
|
||||
arr.append(coordObj);
|
||||
}
|
||||
obj[TRAJECTORY_RELATIVE_KEYWORD] = arr;
|
||||
|
||||
return QJsonDocument(obj).toJson(QJsonDocument::JsonFormat::Compact).toStdString();
|
||||
}
|
||||
|
||||
inline std::vector<Core::RelativePositionRelativeTime> fromString(const QString &trajectoryRelativeJson)
|
||||
{
|
||||
if (trajectoryRelativeJson.isEmpty())
|
||||
return {};
|
||||
|
||||
QJsonObject obj = QJsonDocument::fromJson(trajectoryRelativeJson.toUtf8()).object();
|
||||
if (!obj.contains(TRAJECTORY_RELATIVE_KEYWORD) || !obj[TRAJECTORY_RELATIVE_KEYWORD].isArray() )
|
||||
return {};
|
||||
|
||||
std::vector<Core::RelativePositionRelativeTime> ret;
|
||||
|
||||
QJsonArray arr = obj[TRAJECTORY_RELATIVE_KEYWORD].toArray();
|
||||
for (const auto arrRef: arr)
|
||||
{
|
||||
QJsonObject coordinate = arrRef.toObject();
|
||||
|
||||
if (!coordinate.contains(QStringLiteral("offsetX")) ||
|
||||
!coordinate.contains(QStringLiteral("offsetY")) ||
|
||||
!coordinate.contains(QStringLiteral("offsetZ")) ||
|
||||
!coordinate.contains(QStringLiteral("relativeTime"))
|
||||
)
|
||||
return {};
|
||||
|
||||
Core::RelativePositionRelativeTime coord;
|
||||
coord.offsetX() = coordinate[QStringLiteral("offsetX")].toDouble();
|
||||
coord.offsetY() = coordinate[QStringLiteral("offsetY")].toDouble();
|
||||
coord.offsetZ() = coordinate[QStringLiteral("offsetZ")].toDouble();
|
||||
coord.relativeTime() = coordinate[QStringLiteral("relativeTime")].toInt();
|
||||
|
||||
ret.push_back(coord);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
} // namespace TrajectoryRelative
|
||||
|
||||
|
||||
|
||||
inline double getAngleDegreeNorth(const QPointF &p1, const QPointF &p2)
|
||||
{
|
||||
double x = p2.x() - p1.x();
|
||||
double y = p2.y() - p1.y();
|
||||
|
||||
// Winkel der Geraden bestimmen
|
||||
double alphaRad = atan2(y, x);
|
||||
|
||||
// // Fuer Winkel > PI liefert atan2 math. rechts drehende (also negative) Werte.
|
||||
// // Um Werte von 0-2PI zu bekommen muss deshalb hier von 2Pi abgezogen werden.
|
||||
|
||||
alphaRad -= M_PI / 2.0;
|
||||
alphaRad *= -1.0;
|
||||
|
||||
if (alphaRad < 0.0)
|
||||
alphaRad = 2 * M_PI + alphaRad;
|
||||
|
||||
return (alphaRad * 180.0 / M_PI);
|
||||
}
|
||||
|
||||
inline bool isPointSimilar(AreaEffectSimulation::AesExplosionGeometry geometry)
|
||||
{
|
||||
return (geometry.underlying() == AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint) ||
|
||||
(geometry.underlying() == AreaEffectSimulation::AesExplosionGeometry_def::EgPoint);
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// helper class HandledImpactsStorage
|
||||
//------------------------------------------------------------------------------
|
||||
class AES_COMMON_EXPORT HandledImpactsStorage final
|
||||
{
|
||||
public:
|
||||
Q_DISABLE_COPY(HandledImpactsStorage)
|
||||
|
||||
HandledImpactsStorage();
|
||||
~HandledImpactsStorage();
|
||||
|
||||
void setIndexProcessed(int aesItemId, int index);
|
||||
bool isIndexProcessed(int aesItemId, int index);
|
||||
void removeAesItem(int aesItemId);
|
||||
|
||||
private:
|
||||
class Private;
|
||||
/**
|
||||
* The private d->pointer to not break BC when changing internals of this class
|
||||
*/
|
||||
Private *d = nullptr;
|
||||
};
|
||||
|
||||
} // namespace AreaEffectSimulation
|
||||
Reference in new issue
Block a user