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:
torstenandCopilot committed 2026-08-19 06:06:24 +02:00
1 parent 010f91928a
commit b774f4035c
2785 files changed
+18754 -18316

No files matched your search

@@ -31,7 +31,7 @@ CODEGEN_TOPIC_TYPEDEFS(SRCS_common ${xml_FILE})
# Generate alm_[d|f]tc.h
CODEGEN_CLIENT_TOPICS_IFC(SRCS_common ${xml_FILE})
NGL_ADD_LIBRARY(AAR SV WS svcAlmCommon SHARED ${SRCS_common})
NGL_ADD_LIBRARY2(AAR SV WS svcAlmCommon SHARED ${SRCS_common})
NGL_TARGET_INCLUDE_DIRECTORIES(svcAlmCommon
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../
@@ -60,7 +60,7 @@ SET(SRCS_client
# generate alm_[d|f]tc.h, tlm_[d|f]tc_impl.[cpp|h]
CODEGEN_CLIENT_TOPICS_IMPL(SRCS_client ${xml_FILE})
NGL_ADD_LIBRARY(AAR SV WS svcAlmClient SHARED ${SRCS_client})
NGL_ADD_LIBRARY2(AAR SV WS svcAlmClient SHARED ${SRCS_client})
NGL_TARGET_INCLUDE_DIRECTORIES(svcAlmClient
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../
@@ -105,7 +105,7 @@ CODEGEN_SERVER_TOPICS(SRCS_server ${xml_FILE})
# Generate alm.sql, alm.xml
CODEGEN_SQL(SRCS_server ${xml_FILE})
NGL_ADD_LIBRARY(AAR SV svcAlmServer SHARED ${SRCS_server})
NGL_ADD_LIBRARY2(AAR SV svcAlmServer SHARED ${SRCS_server})
NGL_TARGET_INCLUDE_DIRECTORIES(svcAlmServer
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../
@@ -34,7 +34,6 @@ AlmTests::AlmTests(QObject *parent)
: QObject(parent)
, m_testId(0)
, m_bTestsSuccessful(true)
, m_logger(getLogger("AlmTests"))
, m_participantIndex(0)
{}
@@ -45,7 +44,7 @@ AlmTests::~AlmTests()
// ------------------------------------------------------------------
bool AlmTests::init(int domainId, int testId, int operatorId)
{
INFO_LOG(m_logger) << "init begin";
INFO_LOG() << "init begin";
m_testId = testId;
m_operatorId = operatorId;
@@ -74,7 +73,7 @@ bool AlmTests::init(int domainId, int testId, int operatorId)
// ------------------------------------------------------------------
void AlmTests::startTest()
{
INFO_LOG(m_logger) << "startTest m_testId=" << m_testId;
INFO_LOG() << "startTest m_testId=" << m_testId;
if (m_testId <= 1) // Send FTC ConfigureAlarms and EEM Event
{
QTimer::singleShot(0, this, &AlmTests::tryConfigureAlarms);
@@ -103,7 +102,7 @@ void AlmTests::startTest()
// ------------------------------------------------------------------
void AlmTests::tryConfigureAlarms()
{
INFO_LOG(m_logger) << "trying to send createRequest Operator Message";
INFO_LOG() << "trying to send createRequest Operator Message";
std::vector<AlarmManagement::AlarmAction> alarms;
alarms.resize(2);
@@ -125,7 +124,7 @@ void AlmTests::tryConfigureAlarms()
if (!m_ftcAlm->configureAlarmsRequest(ConfigureAlarmsRequest(alarms, m_operatorId, participantIds, globalEvent, remove), this))
{
ERROR_LOG(m_logger) << "Error requesting create data";
ERROR_LOG() << "Error requesting create data";
failExit();
}
} // tryConfigureAlarms
@@ -133,7 +132,7 @@ void AlmTests::tryConfigureAlarms()
// ------------------------------------------------------------------
void AlmTests::tryCreateParticipant()
{
INFO_LOG(m_logger) << "trying to create Participant index = " << m_participantIndex;
INFO_LOG() << "trying to create Participant index = " << m_participantIndex;
ParticipantManagement::Participant participant;
switch (m_participantIndex)
{
@@ -154,10 +153,10 @@ void AlmTests::tryCreateParticipant()
participant.partyId(5);
break;
}
DEBUG_LOG(m_logger) << "Publishing Participant";
DEBUG_LOG() << "Publishing Participant";
if (!m_dtsPpm->publish(participant))
{
ERROR_LOG(m_logger) << "Error publish Participant";
ERROR_LOG() << "Error publish Participant";
failExit();
}
m_participantIndex++;
@@ -166,7 +165,7 @@ void AlmTests::tryCreateParticipant()
// ------------------------------------------------------------------
void AlmTests::tryConfigureAlarmsList()
{
INFO_LOG(m_logger) << "trying to send createRequest Operator Message";
INFO_LOG() << "trying to send createRequest Operator Message";
std::vector<AlarmManagement::AlarmAction> alarms;
alarms.resize(2);
@@ -189,7 +188,7 @@ void AlmTests::tryConfigureAlarmsList()
if (!m_ftcAlm->configureAlarmsRequest(ConfigureAlarmsRequest(alarms, m_operatorId, participantIds, globalEvent, remove), this))
{
ERROR_LOG(m_logger) << "Error requesting create data";
ERROR_LOG() << "Error requesting create data";
failExit();
}
} // tryConfigureAlarmsList
@@ -197,7 +196,7 @@ void AlmTests::tryConfigureAlarmsList()
// ------------------------------------------------------------------
void AlmTests::trySendEvent()
{
INFO_LOG(m_logger) << "trying to send ParticipantEvent";
INFO_LOG() << "trying to send ParticipantEvent";
ExerciseEventManagement::Event pe;
@@ -216,10 +215,10 @@ void AlmTests::trySendEvent()
QString properties = QString::fromUtf8(QJsonDocument(obj).toJson());
pe.properties(properties.toStdString());
DEBUG_LOG(m_logger) << "Publishing EEM Event";
DEBUG_LOG() << "Publishing EEM Event";
if (!m_dtsEem->publish(pe))
{
ERROR_LOG(m_logger) << "Error publish EEM Event";
ERROR_LOG() << "Error publish EEM Event";
failExit();
}
}
@@ -227,10 +226,10 @@ void AlmTests::trySendEvent()
// ------------------------------------------------------------------
void AlmTests::onConfigureAlarmsReply(const Core::FunctionReplyObject &replyObject)
{
INFO_LOG(m_logger) << "onConfigureAlarmsReply, error = " << replyObject.error();
INFO_LOG() << "onConfigureAlarmsReply, error = " << replyObject.error();
if (replyObject.error())
{
ERROR_LOG(m_logger) << "Error ConfigureAlarms - aborting";
ERROR_LOG() << "Error ConfigureAlarms - aborting";
failExit();
}
} // onConfigureAlarmsReply
@@ -238,11 +237,11 @@ void AlmTests::onConfigureAlarmsReply(const Core::FunctionReplyObject &replyObje
// ------------------------------------------------------------------
void AlmTests::checkAlarm()
{
INFO_LOG(m_logger) << "checkAlarm";
INFO_LOG() << "checkAlarm";
m_dtcAlm->waitForHistoricalDataNotification();
qint32 id = 0;
AlarmManagement::Notification notification = m_dtcAlm->notification(id);
INFO_LOG(m_logger) << "Recived AlarmManagement::Notification: " << notification
INFO_LOG() << "Recived AlarmManagement::Notification: " << notification
<< " testId: " << m_testId;
switch (m_testId)
@@ -250,12 +249,12 @@ void AlmTests::checkAlarm()
case 1:
case 2:
case 3:
INFO_LOG(m_logger) << "ExitSuccess";
INFO_LOG() << "ExitSuccess";
ExitSuccess();
break;
default:
// nothing
INFO_LOG(m_logger) << "failExit";
INFO_LOG() << "failExit";
failExit();
break;
}
@@ -271,7 +270,7 @@ void AlmTests::failExit()
// ------------------------------------------------------------------
void AlmTests::ExitSuccess()
{
DEBUG_LOG(m_logger) << "SUCCESS";
DEBUG_LOG() << "SUCCESS";
m_bTestsSuccessful = true;
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
} // ExitSuccess
@@ -60,8 +60,6 @@ private:
int m_testId;
bool m_bTestsSuccessful;
int m_operatorId;
NGL::INGLLogger &m_logger;
int m_participantIndex;
};
@@ -15,16 +15,15 @@ namespace AlarmManagement
DdsHandler::DdsHandler(const std::shared_ptr<DDSConnector::DdsConnector> &ddsConnector)
: m_ddsConnector(ddsConnector)
, m_logger(getLogger("DdsHandler"))
{
DEBUG_LOG(m_logger) << "DdsHandler(" << m_ddsConnector->getDomainId() << ") for partition: " << m_ddsConnector->getDefaultPartition();
DEBUG_LOG() << "DdsHandler(" << m_ddsConnector->getDomainId() << ") 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;
}
@@ -41,34 +40,34 @@ bool DdsHandler::init(const QStringList &qosFileList)
m_dtsAlm = AlarmManagement::Interface::Dts::create(m_ddsConnector);
bool bRet = m_dtsAlm->enableAll();
INFO_LOG(m_logger) << "Dts initialised";
INFO_LOG() << "Dts initialised";
m_dtcAlm = AlarmManagement::Interface::Dtc::create(m_ddsConnector);
bRet &= m_dtcAlm->enableAcknowledgeSOSInAllExercises();
INFO_LOG(m_logger) << "Dts initialised";
INFO_LOG() << "Dts initialised";
m_ftsAlm = AlarmManagement::Interface::Fts::create(m_ddsConnector);
bRet &= m_ftsAlm->enableAll();
INFO_LOG(m_logger) << "Fts initialised";
INFO_LOG() << "Fts initialised";
m_dtcEem = ExerciseEventManagement::Interface::Dtc::create(m_ddsConnector);
bRet &= m_dtcEem->enableEvent();
INFO_LOG(m_logger) << "Dtc EEM initialised";
INFO_LOG() << "Dtc EEM initialised";
m_ftcMrk = MarkerManagement::Interface::Ftc::create(m_ddsConnector);
bRet &= m_ftcMrk->enableMarkerModify();
INFO_LOG(m_logger) << "Ftc MRK initialised";
INFO_LOG() << "Ftc MRK initialised";
m_dtcPpm = ParticipantManagement::Interface::Dtc::create(m_ddsConnector);
bRet &= m_dtcPpm->enableParticipant();
INFO_LOG(m_logger) << "Dtc PPM initialised";
INFO_LOG() << "Dtc PPM initialised";
m_exmDtc = ExerciseManagement::Interface::Dtc::create(m_ddsConnector);
bRet &= m_exmDtc->enableExercise();
m_dtcTab = TrainingAreaBase::Interface::Dtc::create(m_ddsConnector);
bRet &= m_dtcTab->enableEmergencyCall();
INFO_LOG(m_logger) << "Dtc TAB initialised";
INFO_LOG() << "Dtc TAB initialised";
m_dtsEmergencyCallPublisher = std::make_shared<DDSConnector::Publisher>(m_ddsConnector->getDomainParticipant(),
@@ -78,7 +77,7 @@ bool DdsHandler::init(const QStringList &qosFileList)
m_dtsEmergencyCallPublisher->getDdsPublisher(),
DDS::Helper::getShortTopicName(DDS::topic_type_name<AlarmManagement::AcknowledgeSOSInAllExercises>::value()));
INFO_LOG(m_logger) << "Dtc TAB initialised";
INFO_LOG() << "Dtc TAB initialised";
return bRet;
}
@@ -63,10 +63,6 @@ private:
std::shared_ptr<TrainingAreaBase::Interface::Dtc> m_dtcTab;
std::shared_ptr<DDSConnector::Publisher> m_dtsEmergencyCallPublisher;
std::shared_ptr<DTS::AcknowledgeSOSInAllExercises> m_dtsEmergencyCall;
NGL::INGLLogger &m_logger;
};
}
@@ -39,7 +39,6 @@ HandlerConfigureAlarms::HandlerConfigureAlarms(Initialization *mainHandler)
: QObject()
, ConfigureAlarmsRequestHandler(mainHandler->dds()->ftsAlm())
, m_mainHandler(mainHandler)
, m_logger(getLogger("HandlerConfigureAlarms"))
, m_windowIndex(0)
{
} // end of ctor()
@@ -52,7 +51,7 @@ HandlerConfigureAlarms::~HandlerConfigureAlarms()
bool HandlerConfigureAlarms::init()
{
INFO_LOG(m_logger) << "Start HandlerConfigureAlarms.";
INFO_LOG() << "Start HandlerConfigureAlarms.";
auto dtcEem = m_mainHandler->dds()->dtcEem();
@@ -62,7 +61,7 @@ bool HandlerConfigureAlarms::init()
// publish data from db-table 'alm_config'
auto cb = [this](const Database::AlmConfig & data)
{
DEBUG_LOG(m_logger) << "restore AlarmConfig from DB data: id=" << data.id
DEBUG_LOG() << "restore AlarmConfig from DB data: id=" << data.id
<< " operatorId=" << data.operatorId
<< " participantId=" << data.participantId.toInt()
<< " global=" << data.global
@@ -76,7 +75,7 @@ bool HandlerConfigureAlarms::init()
};
if (!m_mainHandler->db()->select(cb))
{
ERROR_LOG(m_logger) << "Error reading data from database 'alm_config'!";
ERROR_LOG() << "Error reading data from database 'alm_config'!";
return false;
}
@@ -88,7 +87,7 @@ void HandlerConfigureAlarms::removeAlarmConfig(int operatorId,
int participantId,
int eventTypeId)
{
DEBUG_LOG(m_logger) << "removeAlarmConfig m_alarms.size=" << m_alarms.size()
DEBUG_LOG() << "removeAlarmConfig m_alarms.size=" << m_alarms.size()
<< " operatorId=" << operatorId
<< " participantId=" << participantId
<< " eventTypeId=" << eventTypeId;
@@ -98,7 +97,7 @@ void HandlerConfigureAlarms::removeAlarmConfig(int operatorId,
while (i.hasNext())
{
i.next();
DEBUG_LOG(m_logger) << "key= " << i.key() << ": "
DEBUG_LOG() << "key= " << i.key() << ": "
<< " operatorId=" << i.value().operatorId
<< " participantId=" << i.value().participantId.toInt()
<< " eventTypeId=" << i.value().eventTypeId.underlying();
@@ -107,7 +106,7 @@ void HandlerConfigureAlarms::removeAlarmConfig(int operatorId,
&& (eventTypeId == ProjectDataManagement::EventType_def::Unknown || eventTypeId == i.value().eventTypeId.underlying()))
{
const int key = i.key();
DEBUG_LOG(m_logger) << "found alarm to remove: " << key << ", eventTypeId: " << eventTypeId;
DEBUG_LOG() << "found alarm to remove: " << key << ", eventTypeId: " << eventTypeId;
m_mainHandler->db()->removeAlmConfig(key);
m_mainHandler->dds()->dtsAlm()->removeAlarmConfigByKey(key);
m_alarms.remove(key); // is ok, QMapIterator work on a copy
@@ -117,20 +116,20 @@ void HandlerConfigureAlarms::removeAlarmConfig(int operatorId,
void HandlerConfigureAlarms::removeGlobalAlarmConfig(int operatorId)
{
DEBUG_LOG(m_logger) << "removeAlarmConfig m_alarms.size=" << m_alarms.size();
DEBUG_LOG() << "removeAlarmConfig m_alarms.size=" << m_alarms.size();
// Find Key
QMapIterator<int, Database::AlmConfig> i(m_alarms);
while (i.hasNext())
{
i.next();
DEBUG_LOG(m_logger) << "key= " << i.key()
DEBUG_LOG() << "key= " << i.key()
<< " participantId=" << i.value().participantId.toInt();
if ((operatorId == i.value().operatorId)
&& (i.value().participantId.toInt()) == 0)
{
const int key = i.key();
DEBUG_LOG(m_logger) << "found alarm to remove: " << key;
DEBUG_LOG() << "found alarm to remove: " << key;
m_mainHandler->db()->removeAlmConfig(key);
m_mainHandler->dds()->dtsAlm()->removeAlarmConfigByKey(key);
m_alarms.remove(key); // is ok, QMapIterator work on a copy
@@ -142,7 +141,7 @@ void HandlerConfigureAlarms::removeGlobalAlarmConfig(int operatorId)
void HandlerConfigureAlarms::onConfigureAlarmsRequest(const rti::core::SampleIdentity &cookie,
const ConfigureAlarmsRequest &request)
{
DEBUG_LOG(m_logger) << "onConfigureAlarmsRequest " << request;
DEBUG_LOG() << "onConfigureAlarmsRequest " << request;
if (request.participantIds().size() == 0)
{
Core::FunctionReplyObject ret(0, tr_lts("dds", "Error adding ConfigureAlarms to database. There were no participants given."));
@@ -155,13 +154,13 @@ void HandlerConfigureAlarms::onConfigureAlarmsRequest(const rti::core::SampleIde
// remove only this one Alarm, not all types of the participant for operator
// in DB,
// from DDS
DEBUG_LOG(m_logger) << "request.remove()";
DEBUG_LOG() << "request.remove()";
if (request.participantIds().size() > 0 &&
request.alarms().size() > 0)
{
int participantId = request.participantIds()[0];
int eventTypeId = request.alarms()[0].eventTypeId().underlying();
DEBUG_LOG(m_logger) << "removeAlarmConfig(request.operatorId()=" << request.operatorId()
DEBUG_LOG() << "removeAlarmConfig(request.operatorId()=" << request.operatorId()
<< " participantId=" << participantId
<< " eventTypeId=" << eventTypeId;
removeAlarmConfig(request.operatorId(), participantId, eventTypeId);
@@ -172,7 +171,7 @@ void HandlerConfigureAlarms::onConfigureAlarmsRequest(const rti::core::SampleIde
// remove old configuration
for (int participantId : request.participantIds())
{
DEBUG_LOG(m_logger) << "remove old configuration participantId=" << participantId;
DEBUG_LOG() << "remove old configuration participantId=" << participantId;
removeAlarmConfig(request.operatorId(), participantId, 0);
}
if ( request.global())
@@ -182,10 +181,10 @@ void HandlerConfigureAlarms::onConfigureAlarmsRequest(const rti::core::SampleIde
for (int participantId : request.participantIds())
{
DEBUG_LOG(m_logger) << "participantId: " << participantId;
DEBUG_LOG() << "participantId: " << participantId;
for (const AlarmManagement::AlarmAction &action : request.alarms())
{
DEBUG_LOG(m_logger) << "action: " << action;
DEBUG_LOG() << "action: " << action;
AlarmManagement::AlarmConfig almConfig;
almConfig.operatorId(request.operatorId());
@@ -211,7 +210,7 @@ void HandlerConfigureAlarms::onConfigureAlarmsRequest(const rti::core::SampleIde
Core::FunctionReplyObject ret(0, tr_lts("dds", "Error adding ConfigureAlarms to database."));
m_mainHandler->dds()->ftsAlm()->configureAlarmsReply(cookie, ret);
}
DEBUG_LOG(m_logger) << "m_dbAlmConfig.insert id=" << newConfig.id;
DEBUG_LOG() << "m_dbAlmConfig.insert id=" << newConfig.id;
almConfig.id(newConfig.id);
m_alarms.insert(newConfig.id, newConfig);
@@ -225,11 +224,11 @@ void HandlerConfigureAlarms::onConfigureAlarmsRequest(const rti::core::SampleIde
//-----------------------------------------------------------------------------
void HandlerConfigureAlarms::onEventChanged(const ExerciseEventManagement::Event &eventData, DataModification modType)
{
DEBUG_LOG(m_logger) << "onParticipantEventChanged participantId=" << eventData.participantId();
DEBUG_LOG() << "onParticipantEventChanged participantId=" << eventData.participantId();
if (modType == DataModification::eRemoved ||
modType == DataModification::eModified)
return;
DEBUG_LOG(m_logger) << "onParticipantEventChanged verarbeiten m_alarms.size =" << m_alarms.size();
DEBUG_LOG() << "onParticipantEventChanged verarbeiten m_alarms.size =" << m_alarms.size();
ExerciseEventManagement::Event eventDatalocal = eventData;
@@ -249,7 +248,7 @@ void HandlerConfigureAlarms::onEventChanged(const ExerciseEventManagement::Event
for (const Database::AlmConfig &alarm : std::as_const(m_alarms))
{
{
/*DEBUG_LOG(m_logger) << " alarmConfigItem.id=" << alarm.id
/*DEBUG_LOG() << " alarmConfigItem.id=" << alarm.id
<< " alarmConfigItem.participantId=" << alarm.participantId
<< " alarmConfigItem.eventTypeId=" << alarm.eventTypeId
<< " eventDatalocal.eventTypeId()=" << eventDatalocal.eventTypeId().underlying()
@@ -273,7 +272,7 @@ void HandlerConfigureAlarms::onEventChanged(const ExerciseEventManagement::Event
bool allVulnerabilityStates = alarm.vulnerabilityState == -1;
bool vulnerabilityCheck = vulnerabilityState == alarm.vulnerabilityState;
bool globalAlarm = participantId == 0;
DEBUG_LOG(m_logger) << " allVulnerabilityStates=" << allVulnerabilityStates
DEBUG_LOG() << " allVulnerabilityStates=" << allVulnerabilityStates
<< " vulnerabilityCheck=" << vulnerabilityCheck
<< " participantId=" << participantId
<< " eventDatalocal.participantId()=" << eventDatalocal.participantId();
@@ -282,19 +281,19 @@ void HandlerConfigureAlarms::onEventChanged(const ExerciseEventManagement::Event
{
if (sentEventToOperator.contains(alarm.operatorId))
{
DEBUG_LOG(m_logger) << "Event " << eventDatalocal.eventTypeId() << " already handled for Operator:" << alarm.operatorId;
DEBUG_LOG() << "Event " << eventDatalocal.eventTypeId() << " already handled for Operator:" << alarm.operatorId;
continue;
}
sentEventToOperator += alarm.operatorId;
if (alarm.messageWindow)
{
DEBUG_LOG(m_logger) << "send Window to Operator:" << alarm.operatorId;
DEBUG_LOG() << "send Window to Operator:" << alarm.operatorId;
sendWindow(eventDatalocal, alarm);
}
if (alarm.setMarker)
{
DEBUG_LOG(m_logger) << "set Marker to Operator:" << alarm.operatorId;
DEBUG_LOG() << "set Marker to Operator:" << alarm.operatorId;
sendMarker(eventDatalocal, alarm);
}
}
@@ -360,7 +359,7 @@ void HandlerConfigureAlarms::sendMarker(const ExerciseEventManagement::Event &ev
{
int defaultOffset = 10000;
DEBUG_LOG(m_logger) << "eventProperties =" << eventData.properties();
DEBUG_LOG() << "eventProperties =" << eventData.properties();
QString contentStr;
contentStr = QStringLiteral("Equip No.: ");
@@ -377,7 +376,7 @@ void HandlerConfigureAlarms::sendMarker(const ExerciseEventManagement::Event &ev
contentStr += eventObject.value(QStringLiteral("AesName")).toString();
contentStr += QStringLiteral(")");
}
DEBUG_LOG(m_logger) << "contentStr=" << contentStr;
DEBUG_LOG() << "contentStr=" << contentStr;
const QByteArray contentArr = contentStr.toUtf8();
@@ -400,6 +399,6 @@ void HandlerConfigureAlarms::sendMarker(const ExerciseEventManagement::Event &ev
void HandlerConfigureAlarms::onMarkerModifyReply(const Core::FunctionReplyObject &replyObject)
{
Q_UNUSED(replyObject);
INFO_LOG(m_logger) << "************** onMarkerCreateReply";
INFO_LOG() << "************** onMarkerCreateReply";
} // end onMarkerCreateReply
} // namespace AlarmManagement
@@ -84,8 +84,6 @@ private: // attributes
}
};
QMap<int, Database::AlmConfig> m_alarms; // Key = almConfig.id
NGL::INGLLogger &m_logger;
int m_windowIndex;
};
} // namespace AlarmManagement
@@ -25,7 +25,6 @@ HandlerEmergencyCall::HandlerEmergencyCall(const std::shared_ptr<HandlerConfigur
, EmergencyCallAcknowledgeRequestHandler(mainHandler->dds()->ftsAlm())
, m_mainHandler(mainHandler)
, m_configAlarmHandler(configAlarmHandler)
, m_logger(getLogger("HandlerEmergencyCall"))
{
}
@@ -35,7 +34,7 @@ HandlerEmergencyCall::~HandlerEmergencyCall()
bool HandlerEmergencyCall::init()
{
INFO_LOG(m_logger) << "Start HandlerEmergencyCall.";
INFO_LOG() << "Start HandlerEmergencyCall.";
auto dtcTab = m_mainHandler->dds()->dtcTab();
@@ -49,7 +48,7 @@ bool HandlerEmergencyCall::init()
bool bRet = true;
auto cbEmergencyCall = [this, &bRet](const Database::AlmEmergencyCall &data)
{
WARNING_LOG(m_logger)<<" ALM_EMERGENCY " << "Reading from DB AlmEmergencyCall with id = " << data.id;
WARNING_LOG()<<" ALM_EMERGENCY " << "Reading from DB AlmEmergencyCall with id = " << data.id;
if (!this->isExerciseValidForEmergencyCall() && !data.expired)
return;
@@ -58,7 +57,7 @@ bool HandlerEmergencyCall::init()
if (ret.error())
{
delete ifs;
ERROR_LOG(m_logger) << ret();
ERROR_LOG() << ret();
bRet = false;
return;
}
@@ -68,7 +67,7 @@ bool HandlerEmergencyCall::init()
if (!m_mainHandler->db()->select(cbEmergencyCall) || !bRet)
{
ERROR_LOG(m_logger) <<"Error reading data from database 'alm_emergency_call!";
ERROR_LOG() <<"Error reading data from database 'alm_emergency_call!";
return false;
}
@@ -96,21 +95,21 @@ bool HandlerEmergencyCall::createEmergencyCallObject(const AlarmManagement::AlmE
if (ret.error())
{
delete ifs;
ERROR_LOG(m_logger)<< ret();
ERROR_LOG()<< ret();
return false;
}
WARNING_LOG(m_logger)<< "Entry createEmergencyCallObject in the DB id: "<<ifs->getData().id<<" issi: "<<ifs->getData().issi<<" expired: "<<ifs->getData().expired;
WARNING_LOG()<< "Entry createEmergencyCallObject in the DB id: "<<ifs->getData().id<<" issi: "<<ifs->getData().issi<<" expired: "<<ifs->getData().expired;
m_emergencyObjMap.insert(ifs->getId(), ifs);
return true;
}
void HandlerEmergencyCall::onEmergencyCallAcknowledgeRequest(const rti::core::SampleIdentity &cookie, const EmergencyCallAcknowledgeRequest &request)
{
WARNING_LOG(m_logger) << "[onEmergencyCallAcknowledgeRequest] request: " << request;
WARNING_LOG() << "[onEmergencyCallAcknowledgeRequest] request: " << request;
Core::FunctionReplyObject ret = emergencyCallAcknowledgeRequest(request);
if (ret.error())
WARNING_LOG(m_logger)<< ret();
WARNING_LOG()<< ret();
if (request.expired())
{
@@ -123,7 +122,7 @@ void HandlerEmergencyCall::onEmergencyCallAcknowledgeRequest(const rti::core::Sa
ackInEx.operatorId(request.operatorId());
ackInEx.comment(request.comment());
ackInEx.expired(request.expired());
WARNING_LOG(m_logger) << "onEmergencyCallAcknowledgeRequest: issi: "<<ackInEx.issi();
WARNING_LOG() << "onEmergencyCallAcknowledgeRequest: issi: "<<ackInEx.issi();
m_mainHandler->dds()->publishSOS()->write(ackInEx);
}
m_mainHandler->dds()->ftsAlm()->emergencyCallAcknowledgeReply(cookie,ret);
@@ -146,17 +145,17 @@ Core::FunctionReplyObject HandlerEmergencyCall::emergencyCallAcknowledgeRequest(
if (ifs == nullptr)
{
WARNING_LOG(m_logger)<<" Couldn't acknowledge SOS with issi: " <<request.issi()<< ": already acknowledged or issi doesn't exist.";
WARNING_LOG()<<" Couldn't acknowledge SOS with issi: " <<request.issi()<< ": already acknowledged or issi doesn't exist.";
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "already acknowledged or issi(%1) couldn't be found")).arg(request.issi());
}
if (ifs->getData().expired) // if already expired do nothing
{
WARNING_LOG(m_logger) << "SOS Already expired do nothing";
WARNING_LOG() << "SOS Already expired do nothing";
return Core::FunctionReplyObject(ifs->getData().id);
}
WARNING_LOG(m_logger) << "emergencyCallAcknowledgeRequest: issi found!: "<<request.issi()<<" ifs->state: "<<ifs->getData().expired;
WARNING_LOG() << "emergencyCallAcknowledgeRequest: issi found!: "<<request.issi()<<" ifs->state: "<<ifs->getData().expired;
Database::AlmEmergencyCall newData(ifs->getData());
newData.expired = true;
newData.issi = request.issi();
@@ -190,7 +189,7 @@ bool HandlerEmergencyCall::isNewEmergencyCall(const AlmEmergencyCall &newdata)
&& data.incomingTime == newdata.incomingTime()
&& !data.expired)
{
WARNING_LOG(m_logger)<<" SOS EXISTS and not yet quit! issi: "<<data.issi<<" incomingTime: "<<data.incomingTime<<" expired: "<<data.expired;
WARNING_LOG()<<" SOS EXISTS and not yet quit! issi: "<<data.issi<<" incomingTime: "<<data.incomingTime<<" expired: "<<data.expired;
return false;
}
}
@@ -219,7 +218,7 @@ void HandlerEmergencyCall::onEmergencyCallChanged(const TrainingAreaBase::Emerge
void HandlerEmergencyCall::onAcknowledgeSOSInExercises(const AcknowledgeSOSInAllExercises &data, DataModification modType)
{
DEBUG_LOG(m_logger)<< "onAcknowledgeSOSInExercises START ";
DEBUG_LOG()<< "onAcknowledgeSOSInExercises START ";
Q_UNUSED(modType)
EmergencyCallAcknowledgeRequest request;
@@ -233,7 +232,7 @@ void HandlerEmergencyCall::onAcknowledgeSOSInExercises(const AcknowledgeSOSInAll
request.operatorId(data.operatorId());
emergencyCallAcknowledgeRequest(request);
DEBUG_LOG(m_logger)<< "onAcknowledgeEmergencyInExercises END ";
DEBUG_LOG()<< "onAcknowledgeEmergencyInExercises END ";
}
} // namespace AlarmManagement
@@ -47,8 +47,6 @@ private slots:
private:
Initialization *m_mainHandler;
std::shared_ptr<HandlerConfigureAlarms> m_configAlarmHandler;
NGL::INGLLogger &m_logger;
QMap<int, ObjectEmergencyCall *> m_emergencyObjMap; // Key = DangerAreaId
};
@@ -14,7 +14,6 @@ using namespace AlarmManagement;
HandlerParticipant::HandlerParticipant(const std::shared_ptr<DdsHandler> &ddsHandler)
: QObject()
, m_ddsHandler(ddsHandler)
, m_logger(getLogger("HandlerParticipant"))
{
} // end of ctor()
//-----------------------------------------------------------------------------
@@ -45,13 +44,13 @@ bool HandlerParticipant::init()
if (!dtcPpm->enableParticipant())
{
ERROR_LOG(m_logger) << "Could not initialize ParticipantManagement enableParticipant data topic client";
ERROR_LOG() << "Could not initialize ParticipantManagement enableParticipant data topic client";
return false;
}
if (!dtcPpm->enableDynamicParticipantData())
{
ERROR_LOG(m_logger) << "Could not initialize ParticipantManagement enableDynamicParticipant data topic client";
ERROR_LOG() << "Could not initialize ParticipantManagement enableDynamicParticipant data topic client";
return false;
}
@@ -67,7 +66,7 @@ bool HandlerParticipant::init()
if (participant.equipmentNumber().is_set())
{
m_partId2EquipNoMap.insert(participant.id(), participant.equipmentNumber().get());
DEBUG_LOG(m_logger) << "m_partId2EquipNoMap.insert participantId=" << participant.id() << "EquimentNo=" << participant.equipmentNumber().get();
DEBUG_LOG() << "m_partId2EquipNoMap.insert participantId=" << participant.id() << "EquimentNo=" << participant.equipmentNumber().get();
}
else
m_partId2EquipNoMap.insert(participant.id(), 0);
@@ -87,13 +86,13 @@ bool HandlerParticipant::init()
ParticipantManagement::StateInformation state = states[0];
int vulnerability = state.vulnerabilityState().underlying();
m_partId2VulnerabilityMap.insert(i.value().participantId(), vulnerability);
DEBUG_LOG(m_logger) << "m_partId2EquipNoMap.insert participantId=" << i.value().participantId() << "vulnerability=" << vulnerability;
DEBUG_LOG() << "m_partId2EquipNoMap.insert participantId=" << i.value().participantId() << "vulnerability=" << vulnerability;
}
else
m_partId2VulnerabilityMap.insert(i.value().participantId(), -1);
}
INFO_LOG(m_logger) << "HandlerParticipant::init() finished. ";
INFO_LOG() << "HandlerParticipant::init() finished. ";
return true;
} // end of init()
//-----------------------------------------------------------------------------
@@ -102,12 +101,12 @@ void HandlerParticipant::onParticipantChanged(const ParticipantManagement::Parti
{
if (modType == DataModification::eRemoved)
{
DEBUG_LOG(m_logger) << "onParticipantChanged - remove: " << data.id();
DEBUG_LOG() << "onParticipantChanged - remove: " << data.id();
m_participantHierarchy.remove(data.id());
}
else
{
DEBUG_LOG(m_logger) << "onParticipantChanged:" << data;
DEBUG_LOG() << "onParticipantChanged:" << data;
m_participantHierarchy.insert(data.id(),
AlarmManagement::HandlerParticipant::ParticipantHierarchy(data));
const int equipNo = data.equipmentNumber().is_set() ? data.equipmentNumber().get() : 0;
@@ -118,13 +117,13 @@ void HandlerParticipant::onParticipantChanged(const ParticipantManagement::Parti
void HandlerParticipant::onDynamicParticipantChanged(const ParticipantManagement::DynamicParticipantData &data, DataModification modType)
{
DEBUG_LOG(m_logger) << "onDynamicParticipant participantId=" << data.participantId();
DEBUG_LOG() << "onDynamicParticipant participantId=" << data.participantId();
if (modType == DataModification::eRemoved)
{
}
else
{
INFO_LOG(m_logger) << "onDynamicParticipant()"
INFO_LOG() << "onDynamicParticipant()"
<< " participantId: " << data.participantId();
if (data.stateHistory().size() > 0)
{
@@ -132,7 +131,7 @@ void HandlerParticipant::onDynamicParticipantChanged(const ParticipantManagement
ParticipantManagement::StateInformation state = states[0];
int vulnerability = state.vulnerabilityState().underlying();
m_partId2VulnerabilityMap.insert(data.participantId(), vulnerability);
DEBUG_LOG(m_logger) << "m_partId2EquipNoMap.insert participantId=" << data.participantId()
DEBUG_LOG() << "m_partId2EquipNoMap.insert participantId=" << data.participantId()
<< " vulnerability=" << vulnerability;
}
else
@@ -179,7 +178,7 @@ QVector<int> HandlerParticipant::getRecursiveInferiorIds(const int participantId
int HandlerParticipant::participantId2EquipNo(const int participantId) const
{
int ret = m_partId2EquipNoMap.value(participantId, 0);
INFO_LOG(m_logger) << "participantId2EquipNo participantId=" << participantId
INFO_LOG() << "participantId2EquipNo participantId=" << participantId
<< " EquipmentNumber=" << ret;
return ret;
} // end of participantId2EquipNo()
@@ -187,7 +186,7 @@ int HandlerParticipant::participantId2EquipNo(const int participantId) const
int HandlerParticipant::participantId2Vulnerability(const int participantId) const
{
int ret = m_partId2VulnerabilityMap.value(participantId, 0);
INFO_LOG(m_logger) << "m_partId2VulnerabilityMap participantId=" << participantId
INFO_LOG() << "m_partId2VulnerabilityMap participantId=" << participantId
<< " Vulnerability=" << ret;
return ret;
} // end of participantId2Vulnerability()
@@ -85,7 +85,7 @@ private: // attributes
QMap<int, int> m_partId2VulnerabilityMap; ///< Reference map participant (player) to Vulnerability
QHash<int, ParticipantHierarchy> m_participantHierarchy;
std::shared_ptr<DdsHandler> m_ddsHandler; ///< Pointer to VOM DDS handler
NGL::INGLLogger &m_logger; ///< Interface to the Logging-Facility
};
} // namespace AlarmManagement
@@ -19,7 +19,7 @@ using namespace AlarmManagement;
Initialization::Initialization()
: m_logger(getLogger("Initialization"))
{
INFO_LOG(m_logger) << "Initialization::Initialization";
INFO_LOG() << "Initialization::Initialization";
} // end of ctor()
//-----------------------------------------------------------------------------
@@ -32,32 +32,32 @@ Initialization::~Initialization()
m_dbHandler = nullptr;
m_ddsHandler = nullptr;
INFO_LOG(m_logger) << "Initialization::~Initialization";
INFO_LOG() << "Initialization::~Initialization";
} // end of dtor()
//-----------------------------------------------------------------------------
bool Initialization::initialize(const std::shared_ptr<DDSConnector::DdsConnector> &ddsConnector, const QSqlDatabase &sqlDb)
{
INFO_LOG(m_logger) << "Start AlarmManagement Initialization. domainId =" << ddsConnector->getDomainId()
INFO_LOG() << "Start AlarmManagement Initialization. domainId =" << ddsConnector->getDomainId()
<< " exerciseId=" << ddsConnector->getPartitionId();
// initialize DDS
m_ddsHandler = std::make_shared<DdsHandler>(ddsConnector);
if (!m_ddsHandler->init())
{
ERROR_LOG(m_logger) << "Initialisation DdsHandler failed.";
ERROR_LOG() << "Initialisation DdsHandler failed.";
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(ddsConnector->getPartitionId(), sqlDb))
{
ERROR_LOG(m_logger) << "Initialisation DbHandler failed.";
ERROR_LOG() << "Initialisation DbHandler failed.";
return false;
}
INFO_LOG(m_logger) << "DbHandler initialized. ";
INFO_LOG() << "DbHandler initialized. ";
// create handlers
@@ -65,7 +65,7 @@ bool Initialization::initialize(const std::shared_ptr<DDSConnector::DdsConnector
m_handlerConfigureAlarms = std::make_shared<HandlerConfigureAlarms>(this);
m_handlerEmergencyCall = std::make_shared<HandlerEmergencyCall>(m_handlerConfigureAlarms, this);
DEBUG_LOG(m_logger) << "initialize successfully finished";
DEBUG_LOG() << "initialize successfully finished";
return true;
} // end of init()
@@ -76,20 +76,20 @@ bool Initialization::loadFromDatabase()
// initialize handlers
if (!m_handlerParticipant || !m_handlerParticipant->init())
{
ERROR_LOG(m_logger) << "Can not initialize Participant handler";
ERROR_LOG() << "Can not initialize Participant handler";
return false;
}
if (!m_handlerConfigureAlarms || !m_handlerConfigureAlarms->init())
{
ERROR_LOG(m_logger) << "Can not initialize Alarm handler";
ERROR_LOG() << "Can not initialize Alarm handler";
return false;
}
if (!m_handlerEmergencyCall || !m_handlerEmergencyCall->init())
{
ERROR_LOG(m_logger) << "Can not initialize EmergencyCall handler";
ERROR_LOG() << "Can not initialize EmergencyCall handler";
return false;
}
DEBUG_LOG(m_logger) << "loadFromDatabase successfully finished";
DEBUG_LOG() << "loadFromDatabase successfully finished";
return true;
}
@@ -51,7 +51,7 @@ private: // attributes
std::shared_ptr<HandlerParticipant> m_handlerParticipant; ///< Pointer to handler for all participants
std::shared_ptr<HandlerEmergencyCall> m_handlerEmergencyCall;
NGL::INGLLogger &m_logger; ///< Interface to the Logging-Facility
};
} // namespace MessagingDataManagement
@@ -9,7 +9,7 @@
#pragma once
#include <NGLLogger/INGLLogger.h>
#include "alm_export.h"
#include "svcalmcommon_export.h"
namespace AlarmManagement
{
@@ -7,7 +7,6 @@ namespace AlarmManagement{
ObjectEmergencyCall::ObjectEmergencyCall(Initialization *mainHandler, QObject *parent)
: QObject(parent)
, m_mainHandler(mainHandler)
, m_logger(getLogger("ObjectEmergencyCall"))
{
}
@@ -24,7 +23,7 @@ Core::FunctionReplyObject ObjectEmergencyCall::createObject(const Database::AlmE
{
if (!m_mainHandler->db()->insert(m_data))
return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting Order into database."));
WARNING_LOG(m_logger) << "New EmergencyCall created Id: " << m_data.id;
WARNING_LOG() << "New EmergencyCall created Id: " << m_data.id;
}
// Publish Data via DTS
onPublishData();
@@ -41,7 +40,7 @@ Core::FunctionReplyObject ObjectEmergencyCall::updateObject(const Database::AlmE
if (!m_mainHandler->db()->update(m_data))
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "Error updating EmergencyCall into database"));
DEBUG_LOG(m_logger) << "Data changed for Changed Id: " << m_data.id;
DEBUG_LOG() << "Data changed for Changed Id: " << m_data.id;
// Publish Data via DTS
onPublishData();
@@ -72,10 +71,10 @@ void ObjectEmergencyCall::onPublishData()
ddsData.operatorId(m_data.operatorId);
ddsData.comment(m_data.comment.toStdString());
INFO_LOG(m_logger) << "Publish AlmEmergencyCall-data to dds (" << m_data.id << ") ...";
INFO_LOG() << "Publish AlmEmergencyCall-data to dds (" << m_data.id << ") ...";
if (!m_mainHandler->dds()->dtsAlm()->publish(ddsData))
ERROR_LOG(m_logger) << "Error publishing AlmEmergencyCall-data to dds";
ERROR_LOG() << "Error publishing AlmEmergencyCall-data to dds";
}
}// namespace AlarmManagement
@@ -4,7 +4,7 @@
#include <dds_handler.h>
#include "logger.h"
#include <DDS/Core/function_reply_object.h>
#include <DDS/Core/core_types.h>
//Generated
#include <AlarmManagement/alm_db.h>
@@ -34,8 +34,6 @@ protected Q_SLOTS:
private:
Initialization *m_mainHandler;
Database::AlmEmergencyCall m_data;
NGL::INGLLogger &m_logger;
};
}