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 @@ CODEGEN_TOPIC_TYPEDEFS(SRCS_common ${xml_FILE})
|
||||
CODEGEN_CLIENT_TOPICS_IFC(SRCS_common ${xml_FILE})
|
||||
|
||||
# SV needed for topic type plugin
|
||||
NGL_ADD_LIBRARY(WS AAR SV svcSrpCommon SHARED ${SRCS_common})
|
||||
NGL_ADD_LIBRARY2(WS AAR SV svcSrpCommon SHARED ${SRCS_common})
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(svcSrpCommon
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
@@ -61,7 +61,7 @@ SET(SRCS_client
|
||||
# generate srp_ftc_impl.[cpp|h]
|
||||
CODEGEN_CLIENT_TOPICS_IMPL(SRCS_client ${xml_FILE})
|
||||
|
||||
NGL_ADD_LIBRARY(WS svcSrpClient SHARED ${SRCS_client})
|
||||
NGL_ADD_LIBRARY2(WS svcSrpClient SHARED ${SRCS_client})
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(svcSrpClient
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
@@ -89,7 +89,7 @@ SET(SRCS_server
|
||||
# generate srp_[d|f]ts.h, srp_[d|f]ts_impl.[cpp|h]
|
||||
CODEGEN_SERVER_TOPICS(SRCS_server ${xml_FILE})
|
||||
|
||||
NGL_ADD_LIBRARY(AAR SV WS svcSrpServer SHARED ${SRCS_server})
|
||||
NGL_ADD_LIBRARY2(AAR SV WS svcSrpServer SHARED ${SRCS_server})
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(svcSrpServer
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
|
||||
+13
-14
@@ -24,7 +24,6 @@ SrpDtTests::SrpDtTests(QObject *parent)
|
||||
, m_replayPartitionId(0)
|
||||
, m_situationReplayId(0)
|
||||
, m_bTestsSuccessful(true)
|
||||
, m_logger(getLogger("DtTest"))
|
||||
{
|
||||
qRegisterMetaType<Core::FunctionReply>("Core::FunctionReply");
|
||||
}
|
||||
@@ -36,7 +35,7 @@ SrpDtTests::~SrpDtTests()
|
||||
//---------------------------------------------------------------------------------
|
||||
bool SrpDtTests::init(int domainId, int replayPartitionId)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "init begin";
|
||||
DEBUG_LOG() << "init begin";
|
||||
m_replayPartitionId = replayPartitionId;
|
||||
|
||||
// initialize DDS
|
||||
@@ -52,11 +51,11 @@ bool SrpDtTests::init(int domainId, int replayPartitionId)
|
||||
// DdsInterface Publisher
|
||||
//m_ddsConnector->setPublisher(new Publisher(domainId, m_ddsConnector->getPartition(), m_ddsConnector->getDomainParticipant()));
|
||||
|
||||
DEBUG_LOG(m_logger) << "Create dtc";
|
||||
DEBUG_LOG() << "Create dtc";
|
||||
m_dtc = SituationReplay::Interface::Dtc::create(m_ddsConnector);
|
||||
DEBUG_LOG(m_logger) << "Init dtc";
|
||||
DEBUG_LOG() << "Init dtc";
|
||||
bool bRet = m_dtc->enableAll();
|
||||
DEBUG_LOG(m_logger) << "init end - bRet = " << bRet;
|
||||
DEBUG_LOG() << "init end - bRet = " << bRet;
|
||||
|
||||
connect(m_dtc.get(), &SituationReplay::Interface::Dtc::sitReplayChanged,
|
||||
this, &SrpDtTests::onReceiveSituationReplayData);
|
||||
@@ -67,26 +66,26 @@ bool SrpDtTests::init(int domainId, int replayPartitionId)
|
||||
//---------------------------------------------------------------------------------
|
||||
void SrpDtTests::startTest()
|
||||
{
|
||||
INFO_LOG(m_logger) << "startTest";
|
||||
INFO_LOG() << "startTest";
|
||||
QTimer::singleShot(1000, this, &SrpDtTests::tryGetAllSituationReplays);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
void SrpDtTests::tryGetAllSituationReplays()
|
||||
{
|
||||
INFO_LOG(m_logger) << "trying to get all situationReplays";
|
||||
INFO_LOG() << "trying to get all situationReplays";
|
||||
const QMap<qint32, SituationReplay::SitReplay> map = m_dtc->sitReplays();
|
||||
if (map.isEmpty())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting all situation replay data";
|
||||
ERROR_LOG() << "Error requesting all situation replay data";
|
||||
failExit();
|
||||
}
|
||||
else
|
||||
{
|
||||
INFO_LOG(m_logger) << "Amout of existing situation replays = " << map.size();
|
||||
INFO_LOG() << "Amout of existing situation replays = " << map.size();
|
||||
m_situationReplayId = map.firstKey();
|
||||
for(auto it = map.begin(); it != map.end(); ++it)
|
||||
INFO_LOG(m_logger) << "situationReplay(" << it.key() << ") : " << it.value().replayPartitionId() ;
|
||||
INFO_LOG() << "situationReplay(" << it.key() << ") : " << it.value().replayPartitionId() ;
|
||||
}
|
||||
|
||||
QTimer::singleShot(10, this, &SrpDtTests::tryGetSituationReplay);
|
||||
@@ -95,17 +94,17 @@ void SrpDtTests::tryGetAllSituationReplays()
|
||||
//---------------------------------------------------------------------------------
|
||||
void SrpDtTests::tryGetSituationReplay()
|
||||
{
|
||||
INFO_LOG(m_logger) << "trying get itemData for situationReplay " << m_situationReplayId;
|
||||
INFO_LOG() << "trying get itemData for situationReplay " << m_situationReplayId;
|
||||
SituationReplay::SitReplay data = m_dtc->sitReplay(m_situationReplayId);
|
||||
|
||||
if (data.id() <= 0)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error receiving data for situation replay " << m_situationReplayId;
|
||||
ERROR_LOG() << "Error receiving data for situation replay " << m_situationReplayId;
|
||||
failExit();
|
||||
}
|
||||
else
|
||||
{
|
||||
INFO_LOG(m_logger) << "## SitReplay(" << data.id() << "), replayPartition: " << data.replayPartitionId()
|
||||
INFO_LOG() << "## SitReplay(" << data.id() << "), replayPartition: " << data.replayPartitionId()
|
||||
<< ", on exercise " << data.exerciseId();
|
||||
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
|
||||
}
|
||||
@@ -115,7 +114,7 @@ void SrpDtTests::tryGetSituationReplay()
|
||||
void SrpDtTests::onReceiveSituationReplayData(const SituationReplay::SitReplay &data)
|
||||
{
|
||||
if (m_situationReplayId == data.id())
|
||||
INFO_LOG(m_logger) << "##################### Data for id = " << data.id() << " received";
|
||||
INFO_LOG() << "##################### Data for id = " << data.id() << " received";
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
|
||||
+16
-17
@@ -25,7 +25,6 @@ SrpFtTests::SrpFtTests(QObject *parent)
|
||||
, m_replayPartitionId(0)
|
||||
, m_testId(All)
|
||||
, m_bTestsSuccessful(true)
|
||||
, m_logger(getLogger("FtTest"))
|
||||
{
|
||||
qRegisterMetaType<Core::FunctionReply>("Core::FunctionReply");
|
||||
}
|
||||
@@ -37,7 +36,7 @@ SrpFtTests::~SrpFtTests()
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
bool SrpFtTests::init(int domainId, TestId testId, int replayPartitionId, int srpId)
|
||||
{
|
||||
INFO_LOG(m_logger) << "init begin";
|
||||
INFO_LOG() << "init begin";
|
||||
|
||||
m_testId = testId;
|
||||
m_replayPartitionId = replayPartitionId;
|
||||
@@ -54,11 +53,11 @@ bool SrpFtTests::init(int domainId, TestId testId, int replayPartitionId, int sr
|
||||
// Publish/Subscribe on replayPartition
|
||||
m_ddsConnector->initPublisherSubscriber();
|
||||
|
||||
DEBUG_LOG(m_logger) << "create ftc";
|
||||
DEBUG_LOG() << "create ftc";
|
||||
m_ftc = SituationReplay::Interface::Ftc::create(m_ddsConnector);
|
||||
DEBUG_LOG(m_logger) << "init ftc";
|
||||
DEBUG_LOG() << "init ftc";
|
||||
bool bRet = m_ftc->enableAll();
|
||||
DEBUG_LOG(m_logger) << "init end - bRet = " << bRet;
|
||||
DEBUG_LOG() << "init end - bRet = " << bRet;
|
||||
|
||||
return bRet;
|
||||
}
|
||||
@@ -66,7 +65,7 @@ bool SrpFtTests::init(int domainId, TestId testId, int replayPartitionId, int sr
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
void SrpFtTests::startTest()
|
||||
{
|
||||
INFO_LOG(m_logger) << "startTest";
|
||||
INFO_LOG() << "startTest";
|
||||
|
||||
if (m_testId <= TryStart)
|
||||
QTimer::singleShot(0, this, &SrpFtTests::tryStart);
|
||||
@@ -83,7 +82,7 @@ void SrpFtTests::startTest()
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
void SrpFtTests::tryStart()
|
||||
{
|
||||
INFO_LOG(m_logger) << "trying to send startReplay";
|
||||
INFO_LOG() << "trying to send startReplay";
|
||||
m_currentTestId = TryStart;
|
||||
|
||||
qint64 beginTime = 1468401389668;
|
||||
@@ -100,7 +99,7 @@ void SrpFtTests::tryStart()
|
||||
|
||||
if (!m_ftc->changeReplayStateRequest(req, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error starting replay for srp " << m_replayPartitionId;
|
||||
ERROR_LOG() << "Error starting replay for srp " << m_replayPartitionId;
|
||||
failExit();
|
||||
}
|
||||
}
|
||||
@@ -108,7 +107,7 @@ void SrpFtTests::tryStart()
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
void SrpFtTests::tryNotAllowedChange()
|
||||
{
|
||||
INFO_LOG(m_logger) << "trying to send changeReplayState (start) => should fail (not possible with this method)";
|
||||
INFO_LOG() << "trying to send changeReplayState (start) => should fail (not possible with this method)";
|
||||
m_currentTestId = TryNotAllowedChange;
|
||||
switchToState(SituationReplay::SrpState::Started);
|
||||
}
|
||||
@@ -116,7 +115,7 @@ void SrpFtTests::tryNotAllowedChange()
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
void SrpFtTests::tryChangePaused()
|
||||
{
|
||||
INFO_LOG(m_logger) << "trying to send changeReplayState (Paused)";
|
||||
INFO_LOG() << "trying to send changeReplayState (Paused)";
|
||||
m_currentTestId = TryChangePaused;
|
||||
switchToState(SituationReplay::SrpState::Paused);
|
||||
}
|
||||
@@ -124,7 +123,7 @@ void SrpFtTests::tryChangePaused()
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
void SrpFtTests::tryChangeResumed()
|
||||
{
|
||||
INFO_LOG(m_logger) << "trying to send changeReplayState (Resumed)";
|
||||
INFO_LOG() << "trying to send changeReplayState (Resumed)";
|
||||
m_currentTestId = TryChangeResumed;
|
||||
switchToState(SituationReplay::SrpState::Resumed);
|
||||
}
|
||||
@@ -132,7 +131,7 @@ void SrpFtTests::tryChangeResumed()
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
void SrpFtTests::tryStop()
|
||||
{
|
||||
INFO_LOG(m_logger) << "trying to send stopReplay";
|
||||
INFO_LOG() << "trying to send stopReplay";
|
||||
m_currentTestId = TryStop;
|
||||
switchToState(SituationReplay::SrpState::Stopped);
|
||||
}
|
||||
@@ -140,7 +139,7 @@ void SrpFtTests::tryStop()
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
void SrpFtTests::startReplayReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
INFO_LOG(m_logger) << "Got startReplayReply with id " << replyObject.id();
|
||||
INFO_LOG() << "Got startReplayReply with id " << replyObject.id();
|
||||
m_situationReplayId = replyObject.id();
|
||||
if (m_testId == 0 && !replyObject.error())
|
||||
QTimer::singleShot(0, this, &SrpFtTests::tryNotAllowedChange);
|
||||
@@ -151,9 +150,9 @@ void SrpFtTests::startReplayReply(const Core::FunctionReplyObject &replyObject)
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
void SrpFtTests::changeReplayStateReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
INFO_LOG(m_logger) << "Got changeReplayStateReply with id " << replyObject.id();
|
||||
INFO_LOG() << "Got changeReplayStateReply with id " << replyObject.id();
|
||||
if (replyObject.error())
|
||||
INFO_LOG(m_logger) << ", string: " << replyObject.translated();
|
||||
INFO_LOG() << ", string: " << replyObject.translated();
|
||||
if (m_testId == 0 && !replyObject.error())
|
||||
{
|
||||
if (m_currentTestId == TryNotAllowedChange)
|
||||
@@ -170,7 +169,7 @@ void SrpFtTests::changeReplayStateReply(const Core::FunctionReplyObject &replyOb
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
void SrpFtTests::stopReplayReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
INFO_LOG(m_logger) << "Got stopReplayReply with id " << replyObject.id() ;
|
||||
INFO_LOG() << "Got stopReplayReply with id " << replyObject.id() ;
|
||||
|
||||
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
|
||||
}
|
||||
@@ -214,7 +213,7 @@ void SrpFtTests::switchToState(SrpState state)
|
||||
|
||||
if (!m_ftc->changeReplayStateRequest(req, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error changing replay state for srp " << m_situationReplayId << "(" << m_replayPartitionId << ")";
|
||||
ERROR_LOG() << "Error changing replay state for srp " << m_situationReplayId << "(" << m_replayPartitionId << ")";
|
||||
failExit();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ DbReader::DbReader(const std::shared_ptr<DDSConnector::DdsConnector> &ddsConnect
|
||||
, m_query(nullptr)
|
||||
, m_ddsConnector(ddsConnector)
|
||||
, m_bCanHandleSchemas(bCanHandleSchemas)
|
||||
, m_logger(getLogger("DbReader"))
|
||||
{}
|
||||
|
||||
DbReader::~DbReader()
|
||||
@@ -37,17 +36,17 @@ bool DbReader::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;
|
||||
}
|
||||
|
||||
if (!recPlugin->initDts(m_ddsConnector, m_exerciseId, m_bCanHandleSchemas, *m_query))
|
||||
{
|
||||
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.push_back(recPlugin);
|
||||
|
||||
return true;
|
||||
@@ -68,67 +67,67 @@ bool DbReader::init(const QSqlDatabase &db)
|
||||
|
||||
bool DbReader::setReplayStartTime(qint64 startTime)
|
||||
{
|
||||
INFO_LOG(m_logger) << "IN setReplayStartTime " << startTime;
|
||||
INFO_LOG() << "IN setReplayStartTime " << startTime;
|
||||
if (!m_query)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Internal error - no query!";
|
||||
WARNING_LOG() << "Internal error - no query!";
|
||||
return false;
|
||||
}
|
||||
for (RecordReplay::RecordReplayPlugin *recPlugin : m_plugins)
|
||||
{
|
||||
INFO_LOG(m_logger) << "IN setReplayStartTime, current Plugin: " << recPlugin->pluginName()
|
||||
INFO_LOG() << "IN setReplayStartTime, current Plugin: " << recPlugin->pluginName()
|
||||
<< " typename=" << typeid(*recPlugin).name();
|
||||
if (!recPlugin->setReplayStartTime(*m_query, startTime))
|
||||
{
|
||||
WARNING_LOG(m_logger) << "setReplayStartTime for plugin " << recPlugin->svcShortName() << " failed!";
|
||||
WARNING_LOG() << "setReplayStartTime for plugin " << recPlugin->svcShortName() << " failed!";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
INFO_LOG(m_logger) << "IN setReplayStartTime " << startTime << " DONE";
|
||||
INFO_LOG() << "IN setReplayStartTime " << startTime << " DONE";
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DbReader::readData(qint64 fromTime, qint64 toTime)
|
||||
{
|
||||
INFO_LOG(m_logger) << "IN readData " << fromTime << " to " << toTime;
|
||||
INFO_LOG() << "IN readData " << fromTime << " to " << toTime;
|
||||
if (!m_query)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Internal error - no query!";
|
||||
WARNING_LOG() << "Internal error - no query!";
|
||||
return false;
|
||||
}
|
||||
for (RecordReplay::RecordReplayPlugin *recPlugin : m_plugins)
|
||||
{
|
||||
if (!recPlugin->ddsTopicsFromDatabase(*m_query, fromTime, toTime))
|
||||
{
|
||||
WARNING_LOG(m_logger) << "ddsTopicsFromDatabase for plugin " << recPlugin->svcShortName() << " failed!";
|
||||
WARNING_LOG() << "ddsTopicsFromDatabase for plugin " << recPlugin->svcShortName() << " failed!";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
INFO_LOG(m_logger) << "IN readData " << fromTime << " to " << toTime << " DONE";
|
||||
INFO_LOG() << "IN readData " << fromTime << " to " << toTime << " DONE";
|
||||
return true;
|
||||
}
|
||||
|
||||
void DbReader::publish(qint64 desiredTime)
|
||||
{
|
||||
INFO_LOG(m_logger) << "IN publish " << desiredTime;
|
||||
INFO_LOG() << "IN publish " << desiredTime;
|
||||
for (RecordReplay::RecordReplayPlugin *recPlugin : m_plugins)
|
||||
if (!recPlugin->publishData(desiredTime))
|
||||
WARNING_LOG(m_logger) << "publishData for plugin " << recPlugin->svcShortName() << " failed!";
|
||||
INFO_LOG(m_logger) << "IN publish " << desiredTime << " DONE";
|
||||
WARNING_LOG() << "publishData for plugin " << recPlugin->svcShortName() << " failed!";
|
||||
INFO_LOG() << "IN publish " << desiredTime << " DONE";
|
||||
}
|
||||
|
||||
void DbReader::waitForAsyncOperations(qint64 desiredTime)
|
||||
{
|
||||
INFO_LOG(m_logger) << "IN waitForAsyncOperations " << desiredTime;
|
||||
INFO_LOG() << "IN waitForAsyncOperations " << desiredTime;
|
||||
for (RecordReplay::RecordReplayPlugin *recPlugin : m_plugins)
|
||||
if (!recPlugin->waitForAsyncOperations(desiredTime))
|
||||
WARNING_LOG(m_logger) << "waitForAsyncOperations for plugin " << recPlugin->svcShortName() << " failed!";
|
||||
WARNING_LOG() << "waitForAsyncOperations for plugin " << recPlugin->svcShortName() << " failed!";
|
||||
}
|
||||
|
||||
|
||||
void DbReader::clearData()
|
||||
{
|
||||
INFO_LOG(m_logger) << "IN clearData";
|
||||
INFO_LOG() << "IN clearData";
|
||||
for (RecordReplay::RecordReplayPlugin *recPlugin : m_plugins)
|
||||
recPlugin->clearData();
|
||||
}
|
||||
|
||||
@@ -43,7 +43,5 @@ private:
|
||||
bool m_bCanHandleSchemas;
|
||||
|
||||
std::vector<RecordReplay::RecordReplayPlugin*> m_plugins;
|
||||
|
||||
LOGGER_T m_logger;
|
||||
};
|
||||
} // namespace RecordingManagement
|
||||
@@ -34,18 +34,16 @@ static std::shared_ptr<DDSConnector::DdsConnector> makeConnector(const Connectio
|
||||
|
||||
DdsHandler::DdsHandler(const ConnectionParams &output)
|
||||
: m_ddsConnectorReplay(makeConnector(output, IDL::PartitionType::Replay, DDS::QosProfile::ConnectionType::ShmUdpLocalhost))
|
||||
, m_logger(getLogger("DdsHandler"))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "DdsHandler Replay(" << output.partitionId << ") for partition: " << m_ddsConnectorReplay->getDefaultPartition();
|
||||
DEBUG_LOG() << "DdsHandler Replay(" << output.partitionId << ") for partition: " << m_ddsConnectorReplay->getDefaultPartition();
|
||||
}
|
||||
|
||||
DdsHandler::DdsHandler(const ConnectionParams &input, const ConnectionParams &output)
|
||||
: m_ddsConnectorExercise(makeConnector(input, IDL::PartitionType::Exercise, DDS::QosProfile::ConnectionType::Client))
|
||||
, m_ddsConnectorReplay(makeConnector(output, IDL::PartitionType::Replay, DDS::QosProfile::ConnectionType::Shm))
|
||||
, m_logger(getLogger("DdsHandler"))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "DdsHandler Exercise(" << input.partitionId << ") for partition: " << m_ddsConnectorExercise->getDefaultPartition();
|
||||
DEBUG_LOG(m_logger) << "DdsHandler Replay(" << output.partitionId << ") for partition: " << m_ddsConnectorReplay->getDefaultPartition();
|
||||
DEBUG_LOG() << "DdsHandler Exercise(" << input.partitionId << ") for partition: " << m_ddsConnectorExercise->getDefaultPartition();
|
||||
DEBUG_LOG() << "DdsHandler Replay(" << output.partitionId << ") for partition: " << m_ddsConnectorReplay->getDefaultPartition();
|
||||
}
|
||||
|
||||
DdsHandler::~DdsHandler()
|
||||
@@ -63,7 +61,7 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
if ((m_ddsConnectorExercise && !m_ddsConnectorExercise->init(qosFileList)) ||
|
||||
!m_ddsConnectorReplay->init(qosFileList))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error initializing dds connections - aborting";
|
||||
ERROR_LOG() << "Error initializing dds connections - aborting";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -82,10 +80,10 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
m_ddsDts = SituationReplay::Interface::Dts::create(m_ddsConnectorReplay);
|
||||
m_ddsFts = SituationReplay::Interface::Fts::create(m_ddsConnectorReplay);
|
||||
bool bRet = m_ddsDts->enableAll();
|
||||
INFO_LOG(m_logger) << "Dts initialised";
|
||||
INFO_LOG() << "Dts initialised";
|
||||
|
||||
bRet &= m_ddsFts->enableAll();
|
||||
INFO_LOG(m_logger) << "Fts initialised";
|
||||
INFO_LOG() << "Fts initialised";
|
||||
|
||||
initReplayRouting();
|
||||
|
||||
@@ -94,7 +92,7 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
|
||||
void DdsHandler::publishPartitionTime(const Core::PartitionTime &partitionTime)
|
||||
{
|
||||
INFO_LOG(m_logger) << "publish partitionTime: " << partitionTime.timeStamp();
|
||||
INFO_LOG() << "publish partitionTime: " << partitionTime.timeStamp();
|
||||
m_dtsPartitionTime->write(partitionTime);
|
||||
}
|
||||
|
||||
|
||||
@@ -54,8 +54,6 @@ private:
|
||||
std::shared_ptr<SituationReplay::Interface::Fts> m_ddsFts;
|
||||
std::unique_ptr<DTS::PartitionTime> m_dtsPartitionTime;
|
||||
std::unique_ptr<RoutingService::SessionHandler> m_sessionRouting;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
}
|
||||
+7
-8
@@ -29,7 +29,6 @@ HandlerSituationReplay::HandlerSituationReplay(const std::shared_ptr<DdsHandler>
|
||||
, m_dbReader(dbReader)
|
||||
, m_exerciseId(0)
|
||||
, m_partitionId(0)
|
||||
, m_logger(getLogger("HandlerSituationReplay"))
|
||||
{}
|
||||
|
||||
HandlerSituationReplay::~HandlerSituationReplay()
|
||||
@@ -47,7 +46,7 @@ bool HandlerSituationReplay::init(int exerciseId, int partitionId)
|
||||
NSqlQuery q(m_db->database());
|
||||
const qint64 exerciseStartTime = (q.execAndFetch(stmt) ? q.value(0).toLongLong() : 0);
|
||||
|
||||
DEBUG_LOG(m_logger) << "stmt: " << stmt << ", res " << exerciseStartTime;
|
||||
DEBUG_LOG() << "stmt: " << stmt << ", res " << exerciseStartTime;
|
||||
|
||||
Database::SrpSituationReplay newData;
|
||||
newData.srpStateId = SrpState::Stopped;
|
||||
@@ -68,14 +67,14 @@ bool HandlerSituationReplay::createObject(const Database::SrpSituationReplay &ne
|
||||
{
|
||||
delete m_objSrp;
|
||||
m_objSrp = nullptr;
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
ERROR_LOG() << ret();
|
||||
}
|
||||
return m_objSrp != nullptr;
|
||||
}
|
||||
|
||||
Core::FunctionReplyObject HandlerSituationReplay::startReplayRequest(const SituationReplay::ChangeReplayStateRequest &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onStartReplayRequest: " << request;
|
||||
DEBUG_LOG() << "onStartReplayRequest: " << request;
|
||||
// Start only own replay
|
||||
if (request.replayPartitionId() != m_partitionId)
|
||||
return Core::FunctionReplyObject(request.replayPartitionId(),tr_lts("dds", "Wrong replay partition"));
|
||||
@@ -103,7 +102,7 @@ Core::FunctionReplyObject HandlerSituationReplay::startReplayRequest(const Situa
|
||||
|
||||
Core::FunctionReplyObject HandlerSituationReplay::stopReplayRequest(const SituationReplay::ChangeReplayStateRequest &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onStopReplayRequest: " << request;
|
||||
DEBUG_LOG() << "onStopReplayRequest: " << request;
|
||||
|
||||
if (m_objSrp == nullptr)
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "SituationReplay for replayPartitionId %1 not found")).arg(request.replayPartitionId());
|
||||
@@ -145,7 +144,7 @@ Core::FunctionReplyObject HandlerSituationReplay::changeReplayStateRequest(const
|
||||
return startReplayRequest(request);
|
||||
case SrpState_def::Resumed:
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Resume request: " << request.beginTime() << ", cur playback time: " << m_objSrp->currentReplayTime();
|
||||
DEBUG_LOG() << "Resume request: " << request.beginTime() << ", cur playback time: " << m_objSrp->currentReplayTime();
|
||||
if (request.beginTime() != 0 && request.beginTime() != m_objSrp->currentReplayTime())
|
||||
{
|
||||
stopReplayRequest(request);
|
||||
@@ -164,10 +163,10 @@ Core::FunctionReplyObject HandlerSituationReplay::changeReplayStateRequest(const
|
||||
void HandlerSituationReplay::onChangeReplayStateRequest(const rti::core::SampleIdentity &cookie,
|
||||
const ChangeReplayStateRequest &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onChangeReplayStateRequest: " << request;
|
||||
DEBUG_LOG() << "onChangeReplayStateRequest: " << request;
|
||||
auto ret = changeReplayStateRequest(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
WARNING_LOG() << ret();
|
||||
m_ddsHandler->fts()->changeReplayStateReply(cookie, ret);
|
||||
}
|
||||
|
||||
|
||||
@@ -53,8 +53,5 @@ private:
|
||||
|
||||
int m_exerciseId;
|
||||
int m_partitionId;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
};
|
||||
}
|
||||
+12
-13
@@ -23,7 +23,6 @@ HandlerSituationReplaySqlite::HandlerSituationReplaySqlite(const std::shared_ptr
|
||||
, m_partitionId(0)
|
||||
, m_beginTime(0)
|
||||
, m_endTime(0)
|
||||
, m_logger(getLogger("HandlerSituationReplaySqlite"))
|
||||
{}
|
||||
|
||||
HandlerSituationReplaySqlite::~HandlerSituationReplaySqlite()
|
||||
@@ -58,7 +57,7 @@ bool HandlerSituationReplaySqlite::createObject(const Database::SrpSituationRepl
|
||||
{
|
||||
delete m_objSrp;
|
||||
m_objSrp = nullptr;
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
ERROR_LOG() << ret();
|
||||
return false;
|
||||
}
|
||||
connect(m_objSrp, &ObjectSituationReplay::replayTimeChanged, this, &HandlerSituationReplaySqlite::replayTimeChanged);
|
||||
@@ -71,7 +70,7 @@ bool HandlerSituationReplaySqlite::createObject(const Database::SrpSituationRepl
|
||||
|
||||
bool HandlerSituationReplaySqlite::onStartReplayRequest(qint64 begin, qint64 end, double pace)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onStartReplayRequest: " << begin << ", " << end << ", " << pace;
|
||||
DEBUG_LOG() << "onStartReplayRequest: " << begin << ", " << end << ", " << pace;
|
||||
|
||||
Database::SrpSituationReplay newData;
|
||||
newData.srpStateId = SrpState::Started;
|
||||
@@ -87,11 +86,11 @@ bool HandlerSituationReplaySqlite::onStartReplayRequest(qint64 begin, qint64 end
|
||||
|
||||
bool HandlerSituationReplaySqlite::onStopReplayRequest()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onStopReplayRequest";
|
||||
DEBUG_LOG() << "onStopReplayRequest";
|
||||
|
||||
if (m_objSrp == nullptr)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "onStopReplayRequest - internal error";
|
||||
ERROR_LOG() << "onStopReplayRequest - internal error";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -100,7 +99,7 @@ bool HandlerSituationReplaySqlite::onStopReplayRequest()
|
||||
ret = m_objSrp->removeObject();
|
||||
|
||||
if (ret.error())
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
WARNING_LOG() << ret();
|
||||
|
||||
// remove all old data from DDS-Bus & clear maps
|
||||
m_dbReader->clearData();
|
||||
@@ -112,7 +111,7 @@ bool HandlerSituationReplaySqlite::onPauseReplayRequest()
|
||||
{
|
||||
if (m_objSrp == nullptr)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "onChangeReplayStateRequest - internal error";
|
||||
ERROR_LOG() << "onChangeReplayStateRequest - internal error";
|
||||
return false;
|
||||
}
|
||||
return onChangeReplayStateRequest(SrpState::Paused, m_objSrp->pace());
|
||||
@@ -122,7 +121,7 @@ bool HandlerSituationReplaySqlite::onResumeReplayRequest()
|
||||
{
|
||||
if (m_objSrp == nullptr)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "onChangeReplayStateRequest - internal error";
|
||||
ERROR_LOG() << "onChangeReplayStateRequest - internal error";
|
||||
return false;
|
||||
}
|
||||
return onChangeReplayStateRequest(SrpState::Resumed, m_objSrp->pace());
|
||||
@@ -131,17 +130,17 @@ bool HandlerSituationReplaySqlite::onResumeReplayRequest()
|
||||
|
||||
bool HandlerSituationReplaySqlite::onChangeReplayStateRequest(const SituationReplay::SrpState &newState, double newPace)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onChangeReplayStateRequest: " << newState << ", " << newPace;
|
||||
DEBUG_LOG() << "onChangeReplayStateRequest: " << newState << ", " << newPace;
|
||||
|
||||
if (m_objSrp == nullptr)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "onChangeReplayStateRequest - internal error";
|
||||
ERROR_LOG() << "onChangeReplayStateRequest - internal error";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (newState != SrpState::Resumed && newState != SrpState::Paused)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "onChangeReplayStateRequest: SrpStateChange not possible, only resumed & paused allowed";
|
||||
ERROR_LOG() << "onChangeReplayStateRequest: SrpStateChange not possible, only resumed & paused allowed";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -149,7 +148,7 @@ bool HandlerSituationReplaySqlite::onChangeReplayStateRequest(const SituationRep
|
||||
const Core::FunctionReplyObject ret = m_objSrp->switchToState(newState);
|
||||
|
||||
if (ret.error())
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
WARNING_LOG() << ret();
|
||||
|
||||
return !ret.error();
|
||||
}
|
||||
@@ -158,7 +157,7 @@ bool HandlerSituationReplaySqlite::onPaceChangeRequest(double newPace)
|
||||
{
|
||||
if (m_objSrp == nullptr)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "onChangeReplayStateRequest - internal error";
|
||||
ERROR_LOG() << "onChangeReplayStateRequest - internal error";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
+1
-4
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <SituationReplay/situationreplaysqlite_export.h>
|
||||
#include "situationreplaysqlite_export.h"
|
||||
#include <SituationReplay/srp_enums.hpp>
|
||||
|
||||
#include <QObject>
|
||||
@@ -62,8 +62,5 @@ private:
|
||||
int m_partitionId;
|
||||
qint64 m_beginTime;
|
||||
qint64 m_endTime;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
};
|
||||
}
|
||||
@@ -10,7 +10,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <NGLLogger/INGLLogger.h>
|
||||
#include "srp_export.h"
|
||||
#include "svcsrpcommon_export.h"
|
||||
|
||||
namespace SituationReplay
|
||||
{
|
||||
|
||||
@@ -21,7 +21,6 @@ MainHandler::MainHandler()
|
||||
: m_handlerSrp(nullptr)
|
||||
, m_ddsInterface(nullptr)
|
||||
, m_dbHandler(nullptr)
|
||||
, m_logger(getLogger("MainHandler"))
|
||||
{}
|
||||
|
||||
MainHandler::~MainHandler()
|
||||
@@ -39,7 +38,7 @@ bool MainHandler::init(const SituationReplay::ConnectionParams &input,
|
||||
m_dbHandler = std::make_shared<DbHandler>();
|
||||
if (!m_dbHandler->init(input.partitionId, Settings::settings()))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Initialisation dbHandler failed.";
|
||||
ERROR_LOG() << "Initialisation dbHandler failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,5 @@ private:
|
||||
std::shared_ptr<DdsHandler> m_ddsInterface;
|
||||
std::shared_ptr<DbHandler> m_dbHandler;
|
||||
std::shared_ptr<DbReader> m_dbReader;
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
};
|
||||
} // namespace SituationReplay
|
||||
+11
-12
@@ -32,7 +32,6 @@ MainHandlerSqlite::MainHandlerSqlite()
|
||||
, m_staticPublisher(nullptr)
|
||||
, m_ddsInterface(nullptr)
|
||||
, m_dbHandler(nullptr)
|
||||
, m_logger(getLogger("MainHandlerSqlite"))
|
||||
{}
|
||||
|
||||
MainHandlerSqlite::~MainHandlerSqlite()
|
||||
@@ -54,7 +53,7 @@ bool MainHandlerSqlite::initDb(const ReplayInformation &replayInformation,
|
||||
{
|
||||
if (!m_ddsInterface)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "dds must be initialized first!";
|
||||
WARNING_LOG() << "dds must be initialized first!";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -103,15 +102,15 @@ bool MainHandlerSqlite::initDb(const ReplayInformation &replayInformation,
|
||||
m_dbHandler = std::make_shared<DbHandler>();
|
||||
if (!m_dbHandler->init(partitionIdIn, m_dbSqlite))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Initialisation dbHandler failed.";
|
||||
ERROR_LOG() << "Initialisation dbHandler failed.";
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "opening sqlite db successful";
|
||||
DEBUG_LOG() << "opening sqlite db successful";
|
||||
|
||||
m_dbReader = std::make_shared<DbReader>(m_ddsInterface->ddsReplay(), partitionIdIn, false);
|
||||
if (!m_dbReader->init(m_dbHandler->db()->database()))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Could not initialize database reader";
|
||||
ERROR_LOG() << "Could not initialize database reader";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -121,7 +120,7 @@ bool MainHandlerSqlite::initDb(const ReplayInformation &replayInformation,
|
||||
if (!initSrpHandler(partitionIdIn, m_ddsInterface->ddsReplay()->getPartitionId(),
|
||||
replayInformation.timeSpan.begin, replayInformation.timeSpan.end))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Could not initialize situation replay handler";
|
||||
ERROR_LOG() << "Could not initialize situation replay handler";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -179,14 +178,14 @@ bool MainHandlerSqlite::loadReplayConfig(const QString &replayConfigPath)
|
||||
QFile f(replayConfigPath);
|
||||
if (!f.open(QIODevice::ReadOnly))
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Could not open '" << replayConfigPath << "' for reading - no replay config loaded";
|
||||
WARNING_LOG() << "Could not open '" << replayConfigPath << "' for reading - no replay config loaded";
|
||||
return false;
|
||||
}
|
||||
QJsonParseError error;
|
||||
const QJsonDocument doc(QJsonDocument::fromJson(f.readAll(), &error));
|
||||
if (error.error != QJsonParseError::NoError)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Could not parse replay config loaded json file: " << error.errorString();
|
||||
WARNING_LOG() << "Could not parse replay config loaded json file: " << error.errorString();
|
||||
return false;
|
||||
}
|
||||
const QJsonObject obj = doc.object();
|
||||
@@ -247,7 +246,7 @@ void MainHandlerSqlite::maybeAddNewOverlay(qint64 curTime)
|
||||
return;
|
||||
m_curOverlayArrayIdx = nextIdx;
|
||||
m_currentVisibleOverlays += m_overlays.at(nextIdx);
|
||||
DEBUG_LOG(m_logger) << "Showing new overlay with id " << m_overlays.at(m_curOverlayArrayIdx).overlayId
|
||||
DEBUG_LOG() << "Showing new overlay with id " << m_overlays.at(m_curOverlayArrayIdx).overlayId
|
||||
<< " at time " << curTime;
|
||||
emit applyNewOverlay(m_overlays.at(m_curOverlayArrayIdx).overlayId);
|
||||
}
|
||||
@@ -255,7 +254,7 @@ void MainHandlerSqlite::maybeAddNewOverlay(qint64 curTime)
|
||||
|
||||
void MainHandlerSqlite::removeOutdatedOverlays(qint64 curTime)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " curTime = "<< curTime
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " curTime = "<< curTime
|
||||
<< " m_currentVisibleOverlays.size()= "<< m_currentVisibleOverlays.size();
|
||||
|
||||
const qint64 curTimeRelative = curTime - m_replay.timeSpan.begin + m_replay.relativeTimeSpan.begin; // + m_replay.relativeTimeSpan.begin
|
||||
@@ -263,7 +262,7 @@ void MainHandlerSqlite::removeOutdatedOverlays(qint64 curTime)
|
||||
{
|
||||
const qint64 endTime = m_currentVisibleOverlays.at(i).relativeTimeSpan.end;
|
||||
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " curTimeRelative = " << curTimeRelative << " endTime = " << endTime;
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " curTimeRelative = " << curTimeRelative << " endTime = " << endTime;
|
||||
|
||||
if (curTimeRelative > endTime)
|
||||
{
|
||||
@@ -309,7 +308,7 @@ int MainHandlerSqlite::findNextIndex(qint64 curTime, int curIdx, const QVector<F
|
||||
// startTime: msec, rel. to begin of SCRIPT
|
||||
const qint64 startTime = data.at(nextIdx).relativeTimeSpan.begin;
|
||||
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " curTimeRelative = " << curTimeRelative << " startTime = " << startTime;
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " curTimeRelative = " << curTimeRelative << " startTime = " << startTime;
|
||||
|
||||
if (curTimeRelative < startTime)
|
||||
return -1;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include "dds_handler.h"
|
||||
#include "logger.h"
|
||||
#include <SituationReplay/srp_db.h>
|
||||
#include <SituationReplay/situationreplaysqlite_export.h>
|
||||
#include "situationreplaysqlite_export.h"
|
||||
|
||||
namespace DDSConnector
|
||||
{
|
||||
@@ -129,7 +129,5 @@ private:
|
||||
std::shared_ptr<DbHandler> m_dbHandler;
|
||||
std::shared_ptr<DbReader> m_dbReader;
|
||||
QSqlDatabase m_dbSqlite;
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
};
|
||||
} // namespace SituationReplay
|
||||
+17
-18
@@ -27,7 +27,6 @@ ObjectSituationReplay::ObjectSituationReplay(const std::shared_ptr<DdsHandler> &
|
||||
, m_exerciseId(exerciseId)
|
||||
, m_replayTimer(new QTimer(this))
|
||||
, m_currentReplayTime(0)
|
||||
, m_logger(getLogger("ObjectSituationReplay"))
|
||||
{
|
||||
connect(m_replayTimer, &QTimer::timeout, this, &ObjectSituationReplay::onReplayTimerTimeout);
|
||||
}
|
||||
@@ -68,7 +67,7 @@ Core::FunctionReplyObject ObjectSituationReplay::createObject(const Database::Sr
|
||||
}
|
||||
|
||||
// Id is serial -> will be generated by db => inside m_data after db-insert
|
||||
DEBUG_LOG(m_logger) << "New srpId: " << m_data.id;
|
||||
DEBUG_LOG() << "New srpId: " << m_data.id;
|
||||
|
||||
switchToState(SituationReplay::SrpState_def::Stopped);
|
||||
|
||||
@@ -91,7 +90,7 @@ bool ObjectSituationReplay::setPace(double newPace)
|
||||
{
|
||||
if (newPace < 0)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Trying to set a pace < 0";
|
||||
WARNING_LOG() << "Trying to set a pace < 0";
|
||||
return false;
|
||||
}
|
||||
m_data.pace = newPace;
|
||||
@@ -114,7 +113,7 @@ bool ObjectSituationReplay::setSrpData(const Database::SrpSituationReplay &newDa
|
||||
{
|
||||
if (!m_db->update(m_data))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error updating SitReplay data in database (exerciseState)";
|
||||
ERROR_LOG() << "Error updating SitReplay data in database (exerciseState)";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -130,7 +129,7 @@ bool ObjectSituationReplay::setSrpData(const Database::SrpSituationReplay &newDa
|
||||
|
||||
// record SrpStateChange
|
||||
if (!m_db->insert(stateChange))
|
||||
WARNING_LOG(m_logger) << "Recording change of srpState failed";
|
||||
WARNING_LOG() << "Recording change of srpState failed";
|
||||
}
|
||||
|
||||
// Publish Data via DTS
|
||||
@@ -141,7 +140,7 @@ bool ObjectSituationReplay::setSrpData(const Database::SrpSituationReplay &newDa
|
||||
|
||||
bool ObjectSituationReplay::start()
|
||||
{
|
||||
INFO_LOG(m_logger) << "start: " << m_currentReplayTime;
|
||||
INFO_LOG() << "start: " << m_currentReplayTime;
|
||||
m_currentReplayTime = m_data.beginTime;
|
||||
|
||||
emit started(m_currentReplayTime);
|
||||
@@ -157,7 +156,7 @@ bool ObjectSituationReplay::start()
|
||||
|
||||
bool ObjectSituationReplay::pause()
|
||||
{
|
||||
INFO_LOG(m_logger) << "paused: " << m_currentReplayTime;
|
||||
INFO_LOG() << "paused: " << m_currentReplayTime;
|
||||
m_replayTimer->stop();
|
||||
emit paused();
|
||||
return true;
|
||||
@@ -165,7 +164,7 @@ bool ObjectSituationReplay::pause()
|
||||
|
||||
bool ObjectSituationReplay::resume()
|
||||
{
|
||||
INFO_LOG(m_logger) << "resumed" << m_currentReplayTime;
|
||||
INFO_LOG() << "resumed" << m_currentReplayTime;
|
||||
m_replayTimer->start(1000);
|
||||
emit resumed(m_currentReplayTime);
|
||||
return true;
|
||||
@@ -173,7 +172,7 @@ bool ObjectSituationReplay::resume()
|
||||
|
||||
bool ObjectSituationReplay::stop()
|
||||
{
|
||||
INFO_LOG(m_logger) << "stopped: " << m_currentReplayTime;
|
||||
INFO_LOG() << "stopped: " << m_currentReplayTime;
|
||||
m_replayTimer->stop();
|
||||
emit stopped();
|
||||
return true;
|
||||
@@ -189,10 +188,10 @@ void ObjectSituationReplay::onPublishReplayInformation()
|
||||
m_data.endTime,
|
||||
m_data.pace);
|
||||
|
||||
INFO_LOG(m_logger) << "Publish SitReplay data: " << ddsData;
|
||||
INFO_LOG() << "Publish SitReplay data: " << ddsData;
|
||||
|
||||
if (!m_ddsInterface->dts()->publish(ddsData))
|
||||
ERROR_LOG(m_logger) << "Error publishing SitReplay data to dds";
|
||||
ERROR_LOG() << "Error publishing SitReplay data to dds";
|
||||
}
|
||||
|
||||
void ObjectSituationReplay::onPublishReplayTime()
|
||||
@@ -205,13 +204,13 @@ void ObjectSituationReplay::onPublishReplayTime()
|
||||
void ObjectSituationReplay::onReplayTimerTimeout()
|
||||
{
|
||||
m_currentReplayTime += qRound64(m_data.pace * 1000);
|
||||
DEBUG_LOG(m_logger) << "onReplayTimerTimeout, endTime: " << m_data.endTime << " - " << m_currentReplayTime;
|
||||
DEBUG_LOG() << "onReplayTimerTimeout, endTime: " << m_data.endTime << " - " << m_currentReplayTime;
|
||||
checkPublishData();
|
||||
}
|
||||
|
||||
bool ObjectSituationReplay::checkPublishData()
|
||||
{
|
||||
INFO_LOG(m_logger) << " checkPublishData...";
|
||||
INFO_LOG() << " checkPublishData...";
|
||||
|
||||
onPublishReplayTime();
|
||||
if (m_data.endTime != 0 && m_data.endTime < m_currentReplayTime)
|
||||
@@ -226,7 +225,7 @@ bool ObjectSituationReplay::checkPublishData()
|
||||
// publish data for current time
|
||||
m_dbReader->publish(m_currentReplayTime);
|
||||
|
||||
if (m_logger.isInfoEnabled()) INFO_LOG(m_logger) << "m_dbReader->publish took " << timer.elapsed() << " [ms]";
|
||||
if (m_logger.isInfoEnabled()) INFO_LOG() << "m_dbReader->publish took " << timer.elapsed() << " [ms]";
|
||||
|
||||
|
||||
if (qFuzzyIsNull(m_data.pace)) // pace == 0 -> snapshot
|
||||
@@ -237,7 +236,7 @@ bool ObjectSituationReplay::checkPublishData()
|
||||
if (switchToState(SrpState_def::Stopped).error())
|
||||
return false;
|
||||
|
||||
if (m_logger.isInfoEnabled()) INFO_LOG(m_logger) << "m_dbReader->waitForAsyncOperations took " << timerReadData.elapsed() << " [ms]";
|
||||
if (m_logger.isInfoEnabled()) INFO_LOG() << "m_dbReader->waitForAsyncOperations took " << timerReadData.elapsed() << " [ms]";
|
||||
|
||||
}
|
||||
else
|
||||
@@ -248,17 +247,17 @@ bool ObjectSituationReplay::checkPublishData()
|
||||
if (!m_dbReader->readData(m_currentReplayTime, m_currentReplayTime + qRound64(m_data.pace * 1000)))
|
||||
return false;
|
||||
|
||||
if (m_logger.isInfoEnabled()) INFO_LOG(m_logger) << "m_dbReader->readData took " << timerReadData.elapsed() << " [ms]";
|
||||
if (m_logger.isInfoEnabled()) INFO_LOG() << "m_dbReader->readData took " << timerReadData.elapsed() << " [ms]";
|
||||
}
|
||||
}
|
||||
INFO_LOG(m_logger) << " checkPublishData... DONE";
|
||||
INFO_LOG() << " checkPublishData... DONE";
|
||||
return true;
|
||||
}
|
||||
|
||||
Core::FunctionReplyObject ObjectSituationReplay::switchToState(SrpState newSrpState)
|
||||
{
|
||||
Core::FunctionReplyObject ret(m_data.id);
|
||||
INFO_LOG(m_logger) << "-------------- switchTo: " << newSrpState
|
||||
INFO_LOG() << "-------------- switchTo: " << newSrpState
|
||||
<< ", current: " << m_data.srpStateId;
|
||||
if (m_data.srpStateId != newSrpState)
|
||||
{
|
||||
|
||||
+1
-4
@@ -11,7 +11,7 @@
|
||||
#include <QTimer>
|
||||
#include "dds_handler.h"
|
||||
#include "db_reader.h"
|
||||
#include <DDS/Core/function_reply_object.h>
|
||||
#include <DDS/Core/core_types.h>
|
||||
|
||||
// Generated
|
||||
#include <SituationReplay/srp_db.h>
|
||||
@@ -81,8 +81,5 @@ private:
|
||||
int m_exerciseId;
|
||||
QTimer *m_replayTimer;
|
||||
qint64 m_currentReplayTime;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user