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
@@ -33,7 +33,7 @@ RTIDDSGEN(SRCS_common rec_enums.idl)
|
||||
# Generate rec_dt[s,c]_types.h, rec_ft[s,c]_types.h
|
||||
CODEGEN_TOPIC_TYPEDEFS(SRCS_common ${xml_FILE})
|
||||
|
||||
NGL_ADD_LIBRARY(AAR SV WS svcRecCommon SHARED ${SRCS_common})
|
||||
NGL_ADD_LIBRARY2(AAR SV WS svcRecCommon SHARED ${SRCS_common})
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(svcRecCommon
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
@@ -60,7 +60,7 @@ NGL_INSTALL_TARGET(svcRecCommon)
|
||||
# rec_export.h
|
||||
#)
|
||||
|
||||
#NGL_ADD_LIBRARY(AAR SV svcRecServer SHARED ${SRCS_server})
|
||||
#NGL_ADD_LIBRARY2(AAR SV svcRecServer SHARED ${SRCS_server})
|
||||
#NGL_TARGET_INCLUDE_DIRECTORIES(svcRecServer
|
||||
# PUBLIC
|
||||
# ${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
|
||||
@@ -29,7 +29,6 @@ DbWriter::DbWriter(const std::shared_ptr<DDSConnector::DdsConnector> &ddsConnect
|
||||
, m_ddsConnector(ddsConnector)
|
||||
, m_dbWriterSnapshot(nullptr)
|
||||
, m_dbWriterSnapshotThread(nullptr)
|
||||
, m_logger(getLogger("DbWriter"))
|
||||
{}
|
||||
|
||||
DbWriter::~DbWriter()
|
||||
@@ -53,18 +52,18 @@ bool DbWriter::loadPlugin(const LtsPluginManager::PluginInstance &pi)
|
||||
RecordReplay::RecordReplayPlugin *recPlugin = qobject_cast<RecordReplay::RecordReplayPlugin *>(pi.plugin);
|
||||
if (!recPlugin)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Cannot load RecordReplayPlugin " << pi.fileName;
|
||||
ERROR_LOG() << "Cannot load RecordReplayPlugin " << pi.fileName;
|
||||
return false;
|
||||
}
|
||||
INFO_LOG(m_logger) << "Loading RecordReplayPlugin " << pi.fileName;
|
||||
INFO_LOG() << "Loading RecordReplayPlugin " << pi.fileName;
|
||||
// exId == partId da wir hier in IDL::PartitionType::Exercise arbeiten
|
||||
if (!recPlugin->initDtc(m_ddsConnector, m_ddsConnector->getPartitionId()))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Initialisation for RecordReplayPlugin " << pi.fileName << " failed ";
|
||||
ERROR_LOG() << "Initialisation for RecordReplayPlugin " << pi.fileName << " failed ";
|
||||
return false;
|
||||
}
|
||||
|
||||
INFO_LOG(m_logger) << "Loaded record replay plugin " << recPlugin->pluginName();
|
||||
INFO_LOG() << "Loaded record replay plugin " << recPlugin->pluginName();
|
||||
m_plugins += recPlugin;
|
||||
|
||||
return true;
|
||||
@@ -82,7 +81,7 @@ bool DbWriter::init(const std::shared_ptr<DatabaseInterface> &db)
|
||||
|
||||
// Start recording data
|
||||
qint64 msecs = Settings::updateFrequency();
|
||||
INFO_LOG(m_logger) << "Updating recording tables every " << msecs << " milliseconds.";
|
||||
INFO_LOG() << "Updating recording tables every " << msecs << " milliseconds.";
|
||||
connect(m_recordTimer, &QTimer::timeout, this, &DbWriter::ddsTopicsToDatabase);
|
||||
m_recordTimer->start(msecs);
|
||||
|
||||
@@ -114,7 +113,7 @@ bool DbWriter::initSnapshot()
|
||||
|
||||
void DbWriter::ddsTopicsToDatabase()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "IN ddsTopicsToDatabase";
|
||||
DEBUG_LOG() << "IN ddsTopicsToDatabase";
|
||||
DBTransaction trans(m_db->database());
|
||||
|
||||
QHash<QString, qint64> minRecordSampleTimes;
|
||||
@@ -125,7 +124,7 @@ void DbWriter::ddsTopicsToDatabase()
|
||||
if (!recPlugin->ddsTopicsToDatabase(*m_query, minRecordSampleTimes))
|
||||
{
|
||||
// should never happen but who knows
|
||||
ERROR_LOG(m_logger) << "Error recording dds topics - aborting recording data";
|
||||
ERROR_LOG() << "Error recording dds topics - aborting recording data";
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,5 @@ private:
|
||||
DbWriterSnapshot *m_dbWriterSnapshot{nullptr};
|
||||
DbWriterSnapshotThread *m_dbWriterSnapshotThread{nullptr};
|
||||
std::shared_ptr<DatabaseInterface> m_db;
|
||||
|
||||
LOGGER_T m_logger;
|
||||
};
|
||||
} // namespace RecordingManagement
|
||||
+14
-15
@@ -42,7 +42,6 @@ DbWriterSnapshot::DbWriterSnapshot(const QVector<RecordReplay::RecordReplayPlugi
|
||||
, m_snapshotInterval(1 * 60 * 1000) // TODO: make config variable // Interval: 1 min in milliseconds
|
||||
, m_exerciseId(exerciseId)
|
||||
, m_settings(settings)
|
||||
, m_logger(getLogger("DbWriterSnapshot"))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -77,14 +76,14 @@ void DbWriterSnapshot::init()
|
||||
|
||||
// Set search path
|
||||
const QString stmt = QLatin1String("SET SEARCH_PATH TO ") + m_dbInterface->schemaName() + QLatin1String(", PUBLIC");
|
||||
INFO_LOG(m_logger) << "SearchPath Stmt: " << stmt;
|
||||
INFO_LOG() << "SearchPath Stmt: " << stmt;
|
||||
NSqlQuery q(dbConn);
|
||||
|
||||
q.exec(stmt);
|
||||
|
||||
if (!m_dbInterface->init(dbConn))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error initializing database interface - can not initialize DbWriterSnapshot";
|
||||
ERROR_LOG() << "Error initializing database interface - can not initialize DbWriterSnapshot";
|
||||
m_dbInterface = nullptr;
|
||||
return;
|
||||
}
|
||||
@@ -108,7 +107,7 @@ void DbWriterSnapshot::setMinRecordedSampleTimes(const QHash<QString, qint64> &m
|
||||
const QString &topicName = it.key();
|
||||
if (minRecordedSampleTime == 0)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Minimum recorded Sample Time for topic " << topicName <<
|
||||
WARNING_LOG() << "Minimum recorded Sample Time for topic " << topicName <<
|
||||
" is zero - looks like a service did not properly set the sample time!";
|
||||
continue;
|
||||
}
|
||||
@@ -123,7 +122,7 @@ void DbWriterSnapshot::setMinRecordedSampleTimes(const QHash<QString, qint64> &m
|
||||
// already a minimum time - make sure to get the minimum from both
|
||||
m_minRecordedSampleTimes[topicName] = std::min(minRecordedSampleTime, mrstIt.value());
|
||||
}
|
||||
INFO_LOG(m_logger) << "Current minimum sample time for " << topicName
|
||||
INFO_LOG() << "Current minimum sample time for " << topicName
|
||||
<< " is " << m_minRecordedSampleTimes.value(topicName)
|
||||
<< " = " << QDateTime::fromMSecsSinceEpoch(m_minRecordedSampleTimes.value(topicName)).toString();
|
||||
}
|
||||
@@ -158,7 +157,7 @@ void DbWriterSnapshot::initSnapshot()
|
||||
topicRecIdQuery.prepare(QStringLiteral("SELECT MAX(time_stamp) FROM rec_snapshot WHERE svc_name = :svc_name AND topic_name = :topic_name"));
|
||||
|
||||
const qint64 tNow(time(nullptr) * 1000 - 60 * 1 * 1000); // jetzt vor einer Minute
|
||||
INFO_LOG(m_logger) << "tNow (-1min): " << tNow;
|
||||
INFO_LOG() << "tNow (-1min): " << tNow;
|
||||
|
||||
QHash<QString, qint64> minRecordedSampleTimes;
|
||||
|
||||
@@ -199,7 +198,7 @@ void DbWriterSnapshot::initSnapshot()
|
||||
fromWhere = "snapshot + last sample";
|
||||
else if (timeToStartSnapshotCreationFrom == tNow)
|
||||
fromWhere = "current time";
|
||||
INFO_LOG(m_logger) << "last snapshot time for topic '" << topicName
|
||||
INFO_LOG() << "last snapshot time for topic '" << topicName
|
||||
<< "' is: " << timeToStartSnapshotCreationFrom
|
||||
<< " from " << fromWhere;
|
||||
minRecordedSampleTimes[topicName] = timeToStartSnapshotCreationFrom;
|
||||
@@ -219,7 +218,7 @@ void DbWriterSnapshot::writeSnapshotData()
|
||||
const QHash<QString, qint64> minRecSampleTimes(getMinRecordedSampleTimes(lastSnapshotTimeToGenerateNow));
|
||||
if (minRecSampleTimes.isEmpty())
|
||||
{
|
||||
INFO_LOG(m_logger) << "minRecSampleTimes has no entries with time < " << lastSnapshotTimeToGenerateNow
|
||||
INFO_LOG() << "minRecSampleTimes has no entries with time < " << lastSnapshotTimeToGenerateNow
|
||||
<< " nothing to do...";
|
||||
QTimer::singleShot(m_snapshotInterval, Qt::VeryCoarseTimer,
|
||||
this, &DbWriterSnapshot::writeSnapshotData);
|
||||
@@ -230,25 +229,25 @@ void DbWriterSnapshot::writeSnapshotData()
|
||||
qint64 startTime = std::numeric_limits<qint64>::max();
|
||||
for(const qint64 st : std::as_const(minRecSampleTimes))
|
||||
startTime = std::min(startTime, st);
|
||||
INFO_LOG(m_logger) << "writeSnapshotData - lastSnapshotTimeToGenerateNow: " << lastSnapshotTimeToGenerateNow
|
||||
INFO_LOG() << "writeSnapshotData - lastSnapshotTimeToGenerateNow: " << lastSnapshotTimeToGenerateNow
|
||||
<< ", minRecTime is " << startTime;
|
||||
if (startTime <= 0 || startTime > endTime)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Spurious start time (" << startTime
|
||||
WARNING_LOG() << "Spurious start time (" << startTime
|
||||
<< ") - using end time for start (" << endTime << ")";
|
||||
startTime = endTime - 1; // -1 -> create at least one interval
|
||||
}
|
||||
|
||||
if (startTime > lastSnapshotTimeToGenerateNow)
|
||||
{
|
||||
INFO_LOG(m_logger) << "Nothing changed in the last interval until " << lastSnapshotTimeToGenerateNow << " youngest topic is at " << startTime;
|
||||
INFO_LOG() << "Nothing changed in the last interval until " << lastSnapshotTimeToGenerateNow << " youngest topic is at " << startTime;
|
||||
QTimer::singleShot(m_snapshotInterval, Qt::VeryCoarseTimer,
|
||||
this, &DbWriterSnapshot::writeSnapshotData);
|
||||
return;
|
||||
}
|
||||
|
||||
// we know something changed between startTime and lastSnapshotTimeToGenerateNow - let's do some work
|
||||
INFO_LOG(m_logger) << "startTime: " << startTime
|
||||
INFO_LOG() << "startTime: " << startTime
|
||||
<< " lastSnapshotTimeToGenerateNow: " << lastSnapshotTimeToGenerateNow << " - BEGIN";
|
||||
DBTransaction trans(QSqlDatabase::database(dbConnectionName()));
|
||||
NSqlQuery recSnapshotQuery(QSqlDatabase::database(dbConnectionName()));
|
||||
@@ -256,7 +255,7 @@ void DbWriterSnapshot::writeSnapshotData()
|
||||
writeSnapshotDataPlugin(lastSnapshotTimeToGenerateNow, recSnapshotQuery, recPlugin, minRecSampleTimes);
|
||||
|
||||
trans.commit();
|
||||
INFO_LOG(m_logger) << "startTime: " << startTime
|
||||
INFO_LOG() << "startTime: " << startTime
|
||||
<< " lastSnapshotTimeToGenerateNow: " << lastSnapshotTimeToGenerateNow << " - FINISHED";
|
||||
|
||||
|
||||
@@ -289,7 +288,7 @@ void DbWriterSnapshot::writeSnapshotDataPlugin(qint64 endInterval,
|
||||
|
||||
for (auto &snapshotData : vec)
|
||||
{
|
||||
INFO_LOG(m_logger) << "svc: " << recSnapshot.svcName
|
||||
INFO_LOG() << "svc: " << recSnapshot.svcName
|
||||
<< " topic: " << recSnapshot.topicName
|
||||
<< " timestamp: " << snapshotData.timeStamp
|
||||
<< " #elements: " << snapshotData.recIdArray.size();
|
||||
@@ -299,7 +298,7 @@ void DbWriterSnapshot::writeSnapshotDataPlugin(qint64 endInterval,
|
||||
recSnapshot.recIdArray = LtsUtils::BigintArray2D(std::move(snapshotData.recIdArray));
|
||||
|
||||
if (!m_dbInterface->insert(recSnapshot))
|
||||
ERROR_LOG(m_logger) << "Error while recording snaphshot for topic " << recSnapshot.topicName;
|
||||
ERROR_LOG() << "Error while recording snaphshot for topic " << recSnapshot.topicName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,6 @@ private:
|
||||
std::shared_ptr<DatabaseInterface> m_dbInterface;
|
||||
int m_exerciseId;
|
||||
NGL::Settings *m_settings;
|
||||
LOGGER_T m_logger;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -15,16 +15,15 @@ namespace RecordingManagement
|
||||
|
||||
DdsHandler::DdsHandler(int domainId, int exerciseId)
|
||||
: m_ddsConnector(std::make_shared<DDSConnector::DdsConnector>(domainId, IDL::PartitionType::Exercise, exerciseId))
|
||||
, m_logger(getLogger("DdsHandler"))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
DEBUG_LOG() << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
}
|
||||
|
||||
bool DdsHandler::init(const QStringList &qosFileList)
|
||||
{
|
||||
if (!m_ddsConnector->init(qosFileList))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error initializing dds connections - aborting";
|
||||
ERROR_LOG() << "Error initializing dds connections - aborting";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -35,8 +35,6 @@ public:
|
||||
private:
|
||||
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
|
||||
std::shared_ptr<Core::Pacemaker> m_pacemaker;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -9,7 +9,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <NGLLogger/INGLLogger.h>
|
||||
#include "rec_export.h"
|
||||
#include "svcreccommon_export.h"
|
||||
|
||||
namespace RecordingManagement
|
||||
{
|
||||
|
||||
@@ -34,7 +34,5 @@ private:
|
||||
std::shared_ptr<DdsHandler> m_ddsHandler;
|
||||
std::shared_ptr<DbHandler> m_dbHandler;
|
||||
std::shared_ptr<DbWriter> m_dbWriter;
|
||||
|
||||
LOGGER_T m_logger;
|
||||
};
|
||||
} // namespace RecordingManagement
|
||||
Reference in new issue
Block a user