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

@@ -175,7 +175,7 @@ bool BuildingEdit::apply()
DEBUG_LOG() << "fortifyFactors.size()=" << fortifyFactors.size();
DEBUG_LOG(m_logger) << "fortifyFactors.size()=" << fortifyFactors.size();
if (fortifyFactors.size())
{
m_requestHelper->addRequest([this, fortifyFactors]()
@@ -187,7 +187,7 @@ bool BuildingEdit::apply()
fortifyRequest.fortifyFactors().reserve(fortifyFactors.size());
for (const auto &e : fortifyFactors)
{
DEBUG_LOG() << "push_back= databaseId=" << e.structureElementId()
DEBUG_LOG(m_logger) << "push_back= databaseId=" << e.structureElementId()
<< " fortifyFactor=" << e.fortifyFactor();
fortifyRequest.fortifyFactors().push_back(Buildings::FortifyFactor(e.structureElementId(), e.fortifyFactor()));
}
@@ -305,7 +305,7 @@ bool BuildingEdit::sendBuildingStateRequest(ProjectDataManagement::Vulnerability
requestData.buildings(buildings);
requestData.vulnerabilityState(state);
DEBUG_LOG() << Q_FUNC_INFO << "currentData: " << state;
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "currentData: " << state;
return m_bldFtc->setBuildingStatesRequest(requestData, this);
});
@@ -58,6 +58,8 @@ private slots:
void onDestroyElement();
protected:
NGL::INGLLogger &m_logger;
void retranslate() override;
bool apply() override;
@@ -16,8 +16,8 @@ namespace BuildingViewer
{
BuildingEditModel::BuildingEditModel(QObject *parent,
const std::shared_ptr<InfrastructureManagement::Interface::Dtc> &ismDtc,
const std::shared_ptr<Buildings::Interface::Dtc> &bldDtc)
: NGLTreeModel(parent, new NGLTreeItem(QVariant()), {
const std::shared_ptr<Buildings::Interface::Dtc> &bldDtc) : NGLTreeModel(parent, new NGLTreeItem(QVariant()),,
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
tr("Selected Building"),
QStringLiteral("Name (DEBUG)"),
QStringLiteral("MountingPointId (DEBUG)"),
@@ -76,7 +76,7 @@ QVariant BuildingEditModel::data(const QModelIndex &index, int role) const
bool BuildingEditModel::slotUpdateRow(const BuildingViewer::TreeItem &room, const bool fortifyChanged)
{
DEBUG_LOG() << "slotUpdateRow isBuilding=" << room.isBuilding()
DEBUG_LOG(m_logger) << "slotUpdateRow isBuilding=" << room.isBuilding()
<< " isFloor" << room.isFloor()
<< " isRoom" << room.isRoom();
@@ -122,7 +122,7 @@ bool BuildingEditModel::onInsertRow(int &row, const QModelIndex &parent, const B
bool BuildingEditModel::init(int32_t mseId)
{
INFO_LOG() << "init mseId=" << mseId;
INFO_LOG(m_logger) << "init mseId=" << mseId;
NGLTreeModel::resetModel();
m_mapRoomsWithChangedFortifyFactor.clear();
@@ -141,7 +141,7 @@ bool BuildingEditModel::init(int32_t mseId)
const std::vector<InfrastructureManagement::StructureElement> &vecElements = building.elements();
for (const auto &se : vecElements)
{
DEBUG_LOG() << "se: " << se;
DEBUG_LOG(m_logger) << "se: " << se;
if (se.structureElementTypeId() == InfrastructureManagement::StructureElementType::Building)
{
BuildingViewer::TreeItem rootItemBuilding(se);
@@ -163,7 +163,7 @@ bool BuildingEditModel::init(int32_t mseId)
for (const auto &se : vecElements)
{
DEBUG_LOG() << "se: =" << se;
DEBUG_LOG(m_logger) << "se: =" << se;
if (se.structureElementTypeId() == InfrastructureManagement::StructureElementType_def::Floor)
{
BuildingViewer::TreeItem itemRoom(se);
@@ -208,7 +208,7 @@ bool BuildingEditModel::init(int32_t mseId)
}
catch (const std::out_of_range &e)
{
WARNING_LOG() << "Caught exception while trying to get superior id for building " << rootName << " with room with mounting point id: " << se.mountingPointId() << ": " << e.what();
WARNING_LOG(m_logger) << "Caught exception while trying to get superior id for building " << rootName << " with room with mounting point id: " << se.mountingPointId() << ": " << e.what();
return false;
}
@@ -231,7 +231,7 @@ bool BuildingEditModel::init(int32_t mseId)
int parentId = item.hasSuperior() ? item.getSuperior() : rootId;
if (!parentItemIndexCache.contains(parentId))
{
ERROR_LOG() << "Invalid building structure! Tree can not be built!";
ERROR_LOG(m_logger) << "Invalid building structure! Tree can not be built!";
return false;
}
@@ -255,7 +255,7 @@ QModelIndex BuildingEditModel::modelIndexByMountingPointId(int mountingPointId)
if (privateData(mi)->data().value<TreeItem>().mountingPointId() == mountingPointId)
return mi;
}
WARNING_LOG()<<"Could not find modelindex for given room mountig point id: " << mountingPointId;
WARNING_LOG(m_logger)<<"Could not find modelindex for given room mountig point id: " << mountingPointId;
return {};
}
@@ -265,7 +265,7 @@ QModelIndex BuildingEditModel::modelIndexByStructureElementId(int structureEleme
auto it = m_mapModelIndices.find(structureElementId);
if (it == m_mapModelIndices.end())
{
WARNING_LOG()<<"Could not find modelindex for given room structreElementId: " << structureElementId;
WARNING_LOG(m_logger)<<"Could not find modelindex for given room structreElementId: " << structureElementId;
return {};
}
return it.value();
@@ -50,6 +50,8 @@ signals:
void signalModelDataChanged();
private:
NGL::INGLLogger &m_logger;
QVariant data(const QModelIndex &index, int role) const override final;
bool onInsertRow(int &row, const QModelIndex &parent, const BuildingViewer::TreeItem &folderData);
@@ -6,15 +6,14 @@
namespace BuildingViewer
{
ReplayHandler::ReplayHandler(int buildingTopicStart_s, int buildingTopicEnd_s, const TopicReplay::Interface::SituationReplayTime &replay, QObject *parent)
: QObject(parent)
ReplayHandler::ReplayHandler(int buildingTopicStart_s, int buildingTopicEnd_s, const TopicReplay::Interface::SituationReplayTime &replay, QObject *parent) : QObject(parent)
, m_actualReplayStart_ms(0)
, m_actualReplayEnd_ms(0)
, m_replayDuration_ms(0)
, m_startOffset_ms(0)
, m_replayInfo(replay)
{
DEBUG_LOG() << "buildingTopicStart_s = " << buildingTopicStart_s
, m_replayInfo(replay),
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
DEBUG_LOG(m_logger) << "buildingTopicStart_s = " << buildingTopicStart_s
<< ", buildingTopicEnd_s = " << buildingTopicEnd_s
<< ", replay.topicStart_s = " << replay.topicStart_s
<< ", replay.topicEnd_s = " << replay.topicEnd_s
@@ -30,7 +29,7 @@ ReplayHandler::ReplayHandler(int buildingTopicStart_s, int buildingTopicEnd_s, c
m_actualReplayStart_ms = replay.replayStart_ms + start_diff_ms;
m_startOffset_ms = 0;
DEBUG_LOG() << "Replay starts before Building-Topic: Shift replay starting point to m_actualReplayStart_ms = " << m_actualReplayStart_ms;
DEBUG_LOG(m_logger) << "Replay starts before Building-Topic: Shift replay starting point to m_actualReplayStart_ms = " << m_actualReplayStart_ms;
}
else
{
@@ -38,7 +37,7 @@ ReplayHandler::ReplayHandler(int buildingTopicStart_s, int buildingTopicEnd_s, c
m_actualReplayStart_ms = replay.replayStart_ms;
m_startOffset_ms = std::abs(start_diff_ms);
DEBUG_LOG() << "Building-Topic starts before Replay: Starting Replay after " << m_startOffset_ms << "msec";
DEBUG_LOG(m_logger) << "Building-Topic starts before Replay: Starting Replay after " << m_startOffset_ms << "msec";
}
@@ -47,12 +46,12 @@ ReplayHandler::ReplayHandler(int buildingTopicStart_s, int buildingTopicEnd_s, c
if (replay.topicEnd_s > buildingTopicEnd_s)
{
m_actualReplayEnd_ms -= (replay.topicEnd_s - buildingTopicEnd_s) * 1000;
DEBUG_LOG() << "Replay longer than Building-Topic, cutting replay end to m_actualReplayEnd_ms = " << m_actualReplayEnd_ms;
DEBUG_LOG(m_logger) << "Replay longer than Building-Topic, cutting replay end to m_actualReplayEnd_ms = " << m_actualReplayEnd_ms;
}
m_replayDuration_ms = m_actualReplayEnd_ms - m_actualReplayStart_ms;
DEBUG_LOG() << "Replay from " << m_actualReplayStart_ms << " to " << m_actualReplayEnd_ms << " (duration = " << m_replayDuration_ms << ")";
DEBUG_LOG(m_logger) << "Replay from " << m_actualReplayStart_ms << " to " << m_actualReplayEnd_ms << " (duration = " << m_replayDuration_ms << ")";
if (m_startOffset_ms == 0)
m_startOffset_ms = -1;
@@ -71,7 +70,7 @@ void ReplayHandler::tick(qint64 diffSinceLastTick)
return;
}
DEBUG_LOG() << "ReplayHandler::tick(): Remaining: " << m_replayDuration_ms << "msec";
DEBUG_LOG(m_logger) << "ReplayHandler::tick(): Remaining: " << m_replayDuration_ms << "msec";
if (m_startOffset_ms == -1)
{
@@ -25,6 +25,8 @@ signals:
void signalStopReplay();
private:
NGL::INGLLogger &m_logger;
qint64 m_actualReplayStart_ms;
qint64 m_actualReplayEnd_ms;
@@ -15,7 +15,7 @@ namespace BuildingViewer
VideoExporter::VideoExporter(QObject *parent)
: QObject(parent)
{
DEBUG_LOG() << "ThreadVideoExporter has been created";
DEBUG_LOG(m_logger) << "ThreadVideoExporter has been created";
}
void VideoExporter::init(const VideoInformation &videoInfo)
@@ -26,12 +26,12 @@ void VideoExporter::init(const VideoInformation &videoInfo)
void VideoExporter::sendAliveSignals()
{
DEBUG_LOG() << "sendAliveSignals() called";
DEBUG_LOG(m_logger) << "sendAliveSignals() called";
for (auto &e : std::as_const(m_vecVideosToExport))
emit e.m_pExportNotifier->stillAlive();
DEBUG_LOG() << "\tSignals emitted, mutex unlocked";
DEBUG_LOG(m_logger) << "\tSignals emitted, mutex unlocked";
}
@@ -42,17 +42,17 @@ void VideoExporter::doExport()
if (QThread::currentThread()->isInterruptionRequested())
break;
VideoInformation toExport = m_vecVideosToExport.takeFirst();
DEBUG_LOG() << "Starting export of " << toExport.m_strFolderPath;
DEBUG_LOG(m_logger) << "Starting export of " << toExport.m_strFolderPath;
const auto state = toExport.m_bgViewerState.value(QStringLiteral("arrBuildingStates"));
if (!state.isArray())
{
WARNING_LOG() << "No opened buildings, nothing to export, skipping video!";
WARNING_LOG(m_logger) << "No opened buildings, nothing to export, skipping video!";
continue;
}
DEBUG_LOG() << "Emitting 'signalStartRecording'";
DEBUG_LOG(m_logger) << "Emitting 'signalStartRecording'";
emit signalStartRecording(toExport.m_strFolderPath, state);
QSharedPointer<ReplayHandler> pHandler;
@@ -83,7 +83,7 @@ void VideoExporter::doExport()
if (diff_ms >= 1000)
{
last_tick_elapsed = elapsed_sum_ms;
DEBUG_LOG() << "Export: " << elapsed_sum_ms / 1000 << "/" << record_duration_ms / 1000 << "[s] passed";
DEBUG_LOG(m_logger) << "Export: " << elapsed_sum_ms / 1000 << "/" << record_duration_ms / 1000 << "[s] passed";
}
if (pHandler)
@@ -97,12 +97,12 @@ void VideoExporter::doExport()
if (QThread::currentThread()->isInterruptionRequested())
break;
}
DEBUG_LOG() << "Done. Emitting 'signalStopRecording'";
DEBUG_LOG(m_logger) << "Done. Emitting 'signalStopRecording'";
emit signalStopRecording();
DEBUG_LOG() <<"Export done, emitting 'signalExportSuccessful'";
DEBUG_LOG(m_logger) <<"Export done, emitting 'signalExportSuccessful'";
toExport.m_pExportNotifier->setExportSuccessful(toExport.m_strFolderPath);
DEBUG_LOG() <<"\tsignal emitted";
DEBUG_LOG(m_logger) <<"\tsignal emitted";
}
}
@@ -53,6 +53,8 @@ signals:
void signalStopRecording();
private:
NGL::INGLLogger &m_logger;
void sendAliveSignals();
QVector<VideoInformation> m_vecVideosToExport;
@@ -104,7 +104,7 @@ bool TopicReplayInterface::exportTopic(const QJsonObject &attributes,
const QJsonArray states = attributes[QStringLiteral("arrBuildingStates")].toArray();
if (states.isEmpty())
{
INFO_LOG() << "Nothing to export";
INFO_LOG(m_logger) << "Nothing to export";
emit pExportNotifier->exportSuccessful(QString());
return true;
}
@@ -113,7 +113,7 @@ bool TopicReplayInterface::exportTopic(const QJsonObject &attributes,
QFile f(folderPath + QLatin1Char('/') + filename);
if (!f.open(QIODevice::WriteOnly))
{
WARNING_LOG() << "Can not open file '" << f.fileName() << "' for writing!";
WARNING_LOG(m_logger) << "Can not open file '" << f.fileName() << "' for writing!";
pExportNotifier->setExportFailed();
return false;
}
@@ -136,7 +136,7 @@ bool TopicReplayInterface::exportTopic(const QJsonObject &attributes,
obj[QStringLiteral("replays")] = arr;
f.write(QJsonDocument(obj).toJson(QJsonDocument::Indented));
f.close();
DEBUG_LOG() << "BDV filename: " << f.fileName();
DEBUG_LOG(m_logger) << "BDV filename: " << f.fileName();
QVector<int> buildingIds;
buildingIds.reserve(states.size());
@@ -146,7 +146,7 @@ bool TopicReplayInterface::exportTopic(const QJsonObject &attributes,
int buildingId = featureId2DatabaseId(QString::fromStdString(vws.m_featureID));
if (buildingId <= 0)
{
WARNING_LOG() << "Could not retrieve building id from '" << vws.m_featureID << "' - skipping";
WARNING_LOG(m_logger) << "Could not retrieve building id from '" << vws.m_featureID << "' - skipping";
continue;
}
buildingIds += buildingId;
@@ -172,7 +172,7 @@ bool TopicReplayInterface::exportTopic(const QJsonObject &attributes,
if (!m_replayIfc || !m_bgvController)
{
ERROR_LOG() << "BuildingViewer exportTopic: m_replayIfc==nullptr, can not start replay, aborting export";
ERROR_LOG(m_logger) << "BuildingViewer exportTopic: m_replayIfc==nullptr, can not start replay, aborting export";
emit pExportNotifier->exportFailed();
Q_ASSERT(false);
return false;
@@ -224,7 +224,7 @@ bool TopicReplayInterface::exportBuildings(const QVector<int> &buildingIds) cons
const QString modelPath = BgViewerController::buildingModelPath();
if (modelPath.isEmpty())
{
WARNING_LOG() << "Could not find path with building models - can not copy models";
WARNING_LOG(m_logger) << "Could not find path with building models - can not copy models";
return false;
}
@@ -232,13 +232,13 @@ bool TopicReplayInterface::exportBuildings(const QVector<int> &buildingIds) cons
QDir dir(outputPath);
if (!dir.exists() && !dir.mkpath(outputPath))
{
WARNING_LOG() << "Could not create path " << outputPath;
WARNING_LOG(m_logger) << "Could not create path " << outputPath;
return false;
}
QFile f(outputPath + QStringLiteral("/buildings.json"));
if (!f.open(QIODevice::ReadWrite))
{
WARNING_LOG() << "Could not open file " << f.fileName() << " for read/write: " << f.errorString();
WARNING_LOG(m_logger) << "Could not open file " << f.fileName() << " for read/write: " << f.errorString();
return false;
}
const QJsonArray arr(QJsonDocument::fromJson(f.readAll()).array());
@@ -257,7 +257,7 @@ bool TopicReplayInterface::exportBuildings(const QVector<int> &buildingIds) cons
const auto mse = ismDtc->mainStructureElement(buildingId);
if (mse.id() != buildingId)
{
WARNING_LOG() << "Could not find MainStructureElement for building with id " << buildingId << " - skipping";
WARNING_LOG(m_logger) << "Could not find MainStructureElement for building with id " << buildingId << " - skipping";
continue;
}
const QString fnIve = QString::fromStdString(mse.name()) + QStringLiteral(".flt.ive");
@@ -294,7 +294,7 @@ bool TopicReplayInterface::exportShaders() const
{
const QString shaderPath(NGL::findFile(NGL::FileType::ConfigFile, QStringLiteral("shaders")));
const QString outputPath(m_basePath + QStringLiteral("BuildingModels/shaders/"));
DEBUG_LOG() << "shaderPath: " << shaderPath << ", outputPath: " << outputPath;
DEBUG_LOG(m_logger) << "shaderPath: " << shaderPath << ", outputPath: " << outputPath;
return NGL::copyDirContentsToDir(shaderPath, outputPath);
}
@@ -306,10 +306,10 @@ bool TopicReplayInterface::copyFile(const QString &srcFn, const QString &srcDir,
QFile f(src);
if (!f.exists() || (!QFile::exists(dst) && !f.copy(dst)))
{
WARNING_LOG() << "Could not copy " << src << " to " << dst << ": " << f.errorString();
WARNING_LOG(m_logger) << "Could not copy " << src << " to " << dst << ": " << f.errorString();
return false;
}
DEBUG_LOG() << "Copied from " << src << " to " << dst;
DEBUG_LOG(m_logger) << "Copied from " << src << " to " << dst;
return true;
}
@@ -47,6 +47,7 @@ private slots:
void slotStartReplay(qint64 start, qint64 end, double speed);
void slotStopReplay();
private:
NGL::INGLLogger &m_logger;
bool exportBuildings(const QVector<int> &buildingIds) const;
bool exportShaders() const;
bool copyFile(const QString &srcFn, const QString &srcDir, const QString &dstDir) const;
@@ -32,6 +32,7 @@ public:
public Q_SLOTS:
void fetchBuildingList();
protected:
NGL::INGLLogger &m_logger;
void retranslate() override;
signals:
@@ -50,6 +50,8 @@ public slots:
void onViewerEventWidgetFocused(const QString &featureID);
private:
NGL::INGLLogger &m_logger;
Ui::BgViewerDataView *m_ui = nullptr;
BgViewerDataViewModel *m_pModel = nullptr;
BgViewerController *m_pBgvController = nullptr;
@@ -19,10 +19,9 @@
namespace BuildingViewer
{
BdvPluginProvider::BdvPluginProvider(LtsSession::LtsSession *session, QObject *parent)
: PluginProvider(parent)
, m_session(session)
{}
BdvPluginProvider::BdvPluginProvider(LtsSession::LtsSession *session, QObject *parent) : PluginProvider(parent)
, m_session(session),
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {}
bool BdvPluginProvider::init()
{
@@ -36,7 +35,7 @@ bool BdvPluginProvider::init()
if (!m_session->getDtc<Buildings::DataInterface>(m_bldDtc))
{
ERROR_LOG() << "Fetching 'm_bldDtc' failed!";
ERROR_LOG(m_logger) << "Fetching 'm_bldDtc' failed!";
return false;
}
m_session->getForeignGuiInterface<Buildings::ForeignInfoGuiInterface>(m_bldInfoIfc);
@@ -52,7 +51,7 @@ bool BdvPluginProvider::init()
if (!m_session->getDtc<ParticipantManagement::DataInterface>(m_ppmDtc))
{
ERROR_LOG() << "Fetching 'm_ppmDtc' failed!";
ERROR_LOG(m_logger) << "Fetching 'm_ppmDtc' failed!";
return false;
}
m_session->getForeignGuiInterface<ParticipantManagement::ForeignParticipantInfoGuiInterface>(m_ppmParticipantInfoIfc);
@@ -51,6 +51,8 @@ public:
LtsSession::LtsSession *m_session;
private:
NGL::INGLLogger &m_logger;
std::shared_ptr<AdvancedSymbology::ForeignDataInterface> m_asbIfc;
std::shared_ptr<AudioVideoManagement::ForeignDataInterface> m_avmDataIfc;
std::shared_ptr<Buildings::Interface::Dtc> m_bldDtc;