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

@@ -15,10 +15,9 @@
using namespace EffectShowManagement;
HandlerAesData::HandlerAesData(Initialization *mainHandler)
: QObject()
, m_mainHandler(mainHandler)
{
HandlerAesData::HandlerAesData(Initialization *mainHandler) : QObject()
, m_mainHandler(mainHandler),
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
} // end of ctor()
//=============================================================================
HandlerAesData::~HandlerAesData()
@@ -30,7 +29,7 @@ HandlerAesData::~HandlerAesData()
bool HandlerAesData::init()
{
DEBUG_LOG() << "Begin HandlerAesData";
DEBUG_LOG(m_logger) << "Begin HandlerAesData";
// create ObjectAesData
auto cbAes = [this](const Database::EsmAesData & data)
@@ -41,7 +40,7 @@ bool HandlerAesData::init()
};
if (!m_mainHandler->db()->select(cbAes))
{
ERROR_LOG() << "Error reading data from database!";
ERROR_LOG(m_logger) << "Error reading data from database!";
return false;
}
@@ -109,7 +108,7 @@ bool HandlerAesData::init()
return false;
}
DEBUG_LOG() << "m_AesDataObjMap.size() = " << m_AesDataObjMap.size();
DEBUG_LOG(m_logger) << "m_AesDataObjMap.size() = " << m_AesDataObjMap.size();
return true;
} // end of init()
@@ -147,7 +146,7 @@ void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::Explos
if (kindOfModification == HandlerEffectShow::KindOfModification_e::Added && ifs)
kindOfModification = HandlerEffectShow::KindOfModification_e::ModifiedData;
DEBUG_LOG() << "Got ExplosionArea: "
DEBUG_LOG(m_logger) << "Got ExplosionArea: "
<< "\n ID: " << data.id()
<< "\n Name: " << data.name()
<< "\n Effect status: " << data.effectStateId()
@@ -167,7 +166,7 @@ void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::Explos
if (ret.error())
{
delete ifs;
ERROR_LOG() << ret();
ERROR_LOG(m_logger) << ret();
}
else
{
@@ -187,10 +186,10 @@ void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::Explos
if (!ret.error())
m_mainHandler->handlerEffectShow()->onExplosionAreaChanged(areaData, kindOfModification);
else
ERROR_LOG() << ret();
ERROR_LOG(m_logger) << ret();
}
else
WARNING_LOG() << "Explosion Area not available for modification: " << data.id();
WARNING_LOG(m_logger) << "Explosion Area not available for modification: " << data.id();
break;
}
case HandlerEffectShow::KindOfModification_e::Removed:
@@ -198,11 +197,11 @@ void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::Explos
if (ifs != nullptr)
{
if (!m_AesDataObjMap.remove(data.id()))
ERROR_LOG() << "Remove of AES data (" << data.id() << ") from map failed.";
ERROR_LOG(m_logger) << "Remove of AES data (" << data.id() << ") from map failed.";
Core::FunctionReplyObject ret = ifs->removeObject();
if (ret.error())
ERROR_LOG() << ret();
ERROR_LOG(m_logger) << ret();
}
m_mainHandler->handlerEffectShow()->onExplosionAreaChanged(areaData, kindOfModification);
@@ -228,7 +227,7 @@ void HandlerAesData::onExplosionAreaChanged(const AreaEffectSimulation::Explosio
kindOfModification = HandlerEffectShow::KindOfModification_e::ModifiedData;
const Core::GeoPosition2D &posLl = data.area().cornerBottomLeft();
DEBUG_LOG() << "Got ExplosionArea: "
DEBUG_LOG(m_logger) << "Got ExplosionArea: "
<< "\n ID: " << data.id()
<< "\n Name: " << data.name()
<< "\n Effect status: " << data.effectStateId()
@@ -251,7 +250,7 @@ void HandlerAesData::onExplosionAreaChanged(const AreaEffectSimulation::Explosio
if (ret.error())
{
delete ifs;
ERROR_LOG() << ret();
ERROR_LOG(m_logger) << ret();
}
else
{
@@ -271,10 +270,10 @@ void HandlerAesData::onExplosionAreaChanged(const AreaEffectSimulation::Explosio
if (!ret.error())
m_mainHandler->handlerEffectShow()->onExplosionAreaChanged(data, kindOfModification);
else
ERROR_LOG() << ret();
ERROR_LOG(m_logger) << ret();
}
else
WARNING_LOG() << "Explosion Area not available for modification: " << data.id();
WARNING_LOG(m_logger) << "Explosion Area not available for modification: " << data.id();
break;
}
case HandlerEffectShow::KindOfModification_e::Removed:
@@ -282,11 +281,11 @@ void HandlerAesData::onExplosionAreaChanged(const AreaEffectSimulation::Explosio
if (ifs != nullptr)
{
if (!m_AesDataObjMap.remove(data.id()))
ERROR_LOG() << "Remove of AES data (" << data.id() << ") from map failed.";
ERROR_LOG(m_logger) << "Remove of AES data (" << data.id() << ") from map failed.";
Core::FunctionReplyObject ret = ifs->removeObject();
if (ret.error())
ERROR_LOG() << ret();
ERROR_LOG(m_logger) << ret();
}
m_mainHandler->handlerEffectShow()->onExplosionAreaChanged(data, kindOfModification);
@@ -310,7 +309,7 @@ void HandlerAesData::onExplosionClusterChanged(const AreaEffectSimulation::Explo
kindOfModification = HandlerEffectShow::KindOfModification_e::ModifiedData;
const Core::GeoPosition2D &posLl = data.area().cornerBottomLeft();
DEBUG_LOG() << ">>>> Got Cluster: "
DEBUG_LOG(m_logger) << ">>>> Got Cluster: "
<< "\n ID: " << data.id()
<< "\n Name: " << data.name()
<< "\n Effect status: " << data.effectStateId()
@@ -333,7 +332,7 @@ void HandlerAesData::onExplosionClusterChanged(const AreaEffectSimulation::Explo
if (ret.error())
{
delete ifs;
ERROR_LOG() << ret();
ERROR_LOG(m_logger) << ret();
}
else
{
@@ -353,10 +352,10 @@ void HandlerAesData::onExplosionClusterChanged(const AreaEffectSimulation::Explo
if (!ret.error())
m_mainHandler->handlerEffectShow()->onExplosionClusterChanged(data, kindOfModification);
else
ERROR_LOG() << ret();
ERROR_LOG(m_logger) << ret();
}
else
WARNING_LOG() << "Explosion Area not available for modification: " << data.id();
WARNING_LOG(m_logger) << "Explosion Area not available for modification: " << data.id();
break;
}
case HandlerEffectShow::KindOfModification_e::Removed:
@@ -364,11 +363,11 @@ void HandlerAesData::onExplosionClusterChanged(const AreaEffectSimulation::Explo
if (ifs != nullptr)
{
if (!m_AesDataObjMap.remove(data.id()))
ERROR_LOG() << "Remove of AES data (" << data.id() << ") from map failed.";
ERROR_LOG(m_logger) << "Remove of AES data (" << data.id() << ") from map failed.";
Core::FunctionReplyObject ret = ifs->removeObject();
if (ret.error())
ERROR_LOG() << ret();
ERROR_LOG(m_logger) << ret();
}
m_mainHandler->handlerEffectShow()->onExplosionClusterChanged(data, kindOfModification);
@@ -391,7 +390,7 @@ void HandlerAesData::onEffectClusterChanged(const AreaEffectSimulation::EffectCl
kindOfModification = HandlerEffectShow::KindOfModification_e::ModifiedData;
const Core::GeoPosition2D &posLl = data.area().cornerBottomLeft();
DEBUG_LOG() << ">>>> Got EffectCluster: "
DEBUG_LOG(m_logger) << ">>>> Got EffectCluster: "
<< "\n ID: " << data.id()
<< "\n Name: " << data.name()
<< "\n Effect status: " << data.effectStateId()
@@ -414,7 +413,7 @@ void HandlerAesData::onEffectClusterChanged(const AreaEffectSimulation::EffectCl
if (ret.error())
{
delete ifs;
ERROR_LOG() << ret();
ERROR_LOG(m_logger) << ret();
}
else
{
@@ -434,10 +433,10 @@ void HandlerAesData::onEffectClusterChanged(const AreaEffectSimulation::EffectCl
if (!ret.error())
m_mainHandler->handlerEffectShow()->onEffectClusterChanged(data, kindOfModification);
else
ERROR_LOG() << ret();
ERROR_LOG(m_logger) << ret();
}
else
WARNING_LOG() << "Explosion Area not available for modification: " << data.id();
WARNING_LOG(m_logger) << "Explosion Area not available for modification: " << data.id();
break;
}
case HandlerEffectShow::KindOfModification_e::Removed:
@@ -445,11 +444,11 @@ void HandlerAesData::onEffectClusterChanged(const AreaEffectSimulation::EffectCl
if (ifs != nullptr)
{
if (!m_AesDataObjMap.remove(data.id()))
ERROR_LOG() << "Remove of AES data (" << data.id() << ") from map failed.";
ERROR_LOG(m_logger) << "Remove of AES data (" << data.id() << ") from map failed.";
Core::FunctionReplyObject ret = ifs->removeObject();
if (ret.error())
ERROR_LOG() << ret();
ERROR_LOG(m_logger) << ret();
}
m_mainHandler->handlerEffectShow()->onEffectClusterChanged(data, kindOfModification);
@@ -476,7 +475,7 @@ void HandlerAesData::onMineAreaChanged(const AreaEffectSimulation::MineArea &dat
return;
const Core::GeoPosition2D &posLl = data.segments().at(data.segments().size() / 2).positionStart();
DEBUG_LOG() << "Got MineArea: "
DEBUG_LOG(m_logger) << "Got MineArea: "
<< "\n ID: " << data.id()
<< "\n Name: " << data.name()
<< "\n Effect status: " << data.effectStateId()
@@ -497,7 +496,7 @@ void HandlerAesData::onMineAreaChanged(const AreaEffectSimulation::MineArea &dat
if (ret.error())
{
delete ifs;
ERROR_LOG() << ret();
ERROR_LOG(m_logger) << ret();
}
else
{
@@ -517,10 +516,10 @@ void HandlerAesData::onMineAreaChanged(const AreaEffectSimulation::MineArea &dat
if (!ret.error())
m_mainHandler->handlerEffectShow()->onMineAreaChanged(data, kindOfModification);
else
ERROR_LOG() << ret();
ERROR_LOG(m_logger) << ret();
}
else
WARNING_LOG() << "Mine Area not available for modification: " << data.id();
WARNING_LOG(m_logger) << "Mine Area not available for modification: " << data.id();
break;
}
case HandlerEffectShow::KindOfModification_e::Removed:
@@ -528,11 +527,11 @@ void HandlerAesData::onMineAreaChanged(const AreaEffectSimulation::MineArea &dat
if (ifs != nullptr)
{
if (!m_AesDataObjMap.remove(data.id()))
ERROR_LOG() << "Remove of AES data (" << data.id() << ") from map failed.";
ERROR_LOG(m_logger) << "Remove of AES data (" << data.id() << ") from map failed.";
Core::FunctionReplyObject ret = ifs->removeObject();
if (ret.error())
ERROR_LOG() << ret();
ERROR_LOG(m_logger) << ret();
}
m_mainHandler->handlerEffectShow()->onMineAreaChanged(data, kindOfModification);
break;
@@ -558,18 +557,18 @@ bool HandlerAesData::takeIntoAccountEffectShow(const AreaEffectSimulation::AesEf
HandlerEffectShow::KindOfModification_e HandlerAesData::getKindOfModification(const Database::EsmAesData &data, DataModification modType) const
{
auto it = m_AesDataObjMap.find(data.idAes);
DEBUG_LOG() << "Check esm " << data.idAes << " modType " << modType;
DEBUG_LOG(m_logger) << "Check esm " << data.idAes << " modType " << modType;
switch (modType)
{
case DataModification::eAdded:
case DataModification::eModified:
{
DEBUG_LOG() << "Case Added Or Modified";
DEBUG_LOG(m_logger) << "Case Added Or Modified";
if (it != m_AesDataObjMap.end())
{
DEBUG_LOG() << "Found data";
DEBUG_LOG(m_logger) << "Found data";
if (it.value()->areaChanged(data))
return HandlerEffectShow::KindOfModification_e::ModifiedArea;
if (it.value()->dataChanged(data))