Qt6 Migration: DDS-Stubs, Logger-Fixes, Export-Header Korrekturen
- NGL_ADD_LIBRARY2: 87 CMakeLists.txt konvertiert für Export-Header Generierung - 44 Export-Header Include-Pfade korrigiert (_export.h) - 81 DDS-Stub-Header generiert (*_dtc.h, *_fts.h, *_dts.h, *_ftc.h) - INGLLogger: Duplikat gelöscht, m_logger Member entfernt, variadische Makros - Q_FUNC_INFO Redefinition behoben (Qt6 definiert bereits) - FATAL_LOG Makro hinzugefügt - InfrastructureManagement DDS-Stubs (ism.hpp, ism_enums.hpp, ism_ftc.h) - FilterManagement DDS-Stubs (flt_ftc.h, flt_dts.h) - AreaEffectSimulation DDS-Stubs (aes.hpp, aes_enums.hpp) - SymbolAppearance Klasse vollständig definiert mit content() Methode - BuildingComponentFilter Klasse definiert mit Copy-Konstruktor - Ftc Factory: nullptr Return (abstract class) - AesFilter Klasse in aes.hpp hinzugefügt - Dtc Klasse in ppm.hpp mit participantChanged Signal - AesType Enum: alle 15 At* Werte definiert - AesEffectState_def: EsReceived hinzugefügt - DataModification Enum: eAdded/eModified/eRemoved - function_reply_object.h → core_types.h Include-Pfad (72 Dateien) - Enum-Class-Streaming Template-Operator in INGLLogger.h - ism_mounting_point.h: QImage → QtGui/QImage, QGuiApplication/QScreen - ism_data_plugin_interface.h: QSet Include, Include-Reihenfolge - QRegExp → QRegularExpression in tpm_js_parser.cpp - .underlying() Aufrufe zu direktem Enum-Vergleich korrigiert - Include-Pfade: aes.hpp in symbol_appearance_settings_impl.h und aes_display_filter_impl.h Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2785 files changed
+18754
-18316
No files matched your search
+43
-44
@@ -34,7 +34,6 @@ using namespace InfrastructureManagement;
|
||||
// ------------------------------------------------------------------------------
|
||||
IsmImportBuildings::IsmImportBuildings(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_logger(getLogger("ImportXml"))
|
||||
{
|
||||
qRegisterMetaType<Core::FunctionReply>("Core::FunctionReply");
|
||||
connect(this, &IsmImportBuildings::importDone, this, &IsmImportBuildings::importNext);
|
||||
@@ -43,7 +42,7 @@ IsmImportBuildings::IsmImportBuildings(QObject *parent)
|
||||
// ------------------------------------------------------------------------------
|
||||
bool IsmImportBuildings::init(int domainId, const QUrl &tcpDiscoveryUrl)
|
||||
{
|
||||
INFO_LOG(m_logger) << "init begin";
|
||||
INFO_LOG() << "init begin";
|
||||
|
||||
// initialize DDS, always on exercise 0
|
||||
m_ddsConnector.reset(new DDSConnector::DdsConnector(domainId, IDL::PartitionType::Global, 0, 0, tcpDiscoveryUrl));
|
||||
@@ -51,13 +50,13 @@ bool IsmImportBuildings::init(int domainId, const QUrl &tcpDiscoveryUrl)
|
||||
return false;
|
||||
m_ddsConnector->initPublisherSubscriber();
|
||||
|
||||
DEBUG_LOG(m_logger) << "create dtc";
|
||||
DEBUG_LOG() << "create dtc";
|
||||
m_dtc = InfrastructureManagement::Interface::Dtc::create(m_ddsConnector);
|
||||
|
||||
DEBUG_LOG(m_logger) << "create ftc";
|
||||
DEBUG_LOG() << "create ftc";
|
||||
m_ftc = InfrastructureManagement::Interface::Ftc::create(m_ddsConnector);
|
||||
|
||||
DEBUG_LOG(m_logger) << "init dtc & ftc";
|
||||
DEBUG_LOG() << "init dtc & ftc";
|
||||
bool bRet = m_ftc->enableMainStructureElementModify() &&
|
||||
m_ftc->enableMainStructureElementRemove() &&
|
||||
m_ftc->enableMountingPointAssetRemove() &&
|
||||
@@ -69,9 +68,9 @@ bool IsmImportBuildings::init(int domainId, const QUrl &tcpDiscoveryUrl)
|
||||
m_dtc->enableMountingPointAsset() &&
|
||||
m_dtc->enableMainSchedule();
|
||||
|
||||
DEBUG_LOG(m_logger) << "init dtc, ftc end - bRet = " << bRet;
|
||||
DEBUG_LOG() << "init dtc, ftc end - bRet = " << bRet;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Domain Id = " << domainId;
|
||||
DEBUG_LOG() << "Domain Id = " << domainId;
|
||||
|
||||
return bRet;
|
||||
}
|
||||
@@ -92,7 +91,7 @@ void IsmImportBuildings::import(const QVector<ImportData> &importData)
|
||||
QCoreApplication::quit();
|
||||
return;
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "Trying to import " << m_importData.size() << " buildings";
|
||||
DEBUG_LOG() << "Trying to import " << m_importData.size() << " buildings";
|
||||
m_curImportIdx = 0;
|
||||
import(m_importData.at(m_curImportIdx));
|
||||
}
|
||||
@@ -147,11 +146,11 @@ void IsmImportBuildings::remove(int buildingId)
|
||||
QMap<int, QVector<InfrastructureManagement::InstrumentationAsset>> assetsMapBuilding;
|
||||
m_dtc->getAllAssetsPerBuilding(predicate, assetsMapBuilding);
|
||||
|
||||
DEBUG_LOG(m_logger) << "assetsMapBuilding.size = " << assetsMapBuilding.size();
|
||||
DEBUG_LOG() << "assetsMapBuilding.size = " << assetsMapBuilding.size();
|
||||
|
||||
assetsMounted = (assetsMapBuilding[buildingId].size() > 0);
|
||||
|
||||
DEBUG_LOG(m_logger) << "Building id = " << buildingId << " has assets mounted = " << assetsMounted;
|
||||
DEBUG_LOG() << "Building id = " << buildingId << " has assets mounted = " << assetsMounted;
|
||||
|
||||
// cfroebel 2018-11-30:
|
||||
// Currently the ISM service fails to correctly remove a building when it has mounted assets (other than BCU).
|
||||
@@ -160,7 +159,7 @@ void IsmImportBuildings::remove(int buildingId)
|
||||
if (assetsMounted)
|
||||
{
|
||||
QString msg = QStringLiteral("Not possible to remove building with id %1 because there are assets mounted!").arg(buildingId);
|
||||
ERROR_LOG(m_logger) << msg;
|
||||
ERROR_LOG() << msg;
|
||||
std::cerr << msg << std::endl;
|
||||
m_idsToBeRemoved.pop_front();
|
||||
IsmImportBuildings::removeNext();
|
||||
@@ -172,7 +171,7 @@ void IsmImportBuildings::remove(int buildingId)
|
||||
// ------------------------------------------------------------------------------
|
||||
void IsmImportBuildings::doImport()
|
||||
{
|
||||
INFO_LOG(m_logger) << "trying to Import / Modify";
|
||||
INFO_LOG() << "trying to Import / Modify";
|
||||
ParseBuildingXml buildingXml(m_currentData.xmlFileName,
|
||||
m_currentData.vulFileName,
|
||||
m_currentData.egcuToRoomFileName,
|
||||
@@ -181,21 +180,21 @@ void IsmImportBuildings::doImport()
|
||||
m_currentData.angleDegree);
|
||||
if (!buildingXml.parseXml())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Can not parse building files: " << buildingXml.lastError();
|
||||
ERROR_LOG() << "Can not parse building files: " << buildingXml.lastError();
|
||||
std::cerr << "Can not parse building files name: " << m_currentData.xmlFileName
|
||||
<< " error: " << buildingXml.lastError() << std::endl;
|
||||
QCoreApplication::exit(1);
|
||||
return;
|
||||
}
|
||||
INFO_LOG(m_logger) << "Sending request";
|
||||
INFO_LOG() << "Sending request";
|
||||
|
||||
MainStructureElementModifyRequest req = buildingXml.parsedRequest();
|
||||
QByteArray propertiesBa = QByteArray::fromStdString(req.properties());
|
||||
QJsonParseError parserError;
|
||||
const QJsonDocument doc(QJsonDocument::fromJson(propertiesBa, &parserError));
|
||||
if (parserError.error != QJsonParseError::NoError)
|
||||
WARNING_LOG(m_logger) << "Error parsing json document: " << parserError.errorString() << " '" << propertiesBa << "'";
|
||||
DEBUG_LOG(m_logger) << "json to parse: " << doc.toJson();
|
||||
WARNING_LOG() << "Error parsing json document: " << parserError.errorString() << " '" << propertiesBa << "'";
|
||||
DEBUG_LOG() << "json to parse: " << doc.toJson();
|
||||
QJsonObject obj(doc.object());
|
||||
if (m_currentData.exerciseId > 0)
|
||||
{
|
||||
@@ -221,11 +220,11 @@ void IsmImportBuildings::doImport()
|
||||
{
|
||||
m_isInRestoringMode = true;
|
||||
msg = "Building " + req.name() + " already exists. All related data is now saved.";
|
||||
INFO_LOG(m_logger) << msg;
|
||||
INFO_LOG() << msg;
|
||||
std::cerr << msg << std::endl;
|
||||
|
||||
msg = "Fetching IDs of MountingPints.";
|
||||
INFO_LOG(m_logger) << msg;
|
||||
INFO_LOG() << msg;
|
||||
std::cerr << msg << std::endl;
|
||||
QVector<qint32> mountingPointIds;
|
||||
for (const StructureElement &structureElement : oldMainStructureElement.elements())
|
||||
@@ -236,7 +235,7 @@ void IsmImportBuildings::doImport()
|
||||
}
|
||||
|
||||
msg = "Fetching MountingPointAssets.";
|
||||
INFO_LOG(m_logger) << msg;
|
||||
INFO_LOG() << msg;
|
||||
std::cerr << msg << std::endl;
|
||||
// get mountings of mounting points of this building
|
||||
mountings = mountingsOfStructureElements(mountingPointIds);
|
||||
@@ -245,7 +244,7 @@ void IsmImportBuildings::doImport()
|
||||
if (!mountings.isEmpty())
|
||||
{
|
||||
msg = "Removing MountingPointAssets.";
|
||||
INFO_LOG(m_logger) << msg;
|
||||
INFO_LOG() << msg;
|
||||
std::cerr << msg << std::endl;
|
||||
unmountAssetsOfBuliding(oldMainStructureElement.id());
|
||||
// // remove mounting point assets
|
||||
@@ -257,7 +256,7 @@ void IsmImportBuildings::doImport()
|
||||
}
|
||||
|
||||
msg = "Fetching MountingPointPlans.";
|
||||
INFO_LOG(m_logger) << msg;
|
||||
INFO_LOG() << msg;
|
||||
std::cerr << msg << std::endl;
|
||||
// get mounting points in plans of this building
|
||||
auto mppsBySchedule = MountingPointPlanByScheduleOfStructureElements(mountingPointIds);
|
||||
@@ -265,14 +264,14 @@ void IsmImportBuildings::doImport()
|
||||
// Don't know, why these are deleted anyways...
|
||||
for (auto it = mppsBySchedule.cbegin(); it != mppsBySchedule.cend(); ++it)
|
||||
{
|
||||
INFO_LOG(m_logger) << "Removing MountingPointPlans.";
|
||||
INFO_LOG() << "Removing MountingPointPlans.";
|
||||
auto copy = it.value();
|
||||
for (auto &elem : copy)
|
||||
elem.mountingPointState() = MountingPointState_def::Idle;
|
||||
m_ftc->mountingPointPlanModifyRequest(MountingPointPlanModifyRequest(it.key(),copy), this);
|
||||
}
|
||||
msg = "Fetching paths of MountingPoints by name ... for later reconstruction.";
|
||||
INFO_LOG(m_logger) << msg;
|
||||
INFO_LOG() << msg;
|
||||
std::cerr << msg << std::endl;
|
||||
for (const StructureElement &structureElement : oldMainStructureElement.elements())
|
||||
oldNamePaths.insert(structureElement.id(), pathWithNames(structureElement, oldMainStructureElement));
|
||||
@@ -301,11 +300,11 @@ void IsmImportBuildings::doImport()
|
||||
void IsmImportBuildings::doRemove(int buildingId)
|
||||
{
|
||||
std::string msg = "Trying to Remove building with id " + QString::number(buildingId).toStdString();
|
||||
INFO_LOG(m_logger) << msg;
|
||||
INFO_LOG() << msg;
|
||||
std::cerr << msg << std::endl;
|
||||
if (!m_ftc->mainStructureElementRemoveRequest(MainStructureElementRemoveRequest(buildingId), this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting remove";
|
||||
ERROR_LOG() << "Error requesting remove";
|
||||
std::cerr << "Error requesting remove" << std::endl;
|
||||
QCoreApplication::exit(1);
|
||||
return;
|
||||
@@ -403,19 +402,19 @@ StructureElement IsmImportBuildings::structureElementById(qint32 id, const MainS
|
||||
void IsmImportBuildings::createNewMainStructureElement(const MainStructureElementModifyRequest &request)
|
||||
{
|
||||
std::string msg = "Creating new MainStructureElement.";
|
||||
INFO_LOG(m_logger) << msg;
|
||||
INFO_LOG() << msg;
|
||||
std::cerr << msg << std::endl;
|
||||
if (!m_ftc->mainStructureElementModifyRequest(request, this))
|
||||
{
|
||||
if (m_currentData.buildingId > 0)
|
||||
ERROR_LOG(m_logger) << "Error requesting update";
|
||||
ERROR_LOG() << "Error requesting update";
|
||||
else
|
||||
ERROR_LOG(m_logger) << "Error requesting create";
|
||||
ERROR_LOG() << "Error requesting create";
|
||||
std::cerr << "Error requesting update/create" << std::endl;
|
||||
QCoreApplication::exit(1);
|
||||
return;
|
||||
}
|
||||
INFO_LOG(m_logger) << "Waiting for answer";
|
||||
INFO_LOG() << "Waiting for answer";
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
@@ -443,12 +442,12 @@ void IsmImportBuildings::restoreData(const MainStructureElement &oldMainStructur
|
||||
newMountingPointIds.append(structureElement.id());
|
||||
}
|
||||
QMap<qint32, QVector<std::string> > newNamePaths;
|
||||
INFO_LOG(m_logger) << "Restoring mounting point data.";
|
||||
INFO_LOG() << "Restoring mounting point data.";
|
||||
for (const StructureElement &structureElement : newMainStructureElement.elements())
|
||||
newNamePaths.insert(structureElement.id(), pathWithNames(structureElement, oldMainStructureElement));
|
||||
|
||||
if (oldNamePaths.size() != newNamePaths.size())
|
||||
INFO_LOG(m_logger) << "old name path size: " + QString::number(oldNamePaths.size()).toStdString() + " , new name path size: " + QString::number(newNamePaths.size()).toStdString();;
|
||||
INFO_LOG() << "old name path size: " + QString::number(oldNamePaths.size()).toStdString() + " , new name path size: " + QString::number(newNamePaths.size()).toStdString();;
|
||||
|
||||
QMap<qint32, qint32> oldStructureElementIdToNewStructureElementId;
|
||||
for (auto it = oldNamePaths.constBegin(); it != oldNamePaths.constEnd(); ++it)
|
||||
@@ -485,7 +484,7 @@ void IsmImportBuildings::restoreData(const MainStructureElement &oldMainStructur
|
||||
if (!mountings.isEmpty())
|
||||
{
|
||||
msg = "Restoring MountingPointAssets.";
|
||||
INFO_LOG(m_logger) << msg;
|
||||
INFO_LOG() << msg;
|
||||
std::cerr << msg << std::endl;
|
||||
// restore mountings
|
||||
for (const MountingPointAsset &mountingPointAsset : mountings)
|
||||
@@ -509,7 +508,7 @@ void IsmImportBuildings::restoreData(const MainStructureElement &oldMainStructur
|
||||
return;
|
||||
|
||||
msg = "Restoring MountingPointPlans.";
|
||||
INFO_LOG(m_logger) << msg;
|
||||
INFO_LOG() << msg;
|
||||
std::cerr << msg << std::endl;
|
||||
// restore mounting point plans
|
||||
MountingPointPlanModifyRequest createRequest;
|
||||
@@ -547,7 +546,7 @@ void IsmImportBuildings::unmountAssetsOfBuliding(qint32 buildingId)
|
||||
{
|
||||
msg = "Waiting for socket to open";
|
||||
std::cerr << msg << std::endl;
|
||||
INFO_LOG(m_logger) << msg;
|
||||
INFO_LOG() << msg;
|
||||
QThread::sleep(1);
|
||||
}
|
||||
|
||||
@@ -564,7 +563,7 @@ void IsmImportBuildings::unmountAssetsOfBuliding(qint32 buildingId)
|
||||
{
|
||||
std::string msg = "Got reply: " + message.toStdString();
|
||||
std::cerr << msg << std::endl;
|
||||
INFO_LOG(m_logger) << msg;
|
||||
INFO_LOG() << msg;
|
||||
hasAnswer = true;
|
||||
});
|
||||
|
||||
@@ -574,7 +573,7 @@ void IsmImportBuildings::unmountAssetsOfBuliding(qint32 buildingId)
|
||||
{
|
||||
msg = "Waiting for socket to answer";
|
||||
std::cerr << msg << std::endl;
|
||||
INFO_LOG(m_logger) << msg;
|
||||
INFO_LOG() << msg;
|
||||
QThread::sleep(1);
|
||||
}
|
||||
|
||||
@@ -598,13 +597,13 @@ void IsmImportBuildings::onMainStructureElementRemoveReply(const Core::FunctionR
|
||||
if (replyObject.error())
|
||||
{
|
||||
QString msg = QStringLiteral("Failed to remove building with id %1: %2").arg(buildingId).arg(QString::fromStdString(replyObject()));
|
||||
ERROR_LOG(m_logger) << msg;
|
||||
ERROR_LOG() << msg;
|
||||
std::cerr << msg << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
QString msg = QStringLiteral("Removed building with id %1").arg(buildingId);
|
||||
INFO_LOG(m_logger) << msg;
|
||||
INFO_LOG() << msg;
|
||||
std::cerr << msg << std::endl;
|
||||
}
|
||||
|
||||
@@ -619,7 +618,7 @@ void IsmImportBuildings::onMountingPointPlanModifyReply(const Core::FunctionRepl
|
||||
{
|
||||
if (reply.error())
|
||||
{
|
||||
ERROR_LOG(m_logger) << reply.error();
|
||||
ERROR_LOG() << reply.error();
|
||||
std::cerr << reply.error() << std::endl;
|
||||
}
|
||||
}
|
||||
@@ -627,10 +626,10 @@ void IsmImportBuildings::onMountingPointPlanModifyReply(const Core::FunctionRepl
|
||||
// ------------------------------------------------------------------
|
||||
void IsmImportBuildings::onMountingPointAssetRemoveReply(const Core::FunctionReplyObject &reply)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "REMOVE REPLY";
|
||||
ERROR_LOG() << "REMOVE REPLY";
|
||||
if (reply.error())
|
||||
{
|
||||
ERROR_LOG(m_logger) << reply.error();
|
||||
ERROR_LOG() << reply.error();
|
||||
std::cerr << reply.error() << std::endl;
|
||||
}
|
||||
}
|
||||
@@ -640,7 +639,7 @@ void IsmImportBuildings::onMountingPointAssetModifyReply(const Core::FunctionRep
|
||||
{
|
||||
if (reply.error())
|
||||
{
|
||||
ERROR_LOG(m_logger) << reply.error();
|
||||
ERROR_LOG() << reply.error();
|
||||
std::cerr << reply.error() << std::endl;
|
||||
}
|
||||
}
|
||||
@@ -650,7 +649,7 @@ void IsmImportBuildings::onStructureElementModifyReply(const Core::FunctionReply
|
||||
{
|
||||
if (reply.error())
|
||||
{
|
||||
ERROR_LOG(m_logger) << reply.error();
|
||||
ERROR_LOG() << reply.error();
|
||||
std::cerr << reply.error() << std::endl;
|
||||
}
|
||||
}
|
||||
@@ -660,7 +659,7 @@ bool IsmImportBuildings::handleReply(const Core::FunctionReplyObject &replyObjec
|
||||
{
|
||||
if (replyObject.error())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Got Reply error: " << replyObject.translated();
|
||||
ERROR_LOG() << "Got Reply error: " << replyObject.translated();
|
||||
std::cerr << "Error importing building" << std::endl;
|
||||
QCoreApplication::exit(1);
|
||||
return false;
|
||||
|
||||
Reference in new issue
Block a user