Adds immediate migration results

This commit is contained in:
torsten committed 2026-08-18 22:12:24 +02:00
1 parent ba4121728b
commit 6a2a0667ab
2395 files changed
+357322 -2524

No files matched your search

@@ -26,10 +26,10 @@ NGL_ADD_LIBRARY2(AAR SV BuildingControlVwm SHARED ${vwm_SRCS})
NGL_TARGET_LINK_LIBRARIES(BuildingControlVwm
PRIVATE
ngltools
Qt5::Xml
Qt6::Xml
PUBLIC
Qt5::Core
Qt5::Gui
Qt6::Core
Qt6::Gui
LtsUtilsCoreHeaderOnly
BuildingControlCommon
)
@@ -41,8 +41,8 @@ NGL_TARGET_LINK_LIBRARIES(BuildingControlTestVwm
NGLLogger
ngltools
LtsUtilsCoreHeaderOnly
Qt5::Xml
Qt5::Core
Qt6::Xml
Qt6::Core
BuildingControlCommon
BuildingControlVwm
nglcoreapplication
@@ -51,9 +51,9 @@ NGL_TARGET_LINK_LIBRARIES(BuildingControlTestVwm
NGL_ADD_EXECUTABLE(AAR SV BuildingControlTestVwmXml test_vwm_xml.cpp)
NGL_TARGET_LINK_LIBRARIES(BuildingControlTestVwmXml
LtsUtilsCoreHeaderOnly
Qt5::Xml
Qt5::Core
Qt5::Gui
Qt6::Xml
Qt6::Core
Qt6::Gui
BuildingControlVwm
BuildingControlCommon
nglcoreapplication
@@ -66,9 +66,9 @@ IF(BUILD_TESTING AND TARGET BuildingControlVwm)
)
ADD_EXECUTABLE(bld_vwm_math_unit_test ${test_SRCS})
TARGET_LINK_LIBRARIES(bld_vwm_math_unit_test
Qt5::Gui
Qt5::Core
Qt5::Test
Qt6::Gui
Qt6::Core
Qt6::Test
BuildingControlVwm
BuildingControlCommon
nglcoreapplication
@@ -2,6 +2,7 @@
#include "vwm_math.h"
#include <utility>
#include "vwm_xml_reader.h"
#include "vwm_building_room_geometry.h"
#include "vwm_api.h"
@@ -308,11 +309,11 @@ int main(int argc, char *argv[])
QPolygonF footprintPoly;
footprintPoly.reserve(footprint.size());
for (auto coord : qAsConst(footprint))
for (auto coord : std::as_const(footprint))
footprintPoly << coord.toPointF();
double maxZ = 0;
for(const MyRoom &room : qAsConst(rooms))
for(const MyRoom &room : std::as_const(rooms))
{
TRACE_LOG(app.baseLogger()) << "Room: " << room.id
<< ", bboxMin: " << room.bBoxMin
@@ -368,7 +369,7 @@ int main(int argc, char *argv[])
INFO_LOG(app.baseLogger()) << "******** Building '" << building.name() << "' -> checkBsmPosition using rooms";
for(const MyRoom &myRoom : qAsConst(rooms))
for(const MyRoom &myRoom : std::as_const(rooms))
{
const int roomIdToCheck = myRoom.id;
LtsUtils::QPoint3D center = myRoom.center();
@@ -464,7 +465,7 @@ int main(int argc, char *argv[])
INFO_LOG(app.baseLogger()) << "******** Building '" << building.name() << "' -> checkBsmPosition using BSMs";
for (const BuildingControlUnit::Bsm &bsm : qAsConst(bsmConfig.bsmMap))
for (const BuildingControlUnit::Bsm &bsm : std::as_const(bsmConfig.bsmMap))
{
const auto hitPos = BuildingControlUnit::VWM::Math::checkBsmPosition(bsm.position, bsm.direction, building.rooms());
if (hitPos.state != BuildingControlUnit::VWM::HitPosition::State::OuterWall)
@@ -505,7 +506,7 @@ int main(int argc, char *argv[])
INFO_LOG(app.baseLogger()) << "**** Building '" << building.name() << "' heightZ = " << heightZ;
for(const MyRoom &myRoom : qAsConst(rooms))
for(const MyRoom &myRoom : std::as_const(rooms))
{
const int roomIdToCheck = myRoom.id;
LtsUtils::QPoint3D center = myRoom.center();
@@ -534,7 +535,7 @@ int main(int argc, char *argv[])
<< " fine, found just one room: " << roomsWithDetonation.first();
} else {
QString roomIdsStr(QStringLiteral("roomIds("));
for (auto roomId : qAsConst(roomsWithDetonation))
for (auto roomId : std::as_const(roomsWithDetonation))
roomIdsStr.append(QString(QStringLiteral("%1 ")).arg(roomId));
roomIdsStr.append(QStringLiteral(")"));
@@ -2,6 +2,7 @@
#include "vwm_api.h"
#include <utility>
#include "vwm_deposition.h"
#include "vwm_xml_reader.h"
#include "vwm_state_store.h"
@@ -216,7 +217,7 @@ void Api::dumpHitResult(const Hit &hit, const HitResult &result, const Charge &c
output << ",," << "\n";
output << "RoomId,damagePercent,remainingEffectPercent,directHit" << "\n";
for (const HitRoom &hitRoom : qAsConst(result.rooms))
for (const HitRoom &hitRoom : std::as_const(result.rooms))
{
output << hitRoom.roomId << ","
<< hitRoom.damagePercent << ","
@@ -281,7 +282,7 @@ void Api::onSetContaminationState(const std::vector<ContaminationState> &contami
#if QT_VERSION < QT_VERSION_CHECK(5,10,0)
QSet<int> roomsSet;
for (const auto i: qAsConst(newcs.rooms))
for (const auto i: std::as_const(newcs.rooms))
{
roomsSet.insert(i);
}
@@ -404,7 +405,7 @@ void Api::onHitCes(const qint64 effectTimeMSec, const int chargeTypeId,
INFO_LOG(m_logger) << "XXXXX Aes hit - hit pos: " << posImpactOnGround << " direction: " << hit.direction
<< " (p=" << hit.direction+posImpactOnGround << ")"
<< " ; nearestWall.roomId=" << nearestWall.roomId;
for (auto item : qAsConst(nearestWall.wallElement))
for (auto item : std::as_const(nearestWall.wallElement))
DEBUG_LOG(m_logger) << "Aes hit - hit pos: " << posImpactOnGround << " direction: " << hit.direction
<< " (p=" << hit.direction+posImpactOnGround
<< " - " << item;
@@ -436,13 +437,13 @@ NearestWall Api::findNearestWall(const LtsUtils::QPoint3D &detonationLocation, d
distanceOut = std::numeric_limits<double>::max();
INFO_LOG(m_logger) << "XXXXX searching nearest wall ...";
for (const Room &room : qAsConst(m_building.rooms()))
for (const Room &room : std::as_const(m_building.rooms()))
{
for (const OuterWall &wall : qAsConst(room.outerWalls()))
for (const OuterWall &wall : std::as_const(room.outerWalls()))
{
for (const WallElement &we : qAsConst(wall.elements()))
for (const WallElement &we : std::as_const(wall.elements()))
{
for (const LtsUtils::QPoint3D &p : qAsConst(we))
for (const LtsUtils::QPoint3D &p : std::as_const(we))
{
const double dist = (detonationLocation - p).length();
DEBUG_LOG(m_logger) << "Room[" << room.id() << "]: " << p << ", dist = " << dist;
@@ -2,6 +2,7 @@
#include "vwm_building.h"
#include <utility>
#include "vwm_math.h"
#include <QSet>
#include <QVector>
@@ -88,11 +89,11 @@ double Room::damagePercent() const
double currentProtection = 0.0;
double initialProtection = 0.0;
for (const OuterWall &wall : qAsConst(m_outerWalls))
for (const OuterWall &wall : std::as_const(m_outerWalls))
{
currentProtection += wall.protection();
initialProtection += wall.initialProtection();
for (const ExclusionZone &exZone : qAsConst(wall.exclusionZones()))
for (const ExclusionZone &exZone : std::as_const(wall.exclusionZones()))
{
currentProtection += exZone.protection();
initialProtection += exZone.initialProtection();
@@ -264,7 +265,7 @@ Building::Building()
int Building::checkPolygons()
{
int numberOfDuplicates = 0;
for (const Room &room : qAsConst(m_rooms))
for (const Room &room : std::as_const(m_rooms))
{
for (int owIdx = 0; owIdx < room.outerWalls().size(); ++owIdx)
{
@@ -311,7 +312,7 @@ int Building::cleanupPolygons()
<< " in room " << room.id() << " OuterWall[" << owIdx
<< "], element[" << elemIdx << "] "
<< " makePlanar and cleanupDublicatePointsInPolygon would generate short polygon, size=" << candidate.size();
for (auto point : qAsConst(candidate))
for (auto point : std::as_const(candidate))
NOTICE_LOG(m_logger) << " point= " << point;
bMakePlanarDone = false;
@@ -673,7 +674,7 @@ QMap<int, Building::NeighboursToCheck> Building::checkHitNeighbours(const QMap<i
<< oldRe << " -> new: " << neighbour.remainingEffect();
for (const NeighbourRoom &grade2Neighbour : qAsConst(neighbour.neighbours()))
for (const NeighbourRoom &grade2Neighbour : std::as_const(neighbour.neighbours()))
{
if (lowerGradeNeighbours.contains(grade2Neighbour.id()) ||
currentGradeNeighbours.contains(grade2Neighbour.id()))
@@ -829,7 +830,7 @@ double MakePlanar::ratioOfSmallestAndBiggestDimension()
rangeX.min = m_poly.first().x(); rangeX.max = m_poly.first().x();
rangeY.min = m_poly.first().y(); rangeY.max = m_poly.first().y();
rangeZ.min = m_poly.first().z(); rangeZ.max = m_poly.first().z();
for (const LtsUtils::QPoint3D &pnt : qAsConst(m_poly))
for (const LtsUtils::QPoint3D &pnt : std::as_const(m_poly))
{
rangeX.min = std::min(rangeX.min, pnt.x());
rangeX.max = std::max(rangeX.max, pnt.x());
@@ -890,7 +891,7 @@ void wallElementToBottomLeftTopRight3D(const WallElement &wallElement,
const LtsUtils::QPoint3D &frontItem = wallElement.front();
bottomLeftOut = frontItem;
topRightOut = frontItem;
for (auto coord : qAsConst(wallElement))
for (auto coord : std::as_const(wallElement))
{
if (coord.x() < bottomLeftOut.x())
bottomLeftOut.setX(coord.x());
@@ -2,6 +2,7 @@
#include "vwm_math.h"
#include <utility>
#include <logger.h>
@@ -278,7 +279,7 @@ static inline bool getHitPositionInternal(const QVector<LtsUtils::QPoint3D> &pla
ERROR_LOG(l) << "planePoints are not sufficiant";
for (auto coord : planePoints)
ERROR_LOG(l) << "planePoints are not sufficiant: << " << coord;
for (auto coord : qAsConst(localPoly))
for (auto coord : std::as_const(localPoly))
ERROR_LOG(l) << "localPoly are not sufficiant: << " << coord;
return false;
}
@@ -453,12 +454,12 @@ HitPosition checkBsmPosition(const LtsUtils::QPoint3D &position, const LtsUtils:
ERROR_LOG(l) << "localWallElement are not sufficiant";
for (auto coord : wallElement)
ERROR_LOG(l) << "wallElement are not sufficiant: << " << coord;
for (auto coord : qAsConst(localWallElement))
for (auto coord : std::as_const(localWallElement))
ERROR_LOG(l) << "localWallElement are not sufficiant: << " << coord;
continue;
}
for (auto pointOfWallElementLinear : qAsConst(localWallElement))
for (auto pointOfWallElementLinear : std::as_const(localWallElement))
DEBUG_LOG(l) << "room[" << room.id() << "]" << " wall[" << idxOuterWall << "] " << " wallElement[" << idxWallElement << "] #points = " << localWallElement.size() << ", pointOfWallElementLinear=" << pointOfWallElementLinear;
const VwmPlane vwmPlaneOW(localWallElement.at(0), localWallElement.at(1), localWallElement.at(2));
@@ -537,9 +538,9 @@ LtsUtils::QPoint3D getIntersectionInternal(
if (localPoly.size() < 3)
{
ERROR_LOG(l) << "planePoints are not sufficiant";
for (auto coord : qAsConst(planePoints))
for (auto coord : std::as_const(planePoints))
ERROR_LOG(l) << "planePoints are not sufficiant: << " << coord;
for (auto coord : qAsConst(localPoly))
for (auto coord : std::as_const(localPoly))
ERROR_LOG(l) << "localPoly are not sufficiant: << " << coord;
return invalidPosition();
}
@@ -592,9 +593,9 @@ LtsUtils::QPoint3D intersection(const LtsUtils::QPoint3D &start, const LtsUtils:
int cnt = 0;
int roomId4Debugging = 1;
for (const Room &room : qAsConst(rooms))
for (const OuterWall &outerWall : qAsConst(room.outerWalls()))
for (const WallElement &wallElement : qAsConst(outerWall.elements()))
for (const Room &room : std::as_const(rooms))
for (const OuterWall &outerWall : std::as_const(room.outerWalls()))
for (const WallElement &wallElement : std::as_const(outerWall.elements()))
{
const LtsUtils::QPoint3D point = getIntersectionInternal(wallElement, start, direction);
DEBUG_LOG(l) << "getIntersectionInternal:"
@@ -628,9 +629,9 @@ bool hasIntersection(const LtsUtils::QPoint3D &start, const LtsUtils::QPoint3D &
{
const double distance = (end - start).length();
const LtsUtils::QPoint3D direction = (end - start).normalized();
for (const Room &room : qAsConst(rooms))
for (const OuterWall &outerWall : qAsConst(room.outerWalls()))
for (const WallElement &wallElement : qAsConst(outerWall.elements()))
for (const Room &room : std::as_const(rooms))
for (const OuterWall &outerWall : std::as_const(room.outerWalls()))
for (const WallElement &wallElement : std::as_const(outerWall.elements()))
{
const LtsUtils::QPoint3D point = getIntersectionInternal(wallElement, start, direction);
if (point == invalidPosition())
@@ -1,6 +1,7 @@
#include "vwm_state_store.h"
#include <utility>
#include <logger.h>
#include <QJsonDocument>
#include <QJsonObject>
@@ -81,7 +82,7 @@ static inline QJsonArray writeContaminationStates(const QMap<int, ContaminationS
for (const auto &value : contaminationStates.values() )
{
QJsonArray roomArr;
for (const auto & roomId : qAsConst(value.rooms))
for (const auto & roomId : std::as_const(value.rooms))
roomArr.append(QJsonValue(roomId));
contaminationArr.append(QJsonObject({ {QStringLiteral("aesId") , value.aesId},
@@ -4,6 +4,7 @@
#pragma once
#include <LtsUtilsCore/qpoint3d.h>
#include <utility>
#include <QMap>
#include <QVector>
#include <cstdint>
@@ -71,7 +72,7 @@ inline std::ostream &operator<< (std::ostream &stream, const Hit &hit)
<< ", damageStateOverride = " << hit.damageStateOverride;
stream << ", affectedRoomIds = (";
for (int id : qAsConst(hit.affectedRoomIds))
for (int id : std::as_const(hit.affectedRoomIds))
stream << id << ",";
stream << ")";