fix Warning
This commit is contained in:
1 parent
593c221d23
commit
8345470273
316 files changed
+1246
-929
No files matched your search
+3
-2
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_configure_alarms.h"
|
||||
#include <utility>
|
||||
#include "initialization.h"
|
||||
#include <QJsonObject>
|
||||
#include <QJsonDocument>
|
||||
@@ -245,7 +246,7 @@ void HandlerConfigureAlarms::onEventChanged(const ExerciseEventManagement::Event
|
||||
// Schleife ueber jeden Participant in der Konfiguration
|
||||
// Vergleich Participant-ID Event mit Konfiguration Event
|
||||
// Wenn ja, Alarm an operatorId schicken
|
||||
for (const Database::AlmConfig &alarm : qAsConst(m_alarms))
|
||||
for (const Database::AlmConfig &alarm : std::as_const(m_alarms))
|
||||
{
|
||||
{
|
||||
/*DEBUG_LOG(m_logger) << " alarmConfigItem.id=" << alarm.id
|
||||
@@ -267,7 +268,7 @@ void HandlerConfigureAlarms::onEventChanged(const ExerciseEventManagement::Event
|
||||
else
|
||||
participants.append(0);
|
||||
|
||||
for (int participantId : qAsConst(participants))
|
||||
for (int participantId : std::as_const(participants))
|
||||
{
|
||||
bool allVulnerabilityStates = alarm.vulnerabilityState == -1;
|
||||
bool vulnerabilityCheck = vulnerabilityState == alarm.vulnerabilityState;
|
||||
|
||||
+3
-2
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_emergency_call.h"
|
||||
#include <utility>
|
||||
#include "initialization.h"
|
||||
#include "handler_configure_alarms.h"
|
||||
#include "object_emergency_call.h"
|
||||
@@ -131,7 +132,7 @@ void HandlerEmergencyCall::onEmergencyCallAcknowledgeRequest(const rti::core::Sa
|
||||
Core::FunctionReplyObject HandlerEmergencyCall::emergencyCallAcknowledgeRequest(const EmergencyCallAcknowledgeRequest &request)
|
||||
{
|
||||
ObjectEmergencyCall *ifs = nullptr;
|
||||
for(auto _ifs : qAsConst(m_emergencyObjMap))
|
||||
for(auto _ifs : std::as_const(m_emergencyObjMap))
|
||||
{
|
||||
auto data = _ifs->getData();
|
||||
if (data.issi == request.issi
|
||||
@@ -182,7 +183,7 @@ bool HandlerEmergencyCall::isExerciseValidForEmergencyCall() const
|
||||
|
||||
bool HandlerEmergencyCall::isNewEmergencyCall(const AlmEmergencyCall &newdata)
|
||||
{
|
||||
for(const auto &ifs : qAsConst(m_emergencyObjMap))
|
||||
for(const auto &ifs : std::as_const(m_emergencyObjMap))
|
||||
{
|
||||
const auto &data = ifs->getData();
|
||||
if (data.issi == newdata.issi
|
||||
|
||||
+3
-2
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "abstract_firing_strategy.h"
|
||||
#include <utility>
|
||||
|
||||
#include "object_effector.h"
|
||||
#include "main_handler.h"
|
||||
@@ -97,7 +98,7 @@ std::vector<Core::GeoPositionRelativeTime> AbstractFiringStrategy::buildTrajecto
|
||||
geometry.reserve(relativeTrajectory.size());
|
||||
|
||||
// Aehnlich wie Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/aes_handler.cpp Zeile 365
|
||||
for (const TrajectoryPoint &trajPntRelPos : qAsConst(relativeTrajectory))
|
||||
for (const TrajectoryPoint &trajPntRelPos : std::as_const(relativeTrajectory))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Flugbahnpunkt: trajPntRelPos :" << trajPntRelPos; // benefit from operator<<:
|
||||
|
||||
@@ -197,7 +198,7 @@ int32_t AbstractFiringStrategy::gearTypeId(int chargeTypeId, int participantId)
|
||||
DEBUG_LOG(m_logger) << "gearSize " << dynamicParticipantData.gear.size();
|
||||
|
||||
const auto& participantData_gear = dynamicParticipantData.gear;
|
||||
for (const auto &gear : qAsConst(participantData_gear))
|
||||
for (const auto &gear : std::as_const(participantData_gear))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "gear.chargeTypeId(): " << gear.chargeTypeId << ", chargeTypeId:" << chargeTypeId;
|
||||
if (gear.chargeTypeId == chargeTypeId)
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "dm72_firing_strategy.h"
|
||||
#include <utility>
|
||||
|
||||
#include "main_handler.h"
|
||||
#include "object_effector.h"
|
||||
@@ -94,7 +95,7 @@ void Dm72FiringStrategy::init()
|
||||
QVector<UtmWithHeight> tempUtmTreffpunkte;
|
||||
tempUtmTreffpunkte.reserve(wirkmittel.geschoss.anzahl);
|
||||
|
||||
for (const Treffpunkt &treffpunkt : qAsConst(wirkmittel.treffpunkte))
|
||||
for (const Treffpunkt &treffpunkt : std::as_const(wirkmittel.treffpunkte))
|
||||
{
|
||||
const UtmCoordinate utmTreffpunkt = UtmCoordinate::fromGeographic(treffpunkt.koordinate.koordinate.longitude * deg2rad(),
|
||||
treffpunkt.koordinate.koordinate.latitude * deg2rad(),
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "gmlrs_firing_strategy.h"
|
||||
#include <utility>
|
||||
#include "object_effector.h"
|
||||
|
||||
#include <TrainingAreaBase/Plugins/AdlerJson/telegrams.h>
|
||||
@@ -74,7 +75,7 @@ void GmlrsFiringStrategy::init()
|
||||
WirkmittelFeuerkommandoRakete wirkmittel;
|
||||
wirkmittelFeuerkommandoRaketeFromJson(properties, wirkmittel, bOk);
|
||||
|
||||
for (const Treffpunkt &treffpunkt : qAsConst(wirkmittel.treffpunkte))
|
||||
for (const Treffpunkt &treffpunkt : std::as_const(wirkmittel.treffpunkte))
|
||||
{
|
||||
const LtsCoordTrans::UtmCoordinate utmTreffpunkt =
|
||||
LtsCoordTrans::UtmCoordinate::fromGeographic(treffpunkt.koordinate.koordinate.longitude * LtsCoordTrans::deg2rad(),
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "effect_cluster_module_test.h"
|
||||
#include <utility>
|
||||
#include <LtsCoordTrans/lts_coord_trans.h>
|
||||
#include <nglapplication/nglcoreapplication.h>
|
||||
|
||||
@@ -933,7 +934,7 @@ int main(int argc, char *argv[])
|
||||
--argc;
|
||||
|
||||
const QStringList &slPositionalArgs = options.positionalArguments();
|
||||
for (const QString &item : qAsConst(slPositionalArgs))
|
||||
for (const QString &item : std::as_const(slPositionalArgs))
|
||||
std::cout << " item = " << item << std::endl;
|
||||
|
||||
ModuleTestEffectCluster tc(options.domainId(), options.exerciseId());
|
||||
|
||||
+9
-8
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "explosion_cluster_module_test.h"
|
||||
#include <utility>
|
||||
#include <nglapplication/nglcoreapplication.h>
|
||||
#include <LtsCoordTrans/lts_coord_trans.h>
|
||||
|
||||
@@ -265,7 +266,7 @@ void ModuleTestExplosionCluster::dumpCnt()
|
||||
void ModuleTestExplosionCluster::dumpBldgStates()
|
||||
{
|
||||
NOTICE_LOG(m_logger) << " m_buildingStateVec.size() = " << m_buildingStateVec.size();
|
||||
for (const Buildings::BuildingState &bldgState : qAsConst(m_buildingStateVec))
|
||||
for (const Buildings::BuildingState &bldgState : std::as_const(m_buildingStateVec))
|
||||
NOTICE_LOG(m_logger) << " bldgState: "
|
||||
<< ", id = " << bldgState.id
|
||||
<< ", damagePercent = " << bldgState.damagePercent
|
||||
@@ -336,7 +337,7 @@ bool ModuleTestExplosionCluster::checkBldgStates(const QVector<int> &damagePerce
|
||||
QVector<int> damagePercentIst;
|
||||
damagePercentIst.reserve(m_buildingStateVec.size());
|
||||
|
||||
for (const Buildings::BuildingState &bldgState : qAsConst(m_buildingStateVec))
|
||||
for (const Buildings::BuildingState &bldgState : std::as_const(m_buildingStateVec))
|
||||
damagePercentIst.append(bldgState.damagePercent);
|
||||
|
||||
bool same = damagePercentIst == damagePercent;
|
||||
@@ -935,7 +936,7 @@ void ModuleTestExplosionCluster::resetBldgs()
|
||||
std::vector<Buildings::Building> buildingsVec;
|
||||
buildingsVec.reserve(m_bldgIdToName.size());
|
||||
auto bldgIds = m_bldgIdToName.keys();
|
||||
for (int bldgId : qAsConst(bldgIds))
|
||||
for (int bldgId : std::as_const(bldgIds))
|
||||
buildingsVec.push_back( Buildings::Building(bldgId, {}) );
|
||||
|
||||
Buildings::SetBuildingStatesRequest requestData;
|
||||
@@ -951,7 +952,7 @@ void ModuleTestExplosionCluster::resetBldgs()
|
||||
QTest::qWait(100);
|
||||
|
||||
// check states:
|
||||
for (int bldgId : qAsConst(bldgIds))
|
||||
for (int bldgId : std::as_const(bldgIds))
|
||||
{
|
||||
const ProjectDataManagement::VulnerabilityState& bldgState = m_bldDtc->buildingState(bldgId).vulnerabilityState;
|
||||
INFO_LOG(m_logger) << "resetBldgs: bldgId " << bldgId
|
||||
@@ -1292,7 +1293,7 @@ void ModuleTestExplosionCluster::test_TneVerificationBremen_01()
|
||||
<< ", m_data.mhPoints().size()=" << m_data.mhPoints.size();
|
||||
|
||||
const std::vector<Core::GeoPosition> &formRef = itemView.form;
|
||||
for (const Core::GeoPosition &geoCoord : qAsConst(formRef))
|
||||
for (const Core::GeoPosition &geoCoord : std::as_const(formRef))
|
||||
{
|
||||
const LtsCoordTrans::UtmCoordinate &utm = LtsCoordTrans::UtmCoordinate::fromGeographic(geoCoord.lon, geoCoord.lat);
|
||||
INFO_LOG(m_logger) << " TNE VERIFICATION: CHECK:" << " utm: " << utm.mgrs() << ", item=" << geoCoord;
|
||||
@@ -1391,7 +1392,7 @@ void ModuleTestExplosionCluster::test_TneVerificationBremen_02()
|
||||
<< ", m_data.mhPoints().size()=" << m_data.mhPoints.size();
|
||||
|
||||
const std::vector<Core::GeoPosition> &formRef = itemView.form;
|
||||
for (const Core::GeoPosition &geoCoord : qAsConst(formRef))
|
||||
for (const Core::GeoPosition &geoCoord : std::as_const(formRef))
|
||||
{
|
||||
const LtsCoordTrans::UtmCoordinate &utm = LtsCoordTrans::UtmCoordinate::fromGeographic(geoCoord.lon, geoCoord.lat);
|
||||
INFO_LOG(m_logger) << " TNE VERIFICATION: CHECK:" << " utm: " << utm.mgrs() << ", item=" << geoCoord;
|
||||
@@ -2364,7 +2365,7 @@ void ModuleTestExplosionCluster::test_bldg_1104_effects_only()
|
||||
QVERIFY2(m_counterDds.cntTrajectory == 0, "ERROR, cnt failed!!"); // 4 impacts -> 4 trajectory
|
||||
|
||||
std::vector<AreaEffectSimulation::SingleEffect>&singleEffects = m_effects.singleEffects;
|
||||
for (const AreaEffectSimulation::SingleEffect &se : qAsConst(singleEffects))
|
||||
for (const AreaEffectSimulation::SingleEffect &se : std::as_const(singleEffects))
|
||||
{
|
||||
// Since there is no trajectory, no intersection is calculated.
|
||||
// Therefore the impacts are on the ground.
|
||||
@@ -2741,7 +2742,7 @@ int main(int argc, char *argv[])
|
||||
--argc;
|
||||
|
||||
const QStringList &slPositionalArgs = options.positionalArguments();
|
||||
for (const QString &item : qAsConst(slPositionalArgs))
|
||||
for (const QString &item : std::as_const(slPositionalArgs))
|
||||
std::cout << " item = " << item << std::endl;
|
||||
|
||||
// enable_create_bulk only if it´s explicitly called by user:
|
||||
|
||||
+26
-25
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "limits_module_test.h"
|
||||
#include <utility>
|
||||
#include "qtestcase.h"
|
||||
#include <nglapplication/nglcoreapplication.h>
|
||||
#include <LtsCoordTrans/lts_coord_trans.h>
|
||||
@@ -71,7 +72,7 @@ void ModuleTestLimits::testExplosionClusterCentral()
|
||||
|
||||
int counter = 0;
|
||||
const auto &items = m_aesDtc->explosionClusters();
|
||||
for (const auto &item : qAsConst(items))
|
||||
for (const auto &item : std::as_const(items))
|
||||
{
|
||||
if (item.effectStateId == AesEffectState::EsPrepared && item.isCentral == true)
|
||||
++counter;
|
||||
@@ -104,7 +105,7 @@ void ModuleTestLimits::testExplosionClusterDecentral()
|
||||
|
||||
int counter = 0;
|
||||
const auto &items = m_aesDtc->explosionClusters();
|
||||
for (const auto &item : qAsConst(items))
|
||||
for (const auto &item : std::as_const(items))
|
||||
{
|
||||
if ((item.effectStateId == AesEffectState::EsPrepared) && (item.isCentral == false))
|
||||
++counter;
|
||||
@@ -140,7 +141,7 @@ void ModuleTestLimits::testAirSupports()
|
||||
|
||||
int counter = 0;
|
||||
const auto &items = m_aesDtc->explosionClusters();
|
||||
for (const auto &item : qAsConst(items))
|
||||
for (const auto &item : std::as_const(items))
|
||||
{
|
||||
if (item.effectStateId == AesEffectState::EsPrepared && item.isCentral && m_pdmDtc->gearClassFromChargeTypeId(item.chargeStruct.chargeTypeId) == ProjectDataManagement::GearClass::GearClass_AirSupport)
|
||||
++counter;
|
||||
@@ -173,7 +174,7 @@ void ModuleTestLimits::testMineAreaCentral()
|
||||
|
||||
int counter = 0;
|
||||
const auto &items = m_aesDtc->mineAreas();
|
||||
for (const auto &item : qAsConst(items))
|
||||
for (const auto &item : std::as_const(items))
|
||||
{
|
||||
if ((item.effectStateId == AesEffectState::EsPrepared) && (item.isCentral == true))
|
||||
++counter;
|
||||
@@ -207,7 +208,7 @@ void ModuleTestLimits::testMineAreaDecentral()
|
||||
|
||||
int counter = 0;
|
||||
const auto &items = m_aesDtc->mineAreas();
|
||||
for (const auto &curMineArea : qAsConst(items))
|
||||
for (const auto &curMineArea : std::as_const(items))
|
||||
{
|
||||
if ((curMineArea.effectStateId == AesEffectState::EsPrepared) && (curMineArea.isCentral == false))
|
||||
++counter;
|
||||
@@ -234,7 +235,7 @@ void ModuleTestLimits::testMineAreaDecentral()
|
||||
int counter2 = 0;
|
||||
|
||||
const auto &mineAreas = m_aesDtc->mineAreas();
|
||||
for (const auto &item : qAsConst(mineAreas))
|
||||
for (const auto &item : std::as_const(mineAreas))
|
||||
{
|
||||
if ((item.effectStateId == AesEffectState::EsPrepared) &&
|
||||
!item.isCentral &&
|
||||
@@ -270,7 +271,7 @@ void ModuleTestLimits::testNBCCentral()
|
||||
|
||||
int counter = 0;
|
||||
const auto &items = m_aesDtc->nContaminations();
|
||||
for (const auto &item : qAsConst(items))
|
||||
for (const auto &item : std::as_const(items))
|
||||
{
|
||||
if (item.effectStateId == AesEffectState::EsPrepared && item.isCentral == true)
|
||||
++counter;
|
||||
@@ -305,7 +306,7 @@ void ModuleTestLimits::testNBCDecentral()
|
||||
|
||||
int counter = 0;
|
||||
const auto &items = m_aesDtc->nContaminations();
|
||||
for (const auto &item : qAsConst(items))
|
||||
for (const auto &item : std::as_const(items))
|
||||
{
|
||||
if (item.effectStateId == AesEffectState::EsPrepared && item.isCentral == false)
|
||||
++counter;
|
||||
@@ -337,7 +338,7 @@ void ModuleTestLimits::testOffRouteMines()
|
||||
|
||||
int counter = 0;
|
||||
const auto &items = m_aesDtc->offRouteMines();
|
||||
for (const auto &item : qAsConst(items))
|
||||
for (const auto &item : std::as_const(items))
|
||||
{
|
||||
if (item.effectStateId == AesEffectState::EsPrepared && item.isCentral == true)
|
||||
++counter;
|
||||
@@ -369,7 +370,7 @@ void ModuleTestLimits::testBoobyTraps()
|
||||
|
||||
int counter = 0;
|
||||
const auto &items = m_aesDtc->boobyTraps();
|
||||
for (const auto &item : qAsConst(items))
|
||||
for (const auto &item : std::as_const(items))
|
||||
{
|
||||
if (item.effectStateId == AesEffectState::EsPrepared && item.isCentral == true)
|
||||
++counter;
|
||||
@@ -404,7 +405,7 @@ void ModuleTestLimits::testBCCCentral()
|
||||
|
||||
int counter = 0;
|
||||
const auto &items = m_aesDtc->bCContaminations();
|
||||
for (const auto &item : qAsConst(items))
|
||||
for (const auto &item : std::as_const(items))
|
||||
{
|
||||
if (item.effectStateId == AesEffectState::EsPrepared && item.isCentral == true)
|
||||
++counter;
|
||||
@@ -439,7 +440,7 @@ void ModuleTestLimits::testBCCDecentral()
|
||||
|
||||
int counter = 0;
|
||||
const auto &items = m_aesDtc->bCContaminations();
|
||||
for (const auto &item : qAsConst(items))
|
||||
for (const auto &item : std::as_const(items))
|
||||
{
|
||||
if (item.effectStateId == AesEffectState::EsPrepared && item.isCentral == false)
|
||||
++counter;
|
||||
@@ -474,7 +475,7 @@ void ModuleTestLimits::testFADecentral()
|
||||
|
||||
int counter = 0;
|
||||
const auto &items = m_aesDtc->functionalAreas();
|
||||
for (const auto &item : qAsConst(items))
|
||||
for (const auto &item : std::as_const(items))
|
||||
{
|
||||
if (item.effectStateId == AesEffectState::EsPrepared && item.isCentral == false)
|
||||
++counter;
|
||||
@@ -511,7 +512,7 @@ void ModuleTestLimits::testFACentral()
|
||||
int counter = 0;
|
||||
const auto &items = m_aesDtc->functionalAreas();
|
||||
|
||||
for (const auto &item : qAsConst(items))
|
||||
for (const auto &item : std::as_const(items))
|
||||
{
|
||||
if (item.effectStateId == AesEffectState::EsPrepared && item.isCentral == true)
|
||||
++counter;
|
||||
@@ -1192,7 +1193,7 @@ void ModuleTestLimits::deleteAesAreas()
|
||||
const QVector<AesEffectState> sts = {AesEffectState::EsExpired, AesEffectState::EsRemoved, AesEffectState::EsActivated};
|
||||
|
||||
auto clusters = m_aesDtc->explosionClusters();
|
||||
for (auto cluster : qAsConst(clusters))
|
||||
for (auto cluster : std::as_const(clusters))
|
||||
{
|
||||
if (!sts.contains(cluster.effectStateId))
|
||||
{
|
||||
@@ -1202,7 +1203,7 @@ void ModuleTestLimits::deleteAesAreas()
|
||||
}
|
||||
}
|
||||
auto nbcs = m_aesDtc->nContaminations();
|
||||
for (auto nbc : qAsConst(nbcs))
|
||||
for (auto nbc : std::as_const(nbcs))
|
||||
{
|
||||
if (!sts.contains(nbc.effectStateId))
|
||||
{
|
||||
@@ -1212,7 +1213,7 @@ void ModuleTestLimits::deleteAesAreas()
|
||||
}
|
||||
}
|
||||
auto orms = m_aesDtc->offRouteMines();
|
||||
for (auto orm : qAsConst(orms))
|
||||
for (auto orm : std::as_const(orms))
|
||||
{
|
||||
if (!sts.contains(orm.effectStateId))
|
||||
{
|
||||
@@ -1222,7 +1223,7 @@ void ModuleTestLimits::deleteAesAreas()
|
||||
}
|
||||
}
|
||||
auto bts = m_aesDtc->boobyTraps();
|
||||
for (auto bt : qAsConst(bts))
|
||||
for (auto bt : std::as_const(bts))
|
||||
{
|
||||
if (!sts.contains(bt.effectStateId))
|
||||
{
|
||||
@@ -1232,7 +1233,7 @@ void ModuleTestLimits::deleteAesAreas()
|
||||
}
|
||||
}
|
||||
auto mas = m_aesDtc->mineAreas();
|
||||
for (auto ma : qAsConst(mas))
|
||||
for (auto ma : std::as_const(mas))
|
||||
{
|
||||
if (!sts.contains(ma.effectStateId))
|
||||
{
|
||||
@@ -1242,7 +1243,7 @@ void ModuleTestLimits::deleteAesAreas()
|
||||
}
|
||||
}
|
||||
auto bccs = m_aesDtc->bCContaminations();
|
||||
for (auto bcc : qAsConst(bccs))
|
||||
for (auto bcc : std::as_const(bccs))
|
||||
{
|
||||
if (!sts.contains(bcc.effectStateId))
|
||||
{
|
||||
@@ -1252,7 +1253,7 @@ void ModuleTestLimits::deleteAesAreas()
|
||||
}
|
||||
}
|
||||
auto fas = m_aesDtc->functionalAreas();
|
||||
for (auto fa : qAsConst(fas))
|
||||
for (auto fa : std::as_const(fas))
|
||||
{
|
||||
if (!sts.contains(fa.effectStateId))
|
||||
{
|
||||
@@ -1262,7 +1263,7 @@ void ModuleTestLimits::deleteAesAreas()
|
||||
}
|
||||
}
|
||||
auto tas = m_aesDtc->technicalAreas();
|
||||
for (auto ta : qAsConst(tas))
|
||||
for (auto ta : std::as_const(tas))
|
||||
{
|
||||
if (!sts.contains(ta.effectStateId))
|
||||
{
|
||||
@@ -1273,7 +1274,7 @@ void ModuleTestLimits::deleteAesAreas()
|
||||
}
|
||||
|
||||
auto eas = m_aesDtc->explosionAreas();
|
||||
for (auto ea : qAsConst(eas))
|
||||
for (auto ea : std::as_const(eas))
|
||||
{
|
||||
if (!sts.contains(ea.effectStateId))
|
||||
{
|
||||
@@ -1284,7 +1285,7 @@ void ModuleTestLimits::deleteAesAreas()
|
||||
}
|
||||
|
||||
auto ess = m_aesDtc->explosionSingles();
|
||||
for (auto es : qAsConst(ess))
|
||||
for (auto es : std::as_const(ess))
|
||||
{
|
||||
if (!sts.contains(es.effectStateId))
|
||||
{
|
||||
@@ -1360,7 +1361,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
|
||||
const QStringList &slPositionalArgs = options.positionalArguments();
|
||||
for (const QString &item : qAsConst(slPositionalArgs))
|
||||
for (const QString &item : std::as_const(slPositionalArgs))
|
||||
std::cout << " item = " << item << std::endl;
|
||||
|
||||
// enable_create_bulk only if it´s explicitly called by user:
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "aes_others_module_test.h"
|
||||
#include <utility>
|
||||
#include <nglapplication/nglcoreapplication.h>
|
||||
#include <LtsCoordTrans/lts_coord_trans.h>
|
||||
|
||||
@@ -812,7 +813,7 @@ int main(int argc, char *argv[])
|
||||
--argc;
|
||||
|
||||
const QStringList &slPositionalArgs = options.positionalArguments();
|
||||
for (const QString &item : qAsConst(slPositionalArgs))
|
||||
for (const QString &item : std::as_const(slPositionalArgs))
|
||||
std::cout << " item = " << item << std::endl;
|
||||
|
||||
// // enable_create_bulk only if it´s explicitly called by user:
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "trajectory_unit_test.h"
|
||||
#include <utility>
|
||||
#include <Trajectory/trajectory_helper.h>
|
||||
#include <Trajectory/trajectory_generator.h>
|
||||
#include <Trajectory/trajectory_generator_vulcano.h>
|
||||
@@ -991,7 +992,7 @@ void UnitTestTrajectory::test_vulcano_trajectory()
|
||||
}
|
||||
|
||||
int i=0;
|
||||
for (auto &item : qAsConst(trajectoryOut))
|
||||
for (auto &item : std::as_const(trajectoryOut))
|
||||
INFO_LOG(m_logger) << "i = " << i++ << ", item " << item;
|
||||
}
|
||||
|
||||
|
||||
+3
-2
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "trajectory_generator.h"
|
||||
#include <utility>
|
||||
#include "trajectory_generator_vulcano.h"
|
||||
#include <ExerciseManagement/exm_data_plugin_interface.h>
|
||||
#include <AssetManagement/asm_data_plugin_interface.h>
|
||||
@@ -199,7 +200,7 @@ bool TrajectoryGenerator::generateTrajectoryVulcano(const QPoint3D &originatorPo
|
||||
{
|
||||
QPoint4D startPoint = trajectoryMetricOut.first();
|
||||
|
||||
for (const QPoint4D &p4D : qAsConst(trajectoryMetricOut))
|
||||
for (const QPoint4D &p4D : std::as_const(trajectoryMetricOut))
|
||||
{
|
||||
output << p4D.x() - startPoint.x() << ";"
|
||||
<< p4D.y() - startPoint.y() << ";"
|
||||
@@ -231,7 +232,7 @@ bool TrajectoryGenerator::generateTrajectoryVulcano(const QPoint3D &originatorPo
|
||||
trajectoryTimeAwareOut.clear();
|
||||
trajectoryTimeAwareOut.reserve(trajectoryMetricOut.size());
|
||||
|
||||
for (const QPoint4D& pnt4d : qAsConst(trajectoryMetricOut))
|
||||
for (const QPoint4D& pnt4d : std::as_const(trajectoryMetricOut))
|
||||
{
|
||||
LtsCoordTrans::UtmCoordinate pntUtm(idealHitUtm.zone, pnt4d.x(), pnt4d.y());
|
||||
const QPointF &pntGeo = pntUtm.geographic();
|
||||
|
||||
+2
-1
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "trajectory_generator_vulcano.h"
|
||||
#include <utility>
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QPointF>
|
||||
@@ -171,7 +172,7 @@ bool TrajectoryGeneratorVulcano::trajectoryVulcano(const QPoint3D &origin, const
|
||||
trajectoryOut.reserve(phase1_bal.size()+5);
|
||||
|
||||
int cnt = 0;
|
||||
for (const QPointF &xyVertex : qAsConst(phase1_bal))
|
||||
for (const QPointF &xyVertex : std::as_const(phase1_bal))
|
||||
{
|
||||
// translate from XY to XYZ
|
||||
const QPoint3D p3d_offset(xyVertex.x() * factorX, // xyVertex.x()
|
||||
|
||||
+3
-1
@@ -49,7 +49,9 @@ private:
|
||||
qint64 m_finishedTime;
|
||||
};
|
||||
|
||||
static bool withinTolerance(qint64 measured, qint64 expected, qint64 tolerance) {
|
||||
// defined but only used by aes_test_fire_automaton.cpp; AUTOMOC pulls the header
|
||||
// into a separate TU that never calls it, so mark it to suppress -Wunused-function
|
||||
[[maybe_unused]] static bool withinTolerance(qint64 measured, qint64 expected, qint64 tolerance) {
|
||||
return qAbs(measured-expected) <= tolerance;
|
||||
};
|
||||
|
||||
|
||||
+5
-2
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "basics_unit_test.h"
|
||||
#include <utility>
|
||||
|
||||
#include <nglapplication/nglcoreapplication.h>
|
||||
#include <AreaEffectSimulation/aes.hpp>
|
||||
@@ -183,6 +184,7 @@ struct has_memberDouble<ObjectINT> {
|
||||
template < typename T, typename std::enable_if < has_memberDouble<T>::value, int >::type = 0 >
|
||||
void getFilterType(const T &obj)
|
||||
{
|
||||
Q_UNUSED(obj);
|
||||
qCritical() << " HasRequestId";
|
||||
// sendErrorInternal(request.errorSlot, reason, request.uniqueId, request.sample.data().requestId());
|
||||
}
|
||||
@@ -191,6 +193,7 @@ void getFilterType(const T &obj)
|
||||
template < typename T, typename std::enable_if < !has_memberDouble<T>::value, int >::type = 0 >
|
||||
void getFilterType(const T &obj)
|
||||
{
|
||||
Q_UNUSED(obj);
|
||||
qCritical() << " ! HasRequestId";
|
||||
// sendErrorInternal(request.errorSlot, reason, request.uniqueId, -1);
|
||||
}
|
||||
@@ -246,7 +249,7 @@ void UnitTestBasics::test_fireTimer10()
|
||||
QStringList logSl1 = ft.getLogHistorie();
|
||||
QVERIFY2(logSl1.size() == 1, "getCommandHistorie failed");
|
||||
|
||||
for (const auto &log : qAsConst(logSl1))
|
||||
for (const auto &log : std::as_const(logSl1))
|
||||
NOTICE_LOG(m_logger) << "log ='" << log << "'";
|
||||
}
|
||||
|
||||
@@ -319,7 +322,7 @@ void UnitTestBasics::test_fireTimer20()
|
||||
|
||||
// QList<QVariant> arguments = spyStateChanged.takeFirst(); // take the first signal
|
||||
// NOTICE_LOG(m_logger) << " spyStateChanged.count() " << spyStateChanged.count();
|
||||
// for (const QList<QVariant> &argument : qAsConst(spyStateChanged))
|
||||
// for (const QList<QVariant> &argument : std::as_const(spyStateChanged))
|
||||
// NOTICE_LOG(m_logger) << " spyStateChanged . argument " << argument.first().toInt();
|
||||
|
||||
// check order of signal paramter:
|
||||
|
||||
+4
-3
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "polygons_unit_test.h"
|
||||
#include <utility>
|
||||
#include <AreaEffectSimulation/Utils/polygons.h>
|
||||
|
||||
#include <nglapplication/nglcoreapplication.h>
|
||||
@@ -210,7 +211,7 @@ void UnitTestPolygons::test_explosionClusterSingleExplosionsGAUSS_Mtp()
|
||||
qCritical() << "rotation_deg = " << rotation_deg
|
||||
<< ", mtpRotationNorthDegree = " << mtpRotationNorthDegree
|
||||
<< ", explosionClusterDb = " << singleExplosions;
|
||||
for (const auto &singleExplosion : qAsConst(singleExplosions))
|
||||
for (const auto &singleExplosion : std::as_const(singleExplosions))
|
||||
qDebug() << "singleExUtm: " << LtsCoordTrans::UtmCoordinate::fromGeographic(singleExplosion).mgrs();
|
||||
|
||||
size_t i = 0;
|
||||
@@ -242,7 +243,7 @@ void UnitTestPolygons::test_explosionClusterSingleExplosionsGAUSS_Mtp()
|
||||
qCritical() << "rotation_deg = " << rotation_deg
|
||||
<< ", mtpRotationNorthDegree = " << mtpRotationNorthDegree
|
||||
<< " explosionClusterDb = " << singleExplosions;
|
||||
for (const auto &singleExplosion : qAsConst(singleExplosions))
|
||||
for (const auto &singleExplosion : std::as_const(singleExplosions))
|
||||
qCritical() << "singleExUtm: " << LtsCoordTrans::UtmCoordinate::fromGeographic(singleExplosion).mgrs();
|
||||
|
||||
size_t i = 0;
|
||||
@@ -279,7 +280,7 @@ void UnitTestPolygons::test_explosionClusterSingleExplosionsGAUSS_Mtp()
|
||||
<< ", zog = " << zog
|
||||
<< ", mtpRotationNorthDegree = " << mtpRotationNorthDegree
|
||||
<< " explosionClusterDb = " << singleExplosions;
|
||||
for (const auto &singleExplosion : qAsConst(singleExplosions))
|
||||
for (const auto &singleExplosion : std::as_const(singleExplosions))
|
||||
qCritical() << "singleExUtm: " << LtsCoordTrans::UtmCoordinate::fromGeographic(singleExplosion).mgrs();
|
||||
|
||||
size_t i = 0;
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "icons.h"
|
||||
#include <utility>
|
||||
#include "polygons.h"
|
||||
|
||||
#include <AreaEffectSimulation/aes.hpp>
|
||||
@@ -54,7 +55,7 @@ static QPixmap pixmapFromPolygons(const QVector<PolygonData> &datas,
|
||||
for (const PolygonData &data : datas)
|
||||
{
|
||||
polyUtm.clear();
|
||||
for (const QPointF &point : qAsConst(data.poly))
|
||||
for (const QPointF &point : std::as_const(data.poly))
|
||||
{
|
||||
LtsCoordTrans::UtmCoordinate pointUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(point, zone);
|
||||
polyUtm << QPointF(pointUtm.x, pointUtm.y);
|
||||
@@ -66,7 +67,7 @@ static QPixmap pixmapFromPolygons(const QVector<PolygonData> &datas,
|
||||
bounding.reserve(4 * datas.size());
|
||||
// Does not matter, how the total polygon looks as we just need the bounding rect.
|
||||
// << is cheaper than .united()
|
||||
for (const QPolygonF &polyUtmLocal : qAsConst(polysUtm))
|
||||
for (const QPolygonF &polyUtmLocal : std::as_const(polysUtm))
|
||||
bounding << polyUtmLocal;
|
||||
|
||||
// center to center / Todo:: Does it always work?
|
||||
@@ -89,7 +90,7 @@ static QPixmap pixmapFromPolygons(const QVector<PolygonData> &datas,
|
||||
|
||||
QPainter p(&pix);
|
||||
int i = 0;
|
||||
for (const PolygonData &d : qAsConst(datas))
|
||||
for (const PolygonData &d : std::as_const(datas))
|
||||
{
|
||||
QPolygonF mPoly = mTrans.map(polysUtm.at(i++));
|
||||
mPoly = mScale.map(mPoly);
|
||||
|
||||
+12
-23
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "polygons.h"
|
||||
#include <utility>
|
||||
#include "tne_algorithmen.h"
|
||||
|
||||
#include <aes.hpp>
|
||||
@@ -107,7 +108,7 @@ static QPolygonF utmToGeogrphic(const QPolygonF &polyUtm, const LtsCoordTrans::U
|
||||
{
|
||||
QPolygonF poly;
|
||||
poly.reserve(polyUtm.size());
|
||||
for (const QPointF &point : qAsConst(polyUtm))
|
||||
for (const QPointF &point : std::as_const(polyUtm))
|
||||
poly << base.geographic(point);
|
||||
return poly;
|
||||
}
|
||||
@@ -124,18 +125,6 @@ static const QString string4poly(const QPolygonF &poly)
|
||||
return QStringLiteral("%1 Values (%2)").arg(poly.count()).arg(pointString.join(QStringLiteral(" --- ")));
|
||||
}
|
||||
|
||||
static const QString string4poly(const QPair<QPolygonF, QVector<double>> &pair)
|
||||
{
|
||||
if (pair.first.isEmpty())
|
||||
return (QStringLiteral("Empty Polygon!"));
|
||||
int zone = LtsCoordTrans::UtmCoordinate::fromGeographic(pair.first[0]).zone;
|
||||
QStringList pointString;
|
||||
pointString.reserve(pair.first.size());
|
||||
for (int i = 0; i < pair.first.size(); ++i)
|
||||
pointString << LtsCoordTrans::UtmCoordinate::fromGeographic(pair.first[i], zone).mgrs() << QStringLiteral(" ") << QString::number(pair.second[i], 'f', 1);
|
||||
return QStringLiteral("%1 Values (%2)").arg(pair.first.count()).arg(pointString.join(QStringLiteral(" --- ")));
|
||||
}
|
||||
|
||||
QPolygonF circle(const QPointF ¢er, qreal radius, int steps)
|
||||
{
|
||||
const LtsCoordTrans::UtmCoordinate ¢erUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(center);
|
||||
@@ -471,7 +460,7 @@ QVector<QPointF> effectClusterSingleExplosionsGAUSS(const Database::AesEffectClu
|
||||
|
||||
vec.reserve(impactCount);
|
||||
const QTransform trans(fromRotation(-effectCluster.rotationAngle)); // Compass, not mathematical!
|
||||
for (const QPointF &point : qAsConst(impactsGAUSS))
|
||||
for (const QPointF &point : std::as_const(impactsGAUSS))
|
||||
{
|
||||
QPointF p = impactPositionUtm.geographic(trans.map(point));
|
||||
DEBUG_LOG(logger) << "Point = " << p;
|
||||
@@ -547,7 +536,7 @@ QVector<QPointF> effectClusterSingleExplosionsGAUSS_Mtp(const Database::AesEffec
|
||||
|
||||
QVector<LtsCoordTrans::UtmCoordinate> mtps_asRealUtm;
|
||||
mtps_asRealUtm.reserve(mtps_asUtm.size());
|
||||
for (const QPointF &mtp_asUtm : qAsConst(mtps_asUtm))
|
||||
for (const QPointF &mtp_asUtm : std::as_const(mtps_asUtm))
|
||||
{
|
||||
// convert QPointF back to UtmCoordinate: pay attention to order!!!
|
||||
const LtsCoordTrans::UtmCoordinate mtpUtm(impactPositionUtm.zone, mtp_asUtm.x(), mtp_asUtm.y());
|
||||
@@ -586,7 +575,7 @@ QVector<QPointF> effectClusterSingleExplosionsGAUSS_Mtp(const Database::AesEffec
|
||||
|
||||
int idx = 0;
|
||||
const QTransform transform(fromRotation(-mtpRotationNorthDegree)); // Compass, not mathematical!
|
||||
for (const QPointF &point : qAsConst(impactsGAUSS))
|
||||
for (const QPointF &point : std::as_const(impactsGAUSS))
|
||||
{
|
||||
// which mtp:
|
||||
int mtpIdx = (idx++ % mtps_asUtm.size()); // modulo
|
||||
@@ -601,7 +590,7 @@ QVector<QPointF> effectClusterSingleExplosionsGAUSS_Mtp(const Database::AesEffec
|
||||
<< ", randomNumber=" << randomNumber << " singleWidthOut=" << singleWidthOut << " singleHeightOut=" << singleHeightOut
|
||||
<< " rot=" << explosionCluster.rotationAngle;
|
||||
|
||||
for (auto item : qAsConst(finalVec))
|
||||
for (auto item : std::as_const(finalVec))
|
||||
{
|
||||
const LtsCoordTrans::UtmCoordinate &utm = LtsCoordTrans::UtmCoordinate::fromGeographic(item);
|
||||
qCritical() << " TNE VERIFICATION: CHECK:"
|
||||
@@ -895,7 +884,7 @@ QVector<QPointF> explosionClusterSingleExplosionsGAUSS(const Database::AesExplos
|
||||
|
||||
vec.reserve(impactCount);
|
||||
const QTransform trans(fromRotation(-explosionCluster.rotationAngle)); // Compass, not mathematical!
|
||||
for (const QPointF &point : qAsConst(impactsGAUSS))
|
||||
for (const QPointF &point : std::as_const(impactsGAUSS))
|
||||
{
|
||||
QPointF p = impactPositionUtm.geographic(trans.map(point));
|
||||
DEBUG_LOG(logger) << "Point = " << p;
|
||||
@@ -972,7 +961,7 @@ QVector<QPointF> explosionClusterSingleExplosionsGAUSS_Mtp(const Database::AesEx
|
||||
|
||||
QVector<LtsCoordTrans::UtmCoordinate> mtps_asRealUtm;
|
||||
mtps_asRealUtm.reserve(mtps_asUtm.size());
|
||||
for (const QPointF &mtp_asUtm : qAsConst(mtps_asUtm))
|
||||
for (const QPointF &mtp_asUtm : std::as_const(mtps_asUtm))
|
||||
{
|
||||
// convert QPointF back to UtmCoordinate: pay attention to order!!!
|
||||
const LtsCoordTrans::UtmCoordinate mtpUtm(impactPositionUtm.zone, mtp_asUtm.x(), mtp_asUtm.y());
|
||||
@@ -1011,7 +1000,7 @@ QVector<QPointF> explosionClusterSingleExplosionsGAUSS_Mtp(const Database::AesEx
|
||||
|
||||
int idx = 0;
|
||||
const QTransform transform(fromRotation(-mtpRotationNorthDegree)); // Compass, not mathematical!
|
||||
for (const QPointF &point : qAsConst(impactsGAUSS))
|
||||
for (const QPointF &point : std::as_const(impactsGAUSS))
|
||||
{
|
||||
// which mtp:
|
||||
int mtpIdx = (idx++ % mtps_asUtm.size()); // modulo
|
||||
@@ -1026,7 +1015,7 @@ QVector<QPointF> explosionClusterSingleExplosionsGAUSS_Mtp(const Database::AesEx
|
||||
<< ", randomNumber=" << randomNumber << " singleWidthOut=" << singleWidthOut << " singleHeightOut=" << singleHeightOut
|
||||
<< " rot=" << explosionCluster.rotationAngle;
|
||||
|
||||
for (auto item : qAsConst(finalVec))
|
||||
for (auto item : std::as_const(finalVec))
|
||||
{
|
||||
const LtsCoordTrans::UtmCoordinate &utm = LtsCoordTrans::UtmCoordinate::fromGeographic(item);
|
||||
qCritical() << " TNE VERIFICATION: CHECK:"
|
||||
@@ -1673,7 +1662,7 @@ LtsUtils::QPoint3D calculateFiringUnitCenterNonRecursive(const std::shared_ptr<P
|
||||
int childCount = 0;
|
||||
LtsUtils::QPoint3D pos;
|
||||
|
||||
for (int childId : qAsConst(childIds))
|
||||
for (int childId : std::as_const(childIds))
|
||||
{
|
||||
const ParticipantManagement::ParticipantPosition &childPos = ppmDtc->participantPosition(childId);
|
||||
if (childPos.participantId != childId)
|
||||
@@ -1726,7 +1715,7 @@ std::vector<Core::GeoPosition2D> dangerAreaDefaultSegments(const QPointF ¢er
|
||||
// polyUtm = QTransform().rotate(0).map(polyUtm);
|
||||
LtsCoordTrans::UtmCoordinate impactPositionUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(centerPos);
|
||||
const QPolygonF poly(utmToGeogrphic(polyUtm, impactPositionUtm));
|
||||
for (const auto &p : qAsConst(poly))
|
||||
for (const auto &p : std::as_const(poly))
|
||||
segments.push_back(Core::GeoPosition2D(p.x(), p.y()));
|
||||
|
||||
return segments;
|
||||
|
||||
+2
-1
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_explosion_single_central.h"
|
||||
#include <utility>
|
||||
#include "main_handler.h"
|
||||
|
||||
#include <LtsCoordTrans/lts_coord_trans.h>
|
||||
@@ -35,7 +36,7 @@ bool HandlerExplosionSingleCentral::init()
|
||||
return true;
|
||||
}
|
||||
// create indirect fire single objects
|
||||
for (const Database::AesExplosionSingleCentral &dbData : qAsConst(dataVec))
|
||||
for (const Database::AesExplosionSingleCentral &dbData : std::as_const(dataVec))
|
||||
{
|
||||
ObjectExplosionSingleCentral *ifs(new ObjectExplosionSingleCentral(m_mainHandler, this));
|
||||
connect(ifs, &ObjectExplosionSingleCentral::effectStateChanged, this, &HandlerExplosionSingleCentral::onEffectStateChanged);
|
||||
|
||||
+9
-8
@@ -6,6 +6,7 @@
|
||||
* $Author$
|
||||
*/
|
||||
#include "aes_dtc_impl_custom.h"
|
||||
#include <utility>
|
||||
#include <DDS/DTC/generic_dtc.h>
|
||||
#include <DDS/Generic/generic_data_reader.h>
|
||||
#include <QElapsedTimer>
|
||||
@@ -120,7 +121,7 @@ AreaEffectSimulation::AesType DtcImplCustom::aesItemIdFromExternalId(long long e
|
||||
|
||||
QMap<qint32, AreaEffectSimulation::BCContamination> bcConts = bCContaminations();
|
||||
aesItemId = 0;
|
||||
for (const AreaEffectSimulation::BCContamination &bcCont : qAsConst(bcConts))
|
||||
for (const AreaEffectSimulation::BCContamination &bcCont : std::as_const(bcConts))
|
||||
{
|
||||
if (bcCont.externalId == externalId)
|
||||
{
|
||||
@@ -132,7 +133,7 @@ AreaEffectSimulation::AesType DtcImplCustom::aesItemIdFromExternalId(long long e
|
||||
return AreaEffectSimulation::AesType::AtBCContamination;
|
||||
|
||||
QMap<qint32, AreaEffectSimulation::NContamination> nConts = nContaminations();
|
||||
for (const AreaEffectSimulation::NContamination &nCont: qAsConst(nConts))
|
||||
for (const AreaEffectSimulation::NContamination &nCont: std::as_const(nConts))
|
||||
{
|
||||
if (nCont.externalId == externalId)
|
||||
{
|
||||
@@ -144,7 +145,7 @@ AreaEffectSimulation::AesType DtcImplCustom::aesItemIdFromExternalId(long long e
|
||||
return AreaEffectSimulation::AesType::AtNContamination;
|
||||
|
||||
QMap<qint32, AreaEffectSimulation::ExplosionArea> explAreas = explosionAreas();
|
||||
for (const AreaEffectSimulation::ExplosionArea &explArea : qAsConst(explAreas))
|
||||
for (const AreaEffectSimulation::ExplosionArea &explArea : std::as_const(explAreas))
|
||||
{
|
||||
if (explArea.externalId == externalId)
|
||||
{
|
||||
@@ -156,7 +157,7 @@ AreaEffectSimulation::AesType DtcImplCustom::aesItemIdFromExternalId(long long e
|
||||
return AreaEffectSimulation::AesType::AtExplosionArea;
|
||||
|
||||
QMap<qint32, AreaEffectSimulation::ExplosionSingle> explSingles = explosionSingles();
|
||||
for (const AreaEffectSimulation::ExplosionSingle &explSingle : qAsConst(explSingles))
|
||||
for (const AreaEffectSimulation::ExplosionSingle &explSingle : std::as_const(explSingles))
|
||||
{
|
||||
if (explSingle.externalId == externalId)
|
||||
{
|
||||
@@ -168,7 +169,7 @@ AreaEffectSimulation::AesType DtcImplCustom::aesItemIdFromExternalId(long long e
|
||||
return AreaEffectSimulation::AesType::AtExplosionSingle;
|
||||
|
||||
QMap<qint32, AreaEffectSimulation::MineArea> mAreas = mineAreas();
|
||||
for(const AreaEffectSimulation::MineArea &mArea : qAsConst(mAreas))
|
||||
for(const AreaEffectSimulation::MineArea &mArea : std::as_const(mAreas))
|
||||
{
|
||||
if (mArea.externalId == externalId)
|
||||
{
|
||||
@@ -180,7 +181,7 @@ AreaEffectSimulation::AesType DtcImplCustom::aesItemIdFromExternalId(long long e
|
||||
return AreaEffectSimulation::AesType::AtMineArea;
|
||||
|
||||
QMap<qint32, AreaEffectSimulation::MineCorridor> mCorridors = mineCorridors();
|
||||
for (const AreaEffectSimulation::MineCorridor &mCorridor : qAsConst(mCorridors))
|
||||
for (const AreaEffectSimulation::MineCorridor &mCorridor : std::as_const(mCorridors))
|
||||
{
|
||||
if (mCorridor.externalId == externalId)
|
||||
{
|
||||
@@ -352,7 +353,7 @@ QVector<TrajectoryTimeAware> DtcImplCustom::trajectoriesTimeAwareFromOriginatorI
|
||||
|
||||
const QMap<qint32, AreaEffectSimulation::TrajectoryTimeAware> &trajectoryTimeAwareMap = trajectoryTimeAwares();
|
||||
|
||||
for (const AreaEffectSimulation::TrajectoryTimeAware &trajectoryTimeAware : qAsConst(trajectoryTimeAwareMap))
|
||||
for (const AreaEffectSimulation::TrajectoryTimeAware &trajectoryTimeAware : std::as_const(trajectoryTimeAwareMap))
|
||||
{
|
||||
// be aware of: [E01562-259] use originatorId, originatorTypeId (instead of aesItemId, aesTypeId)
|
||||
if ((trajectoryTimeAware.originatorId == originatorId) &&
|
||||
@@ -401,7 +402,7 @@ void DtcImplCustom::initDAO()
|
||||
// // We don´t realy know, how many to reserve:
|
||||
// trajectoriesFromAesIdVec.reserve(120); // 2024-09 N.Thoden: 120 ist maximum per area
|
||||
|
||||
// for (const AreaEffectSimulation::TrajectoryTimeAware &trajectoryTimeAware : qAsConst(trajectoryTimeAwareMap))
|
||||
// for (const AreaEffectSimulation::TrajectoryTimeAware &trajectoryTimeAware : std::as_const(trajectoryTimeAwareMap))
|
||||
// {
|
||||
// if (trajectoryTimeAware.aesItemId() == aesId)
|
||||
// trajectoriesFromAesIdVec.push_back(trajectoryTimeAware);
|
||||
|
||||
+2
-1
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_air_support_impact.h"
|
||||
#include <utility>
|
||||
#include "main_handler.h"
|
||||
|
||||
namespace AreaEffectSimulation
|
||||
@@ -28,7 +29,7 @@ bool HandlerAirSupportImpact::init()
|
||||
}
|
||||
|
||||
// create air support impact objects
|
||||
for (const Database::AesAirSupportImpact &dbData : qAsConst(dataVec))
|
||||
for (const Database::AesAirSupportImpact &dbData : std::as_const(dataVec))
|
||||
{
|
||||
ObjectAirSupportImpact *ifs(new ObjectAirSupportImpact(m_mainHandler, this));
|
||||
connect(ifs, &ObjectAirSupportImpact::effectStateChanged, this, &HandlerAirSupportImpact::onEffectStateChanged);
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "main_handler.h"
|
||||
#include <utility>
|
||||
#include "logger.h"
|
||||
|
||||
#include <QtCore/QObject>
|
||||
@@ -132,7 +133,7 @@ public:
|
||||
{
|
||||
m_areaCount = 0;
|
||||
m_areaCountCentral = 0;
|
||||
for (const Obj *area : qAsConst(m_objectMap))
|
||||
for (const Obj *area : std::as_const(m_objectMap))
|
||||
{
|
||||
if (area->isObjectInTrainingArea()) // meanwhile an ugly name, means EsPrepared, EsActivated, EsPaused
|
||||
{
|
||||
|
||||
+3
-2
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_borderline.h"
|
||||
#include <utility>
|
||||
#include "object_borderline.h"
|
||||
|
||||
|
||||
@@ -47,13 +48,13 @@ bool HandlerBorderline::init()
|
||||
// contains all segments of an borderline in ascending order
|
||||
QVector<Database::AesBorderlineSegment> dbBorderlineSegments;
|
||||
|
||||
for (const Database::AesBorderline &dbBorderline : qAsConst(borderlineVec))
|
||||
for (const Database::AesBorderline &dbBorderline : std::as_const(borderlineVec))
|
||||
{
|
||||
if (dbBorderline.effectStateId == AesEffectState::EsRemoved)
|
||||
continue;
|
||||
|
||||
dbBorderlineSegments.clear();
|
||||
for (const Database::AesBorderlineSegment &segment : qAsConst(segmentVec))
|
||||
for (const Database::AesBorderlineSegment &segment : std::as_const(segmentVec))
|
||||
{
|
||||
if (segment.borderlineId == dbBorderline.privBorderlineId)
|
||||
dbBorderlineSegments.insert(segment.positionIndex, segment);
|
||||
|
||||
+5
-4
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_charge_administration.h"
|
||||
#include <utility>
|
||||
#include "object_charge_administration.h"
|
||||
|
||||
namespace AreaEffectSimulation
|
||||
@@ -52,7 +53,7 @@ bool HandlerChargeAdministration::init()
|
||||
|
||||
int HandlerChargeAdministration::getObjectChargeAdministrationId(int partyId, int chargeTypeId, ProjectDataManagement::EffectSource effectSourceId)
|
||||
{
|
||||
for (ObjectChargeAdministration *val : qAsConst(m_chargeAdminObjMap))
|
||||
for (ObjectChargeAdministration *val : std::as_const(m_chargeAdminObjMap))
|
||||
{
|
||||
if (val->data().partyId == partyId && val->data().chargeTypeId == chargeTypeId && val->data().effectSourceId == effectSourceId)
|
||||
return val->id();
|
||||
@@ -117,7 +118,7 @@ Core::FunctionReplyObject HandlerChargeAdministration::chargeAdministrationModif
|
||||
|
||||
Core::FunctionReplyObject HandlerChargeAdministration::claimPlannedCharge(int chargeTypeId, int partyId, int count)
|
||||
{
|
||||
for (ObjectChargeAdministration *val : qAsConst(m_chargeAdminObjMap))
|
||||
for (ObjectChargeAdministration *val : std::as_const(m_chargeAdminObjMap))
|
||||
{
|
||||
if (val->data().partyId == partyId && val->data().chargeTypeId == chargeTypeId)
|
||||
return val->claimPlannedCharge(count);
|
||||
@@ -142,7 +143,7 @@ Core::FunctionReplyObject HandlerChargeAdministration::consumeCharge(int chargeT
|
||||
|
||||
DEBUG_LOG(m_logger) << "effectSource: " << effectSource;
|
||||
|
||||
for (ObjectChargeAdministration *val : qAsConst(m_chargeAdminObjMap))
|
||||
for (ObjectChargeAdministration *val : std::as_const(m_chargeAdminObjMap))
|
||||
{
|
||||
if (val->data().partyId == partyId && val->data().chargeTypeId == chargeTypeId && val->data().effectSourceId == effectSource)
|
||||
{
|
||||
@@ -157,7 +158,7 @@ Core::FunctionReplyObject HandlerChargeAdministration::consumeCharge(int chargeT
|
||||
|
||||
int HandlerChargeAdministration::availableCharge(int chargeTypeId, int partyId) const
|
||||
{
|
||||
for (ObjectChargeAdministration *val : qAsConst(m_chargeAdminObjMap))
|
||||
for (ObjectChargeAdministration *val : std::as_const(m_chargeAdminObjMap))
|
||||
{
|
||||
if (val->data().partyId == partyId && val->data().chargeTypeId == chargeTypeId)
|
||||
return val->availableCharge();
|
||||
|
||||
+2
-1
@@ -1,4 +1,5 @@
|
||||
#include "handler_charge_effect.h"
|
||||
#include <utility>
|
||||
|
||||
#include "handler_charge_administration.h"
|
||||
#include "handler_effect_cluster.h"
|
||||
@@ -52,7 +53,7 @@ bool HandlerChargeEffect::init()
|
||||
|
||||
ObjectChargeEffect::s_afterglowMsecs = Settings::getChargeEffectAfterGlow();
|
||||
|
||||
for (const Database::AesChargeEffect ¤tChargeEffectData : qAsConst(chargeEffectDbData))
|
||||
for (const Database::AesChargeEffect ¤tChargeEffectData : std::as_const(chargeEffectDbData))
|
||||
{
|
||||
ObjectChargeEffect *newChargeEffect = new ObjectChargeEffect(currentChargeEffectData, m_mainHandler, this);
|
||||
|
||||
|
||||
+3
-2
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_danger_area.h"
|
||||
#include <utility>
|
||||
#include "object_danger_area.h"
|
||||
|
||||
#include <TrainingAreaBase/tab_dtc.h>
|
||||
@@ -42,11 +43,11 @@ bool HandlerDangerArea::init()
|
||||
|
||||
// create area mine objects
|
||||
QVector<Database::AesDangerSegment> mySegments;
|
||||
for (const Database::AesDangerArea &area : qAsConst(areaVec))
|
||||
for (const Database::AesDangerArea &area : std::as_const(areaVec))
|
||||
{
|
||||
// Gather segments
|
||||
mySegments.clear();
|
||||
for (const Database::AesDangerSegment &mas : qAsConst(segmentVec))
|
||||
for (const Database::AesDangerSegment &mas : std::as_const(segmentVec))
|
||||
{
|
||||
if (mas.dangerAreaId == area.privDangerAreaId)
|
||||
mySegments << mas;
|
||||
|
||||
+8
-9
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_effect_cluster.h"
|
||||
#include <utility>
|
||||
#include "handler_charge_administration.h"
|
||||
#include "object_effect_cluster.h"
|
||||
#include "settings.h"
|
||||
@@ -390,8 +391,6 @@ void HandlerEffectCluster::onEffectClusterOcModifyRequest(const rti::core::Sampl
|
||||
ecCommonModifyRequest.area = request.area;
|
||||
|
||||
int impactCount = 0;
|
||||
for (const auto &effector : request.effectors)
|
||||
effector.chargeAmount;
|
||||
if (impactCount == 1)
|
||||
ecCommonModifyRequest.explosionGeometry = AreaEffectSimulation::AesExplosionGeometry::EgPoint;
|
||||
else
|
||||
@@ -632,7 +631,7 @@ Core::FunctionReplyObject HandlerEffectCluster::effectClusterModifyRequest(const
|
||||
void HandlerEffectCluster::recountActiveAreas()
|
||||
{
|
||||
s_currentAirSupportCount = 0;
|
||||
for (const auto *area : qAsConst(m_objectMap))
|
||||
for (const auto *area : std::as_const(m_objectMap))
|
||||
{
|
||||
if (area->isObjectInTrainingArea()) // meanwhile an ugly name, means EsPrepared, EsActivated, EsPaused
|
||||
{
|
||||
@@ -681,7 +680,7 @@ void HandlerEffectCluster::onEffectClusterFireHaltRequest(const rti::core::Sampl
|
||||
|
||||
QMap<int, ObjectEffectCluster *> effectClusterPartyMap;
|
||||
|
||||
for (const auto *area : qAsConst(m_objectMap))
|
||||
for (const auto *area : std::as_const(m_objectMap))
|
||||
{
|
||||
if (area->data().partyId == request.partyId)
|
||||
{
|
||||
@@ -701,7 +700,7 @@ void HandlerEffectCluster::onEffectClusterFireHaltRequest(const rti::core::Sampl
|
||||
case ProjectDataManagement::L22_FireHaltCategory::L22_FireHaltCategory_A: // Feuer Halt Allgemein
|
||||
{
|
||||
// all control operations are halted
|
||||
for (auto *ifs : qAsConst(effectClusterPartyMap))
|
||||
for (auto *ifs : std::as_const(effectClusterPartyMap))
|
||||
{
|
||||
EffectClusterPauseResumeRequest req;
|
||||
|
||||
@@ -718,7 +717,7 @@ void HandlerEffectCluster::onEffectClusterFireHaltRequest(const rti::core::Sampl
|
||||
{
|
||||
// Ongoing combat operations are halted after comparing the extent of
|
||||
// the fire hold with the corresponding target coordinate and circular area.
|
||||
for (auto *ifs : qAsConst(effectClusterPartyMap))
|
||||
for (auto *ifs : std::as_const(effectClusterPartyMap))
|
||||
{
|
||||
const double lonRad = request.longitude.is_set() ? request.longitude.get() * LtsCoordTrans::deg2rad() : 0.0;
|
||||
const double latRad = request.latitude.is_set() ? request.latitude.get() * LtsCoordTrans::deg2rad() : 0.0;
|
||||
@@ -746,7 +745,7 @@ void HandlerEffectCluster::onEffectClusterFireHaltRequest(const rti::core::Sampl
|
||||
// Unlike "Check Fire" (Feuer Halt), any rounds already loaded in a Panzerhaubitze (PzH) are still fired,
|
||||
// followed by an EX-FQ(FN) report. Once the weapon system confirms execution,
|
||||
// the engagement is closed and the target area status is set to "expired."
|
||||
for (auto *ifs : qAsConst(effectClusterPartyMap))
|
||||
for (auto *ifs : std::as_const(effectClusterPartyMap))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "[Feuer Einstellen ----- markAsExpired] " << "effectClusterId: " << ifs->data().id;
|
||||
|
||||
@@ -755,7 +754,7 @@ void HandlerEffectCluster::onEffectClusterFireHaltRequest(const rti::core::Sampl
|
||||
break;
|
||||
}
|
||||
case ProjectDataManagement::L22_FireHaltCategory::L22_FireHaltCategory_C: // Aufheben Feuer Halt Allgemein
|
||||
for (auto *ifs : qAsConst(effectClusterPartyMap))
|
||||
for (auto *ifs : std::as_const(effectClusterPartyMap))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "[Aufheben Feuer Halt Allgemein] " << "effectClusterId: " << ifs->data().id;
|
||||
|
||||
@@ -768,7 +767,7 @@ void HandlerEffectCluster::onEffectClusterFireHaltRequest(const rti::core::Sampl
|
||||
break;
|
||||
case ProjectDataManagement::L22_FireHaltCategory::L22_FireHaltCategory_F: // Aufheben Feuer Halt Referenziert
|
||||
{
|
||||
for (auto *ifs : qAsConst(effectClusterPartyMap))
|
||||
for (auto *ifs : std::as_const(effectClusterPartyMap))
|
||||
{
|
||||
const double lonRad = request.longitude.is_set() ? request.longitude.get() * LtsCoordTrans::deg2rad() : 0.0; // optional<lonRad>
|
||||
const double latRad = request.latitude.is_set() ? request.latitude.get() * LtsCoordTrans::deg2rad() : 0.0; // optional <latRad>
|
||||
|
||||
+2
-1
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_explosion_cluster.h"
|
||||
#include <utility>
|
||||
#include "handler_charge_administration.h"
|
||||
#include <AreaEffectSimulation/Utils/polygons.h>
|
||||
#include <ProjectDataManagement/pdm_translation.h>
|
||||
@@ -611,7 +612,7 @@ Core::FunctionReplyObject HandlerExplosionCluster::modifyPartyParticipant(qint32
|
||||
void HandlerExplosionCluster::recountActiveAreas()
|
||||
{
|
||||
s_currentAirSupportCount = 0;
|
||||
for (const auto *area : qAsConst(m_objectMap))
|
||||
for (const auto *area : std::as_const(m_objectMap))
|
||||
{
|
||||
if (area->isObjectInTrainingArea()) // meanwhile an ugly name, means EsPrepared, EsActivated, EsPaused
|
||||
{
|
||||
|
||||
+2
-1
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_explosion_single.h"
|
||||
#include <utility>
|
||||
#include "main_handler.h"
|
||||
#include <AreaEffectSimulation/Utils/polygons.h>
|
||||
|
||||
@@ -30,7 +31,7 @@ bool HandlerExplosionSingle::init()
|
||||
return true;
|
||||
}
|
||||
// create indirect fire single objects
|
||||
for (const Database::AesExplosionSingle &dbData : qAsConst(dataVec))
|
||||
for (const Database::AesExplosionSingle &dbData : std::as_const(dataVec))
|
||||
{
|
||||
ObjectExplosionSingle *ifs(new ObjectExplosionSingle(m_mainHandler, this));
|
||||
connect(ifs, &ObjectExplosionSingle::effectStateChanged, this, &HandlerExplosionSingle::onEffectStateChanged);
|
||||
|
||||
+3
-2
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_functional_area.h"
|
||||
#include <utility>
|
||||
#include "Utils/polygons.h"
|
||||
|
||||
#include <QtGui/QPolygonF>
|
||||
@@ -51,7 +52,7 @@ bool HandlerFunctionalArea::init()
|
||||
return false;
|
||||
}
|
||||
|
||||
for (const Database::AesFunctionalAreaType ¤tFunctionalAreaType : qAsConst(functionalAreaTypeVec))
|
||||
for (const Database::AesFunctionalAreaType ¤tFunctionalAreaType : std::as_const(functionalAreaTypeVec))
|
||||
{
|
||||
|
||||
FunctionalAreaType *ddsData = new FunctionalAreaType(currentFunctionalAreaType.id,
|
||||
@@ -74,7 +75,7 @@ bool HandlerFunctionalArea::init()
|
||||
|
||||
|
||||
// create functional area objects
|
||||
for (const Database::AesFunctionalArea &dbData : qAsConst(dataVec))
|
||||
for (const Database::AesFunctionalArea &dbData : std::as_const(dataVec))
|
||||
{
|
||||
ObjectFunctionalArea *ifs(new ObjectFunctionalArea(m_mainHandler, this));
|
||||
connect(ifs, &ObjectFunctionalArea::effectStateChanged, this, &HandlerFunctionalArea::onEffectStateChanged);
|
||||
|
||||
+3
-2
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_gas_pipe.h"
|
||||
#include <utility>
|
||||
#include "object_gas_pipe.h"
|
||||
#include <QtCore/QTimer>
|
||||
#include "Utils/polygons.h"
|
||||
@@ -50,13 +51,13 @@ bool HandlerGasPipe::init()
|
||||
// contains all segments of an gasPipe in ascending order
|
||||
QVector<Database::AesGasPipeSegment> dbGasPipeSegments;
|
||||
|
||||
for (const Database::AesGasPipe &dbGasPipe : qAsConst(gasPipeVec))
|
||||
for (const Database::AesGasPipe &dbGasPipe : std::as_const(gasPipeVec))
|
||||
{
|
||||
if (dbGasPipe.effectStateId == AesEffectState::EsRemoved)
|
||||
continue;
|
||||
|
||||
dbGasPipeSegments.clear();
|
||||
for (const Database::AesGasPipeSegment &segment : qAsConst(segmentVec))
|
||||
for (const Database::AesGasPipeSegment &segment : std::as_const(segmentVec))
|
||||
{
|
||||
if (segment.gasPipeId == dbGasPipe.privGasPipeId)
|
||||
dbGasPipeSegments.insert(segment.positionIndex, segment);
|
||||
|
||||
+10
-9
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_mine_area.h"
|
||||
#include <utility>
|
||||
#include "Utils/polygons.h"
|
||||
#include "handler_effect_cluster.h"
|
||||
#include "handler_mine_corridor.h"
|
||||
@@ -69,7 +70,7 @@ bool HandlerMineArea::init()
|
||||
}
|
||||
|
||||
// create area mine objects
|
||||
for (const Database::AesMineArea &area : qAsConst(areaVec))
|
||||
for (const Database::AesMineArea &area : std::as_const(areaVec))
|
||||
{
|
||||
|
||||
if (area.layingProcedureTypeId == AesMaLayingProcedureType::LptArtillery && !area.isCentral
|
||||
@@ -159,7 +160,7 @@ void HandlerMineArea::redistributeMines(int aesId, QList<Database::AesMineAreaTr
|
||||
DEBUG_LOG(m_logger) << "Putting mines from " << aesId << " into other MineAreas if applicable or in NullArea.";
|
||||
|
||||
// check if any other MineArea will handle some of the mines
|
||||
for (const auto &mineArea : qAsConst(m_objectMap))
|
||||
for (const auto &mineArea : std::as_const(m_objectMap))
|
||||
{
|
||||
if (mineArea->id() != aesId)
|
||||
{
|
||||
@@ -185,7 +186,7 @@ void HandlerMineArea::redistributeMines(int aesId, QList<Database::AesMineAreaTr
|
||||
|
||||
bool HandlerMineArea::removeDuplicateMine(int mineId)
|
||||
{
|
||||
for (const auto &mineArea : qAsConst(m_objectMap))
|
||||
for (const auto &mineArea : std::as_const(m_objectMap))
|
||||
{
|
||||
if (mineArea->isDusMineArea() && mineArea->hasMine(mineId))
|
||||
{
|
||||
@@ -621,7 +622,7 @@ Core::FunctionReplyObject HandlerMineArea::mineResetRequest(const MineResetReque
|
||||
DEBUG_LOG(m_logger) << "Resetting all unassociated DUS mines (NullArea) and all DUS mine areas";
|
||||
// Do this first!
|
||||
m_nullArea->resetMines();
|
||||
for (auto mineAreaObj : qAsConst(m_objectMap))
|
||||
for (auto mineAreaObj : std::as_const(m_objectMap))
|
||||
{
|
||||
if (!mineAreaObj->isDusMineArea() && !mineAreaObj->isConcreteMine())
|
||||
continue;
|
||||
@@ -805,7 +806,7 @@ void HandlerMineArea::onNewMineCorridor(const AesItemView &aiv)
|
||||
if (aiv.effectStateId != AesEffectState::EsActivated)
|
||||
return;
|
||||
|
||||
for (ObjectMineArea *ma : qAsConst(m_objectMap))
|
||||
for (ObjectMineArea *ma : std::as_const(m_objectMap))
|
||||
{
|
||||
if (intersects(ma->boundingRect(), aiv.form))
|
||||
ma->clearCorridor(aiv);
|
||||
@@ -1183,7 +1184,7 @@ void HandlerMineArea::onTimeoutEquipNo(int equipNo, int chargeTypeId)
|
||||
|
||||
std::vector<Core::GeoPosition2D> vec;
|
||||
vec.reserve(points.size());
|
||||
for (QPointF bbPoint : qAsConst(points))
|
||||
for (QPointF bbPoint : std::as_const(points))
|
||||
{
|
||||
Core::GeoPosition2D pos;
|
||||
pos.lon = bbPoint.x();
|
||||
@@ -1192,7 +1193,7 @@ void HandlerMineArea::onTimeoutEquipNo(int equipNo, int chargeTypeId)
|
||||
vec.push_back(pos);
|
||||
}
|
||||
// vec.reserve(boundingBox.size());
|
||||
// for( QPointF bbPoint : qAsConst(boundingBox))
|
||||
// for( QPointF bbPoint : std::as_const(boundingBox))
|
||||
// {
|
||||
// Core::GeoPosition2D pos;
|
||||
// LtsCoordTrans::UtmCoordinate utm;
|
||||
@@ -1259,7 +1260,7 @@ bool HandlerMineArea::checkIfNullMineIsInArea(const std::vector<AreaEffectSimula
|
||||
QVector<Database::AesMineAreaSegment> vecSeg;
|
||||
vecSeg.reserve(segments.size());
|
||||
|
||||
for (const AreaEffectSimulation::MineSegment &seg : qAsConst(segments))
|
||||
for (const AreaEffectSimulation::MineSegment &seg : std::as_const(segments))
|
||||
{
|
||||
Database::AesMineAreaSegment dbSeg;
|
||||
dbSeg.startPosition = QPointF(seg.positionStart.lon, seg.positionStart.lat);
|
||||
@@ -1303,7 +1304,7 @@ bool HandlerMineArea::containsPointInExpandedMinefield(const QPointF &positionGe
|
||||
mineAreaPolygonUtm.push_back(QPointF(pointMineAreaUtm.x, pointMineAreaUtm.y));
|
||||
}
|
||||
|
||||
for (const QPointF &mineAreaPointUTM : qAsConst(mineAreaPolygonUtm))
|
||||
for (const QPointF &mineAreaPointUTM : std::as_const(mineAreaPolygonUtm))
|
||||
{
|
||||
|
||||
double x = pointUtm.x - mineAreaPointUTM.x();
|
||||
|
||||
+3
-2
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_mine_corridor.h"
|
||||
#include <utility>
|
||||
#include "object_mine_corridor.h"
|
||||
#include "mine_corridor_creator.h"
|
||||
|
||||
@@ -47,11 +48,11 @@ bool HandlerMineCorridor::init()
|
||||
|
||||
// create area mine objects
|
||||
QVector<Database::AesMineCorridorSegment> mySegments;
|
||||
for (const Database::AesMineCorridor &area : qAsConst(areaVec))
|
||||
for (const Database::AesMineCorridor &area : std::as_const(areaVec))
|
||||
{
|
||||
// Gather segments
|
||||
mySegments.clear();
|
||||
for (const Database::AesMineCorridorSegment &mas : qAsConst(segmentVec))
|
||||
for (const Database::AesMineCorridorSegment &mas : std::as_const(segmentVec))
|
||||
{
|
||||
if (mas.mineCorridorId == area.id)
|
||||
mySegments << mas;
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_ncontamination.h"
|
||||
#include <utility>
|
||||
#include "Utils/polygons.h"
|
||||
|
||||
#include <QtGui/QPolygonF>
|
||||
@@ -33,7 +34,7 @@ bool HandlerNContamination::init()
|
||||
|
||||
DEBUG_LOG(m_logger) << "TotalC: " << totalAreasCentral() << " Total: " << totalAreas();
|
||||
|
||||
for (const Database::AesNContamination &dbData : qAsConst(dataVec))
|
||||
for (const Database::AesNContamination &dbData : std::as_const(dataVec))
|
||||
{
|
||||
ObjectNContamination *ifs(new ObjectNContamination(m_mainHandler, this));
|
||||
connect(ifs, &ObjectNContamination::effectStateChanged, this, &HandlerNContamination::onEffectStateChanged);
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_recon_area.h"
|
||||
#include <utility>
|
||||
#include <AreaEffectSimulation/Utils/polygons.h>
|
||||
#include <QtGui/QPolygonF>
|
||||
|
||||
@@ -31,7 +32,7 @@ bool HandlerReconArea::init()
|
||||
}
|
||||
|
||||
// create Recon area objects
|
||||
for (const Database::AesReconArea &dbData : qAsConst(dataVec))
|
||||
for (const Database::AesReconArea &dbData : std::as_const(dataVec))
|
||||
{
|
||||
ObjectReconArea *ifs(new ObjectReconArea(m_mainHandler, this));
|
||||
connect(ifs, &ObjectReconArea::effectStateChanged, this, &HandlerReconArea::onEffectStateChanged);
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_technical_area.h"
|
||||
#include <utility>
|
||||
|
||||
#include <QtGui/QPolygonF>
|
||||
|
||||
@@ -31,7 +32,7 @@ bool HandlerTechnicalArea::init()
|
||||
}
|
||||
|
||||
// create Technical area objects
|
||||
for (const Database::AesTechnicalArea &dbData : qAsConst(dataVec))
|
||||
for (const Database::AesTechnicalArea &dbData : std::as_const(dataVec))
|
||||
{
|
||||
ObjectTechnicalArea *ifs(new ObjectTechnicalArea(m_mainHandler, this));
|
||||
connect(ifs, &ObjectTechnicalArea::effectStateChanged, this, &HandlerTechnicalArea::onEffectStateChanged);
|
||||
|
||||
+3
-2
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "meteo_data_provider.h"
|
||||
#include <utility>
|
||||
#include "main_handler.h"
|
||||
#include <LtsCoordTrans/lts_coord_trans.h>
|
||||
#include "settings.h"
|
||||
@@ -55,7 +56,7 @@ MeteoDataManagement::MeteoData MeteoDataProvider::getNearestWeather(const Core::
|
||||
LtsCoordTrans::UtmCoordinate utm(LtsCoordTrans::UtmCoordinate::fromGeographic(pos.lon, pos.lat));
|
||||
double nearestDistanceSquared = std::numeric_limits<double>::max();
|
||||
MeteoDataManagement::MeteoData retMd;
|
||||
for (const auto &md : qAsConst(m_meteoData))
|
||||
for (const auto &md : std::as_const(m_meteoData))
|
||||
{
|
||||
if (md.isStaticMeteoData)
|
||||
continue;
|
||||
@@ -95,7 +96,7 @@ void MeteoDataProvider::initWeatherData()
|
||||
return;
|
||||
m_mdmDtc->waitForHistoricalDataMeteoData();
|
||||
m_meteoData = m_mdmDtc->meteoDatas();
|
||||
for (const auto &data : qAsConst(m_meteoData))
|
||||
for (const auto &data : std::as_const(m_meteoData))
|
||||
if (data.isStaticMeteoData)
|
||||
{
|
||||
m_staticWeatherId = data.id;
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "mine_corridor_creator.h"
|
||||
#include <utility>
|
||||
#include "object_mine_corridor.h"
|
||||
|
||||
#include <TrainingAreaBase/tab_dtc.h>
|
||||
@@ -97,7 +98,7 @@ void MineCorridorCreator::checkCorridorData(bool bFinished)
|
||||
DEBUG_LOG(m_logger) << "Checking corridor data (finished: " << bFinished << ") for equipment " << m_equipNo;
|
||||
std::vector<LtsCoordTrans::UtmCoordinate> coords;
|
||||
coords.reserve(m_sortedCorridorData.size());
|
||||
for (const auto &c : qAsConst(m_sortedCorridorData))
|
||||
for (const auto &c : std::as_const(m_sortedCorridorData))
|
||||
coords.push_back(c);
|
||||
const auto coordsSmoothed = ramerDouglasPeucker(coords, s_smoothDistance);
|
||||
DEBUG_LOG(m_logger) << "Calculated points:";
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <utility>
|
||||
#include <QPolygonF>
|
||||
#include <QTimer>
|
||||
|
||||
@@ -148,7 +149,7 @@ class ObjectBase : public QObject
|
||||
{
|
||||
QPolygonF out;
|
||||
out.reserve(in.size());
|
||||
for (const auto &pos : qAsConst(in))
|
||||
for (const auto &pos : std::as_const(in))
|
||||
out.push_back(QPointF(pos.lon, pos.lat));
|
||||
|
||||
return out;
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "object_borderline.h"
|
||||
#include <utility>
|
||||
#include "special_area_provider.h"
|
||||
|
||||
#include <QtGui/QPolygonF>
|
||||
@@ -125,7 +126,7 @@ Core::FunctionReplyObject ObjectBorderline::updateObject(const Database::AesBord
|
||||
}
|
||||
|
||||
// update all AesBorderlineSegments in database
|
||||
for (const Database::AesBorderlineSegment &segment : qAsConst(tmpDbSegments))
|
||||
for (const Database::AesBorderlineSegment &segment : std::as_const(tmpDbSegments))
|
||||
{
|
||||
if (!m_mainHandler->db()->update(segment))
|
||||
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "Error updating AesBorderlineSegment-data in database."));
|
||||
|
||||
+4
-3
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "object_danger_area.h"
|
||||
#include <utility>
|
||||
#include "special_area_provider.h"
|
||||
|
||||
#include "Utils/polygons.h"
|
||||
@@ -130,7 +131,7 @@ Core::FunctionReplyObject ObjectDangerArea::updateObject(const Database::AesDang
|
||||
for (size_t i = 0; i < segments.size(); ++i)
|
||||
tmpSegments[i].position = QPointF(segments[i].lon, segments[i].lat);
|
||||
|
||||
for (const Database::AesDangerSegment &segment : qAsConst(tmpSegments))
|
||||
for (const Database::AesDangerSegment &segment : std::as_const(tmpSegments))
|
||||
{
|
||||
if (!m_mainHandler->db()->update(segment))
|
||||
return Core::FunctionReplyObject(data.id, tr_lts("dds", "Error updating AesDangerSegment-data in database."));
|
||||
@@ -241,7 +242,7 @@ void ObjectDangerArea::removeTopics()
|
||||
auto dts = m_mainHandler->dds()->dts();
|
||||
dts->removeDangerAreaByKey(m_data.id);
|
||||
dts->removeAesItemViewByKey(1000 * m_data.id + static_cast<int>(AesType::AtDangerArea));
|
||||
for (int idx : qAsConst(m_correlatedAesItems))
|
||||
for (int idx : std::as_const(m_correlatedAesItems))
|
||||
dts->removeDangerAreaCorrelatedAesItemByKey(idForCorrelatedItem(idx));
|
||||
m_correlatedAesItems.clear();
|
||||
emit removeAiv(m_data.id);
|
||||
@@ -254,7 +255,7 @@ void ObjectDangerArea::onUpdateCorrelation()
|
||||
// If Danger Area is not active, remove correlations and return
|
||||
if (effectState() != AesEffectState::EsActivated)
|
||||
{
|
||||
for(int oldItem : qAsConst(m_correlatedAesItems))
|
||||
for(int oldItem : std::as_const(m_correlatedAesItems))
|
||||
m_mainHandler->dds()->dts()->removeDangerAreaCorrelatedAesItemByKey(idForCorrelatedItem(oldItem));
|
||||
m_correlatedAesItems.clear();
|
||||
return;
|
||||
|
||||
+11
-10
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "object_effect_cluster.h"
|
||||
#include <utility>
|
||||
#include "Utils/polygons.h"
|
||||
#include "handler_charge_administration.h"
|
||||
#include "handler_charge_effect.h"
|
||||
@@ -461,9 +462,9 @@ Core::FunctionReplyObject ObjectEffectCluster::updateObject(const Database::AesE
|
||||
|
||||
int oldImpactCount = 0;
|
||||
int newImpactCount = 0;
|
||||
for (const auto &oldEffector : qAsConst(m_effectorData))
|
||||
for (const auto &oldEffector : std::as_const(m_effectorData))
|
||||
oldImpactCount += oldEffector.chargeAmount;
|
||||
for (const auto &newEffector : qAsConst(effectorDatas))
|
||||
for (const auto &newEffector : std::as_const(effectorDatas))
|
||||
newImpactCount += newEffector.chargeAmount;
|
||||
|
||||
if (oldImpactCount != newImpactCount)
|
||||
@@ -686,7 +687,7 @@ bool ObjectEffectCluster::initialCalculations(QString *reasonOut)
|
||||
mtps_asUtm.resize(m_data.impactCount);
|
||||
|
||||
m_temporaryData.mhPoints.reserve(mtps_asUtm.size());
|
||||
for (const QPointF &mtp_asUtm : qAsConst(mtps_asUtm))
|
||||
for (const QPointF &mtp_asUtm : std::as_const(mtps_asUtm))
|
||||
{
|
||||
LtsCoordTrans::UtmCoordinate temp(impactPositionUtm.zone, mtp_asUtm.x(), mtp_asUtm.y());
|
||||
m_temporaryData.mhPoints.emplace_back(Core::GeoPosition2D(temp.geographic().x(), temp.geographic().y()));
|
||||
@@ -1435,7 +1436,7 @@ void ObjectEffectCluster::publishAiv()
|
||||
const QVector<QPointF> &singleExplosions = Polygons::effectClusterSingleExplosionsGAUSS_Mtp(m_data, m_effectorData);
|
||||
|
||||
singleEffectsRef.reserve(singleExplosions.size());
|
||||
for (const QPointF &singleExplosion : qAsConst(singleExplosions))
|
||||
for (const QPointF &singleExplosion : std::as_const(singleExplosions))
|
||||
{
|
||||
SingleEffect se;
|
||||
se.singleEffectState = AesSingleEffectState::SesScheduled;
|
||||
@@ -1616,7 +1617,7 @@ void ObjectEffectCluster::markAsExpired(bool fireLoadedRound)
|
||||
DEBUG_LOG(m_logger) << "TimerTimeout we will now send Confirmation for " << m_data.id;
|
||||
|
||||
// send confirmation for all Effectors then mark as expired (with false)
|
||||
for (const auto effector : qAsConst(m_effectorData))
|
||||
for (const auto &effector : m_effectorData)
|
||||
{
|
||||
onSendConfirmationReportToTab(effector.participantId);
|
||||
}
|
||||
@@ -2036,7 +2037,7 @@ void ObjectEffectCluster::onEffectorFired(int participantId, int aesItemId, cons
|
||||
|
||||
if (chargeEffectIds.size() > 1) // we need to find the last and first one
|
||||
{
|
||||
for (const auto id : qAsConst(chargeEffectIds))
|
||||
for (const auto id : std::as_const(chargeEffectIds))
|
||||
{
|
||||
const auto &chargeEffect = m_mainHandler->chargeEffectHandler()->getChargeEffectById(id);
|
||||
if (chargeEffect->getEffectStart() > lastChargeEffect.second)
|
||||
@@ -2547,7 +2548,7 @@ bool ObjectEffectCluster::generateTrajectoryVulcanoSpecific(int explosionNumber,
|
||||
|
||||
// "convert" from time-aware curve 'back' to time-unaware trajectoryGeometry
|
||||
tdRef.trajectoryGeometry.clear();
|
||||
for (const Core::GeoPositionRelativeTime &geoPosRelTime : qAsConst(tdRef.trajectoryTimeAware.geometry))
|
||||
for (const Core::GeoPositionRelativeTime &geoPosRelTime : std::as_const(tdRef.trajectoryTimeAware.geometry))
|
||||
tdRef.trajectoryGeometry.emplace_back(geoPosRelTime); // implicit // downcast
|
||||
|
||||
tdRef.peakHeightAbs = peakHeightRelToOrigin + originatorPosition_geo.z();
|
||||
@@ -2722,7 +2723,7 @@ void ObjectEffectCluster::sendCalculateTrajectoryAdlerRequest(const QVector<Data
|
||||
|
||||
QString reason;
|
||||
|
||||
for (const auto &data : qAsConst(effectorData))
|
||||
for (const auto &data : std::as_const(effectorData))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "TRY to send Calcualte TrajecotryAdlerReuqest for participantId=" << data.participantId;
|
||||
|
||||
@@ -3048,7 +3049,7 @@ void ObjectEffectCluster::publishTrajectory(int explosionIndex)
|
||||
#define REDUCED_DISTRIBUTION // [GUEZE-2462] Darstellung Flugparabel Steilfeuer
|
||||
#ifdef REDUCED_DISTRIBUTION
|
||||
const int trajSize = trajectoryGeometry.size();
|
||||
for (const Core::GeoPosition &pos3D : qAsConst(trajectoryGeometry))
|
||||
for (const Core::GeoPosition &pos3D : std::as_const(trajectoryGeometry))
|
||||
{
|
||||
// if (!m_isAirSupportSource)
|
||||
{
|
||||
@@ -3076,7 +3077,7 @@ void ObjectEffectCluster::publishTrajectory(int explosionIndex)
|
||||
} // for
|
||||
|
||||
#else
|
||||
for (const Core::GeoPosition &pos3D : qAsConst(trajectoryGeometry))
|
||||
for (const Core::GeoPosition &pos3D : std::as_const(trajectoryGeometry))
|
||||
{
|
||||
geometryRef.emplace_back(Core::GeoPositionRelativeTime(pos3D.lon(), pos3D.lat(), pos3D.z(), idx * flightDurationMSecSeg));
|
||||
++idx;
|
||||
|
||||
+9
-8
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "object_explosion_cluster.h"
|
||||
#include <utility>
|
||||
#include "Utils/polygons.h"
|
||||
#include "handler_charge_administration.h"
|
||||
#include "handler_trajectory.h"
|
||||
@@ -299,7 +300,7 @@ Core::FunctionReplyObject ObjectExplosionCluster::createObject(const Database::A
|
||||
// DEBUG_LOG(m_logger) << "data.damagePercent() > 80. Check, if m_trajectoryCont contains building:" << data.id()
|
||||
// << " aesItemId=" << m_aiv.aesItemId();
|
||||
|
||||
// for (const TracjectoryData &tracjectoryData : qAsConst(m_trajectoryCont))
|
||||
// for (const TracjectoryData &tracjectoryData : std::as_const(m_trajectoryCont))
|
||||
// {
|
||||
// DEBUG_LOG(m_logger) << "print_m_trajectory"
|
||||
// << " value: index=" << tracjectoryData.index
|
||||
@@ -514,7 +515,7 @@ bool ObjectExplosionCluster::initialCalculations(QString *reasonOut)
|
||||
mtps_asUtm.resize(m_data.impactCount);
|
||||
|
||||
m_temporaryData.mhPoints.reserve(mtps_asUtm.size());
|
||||
for (const QPointF &mtp_asUtm : qAsConst(mtps_asUtm))
|
||||
for (const QPointF &mtp_asUtm : std::as_const(mtps_asUtm))
|
||||
{
|
||||
LtsCoordTrans::UtmCoordinate temp(impactPositionUtm.zone, mtp_asUtm.x(), mtp_asUtm.y());
|
||||
m_temporaryData.mhPoints.emplace_back(Core::GeoPosition2D(temp.geographic().x(), temp.geographic().y()));
|
||||
@@ -1515,7 +1516,7 @@ void ObjectExplosionCluster::publishAiv()
|
||||
int explosionIndex = 0;
|
||||
|
||||
singleEffectsRef.reserve(singleExplosions.size());
|
||||
for (const QPointF &singleExplosion : qAsConst(singleExplosions))
|
||||
for (const QPointF &singleExplosion : std::as_const(singleExplosions))
|
||||
{
|
||||
SingleEffect se;
|
||||
se.singleEffectState = AesSingleEffectState::SesScheduled;
|
||||
@@ -1652,7 +1653,7 @@ void ObjectExplosionCluster::removeTopics()
|
||||
#ifdef USE_TRAJECTORY_VIA_HANDLER
|
||||
// remove TrajectoryTimeAware created via Handler:
|
||||
// topicIds are stored at m_trajectoryHandlerExplosionIndexToTopicId
|
||||
for (int topicId : qAsConst(m_trajectoryHandlerExplosionIndexToTopicId))
|
||||
for (int topicId : std::as_const(m_trajectoryHandlerExplosionIndexToTopicId))
|
||||
{
|
||||
dts->removeTrajectoryTimeAwareByKey(topicId);
|
||||
}
|
||||
@@ -2478,7 +2479,7 @@ bool ObjectExplosionCluster::generateTrajectoryVulcanoSpecific(int explosionNumb
|
||||
|
||||
// "convert" from time-aware curve 'back' to time-unaware trajectoryGeometry
|
||||
tdRef.trajectoryGeometry.clear();
|
||||
for (const Core::GeoPositionRelativeTime &geoPosRelTime : qAsConst(tdRef.trajectoryTimeAware.geometry))
|
||||
for (const Core::GeoPositionRelativeTime &geoPosRelTime : std::as_const(tdRef.trajectoryTimeAware.geometry))
|
||||
tdRef.trajectoryGeometry.emplace_back(geoPosRelTime); // implicit // downcast
|
||||
|
||||
tdRef.peakHeightAbs = peakHeightRelToOrigin + originatorPosition_geo.z();
|
||||
@@ -2749,7 +2750,7 @@ void ObjectExplosionCluster::publishTrajectory(int explosionIndex)
|
||||
#define REDUCED_DISTRIBUTION // [GUEZE-2462] Darstellung Flugparabel Steilfeuer
|
||||
#ifdef REDUCED_DISTRIBUTION
|
||||
const int trajSize = trajectoryGeometry.size();
|
||||
for (const Core::GeoPosition &pos3D : qAsConst(trajectoryGeometry))
|
||||
for (const Core::GeoPosition &pos3D : std::as_const(trajectoryGeometry))
|
||||
{
|
||||
// if (!m_isAirSupportSource)
|
||||
{
|
||||
@@ -2777,7 +2778,7 @@ void ObjectExplosionCluster::publishTrajectory(int explosionIndex)
|
||||
} // for
|
||||
|
||||
#else
|
||||
for (const Core::GeoPosition &pos3D : qAsConst(trajectoryGeometry))
|
||||
for (const Core::GeoPosition &pos3D : std::as_const(trajectoryGeometry))
|
||||
{
|
||||
geometryRef.emplace_back(Core::GeoPositionRelativeTime(pos3D.lon(), pos3D.lat(), pos3D.z(), idx * flightDurationMSecSeg));
|
||||
++idx;
|
||||
@@ -2930,7 +2931,7 @@ void ObjectExplosionCluster::dump(const char *file, int lineNo) const
|
||||
DEBUG_LOG(m_logger) << m_data.id << ", DUMP: m_trajectoryCont.keys()= " << trajectoryContKeys;
|
||||
|
||||
DEBUG_LOG(m_logger) << m_data.id << ", DUMP: m_publisedTrajectoriesForDebug.size = " << m_publisedTrajectoriesForDebug.size();
|
||||
for (const auto &item : qAsConst(m_publisedTrajectoriesForDebug))
|
||||
for (const auto &item : std::as_const(m_publisedTrajectoriesForDebug))
|
||||
DEBUG_LOG(m_logger) << m_data.id << ", DUMP: m_publisedTrajectoriesForDebug = " << item;
|
||||
|
||||
DEBUG_LOG(m_logger) << "END ******* DUMP: id = " << m_data.id << ", name = '" << m_data.name << "' **************";
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "object_gas_pipe.h"
|
||||
#include <utility>
|
||||
#include "special_area_provider.h"
|
||||
|
||||
#include <QtGui/QPolygonF>
|
||||
@@ -133,7 +134,7 @@ Core::FunctionReplyObject ObjectGasPipe::updateObject(const Database::AesGasPipe
|
||||
}
|
||||
|
||||
// update all AesGasPipeSegments in database
|
||||
for (const Database::AesGasPipeSegment &segment : qAsConst(tmpDbSegments))
|
||||
for (const Database::AesGasPipeSegment &segment : std::as_const(tmpDbSegments))
|
||||
{
|
||||
if (!m_mainHandler->db()->update(segment))
|
||||
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "Error updating AesGasPipeSegment-data in database."));
|
||||
|
||||
+17
-16
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "object_mine_area.h"
|
||||
#include <utility>
|
||||
#include "handler_mine_area.h"
|
||||
#include "qtransform.h"
|
||||
#include "special_area_provider.h"
|
||||
@@ -116,7 +117,7 @@ int ObjectMineArea::getMineIdByIndex(int index) const
|
||||
|
||||
DEBUG_LOG(m_logger) << "getMineIdByIndex index: " << index;
|
||||
int count = 0;
|
||||
for (const Database::AesMineAreaTriggeredMines &tm : qAsConst(m_triggeredMines))
|
||||
for (const Database::AesMineAreaTriggeredMines &tm : std::as_const(m_triggeredMines))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "tm: mineId: " << tm.mineId;
|
||||
if (count == index)
|
||||
@@ -150,7 +151,7 @@ void ObjectMineArea::clearCorridor(const AesItemView &aiv)
|
||||
|
||||
QVector<int> minesToTrigger;
|
||||
minesToTrigger.reserve(m_triggeredMines.size());
|
||||
for (const Database::AesMineAreaTriggeredMines &tm : qAsConst(m_triggeredMines))
|
||||
for (const Database::AesMineAreaTriggeredMines &tm : std::as_const(m_triggeredMines))
|
||||
{
|
||||
LtsCoordTrans::UtmCoordinate utmMinePos = LtsCoordTrans::UtmCoordinate::fromGeographic(tm.position, zone);
|
||||
if (aivUtmPoly.containsPoint(QPointF(utmMinePos.x, utmMinePos.y), Qt::OddEvenFill))
|
||||
@@ -170,14 +171,14 @@ void ObjectMineArea::clearBuildings()
|
||||
|
||||
DEBUG_LOG(m_logger) << "mseIds size: " << mseIds.size();
|
||||
QVector<int> minesToTrigger;
|
||||
for (int mseId : qAsConst(mseIds))
|
||||
for (int mseId : std::as_const(mseIds))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "mseId: " << mseId;
|
||||
const QPolygonF &footprint = m_mainHandler->dds()->ismDtc()->getUtmFootprintById(mseId, zoneOut, isGroundLevel);
|
||||
|
||||
minesToTrigger.clear();
|
||||
minesToTrigger.reserve(m_triggeredMines.size());
|
||||
for (const Database::AesMineAreaTriggeredMines &tm : qAsConst(m_triggeredMines))
|
||||
for (const Database::AesMineAreaTriggeredMines &tm : std::as_const(m_triggeredMines))
|
||||
{
|
||||
const LtsCoordTrans::UtmCoordinate &utmMinePos = LtsCoordTrans::UtmCoordinate::fromGeographic(tm.position, zoneOut);
|
||||
if (footprint.containsPoint(QPointF(utmMinePos.x, utmMinePos.y), Qt::OddEvenFill))
|
||||
@@ -349,7 +350,7 @@ bool ObjectMineArea::publishTriggeredImpacts()
|
||||
tis.bitfield.resize((m_triggeredMines.size() + 7) / 8);
|
||||
|
||||
int i = 0;
|
||||
for (const auto &mine : qAsConst(m_triggeredMines))
|
||||
for (const auto &mine : std::as_const(m_triggeredMines))
|
||||
{
|
||||
// Triggered Impact == 0, if mine is disarmed/exploded
|
||||
LtsUtils::BitArray::setBit(tis.bitfield, i++, !mine.isTriggered);
|
||||
@@ -373,7 +374,7 @@ bool ObjectMineArea::publishDusMineStatus()
|
||||
dms.mines.resize(m_triggeredMines.size());
|
||||
int i = 0;
|
||||
|
||||
for (const auto &mine : qAsConst(m_triggeredMines))
|
||||
for (const auto &mine : std::as_const(m_triggeredMines))
|
||||
{
|
||||
const DusMine entry(mine.mineId, mine.isTriggered, mine.chargeTypeId, {mine.position.x(), mine.position.y()});
|
||||
dms.mines[i++] = entry;
|
||||
@@ -399,7 +400,7 @@ Core::FunctionReplyObject ObjectMineArea::changeSegmentsToLine(bool sortMines)
|
||||
QVector<LtsCoordTrans::UtmCoordinate> polyUtm;
|
||||
polyUtm.reserve(m_mineAreaPolygon.size());
|
||||
|
||||
for (const QPointF &point : qAsConst(m_mineAreaPolygon))
|
||||
for (const QPointF &point : std::as_const(m_mineAreaPolygon))
|
||||
{
|
||||
LtsCoordTrans::UtmCoordinate posUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(point.x(), point.y());
|
||||
DEBUG_LOG(m_logger) << "mineArea Polygon: " << posUtm.mgrs();
|
||||
@@ -408,14 +409,14 @@ Core::FunctionReplyObject ObjectMineArea::changeSegmentsToLine(bool sortMines)
|
||||
|
||||
QVector<LtsCoordTrans::UtmCoordinate> minesUtm;
|
||||
minesUtm.reserve(m_triggeredMines.size());
|
||||
for (const Database::AesMineAreaTriggeredMines &tm : qAsConst(m_triggeredMines))
|
||||
for (const Database::AesMineAreaTriggeredMines &tm : std::as_const(m_triggeredMines))
|
||||
{
|
||||
LtsCoordTrans::UtmCoordinate posUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(tm.position.x(), tm.position.y());
|
||||
DEBUG_LOG(m_logger) << "triggeredMines: " << posUtm.mgrs();
|
||||
minesUtm.append(posUtm);
|
||||
}
|
||||
|
||||
for (const Database::AesMineAreaTriggeredMines &tm : qAsConst(m_triggeredMines))
|
||||
for (const Database::AesMineAreaTriggeredMines &tm : std::as_const(m_triggeredMines))
|
||||
{
|
||||
Core::GeoPosition2D geoPos = Core::GeoPosition2D(tm.position.x(), tm.position.y());
|
||||
vec.append(geoPos);
|
||||
@@ -434,7 +435,7 @@ Core::FunctionReplyObject ObjectMineArea::changeSegmentsToLine(bool sortMines)
|
||||
// In case of MineLayerPoisition (Not Sorting) with DUS Mines and more than 2 Mines (1 Segment) we
|
||||
// ignore the mines and just use the segments positions (Start is the startingPos of the the first segment
|
||||
// then add all end Positions of all segments
|
||||
for (const auto &segment : qAsConst(m_segments))
|
||||
for (const auto &segment : std::as_const(m_segments))
|
||||
{
|
||||
if (vecSorted.empty())
|
||||
vecSorted.push_back(Core::GeoPosition2D(segment.startPosition.x(), segment.startPosition.y()));
|
||||
@@ -472,7 +473,7 @@ Core::FunctionReplyObject ObjectMineArea::changeSegmentsToLine(bool sortMines)
|
||||
DEBUG_LOG(m_logger) << "Distance between startPos and pos: " << length;
|
||||
|
||||
Core::GeoPosition2D newPos = pos;
|
||||
for (const Core::GeoPosition2D &pos2 : qAsConst(vec))
|
||||
for (const Core::GeoPosition2D &pos2 : std::as_const(vec))
|
||||
{
|
||||
if (pos2 == pos || pos2 == startPos)
|
||||
continue;
|
||||
@@ -1034,7 +1035,7 @@ bool ObjectMineArea::containsPointInExpandedMinefield(const QPointF &positionGeo
|
||||
|
||||
const double distance = 0.5;
|
||||
|
||||
for (const QPointF &mineAreaPointUTM : qAsConst(mineAreaPolygonUtm))
|
||||
for (const QPointF &mineAreaPointUTM : std::as_const(mineAreaPolygonUtm))
|
||||
{
|
||||
|
||||
double x = pointUtm.x - mineAreaPointUTM.x();
|
||||
@@ -1138,7 +1139,7 @@ void ObjectMineArea::updateMineByOldMineId(Database::AesMineAreaTriggeredMines &
|
||||
int ObjectMineArea::mineCount()
|
||||
{
|
||||
double totalLength = 0.0;
|
||||
for (const Database::AesMineAreaSegment &segment : qAsConst(m_segments))
|
||||
for (const Database::AesMineAreaSegment &segment : std::as_const(m_segments))
|
||||
{
|
||||
LtsCoordTrans::UtmCoordinate startPositionUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(segment.startPosition);
|
||||
LtsCoordTrans::UtmCoordinate endPositionUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(segment.endPosition, startPositionUtm.zone);
|
||||
@@ -1351,7 +1352,7 @@ void ObjectMineArea::onPublishData()
|
||||
|
||||
std::vector<MineSegment> segVec;
|
||||
segVec.reserve(m_segments.size());
|
||||
for (const auto &segment : qAsConst(m_segments))
|
||||
for (const auto &segment : std::as_const(m_segments))
|
||||
segVec.emplace_back(
|
||||
MineSegment(Core::GeoPosition2D(segment.startPosition.x(), segment.startPosition.y()), Core::GeoPosition2D(segment.endPosition.x(), segment.endPosition.y())));
|
||||
|
||||
@@ -1442,7 +1443,7 @@ void ObjectMineArea::publishAiv()
|
||||
aiv2.effectStart = toMSec(m_data.effectStart);
|
||||
aiv2.form.clear();
|
||||
aiv2.form.reserve(m_triggeredMines.size());
|
||||
for (const auto &tm : qAsConst(m_triggeredMines))
|
||||
for (const auto &tm : std::as_const(m_triggeredMines))
|
||||
aiv2.form.resize(aiv2.form.size() + 1, Core::GeoPosition(tm.position.x(), tm.position.y(), 0.0));
|
||||
aiv2.boundingBoxBottomLeft = aiv.boundingBoxBottomLeft;
|
||||
aiv2.boundingBoxTopRight = aiv.boundingBoxTopRight;
|
||||
@@ -1493,7 +1494,7 @@ Core::FunctionReplyObject ObjectMineArea::createGeoSegmentsFromMineData(double &
|
||||
|
||||
std::vector<Core::GeoPosition2D> tempMinePos;
|
||||
tempMinePos.reserve(m_triggeredMines.size() + mineData.size());
|
||||
for (const auto &t : qAsConst(m_triggeredMines))
|
||||
for (const auto &t : std::as_const(m_triggeredMines))
|
||||
tempMinePos.emplace_back(Core::GeoPosition2D(t.position.x(), t.position.y()));
|
||||
|
||||
for (const auto &md : mineData)
|
||||
|
||||
+6
-5
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "object_mine_area_null.h"
|
||||
#include <utility>
|
||||
#include "special_area_provider.h"
|
||||
|
||||
#include <QtGui/QPolygonF>
|
||||
@@ -73,7 +74,7 @@ bool ObjectMineAreaNull::isVirtualMine() const
|
||||
int ObjectMineAreaNull::lastConcreteMineNo()
|
||||
{
|
||||
int lastMineNo = 0;
|
||||
for (const Database::AesMineAreaTriggeredMines &mine : qAsConst(m_triggeredMines))
|
||||
for (const Database::AesMineAreaTriggeredMines &mine : std::as_const(m_triggeredMines))
|
||||
{
|
||||
// NOTE: igniterType/IgniterFunciton = 0 as long as AesMineAreaTriggeredMines does not contain values
|
||||
DEBUG_LOG(m_logger) << "mine: chargeTypeId " << mine.chargeTypeId << ", mineId: " << mine.mineId;
|
||||
@@ -245,7 +246,7 @@ void ObjectMineAreaNull::publishAiv()
|
||||
vec.reserve(m_triggeredMines.size());
|
||||
QPolygonF tmp;
|
||||
tmp.reserve(m_triggeredMines.size());
|
||||
for (const auto &mine : qAsConst(m_triggeredMines))
|
||||
for (const auto &mine : std::as_const(m_triggeredMines))
|
||||
{
|
||||
vec.emplace_back(Core::GeoPosition(mine.position.x(), mine.position.y(), 0));
|
||||
tmp.push_back(mine.position);
|
||||
@@ -285,7 +286,7 @@ bool ObjectMineAreaNull::publishTriggeredImpacts()
|
||||
tis.setId = dds::core::optional<rti::core::int64>(m_setId);
|
||||
|
||||
int i = 0;
|
||||
for (const auto &mine : qAsConst(m_triggeredMines))
|
||||
for (const auto &mine : std::as_const(m_triggeredMines))
|
||||
{
|
||||
// Triggered Impact == 0, if mine is disarmed/exploded
|
||||
LtsUtils::BitArray::setBit(tis.bitfield, i++, !mine.isTriggered);
|
||||
@@ -307,7 +308,7 @@ bool ObjectMineAreaNull::publishDusMineStatus()
|
||||
dms.mines.resize(m_triggeredMines.size());
|
||||
dms.setId = dds::core::optional<rti::core::int64>(m_setId);
|
||||
int i = 0;
|
||||
for (const auto &mine : qAsConst(m_triggeredMines))
|
||||
for (const auto &mine : std::as_const(m_triggeredMines))
|
||||
{
|
||||
const DusMine entry(mine.mineId, mine.isTriggered, mine.chargeTypeId, {mine.position.x(), mine.position.y()});
|
||||
dms.mines[i++] = entry;
|
||||
@@ -328,7 +329,7 @@ QPolygonF ObjectMineAreaNull::generateForm()
|
||||
vec.reserve(m_triggeredMines.size());
|
||||
QPolygonF tmp;
|
||||
tmp.reserve(m_triggeredMines.size());
|
||||
for (const auto &mine : qAsConst(m_triggeredMines))
|
||||
for (const auto &mine : std::as_const(m_triggeredMines))
|
||||
{
|
||||
vec.emplace_back(Core::GeoPosition(mine.position.x(), mine.position.y(), 0));
|
||||
tmp.push_back(mine.position);
|
||||
|
||||
+2
-1
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "object_mine_corridor.h"
|
||||
#include <utility>
|
||||
#include "special_area_provider.h"
|
||||
|
||||
#include "Utils/polygons.h"
|
||||
@@ -140,7 +141,7 @@ Core::FunctionReplyObject ObjectMineCorridor::updateObject(const Database::AesMi
|
||||
for (size_t i = 0; i < segments.size(); ++i)
|
||||
tmpSegments[i].position = QPointF(segments[i].lon, segments[i].lat);
|
||||
|
||||
for (const Database::AesMineCorridorSegment &segment : qAsConst(tmpSegments))
|
||||
for (const Database::AesMineCorridorSegment &segment : std::as_const(tmpSegments))
|
||||
{
|
||||
if (!m_mainHandler->db()->update(segment))
|
||||
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "Error updating AesMineCorridorSegment-data in database."));
|
||||
|
||||
+3
-2
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_training_area.h"
|
||||
#include <utility>
|
||||
#include "object_training_area.h"
|
||||
#include "main_handler.h"
|
||||
#include "convert_db_to_dds.h"
|
||||
@@ -46,7 +47,7 @@ bool HandlerTrainingArea::init()
|
||||
return false;
|
||||
}
|
||||
|
||||
for (const Database::AsmMapDescription &data : qAsConst(dataVecMD))
|
||||
for (const Database::AsmMapDescription &data : std::as_const(dataVecMD))
|
||||
{
|
||||
ObjectMapDescription *ifs(new ObjectMapDescription(m_mainHandler));
|
||||
Core::FunctionReplyObject ret = ifs->createObject(convert(data), data.objOrder);
|
||||
@@ -94,7 +95,7 @@ bool HandlerTrainingArea::init()
|
||||
}
|
||||
|
||||
// create asm_training_area
|
||||
for (const Database::AsmTrainingArea &data : qAsConst(dataVec))
|
||||
for (const Database::AsmTrainingArea &data : std::as_const(dataVec))
|
||||
{
|
||||
// insert sequences of map descriptions in data
|
||||
ObjectTrainingArea *ifs(new ObjectTrainingArea(m_mainHandler));
|
||||
|
||||
+3
-2
@@ -21,6 +21,7 @@
|
||||
*/
|
||||
|
||||
#include "avm_vca_tests.h"
|
||||
#include <utility>
|
||||
#include <AudioVideoManagement/avm_dtc.h>
|
||||
#include <nglapplication/nglcoreapplication.h>
|
||||
#include <LtsCommandLineParser/LtsCommandLineParser.h>
|
||||
@@ -193,14 +194,14 @@ void AvmVcaTests::createCnrConfig()
|
||||
|
||||
void AvmVcaTests::removeTvcConfig()
|
||||
{
|
||||
for (auto id: qAsConst(m_tvcConfigIds))
|
||||
for (auto id: std::as_const(m_tvcConfigIds))
|
||||
m_ftc->removeTvcConfigRequest(RemoveTvcConfigRequest{id}, this);
|
||||
QTRY_VERIFY(m_tvcConfigIds.isEmpty());
|
||||
}
|
||||
|
||||
void AvmVcaTests::removeCnrConfig()
|
||||
{
|
||||
for (auto id: qAsConst(m_cnrConfigIds))
|
||||
for (auto id: std::as_const(m_cnrConfigIds))
|
||||
m_ftc->removeCnrConfigRequest(RemoveCnrConfigRequest{id}, this);
|
||||
QTRY_VERIFY(m_cnrConfigIds.isEmpty());
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "ava_state.h"
|
||||
#include <utility>
|
||||
#include "ava_session.h"
|
||||
#include "ava_control.h"
|
||||
#include "av_helper.h"
|
||||
@@ -40,7 +41,7 @@ AvaState::AvaState(AvaSession *session)
|
||||
QStringList AvaState::currentLiveVideoStreams() const
|
||||
{
|
||||
QStringList streams;
|
||||
for (const QMap<QString, AvaStreamState> &map : qAsConst(m_videoState))
|
||||
for (const QMap<QString, AvaStreamState> &map : std::as_const(m_videoState))
|
||||
{
|
||||
const QList<QString> streamNames = map.keys();
|
||||
for (const QString &streamName : streamNames)
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "cnr_handler.h"
|
||||
#include <utility>
|
||||
#include "avm_dts.h"
|
||||
#include "dds_handler.h"
|
||||
#include "exercise_context.h"
|
||||
@@ -235,7 +236,7 @@ bool CnrHandler::init()
|
||||
return false;
|
||||
}
|
||||
|
||||
for (const AvmCnrChannel ¤tChannel : qAsConst(m_channels))
|
||||
for (const AvmCnrChannel ¤tChannel : std::as_const(m_channels))
|
||||
m_dts->publish(::AudioVideoManagement::toDds(currentChannel));
|
||||
|
||||
// Don't use select with callback here as addConfig() uses the DB, too.
|
||||
@@ -246,7 +247,7 @@ bool CnrHandler::init()
|
||||
return false;
|
||||
}
|
||||
|
||||
for (const AvmCnrConfig ¤tConfig : qAsConst(cnrConfigs))
|
||||
for (const AvmCnrConfig ¤tConfig : std::as_const(cnrConfigs))
|
||||
{
|
||||
auto reply = createCnrConfig(toRequest(currentConfig, 0), currentConfig.id);
|
||||
if (reply.error())
|
||||
@@ -399,7 +400,7 @@ void CnrHandler::updateDeviceConfig()
|
||||
{
|
||||
DBTransaction trans(m_db->database());
|
||||
|
||||
for (const auto &config : qAsConst(m_cache))
|
||||
for (const auto &config : std::as_const(m_cache))
|
||||
if (config.isActive)
|
||||
m_deviceConfig->update(config);
|
||||
|
||||
@@ -481,7 +482,7 @@ Core::FunctionReplyObject CnrHandler::validateRequest(const ModifyCnrConfigReque
|
||||
*/
|
||||
bool CnrHandler::checkConstraint(const std::function<bool (const CnrConfig &)> &constraint, const boost::optional<int> &exerciseId, const boost::optional<int32_t> &excludeId) const
|
||||
{
|
||||
for (const CnrConfig &config : qAsConst(m_cache))
|
||||
for (const CnrConfig &config : std::as_const(m_cache))
|
||||
{
|
||||
if (excludeId == config.id)
|
||||
continue;
|
||||
@@ -707,7 +708,7 @@ QString CnrHandler::exerciseList(const CnrConfig &config) const
|
||||
|
||||
// Global - all active exercises, no matter if they have active plannings or not
|
||||
QStringList exerciseList;
|
||||
for (const auto &context : qAsConst(m_activeExercises->allContexts()))
|
||||
for (const auto &context : std::as_const(m_activeExercises->allContexts()))
|
||||
exerciseList.append(context.toString());
|
||||
return exerciseList.join(QLatin1Char(','));
|
||||
}
|
||||
@@ -744,7 +745,7 @@ int CnrHandler::normalizedAddacChannel(int addacChannel) const
|
||||
|
||||
Database::AvmCnrChannel CnrHandler::channelById(int32_t id) const
|
||||
{
|
||||
for (const Database::AvmCnrChannel &channel : qAsConst(m_channels))
|
||||
for (const Database::AvmCnrChannel &channel : std::as_const(m_channels))
|
||||
if (channel.id == id)
|
||||
return channel;
|
||||
|
||||
|
||||
+5
-4
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "cnr_tvc_profile_handler.h"
|
||||
#include <utility>
|
||||
#include "cnr_handler.h"
|
||||
#include "tvc_handler.h"
|
||||
#include <AudioVideoManagement/avm_dts.h>
|
||||
@@ -49,7 +50,7 @@ CnrTvcProfile toDds(const Database::AvmCnrTvcProfile &circuitContainerDb, T circ
|
||||
|
||||
CnrTvcProfile circuitContainerDds(circuitContainerDb.id, circuitContainerDb.operatorId, circuitContainerDb.exerciseId, {});
|
||||
circuitContainerDds.data.reserve(circuitsDb.size());
|
||||
for (const auto ¤tCircuitDb : qAsConst(circuitsDb))
|
||||
for (const auto ¤tCircuitDb : std::as_const(circuitsDb))
|
||||
circuitContainerDds.data.push_back(toDds(currentCircuitDb));
|
||||
return circuitContainerDds;
|
||||
}
|
||||
@@ -148,7 +149,7 @@ bool CnrTvcProfileHandler::init()
|
||||
return false;
|
||||
}
|
||||
|
||||
for (const auto ¤tCircuitContainer: qAsConst(circuitContainersDb))
|
||||
for (const auto ¤tCircuitContainer: std::as_const(circuitContainersDb))
|
||||
status &= collectAndPublish(currentCircuitContainer);
|
||||
|
||||
return status;
|
||||
@@ -570,7 +571,7 @@ void CnrTvcProfileHandler::onConfigChanged(int32_t configId, RadioSystem type)
|
||||
|
||||
// Find all CnrTvcProfiles where this config is referenced and reload those.
|
||||
// Hint: reloading might modify m_cache. Thus the reloading is done in a separate loop.
|
||||
for (const auto &profile : qAsConst(m_cache))
|
||||
for (const auto &profile : std::as_const(m_cache))
|
||||
for (const auto &data : profile.data)
|
||||
if (data.radioSystemId == type && data.radioCircuitId == configId)
|
||||
{
|
||||
@@ -578,7 +579,7 @@ void CnrTvcProfileHandler::onConfigChanged(int32_t configId, RadioSystem type)
|
||||
break;
|
||||
}
|
||||
|
||||
for (const auto &profile : qAsConst(toBeReloaded))
|
||||
for (const auto &profile : std::as_const(toBeReloaded))
|
||||
{
|
||||
Database::AvmCnrTvcProfile profileDb = toDb(profile);
|
||||
const bool isReload = true;
|
||||
|
||||
+3
-3
@@ -71,13 +71,13 @@ namespace AudioVideoManagement
|
||||
{
|
||||
|
||||
DefaultAvMenus::DefaultAvMenus(const ExerciseContext &context, Interface::Dts *dts, HandlerVideoTeam *handlerVideoTeams, InfrastructureManagement::Interface::Dtc *ismDtc)
|
||||
: m_context(context)
|
||||
: m_logger(getLogger("DefaultAvMenus"))
|
||||
, m_isInitialized(false)
|
||||
, m_context(context)
|
||||
, m_dts(dts)
|
||||
, m_videoTeamHandler(handlerVideoTeams)
|
||||
, m_ismDtc(ismDtc)
|
||||
, m_timer(new QTimer)
|
||||
, m_logger(getLogger("DefaultAvMenus"))
|
||||
, m_isInitialized(false)
|
||||
{
|
||||
Q_ASSERT(dts);
|
||||
Q_ASSERT(ismDtc);
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "exercises_handler.h"
|
||||
#include <utility>
|
||||
#include "dds_handler.h"
|
||||
#include "dds_handler_exercise.h"
|
||||
#include "main_handler.h"
|
||||
@@ -80,7 +81,7 @@ bool ExercisesHandler::init()
|
||||
return false;
|
||||
|
||||
DBTransaction trans(db()->database());
|
||||
for (const Database::AvmDeviceConfig &dc : qAsConst(avmDeviceConfig))
|
||||
for (const Database::AvmDeviceConfig &dc : std::as_const(avmDeviceConfig))
|
||||
{
|
||||
// nur hinzufuegen, wenn es record/replay session ist
|
||||
// alle anderen -> aus DB loeschen
|
||||
|
||||
+4
-3
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "frequency_planning_handler.h"
|
||||
#include <utility>
|
||||
|
||||
#include <Proxies/CombatNetRadio/Helper/cnr_frequency_planning_helper.h>
|
||||
#include "frequency_set_handler.h"
|
||||
@@ -160,7 +161,7 @@ bool FrequencyPlanningHandler::init()
|
||||
return false;
|
||||
}
|
||||
|
||||
for (const Database::AvmFrequencyPlanning &planContainerDb : qAsConst(frequencyPlannings))
|
||||
for (const Database::AvmFrequencyPlanning &planContainerDb : std::as_const(frequencyPlannings))
|
||||
collectAndPublish(planContainerDb);
|
||||
|
||||
auto cbAfp = [this] (const Database::AvmActiveFrequencyPlanning ¤tDbData)
|
||||
@@ -360,7 +361,7 @@ Core::FunctionReplyObject FrequencyPlanningHandler::validateRequest(const Modify
|
||||
for (const FrequencyPlanningData &entry : request.data)
|
||||
{
|
||||
QSet<int> frequencySetEntries = AudioVideoManagement::frequencySetDataIds(entry.properties);
|
||||
for(const int &setEntry : qAsConst(frequencySetEntries))
|
||||
for(const int &setEntry : std::as_const(frequencySetEntries))
|
||||
{
|
||||
if (setEntry != 0 && !m_frequencySetHandler->isValid(request.frequencySetId, setEntry))
|
||||
return reply.setStr(tr_lts("dds", "FrequencySetData %1 does not belong to FrequencySet %2")).arg(setEntry).arg(request.frequencySetId);
|
||||
@@ -556,7 +557,7 @@ Core::FunctionReplyObject FrequencyPlanningHandler::testActivation(const std::ve
|
||||
for (const FrequencyPlanningData &fpdEntry : entries)
|
||||
{
|
||||
QSet<int> frequencySetEntries = AudioVideoManagement::frequencySetDataIds(fpdEntry.properties);
|
||||
for(const int &setEntry : qAsConst(frequencySetEntries))
|
||||
for(const int &setEntry : std::as_const(frequencySetEntries))
|
||||
{
|
||||
if(takenSetEntries.contains(setEntry))
|
||||
{
|
||||
|
||||
+2
-1
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "frequency_set_handler.h"
|
||||
#include <utility>
|
||||
#include "dds_handler.h"
|
||||
#include "main_handler.h"
|
||||
#include <AudioVideoManagement/avm_dts.h>
|
||||
@@ -37,7 +38,7 @@ bool FrequencySetHandler::init()
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "Found " << frequencySets.size() << " Frequency Sets";
|
||||
|
||||
for (const Database::AvmFrequencySet ¤tfrequencySet : qAsConst(frequencySets))
|
||||
for (const Database::AvmFrequencySet ¤tfrequencySet : std::as_const(frequencySets))
|
||||
addFrequencySet(toDdsFrequencySet(currentfrequencySet));
|
||||
|
||||
return true;
|
||||
|
||||
+5
-4
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_frequency_planning_status.h"
|
||||
#include <utility>
|
||||
#include "object_frequency_planning_status.h"
|
||||
|
||||
#include "avm_db.h"
|
||||
@@ -81,7 +82,7 @@ bool HandlerFrequencyPlanningStatus::init()
|
||||
}
|
||||
|
||||
// create objects
|
||||
for (const Database::AvmFrequencyPlanningStatus &data : qAsConst(dataVec))
|
||||
for (const Database::AvmFrequencyPlanningStatus &data : std::as_const(dataVec))
|
||||
{
|
||||
FrequencyPlanningStatus ddsData = ObjectFrequencyPlanningStatus::toDdsData(data);
|
||||
ObjectFrequencyPlanningStatus *ifs(new ObjectFrequencyPlanningStatus(m_dts, m_db));
|
||||
@@ -112,7 +113,7 @@ void HandlerFrequencyPlanningStatus::onClearFrequencyPlanningStatusRequest(const
|
||||
{
|
||||
Q_UNUSED(request);
|
||||
Core::FunctionReplyObject ret;
|
||||
for (ObjectFrequencyPlanningStatus *ifs : qAsConst(m_data))
|
||||
for (ObjectFrequencyPlanningStatus *ifs : std::as_const(m_data))
|
||||
{
|
||||
ret = ifs->clearValues();
|
||||
if (ret.error())
|
||||
@@ -125,7 +126,7 @@ void HandlerFrequencyPlanningStatus::onRemoveFrequencyPlanningStatusByClientRequ
|
||||
{
|
||||
Core::FunctionReplyObject ret;
|
||||
QVector<int> clients;
|
||||
for (ObjectFrequencyPlanningStatus *ifs : qAsConst(m_data))
|
||||
for (ObjectFrequencyPlanningStatus *ifs : std::as_const(m_data))
|
||||
{
|
||||
if (request.client == 0 || ifs->getData().client == request.client)
|
||||
{
|
||||
@@ -137,7 +138,7 @@ void HandlerFrequencyPlanningStatus::onRemoveFrequencyPlanningStatusByClientRequ
|
||||
clients << client;
|
||||
}
|
||||
}
|
||||
for (int client : qAsConst(clients))
|
||||
for (int client : std::as_const(clients))
|
||||
{
|
||||
// delete ObjectVideoReceiver
|
||||
delete m_data[client];
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_video_receiver.h"
|
||||
#include <utility>
|
||||
#include "object_video_receiver.h"
|
||||
|
||||
#include <QNetworkReply>
|
||||
@@ -68,7 +69,7 @@ bool HandlerVideoReceiver::init()
|
||||
}
|
||||
|
||||
// create objects
|
||||
for (const Database::AvmVideoReceiver &data : qAsConst(dataVec))
|
||||
for (const Database::AvmVideoReceiver &data : std::as_const(dataVec))
|
||||
{
|
||||
AudioVideoManagement::VideoReceiver ddsData = ObjectVideoReceiver::toDdsData(data);
|
||||
ObjectVideoReceiver *ifs(new ObjectVideoReceiver(m_dts, m_db));
|
||||
|
||||
+5
-4
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_video_team.h"
|
||||
#include <utility>
|
||||
#include "object_video_team.h"
|
||||
#include "default_av_menus.h"
|
||||
|
||||
@@ -143,7 +144,7 @@ bool HandlerVideoTeam::init()
|
||||
}
|
||||
|
||||
// create objects
|
||||
for (const Database::AvmVideoTeam &data : qAsConst(dataVec))
|
||||
for (const Database::AvmVideoTeam &data : std::as_const(dataVec))
|
||||
{
|
||||
VideoTeam ddsData = ObjectVideoTeam::toDdsData(data);
|
||||
ObjectVideoTeam *ifs(new ObjectVideoTeam(m_dts, m_db));
|
||||
@@ -168,7 +169,7 @@ bool HandlerVideoTeam::init()
|
||||
QMap<int, VideoTeam> HandlerVideoTeam::videoTeams() const
|
||||
{
|
||||
QMap<int, VideoTeam> ret;
|
||||
for (const auto &videoTeam : qAsConst(m_videoTeamObjMap))
|
||||
for (const auto &videoTeam : std::as_const(m_videoTeamObjMap))
|
||||
ret.insert(videoTeam->getId(), videoTeam->getData());
|
||||
return ret;
|
||||
}
|
||||
@@ -193,7 +194,7 @@ bool HandlerVideoTeam::needDeviceConfig(const VideoTeam &videoTeam) const
|
||||
|
||||
void HandlerVideoTeam::onContextActivated(const ExerciseContext &context)
|
||||
{
|
||||
for (const auto *ifs : qAsConst(m_videoTeamObjMap))
|
||||
for (const auto *ifs : std::as_const(m_videoTeamObjMap))
|
||||
{
|
||||
VideoTeam ddsData = ifs->getData();
|
||||
if (ddsData.exerciseId == context.id())
|
||||
@@ -203,7 +204,7 @@ void HandlerVideoTeam::onContextActivated(const ExerciseContext &context)
|
||||
|
||||
void HandlerVideoTeam::onContextDeactivated(const ExerciseContext &context)
|
||||
{
|
||||
for (ObjectVideoTeam *ifs : qAsConst(m_videoTeamObjMap))
|
||||
for (ObjectVideoTeam *ifs : std::as_const(m_videoTeamObjMap))
|
||||
{
|
||||
if (ifs->exerciseId() == context.id())
|
||||
{
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "tvc_handler.h"
|
||||
#include <utility>
|
||||
#include "dds_handler.h"
|
||||
#include "exercise_context.h"
|
||||
#include "active_exercises.h"
|
||||
@@ -201,7 +202,7 @@ bool TvcHandler::init()
|
||||
return false;
|
||||
}
|
||||
|
||||
for (const AvmTvcChannel ¤tChannel : qAsConst(m_channels))
|
||||
for (const AvmTvcChannel ¤tChannel : std::as_const(m_channels))
|
||||
m_dts->publish(toDds(currentChannel));
|
||||
|
||||
QVector<AvmTvcConfig> tvcConfigs;
|
||||
@@ -212,7 +213,7 @@ bool TvcHandler::init()
|
||||
return false;
|
||||
}
|
||||
|
||||
for (const AvmTvcConfig ¤tConfig : qAsConst(tvcConfigs))
|
||||
for (const AvmTvcConfig ¤tConfig : std::as_const(tvcConfigs))
|
||||
createTvcConfig(toRequest(currentConfig, 0), currentConfig.id);
|
||||
|
||||
return true;
|
||||
@@ -412,7 +413,7 @@ Database::AvmDeviceConfig TvcHandler::toDeviceConfig(const TvcConfig &tvcConfig)
|
||||
|
||||
Database::AvmTvcChannel TvcHandler::channelById(int32_t id) const
|
||||
{
|
||||
for (const Database::AvmTvcChannel &channel : qAsConst(m_channels))
|
||||
for (const Database::AvmTvcChannel &channel : std::as_const(m_channels))
|
||||
if (channel.id == id)
|
||||
return channel;
|
||||
|
||||
@@ -424,7 +425,7 @@ void TvcHandler::onContextActivated(const ExerciseContext &context)
|
||||
{
|
||||
bool isFirstActiveExercise = m_activeExercises->count() == 1;
|
||||
|
||||
for (const TvcConfig &tvcConfig : qAsConst(m_cache))
|
||||
for (const TvcConfig &tvcConfig : std::as_const(m_cache))
|
||||
{
|
||||
bool isLocal = tvcConfig.exerciseId.is_set();
|
||||
if (isLocal)
|
||||
@@ -446,7 +447,7 @@ void TvcHandler::onContextDeactivated(const ExerciseContext &context)
|
||||
{
|
||||
bool haveActiveExercise = m_activeExercises->count() > 0;
|
||||
|
||||
for (const TvcConfig &tvcConfig : qAsConst(m_cache))
|
||||
for (const TvcConfig &tvcConfig : std::as_const(m_cache))
|
||||
{
|
||||
bool isLocal = tvcConfig.exerciseId.is_set();
|
||||
|
||||
@@ -526,7 +527,7 @@ Core::FunctionReplyObject TvcHandler::validateRequest(const ModifyTvcConfigReque
|
||||
*/
|
||||
bool TvcHandler::checkConstraint(const std::function<bool (const TvcConfig &)> &constraint, const boost::optional<int> &exerciseId, const boost::optional<int32_t> &excludeId) const
|
||||
{
|
||||
for (const TvcConfig &config : qAsConst(m_cache))
|
||||
for (const TvcConfig &config : std::as_const(m_cache))
|
||||
{
|
||||
if (excludeId == config.id)
|
||||
continue;
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_participant_borderline.h"
|
||||
#include <utility>
|
||||
|
||||
#include <QtCore/QLineF>
|
||||
#include <QtCore/QTimer>
|
||||
@@ -126,7 +127,7 @@ void HandlerParticipantBorderline::onParticipantPositionChanged(const CentralEff
|
||||
<< " participantTypeId=" << partPos.participantTypeId()
|
||||
<< " Anzahl Borderlines=" << m_borderlines.size();
|
||||
|
||||
for (const BorderlineUtm &borderline : qAsConst(m_borderlines))
|
||||
for (const BorderlineUtm &borderline : std::as_const(m_borderlines))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "borderline id = " << borderline.id
|
||||
<< ", Box bottomLeft = " << CentralEffectSimulation::debug(borderline.boundingBox.bottomLeft())
|
||||
|
||||
+6
-5
@@ -6,6 +6,7 @@
|
||||
* Created by gr, SLSE, 2017-02-20
|
||||
*/
|
||||
#include "handler_simulated_movement.h"
|
||||
#include <utility>
|
||||
#include <CentralEffectSimulation/handler_participant.h>
|
||||
|
||||
#include <QtCore/QTimer>
|
||||
@@ -65,7 +66,7 @@ bool HandlerSimulatedMovement::loadSimulatedMovementFromDb()
|
||||
DEBUG_LOG(m_logger) << "loadSimulatedMovementSegmentsFromDb size =" << simMoveSegVec.size();
|
||||
|
||||
// add to internal buffer
|
||||
for (const CentralEffectSimulation::Database::CesSimulatedMovement &data : qAsConst(simMoveVec))
|
||||
for (const CentralEffectSimulation::Database::CesSimulatedMovement &data : std::as_const(simMoveVec))
|
||||
{
|
||||
CentralEffectSimulation::SimulatedMovement request;
|
||||
request.id(data.id);
|
||||
@@ -77,14 +78,14 @@ bool HandlerSimulatedMovement::loadSimulatedMovementFromDb()
|
||||
DEBUG_LOG(m_logger) << "Loading SimulatedMovement: " << request;
|
||||
|
||||
QMap <int, CentralEffectSimulation::Database::CesSimulatedMovementSegment> segDbMap; // QMap to get it sorted
|
||||
for (const CentralEffectSimulation::Database::CesSimulatedMovementSegment &segData : qAsConst(simMoveSegVec))
|
||||
for (const CentralEffectSimulation::Database::CesSimulatedMovementSegment &segData : std::as_const(simMoveSegVec))
|
||||
{
|
||||
if (segData.simulatedMovementId == data.id)
|
||||
segDbMap.insert(segData.positionIndex, segData);
|
||||
}
|
||||
request.segments().reserve(segDbMap.size());
|
||||
CentralEffectSimulation::SimulatedMovementSegment seg;
|
||||
for (const CentralEffectSimulation::Database::CesSimulatedMovementSegment &segDb : qAsConst(segDbMap))
|
||||
for (const CentralEffectSimulation::Database::CesSimulatedMovementSegment &segDb : std::as_const(segDbMap))
|
||||
{
|
||||
seg.delay(segDb.delay);
|
||||
seg.name(segDb.name.toStdString());
|
||||
@@ -280,7 +281,7 @@ void HandlerSimulatedMovement::onSimulatedMovementRemoveByParticipantIdRequest(c
|
||||
DEBUG_LOG(m_logger) << "onSimulatedMovementRemoveByParticipantIdRequest: " << request;
|
||||
|
||||
int id = 0;
|
||||
for (const SimulationMovement *simMovement : qAsConst(m_simulationMovements))
|
||||
for (const SimulationMovement *simMovement : std::as_const(m_simulationMovements))
|
||||
{
|
||||
if (simMovement->participantId() == request.participantId())
|
||||
{
|
||||
@@ -299,7 +300,7 @@ SimulationMovement *HandlerSimulatedMovement::findSimulationMovement(int id, int
|
||||
{
|
||||
if (id)
|
||||
return m_simulationMovements.value(id);
|
||||
for (SimulationMovement *s : qAsConst(m_simulationMovements))
|
||||
for (SimulationMovement *s : std::as_const(m_simulationMovements))
|
||||
{
|
||||
if (s->participantId() == participantId)
|
||||
return s;
|
||||
|
||||
+10
-9
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "ces_building_model.h"
|
||||
#include <utility>
|
||||
|
||||
#include <Buildings/BuildingControlUnit/VWM/vwm_xml_reader.h>
|
||||
#include <Buildings/BuildingControlUnit/VWM/vwm_math.h>
|
||||
@@ -103,7 +104,7 @@ bool BuildingModel::init(
|
||||
<< ", m_refPos=" << m_refPos;
|
||||
|
||||
|
||||
for (const InfrastructureManagement::FootprintElement &footprintElement : qAsConst(mfp.elements()))
|
||||
for (const InfrastructureManagement::FootprintElement &footprintElement : std::as_const(mfp.elements()))
|
||||
m_footprint << QPointF(footprintElement.relPosition().offsetX(), footprintElement.relPosition().offsetY());
|
||||
if (m_footprint.isEmpty())
|
||||
{
|
||||
@@ -122,10 +123,10 @@ bool BuildingModel::init(
|
||||
|
||||
m_height = DBL_MIN;
|
||||
const QMap<int, BuildingControlUnit::VWM::Room> &roomMap = rooms();
|
||||
for (const BuildingControlUnit::VWM::Room &room : qAsConst(roomMap))
|
||||
for (const BuildingControlUnit::VWM::OuterWall &outerWall : qAsConst(room.outerWalls()))
|
||||
for (const BuildingControlUnit::VWM::WallElement &wallElement : qAsConst(outerWall.elements()))
|
||||
for (const LtsUtils::QPoint3D &point : qAsConst(wallElement))
|
||||
for (const BuildingControlUnit::VWM::Room &room : std::as_const(roomMap))
|
||||
for (const BuildingControlUnit::VWM::OuterWall &outerWall : std::as_const(room.outerWalls()))
|
||||
for (const BuildingControlUnit::VWM::WallElement &wallElement : std::as_const(outerWall.elements()))
|
||||
for (const LtsUtils::QPoint3D &point : std::as_const(wallElement))
|
||||
if (point.z() > m_height)
|
||||
m_height = point.z();
|
||||
|
||||
@@ -311,7 +312,7 @@ QVector<LtsUtils::QPoint3D> BuildingModel::fromGeographic(const std::vector<Core
|
||||
{
|
||||
QVector<LtsUtils::QPoint3D> ret;
|
||||
ret.reserve(points.size());
|
||||
for (const Core::GeoPosition &point : qAsConst(points))
|
||||
for (const Core::GeoPosition &point : std::as_const(points))
|
||||
ret.append(fromGeographic(point));
|
||||
return ret;
|
||||
}
|
||||
@@ -326,7 +327,7 @@ std::vector<Core::GeoPosition> BuildingModel::toGeographic(const QVector<LtsUtil
|
||||
{
|
||||
std::vector<Core::GeoPosition> ret;
|
||||
ret.reserve(points.size());
|
||||
for (const LtsUtils::QPoint3D &point : qAsConst(points))
|
||||
for (const LtsUtils::QPoint3D &point : std::as_const(points))
|
||||
ret.push_back(toGeographic(point));
|
||||
return ret;
|
||||
}
|
||||
@@ -341,7 +342,7 @@ QVector<LtsUtils::QPoint3D> BuildingModel::fromReference(const QVector<LtsUtils:
|
||||
{
|
||||
QVector<LtsUtils::QPoint3D> ret;
|
||||
ret.reserve(points.size());
|
||||
for (const LtsUtils::QPoint3D &point : qAsConst(points))
|
||||
for (const LtsUtils::QPoint3D &point : std::as_const(points))
|
||||
ret.append(fromReference(point));
|
||||
return ret;
|
||||
}
|
||||
@@ -355,7 +356,7 @@ QVector<LtsUtils::QPoint3D> BuildingModel::toReference(const QVector<LtsUtils::Q
|
||||
{
|
||||
QVector<LtsUtils::QPoint3D> ret;
|
||||
ret.reserve(points.size());
|
||||
for (const LtsUtils::QPoint3D &point : qAsConst(points))
|
||||
for (const LtsUtils::QPoint3D &point : std::as_const(points))
|
||||
ret.append(toReference(point));
|
||||
return ret;
|
||||
}
|
||||
|
||||
+9
-8
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_aes_data.h"
|
||||
#include <utility>
|
||||
|
||||
#include <CentralEffectSimulation/handler_participant.h>
|
||||
#include <CentralEffectSimulation/handler_building_data.h>
|
||||
@@ -234,7 +235,7 @@ void HandlerAesData::calculateBuildingExplosion(const AreaEffectSimulation::Char
|
||||
|
||||
// Bounding-Box-Check
|
||||
// QMap<int, Footprint> m_handlerBuildingData.getFootprints();
|
||||
for (const CentralEffectSimulation::HandlerBuildingData::Footprint &footprint : qAsConst(footprints))
|
||||
for (const CentralEffectSimulation::HandlerBuildingData::Footprint &footprint : std::as_const(footprints))
|
||||
{
|
||||
|
||||
const Core::GeoPosition2D impactPosition2D(impactPosition.lon(), impactPosition.lat());
|
||||
@@ -406,7 +407,7 @@ void HandlerAesData::onEffectsChanged(const AreaEffectSimulation::Effects &effec
|
||||
|
||||
// calculate for every building of our exercise:
|
||||
const QHash<int, CentralEffectSimulation::HandlerBuildingData::Footprint> &footprints = m_handlerBuildingData->getFootprints();
|
||||
for (const CentralEffectSimulation::HandlerBuildingData::Footprint &footprint : qAsConst(footprints))
|
||||
for (const CentralEffectSimulation::HandlerBuildingData::Footprint &footprint : std::as_const(footprints))
|
||||
{
|
||||
calculateImpacts(effects, footprint);
|
||||
}
|
||||
@@ -493,7 +494,7 @@ void HandlerAesData::preCalculateImpacts(const AreaEffectSimulation::TriggeredIm
|
||||
// Vulnerability should be calculated
|
||||
|
||||
const QHash<int, CentralEffectSimulation::HandlerBuildingData::Footprint> &footprints = m_handlerBuildingData->getFootprints();
|
||||
for (const CentralEffectSimulation::HandlerBuildingData::Footprint &footprint : qAsConst(footprints))
|
||||
for (const CentralEffectSimulation::HandlerBuildingData::Footprint &footprint : std::as_const(footprints))
|
||||
{
|
||||
calculateImpacts(data, aesItemView, footprint);
|
||||
} // for
|
||||
@@ -585,7 +586,7 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac
|
||||
|
||||
CentralEffectSimulation::BitfieldStates &bitfieldStates = m_bitfieldStatesBld[footprint.mseId];
|
||||
QSet<int> &bitfieldState = bitfieldStates[aesItemId];
|
||||
for (int i : qAsConst(bitfieldState))
|
||||
for (int i : std::as_const(bitfieldState))
|
||||
DEBUG_LOG(m_logger) << "bitfieldState for " << aesItemId << ": " << i;
|
||||
|
||||
for (int32_t bitFieldIdx = 0; bitFieldIdx < data.impactCount(); ++bitFieldIdx)
|
||||
@@ -710,7 +711,7 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::Effects &effec
|
||||
|
||||
const std::vector<AreaEffectSimulation::SingleEffect> &singleEffectsRef = effects.singleEffects();
|
||||
int indexBitFieldIdx = -1;
|
||||
for (const AreaEffectSimulation::SingleEffect &singleEffect : qAsConst(singleEffectsRef))
|
||||
for (const AreaEffectSimulation::SingleEffect &singleEffect : std::as_const(singleEffectsRef))
|
||||
{
|
||||
++indexBitFieldIdx;
|
||||
|
||||
@@ -855,7 +856,7 @@ void HandlerAesData::checkBuildingsHit(const AreaEffectSimulation::AesItemView &
|
||||
DEBUG_LOG(m_logger) << "AtBoobyTrapSecondary data.form().size()=" << data.form().size();
|
||||
// BoobyTrap
|
||||
polyGeo.reserve(data.form().size());
|
||||
for (const auto &pointGeo : qAsConst(data.form()))
|
||||
for (const auto &pointGeo : std::as_const(data.form()))
|
||||
{
|
||||
QPointF point;
|
||||
point.setX(pointGeo.lon());
|
||||
@@ -872,7 +873,7 @@ void HandlerAesData::checkBuildingsHit(const AreaEffectSimulation::AesItemView &
|
||||
<< " exerciseId=" << exerciseId;
|
||||
// only include buildings within the radius
|
||||
|
||||
for (const int buildingId : qAsConst(buildingIdsInside))
|
||||
for (const int buildingId : std::as_const(buildingIdsInside))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << " BuildingId=" << buildingId;
|
||||
Buildings::Building tmpBldg;
|
||||
@@ -958,7 +959,7 @@ QVector<int> HandlerAesData::findBuildingsBetween(const LtsCoordTrans::LtsCoordi
|
||||
// check all exercise specific footprints except our:
|
||||
const QHash<int, CentralEffectSimulation::HandlerBuildingData::Footprint> &allFootprintsOfEx = m_handlerBuildingData->getFootprints();
|
||||
buildingIdsInBetween.reserve(allFootprintsOfEx.size());
|
||||
for (const CentralEffectSimulation::HandlerBuildingData::Footprint &footprintToCheck : qAsConst(allFootprintsOfEx))
|
||||
for (const CentralEffectSimulation::HandlerBuildingData::Footprint &footprintToCheck : std::as_const(allFootprintsOfEx))
|
||||
{
|
||||
// do not check ourself
|
||||
if (footprintToCheck.mseId == targetFootprint.mseId)
|
||||
|
||||
+6
-5
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_building_model.h"
|
||||
#include <utility>
|
||||
|
||||
#include <CentralEffectSimulation/logger.h>
|
||||
|
||||
@@ -321,7 +322,7 @@ CentralEffectSimulation::GetLineBuildingIntersectionReply HandlerBuildingModel::
|
||||
|
||||
QPolygonF polygon2D;
|
||||
polygon2D.reserve(polylineRef.size());
|
||||
for (const Core::GeoPosition &geoPos : qAsConst(polylineRef))
|
||||
for (const Core::GeoPosition &geoPos : std::as_const(polylineRef))
|
||||
polygon2D << QPointF(geoPos.lon(), geoPos.lat());
|
||||
|
||||
// Only the buildings where the line/trajectory flies over the building footprint are taken into account.
|
||||
@@ -332,7 +333,7 @@ CentralEffectSimulation::GetLineBuildingIntersectionReply HandlerBuildingModel::
|
||||
if (m_logger.isDebugEnabled())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "relevantBuildings.size=" << relevantBuildings.size();
|
||||
for (const int bldgId : qAsConst(relevantBuildings))
|
||||
for (const int bldgId : std::as_const(relevantBuildings))
|
||||
DEBUG_LOG(m_logger) << "relevantBuilding: bldgId = " << bldgId;
|
||||
}
|
||||
|
||||
@@ -368,8 +369,8 @@ CentralEffectSimulation::GetLineBuildingIntersectionReply HandlerBuildingModel::
|
||||
<< " , end=" << segEnd;
|
||||
|
||||
int buildingId = -1; // for debugging purposes
|
||||
//for (BuildingModel *buildingModel : qAsConst(m_buildingModels))
|
||||
for (const int bldgId : qAsConst(relevantBuildings))
|
||||
//for (BuildingModel *buildingModel : std::as_const(m_buildingModels))
|
||||
for (const int bldgId : std::as_const(relevantBuildings))
|
||||
{
|
||||
BuildingModel *buildingModel = m_buildingModels.value(bldgId, nullptr);
|
||||
if (!buildingModel)
|
||||
@@ -487,7 +488,7 @@ CentralEffectSimulation::GetLineBuildingIntersectionReply HandlerBuildingModel::
|
||||
|
||||
} // if
|
||||
|
||||
} // for (const int bldgId : qAsConst(relevantBuildings))
|
||||
} // for (const int bldgId : std::as_const(relevantBuildings))
|
||||
} // for(lineIt = polylineRef.begin(); lineIt != polylineRef.end()-1; ++lineIt)
|
||||
|
||||
DEBUG_LOG(m_logger) << "END getLineBuildingIntersectionInternal, request '" << request.requestId() << "'"
|
||||
|
||||
+11
-4
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_contamination.h"
|
||||
#include <utility>
|
||||
|
||||
#include <CentralEffectSimulation/handler_participant.h>
|
||||
#include <CentralEffectSimulation/handler_building_data.h>
|
||||
@@ -156,7 +157,7 @@ void HandlerContamination::onAesItemViewChanged(const AreaEffectSimulation::AesI
|
||||
bool isGroundLevel = false;
|
||||
const QVector<int> &buildingIds = dtcIsm.get()->getBuildingByPolygon(exerciseId, polygonGeo, completeEnclosed, isGroundLevel);
|
||||
DEBUG_LOG(m_logger) << "buildingIds.size=" << buildingIds.size();
|
||||
for (int buildingId : qAsConst(buildingIds))
|
||||
for (int buildingId : std::as_const(buildingIds))
|
||||
{
|
||||
calculateBuilding(buildingId, data, chargeHeight, chargeDepression);
|
||||
}
|
||||
@@ -192,7 +193,7 @@ void HandlerContamination::calculateBuilding(int buildingId,
|
||||
DEBUG_LOG(m_logger) << "buildingId=" << buildingId;
|
||||
effectedRooms.clear();
|
||||
effectedFloors = getEffectedFloors(buildingId, chargeHeight, chargeDepression);
|
||||
for (int effectedFloor : qAsConst(effectedFloors))
|
||||
for (int effectedFloor : std::as_const(effectedFloors))
|
||||
effectedRooms += dtcIsm.get()->getRoomIdsFromFloorId(buildingId, effectedFloor);
|
||||
if (!effectedRooms.empty())
|
||||
{
|
||||
@@ -255,7 +256,7 @@ void HandlerContamination::onBuildingStateChanged(const Buildings::BuildingState
|
||||
// Buildings that have been reset or decontaminated will be recontaminated as long as the nuclear weapon is still present
|
||||
|
||||
const auto aesItemViews = m_ddsHandler->dtcAes()->aesItemViews();
|
||||
for (const auto &aesItemView : qAsConst(aesItemViews))
|
||||
for (const auto &aesItemView : std::as_const(aesItemViews))
|
||||
{
|
||||
if (aesItemView.effectStateId() == AreaEffectSimulation::AesEffectState::EsActivated)
|
||||
{
|
||||
@@ -370,7 +371,7 @@ QVector<int> HandlerContamination::getEffectedFloors(const int buildingId, const
|
||||
const QVector<int> &floorIds = dtcIsm->getFloorIdsFromBuilding(buildingId);
|
||||
QVector<int> effectedFloorIds;
|
||||
effectedFloorIds.reserve(floorIds.size());
|
||||
for (int floorId : qAsConst(floorIds))
|
||||
for (int floorId : std::as_const(floorIds))
|
||||
{
|
||||
double halfFloorHeight = dtcIsm->getHalfFloorHeight(buildingId, floorId);
|
||||
DEBUG_LOG(m_logger) << " floorId=" << floorId
|
||||
@@ -451,6 +452,8 @@ bool HandlerContamination::isInsideInnerCircle(int buildingId, int aesId)
|
||||
DEBUG_LOG(m_logger) << "isInsideInnerCircle return false";
|
||||
return false;
|
||||
}
|
||||
// unreachable fallback (silences -Wreturn-type; macro uses a for-loop that confuses GCC control flow)
|
||||
return false;
|
||||
}
|
||||
|
||||
// Returns true if the building is in the inner circle at the time of impact and should fail as a result.
|
||||
@@ -482,6 +485,8 @@ bool HandlerContamination::isInsideBCContamination(int buildingId, int aesId)
|
||||
DEBUG_LOG(m_logger) << "isInsideInnerCircle return false";
|
||||
return false;
|
||||
}
|
||||
// unreachable fallback (silences -Wreturn-type; macro uses a for-loop that confuses GCC control flow)
|
||||
return false;
|
||||
}
|
||||
|
||||
// Returns true if the building is located in range 1 at the time of impact and is to be contaminated as a result.
|
||||
@@ -514,6 +519,8 @@ bool HandlerContamination::isInsideRange1(int buildingId, int aesId)
|
||||
DEBUG_LOG(m_logger) << "isInsideRange1 return false";
|
||||
return false;
|
||||
}
|
||||
// unreachable fallback (silences -Wreturn-type; macro uses a for-loop that confuses GCC control flow)
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace CesBuildings
|
||||
+5
-4
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_aes_data.h"
|
||||
#include <utility>
|
||||
#include "settings.h"
|
||||
|
||||
#include <CentralEffectSimulation/handler_participant.h>
|
||||
@@ -181,7 +182,7 @@ void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::Explos
|
||||
|
||||
// Bounding-Box-Check
|
||||
// QMap<int, Footprint> m_footprints;
|
||||
for (const Footprint &footprint : qAsConst(m_footprints))
|
||||
for (const Footprint &footprint : std::as_const(m_footprints))
|
||||
{
|
||||
const QPointF impactPos(CentralEffectSimulation::geographic2Utm(data.impactPosition(), footprint.zone));
|
||||
const QPolygonF polyBldgRadius({QPointF(footprint.boundingBoxPolyUtm.bottomLeft().rx() - impactRadius,
|
||||
@@ -304,7 +305,7 @@ void HandlerAesData::calculateFootprint(const InfrastructureManagement::MainFoot
|
||||
footprint.geoPosition = mse.geoPosition();
|
||||
const QPointF utmFpPosition = CentralEffectSimulation::geographic2Utm(footprint.geoPosition, &footprint.zone);
|
||||
footprint.polyUtm.reserve(poly.size());
|
||||
for (const QPointF &point : qAsConst(poly))
|
||||
for (const QPointF &point : std::as_const(poly))
|
||||
footprint.polyUtm.push_back(utmFpPosition + point);
|
||||
footprint.boundingBoxPolyUtm = footprint.polyUtm.boundingRect();
|
||||
|
||||
@@ -351,7 +352,7 @@ void HandlerAesData::preCalculateImpacts(const AreaEffectSimulation::TriggeredIm
|
||||
}
|
||||
// Bounding-Box-Check
|
||||
// QMap<int, Footprint> m_footprints;
|
||||
for (const Footprint &footprint : qAsConst(m_footprints))
|
||||
for (const Footprint &footprint : std::as_const(m_footprints))
|
||||
{
|
||||
//if (boundingBoxImpact.contains(footprint.boundingBoxPolyUtm))
|
||||
calculateImpacts(data, footprint);
|
||||
@@ -407,7 +408,7 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac
|
||||
|
||||
BitfieldStates &bitfieldStates = m_bitfieldStatesBld[footprint.mseId];
|
||||
QSet<int> &bitfieldState = bitfieldStates[data.aesItemId()];
|
||||
for (int i : qAsConst(bitfieldState))
|
||||
for (int i : std::as_const(bitfieldState))
|
||||
DEBUG_LOG(m_logger) << "bitfieldState for " << data.aesItemId() << ": " << i;
|
||||
|
||||
const AreaEffectSimulation::AesItemView &aesItemView = *it;
|
||||
|
||||
+3
-2
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_participant_area.h"
|
||||
#include <utility>
|
||||
#include "settings.h"
|
||||
#include "CentralEffectSimulation/handler_participant.h"
|
||||
|
||||
@@ -498,7 +499,7 @@ void HandlerParticipantArea::calculateAesParticipant(const CentralEffectSimulati
|
||||
return;
|
||||
|
||||
DEBUG_LOG(m_logger) << "HandlerParticipantArea::calculateAesParticipant paricipantId: " << participantPos.participantId();
|
||||
for (const CentralEffectSimulation::AesItemViewUtm &itemView : qAsConst(m_aesItemViews))
|
||||
for (const CentralEffectSimulation::AesItemViewUtm &itemView : std::as_const(m_aesItemViews))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << " itemView: " << itemView.aesItemId << ", " << itemView.aesTypeId;
|
||||
switch (itemView.aesTypeId.underlying())
|
||||
@@ -837,7 +838,7 @@ void HandlerParticipantArea::onExplosionSingleCentralChanged(const AreaEffectSim
|
||||
const int effectType = static_cast<int>(EffectType::ExplosionSingle) & 0xffff;
|
||||
const QMap<int, BuildingModel *> buildingModels = m_handlerBuildingModel->buildingModels();
|
||||
const QList<CentralEffectSimulation::HandlerParticipant::CesParticipantData> participantPositions = m_handlerParticipant->positions().values();
|
||||
for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPosition : qAsConst(participantPositions))
|
||||
for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPosition : std::as_const(participantPositions))
|
||||
{
|
||||
if (participantPosition.insideBuilding())
|
||||
continue;
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "expand_polygon.h"
|
||||
#include <utility>
|
||||
|
||||
#include <CentralEffectSimulation/logger.h>
|
||||
|
||||
@@ -28,7 +29,7 @@ QPolygonF bufferUtmPolygon(const QPolygonF &polygonUtmIn, const int zone, const
|
||||
Esri::ArcGISRuntime::PolygonBuilder polygonBuilder(Esri::ArcGISRuntime::SpatialReference(32600 + zone));
|
||||
DEBUG_LOG(logger) << "ExpandPolygon::bufferUtmPolygon";
|
||||
|
||||
for (const QPointF &pointUtm : qAsConst(polygonUtmIn))
|
||||
for (const QPointF &pointUtm : std::as_const(polygonUtmIn))
|
||||
polygonBuilder.addPoint(Esri::ArcGISRuntime::Point(pointUtm.x(), pointUtm.y(), 0));
|
||||
const Esri::ArcGISRuntime::Geometry &esriGeometry = polygonBuilder.toGeometry();
|
||||
|
||||
|
||||
+12
-11
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_explosions.h"
|
||||
#include <utility>
|
||||
#include "expand_polygon.h"
|
||||
|
||||
#include <LtsUtilsCore/dds_bitarray.h>
|
||||
@@ -229,7 +230,7 @@ void HandlerExplosions::onAesItemViewChanged(const AreaEffectSimulation::AesItem
|
||||
|
||||
const int remaining = 1; // ICD GUEZSB60_ICD-0052_Zentrale_Tne.doc Wirkfeldtyp Gefahrenbereich Steilfeuer
|
||||
const auto &participantPositions = m_handlerParticipant->positions();
|
||||
for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &pPos : qAsConst(participantPositions))
|
||||
for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &pPos : std::as_const(participantPositions))
|
||||
{
|
||||
if (!allParticipantIdsInArea.contains(pPos.participantId()))
|
||||
continue;
|
||||
@@ -358,7 +359,7 @@ void HandlerExplosions::calculateImpact(const AreaEffectSimulation::ChargeEffect
|
||||
AreaEffectSimulation::ChargeStruct chargeStruct(data.chargeTypeId(),data.igniterTypeId(), data.igniterFunctionId());
|
||||
const double impactRadius = m_ddsHandler->chargeTypeRadius(chargeStruct);
|
||||
|
||||
for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &pPos : qAsConst(participantPositions))
|
||||
for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &pPos : std::as_const(participantPositions))
|
||||
{
|
||||
if (m_handlerParticipant->isOutdated(pPos)) // Participant Position is not valid Todo Magic Number
|
||||
continue;
|
||||
@@ -555,7 +556,7 @@ void HandlerExplosions::onExplosionSingleChanged(const AreaEffectSimulation::Exp
|
||||
return;
|
||||
}
|
||||
|
||||
for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &pPos : qAsConst(participantPositions))
|
||||
for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &pPos : std::as_const(participantPositions))
|
||||
{
|
||||
if (m_handlerParticipant->isOutdated(pPos)) // Participant Position is not valid Todo Magic Number
|
||||
continue;
|
||||
@@ -646,7 +647,7 @@ void HandlerExplosions::onEffectsChanged(const AreaEffectSimulation::Effects &ef
|
||||
triggeredEffectsLtsCoord.reserve(singleEffectsRef.size());
|
||||
|
||||
int curSeIndex = -1;
|
||||
for (const AreaEffectSimulation::SingleEffect &se : qAsConst(singleEffectsRef))
|
||||
for (const AreaEffectSimulation::SingleEffect &se : std::as_const(singleEffectsRef))
|
||||
{
|
||||
++curSeIndex;
|
||||
if (se.singleEffectState() != AreaEffectSimulation::AesSingleEffectState::SesTriggered)
|
||||
@@ -670,7 +671,7 @@ void HandlerExplosions::onEffectsChanged(const AreaEffectSimulation::Effects &ef
|
||||
|
||||
// Now call calculateImpacts() (createEvent if in circle...)
|
||||
const auto &participantPositions = m_handlerParticipant->positions();
|
||||
for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &pPos : qAsConst(participantPositions))
|
||||
for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &pPos : std::as_const(participantPositions))
|
||||
{
|
||||
if (pPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::CatastrophicKill)
|
||||
continue;
|
||||
@@ -906,7 +907,7 @@ void HandlerExplosions::calculateSmartEffect(const AreaEffectSimulation::Effects
|
||||
bool itemAvailable = m_ddsHandler->dtcAes()->aesItemFromId(effects.aesItemId(), aesItem);
|
||||
if ( itemAvailable)
|
||||
{
|
||||
for (const AreaEffectSimulation::SingleEffect &se : qAsConst(effects.singleEffects()))
|
||||
for (const AreaEffectSimulation::SingleEffect &se : std::as_const(effects.singleEffects()))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " ---> singleEffect=" << se
|
||||
<< ", aesItem= " << aesItem;
|
||||
@@ -947,7 +948,7 @@ void HandlerExplosions::calculateSmartExplosion(const int32_t aesItemId,
|
||||
bool bHumanFound = false;
|
||||
|
||||
const auto &participantPositions = m_handlerParticipant->positions();
|
||||
for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPosition : qAsConst(participantPositions))
|
||||
for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPosition : std::as_const(participantPositions))
|
||||
{
|
||||
if (m_handlerParticipant->isOutdated(participantPosition)) // Participant Position is not valid Todo Magic Number
|
||||
continue;
|
||||
@@ -1090,7 +1091,7 @@ void HandlerExplosions::calculateImpacts(const AreaEffectSimulation::TriggeredIm
|
||||
return;
|
||||
|
||||
const auto &participantPositions = m_handlerParticipant->positions();
|
||||
for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &pPos : qAsConst(participantPositions))
|
||||
for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &pPos : std::as_const(participantPositions))
|
||||
{
|
||||
if (m_handlerParticipant->isOutdated(pPos)) // Participant Position is not valid Todo Magic Number
|
||||
continue;
|
||||
@@ -1120,7 +1121,7 @@ void HandlerExplosions::calculateImpacts(const CentralEffectSimulation::AesItemV
|
||||
|
||||
DEBUG_LOG(m_logger) << "XXXXXXXXXXXX calculateImpacts2a impactsToCheck.size " << impactsToCheck.size();
|
||||
|
||||
for (int bitFieldIdx : qAsConst(impactsToCheck))
|
||||
for (int bitFieldIdx : std::as_const(impactsToCheck))
|
||||
{
|
||||
if (itemView.form.size() <= bitFieldIdx)
|
||||
continue;
|
||||
@@ -1178,7 +1179,7 @@ void HandlerExplosions::calculateImpactsEffect(const CentralEffectSimulation::Ae
|
||||
|
||||
DEBUG_LOG(m_logger) << "shiftedParticipantLtsCoord = " << shiftedParticipantLtsCoord.toString(true);
|
||||
|
||||
for (const LtsCoordinate &newTriggeredImpactLtsCoord : qAsConst(triggeredEffectsLtsCoord))
|
||||
for (const LtsCoordinate &newTriggeredImpactLtsCoord : std::as_const(triggeredEffectsLtsCoord))
|
||||
{
|
||||
// const int zoneToUse = itemView.zone;
|
||||
// 2D or 3D??
|
||||
@@ -1343,7 +1344,7 @@ void HandlerExplosions::calculateImpactsEffect_outdated(const CentralEffectSimul
|
||||
DEBUG_LOG(m_logger) << "calculateImpactsEffect 1 triggeredEffectsUtmPos.size " << triggeredEffectsUtmPos.size();
|
||||
|
||||
int idx = -1;
|
||||
for (const QPointF &newTriggeredImpactUtm : qAsConst(triggeredEffectsUtmPos))
|
||||
for (const QPointF &newTriggeredImpactUtm : std::as_const(triggeredEffectsUtmPos))
|
||||
{
|
||||
++idx;
|
||||
|
||||
|
||||
+4
-3
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_vulcano.h"
|
||||
#include <utility>
|
||||
#include "expand_polygon.h"
|
||||
#include "isInCone.h"
|
||||
#include "settings.h"
|
||||
@@ -244,7 +245,7 @@ void HandlerVulcano::onTrajectoryTimeAwareTimeout()
|
||||
const auto &designationsVec = dpd.designations();
|
||||
DEBUG_LOG(m_logger) << "onTimerTimeout participantId=" << participantId;
|
||||
|
||||
for (const auto &designation : qAsConst(designationsVec))
|
||||
for (const auto &designation : std::as_const(designationsVec))
|
||||
{
|
||||
if (designation.code() == prf && designation.outputPower() > 0)
|
||||
{
|
||||
@@ -368,7 +369,7 @@ Core::GeoPosition HandlerVulcano::getTrajectoryPosFromTime(int aesId, long long
|
||||
|
||||
Core::GeoPosition result;
|
||||
int i = 0;
|
||||
for (const auto &point : qAsConst(trajectoryTimeAwareValue.geometry()))
|
||||
for (const auto &point : std::as_const(trajectoryTimeAwareValue.geometry()))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "time=" << point.relativeTime();
|
||||
if ( (point.relativeTime() > relTime) && (i > 0))
|
||||
@@ -404,7 +405,7 @@ void HandlerVulcano::onDynamicParticipantChanged(const ParticipantManagement::Dy
|
||||
<< data.designations().size();
|
||||
if (data.designations().size() > 0)
|
||||
{
|
||||
for (const ParticipantManagement::LaserDesignation &designation : qAsConst(data.designations()))
|
||||
for (const ParticipantManagement::LaserDesignation &designation : std::as_const(data.designations()))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "gearId=" << designation.gearId()
|
||||
<< " code=" << designation.code()
|
||||
|
||||
+3
-2
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_functional_area.h"
|
||||
#include <utility>
|
||||
|
||||
#include <QtCore/QTimer>
|
||||
#include <QtCore/QDateTime>
|
||||
@@ -302,7 +303,7 @@ void HandlerFunctionalAreas::onNewParticipantPosition(const CentralEffectSimulat
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "HandlerParticipantArea::calculateAesParticipant paricipantId: " << participantData.participantId();
|
||||
for (const CentralEffectSimulation::AesItemViewUtm &itemView : qAsConst(m_aesItemViews))
|
||||
for (const CentralEffectSimulation::AesItemViewUtm &itemView : std::as_const(m_aesItemViews))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << " itemView: " << itemView.aesItemId << ", " << itemView.aesTypeId;
|
||||
switch (itemView.aesTypeId.underlying())
|
||||
@@ -345,7 +346,7 @@ void HandlerFunctionalAreas::onNewIndoorParticipantPosition(const CentralEffectS
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "HandlerParticipantArea::calculateAesParticipant paricipantId: " << participantData.participantId();
|
||||
for (const CentralEffectSimulation::AesItemViewUtm &itemView : qAsConst(m_aesItemViews))
|
||||
for (const CentralEffectSimulation::AesItemViewUtm &itemView : std::as_const(m_aesItemViews))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << " itemView: " << itemView.aesItemId << ", " << itemView.aesTypeId;
|
||||
switch (itemView.aesTypeId.underlying())
|
||||
|
||||
+5
-4
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_aes_data.h"
|
||||
#include <utility>
|
||||
#include <CentralEffectSimulation/handler_participant.h>
|
||||
//#include "main_handler.h"
|
||||
#include "settings.h"
|
||||
@@ -135,7 +136,7 @@ void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::Explos
|
||||
|
||||
// Bounding-Box-Check
|
||||
// QMap<int, Footprint> m_footprints;
|
||||
for (const Footprint &footprint : qAsConst(m_footprints))
|
||||
for (const Footprint &footprint : std::as_const(m_footprints))
|
||||
{
|
||||
const QPointF impactPos(CentralEffectSimulation::geographic2Utm(data.impactPosition(), footprint.zone));
|
||||
const QPolygonF polyBldgRadius({QPointF(footprint.boundingBoxPolyUtm.bottomLeft().rx() - impactRadius,
|
||||
@@ -258,7 +259,7 @@ void HandlerAesData::calculateFootprint(const InfrastructureManagement::MainFoot
|
||||
footprint.geoPosition = mse.geoPosition();
|
||||
const QPointF utmFpPosition = CentralEffectSimulation::geographic2Utm(footprint.geoPosition, &footprint.zone);
|
||||
footprint.polyUtm.reserve(poly.size());
|
||||
for (const QPointF &point : qAsConst(poly))
|
||||
for (const QPointF &point : std::as_const(poly))
|
||||
footprint.polyUtm.push_back(utmFpPosition + point);
|
||||
footprint.boundingBoxPolyUtm = footprint.polyUtm.boundingRect();
|
||||
|
||||
@@ -305,7 +306,7 @@ void HandlerAesData::preCalculateImpacts(const AreaEffectSimulation::TriggeredIm
|
||||
}
|
||||
// Bounding-Box-Check
|
||||
// QMap<int, Footprint> m_footprints;
|
||||
for (const Footprint &footprint : qAsConst(m_footprints))
|
||||
for (const Footprint &footprint : std::as_const(m_footprints))
|
||||
{
|
||||
//if (boundingBoxImpact.contains(footprint.boundingBoxPolyUtm))
|
||||
calculateImpacts(data, footprint);
|
||||
@@ -361,7 +362,7 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac
|
||||
|
||||
BitfieldStates &bitfieldStates = m_bitfieldStatesBld[footprint.mseId];
|
||||
QSet<int> &bitfieldState = bitfieldStates[data.aesItemId()];
|
||||
for (int i : qAsConst(bitfieldState))
|
||||
for (int i : std::as_const(bitfieldState))
|
||||
DEBUG_LOG(m_logger) << "bitfieldState for " << data.aesItemId() << ": " << i;
|
||||
|
||||
const AreaEffectSimulation::AesItemView &aesItemView = *it;
|
||||
|
||||
+3
-2
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_participant_gas_pipe.h"
|
||||
#include <utility>
|
||||
|
||||
#include <QtCore/QLineF>
|
||||
#include <QtCore/QTimer>
|
||||
@@ -202,7 +203,7 @@ void HandlerParticipantGasPipe::onParticipantPositionChanged(const CentralEffect
|
||||
<< " Anzahl GasPipes=" << m_gasPipes.size();
|
||||
|
||||
|
||||
for (const CentralEffectSimulation::AesItemViewUtm &gasPipe : qAsConst(m_gasPipes))
|
||||
for (const CentralEffectSimulation::AesItemViewUtm &gasPipe : std::as_const(m_gasPipes))
|
||||
{
|
||||
calculateGasPipeParticipant(gasPipe, partPos);
|
||||
|
||||
@@ -317,7 +318,7 @@ void HandlerParticipantGasPipe::onSendCesHitReply(const Core::FunctionReplyObjec
|
||||
void HandlerParticipantGasPipe::sendFtcCesHitRequestTimeout()
|
||||
{
|
||||
auto ftcTab = m_ddsHandler->ftcTab();
|
||||
for (const TrainingAreaBase::SendCesHitRequest &hr : qAsConst(m_requestMap))
|
||||
for (const TrainingAreaBase::SendCesHitRequest &hr : std::as_const(m_requestMap))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "sendFtcCesHitRequestTimeout: " << hr;
|
||||
ftcTab->sendCesHitRequest(hr, this);
|
||||
|
||||
+3
-2
@@ -79,6 +79,7 @@ bool BallisticService::createInterfaceOf(IUnknown **app_interface, E_TypeOfInter
|
||||
}
|
||||
|
||||
Ammunition *configuredAmmunition;
|
||||
Ammunition foundAmmunition; // function-scope copy: loop-local would dangle (use-after-free)
|
||||
E_TypeOfImpl e_impl = e_ImplBase;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Target Interface Pointer : " << app_interface ;
|
||||
@@ -91,9 +92,9 @@ bool BallisticService::createInterfaceOf(IUnknown **app_interface, E_TypeOfInter
|
||||
QVector<N_Ballistic::Ammunition>* ammunitions = m_ammuConfig->GetAmmunitions();
|
||||
for ( int i = 0; i < ammunitions->size(); i++)
|
||||
{
|
||||
N_Ballistic::Ammunition ammunition = m_ammuConfig->GetAmmunitions()->at(i);
|
||||
foundAmmunition = m_ammuConfig->GetAmmunitions()->at(i);
|
||||
//find ammunition
|
||||
configuredAmmunition = &ammunition;
|
||||
configuredAmmunition = &foundAmmunition;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Ammunition found: " << configuredAmmunition->m_AmmunInfo.m_Name ;
|
||||
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_geopairing.h"
|
||||
#include <utility>
|
||||
#include "settings.h"
|
||||
#include "GBL_ConfigSystem/geoconfig.h"
|
||||
#include "GeoPairingImpl/GeoPairingImpl.hpp"
|
||||
@@ -539,7 +540,7 @@ void HandlerGeoPairing::onSendGeopairingDataReply(const Core::FunctionReplyObjec
|
||||
void HandlerGeoPairing::sendFtcCesHitRequestTimeout()
|
||||
{
|
||||
auto ftcTab = m_ddsHandlerAes->ftcTab();
|
||||
for (const TrainingAreaBase::SendCesHitRequest &hr : qAsConst(m_requestMap))
|
||||
for (const TrainingAreaBase::SendCesHitRequest &hr : std::as_const(m_requestMap))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "sendFtcCesHitRequest: " << hr;
|
||||
ftcTab->sendCesHitRequest(hr, this);
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_mine_areas.h"
|
||||
#include <utility>
|
||||
#include "CentralEffectSimulation/handler_participant.h"
|
||||
#include "settings.h"
|
||||
|
||||
@@ -373,7 +374,7 @@ void HandlerMineAreas::onNewOutdoorPosition(const CentralEffectSimulation::Handl
|
||||
|
||||
// const QVector<QPointF> utmStepPoly = m_handlerParticipant->getParticipantStep(participantPos.participantId(), m_zone);
|
||||
|
||||
for (const CentralEffectSimulation::AesItemViewUtm &itemView : qAsConst(m_aesItemViews))
|
||||
for (const CentralEffectSimulation::AesItemViewUtm &itemView : std::as_const(m_aesItemViews))
|
||||
{
|
||||
int remaining = m_ddsHandler->remainingTasCode(itemView.chargeStruct);
|
||||
DEBUG_LOG(m_logger) << " itemView: " << itemView.aesItemId << ", " << itemView.aesTypeId
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_nbc.h"
|
||||
#include <utility>
|
||||
|
||||
#include <QtCore/QTimer>
|
||||
#include <QtCore/QDateTime>
|
||||
@@ -497,7 +498,7 @@ void HandlerNBC::onNewOutdoorParticipantPosition(const CentralEffectSimulation::
|
||||
|
||||
DEBUG_LOG(m_logger) << "HandlerParticipantArea::calculateAesParticipant paricipantId: " << participantData.participantId()
|
||||
<< " m_aesItemViews.size()=" << m_aesItemViews.size();
|
||||
for (const CentralEffectSimulation::AesItemViewUtm &itemView : qAsConst(m_aesItemViews))
|
||||
for (const CentralEffectSimulation::AesItemViewUtm &itemView : std::as_const(m_aesItemViews))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << " xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
|
||||
DEBUG_LOG(m_logger) << " itemView: " << itemView.aesItemId << ", " << itemView.aesTypeId;
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_participant_building.h"
|
||||
#include <utility>
|
||||
#include <CentralEffectSimulation/handler_participant.h>
|
||||
#include <ProjectDataManagement/pdm_dtc.h>
|
||||
|
||||
@@ -302,7 +303,7 @@ void HandlerParticipantBuilding::sendCesHitToParticipant(const Buildings::Buildi
|
||||
void HandlerParticipantBuilding::sendFtcCesHitRequestTimeout()
|
||||
{
|
||||
auto ftcTab = m_ddsHandler->ftcTab();
|
||||
for (const TrainingAreaBase::SendCesHitRequest &hr : qAsConst(m_requestMap))
|
||||
for (const TrainingAreaBase::SendCesHitRequest &hr : std::as_const(m_requestMap))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "sendFtcCesHitRequest: " << hr;
|
||||
ftcTab->sendCesHitRequest(hr, this);
|
||||
|
||||
+3
-2
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_participant_booby_trap.h"
|
||||
#include <utility>
|
||||
|
||||
#include <LtsCoordTrans/lts_coord_trans.h>
|
||||
|
||||
@@ -502,7 +503,7 @@ void HandlerParticipantBoobyTrap::onParticipantPositionChanged(const CentralEffe
|
||||
return;
|
||||
}
|
||||
|
||||
for (const CentralEffectSimulation::AesItemViewUtm &boobyTrap : qAsConst(m_boobyTrapItems))
|
||||
for (const CentralEffectSimulation::AesItemViewUtm &boobyTrap : std::as_const(m_boobyTrapItems))
|
||||
{
|
||||
if (!calculateBoobyTrapParticipant(boobyTrap, partPos))
|
||||
continue;
|
||||
@@ -675,7 +676,7 @@ void HandlerParticipantBoobyTrap::sendFtcBoobyTrapTrigger(int aesItemId)
|
||||
void HandlerParticipantBoobyTrap::sendFtcCesHitRequestTimeout()
|
||||
{
|
||||
auto ftcTab = m_ddsHandler->ftcTab();
|
||||
for (const TrainingAreaBase::SendCesHitRequest &hr : qAsConst(m_requestMap))
|
||||
for (const TrainingAreaBase::SendCesHitRequest &hr : std::as_const(m_requestMap))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "sendFtcCesHitRequestTimeout: " << hr;
|
||||
ftcTab->sendCesHitRequest(hr, this);
|
||||
|
||||
+3
-2
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_participant_off_route_mine.h"
|
||||
#include <utility>
|
||||
|
||||
#include <LtsCoordTrans/lts_coord_trans.h>
|
||||
|
||||
@@ -346,7 +347,7 @@ void HandlerParticipantOffRouteMine::onParticipantPositionChanged(const CentralE
|
||||
return;
|
||||
}
|
||||
|
||||
for (const CentralEffectSimulation::AesItemViewUtm &offRouteMine : qAsConst(m_offRouteMineItems))
|
||||
for (const CentralEffectSimulation::AesItemViewUtm &offRouteMine : std::as_const(m_offRouteMineItems))
|
||||
{
|
||||
calculateOffRouteMineParticipant(offRouteMine, partPos);
|
||||
|
||||
@@ -518,7 +519,7 @@ void HandlerParticipantOffRouteMine::sendFtcOffRouteMineTrigger(int aesItemId)
|
||||
void HandlerParticipantOffRouteMine::sendFtcCesHitRequestTimeout()
|
||||
{
|
||||
auto ftcTab = m_ddsHandler->ftcTab();
|
||||
for (const TrainingAreaBase::SendCesHitRequest &hr : qAsConst(m_requestMap))
|
||||
for (const TrainingAreaBase::SendCesHitRequest &hr : std::as_const(m_requestMap))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "sendFtcCesHitRequestTimeout: " << hr;
|
||||
ftcTab->sendCesHitRequest(hr, this);
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_building_data.h"
|
||||
#include <utility>
|
||||
#include "settings.h"
|
||||
#include "handler_participant.h"
|
||||
#include <LtsUtilsCore/dds_bitarray.h>
|
||||
@@ -78,7 +79,7 @@ void HandlerBuildingData::onMainStructureElementChanged(const InfrastructureMana
|
||||
|
||||
m_mainStructureElements.insert(data.id, data);
|
||||
DEBUG_LOG(m_logger) << "Got MainStructureElement: " << data;
|
||||
for (const InfrastructureManagement::StructureElement &ele : qAsConst(data.elements))
|
||||
for (const InfrastructureManagement::StructureElement &ele : std::as_const(data.elements))
|
||||
{
|
||||
if (ele.structureElementTypeId == InfrastructureManagement::StructureElementType::Room)
|
||||
{
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_codification_data.h"
|
||||
#include <utility>
|
||||
#include "object_codification_data.h"
|
||||
|
||||
using namespace CodificationManagement;
|
||||
@@ -39,7 +40,7 @@ bool HandlerCodificationData::init()
|
||||
}
|
||||
|
||||
// create objects
|
||||
for (const Database::CodCodificationTable &data : qAsConst(dataVec))
|
||||
for (const Database::CodCodificationTable &data : std::as_const(dataVec))
|
||||
{
|
||||
CodificationManagement::CodificationData ddsData = ObjectCodificationData::toDdsData(data);
|
||||
ObjectCodificationData *ifs(new ObjectCodificationData(m_ddsHandler, m_dbHandler));
|
||||
|
||||
+10
-9
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_effect_show.h"
|
||||
#include <utility>
|
||||
#include "handler_ppm_data.h"
|
||||
#include "handler_tab_data.h"
|
||||
#include "handler_mdm_data.h"
|
||||
@@ -610,7 +611,7 @@ void HandlerEffectShow::removeEffectShowsRelatedToAes(int idAes, bool retract)
|
||||
//-------------------------------------------------------------------------------
|
||||
void HandlerEffectShow::updateEffectShowsRelatedToMineArea(const AreaEffectSimulation::MineArea &data)
|
||||
{
|
||||
for (ObjectEffectShow *obj : qAsConst(m_effectShowObjMap))
|
||||
for (ObjectEffectShow *obj : std::as_const(m_effectShowObjMap))
|
||||
{
|
||||
if (obj->getIdAES() == data.id)
|
||||
{
|
||||
@@ -624,7 +625,7 @@ void HandlerEffectShow::updateEffectShowsRelatedToMineArea(const AreaEffectSimul
|
||||
//-------------------------------------------------------------------------------
|
||||
void HandlerEffectShow::updateEffectShowsRelatedToExplosionArea(const AreaEffectSimulation::ExplosionArea &data)
|
||||
{
|
||||
for (ObjectEffectShow *obj : qAsConst(m_effectShowObjMap))
|
||||
for (ObjectEffectShow *obj : std::as_const(m_effectShowObjMap))
|
||||
{
|
||||
if (obj->getIdAES() == data.id)
|
||||
{
|
||||
@@ -638,7 +639,7 @@ void HandlerEffectShow::updateEffectShowsRelatedToExplosionArea(const AreaEffect
|
||||
|
||||
void HandlerEffectShow::updateEffectShowsRelatedToExplosionCluster(const AreaEffectSimulation::ExplosionCluster &data)
|
||||
{
|
||||
for (ObjectEffectShow *obj : qAsConst(m_effectShowObjMap))
|
||||
for (ObjectEffectShow *obj : std::as_const(m_effectShowObjMap))
|
||||
{
|
||||
if (obj->getIdAES() == data.id)
|
||||
{
|
||||
@@ -652,7 +653,7 @@ void HandlerEffectShow::updateEffectShowsRelatedToExplosionCluster(const AreaEff
|
||||
|
||||
void HandlerEffectShow::updateEffectShowsRelatedToEffectCluster(const AreaEffectSimulation::EffectCluster &data)
|
||||
{
|
||||
for (ObjectEffectShow *obj : qAsConst(m_effectShowObjMap))
|
||||
for (ObjectEffectShow *obj : std::as_const(m_effectShowObjMap))
|
||||
{
|
||||
if (obj->getIdAES() == data.id)
|
||||
{
|
||||
@@ -726,7 +727,7 @@ void HandlerEffectShow::modifyEffectShows(const QVector<Database::EsmEffectShow>
|
||||
//-------------------------------------------------------------------------------
|
||||
void HandlerEffectShow::updateEffectShowOrdersRelatedToAes(int idAes)
|
||||
{
|
||||
for (ObjectEffectShow *obj : qAsConst(m_effectShowObjMap))
|
||||
for (ObjectEffectShow *obj : std::as_const(m_effectShowObjMap))
|
||||
{
|
||||
if (obj->getIdAES() == idAes)
|
||||
triggerEffectShowOrder(obj);
|
||||
@@ -735,7 +736,7 @@ void HandlerEffectShow::updateEffectShowOrdersRelatedToAes(int idAes)
|
||||
//-------------------------------------------------------------------------------
|
||||
void HandlerEffectShow::pauseEffectShowsRelatedToAes(int idAes)
|
||||
{
|
||||
for (ObjectEffectShow *obj : qAsConst(m_effectShowObjMap))
|
||||
for (ObjectEffectShow *obj : std::as_const(m_effectShowObjMap))
|
||||
{
|
||||
if (obj->getIdAES() == idAes)
|
||||
triggerEffectShowStop(obj);
|
||||
@@ -744,7 +745,7 @@ void HandlerEffectShow::pauseEffectShowsRelatedToAes(int idAes)
|
||||
//-------------------------------------------------------------------------------
|
||||
void HandlerEffectShow::continueEffectShowsRelatedToAes(int idAes)
|
||||
{
|
||||
for (ObjectEffectShow *obj : qAsConst(m_effectShowObjMap))
|
||||
for (ObjectEffectShow *obj : std::as_const(m_effectShowObjMap))
|
||||
{
|
||||
if (obj->getIdAES() == idAes)
|
||||
triggerEffectShowContinue(obj);
|
||||
@@ -891,7 +892,7 @@ void HandlerEffectShow::triggerMeteoData(const ObjectEffectShow *ifs)
|
||||
//-----------------------------------------------------------------------------
|
||||
void HandlerEffectShow::onSendMeteoData()
|
||||
{
|
||||
for (ObjectEffectShow *obj : qAsConst(m_effectShowObjMap))
|
||||
for (ObjectEffectShow *obj : std::as_const(m_effectShowObjMap))
|
||||
{
|
||||
const Database::EsmEffectShow &effectShow = obj->getData();
|
||||
if (effectShow.esmParticipantId == -1)
|
||||
@@ -909,7 +910,7 @@ void HandlerEffectShow::onCleanUp()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Start Cleanup ";
|
||||
QVector<ObjectEffectShow * > objects;
|
||||
for (ObjectEffectShow *obj : qAsConst(m_effectShowObjMap))
|
||||
for (ObjectEffectShow *obj : std::as_const(m_effectShowObjMap))
|
||||
{
|
||||
const Database::EsmEffectShow &effectShow = obj->getData();
|
||||
if (effectShow.orderConfirmation == static_cast<int>(OrderConfirmation_e::OrderCarriedOut) || effectShow.startTime <= 0 || effectShow.id <= 0)
|
||||
|
||||
+2
-1
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_mdm_data.h"
|
||||
#include <utility>
|
||||
#include "initialization.h"
|
||||
#include <LtsCoordTrans/lts_coord_trans.h>
|
||||
#include "settings.h"
|
||||
@@ -49,7 +50,7 @@ bool HandlerMdmData::getNearestWeather(const Core::GeoPosition2D &pos,
|
||||
double nearestDistanceSquared = std::numeric_limits<double>::max();
|
||||
|
||||
bool found = false;
|
||||
for (const auto &md : qAsConst(m_meteoData))
|
||||
for (const auto &md : std::as_const(m_meteoData))
|
||||
{
|
||||
if (md.isStaticMeteoData)
|
||||
continue;
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_san_nine_liner.h"
|
||||
#include <utility>
|
||||
#include "object_san_nine_liner.h"
|
||||
#include "object_san_category_line.h"
|
||||
#include "san_category_line_json.h"
|
||||
@@ -75,7 +76,7 @@ bool HandlerSanNineLiner::init()
|
||||
}
|
||||
|
||||
// publish
|
||||
for (ObjectSanNineLiner *objSan : qAsConst(m_mapObjectSanNineLiner))
|
||||
for (ObjectSanNineLiner *objSan : std::as_const(m_mapObjectSanNineLiner))
|
||||
objSan->onPublishData();
|
||||
|
||||
return true;
|
||||
@@ -142,7 +143,7 @@ void HandlerSanNineLiner::onSanNineLinerModifyRequest(const rti::core::SampleIde
|
||||
QVector<Database::SanCategoryLine> linesCategory = SanCategoryLine::fromJson(request.lines, data.id);
|
||||
INFO_LOG(m_logger) << "LinesCategory count: " << linesCategory.count();
|
||||
|
||||
for (Database::SanCategoryLine cl : qAsConst(linesCategory))
|
||||
for (Database::SanCategoryLine cl : std::as_const(linesCategory))
|
||||
{
|
||||
ObjectSanCategoryLine *ifsCl(new ObjectSanCategoryLine(m_ddsHandler, m_db));
|
||||
ret = ifsCl->createObject(cl);
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "object_criterium.h"
|
||||
#include <utility>
|
||||
#include "object_evaluation_element.h"
|
||||
|
||||
namespace Evaluations
|
||||
@@ -55,7 +56,7 @@ Core::FunctionReplyObject ObjectCriterium::removeObject()
|
||||
if (!m_db->removeEvlCriterium(m_data.id))
|
||||
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "EvlCriterium with id %1 can not be removed")).arg(m_data.id);
|
||||
|
||||
for (ObjectEvaluationElement *oee : qAsConst(m_elementsMap))
|
||||
for (ObjectEvaluationElement *oee : std::as_const(m_elementsMap))
|
||||
oee->removeObject();
|
||||
qDeleteAll(m_elementsMap);
|
||||
m_elementsMap.clear();
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "san_category_line_json.h"
|
||||
#include <utility>
|
||||
|
||||
#include <QJsonDocument>
|
||||
#include <QDebug>
|
||||
@@ -54,7 +55,7 @@ QVector<Database::SanCategoryLine> SanCategoryLine::fromJson(const std::string &
|
||||
QJsonDocument SanCategoryLine::toJson(std::vector<Database::SanCategoryLine> vecCategoryLines)
|
||||
{
|
||||
QJsonArray arr;
|
||||
for (const Database::SanCategoryLine &cl : qAsConst(vecCategoryLines))
|
||||
for (const Database::SanCategoryLine &cl : std::as_const(vecCategoryLines))
|
||||
{
|
||||
QJsonObject obj;
|
||||
obj[QStringLiteral("id")] = cl.id;
|
||||
|
||||
+3
-2
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "web_socket_handler.h"
|
||||
#include <utility>
|
||||
#include <QWebSocket>
|
||||
#include <iostream>
|
||||
|
||||
@@ -32,7 +33,7 @@ WebSocketHandler::WebSocketHandler(QObject *parent)
|
||||
|
||||
WebSocketHandler::~WebSocketHandler()
|
||||
{
|
||||
for (auto s : qAsConst(m_webSockets))
|
||||
for (auto s : std::as_const(m_webSockets))
|
||||
{
|
||||
s->disconnect(this);
|
||||
s->close();
|
||||
@@ -64,7 +65,7 @@ bool WebSocketHandler::sendTelegram(const QString &jsonStr)
|
||||
ERROR_LOG(m_logger) << "jsonStr" << jsonStr;
|
||||
|
||||
bool bOk = false;
|
||||
for (QWebSocket *ws : qAsConst(m_webSockets))
|
||||
for (QWebSocket *ws : std::as_const(m_webSockets))
|
||||
{
|
||||
if (ws->sendTextMessage(jsonStr))
|
||||
bOk = true;
|
||||
|
||||
+3
-1
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_dynamic_participant_data.h"
|
||||
#include <utility>
|
||||
#include <ExerciseEventManagement/eem_db.h>
|
||||
|
||||
#include <ParticipantManagement/ppm.hpp>
|
||||
@@ -177,6 +178,7 @@ void HandlerDynamicParticipantData::tryCreateHitEvent(Database::EemEvent eData,
|
||||
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_Initialization:
|
||||
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_MedicalTimeout:
|
||||
return;
|
||||
default: break;
|
||||
}
|
||||
|
||||
QJsonObject obj;
|
||||
@@ -528,7 +530,7 @@ void HandlerDynamicParticipantData::onBuildingStateChanged(const Buildings::Buil
|
||||
for (const auto &cs: data.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({{QStringLiteral("aesId") , cs.aesId},
|
||||
|
||||
+4
-3
@@ -8,6 +8,7 @@
|
||||
|
||||
|
||||
#include "web_socket_avs.h"
|
||||
#include <utility>
|
||||
#include "web_socket_server.h"
|
||||
#include "main_handler.h"
|
||||
#include "settings.h"
|
||||
@@ -388,7 +389,7 @@ void WebSocketAvs::openWebSocket()
|
||||
DEBUG_LOG(m_logger) << "openWebSocket";
|
||||
closeWebSocket();
|
||||
m_wsSocket = new QWebSocket;
|
||||
connect(m_wsSocket, QOverload<QAbstractSocket::SocketError>::of(&QWebSocket::error),
|
||||
connect(m_wsSocket, &QWebSocket::errorOccurred,
|
||||
this, &WebSocketAvs::onWebSocketError);
|
||||
connect(m_wsSocket, &QWebSocket::connected,
|
||||
this, &WebSocketAvs::onWebSocketConnected);
|
||||
@@ -564,7 +565,7 @@ void WebSocketAvs::onCleanUpDbInternal()
|
||||
|
||||
}
|
||||
|
||||
for (const AvsData &oldEntry : qAsConst(ntpRangeSortLocal))
|
||||
for (const AvsData &oldEntry : std::as_const(ntpRangeSortLocal))
|
||||
{
|
||||
const auto &item = collection.value(oldEntry.eventTime);
|
||||
|
||||
@@ -680,7 +681,7 @@ QMap<QString, QVector<AvsData>> WebSocketAvs::getAllInternalDbData()
|
||||
//qCritical() << "END select reading internal db ";
|
||||
DEBUG_LOG(m_logger) << "START Sync read local DB at " << QDateTime::fromMSecsSinceEpoch(m_lastUpdate).toString();
|
||||
int j = 0;
|
||||
for (const auto &dataI : qAsConst(dataVec))
|
||||
for (const auto &dataI : std::as_const(dataVec))
|
||||
{
|
||||
if (m_lastUpdate > 0 && dataI.sampleTime < m_lastUpdate)
|
||||
continue;
|
||||
|
||||
+4
-3
@@ -8,6 +8,7 @@
|
||||
|
||||
|
||||
#include "web_socket_server.h"
|
||||
#include <utility>
|
||||
|
||||
#include <QJsonArray>
|
||||
#include <QJsonDocument>
|
||||
@@ -34,7 +35,7 @@ WebSocketEventServer::WebSocketEventServer(const QSqlDatabase &db, QObject *pare
|
||||
|
||||
WebSocketEventServer::~WebSocketEventServer()
|
||||
{
|
||||
for (auto s : qAsConst(m_liveSockets))
|
||||
for (auto s : std::as_const(m_liveSockets))
|
||||
{
|
||||
s->disconnect(this);
|
||||
s->close();
|
||||
@@ -83,7 +84,7 @@ void WebSocketEventServer::sendEvent(const QJsonObject &obj)
|
||||
{
|
||||
const QJsonDocument doc(obj);
|
||||
const QString msg = QString::fromUtf8(doc.toJson(QJsonDocument::Compact));
|
||||
for (QWebSocket *ws : qAsConst(m_liveSockets))
|
||||
for (QWebSocket *ws : std::as_const(m_liveSockets))
|
||||
ws->sendTextMessage(msg);
|
||||
m_liveHistory[time(nullptr)].push_back(msg);
|
||||
}
|
||||
@@ -104,7 +105,7 @@ void WebSocketEventServer::onNewConnection()
|
||||
{
|
||||
connect(ws, &QWebSocket::disconnected,
|
||||
this, &WebSocketEventServer::onSocketDisconnected);
|
||||
for (const auto &historyVec : qAsConst(m_liveHistory))
|
||||
for (const auto &historyVec : std::as_const(m_liveHistory))
|
||||
{
|
||||
for (const auto &msg : historyVec)
|
||||
ws->sendTextMessage(msg);
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "exercise_state_machine.h"
|
||||
#include <utility>
|
||||
#include "exercise_state_manager.h"
|
||||
#include "exercise_state_base.h"
|
||||
|
||||
@@ -77,7 +78,7 @@ ExerciseStateMachine::ExerciseStateMachine(ObjectExercise* objExe, QObject *pare
|
||||
// ----------------------------------------------------------------------------------------------------------
|
||||
|
||||
//States zur StateMachine hinzufügen
|
||||
for (ExerciseStateBase *state : qAsConst(m_exerciseStates))
|
||||
for (ExerciseStateBase *state : std::as_const(m_exerciseStates))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Ex " << exerciseId() << ": state: " << state->exerciseState();
|
||||
m_stateMachine->addState(state);
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_exercise.h"
|
||||
#include <utility>
|
||||
#include "exm_db.h"
|
||||
#include "handler_exercise_phase.h"
|
||||
#include "main_handler.h"
|
||||
@@ -70,7 +71,7 @@ bool HandlerExercise::init()
|
||||
QVector<QPair<int, ExerciseState>> exerciseStates;
|
||||
exerciseStates.reserve(dataVec.size());
|
||||
// create exercise objects
|
||||
for (const Database::ExmExercise &data : qAsConst(dataVec))
|
||||
for (const Database::ExmExercise &data : std::as_const(dataVec))
|
||||
{
|
||||
ObjectExercise *ifs(new ObjectExercise(m_ddsHandler, m_db, m_exTblGen, this));
|
||||
Core::FunctionReplyObject ret = ifs->createObject(data);
|
||||
@@ -106,7 +107,7 @@ bool HandlerExercise::init()
|
||||
return a.first < b.first;
|
||||
});
|
||||
|
||||
for (const auto &p : qAsConst(exerciseStates))
|
||||
for (const auto &p : std::as_const(exerciseStates))
|
||||
m_exercisesToStart.enqueue(p.first);
|
||||
m_startupExerciseTimer->start();
|
||||
|
||||
@@ -211,7 +212,7 @@ Core::FunctionReplyObject HandlerExercise::exerciseCreateRequest(const ExerciseC
|
||||
|
||||
int iCnt = 0;
|
||||
QSet<int> linkedExerciseIds;
|
||||
for (const ObjectExercise *ex : qAsConst(m_exeObjMap))
|
||||
for (const ObjectExercise *ex : std::as_const(m_exeObjMap))
|
||||
{
|
||||
const auto state = ex->exerciseState();
|
||||
|
||||
@@ -313,7 +314,7 @@ Core::FunctionReplyObject HandlerExercise::exerciseModifyRequest(const ExerciseM
|
||||
int iCntRunningExercises = 0;
|
||||
QSet<int> linkedExerciseIds;
|
||||
|
||||
for (const ObjectExercise *ex : qAsConst(m_exeObjMap))
|
||||
for (const ObjectExercise *ex : std::as_const(m_exeObjMap))
|
||||
{
|
||||
const auto state = ex->exerciseState();
|
||||
|
||||
@@ -350,7 +351,7 @@ Core::FunctionReplyObject HandlerExercise::exerciseModifyRequest(const ExerciseM
|
||||
if (request.newState == ExerciseState::Stopped)
|
||||
{
|
||||
int iCnt = 0;
|
||||
for (const ObjectExercise *ex : qAsConst(m_exeObjMap))
|
||||
for (const ObjectExercise *ex : std::as_const(m_exeObjMap))
|
||||
{
|
||||
const auto state = ex->exerciseState();
|
||||
if (ex->id() != request.id && state == ExerciseState::Stopped)
|
||||
@@ -365,7 +366,7 @@ Core::FunctionReplyObject HandlerExercise::exerciseModifyRequest(const ExerciseM
|
||||
request.newState == ExerciseState::Paused))
|
||||
{
|
||||
int iCnt = 0;
|
||||
for (const ObjectExercise *ex : qAsConst(m_exeObjMap))
|
||||
for (const ObjectExercise *ex : std::as_const(m_exeObjMap))
|
||||
{
|
||||
if (ex->id() != request.id && ex->data().hasHlaInterface && (ex->exerciseState() == ExerciseState::Started ||
|
||||
ex->exerciseState() == ExerciseState::Paused))
|
||||
@@ -730,7 +731,7 @@ bool HandlerExercise::checkEquipmentNumbersOnAllExercises(int exerciseIdToBeStar
|
||||
(ifs->exerciseState() == ExerciseState::Paused))
|
||||
{
|
||||
const std::vector<ParticipantManagement::Equipment2ParticipantId> &mapping = equipmentExerciseMapping.mapping;
|
||||
for (const auto &eq2p : qAsConst(mapping))
|
||||
for (const auto &eq2p : std::as_const(mapping))
|
||||
if (eqNoForEx.contains(eq2p.equipmentNumber))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " !!! eq = " << eq2p.equipmentNumber << " is already used in exercise =" << exerciseId;
|
||||
@@ -811,7 +812,7 @@ QStringList HandlerExercise::doubleChannels(int exerciseAId, int exerciseBId) co
|
||||
|
||||
doubleChannelNames.reserve(exerciseAChannelIds.size());
|
||||
|
||||
for (int exerciseAChannelId : qAsConst(exerciseAChannelIds))
|
||||
for (int exerciseAChannelId : std::as_const(exerciseAChannelIds))
|
||||
{
|
||||
if (exerciseBChannelIds.contains(exerciseAChannelId))
|
||||
doubleChannelNames.append(QString::fromStdString(m_ddsHandler->avmDtc()->cnrChannel(exerciseAChannelId).name));
|
||||
|
||||
+5
-4
@@ -11,6 +11,7 @@
|
||||
*/
|
||||
|
||||
#include "flm_tests.h"
|
||||
#include <utility>
|
||||
|
||||
#include <nglapplication/nglcoreapplication.h>
|
||||
#include <LtsCommandLineParser/LtsCommandLineParser.h>
|
||||
@@ -690,7 +691,7 @@ void FlmTests::tryGetAllTemplates()
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "Found " << allTemplates.size() << " templates";
|
||||
for (const FileContent &fc : qAsConst(allTemplates))
|
||||
for (const FileContent &fc : std::as_const(allTemplates))
|
||||
DEBUG_LOG(m_logger) << "Found template (id, name) = (" << fc.id << ", " << fc.name << ")";
|
||||
|
||||
QTest::qWait(1000);
|
||||
@@ -710,7 +711,7 @@ void FlmTests::tryGetAllPlans()
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "Found " << allPlans.size() << " plans";
|
||||
for (const QString &plan : qAsConst(allPlans))
|
||||
for (const QString &plan : std::as_const(allPlans))
|
||||
DEBUG_LOG(m_logger) << "Found plan = " << plan;
|
||||
|
||||
QTest::qWait(1000);
|
||||
@@ -730,7 +731,7 @@ void FlmTests::tryGetAllFavs()
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "Found " << allFavs.size() << " favs";
|
||||
for (const QString &fav : qAsConst(allFavs))
|
||||
for (const QString &fav : std::as_const(allFavs))
|
||||
DEBUG_LOG(m_logger) << "Found fav = " << fav;
|
||||
|
||||
QTest::qWait(1000);
|
||||
@@ -750,7 +751,7 @@ void FlmTests::tryGetAllSymbols()
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "Found " << allSymbols.size() << " symbols";
|
||||
for (const QString &symbol : qAsConst(allSymbols))
|
||||
for (const QString &symbol : std::as_const(allSymbols))
|
||||
DEBUG_LOG(m_logger) << "Found symbol = " << symbol;
|
||||
|
||||
QTest::qWait(1000);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "thp_script_httq.h"
|
||||
#include <utility>
|
||||
#include "logger.h"
|
||||
|
||||
#include <httq/HttpRequest.h>
|
||||
@@ -162,7 +163,7 @@ ThpScriptServer::ThpScriptServer(QObject *parent)
|
||||
}
|
||||
|
||||
|
||||
connect(cli, QOverload<QAbstractSocket::SocketError>::of(&QWebSocket::error),
|
||||
connect(cli, &QWebSocket::errorOccurred,
|
||||
this, [cli]()
|
||||
{
|
||||
cli->deleteLater();
|
||||
@@ -348,7 +349,7 @@ void ThpScriptServer::changeList(const ThpServerInformation &tsi, httq::HttpRequ
|
||||
QVector<ThpServerInformation> tsiArray;
|
||||
tsiArray.reserve(arr.size() + 1);
|
||||
|
||||
for (const QJsonValue &val : qAsConst(arr))
|
||||
for (const QJsonValue &val : std::as_const(arr))
|
||||
{
|
||||
ThpServerInformation tsix(fromJson(val));
|
||||
if (tsix.scriptId == tsi.scriptId && tsix.exerciseId == tsi.exerciseId)
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_ied.h"
|
||||
#include <utility>
|
||||
#include "object_ied.h"
|
||||
#include "main_handler.h"
|
||||
#include "gim_db.h"
|
||||
@@ -75,7 +76,7 @@ bool HandlerIed::init()
|
||||
}
|
||||
|
||||
// create Ied objects
|
||||
for (const Database::GimIed &data : qAsConst(dataVec))
|
||||
for (const Database::GimIed &data : std::as_const(dataVec))
|
||||
{
|
||||
ObjectIed *ifs(new ObjectIed(m_ddsHandler, m_db, m_ppmDtc, this));
|
||||
Core::FunctionReplyObject ret = ifs->createObject(data);
|
||||
|
||||
+2
-1
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "ism_tests.h"
|
||||
#include <utility>
|
||||
|
||||
#include <nglapplication/nglcoreapplication.h>
|
||||
#include <LtsCommandLineParser/LtsCommandLineParser.h>
|
||||
@@ -1052,7 +1053,7 @@ void IsmTests::checkSchedule()
|
||||
else
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Instrumentation plan not complete !!!";
|
||||
for (const MountingPointPlan &mpp : qAsConst(diff))
|
||||
for (const MountingPointPlan &mpp : std::as_const(diff))
|
||||
ERROR_LOG(m_logger) << "Diff - # mpp.structureElementId() = " << mpp.structureElementId;
|
||||
}
|
||||
|
||||
|
||||
+4
-3
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_effect_area.h"
|
||||
#include <utility>
|
||||
#include "handler_main_structure_element.h"
|
||||
#include "handler_mounting_point_asset.h"
|
||||
#include "object_main_structure_element.h"
|
||||
@@ -41,7 +42,7 @@ HandlerEffectArea::~HandlerEffectArea()
|
||||
bool HandlerEffectArea::init()
|
||||
{
|
||||
const QHash<int, ObjectMainStructureElement *> &objMseMap = m_mainHandler->getHandlerMainStructureElement()->getMainStructureElementsMap();
|
||||
for (const auto &objMse : qAsConst(objMseMap))
|
||||
for (const auto &objMse : std::as_const(objMseMap))
|
||||
{
|
||||
ObjectEffectArea *effectAreaObj = createEffectAreaForMse(objMse->getData());
|
||||
if (effectAreaObj)
|
||||
@@ -51,7 +52,7 @@ bool HandlerEffectArea::init()
|
||||
if (m_logger.isDebugEnabled())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "number of EffectAreas: " << m_objectEffectAreaMap.size();
|
||||
for (const auto &EffectAreaObj : qAsConst(m_objectEffectAreaMap))
|
||||
for (const auto &EffectAreaObj : std::as_const(m_objectEffectAreaMap))
|
||||
DEBUG_LOG(m_logger) << "EffectArea ID: " << EffectAreaObj->getId()
|
||||
<< " | area EGCU ID: " << EffectAreaObj->getAreaEgcuId();
|
||||
}
|
||||
@@ -128,7 +129,7 @@ std::vector<int32_t> HandlerEffectArea::egcuIdsFromJsonObject(const QJsonObject
|
||||
|
||||
const QJsonArray &egcuMountPoints = jsonObj.value(QStringLiteral("egcuMountpoints")).toArray(); // qAsConst does not work with r-value
|
||||
DEBUG_LOG(m_logger) << "egcuMountPoints.size=" << egcuMountPoints.size();
|
||||
for (const auto &egcuMountPnt : qAsConst(egcuMountPoints))
|
||||
for (const auto &egcuMountPnt : std::as_const(egcuMountPoints))
|
||||
{
|
||||
QJsonObject element = egcuMountPnt.toObject();
|
||||
int mountingPointId = element.value(QStringLiteral("id")).toInt();
|
||||
|
||||
+7
-6
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_main_structure_element.h"
|
||||
#include <utility>
|
||||
#include "handler_mounting_point_asset.h"
|
||||
#include "handler_instrumentation_asset.h"
|
||||
#include "object_main_structure_element.h"
|
||||
@@ -66,7 +67,7 @@ bool HandlerMainStructureElement::init()
|
||||
std::sort(dataVecSE.begin(), dataVecSE.end(), sortSE);
|
||||
|
||||
// create MSE objects
|
||||
for (const Database::IsmMainStructureElement &dbData : qAsConst(dataVec))
|
||||
for (const Database::IsmMainStructureElement &dbData : std::as_const(dataVec))
|
||||
{
|
||||
ObjectMainStructureElement *ifs(new ObjectMainStructureElement(dbData, m_mainHandler));
|
||||
m_objectMainStructureElementMap.insert(ifs->getId(), ifs);
|
||||
@@ -74,7 +75,7 @@ bool HandlerMainStructureElement::init()
|
||||
DEBUG_LOG(m_logger) << "m_objectMainStructureElementMap.size() = " << m_objectMainStructureElementMap.size();
|
||||
|
||||
// create SE objects, add them to MSE
|
||||
for (const Database::IsmStructureElement &dbData : qAsConst(dataVecSE))
|
||||
for (const Database::IsmStructureElement &dbData : std::as_const(dataVecSE))
|
||||
{
|
||||
ObjectMainStructureElement *objMse = m_objectMainStructureElementMap.value(dbData.mainStructureElementId);
|
||||
if (!objMse || !objMse->isValid())
|
||||
@@ -93,7 +94,7 @@ bool HandlerMainStructureElement::init()
|
||||
}
|
||||
|
||||
// add structure elements to global map for lookup (e.g. in 'add Footprints to MSE objects')
|
||||
for (ObjectMainStructureElement *objMse : qAsConst(m_objectMainStructureElementMap))
|
||||
for (ObjectMainStructureElement *objMse : std::as_const(m_objectMainStructureElementMap))
|
||||
m_objectStructureElementMap.unite(objMse->getStructureElements());
|
||||
|
||||
// add Footprints to MSE objects
|
||||
@@ -111,7 +112,7 @@ bool HandlerMainStructureElement::init()
|
||||
}
|
||||
}
|
||||
|
||||
for (const QMap<int, Database::IsmStructureElementFootprint> &cont : qAsConst(footprintSorted))
|
||||
for (const QMap<int, Database::IsmStructureElementFootprint> &cont : std::as_const(footprintSorted))
|
||||
{
|
||||
if (cont.empty())
|
||||
continue;
|
||||
@@ -581,7 +582,7 @@ void HandlerMainStructureElement::onExerciseStateChanged(const ExerciseManagemen
|
||||
if (data.state != ExerciseManagement::ExerciseState::Terminated)
|
||||
return;
|
||||
|
||||
for (auto mseObj : qAsConst(m_objectMainStructureElementMap))
|
||||
for (auto mseObj : std::as_const(m_objectMainStructureElementMap))
|
||||
{
|
||||
const MainStructureElement &mse = mseObj->getData();
|
||||
QJsonObject obj = QJsonDocument::fromJson(QByteArray::fromStdString(mse.properties)).object();
|
||||
@@ -601,7 +602,7 @@ void HandlerMainStructureElement::onExerciseStateChanged(const ExerciseManagemen
|
||||
modReq.modelId = mse.modelId;
|
||||
modReq.name = mse.name;
|
||||
std::vector<InfrastructureManagement::StructureElement> resElements;
|
||||
for (auto element : qAsConst(mse.elements))
|
||||
for (auto element : std::as_const(mse.elements))
|
||||
{
|
||||
QJsonDocument doc = QJsonDocument::fromJson(QByteArray::fromStdString(element.properties));
|
||||
QJsonObject objEle = doc.object();
|
||||
|
||||
+8
-7
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "ism_dtc_impl_custom.h"
|
||||
#include <utility>
|
||||
#include "ism_dtc_impl_custom_p.h"
|
||||
|
||||
#include <DDS/DTC/generic_dtc.h>
|
||||
@@ -818,7 +819,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 : qAsConst(mfElements))
|
||||
// for (const InfrastructureManagement::FootprintElement &element : std::as_const(mfElements))
|
||||
// {
|
||||
// // maybe this is easier?
|
||||
// // // if different, continue
|
||||
@@ -839,7 +840,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 : qAsConst(mfElements))
|
||||
// for (const InfrastructureManagement::FootprintElement &element : std::as_const(mfElements))
|
||||
// {
|
||||
// const auto &relPos = element.relPosition();
|
||||
// poly.push_back(QPointF(relPos.offsetX(), relPos.offsetY()));
|
||||
@@ -857,7 +858,7 @@ QPolygonF DtcImplCustom::getUtmFootprintById(int mseId, int &zoneOut, bool isGro
|
||||
|
||||
// QPolygonF retPolyUtm;
|
||||
// retPolyUtm.reserve(poly.size());
|
||||
// for (const QPointF &point : qAsConst(poly))
|
||||
// for (const QPointF &point : std::as_const(poly))
|
||||
// {
|
||||
// const QPointF finalUtmPoint(utmFpPosition + point);
|
||||
// retPolyUtm.push_back(finalUtmPoint);
|
||||
@@ -883,7 +884,7 @@ QVector <int> DtcImplCustom::getBuildingByPolygon(int exerciseId, const QPolygon
|
||||
|
||||
// Convert Form to UTM
|
||||
int zone = -1;
|
||||
for (const QPointF &point : qAsConst(polygon))
|
||||
for (const QPointF &point : std::as_const(polygon))
|
||||
{
|
||||
auto utm = LtsCoordTrans::UtmCoordinate::fromGeographic(point, zone);
|
||||
DEBUG_LOG(m_logger) << "geo=" << point.x() << "/" << point.y()
|
||||
@@ -912,7 +913,7 @@ QVector <int> DtcImplCustom::getBuildingByPolygon(int exerciseId, const QPolygon
|
||||
if (completeEnclosed)
|
||||
{
|
||||
const QPolygonF &footprintPolygonRef = footprintPolygon.value();
|
||||
for (const QPointF &fpPoint : qAsConst(footprintPolygonRef))
|
||||
for (const QPointF &fpPoint : std::as_const(footprintPolygonRef))
|
||||
{
|
||||
if (!polygonUtm.containsPoint(fpPoint, Qt::OddEvenFill))
|
||||
{
|
||||
@@ -949,7 +950,7 @@ int DtcImplCustom::getSurroundingBuildingByPolygon(int exerciseId, const QPolygo
|
||||
|
||||
// Convert Form to UTM
|
||||
int zone = -1;
|
||||
for (const QPointF &point : qAsConst(polygon))
|
||||
for (const QPointF &point : std::as_const(polygon))
|
||||
{
|
||||
auto utm = LtsCoordTrans::UtmCoordinate::fromGeographic(point, zone);
|
||||
DEBUG_LOG(m_logger) << "geo=" << point.x() << "/" << point.y()
|
||||
@@ -976,7 +977,7 @@ int DtcImplCustom::getSurroundingBuildingByPolygon(int exerciseId, const QPolygo
|
||||
DEBUG_LOG(m_logger) << "getBuildingByPolygon Append Building id=" << footprintPolygon.key();
|
||||
if (completeEnclosed)
|
||||
{
|
||||
for (const QPointF &fpPoint : qAsConst(polygonUtm))
|
||||
for (const QPointF &fpPoint : std::as_const(polygonUtm))
|
||||
{
|
||||
if (!footprintPolygon.value().containsPoint(fpPoint, Qt::OddEvenFill))
|
||||
{
|
||||
|
||||
Loaded 100 of 316 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user