Adds immediate migration results
This commit is contained in:
2395 files changed
+357322
-2524
No files matched your search
+2
-2
@@ -42,8 +42,8 @@ NGL_TARGET_LINK_LIBRARIES(BuildingControlBsm
|
||||
PRIVATE
|
||||
NGLLogger
|
||||
PUBLIC
|
||||
Qt5::Core
|
||||
Qt5::Network
|
||||
Qt6::Core
|
||||
Qt6::Network
|
||||
BuildingControlCommon
|
||||
)
|
||||
|
||||
|
||||
+5
-4
@@ -2,6 +2,7 @@
|
||||
|
||||
|
||||
#include "bsm_socket_handler.h"
|
||||
#include <utility>
|
||||
#include "bsm_telegrams_base.h"
|
||||
#include "bsm_telegrams_bit_timeout_request.h"
|
||||
#include "bsm_telegrams_chopped_signal_flash.h"
|
||||
@@ -109,7 +110,7 @@ bool SocketHandler::triggerFlashlights(int numberOfFlashes,
|
||||
flash.m_choppedFlashConfig = qBound(2, choppedConfiguration, 10);
|
||||
flash.m_flashDuration = flashDuration;
|
||||
const QByteArray data = flash.toBytestream();
|
||||
for (Socket *s : qAsConst(m_sockets))
|
||||
for (Socket *s : std::as_const(m_sockets))
|
||||
{
|
||||
if (s->isConnected())
|
||||
{
|
||||
@@ -201,7 +202,7 @@ void SocketHandler::onCleanupQueue()
|
||||
return;
|
||||
QVector<OpticalShot> activeShots;
|
||||
qint64 tNow = QDateTime::currentMSecsSinceEpoch();
|
||||
for (const OpticalShot &os : qAsConst(m_lastShots))
|
||||
for (const OpticalShot &os : std::as_const(m_lastShots))
|
||||
{
|
||||
if (os.timeStampMSec < tNow - s_opticalTimeSlot)
|
||||
continue;
|
||||
@@ -237,7 +238,7 @@ Socket *SocketHandler::getSocketForBsm(const QString &hostname)
|
||||
{
|
||||
if (ha.isLoopback())
|
||||
continue;
|
||||
for (Socket *s : qAsConst(m_sockets))
|
||||
for (Socket *s : std::as_const(m_sockets))
|
||||
{
|
||||
if (s->peerAddress() == ha)
|
||||
return s;
|
||||
@@ -356,7 +357,7 @@ void SocketHandler::handleDirectFireSummray()
|
||||
return;
|
||||
int distance = 3000;
|
||||
DEBUG_LOG(m_logger) << "distance=" << distance;
|
||||
for (const OpticalShot &os : qAsConst(m_lastShots))
|
||||
for (const OpticalShot &os : std::as_const(m_lastShots))
|
||||
{
|
||||
int act_distance = os.deposition1 * os.deposition1 + os.deposition2 * os.deposition2;
|
||||
DEBUG_LOG(m_logger) << "act_distance=" << act_distance << " BSM-ID=" << os.id
|
||||
|
||||
+8
-8
@@ -32,12 +32,12 @@ SET(bc_SRCS
|
||||
NGL_ADD_LIBRARY2(AAR SV BuildingControlCommon SHARED ${bcc_SRCS})
|
||||
NGL_TARGET_LINK_LIBRARIES(BuildingControlCommon
|
||||
PRIVATE
|
||||
Qt5::Xml
|
||||
Qt6::Xml
|
||||
nglsettings
|
||||
ngltools
|
||||
PUBLIC
|
||||
NGLLogger
|
||||
Qt5::Core
|
||||
Qt6::Core
|
||||
LtsUtilsCoreHeaderOnly
|
||||
)
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(BuildingControlCommon
|
||||
@@ -47,12 +47,12 @@ NGL_TARGET_INCLUDE_DIRECTORIES(BuildingControlCommon
|
||||
|
||||
NGL_ADD_EXECUTABLE(AAR SV BuildingControlUnit ${bc_SRCS})
|
||||
NGL_TARGET_LINK_LIBRARIES(BuildingControlUnit
|
||||
Qt5::Core
|
||||
Qt5::WebSockets
|
||||
# Qt5::Test
|
||||
Qt5::Xml
|
||||
Qt5::Network
|
||||
Qt5::Concurrent
|
||||
Qt6::Core
|
||||
Qt6::WebSockets
|
||||
# Qt6::Test
|
||||
Qt6::Xml
|
||||
Qt6::Network
|
||||
Qt6::Concurrent
|
||||
BuildingControlBsm
|
||||
BuildingControlCommon
|
||||
BuildingControlJson
|
||||
|
||||
+10
-10
@@ -22,11 +22,11 @@ SET(cot_SRCS
|
||||
NGL_ADD_LIBRARY2(AAR SV ControlEffects SHARED ${co_SRCS})
|
||||
NGL_TARGET_LINK_LIBRARIES(ControlEffects
|
||||
NGLLogger
|
||||
Qt5::Concurrent
|
||||
Qt5::Core
|
||||
# Qt5::Test
|
||||
Qt5::Xml
|
||||
Qt5::Network
|
||||
Qt6::Concurrent
|
||||
Qt6::Core
|
||||
# Qt6::Test
|
||||
Qt6::Xml
|
||||
Qt6::Network
|
||||
BuildingControlCommon
|
||||
BuildingControlVwm
|
||||
BuildingControlBsm
|
||||
@@ -36,11 +36,11 @@ NGL_TARGET_LINK_LIBRARIES(ControlEffects
|
||||
NGL_ADD_EXECUTABLE(AAR SV ControlEffectsTest ${cot_SRCS})
|
||||
NGL_TARGET_LINK_LIBRARIES(ControlEffectsTest
|
||||
NGLLogger
|
||||
Qt5::Concurrent
|
||||
Qt5::Core
|
||||
# Qt5::Test
|
||||
Qt5::Xml
|
||||
Qt5::Network
|
||||
Qt6::Concurrent
|
||||
Qt6::Core
|
||||
# Qt6::Test
|
||||
Qt6::Xml
|
||||
Qt6::Network
|
||||
BuildingControlCommon
|
||||
BuildingControlVwm
|
||||
nglcoreapplication
|
||||
|
||||
+3
-2
@@ -2,6 +2,7 @@
|
||||
|
||||
|
||||
#include "handeleffects.h"
|
||||
#include <utility>
|
||||
#include "handeleffect.h"
|
||||
#include "handle_http_request.h"
|
||||
#include <QTimer>
|
||||
@@ -162,7 +163,7 @@ void HandelEffects::setOverrides(const QVector<BcuEffectState> &effectStates)
|
||||
{
|
||||
m_effectStates = effectStates;
|
||||
DEBUG_LOG(m_logger) << "In set overrides for " << m_hostname << ", effectStates.size: " << effectStates.size();
|
||||
for(const auto &es : qAsConst(m_effectStates))
|
||||
for(const auto &es : std::as_const(m_effectStates))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "m_effectStates: es.id=" << es.id
|
||||
<< ", es.type=" << es.type
|
||||
@@ -170,7 +171,7 @@ void HandelEffects::setOverrides(const QVector<BcuEffectState> &effectStates)
|
||||
}
|
||||
m_sounds = EffectOverride::EO_Auto;
|
||||
DEBUG_LOG(m_logger) << "Nun die Schleife:";
|
||||
for(const auto &es : qAsConst(effectStates))
|
||||
for(const auto &es : std::as_const(effectStates))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "es.id=" << es.id
|
||||
<< ", es.type=" << es.type
|
||||
|
||||
+3
-3
@@ -14,10 +14,10 @@ SET(json_SRCS
|
||||
NGL_ADD_LIBRARY2(AAR SV BuildingControlJson SHARED ${json_SRCS})
|
||||
NGL_TARGET_LINK_LIBRARIES(BuildingControlJson
|
||||
PRIVATE
|
||||
Qt5::WebSockets
|
||||
Qt6::WebSockets
|
||||
PUBLIC
|
||||
Qt5::Core
|
||||
Qt5::Network
|
||||
Qt6::Core
|
||||
Qt6::Network
|
||||
BuildingControlCommon
|
||||
BuildingControlBsm
|
||||
BuildingControlVwm
|
||||
|
||||
+4
-3
@@ -2,6 +2,7 @@
|
||||
|
||||
|
||||
#include "json_api.h"
|
||||
#include <utility>
|
||||
#include "web_socket_handler.h"
|
||||
#include "web_socket_telegrams.h"
|
||||
#include <QWebSocket>
|
||||
@@ -168,7 +169,7 @@ void Api::onTelegramReceived(const std::shared_ptr<Telegrams::BaseTelegram> &tel
|
||||
Telegrams::SetEffectStates *sff = static_cast<Telegrams::SetEffectStates *>(tele.get());
|
||||
QVector<BcuEffectState> val;
|
||||
val.reserve(sff->effectStates.size());
|
||||
for(const auto &fi : qAsConst(sff->effectStates))
|
||||
for(const auto &fi : std::as_const(sff->effectStates))
|
||||
{
|
||||
BcuEffectState ff;
|
||||
ff.id = fi.id;
|
||||
@@ -192,7 +193,7 @@ void Api::onTelegramReceived(const std::shared_ptr<Telegrams::BaseTelegram> &tel
|
||||
Telegrams::SetFortifyFactor *sff = static_cast<Telegrams::SetFortifyFactor *>(tele.get());
|
||||
QVector<FortifyInfo> val;
|
||||
val.reserve(sff->fortifyFactors.size());
|
||||
for(const auto &fi : qAsConst(sff->fortifyFactors))
|
||||
for(const auto &fi : std::as_const(sff->fortifyFactors))
|
||||
{
|
||||
FortifyInfo ff;
|
||||
ff.roomId = fi.roomId;
|
||||
@@ -207,7 +208,7 @@ void Api::onTelegramReceived(const std::shared_ptr<Telegrams::BaseTelegram> &tel
|
||||
Telegrams::RelayState *sff = static_cast<Telegrams::RelayState *>(tele.get());
|
||||
QVector<RelayStateInfo> val;
|
||||
val.reserve(sff->relayStates.size());
|
||||
for(const auto &fi : qAsConst(sff->relayStates))
|
||||
for(const auto &fi : std::as_const(sff->relayStates))
|
||||
{
|
||||
RelayStateInfo ff;
|
||||
ff.id = fi.id;
|
||||
|
||||
+3
-2
@@ -2,6 +2,7 @@
|
||||
|
||||
|
||||
#include "web_socket_handler.h"
|
||||
#include <utility>
|
||||
#include "web_socket_telegrams.h"
|
||||
#include <QWebSocket>
|
||||
#include <iostream>
|
||||
@@ -18,7 +19,7 @@ WebSocketHandler::WebSocketHandler(QObject *parent)
|
||||
|
||||
WebSocketHandler::~WebSocketHandler()
|
||||
{
|
||||
for (QWebSocket *s : qAsConst(m_webSockets))
|
||||
for (QWebSocket *s : std::as_const(m_webSockets))
|
||||
{
|
||||
s->disconnect(this);
|
||||
s->close();
|
||||
@@ -51,7 +52,7 @@ bool WebSocketHandler::sendTelegram(const Telegrams::BaseTelegram *tele, QWebSoc
|
||||
DEBUG_LOG(m_logger) << "jsonStr" << jsonStr;
|
||||
|
||||
bool bOk = false;
|
||||
for (QWebSocket *ws : qAsConst(m_webSockets))
|
||||
for (QWebSocket *ws : std::as_const(m_webSockets))
|
||||
{
|
||||
if (wsDirect != nullptr && wsDirect != ws)
|
||||
continue;
|
||||
|
||||
+11
-11
@@ -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
|
||||
|
||||
+7
-6
@@ -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(")"));
|
||||
|
||||
|
||||
+8
-7
@@ -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;
|
||||
|
||||
+8
-7
@@ -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());
|
||||
|
||||
+12
-11
@@ -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())
|
||||
|
||||
+2
-1
@@ -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},
|
||||
|
||||
+2
-1
@@ -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 << ")";
|
||||
|
||||
|
||||
+4
-3
@@ -2,6 +2,7 @@
|
||||
|
||||
|
||||
#include "main_handler.h"
|
||||
#include <utility>
|
||||
#include <QWebSocket>
|
||||
#include "VWM/vwm_types.h"
|
||||
#include "bcu_xml_reader.h"
|
||||
@@ -180,7 +181,7 @@ void MainHandler::onHitResult(const HitResult &result, const QMap<int, Contamina
|
||||
|
||||
if (playSound)
|
||||
{
|
||||
for (HandelEffects *he : qAsConst(m_handelEffectsVec))
|
||||
for (HandelEffects *he : std::as_const(m_handelEffectsVec))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "playHitSound @EGCU " << he->hostname() << ", SoundId: " << result.effectSoundId;
|
||||
he->playHitSound(result.effectSoundId);
|
||||
@@ -252,7 +253,7 @@ void MainHandler::onSetEffectStatesRequest(const QString &hostname, const QVecto
|
||||
}
|
||||
return;
|
||||
}
|
||||
for (HandelEffects* hes : qAsConst(m_handelEffectsVec))
|
||||
for (HandelEffects* hes : std::as_const(m_handelEffectsVec))
|
||||
{
|
||||
if (hes->hostname() != hostname)
|
||||
continue;
|
||||
@@ -309,7 +310,7 @@ QVector<int> MainHandler::getSegmentDamage(const QVector<HitRoom> &allHitRooms,
|
||||
return result;
|
||||
result.reserve(m_egcuConfig.egcus.size());
|
||||
|
||||
for (const Egcu &egcu : qAsConst(m_egcuConfig.egcus))
|
||||
for (const Egcu &egcu : std::as_const(m_egcuConfig.egcus))
|
||||
{
|
||||
int damagePercentSegment = 0;
|
||||
for (const HitRoom &hr : allHitRooms)
|
||||
|
||||
+2
-1
@@ -2,6 +2,7 @@
|
||||
|
||||
|
||||
#include "web_socket_telegrams.h"
|
||||
#include <utility>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonObject>
|
||||
#include <QJsonArray>
|
||||
@@ -252,7 +253,7 @@ QByteArray SetContaminationState::toJson() const
|
||||
for (const auto &cs : contaminationStates )
|
||||
{
|
||||
QJsonArray roomArr;
|
||||
for (const auto & roomId : qAsConst(cs.rooms))
|
||||
for (const auto & roomId : std::as_const(cs.rooms))
|
||||
roomArr.append(QJsonValue(roomId));
|
||||
|
||||
contaminationArr.append(QJsonObject({ {s_aesId(), cs.aesId},
|
||||
|
||||
Reference in new issue
Block a user