Adds immediate migration results in progress

This commit is contained in:
torsten committed 2026-08-19 11:18:24 +02:00
1 parent 8453e104c5
commit 3bb6e89496
2102 files changed
+17482 -15071

No files matched your search

@@ -51,7 +51,7 @@ HandlerConfigureAlarms::~HandlerConfigureAlarms()
bool HandlerConfigureAlarms::init()
{
INFO_LOG() << "Start HandlerConfigureAlarms.";
INFO_LOG(m_logger) << "Start HandlerConfigureAlarms.";
auto dtcEem = m_mainHandler->dds()->dtcEem();
@@ -61,7 +61,7 @@ bool HandlerConfigureAlarms::init()
// publish data from db-table 'alm_config'
auto cb = [this](const Database::AlmConfig & data)
{
DEBUG_LOG() << "restore AlarmConfig from DB data: id=" << data.id
DEBUG_LOG(m_logger) << "restore AlarmConfig from DB data: id=" << data.id
<< " operatorId=" << data.operatorId
<< " participantId=" << data.participantId.toInt()
<< " global=" << data.global
@@ -75,7 +75,7 @@ bool HandlerConfigureAlarms::init()
};
if (!m_mainHandler->db()->select(cb))
{
ERROR_LOG() << "Error reading data from database 'alm_config'!";
ERROR_LOG(m_logger) << "Error reading data from database 'alm_config'!";
return false;
}
@@ -87,7 +87,7 @@ void HandlerConfigureAlarms::removeAlarmConfig(int operatorId,
int participantId,
int eventTypeId)
{
DEBUG_LOG() << "removeAlarmConfig m_alarms.size=" << m_alarms.size()
DEBUG_LOG(m_logger) << "removeAlarmConfig m_alarms.size=" << m_alarms.size()
<< " operatorId=" << operatorId
<< " participantId=" << participantId
<< " eventTypeId=" << eventTypeId;
@@ -97,7 +97,7 @@ void HandlerConfigureAlarms::removeAlarmConfig(int operatorId,
while (i.hasNext())
{
i.next();
DEBUG_LOG() << "key= " << i.key() << ": "
DEBUG_LOG(m_logger) << "key= " << i.key() << ": "
<< " operatorId=" << i.value().operatorId
<< " participantId=" << i.value().participantId.toInt()
<< " eventTypeId=" << i.value().eventTypeId.underlying();
@@ -106,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() << "found alarm to remove: " << key << ", eventTypeId: " << eventTypeId;
DEBUG_LOG(m_logger) << "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
@@ -116,20 +116,20 @@ void HandlerConfigureAlarms::removeAlarmConfig(int operatorId,
void HandlerConfigureAlarms::removeGlobalAlarmConfig(int operatorId)
{
DEBUG_LOG() << "removeAlarmConfig m_alarms.size=" << m_alarms.size();
DEBUG_LOG(m_logger) << "removeAlarmConfig m_alarms.size=" << m_alarms.size();
// Find Key
QMapIterator<int, Database::AlmConfig> i(m_alarms);
while (i.hasNext())
{
i.next();
DEBUG_LOG() << "key= " << i.key()
DEBUG_LOG(m_logger) << "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() << "found alarm to remove: " << key;
DEBUG_LOG(m_logger) << "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
@@ -141,7 +141,7 @@ void HandlerConfigureAlarms::removeGlobalAlarmConfig(int operatorId)
void HandlerConfigureAlarms::onConfigureAlarmsRequest(const rti::core::SampleIdentity &cookie,
const ConfigureAlarmsRequest &request)
{
DEBUG_LOG() << "onConfigureAlarmsRequest " << request;
DEBUG_LOG(m_logger) << "onConfigureAlarmsRequest " << request;
if (request.participantIds().size() == 0)
{
Core::FunctionReplyObject ret(0, tr_lts("dds", "Error adding ConfigureAlarms to database. There were no participants given."));
@@ -154,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() << "request.remove()";
DEBUG_LOG(m_logger) << "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() << "removeAlarmConfig(request.operatorId()=" << request.operatorId()
DEBUG_LOG(m_logger) << "removeAlarmConfig(request.operatorId()=" << request.operatorId()
<< " participantId=" << participantId
<< " eventTypeId=" << eventTypeId;
removeAlarmConfig(request.operatorId(), participantId, eventTypeId);
@@ -171,7 +171,7 @@ void HandlerConfigureAlarms::onConfigureAlarmsRequest(const rti::core::SampleIde
// remove old configuration
for (int participantId : request.participantIds())
{
DEBUG_LOG() << "remove old configuration participantId=" << participantId;
DEBUG_LOG(m_logger) << "remove old configuration participantId=" << participantId;
removeAlarmConfig(request.operatorId(), participantId, 0);
}
if ( request.global())
@@ -181,10 +181,10 @@ void HandlerConfigureAlarms::onConfigureAlarmsRequest(const rti::core::SampleIde
for (int participantId : request.participantIds())
{
DEBUG_LOG() << "participantId: " << participantId;
DEBUG_LOG(m_logger) << "participantId: " << participantId;
for (const AlarmManagement::AlarmAction &action : request.alarms())
{
DEBUG_LOG() << "action: " << action;
DEBUG_LOG(m_logger) << "action: " << action;
AlarmManagement::AlarmConfig almConfig;
almConfig.operatorId(request.operatorId());
@@ -210,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_dbAlmConfig.insert id=" << newConfig.id;
DEBUG_LOG(m_logger) << "m_dbAlmConfig.insert id=" << newConfig.id;
almConfig.id(newConfig.id);
m_alarms.insert(newConfig.id, newConfig);
@@ -224,11 +224,11 @@ void HandlerConfigureAlarms::onConfigureAlarmsRequest(const rti::core::SampleIde
//-----------------------------------------------------------------------------
void HandlerConfigureAlarms::onEventChanged(const ExerciseEventManagement::Event &eventData, DataModification modType)
{
DEBUG_LOG() << "onParticipantEventChanged participantId=" << eventData.participantId();
DEBUG_LOG(m_logger) << "onParticipantEventChanged participantId=" << eventData.participantId();
if (modType == DataModification::eRemoved ||
modType == DataModification::eModified)
return;
DEBUG_LOG() << "onParticipantEventChanged verarbeiten m_alarms.size =" << m_alarms.size();
DEBUG_LOG(m_logger) << "onParticipantEventChanged verarbeiten m_alarms.size =" << m_alarms.size();
ExerciseEventManagement::Event eventDatalocal = eventData;
@@ -248,7 +248,7 @@ void HandlerConfigureAlarms::onEventChanged(const ExerciseEventManagement::Event
for (const Database::AlmConfig &alarm : std::as_const(m_alarms))
{
{
/*DEBUG_LOG() << " alarmConfigItem.id=" << alarm.id
/*DEBUG_LOG(m_logger) << " alarmConfigItem.id=" << alarm.id
<< " alarmConfigItem.participantId=" << alarm.participantId
<< " alarmConfigItem.eventTypeId=" << alarm.eventTypeId
<< " eventDatalocal.eventTypeId()=" << eventDatalocal.eventTypeId().underlying()
@@ -272,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() << " allVulnerabilityStates=" << allVulnerabilityStates
DEBUG_LOG(m_logger) << " allVulnerabilityStates=" << allVulnerabilityStates
<< " vulnerabilityCheck=" << vulnerabilityCheck
<< " participantId=" << participantId
<< " eventDatalocal.participantId()=" << eventDatalocal.participantId();
@@ -281,19 +281,19 @@ void HandlerConfigureAlarms::onEventChanged(const ExerciseEventManagement::Event
{
if (sentEventToOperator.contains(alarm.operatorId))
{
DEBUG_LOG() << "Event " << eventDatalocal.eventTypeId() << " already handled for Operator:" << alarm.operatorId;
DEBUG_LOG(m_logger) << "Event " << eventDatalocal.eventTypeId() << " already handled for Operator:" << alarm.operatorId;
continue;
}
sentEventToOperator += alarm.operatorId;
if (alarm.messageWindow)
{
DEBUG_LOG() << "send Window to Operator:" << alarm.operatorId;
DEBUG_LOG(m_logger) << "send Window to Operator:" << alarm.operatorId;
sendWindow(eventDatalocal, alarm);
}
if (alarm.setMarker)
{
DEBUG_LOG() << "set Marker to Operator:" << alarm.operatorId;
DEBUG_LOG(m_logger) << "set Marker to Operator:" << alarm.operatorId;
sendMarker(eventDatalocal, alarm);
}
}
@@ -359,7 +359,7 @@ void HandlerConfigureAlarms::sendMarker(const ExerciseEventManagement::Event &ev
{
int defaultOffset = 10000;
DEBUG_LOG() << "eventProperties =" << eventData.properties();
DEBUG_LOG(m_logger) << "eventProperties =" << eventData.properties();
QString contentStr;
contentStr = QStringLiteral("Equip No.: ");
@@ -376,7 +376,7 @@ void HandlerConfigureAlarms::sendMarker(const ExerciseEventManagement::Event &ev
contentStr += eventObject.value(QStringLiteral("AesName")).toString();
contentStr += QStringLiteral(")");
}
DEBUG_LOG() << "contentStr=" << contentStr;
DEBUG_LOG(m_logger) << "contentStr=" << contentStr;
const QByteArray contentArr = contentStr.toUtf8();
@@ -399,6 +399,6 @@ void HandlerConfigureAlarms::sendMarker(const ExerciseEventManagement::Event &ev
void HandlerConfigureAlarms::onMarkerModifyReply(const Core::FunctionReplyObject &replyObject)
{
Q_UNUSED(replyObject);
INFO_LOG() << "************** onMarkerCreateReply";
INFO_LOG(m_logger) << "************** onMarkerCreateReply";
} // end onMarkerCreateReply
} // namespace AlarmManagement