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

@@ -22,12 +22,11 @@ using namespace ExerciseEventManagement;
HandlerParticipantEvent::HandlerParticipantEvent(MainHandler *mainHandler,
const std::shared_ptr<DdsHandler> &ddsHandler,
const std::shared_ptr<DbHandler> &db,
const std::shared_ptr<WebSocketEventServer> &eventServer)
: m_ddsHandler(ddsHandler)
const std::shared_ptr<WebSocketEventServer> &eventServer) : m_ddsHandler(ddsHandler)
, m_dbHandler(db)
, m_eventServer(eventServer)
, m_mainHandler(mainHandler)
{
, m_mainHandler(mainHandler),
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
} // end of ctor()
//-----------------------------------------------------------------------------
@@ -38,13 +37,13 @@ HandlerParticipantEvent::~HandlerParticipantEvent()
bool HandlerParticipantEvent::init()
{
INFO_LOG() << "start init() DTC CentralEffectSimulation ";
INFO_LOG(m_logger) << "start init() DTC CentralEffectSimulation ";
// DTC CentralEffectSimulation
m_cesDtc = CentralEffectSimulation::Interface::Dtc::create(m_ddsHandler->ddsConnector());
if (!m_cesDtc)
{
ERROR_LOG() << "Could not create DTC CentralEffectSimulation";
ERROR_LOG(m_logger) << "Could not create DTC CentralEffectSimulation";
return false;
}
@@ -54,7 +53,7 @@ bool HandlerParticipantEvent::init()
if (!m_cesDtc->enableParticipantEvent() )
{
ERROR_LOG() << "init() DTC CentralEffectSimulation failed";
ERROR_LOG(m_logger) << "init() DTC CentralEffectSimulation failed";
return false;
}
@@ -62,7 +61,7 @@ bool HandlerParticipantEvent::init()
m_pdmDtc = ProjectDataManagement::Interface::Dtc::create(m_ddsHandler->ddsConnector());
if (!m_pdmDtc)
{
ERROR_LOG() << "Could not create DTC ProjectDataManagement";
ERROR_LOG(m_logger) << "Could not create DTC ProjectDataManagement";
return false;
}
m_pdmDtc->enableChargeType();
@@ -84,7 +83,7 @@ bool HandlerParticipantEvent::init()
void HandlerParticipantEvent::onAesItemViewChanged(const AreaEffectSimulation::AesItemView &data, DataModification modType)
{
DEBUG_LOG() << "AesItemId: " << data.aesItemId() << ", effectState: " << data.effectStateId();
DEBUG_LOG(m_logger) << "AesItemId: " << data.aesItemId() << ", effectState: " << data.effectStateId();
Database::EemEvent eData = m_aesMap[data.id()];
eData.sampleTime = data.effectStart();
@@ -96,7 +95,7 @@ void HandlerParticipantEvent::onAesItemViewChanged(const AreaEffectSimulation::A
{
case DataModification::eAdded:
m_itemViews.insert(data.aesItemId(), data.aesTypeId());
DEBUG_LOG() << "eAdded: AesItemId: " << data.aesItemId() << ", effectState: " << data.effectStateId();
DEBUG_LOG(m_logger) << "eAdded: AesItemId: " << data.aesItemId() << ", effectState: " << data.effectStateId();
m_aesEffectState.insert(data.aesItemId(), data.effectStateId());
if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtBorderline)
@@ -115,7 +114,7 @@ void HandlerParticipantEvent::onAesItemViewChanged(const AreaEffectSimulation::A
data.boundingBoxBottomLeft().lat(), 0.0);
if (!m_dbHandler->db()->insert(eData))
ERROR_LOG() << "Error while inserting event data from AES ";
ERROR_LOG(m_logger) << "Error while inserting event data from AES ";
else
publishData(eData);
}
@@ -124,22 +123,22 @@ void HandlerParticipantEvent::onAesItemViewChanged(const AreaEffectSimulation::A
{
AreaEffectSimulation::AesEffectState effectState = m_aesEffectState.value(data.aesItemId());
DEBUG_LOG() << "eModified: AesItemId: " << data.aesItemId() << ", effectState: " << data.effectStateId();
DEBUG_LOG() << "effectState: " << effectState;
DEBUG_LOG(m_logger) << "eModified: AesItemId: " << data.aesItemId() << ", effectState: " << data.effectStateId();
DEBUG_LOG(m_logger) << "effectState: " << effectState;
// insert event only once
if (effectState != AreaEffectSimulation::AesEffectState::EsPrepared &&
(effectState == AreaEffectSimulation::AesEffectState_def::EsActivated && data.effectStateId() != AreaEffectSimulation::AesEffectState_def::EsExpired))
return;
INFO_LOG() << "new/update event: aesId: " << data.aesItemId();
INFO_LOG(m_logger) << "new/update event: aesId: " << data.aesItemId();
m_aesEffectState.insert(data.aesItemId(), data.effectStateId());
m_itemViews.insert(data.aesItemId(), data.aesTypeId());
eData.position = LtsUtils::QPoint3D(data.boundingBoxBottomLeft().lon(),
data.boundingBoxBottomLeft().lat(), 0.0);
INFO_LOG() << "aesType: " << data.aesTypeId();
INFO_LOG(m_logger) << "aesType: " << data.aesTypeId();
switch (data.aesTypeId().underlying())
{
@@ -181,7 +180,7 @@ void HandlerParticipantEvent::onAesItemViewChanged(const AreaEffectSimulation::A
// No ExerciseEvent for AesType
default:
{
INFO_LOG() << "No ExerciseEvent for AesType:" << data.aesTypeId().underlying();
INFO_LOG(m_logger) << "No ExerciseEvent for AesType:" << data.aesTypeId().underlying();
return;
}
}
@@ -212,7 +211,7 @@ void HandlerParticipantEvent::onAesItemViewChanged(const AreaEffectSimulation::A
{
if (!m_dbHandler->db()->insert(eData))
{
ERROR_LOG() << "Error while inserting event data from AES ";
ERROR_LOG(m_logger) << "Error while inserting event data from AES ";
break;
}
m_aesMap.insert(data.id(), eData);
@@ -221,7 +220,7 @@ void HandlerParticipantEvent::onAesItemViewChanged(const AreaEffectSimulation::A
{
if (!m_dbHandler->db()->update(eData))
{
ERROR_LOG() << "Error while updating event data from AES ";
ERROR_LOG(m_logger) << "Error while updating event data from AES ";
break;
}
}
@@ -290,7 +289,7 @@ void HandlerParticipantEvent::onExplosionSingleChanged(const AreaEffectSimulatio
{
if (!m_dbHandler->db()->insert(eData))
{
ERROR_LOG() << "Error while inserting event data from AES ";
ERROR_LOG(m_logger) << "Error while inserting event data from AES ";
break;
}
m_aesMap.insert(data.id(), eData);
@@ -299,7 +298,7 @@ void HandlerParticipantEvent::onExplosionSingleChanged(const AreaEffectSimulatio
{
if (!m_dbHandler->db()->update(eData))
{
ERROR_LOG() << "Error while updating event data from AES ";
ERROR_LOG(m_logger) << "Error while updating event data from AES ";
break;
}
}
@@ -307,7 +306,7 @@ void HandlerParticipantEvent::onExplosionSingleChanged(const AreaEffectSimulatio
break;
}
default:
DEBUG_LOG() << "Nothing to do";
DEBUG_LOG(m_logger) << "Nothing to do";
}
}
//-----------------------------------------------------------------------------
@@ -323,7 +322,7 @@ void HandlerParticipantEvent::onParticipantEventChanged(const CentralEffectSimul
eData.partyId = data.partyId();
eData.sampleTime = data.eventTime();
eData.position = LtsUtils::QPoint3D(data.position().lon(), data.position().lat(), data.position().z());
DEBUG_LOG() << " onParticipantEventChanged "
DEBUG_LOG(m_logger) << " onParticipantEventChanged "
<< " position=" << data.position()
<< " eData.position=" << eData.position;
@@ -397,7 +396,7 @@ void HandlerParticipantEvent::onParticipantEventChanged(const CentralEffectSimul
if (!m_dbHandler->db()->insert(eData))
ERROR_LOG() << "Error while inserting event data from CES ";
ERROR_LOG(m_logger) << "Error while inserting event data from CES ";
else
publishData(eData);
@@ -412,7 +411,7 @@ void HandlerParticipantEvent::publishData(const Database::EemEvent &data)
ExerciseEventManagement::Event ddsData = toDdsData(data);
if (!m_ddsHandler->dts()->publish(ddsData))
ERROR_LOG() << "Error publishing event-data to dds";
ERROR_LOG(m_logger) << "Error publishing event-data to dds";
// take data from dds-bus after 10s, we need just to make sure the recording service got it
m_mainHandler->addEventIdToRemove(ddsData.id());