fix Warning

This commit is contained in:
berrux-dev committed 2026-10-03 09:20:13 +02:00
1 parent 593c221d23
commit 8345470273
316 files changed
+1246 -929

No files matched your search

@@ -8,6 +8,7 @@
*/
#include "aes_handler.h"
#include <utility>
#include "DDS/Core/function_reply_object.h"
#include "aes.hpp"
#include "json_dispatcher.h"
@@ -128,7 +129,7 @@ void AesHandler::onEffectClusterModifyReply(const Core::FunctionReplyObject &rep
std::vector<std::string> args;
args.reserve(argsList.size());
for (const auto &str : qAsConst(argsList))
for (const auto &str : std::as_const(argsList))
args.emplace_back(str.toStdString());
req.notification().content(content.toStdString());
@@ -171,7 +172,7 @@ void AesHandler::onEffectClusterModifyReply(const Core::FunctionReplyObject &rep
std::vector<NotificationManagement::Address> recipientIdsDds;
recipientIdsDds.reserve(recipientIds.size());
for (const auto &recipientId : qAsConst(recipientIds))
for (const auto &recipientId : std::as_const(recipientIds))
{
NotificationManagement::Address addr;
addr.addressId(recipientId);
@@ -349,7 +350,7 @@ void AesHandler::sendTrajectoryAdlerModifyRequest(const WirkfeldplanungData &dat
QVector<int> subordinates = m_dtcPpm->getSubordinatesByParticipant(participantId);
QVector<ParticipantManagement::ParticipantPosition> subordinatePositions;
for (int subordinate : qAsConst(subordinates))
for (int subordinate : std::as_const(subordinates))
{
DEBUG_LOG(m_logger) << "subordinates(" << participantId << ") :" << subordinate;
subordinatePositions.append(m_dtcPpm->participantPosition(subordinate));
@@ -365,7 +366,7 @@ void AesHandler::sendTrajectoryAdlerModifyRequest(const WirkfeldplanungData &dat
double grad = (data.zieldaten.zielachse / 6400.) * 360.0;
for (Flugbahnpunkt pos : qAsConst(data.feuerkommando.wirkmittel.at(wirkmittelIndex).flugbahnpunkt))
for (Flugbahnpunkt pos : std::as_const(data.feuerkommando.wirkmittel.at(wirkmittelIndex).flugbahnpunkt))
{
/*
DEBUG_LOG(m_logger) << "Flugbahnpunkt:"
@@ -625,7 +626,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
QList<QRectF> rects;
int zone = 0;
QVector<QPointF> vecPoints;
for (const WirkmittelFeuerkommando &effector : qAsConst(data.feuerkommando.wirkmittel))
for (const WirkmittelFeuerkommando &effector : std::as_const(data.feuerkommando.wirkmittel))
{
// get the target point for the effector
const QPointF centerPoint(effector.auftreffpunkt.koordinate.longitude * (M_PI / 180.0), effector.auftreffpunkt.koordinate.latitude * (M_PI / 180.0));
@@ -674,9 +675,9 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
// Now that we know the impact radius we create a boundingbox around all impact areas
int zone = 0;
QVector<QPointF> vecPoints;
for (const WirkmittelFeuerkommandoRakete &effector : qAsConst(data.feuerkommando.wirkmittelRakete))
for (const WirkmittelFeuerkommandoRakete &effector : std::as_const(data.feuerkommando.wirkmittelRakete))
{
for (const Treffpunkt &treffpunkt : qAsConst(effector.treffpunkte))
for (const Treffpunkt &treffpunkt : std::as_const(effector.treffpunkte))
{
const QPointF centerPoint(treffpunkt.koordinate.koordinate.longitude * (M_PI / 180.0), treffpunkt.koordinate.koordinate.latitude * (M_PI / 180.0));
@@ -744,7 +745,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
if (data.feuerkommando.wirkmittel.size() > 0)
{
for (const auto &effectorAdler : qAsConst(data.feuerkommando.wirkmittel))
for (const auto &effectorAdler : std::as_const(data.feuerkommando.wirkmittel))
{
AreaEffectSimulation::EffectorData effectorData;
effectorData.angleOfFall() = 0;
@@ -778,7 +779,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
const double useNewGrad = -90 + std::atan2(coordDiff.y, coordDiff.x) * (180.0 / M_PI);
DEBUG_LOG(m_logger) << "Atan2 Deg to: last point " << std::atan2(coordDiff.y, coordDiff.x) * (180.0 / M_PI);
for (const auto &flightPointAdler : qAsConst(effectorAdler.flugbahnpunkt))
for (const auto &flightPointAdler : std::as_const(effectorAdler.flugbahnpunkt))
{
Core::RelativePositionRelativeTime flightPoint;
flightPoint.offsetX() = 0; // flightPointAdler.zRelativ;
@@ -826,7 +827,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
}
else if (data.feuerkommando.wirkmittelRakete.size() > 0)
{
for (const auto &effectorAdler : qAsConst(data.feuerkommando.wirkmittelRakete))
for (const auto &effectorAdler : std::as_const(data.feuerkommando.wirkmittelRakete))
{
AreaEffectSimulation::EffectorData effectorData;
@@ -851,7 +852,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
// create centroid
Core::GeoPosition mhpPos;
QPointF centroid;
for (const auto &treffpunkt : qAsConst(effectorAdler.treffpunkte))
for (const auto &treffpunkt : std::as_const(effectorAdler.treffpunkte))
centroid += {treffpunkt.koordinate.koordinate.latitude, treffpunkt.koordinate.koordinate.longitude};
centroid /= effectorAdler.treffpunkte.size();
@@ -889,7 +890,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
double currentFlightTime = 0.0;
const LtsCoordTrans::UtmCoordinate utmStartPos = LtsCoordTrans::UtmCoordinate::fromGeographic(participantPosition.pos().lon(), participantPosition.pos().lat());
for (const Core::GeoPosition &pos : qAsConst(trajectoryWithoutTime))
for (const Core::GeoPosition &pos : std::as_const(trajectoryWithoutTime))
{
const LtsCoordTrans::UtmCoordinate utmCurrentPos = LtsCoordTrans::UtmCoordinate::fromGeographic(pos.lon(), pos.lat());
@@ -935,7 +936,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
std::vector<ProjectDataManagement::L27_EffectorId> refWirkmittel;
refWirkmittel.reserve(data.feuerkommando.wirkmittel.size());
for (const auto &wm : qAsConst(data.feuerkommando.wirkmittel))
for (const auto &wm : std::as_const(data.feuerkommando.wirkmittel))
{
ammoCounter += wm.geschoss.anzahl; // Counts every Ammo that will be shooted
DEBUG_LOG(m_logger) << "INSERT KENNER INTO MAP: " << data.feuerkampfReferenz << "---------" << wm.kenner;
@@ -954,7 +955,7 @@ QList<qint32> AesHandler::findAllPendingEffectCluster(int partyId)
// QList<AreaEffectSimulation::EffectCluster> ret;
QList<qint32> ret;
const auto &effectClusters = m_dtcAes->effectClusters();
for (const auto &effectCluster : qAsConst(effectClusters))
for (const auto &effectCluster : std::as_const(effectClusters))
{
if (effectCluster.partyId() != partyId)
continue;
@@ -993,7 +994,7 @@ void AesHandler::handleAmmoCount(const Feuerkampfdaten &data, int saaPartyId, bo
const auto &aesEffetClusters = m_dtcAes->effectClusters();
for (const auto &aes : qAsConst(aesEffetClusters))
for (const auto &aes : std::as_const(aesEffetClusters))
{
if (aes.isDeleted() || aes.partyId() != saaPartyId || aes.element() != refTrimmed.toStdString())
{
@@ -1024,7 +1025,7 @@ void AesHandler::handleAmmoCount(const Feuerkampfdaten &data, int saaPartyId, bo
{
auto refKenners = m_feuerkampfReferenzWirkmittel.value(refTrimmed);
for (const auto &kenner : qAsConst(refKenners))
for (const auto &kenner : std::as_const(refKenners))
{
ExVollzugsmeldung exvm;
exvm.feuerkampfdaten.feuerkampfReferenz = data.feuerkampfReferenz;
@@ -1056,7 +1057,7 @@ void AesHandler::removeAllPendingEffectCluster(int partyId)
INFO_LOG(m_logger) << "Pending effect cluster size: " << effectClusterIds.size();
Core::RemoveElementRequest req;
for (const qint32 id : qAsConst(effectClusterIds))
for (const qint32 id : std::as_const(effectClusterIds))
{
req.id(id);
INFO_LOG(m_logger) << "Remove effect cluster id: " << id;