fix Warning
This commit is contained in:
1 parent
593c221d23
commit
8345470273
316 files changed
+1246
-929
No files matched your search
+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))
|
||||
{
|
||||
|
||||
+4
-3
@@ -9,6 +9,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "ism_dtc_impl_custom.h"
|
||||
#include <utility>
|
||||
#include <LtsCoordinate/lts_coord_vector.h>
|
||||
|
||||
#include <QtCore/QHash>
|
||||
@@ -66,7 +67,7 @@ public:
|
||||
const std::vector<InfrastructureManagement::FootprintElement> &mfElements = mf.elements;
|
||||
QPolygonF poly;
|
||||
poly.reserve(mfElements.size());
|
||||
for (const InfrastructureManagement::FootprintElement &element : qAsConst(mfElements))
|
||||
for (const InfrastructureManagement::FootprintElement &element : std::as_const(mfElements))
|
||||
{
|
||||
// if different, continue
|
||||
if (isGroundLevel != element.isGroundLevel)
|
||||
@@ -78,7 +79,7 @@ public:
|
||||
// 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));
|
||||
@@ -99,7 +100,7 @@ public:
|
||||
|
||||
// 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);
|
||||
|
||||
+3
-2
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "object_main_structure_element.h"
|
||||
#include <utility>
|
||||
#include "handler_main_structure_element.h"
|
||||
#include "object_structure_element.h"
|
||||
#include "main_handler.h"
|
||||
@@ -439,7 +440,7 @@ Core::FunctionReplyObject ObjectMainStructureElement::updateObject(const MainStr
|
||||
m_mainHandler->getHandlerMainStructureElement()->removedStructureElements(oldStructureElements);
|
||||
m_mainHandler->getHandlerMainStructureElement()->addedStructureElements(m_objectStructureElements);
|
||||
QMap<int, ObjectStructureElement*> newObjectStructureElements;
|
||||
for (ObjectStructureElement *ose : qAsConst(m_objectStructureElements))
|
||||
for (ObjectStructureElement *ose : std::as_const(m_objectStructureElements))
|
||||
{
|
||||
// only delete the old ones
|
||||
// and also not the one for the mse and bcu
|
||||
@@ -488,7 +489,7 @@ Core::FunctionReplyObject ObjectMainStructureElement::removeObject()
|
||||
dts()->removeMainStructureElementByKey(m_data.id);
|
||||
dts()->removeMainFootprintByKey(m_footprint.id);
|
||||
|
||||
for (ObjectStructureElement *ose : qAsConst(m_objectStructureElements))
|
||||
for (ObjectStructureElement *ose : std::as_const(m_objectStructureElements))
|
||||
{
|
||||
ose->removeObject();
|
||||
delete ose;
|
||||
|
||||
+2
-1
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "object_special_area.h"
|
||||
#include <utility>
|
||||
|
||||
#include <QJsonDocument>
|
||||
#include <QtGui/QPolygonF>
|
||||
@@ -89,7 +90,7 @@ SpecialArea ObjectSpecialArea::toDdsData(const Database::IsmSpecialArea &dbData)
|
||||
|
||||
QPolygonF tmp;
|
||||
tmp.reserve(ddsData.polygon.size());
|
||||
for (const Core::GeoPosition2D &pos : qAsConst(ddsData.polygon))
|
||||
for (const Core::GeoPosition2D &pos : std::as_const(ddsData.polygon))
|
||||
tmp.push_back(QPointF(pos.lon, pos.lat));
|
||||
|
||||
QRectF boundingBox = tmp.boundingRect();
|
||||
|
||||
+3
-4
@@ -332,10 +332,9 @@ QDomDocument ParseBuildingXml::openXml(const QString &fileName) const
|
||||
|
||||
// read Xml file
|
||||
QDomDocument metaDoc;
|
||||
int errLine = 0, errColumn = 0;
|
||||
QString err;
|
||||
if (!metaDoc.setContent(&f, &err, &errLine, &errColumn))
|
||||
throw XmlImportException(tr("Error parsing file content: %1 at %2.%3").arg(err).arg(errLine).arg(errColumn));
|
||||
const auto parseResult = metaDoc.setContent(&f);
|
||||
if (!parseResult)
|
||||
throw XmlImportException(tr("Error parsing file content: %1 at %2.%3").arg(parseResult.errorMessage).arg(int(parseResult.errorLine)).arg(int(parseResult.errorColumn)));
|
||||
|
||||
// close metaFile
|
||||
f.close();
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "schedule_status_state_machine.h"
|
||||
#include <utility>
|
||||
#include "schedule_status_manager.h"
|
||||
#include "schedule_status_base.h"
|
||||
|
||||
@@ -74,7 +75,7 @@ ScheduleStatusMachine::ScheduleStatusMachine(ObjectMainSchedule* objSchedule, QO
|
||||
// ----------------------------------------------------------------------------------------------------------
|
||||
|
||||
//States zur StateMachine hinzufügen
|
||||
for (ScheduleStatusBase *state : qAsConst(m_ScheduleStatuses))
|
||||
for (ScheduleStatusBase *state : std::as_const(m_ScheduleStatuses))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Schedule " << scheduleId() << ": state: " << state->scheduleStatus();
|
||||
m_stateMachine->addState(state);
|
||||
|
||||
Reference in new issue
Block a user