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

@@ -24,7 +24,7 @@ HandlerBuildingData::HandlerBuildingData(const std::shared_ptr<CentralEffectSimu
, m_ddsHandler(ddsHandler)
, m_logger(CentralEffectSimulation::getLogger("HandlerBuildingData"))
{
INFO_LOG() << "HandlerBuildingData::HandlerBuildingData()";
INFO_LOG(m_logger) << "HandlerBuildingData::HandlerBuildingData()";
} // end of ctor()
//-----------------------------------------------------------------------------
@@ -34,7 +34,7 @@ HandlerBuildingData::~HandlerBuildingData()
//-----------------------------------------------------------------------------
bool HandlerBuildingData::init()
{
INFO_LOG() << "HandlerBuildingData::init()";
INFO_LOG(m_logger) << "HandlerBuildingData::init()";
auto dtcIsm = m_ddsHandler->dtcIsm();
dtcIsm->waitForHistoricalDataMainStructureElement(1000);
@@ -67,18 +67,18 @@ bool HandlerBuildingData::init()
// ///////////////////////////////////
void HandlerBuildingData::onMainStructureElementChanged(const InfrastructureManagement::MainStructureElement &data, DataModification modType)
{
INFO_LOG() << "HandlerBuildingData::onMainStructureElementChanged() id=" << data.id();
INFO_LOG(m_logger) << "HandlerBuildingData::onMainStructureElementChanged() id=" << data.id();
if (modType == DataModification::eRemoved
|| !m_ddsHandler->dtcIsm()->isElementAssignedToExercise(data, m_ddsHandler->getExerciseId()))
{
INFO_LOG() << "HandlerBuildingData::onMainStructureElementChanged() id=" << data.id() << " remove";
INFO_LOG(m_logger) << "HandlerBuildingData::onMainStructureElementChanged() id=" << data.id() << " remove";
m_mainStructureElements.remove(data.id());
m_footprints.remove(data.id());
return;
}
m_mainStructureElements.insert(data.id(), data);
DEBUG_LOG() << "Got MainStructureElement: " << data;
DEBUG_LOG(m_logger) << "Got MainStructureElement: " << data;
for (const InfrastructureManagement::StructureElement &ele : std::as_const(data.elements()))
{
if (ele.structureElementTypeId() == InfrastructureManagement::StructureElementType_def::Room)
@@ -89,7 +89,7 @@ void HandlerBuildingData::onMainStructureElementChanged(const InfrastructureMana
const int structureElementId = path.at(0);
const int floorId = path.at(1);
const int roomId = path.at(2);
DEBUG_LOG() << "ele.id=" << ele.id() << " name =" << ele.name()
DEBUG_LOG(m_logger) << "ele.id=" << ele.id() << " name =" << ele.name()
<< " ele.StructureElementType=" << ele.structureElementTypeId()
<< " buildingId = " << structureElementId
<< " floorId =" << floorId
@@ -102,7 +102,7 @@ void HandlerBuildingData::onMainStructureElementChanged(const InfrastructureMana
{
if (ele.mountingPointTypeId() == InfrastructureManagement::MountingPointType::EffectGenerationControlUnit)
{
DEBUG_LOG() << "EGCU id=" << ele.id()
DEBUG_LOG(m_logger) << "EGCU id=" << ele.id()
<< " displayName=" << ele.displayName()
<< " name=" << ele.name()
<< " type=" << ele.mountingPointTypeId();
@@ -121,7 +121,7 @@ void HandlerBuildingData::onMainStructureElementChanged(const InfrastructureMana
//QString hostname = QString::fromStdString(ele.hostname());
//assetPosition.hostname = hostname;
m_assetPositions.insert(assetPosition.structureElementId, assetPosition);
DEBUG_LOG() << "assetPosition.insert StructureElementId= " << assetPosition.structureElementId
DEBUG_LOG(m_logger) << "assetPosition.insert StructureElementId= " << assetPosition.structureElementId
<< " geoPosition=" << assetPosition.geoPosition
<< " relPosition=" << assetPosition.relPosition
<< " hostname=" << assetPosition.hostname
@@ -141,7 +141,7 @@ void HandlerBuildingData::onMountingPointAssetChanged(const InfrastructureManage
if (modType == DataModification::eRemoved)
return;
DEBUG_LOG() << "onMountingPointAssetChanged id=" << data.id()
DEBUG_LOG(m_logger) << "onMountingPointAssetChanged id=" << data.id()
<< " assetId=" << data.assetId()
<< " structureElementId=" << data.structureElementId();
m_mountingPointAsset.insert(data.structureElementId(), m_assetMountingPoint.value(data.assetId()));
@@ -155,7 +155,7 @@ void HandlerBuildingData::onInstrumentationAssetChanged(const InfrastructureMana
if (data.mountingPointTypeId() == InfrastructureManagement::MountingPointType::EffectGenerationControlUnit)
{
DEBUG_LOG() << "onInstrumentationAssetChanged id=" << data.id()
DEBUG_LOG(m_logger) << "onInstrumentationAssetChanged id=" << data.id()
<< " hostname=" << data.hostname();
QString hostname = QString::fromStdString(data.hostname());
m_instrumentationAssets.insert(data.id(), hostname);
@@ -163,7 +163,7 @@ void HandlerBuildingData::onInstrumentationAssetChanged(const InfrastructureMana
{
int assetId = data.id();
int mountpointId = m_assetMountingPoint.value(assetId);
DEBUG_LOG() << "m_instrumentationAsset.contains(" << assetId << ")"
DEBUG_LOG(m_logger) << "m_instrumentationAsset.contains(" << assetId << ")"
<< " assetId=" << assetId
<< " mountpointId=" << mountpointId;
if (m_assetPositions.contains(mountpointId))
@@ -172,7 +172,7 @@ void HandlerBuildingData::onInstrumentationAssetChanged(const InfrastructureMana
assetPosition.hostname = hostname;
assetPosition.mountingPointType = data.mountingPointTypeId();
m_assetPositions.insert(assetPosition.structureElementId, assetPosition);
DEBUG_LOG() << "m_assetPositions.insert assetPosition structureElementId= " << assetPosition.structureElementId
DEBUG_LOG(m_logger) << "m_assetPositions.insert assetPosition structureElementId= " << assetPosition.structureElementId
<< " type=" << assetPosition.mountingPointType
<< " geoPosition=" << assetPosition.geoPosition
<< " relPosition=" << assetPosition.relPosition
@@ -186,7 +186,7 @@ void HandlerBuildingData::onInstrumentationAssetChanged(const InfrastructureMana
QVector<int> HandlerBuildingData::getFloorsFromStructureElementId(int structureElementId) const
{
DEBUG_LOG() << "getFloorsFromStructureElementId structureElementId=" << structureElementId;
DEBUG_LOG(m_logger) << "getFloorsFromStructureElementId structureElementId=" << structureElementId;
QVector<int> result;
result.reserve(m_structureElementToFloor.size());
for (auto i = m_structureElementToFloor.begin(); i != m_structureElementToFloor.end(); ++i)
@@ -194,13 +194,13 @@ QVector<int> HandlerBuildingData::getFloorsFromStructureElementId(int structureE
if (i.value() == structureElementId)
result.append(i.key());
}
DEBUG_LOG() << "result.size()" << result.size();
DEBUG_LOG(m_logger) << "result.size()" << result.size();
return result;
}
QVector<int> HandlerBuildingData::getFloorsFromBuilding(int buildingId) const
{
DEBUG_LOG() << "getFloorsFromBuilding buildingId=" << buildingId;
DEBUG_LOG(m_logger) << "getFloorsFromBuilding buildingId=" << buildingId;
QVector<int> result;
result.reserve(m_buildingFloor.size());
for (auto i = m_buildingFloor.begin(); i != m_buildingFloor.end(); ++i)
@@ -208,18 +208,18 @@ QVector<int> HandlerBuildingData::getFloorsFromBuilding(int buildingId) const
if (i.value() == buildingId)
result.append(i.key());
}
DEBUG_LOG() << "result.size()" << result.size();
DEBUG_LOG(m_logger) << "result.size()" << result.size();
return result;
}
void HandlerBuildingData::printAssetPositions()
{
DEBUG_LOG() << "printAssetPositions: ";
DEBUG_LOG(m_logger) << "printAssetPositions: ";
QHashIterator<int, AssetPosition> i(m_assetPositions);
while (i.hasNext())
{
i.next();
DEBUG_LOG() << "printAssetPositions: "
DEBUG_LOG(m_logger) << "printAssetPositions: "
<< i.key() << ": " << i.value().structureElementId
<< " type = " << i.value().mountingPointType
<< " hostname =" << i.value().hostname
@@ -237,24 +237,24 @@ int HandlerBuildingData::getBuildingIdFromRoomId(const int roomId)
buildingId = -1;
else
buildingId = getBuildingIdFromFloorId(floorId);
DEBUG_LOG() << "getBuildingIdFromRoomId roomId=" << roomId
DEBUG_LOG(m_logger) << "getBuildingIdFromRoomId roomId=" << roomId
<< " buildingId=" << buildingId;
return buildingId;
}
QVector<int> HandlerBuildingData::polygonEncloseBuildings(const QPolygonF &polygon)
{
DEBUG_LOG() << "polygonEncloseBuildings";
DEBUG_LOG(m_logger) << "polygonEncloseBuildings";
int exerciseId = m_ddsHandler->getExerciseId();
bool completeEnclosed = true;
DEBUG_LOG() << "Vor getBuildingByPolygon";
DEBUG_LOG(m_logger) << "Vor getBuildingByPolygon";
bool isGroundLevel = false;
QVector<int> buildingsInside = m_ddsHandler->dtcIsm()->getBuildingByPolygon(exerciseId, polygon, completeEnclosed, isGroundLevel);
DEBUG_LOG() << "Nach getBuildingByPolygon";
DEBUG_LOG(m_logger) << "Nach getBuildingByPolygon";
//int buildingId = m_ddsHandler->dtcIsm()->getSurroundingBuildingByPolygon(exerciseId, polygon);
//DEBUG_LOG() << "getSurroundingBuildingByPolygon buildingId= " << buildingId;
//DEBUG_LOG(m_logger) << "getSurroundingBuildingByPolygon buildingId= " << buildingId;
return buildingsInside;
}
@@ -269,7 +269,7 @@ void HandlerBuildingData::getFootprintsByExercise()
while (i.hasNext())
{
i.next();
DEBUG_LOG() << "Key=" << i.key() << ": " << i.value().size();
DEBUG_LOG(m_logger) << "Key=" << i.key() << ": " << i.value().size();
Footprint footprint;
footprint.mseId = i.key();
footprint.polyUtm = i.value();
@@ -279,7 +279,7 @@ void HandlerBuildingData::getFootprintsByExercise()
// for concealment calculation (Verdeckung)
if (!footprint.boundingBoxPolyUtm.isValid())
{
WARNING_LOG() << "mseId=" << footprint.mseId
WARNING_LOG(m_logger) << "mseId=" << footprint.mseId
<< " boundingBoxPolyUtm not valid";
continue;
}