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
@@ -32,7 +32,7 @@ CODEGEN_TOPIC_TYPEDEFS(SRCS_common ${xml_FILE})
|
||||
# generate nom_[d|f]tc.h
|
||||
CODEGEN_CLIENT_TOPICS_IFC(SRCS_common ${xml_FILE})
|
||||
|
||||
NGL_ADD_LIBRARY(AAR SV WS svcNomCommon SHARED ${SRCS_common})
|
||||
NGL_ADD_LIBRARY2(AAR SV WS svcNomCommon SHARED ${SRCS_common})
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(svcNomCommon
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
@@ -61,7 +61,7 @@ SET(SRCS_client
|
||||
# generate nom_[d|f]tc_impl.[cpp|h]
|
||||
CODEGEN_CLIENT_TOPICS_IMPL(SRCS_client ${xml_FILE})
|
||||
|
||||
NGL_ADD_LIBRARY(AAR SV WS svcNomClient SHARED ${SRCS_client})
|
||||
NGL_ADD_LIBRARY2(AAR SV WS svcNomClient SHARED ${SRCS_client})
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(svcNomClient
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
@@ -89,7 +89,7 @@ SET(SRCS_server
|
||||
# generate nom_[d|f]ts.h, nom_[d|f]ts_impl.[cpp|h]
|
||||
CODEGEN_SERVER_TOPICS(SRCS_server ${xml_FILE})
|
||||
|
||||
NGL_ADD_LIBRARY(AAR SV svcNomServer SHARED ${SRCS_server})
|
||||
NGL_ADD_LIBRARY2(AAR SV svcNomServer SHARED ${SRCS_server})
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(svcNomServer
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
|
||||
+41
-42
@@ -35,7 +35,6 @@ NomTests::NomTests(QObject *parent)
|
||||
, m_notificationId(0)
|
||||
, m_eTestStep(eUnknown)
|
||||
, m_bTestsSuccessful(true)
|
||||
, m_logger(getLogger("NomTests"))
|
||||
{
|
||||
qRegisterMetaType<Core::FunctionReply>("Core::FunctionReply");
|
||||
} // end of ctor()
|
||||
@@ -48,7 +47,7 @@ NomTests::~NomTests()
|
||||
//-----------------------------------------------------------------------------
|
||||
bool NomTests::init(int domainId, int exerciseId, int testId, int notificationId)
|
||||
{
|
||||
INFO_LOG(m_logger) << "MrkTests::init() "
|
||||
INFO_LOG() << "MrkTests::init() "
|
||||
<< " domainId:" << domainId
|
||||
<< " exerciseId:" << exerciseId
|
||||
<< " testId: " << testId
|
||||
@@ -66,22 +65,22 @@ bool NomTests::init(int domainId, int exerciseId, int testId, int notificationId
|
||||
m_ddsConnector->initPublisherSubscriber();
|
||||
|
||||
// Access to FTC
|
||||
TRACE_LOG(m_logger) << "create ftc";
|
||||
TRACE_LOG() << "create ftc";
|
||||
m_ftc = NotificationManagement::Interface::Ftc::create(m_ddsConnector);
|
||||
TRACE_LOG(m_logger) << "init ftc";
|
||||
TRACE_LOG() << "init ftc";
|
||||
bool bRet = m_ftc->enableAll();
|
||||
TRACE_LOG(m_logger) << "init end - bRet = " << bRet;
|
||||
TRACE_LOG() << "init end - bRet = " << bRet;
|
||||
|
||||
// Access to DTC
|
||||
TRACE_LOG(m_logger) << "create dtc";
|
||||
TRACE_LOG() << "create dtc";
|
||||
m_dtc = NotificationManagement::Interface::Dtc::create(m_ddsConnector);
|
||||
TRACE_LOG(m_logger) << "init dtc";
|
||||
TRACE_LOG() << "init dtc";
|
||||
bRet &= m_dtc->enableAll();
|
||||
TRACE_LOG(m_logger) << "init end - bRet = " << bRet;
|
||||
TRACE_LOG() << "init end - bRet = " << bRet;
|
||||
|
||||
|
||||
// Access to OPM DTC
|
||||
TRACE_LOG(m_logger) << "create opmDtc";
|
||||
TRACE_LOG() << "create opmDtc";
|
||||
m_opmDtc = OperatorManagement::Interface::Dtc::create(m_ddsConnector);
|
||||
m_opmDtc->enableUser();
|
||||
|
||||
@@ -91,7 +90,7 @@ bool NomTests::init(int domainId, int exerciseId, int testId, int notificationId
|
||||
//-----------------------------------------------------------------------------
|
||||
void NomTests::startTest()
|
||||
{
|
||||
INFO_LOG(m_logger) << "startTest() exerciseId:" << m_exerciseId
|
||||
INFO_LOG() << "startTest() exerciseId:" << m_exerciseId
|
||||
<< " testId:" << m_testId
|
||||
<< " notificationId:" << m_notificationId
|
||||
;
|
||||
@@ -130,10 +129,10 @@ void NomTests::tryCreate()
|
||||
CreateNotificationRequest data;
|
||||
getCreateNotificationRequestData(data);
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send CreateNotificationRequest";
|
||||
INFO_LOG() << "trying to send CreateNotificationRequest";
|
||||
if (!m_ftc->createNotificationRequest(data, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting create data";
|
||||
ERROR_LOG() << "Error requesting create data";
|
||||
failExit();
|
||||
}
|
||||
}
|
||||
@@ -192,7 +191,7 @@ void NomTests::tryCreateHQ()
|
||||
notifReq.notification(notif);
|
||||
|
||||
if (!m_ftc->createNotificationRequest(notifReq, this))
|
||||
ERROR_LOG(m_logger) << "Error requesting create Notification data";
|
||||
ERROR_LOG() << "Error requesting create Notification data";
|
||||
|
||||
} // end of tryCreate()
|
||||
|
||||
@@ -214,10 +213,10 @@ void NomTests::tryReadReceipt()
|
||||
request.notificationIds({m_notificationId});
|
||||
request.processed(true);
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send CreateNotificationRequest";
|
||||
INFO_LOG() << "trying to send CreateNotificationRequest";
|
||||
if (!m_ftc->readReceiptRequest(request, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting readReceipt data";
|
||||
ERROR_LOG() << "Error requesting readReceipt data";
|
||||
failExit();
|
||||
}
|
||||
} // end of tryReadReceipt
|
||||
@@ -231,10 +230,10 @@ void NomTests::tryRemove()
|
||||
|
||||
data.id(m_notificationId);
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send remove request for notificationId:" << data.id();
|
||||
INFO_LOG() << "trying to send remove request for notificationId:" << data.id();
|
||||
if (!m_ftc->notificationRemoveRequest(data, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting remove data for notificationId:" << data.id();
|
||||
ERROR_LOG() << "Error requesting remove data for notificationId:" << data.id();
|
||||
failExit();
|
||||
}
|
||||
*/
|
||||
@@ -245,12 +244,12 @@ void NomTests::tryRemove()
|
||||
void NomTests::tryGetAllNotifications()
|
||||
{
|
||||
m_eTestStep = eGetAllNotifications;
|
||||
DEBUG_LOG(m_logger) << "trying to get all notifications";
|
||||
DEBUG_LOG() << "trying to get all notifications";
|
||||
|
||||
m_dtc->waitForHistoricalDataNomNotification();
|
||||
if (m_dtc->nomNotifications().isEmpty())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting all notification data";
|
||||
ERROR_LOG() << "Error requesting all notification data";
|
||||
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
|
||||
return;
|
||||
}
|
||||
@@ -260,7 +259,7 @@ void NomTests::tryGetAllNotifications()
|
||||
// needed for Test 11 tryGetNotification
|
||||
m_notificationId = notif.id();
|
||||
|
||||
INFO_LOG(m_logger) << "Nom(" << notif.id() << ") :"
|
||||
INFO_LOG() << "Nom(" << notif.id() << ") :"
|
||||
<< " title:" << notif.title()
|
||||
<< " content:" << notif.content()
|
||||
<< " timeStamp:" << notif.timeStamp()
|
||||
@@ -270,7 +269,7 @@ void NomTests::tryGetAllNotifications()
|
||||
<< " processPrio: " << notif.processedPriority()
|
||||
<< " recipient count:" << notif.recipientIds().size();
|
||||
|
||||
INFO_LOG(m_logger) << "SenderAddress(" << notif.sender().id() << ") :"
|
||||
INFO_LOG() << "SenderAddress(" << notif.sender().id() << ") :"
|
||||
<< " name: " << notif.sender().name()
|
||||
<< ", addressId: " << notif.sender().addressId()
|
||||
<< ", addressSubId: " << notif.sender().addressSubId()
|
||||
@@ -285,14 +284,14 @@ void NomTests::tryGetAllNotifications()
|
||||
//-----------------------------------------------------------------------------
|
||||
void NomTests::tryGetNotification()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "trying to get notification with id:" << m_notificationId;
|
||||
DEBUG_LOG() << "trying to get notification with id:" << m_notificationId;
|
||||
|
||||
if (m_testId > 1)
|
||||
m_eTestStep = eGetNotification;
|
||||
|
||||
if (m_notificationId <= 0)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "invalid notificationId - test aborted.";
|
||||
ERROR_LOG() << "invalid notificationId - test aborted.";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -301,12 +300,12 @@ void NomTests::tryGetNotification()
|
||||
|
||||
if (notif.id() <= 0)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error receiving data for notificationId " << m_notificationId << " returnVal:" << notif.id();
|
||||
ERROR_LOG() << "Error receiving data for notificationId " << m_notificationId << " returnVal:" << notif.id();
|
||||
failExit();
|
||||
}
|
||||
else
|
||||
{
|
||||
INFO_LOG(m_logger) << "NomNotification(" << notif.id() << ") :"
|
||||
INFO_LOG() << "NomNotification(" << notif.id() << ") :"
|
||||
<< " title:" << notif.title()
|
||||
<< " content:" << notif.content()
|
||||
<< " timeStamp:" << notif.timeStamp()
|
||||
@@ -318,7 +317,7 @@ void NomTests::tryGetNotification()
|
||||
|
||||
for (const NotificationManagement::Address &addr : notif.recipientIds())
|
||||
{
|
||||
INFO_LOG(m_logger) << "Recipient(" << addr.id() << ") :"
|
||||
INFO_LOG() << "Recipient(" << addr.id() << ") :"
|
||||
<< " name: " << addr.name()
|
||||
<< ", addressId: " << addr.addressId()
|
||||
<< ", addressSubId: " << addr.addressSubId()
|
||||
@@ -327,7 +326,7 @@ void NomTests::tryGetNotification()
|
||||
<< ", isRead: " << addr.isRead();
|
||||
}
|
||||
|
||||
INFO_LOG(m_logger) << "SenderAddress(" << notif.sender().id() << ") :"
|
||||
INFO_LOG() << "SenderAddress(" << notif.sender().id() << ") :"
|
||||
<< " name: " << notif.sender().name()
|
||||
<< ", addressId: " << notif.sender().addressId()
|
||||
<< ", addressSubId: " << notif.sender().addressSubId()
|
||||
@@ -341,7 +340,7 @@ void NomTests::tryGetNotification()
|
||||
{
|
||||
if (! onCompareCreatedData(notif))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Compare created data failed!";
|
||||
ERROR_LOG() << "Compare created data failed!";
|
||||
failExit();
|
||||
}
|
||||
else
|
||||
@@ -360,19 +359,19 @@ void NomTests::tryGetNotification()
|
||||
//-----------------------------------------------------------------------------
|
||||
void NomTests::onCreateNotificationReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
INFO_LOG(m_logger) << "Got createReply with id " << replyObject.id()
|
||||
INFO_LOG() << "Got createReply with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.translated();
|
||||
|
||||
m_notificationId = replyObject.id();
|
||||
|
||||
if (replyObject.error())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting create data";
|
||||
ERROR_LOG() << "Error requesting create data";
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
else
|
||||
DEBUG_LOG(m_logger) << "Requesting create data ok. Got new id:" << replyObject.id() << " ... ok.";
|
||||
DEBUG_LOG() << "Requesting create data ok. Got new id:" << replyObject.id() << " ... ok.";
|
||||
|
||||
if (m_testId == 0)
|
||||
// QTimer::singleShot(0, this, &NomTests::tryModify()));
|
||||
@@ -386,17 +385,17 @@ void NomTests::onCreateNotificationReply(const Core::FunctionReplyObject &replyO
|
||||
void NomTests::onReadReceiptReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
|
||||
INFO_LOG(m_logger) << "Got onReadReceipt with id " << replyObject.id()
|
||||
INFO_LOG() << "Got onReadReceipt with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.translated();
|
||||
|
||||
if (replyObject.error())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting ReadReceipt data for id:" << replyObject.id();
|
||||
ERROR_LOG() << "Error requesting ReadReceipt data for id:" << replyObject.id();
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
else
|
||||
DEBUG_LOG(m_logger) << "Requesting ReadReceipt data for id:" << replyObject.id() << " ... ok.";
|
||||
DEBUG_LOG() << "Requesting ReadReceipt data for id:" << replyObject.id() << " ... ok.";
|
||||
|
||||
if (m_testId == 0)
|
||||
// QTimer::singleShot(0, this, &MrkTests::tryDelete()));
|
||||
@@ -410,17 +409,17 @@ void NomTests::onReadReceiptReply(const Core::FunctionReplyObject &replyObject)
|
||||
/*
|
||||
void NomTests::onNotificationRemoveReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
INFO_LOG(m_logger) << "Got removeReply with id " << replyObject.id()
|
||||
INFO_LOG() << "Got removeReply with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.translated();
|
||||
|
||||
if (replyObject.error())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting remove data for NotificationId:" << replyObject.id();
|
||||
ERROR_LOG() << "Error requesting remove data for NotificationId:" << replyObject.id();
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
else
|
||||
DEBUG_LOG(m_logger) << "Requesting remove data for NotificationId:" << replyObject.id() << " ... ok.";
|
||||
DEBUG_LOG() << "Requesting remove data for NotificationId:" << replyObject.id() << " ... ok.";
|
||||
|
||||
if (m_testId == 0)
|
||||
{
|
||||
@@ -436,21 +435,21 @@ void NomTests::onNotificationRemoveReply(const Core::FunctionReplyObject &replyO
|
||||
//-----------------------------------------------------------------------------
|
||||
void NomTests::onReceiveNotificationChanged(const NomNotification &data, DataModification modType)
|
||||
{
|
||||
// INFO_LOG(m_logger) << "onReceiveNotificationChanged() notificationId:" << data.id()
|
||||
// INFO_LOG() << "onReceiveNotificationChanged() notificationId:" << data.id()
|
||||
// << " modificationType: = " << (int)modType<< " received";
|
||||
|
||||
switch (modType)
|
||||
{
|
||||
case DataModification::eAdded:
|
||||
INFO_LOG(m_logger) << "*** NomNotification added received. notificationId:" << data.id();
|
||||
INFO_LOG() << "*** NomNotification added received. notificationId:" << data.id();
|
||||
break;
|
||||
|
||||
case DataModification::eModified:
|
||||
INFO_LOG(m_logger) << "*** NomNotification modified received. notificationId:" << data.id();
|
||||
INFO_LOG() << "*** NomNotification modified received. notificationId:" << data.id();
|
||||
break;
|
||||
|
||||
case DataModification::eRemoved:
|
||||
INFO_LOG(m_logger) << "*** NomNotification removed received. notificationId:" << data.id();
|
||||
INFO_LOG() << "*** NomNotification removed received. notificationId:" << data.id();
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -506,7 +505,7 @@ void NomTests::getCreateNotificationRequestData(CreateNotificationRequest &data)
|
||||
//-----------------------------------------------------------------------------
|
||||
bool NomTests::onCompareCreatedData(NomNotification &data)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "start onCompareCreatedData() for id :" << data.id();
|
||||
DEBUG_LOG() << "start onCompareCreatedData() for id :" << data.id();
|
||||
|
||||
// Vergleicht die zurueckgelesen Datan mit den statischen create Daten
|
||||
|
||||
|
||||
-2
@@ -96,8 +96,6 @@ private:
|
||||
} m_eTestStep;
|
||||
|
||||
bool m_bTestsSuccessful;
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
};
|
||||
|
||||
} // namespace NotificationManagement
|
||||
@@ -15,9 +15,8 @@ namespace NotificationManagement
|
||||
|
||||
DdsHandler::DdsHandler(int domainId)
|
||||
: m_ddsConnector(std::make_shared<DDSConnector::DdsConnector>(domainId, IDL::PartitionType::AllExercises))
|
||||
, m_logger(getLogger("DdsHandler"))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
DEBUG_LOG() << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
} // end of ctor()DdsHandler
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -25,7 +24,7 @@ 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;
|
||||
}
|
||||
|
||||
@@ -42,22 +41,22 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
// DTS
|
||||
m_ddsDts = NotificationManagement::Interface::Dts::create(m_ddsConnector);
|
||||
bool bRet = m_ddsDts->enableAll();
|
||||
INFO_LOG(m_logger) << "Dts initialised";
|
||||
INFO_LOG() << "Dts initialised";
|
||||
|
||||
// FTS
|
||||
m_ddsFts = NotificationManagement::Interface::Fts::create(m_ddsConnector);
|
||||
bRet &= m_ddsFts->enableAll();
|
||||
INFO_LOG(m_logger) << "Fts initialised";
|
||||
INFO_LOG() << "Fts initialised";
|
||||
|
||||
// DtcExm
|
||||
m_dtcExm = ExerciseManagement::Interface::Dtc::create(m_ddsConnector);
|
||||
bRet &= m_dtcExm->enableExercise();
|
||||
INFO_LOG(m_logger) << "DtcExm initialised";
|
||||
INFO_LOG() << "DtcExm initialised";
|
||||
|
||||
// DtcOpm
|
||||
m_dtcOpm = OperatorManagement::Interface::Dtc::create(m_ddsConnector);
|
||||
bRet &= m_dtcOpm->enableUser();
|
||||
INFO_LOG(m_logger) << "DtcOpm initialised";
|
||||
INFO_LOG() << "DtcOpm initialised";
|
||||
|
||||
return bRet;
|
||||
} // end of init()
|
||||
|
||||
@@ -55,7 +55,6 @@ private:
|
||||
std::shared_ptr<NotificationManagement::Interface::Fts> m_ddsFts;
|
||||
std::shared_ptr<ExerciseManagement::Interface::Dtc> m_dtcExm;
|
||||
std::shared_ptr<OperatorManagement::Interface::Dtc> m_dtcOpm;
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
}
|
||||
+17
-18
@@ -25,7 +25,6 @@ HandlerNotification::HandlerNotification(const std::shared_ptr<DdsHandler> &ddsH
|
||||
, m_removeNotificationTimer(new QTimer())
|
||||
, m_ddsHandler(ddsHandler)
|
||||
, m_db(db)
|
||||
, m_logger(getLogger("HandlerNotification"))
|
||||
{
|
||||
} // end of ctor()
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -38,14 +37,14 @@ HandlerNotification::~HandlerNotification()
|
||||
|
||||
bool HandlerNotification::init()
|
||||
{
|
||||
INFO_LOG(m_logger) << "--- Start NotificationManagement HandlerNotification.";
|
||||
INFO_LOG() << "--- Start NotificationManagement HandlerNotification.";
|
||||
|
||||
QVector<Database::NomAddress> dataAddressVec;
|
||||
|
||||
// read all addresses from database
|
||||
if (!m_db->select(dataAddressVec))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error reading address data from database!";
|
||||
ERROR_LOG() << "Error reading address data from database!";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -59,7 +58,7 @@ bool HandlerNotification::init()
|
||||
// Remove old notifications
|
||||
if (isRemoveable(notif))
|
||||
{
|
||||
INFO_LOG(m_logger) << "Remove old notification " << notif.title() << ", id = " << notif.id();
|
||||
INFO_LOG() << "Remove old notification " << notif.title() << ", id = " << notif.id();
|
||||
removeNotificationIds.append(notif.id());
|
||||
return;
|
||||
}
|
||||
@@ -82,7 +81,7 @@ bool HandlerNotification::init()
|
||||
if (ret.error())
|
||||
{
|
||||
delete ifs;
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
ERROR_LOG() << ret();
|
||||
bRet = false;
|
||||
return;
|
||||
}
|
||||
@@ -90,7 +89,7 @@ bool HandlerNotification::init()
|
||||
};
|
||||
if (!m_db->select(cb) || !bRet)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error reading data from database!";
|
||||
ERROR_LOG() << "Error reading data from database!";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -100,11 +99,11 @@ bool HandlerNotification::init()
|
||||
m_db->removeNomNotification(notificationId);
|
||||
trans.commit();
|
||||
|
||||
DEBUG_LOG(m_logger) << "m_objectNotificationMap.size() = " << m_objectNotificationMap.size();
|
||||
DEBUG_LOG() << "m_objectNotificationMap.size() = " << m_objectNotificationMap.size();
|
||||
|
||||
if (!m_ddsHandler->fts())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "m_ddsHandler->fts() == nullptr!";
|
||||
ERROR_LOG() << "m_ddsHandler->fts() == nullptr!";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -119,8 +118,8 @@ bool HandlerNotification::init()
|
||||
connect(m_removeNotificationTimer, &QTimer::timeout, this, &HandlerNotification::onCheckRemove);
|
||||
m_removeNotificationTimer->start();
|
||||
|
||||
DEBUG_LOG(m_logger) << "removeTimerInterval: " << Settings::removeTimerIntervalMSec();
|
||||
DEBUG_LOG(m_logger) << "expiryTime: " << Settings::expiryIntervalMSec();
|
||||
DEBUG_LOG() << "removeTimerInterval: " << Settings::removeTimerIntervalMSec();
|
||||
DEBUG_LOG() << "expiryTime: " << Settings::expiryIntervalMSec();
|
||||
|
||||
return true;
|
||||
} // end of init()
|
||||
@@ -129,14 +128,14 @@ bool HandlerNotification::init()
|
||||
void HandlerNotification::onCreateNotificationRequest(const rti::core::SampleIdentity &cookie,
|
||||
const CreateNotification &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onCreateNotificationRequest: " << request;
|
||||
DEBUG_LOG() << "onCreateNotificationRequest: " << request;
|
||||
|
||||
ObjectNotification *ifs(new ObjectNotification(m_ddsHandler, m_db));
|
||||
const Core::FunctionReplyObject ret = ifs->createObject(request.notification());
|
||||
if (ret.error())
|
||||
{
|
||||
delete ifs;
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
WARNING_LOG() << ret();
|
||||
m_ddsHandler->fts()->createNotificationReply(cookie, ret);
|
||||
return;
|
||||
}
|
||||
@@ -150,7 +149,7 @@ void HandlerNotification::onCreateNotificationRequest(const rti::core::SampleIde
|
||||
void HandlerNotification::onReadReceiptRequest(const rti::core::SampleIdentity &cookie,
|
||||
const ReadReceipt &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onReadReceiptRequest: " << request;
|
||||
DEBUG_LOG() << "onReadReceiptRequest: " << request;
|
||||
Core::FunctionReplyObject ret;
|
||||
|
||||
for (const auto notificationId : request.notificationIds())
|
||||
@@ -171,7 +170,7 @@ void HandlerNotification::onReadReceiptRequest(const rti::core::SampleIdentity &
|
||||
|
||||
void HandlerNotification::onDeleteMessageRequest(const rti::core::SampleIdentity &cookie, const DeleteMessage &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onDeleteMessageRequest: " << request;
|
||||
DEBUG_LOG() << "onDeleteMessageRequest: " << request;
|
||||
Core::FunctionReplyObject ret;
|
||||
|
||||
for (const auto notificationId : request.notificationIds())
|
||||
@@ -204,10 +203,10 @@ void HandlerNotification::onExerciseChanged(const ExerciseManagement::Exercise &
|
||||
if (obj->notification().exerciseId() != data.id())
|
||||
continue;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Remove notification " << obj->id();
|
||||
DEBUG_LOG() << "Remove notification " << obj->id();
|
||||
Core::FunctionReplyObject ret = obj->removeObject();
|
||||
if (ret.error())
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
ERROR_LOG() << ret();
|
||||
else
|
||||
{
|
||||
// delete ObjectNotification
|
||||
@@ -230,10 +229,10 @@ void HandlerNotification::onCheckRemove()
|
||||
if (!isRemoveable(notif))
|
||||
continue;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Remove notification " << obj->id();
|
||||
DEBUG_LOG() << "Remove notification " << obj->id();
|
||||
Core::FunctionReplyObject ret = obj->removeObject();
|
||||
if (ret.error())
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
ERROR_LOG() << ret();
|
||||
else
|
||||
{
|
||||
// delete ObjectNotification
|
||||
|
||||
-2
@@ -50,8 +50,6 @@ private: // attributes
|
||||
QTimer* m_removeNotificationTimer;
|
||||
std::shared_ptr<DdsHandler> m_ddsHandler;
|
||||
std::shared_ptr<DatabaseInterface> m_db;
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
QHash<int, ObjectNotification *> m_objectNotificationMap; // Key = notificationId
|
||||
};
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <NGLLogger/INGLLogger.h>
|
||||
#include "nom_export.h"
|
||||
#include "svcnomcommon_export.h"
|
||||
|
||||
namespace NotificationManagement
|
||||
{
|
||||
|
||||
+10
-10
@@ -18,13 +18,13 @@ namespace NotificationManagement
|
||||
MainHandler::MainHandler()
|
||||
: m_logger(getLogger("MainHandler"))
|
||||
{
|
||||
INFO_LOG(m_logger) << "MainHandler::MainHandler";
|
||||
INFO_LOG() << "MainHandler::MainHandler";
|
||||
} // end of ctor()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
MainHandler::~MainHandler()
|
||||
{
|
||||
INFO_LOG(m_logger) << "MainHandler::~MainHandler";
|
||||
INFO_LOG() << "MainHandler::~MainHandler";
|
||||
m_ddsHandler = nullptr;
|
||||
m_dbHandler = nullptr;
|
||||
} // end of dtor()
|
||||
@@ -32,38 +32,38 @@ MainHandler::~MainHandler()
|
||||
|
||||
bool MainHandler::init(int domainId)
|
||||
{
|
||||
INFO_LOG(m_logger) << "Start MessageDataManagement MainHandler. domainId ="<<domainId;
|
||||
INFO_LOG() << "Start MessageDataManagement MainHandler. domainId ="<<domainId;
|
||||
|
||||
// initialize DDS
|
||||
m_ddsHandler = std::make_shared<DdsHandler>(domainId);
|
||||
if (!m_ddsHandler->init())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Initialisation DdsHandler failed.";
|
||||
ERROR_LOG() << "Initialisation DdsHandler failed.";
|
||||
if (m_ddsHandler->pacemaker())
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError);
|
||||
return false;
|
||||
}
|
||||
INFO_LOG(m_logger) << "m_ddsHandler initialized. ";
|
||||
INFO_LOG() << "m_ddsHandler initialized. ";
|
||||
|
||||
// initialize database
|
||||
m_dbHandler = std::make_shared<DbHandler>();
|
||||
if (!m_dbHandler->init(0, Settings::settings()))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Initialisation DbHandler failed.";
|
||||
ERROR_LOG() << "Initialisation DbHandler failed.";
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError);
|
||||
return false;
|
||||
}
|
||||
INFO_LOG(m_logger) << "DbHandler initialized. ";
|
||||
INFO_LOG() << "DbHandler initialized. ";
|
||||
|
||||
INFO_LOG(m_logger) << "create HandlerNotification. ";
|
||||
INFO_LOG() << "create HandlerNotification. ";
|
||||
m_handlerNotification = std::make_shared<HandlerNotification>(m_ddsHandler, m_dbHandler->db());
|
||||
if (!m_handlerNotification->init())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "create HandlerNotification failed.";
|
||||
ERROR_LOG() << "create HandlerNotification failed.";
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError);
|
||||
return false;
|
||||
}
|
||||
INFO_LOG(m_logger) << "HandlerNotification initialized";
|
||||
INFO_LOG() << "HandlerNotification initialized";
|
||||
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::Running);
|
||||
//m_ddsHandler->enableEquipmentMessage();
|
||||
|
||||
@@ -35,7 +35,7 @@ private: // attributes
|
||||
std::shared_ptr<DdsHandler> m_ddsHandler; ///< Pointer to DDS handler
|
||||
std::shared_ptr<DbHandler> m_dbHandler; ///< Pointer to DB handler
|
||||
std::shared_ptr<HandlerNotification> m_handlerNotification;
|
||||
NGL::INGLLogger &m_logger; ///< Interface to the Logging-Facility
|
||||
|
||||
|
||||
};
|
||||
} // namespace NotificationManagement
|
||||
+18
-19
@@ -25,7 +25,6 @@ const QString CONTENT_ARG = QStringLiteral("contentArg");
|
||||
ObjectNotification::ObjectNotification(const std::shared_ptr<DdsHandler> &ddsHandler, const std::shared_ptr<DatabaseInterface> &db)
|
||||
: m_ddsHandler(ddsHandler)
|
||||
, m_db(db)
|
||||
, m_logger(getLogger("ObjectNotification"))
|
||||
{
|
||||
} // end of ctor()
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -47,9 +46,9 @@ Core::FunctionReplyObject ObjectNotification::createObject(const NomNotification
|
||||
|
||||
// Neue DB Id in lokale Struktur uebernehmen
|
||||
m_dataNotificationObject.id(dbDataNotification.id);
|
||||
DEBUG_LOG(m_logger) << "New NotificationId: " << dbDataNotification.id;
|
||||
DEBUG_LOG() << "New NotificationId: " << dbDataNotification.id;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Handle Address for notificationId:" << dbDataNotification.id << " number of depending recipients: " << data.recipientIds().size();
|
||||
DEBUG_LOG() << "Handle Address for notificationId:" << dbDataNotification.id << " number of depending recipients: " << data.recipientIds().size();
|
||||
|
||||
// Behandlung von Recipients
|
||||
for (size_t i = 0; i < data.recipientIds().size(); ++i)
|
||||
@@ -99,7 +98,7 @@ QString ObjectNotification::contentArgsToJson()
|
||||
|
||||
for (const std::string& arg : std::as_const(m_dataNotificationObject.contentArgs()))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << ".arg() ersetzt immer den kleinsten freien Platzhalter"
|
||||
DEBUG_LOG() << ".arg() ersetzt immer den kleinsten freien Platzhalter"
|
||||
<< ", arg=" << arg;
|
||||
QJsonObject argObj;
|
||||
argObj[CONTENT_ID] = i;
|
||||
@@ -111,18 +110,18 @@ QString ObjectNotification::contentArgsToJson()
|
||||
mainObject[TRANSLATION_ARGS] = jsonArray;
|
||||
|
||||
QJsonDocument doc(mainObject);
|
||||
DEBUG_LOG(m_logger) << "ObjectNotification::contentArgsToJson properties=" << QString::fromUtf8(doc.toJson(QJsonDocument::Compact));
|
||||
DEBUG_LOG() << "ObjectNotification::contentArgsToJson properties=" << QString::fromUtf8(doc.toJson(QJsonDocument::Compact));
|
||||
return QString::fromUtf8(doc.toJson(QJsonDocument::Compact));
|
||||
}
|
||||
|
||||
std::vector<std::string> ObjectNotification::jsonToContentArgs(const QString &jsonString)
|
||||
{
|
||||
//DEBUG_LOG(m_logger) << "jsonToContentArgs jsonString=" << jsonString;
|
||||
//DEBUG_LOG() << "jsonToContentArgs jsonString=" << jsonString;
|
||||
std::vector<std::string> result;
|
||||
// 1. String parsen
|
||||
QJsonDocument doc = QJsonDocument::fromJson(jsonString.toUtf8());
|
||||
if (!doc.isObject()) {
|
||||
//WARNING_LOG(m_logger) << "properties: Invalid JSON-Object";
|
||||
//WARNING_LOG() << "properties: Invalid JSON-Object";
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -130,7 +129,7 @@ std::vector<std::string> ObjectNotification::jsonToContentArgs(const QString &js
|
||||
|
||||
// 2. Das Array aus "translationsArgs" herausholen
|
||||
if (!hauptObjekt.contains(TRANSLATION_ARGS) || !hauptObjekt[TRANSLATION_ARGS].isArray()) {
|
||||
//WARNING_LOG(m_logger) << "Missing or invalid 'translationsArgs' key (must be an array).";
|
||||
//WARNING_LOG() << "Missing or invalid 'translationsArgs' key (must be an array).";
|
||||
return result;
|
||||
}
|
||||
QJsonArray jsonArray = hauptObjekt[TRANSLATION_ARGS].toArray();
|
||||
@@ -149,8 +148,8 @@ std::vector<std::string> ObjectNotification::jsonToContentArgs(const QString &js
|
||||
// 4. Zugriff über die ID testen
|
||||
if (sucheMap.contains(gesuchteId)) {
|
||||
QJsonObject treffer = sucheMap[gesuchteId];
|
||||
//DEBUG_LOG(m_logger) << "ID" << gesuchteId << "gefunden!";
|
||||
//DEBUG_LOG(m_logger) << "Inhalt:" << treffer[CONTENT_ARG].toString();
|
||||
//DEBUG_LOG() << "ID" << gesuchteId << "gefunden!";
|
||||
//DEBUG_LOG() << "Inhalt:" << treffer[CONTENT_ARG].toString();
|
||||
QString contentStr = treffer[CONTENT_ARG].toString();
|
||||
result.emplace_back(contentStr.toStdString());
|
||||
} else {
|
||||
@@ -178,7 +177,7 @@ Core::FunctionReplyObject ObjectNotification::readReceipt(const ReadReceipt &dat
|
||||
continue;
|
||||
|
||||
dbDataAddr = toDbData(recipientAddr);
|
||||
DEBUG_LOG(m_logger) << "Found Operator " << data.operatorId() << " with repicpentID " << dbDataAddr.id;
|
||||
DEBUG_LOG() << "Found Operator " << data.operatorId() << " with repicpentID " << dbDataAddr.id;
|
||||
dbDataAddr.notificationId = dbDataNotification.id;
|
||||
|
||||
break;
|
||||
@@ -207,7 +206,7 @@ Core::FunctionReplyObject ObjectNotification::readReceipt(const ReadReceipt &dat
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Notification already processed id=" << notificationId;
|
||||
DEBUG_LOG() << "Notification already processed id=" << notificationId;
|
||||
return Core::FunctionReplyObject(dbDataNotification.processed, {}, {}, tr_lts("dds", "Notification already processed"));
|
||||
}
|
||||
}
|
||||
@@ -217,7 +216,7 @@ Core::FunctionReplyObject ObjectNotification::readReceipt(const ReadReceipt &dat
|
||||
|
||||
trans.commit();
|
||||
|
||||
INFO_LOG(m_logger) << "Data changed for NotificationId: " << m_dataNotificationObject.id();
|
||||
INFO_LOG() << "Data changed for NotificationId: " << m_dataNotificationObject.id();
|
||||
|
||||
const std::vector<Address> recipients = m_dataNotificationObject.recipientIds();
|
||||
const Address sender = m_dataNotificationObject.sender();
|
||||
@@ -250,7 +249,7 @@ Core::FunctionReplyObject ObjectNotification::deleteMessage(const DeleteMessage
|
||||
|
||||
for (const Address &recipientAddr : std::as_const(m_dataNotificationObject.recipientIds()))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "recipientAddr="
|
||||
DEBUG_LOG() << "recipientAddr="
|
||||
<< ", id: " << recipientAddr.id() << ", addressId: " << recipientAddr.addressId() << ", isDeleted: " << recipientAddr.isDeleted();
|
||||
if (data.operatorId() > 0 && recipientAddr.addressType() == AddressType_def::Operator && recipientAddr.addressId() != data.operatorId())
|
||||
continue;
|
||||
@@ -276,7 +275,7 @@ Core::FunctionReplyObject ObjectNotification::deleteMessage(const DeleteMessage
|
||||
|
||||
trans.commit();
|
||||
|
||||
INFO_LOG(m_logger) << "Data changed for NotificationId: " << m_dataNotificationObject.id();
|
||||
INFO_LOG() << "Data changed for NotificationId: " << m_dataNotificationObject.id();
|
||||
|
||||
std::vector<Address> recipients = m_dataNotificationObject.recipientIds();
|
||||
Address sender = m_dataNotificationObject.sender();
|
||||
@@ -285,7 +284,7 @@ Core::FunctionReplyObject ObjectNotification::deleteMessage(const DeleteMessage
|
||||
|
||||
for (const Address &addr : std::as_const(recipients))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "addr="
|
||||
DEBUG_LOG() << "addr="
|
||||
<< ", id: " << addr.id() << ", addressId: " << addr.addressId() << ", isDeleted: " << addr.isDeleted();
|
||||
|
||||
if (addr.id() == dbDataAddr.id)
|
||||
@@ -303,7 +302,7 @@ Core::FunctionReplyObject ObjectNotification::deleteMessage(const DeleteMessage
|
||||
|
||||
Core::FunctionReplyObject ObjectNotification::deleteObject(const DeleteMessage &data, int notificationId)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "ObjectNotification::deleteObject"
|
||||
DEBUG_LOG() << "ObjectNotification::deleteObject"
|
||||
<< ", notificationId: " << notificationId << ", addressId: " << data.addressId() << ", operatorId: " << data.operatorId()
|
||||
<< ", workstationId: " << data.workstationId();
|
||||
deleteMessage(data, notificationId);
|
||||
@@ -329,10 +328,10 @@ bool ObjectNotification::isValid() const { return m_dataNotificationObject.id()
|
||||
|
||||
void ObjectNotification::onPublishData()
|
||||
{
|
||||
INFO_LOG(m_logger) << "Publish NomNotification-data to dds notificationId:" << m_dataNotificationObject.id();
|
||||
INFO_LOG() << "Publish NomNotification-data to dds notificationId:" << m_dataNotificationObject.id();
|
||||
|
||||
if (!m_ddsHandler->dts()->publish(m_dataNotificationObject))
|
||||
WARNING_LOG(m_logger) << "Error publishing NomNotification-data to dds";
|
||||
WARNING_LOG() << "Error publishing NomNotification-data to dds";
|
||||
|
||||
} // end of onPublishData()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
+1
-4
@@ -10,7 +10,7 @@
|
||||
|
||||
#include "dds_handler.h"
|
||||
//#include "nom_db.h"
|
||||
#include <DDS/Core/function_reply_object.h>
|
||||
#include <DDS/Core/core_types.h>
|
||||
|
||||
// Generated
|
||||
#include <NotificationManagement/nom_db.h>
|
||||
@@ -58,8 +58,5 @@ private:
|
||||
std::shared_ptr<DdsHandler> m_ddsHandler;
|
||||
std::shared_ptr<DatabaseInterface> m_db;
|
||||
NomNotification m_dataNotificationObject;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
};
|
||||
} // namespace NotificationManagement
|
||||
Reference in new issue
Block a user