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

@@ -91,7 +91,7 @@ void PlanTopicEditor::updateInternalData()
if (fileId != -1)
{
DEBUG_LOG() << "topic compatibility mode - converting..";
DEBUG_LOG(m_logger) << "topic compatibility mode - converting..";
QJsonObject fakePlanItem;
fakePlanItem[QStringLiteral("keyId")] = 0;
@@ -111,7 +111,7 @@ void PlanTopicEditor::updateInternalData()
if (m_planItems.isEmpty())
{
WARNING_LOG() << "topic empty";
WARNING_LOG(m_logger) << "topic empty";
return;
}
@@ -34,6 +34,10 @@ public:
private:
NGL::INGLLogger &m_logger;
void updateInternalData() override final;
void retranslate() override final;
@@ -381,7 +381,7 @@ void PlanOverlayModel::updatePlanItem(const PlanItem &planItem)
{
if (!planItem.isValid())
{
ERROR_LOG() << "planItem has invalid key";
ERROR_LOG(m_logger) << "planItem has invalid key";
return;
}
@@ -539,12 +539,12 @@ void PlanOverlayModel::removeOverlay(int keyId)
bool PlanOverlayModel::reInitModel(int exerciseId, int phaseId)
{
DEBUG_LOG() << "ReInit Model for exerciseId = " << exerciseId << ", phaseId = " << phaseId;
DEBUG_LOG(m_logger) << "ReInit Model for exerciseId = " << exerciseId << ", phaseId = " << phaseId;
if ((exerciseId < 1) || (phaseId < 1))
{
WARNING_LOG() << Q_FUNC_INFO << " has been called with undefined exercise and/or phaseId";
WARNING_LOG(m_logger) << Q_FUNC_INFO << " has been called with undefined exercise and/or phaseId";
return false;
}
@@ -558,7 +558,7 @@ bool PlanOverlayModel::reInitModel(int exerciseId, int phaseId)
int planExId = it.value().m_exerciseId;
int planPhId = it.value().m_phaseId;
DEBUG_LOG() << "Plan name = " << it.value().m_fileName << " exercise = " << planExId << " phase = " << planPhId;
DEBUG_LOG(m_logger) << "Plan name = " << it.value().m_fileName << " exercise = " << planExId << " phase = " << planPhId;
if ((planExId < 1) || (planPhId < 1) || ((planExId == exerciseId) && (planPhId == phaseId)))
{
@@ -174,6 +174,7 @@ signals:
private:
NGL::INGLLogger &m_logger;
PlanItem &planItemRef(int keyId);
class InternalData;
@@ -122,31 +122,31 @@ bool InterfaceImpl::fetchInterfaces()
if (!m_session->getDtc<FileManagement::DataInterface>(m_internal->m_dtc))
{
DEBUG_LOG() << "getDtc for FileManagement::DataInterface failed.";
DEBUG_LOG(m_logger) << "getDtc for FileManagement::DataInterface failed.";
return false;
}
if (!m_session->getDtc<OperatorManagement::DataInterface>(m_internal->m_opmDtc))
{
DEBUG_LOG() << "getDtc for OperatorManagement::DataInterface failed.";
DEBUG_LOG(m_logger) << "getDtc for OperatorManagement::DataInterface failed.";
return false;
}
if (!m_session->getDtc<ExerciseManagement::DataInterface>(m_internal->m_exmDtc))
{
DEBUG_LOG() << "getDtc for ExerciseManagement::DataInterface failed.";
DEBUG_LOG(m_logger) << "getDtc for ExerciseManagement::DataInterface failed.";
return false;
}
if (!m_session->getFtc<FileManagement::DataInterface>(m_internal->m_ftc))
{
DEBUG_LOG() << "getFtc for FileManagement::DataInterface failed.";
DEBUG_LOG(m_logger) << "getFtc for FileManagement::DataInterface failed.";
return false;
}
if (!m_session->getForeignGuiInterface(m_internal->m_situationMapGui))
{
DEBUG_LOG() << "getForeignGuiInterface for SituationMap::ForeignGuiInterface failed.";
DEBUG_LOG(m_logger) << "getForeignGuiInterface for SituationMap::ForeignGuiInterface failed.";
return false;
}
@@ -238,7 +238,7 @@ bool InterfaceImpl::loadPlan(int planFileId,
if (overrideSitMapIfc == nullptr)
{
ERROR_LOG() << "no sit map ifc to load a plan on!";
ERROR_LOG(m_logger) << "no sit map ifc to load a plan on!";
return false;
}
@@ -250,7 +250,7 @@ bool InterfaceImpl::loadPlan(int planFileId,
if (fileContent.id() <= 0)
{
ERROR_LOG() << "Could not find plan with id " << planFileId << " in filemanagement - removing";
ERROR_LOG(m_logger) << "Could not find plan with id " << planFileId << " in filemanagement - removing";
return false;
}
@@ -265,7 +265,7 @@ bool InterfaceImpl::loadPlan(int planFileId,
if (!overrideSitMapIfc->planOverlaySetContent(planFileId, nameOfPlan, planXMLContent))
{
ERROR_LOG() << "no sit map ifc to load a plan on!";
ERROR_LOG(m_logger) << "no sit map ifc to load a plan on!";
return false;
}
@@ -307,7 +307,7 @@ bool InterfaceImpl::loadPlan(int planFileId,
else
planItem.m_maxScale = 0.0;
DEBUG_LOG() << " load plan and set minMaxScale:"
DEBUG_LOG(m_logger) << " load plan and set minMaxScale:"
<< " minScaleStr = " << minScaleStr
<< " maxScaleStr = " << maxScaleStr
<< " planItem.m_minScale = " << planItem.m_minScale
@@ -363,7 +363,7 @@ bool InterfaceImpl::loadPlan(int planFileId,
bool InterfaceImpl::unloadAllPlans()
{
DEBUG_LOG() << Q_FUNC_INFO << " START";
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START";
const QMap<unsigned int, PlanOverlayModel::PlanItem> &planStore = m_internal->m_overlayModel->planStore();
@@ -372,12 +372,12 @@ bool InterfaceImpl::unloadAllPlans()
{
mapIt.next();
unsigned int planId = mapIt.key();
DEBUG_LOG() << Q_FUNC_INFO << " removeOverlay, planId=" << planId;
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " removeOverlay, planId=" << planId;
m_internal->m_overlayModel->removeOverlay(planId);
}
DEBUG_LOG() << Q_FUNC_INFO << " END";
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END";
return true;
}
@@ -387,7 +387,7 @@ void InterfaceImpl::onUpdatePlan(int planId)
PlanOverlaysPlugin::PlanOverlayModel::PlanItem planItem = m_internal->m_overlayModel->planItemValue(planId);
if (!planItem.isValid())
{
ERROR_LOG() << "plan item with id " << planId << " not found in model";
ERROR_LOG(m_logger) << "plan item with id " << planId << " not found in model";
return;
}
@@ -405,7 +405,7 @@ void InterfaceImpl::onUpdatePlan(int planId)
if (!m_internal->m_foreignSitmapIfc->planOverlaySetContent(planFileId, planItem.m_fileName, planXMLContent))
{
ERROR_LOG() << Q_FUNC_INFO << "Error rendering planContent [" << planItem.m_fileName << "]";
ERROR_LOG(m_logger) << Q_FUNC_INFO << "Error rendering planContent [" << planItem.m_fileName << "]";
return false;
}
@@ -423,7 +423,7 @@ void InterfaceImpl::onUpdatePlan(int planId)
if (!ok)
{
ERROR_LOG() << Q_FUNC_INFO << "Error reading planContent [" << planItem.m_fileName << "]";
ERROR_LOG(m_logger) << Q_FUNC_INFO << "Error reading planContent [" << planItem.m_fileName << "]";
LtsWidgets::LtsMessageDialog::showMessage(m_session->baseLayout(), tr("Reading plan '%1' from database failed").arg(planItem.m_fileName), m_internal->m_messageBoxTitle);
}
}
@@ -498,7 +498,7 @@ QWidget *InterfaceImpl::openPlanOverlayDialog(const QJsonArray &planItems, bool
{
if (!planItemValue.isObject())
{
WARNING_LOG() << "planItem from json array is not an object! " << planItemValue.type();
WARNING_LOG(m_logger) << "planItem from json array is not an object! " << planItemValue.type();
continue;
}
@@ -506,7 +506,7 @@ QWidget *InterfaceImpl::openPlanOverlayDialog(const QJsonArray &planItems, bool
int planFileId = planItemObj[QStringLiteral("fileId")].toInt(-1);
if (!loadPlan(planFileId, planItemObj))
ERROR_LOG() << "could not load plan with file id " << planFileId;
ERROR_LOG(m_logger) << "could not load plan with file id " << planFileId;
}
@@ -562,7 +562,7 @@ void InterfaceImpl::onReloadPlanById(int planId)
const QByteArray &planXMLContent = LtsUtils::toQByteArray(reply.content());
if (planXMLContent.isEmpty())
{
ERROR_LOG() << Q_FUNC_INFO << "Error plan [" << nameOfPlan << "] is empty";
ERROR_LOG(m_logger) << Q_FUNC_INFO << "Error plan [" << nameOfPlan << "] is empty";
return false;
}
@@ -570,7 +570,7 @@ void InterfaceImpl::onReloadPlanById(int planId)
if (!m_internal->m_foreignSitmapIfc->planOverlaySetContent(planItem.m_fileId, planItem.m_fileName, planXMLContent))
{
ERROR_LOG() << Q_FUNC_INFO << "Error rendering planContent [" << nameOfPlan << "]";
ERROR_LOG(m_logger) << Q_FUNC_INFO << "Error rendering planContent [" << nameOfPlan << "]";
return false;
}
@@ -595,7 +595,7 @@ void InterfaceImpl::onReloadPlanById(int planId)
if (!ok)
{
ERROR_LOG() << Q_FUNC_INFO << "Error reading planContent [" << nameOfPlan << "]";
ERROR_LOG(m_logger) << Q_FUNC_INFO << "Error reading planContent [" << nameOfPlan << "]";
const QString & msg = tr("Reading plan '%1' from database failed").arg(nameOfPlan);
LtsWidgets::LtsMessageDialog::showMessage(m_session->baseLayout(), msg, m_internal->m_messageBoxTitle);
return;
@@ -617,14 +617,14 @@ bool InterfaceImpl::removePlan(int planId, SituationMap::ForeignGuiInterface* ov
if (overrideSitMapIfc == nullptr)
{
ERROR_LOG() << "no sit map ifc to remove a plan from for planId " << planId;
ERROR_LOG(m_logger) << "no sit map ifc to remove a plan from for planId " << planId;
return false;
}
const PlanOverlaysPlugin::PlanOverlayModel::PlanItem & planItem = m_internal->m_overlayModel->planItem(planId);
if (!planItem.isValid())
{
ERROR_LOG() << "plan item invalid for planId " << planId;
ERROR_LOG(m_logger) << "plan item invalid for planId " << planId;
return false;
}
@@ -708,7 +708,7 @@ void InterfaceImpl::onExerciseChanged(const ExerciseManagement::Exercise &data,
{
case DataModification::eModified:
{
DEBUG_LOG() << "onExerciseChanged - Modified";
DEBUG_LOG(m_logger) << "onExerciseChanged - Modified";
m_internal->m_overlayModel->reInitModel(data.id(), data.activePhaseId());
break;
}
@@ -727,12 +727,12 @@ void InterfaceImpl::onReloadPlanByName(const PlanOverlaysPlugin::PlanOverlayMode
{
int planFileId = m_internal->m_dtc->getFileId(FileManagement::FileType::TacticalPlan, planItem.m_fileName, exerciseId, phaseId);
DEBUG_LOG() << "Plan File Id = " << planFileId;
DEBUG_LOG(m_logger) << "Plan File Id = " << planFileId;
if (planFileId < 1)
{
if (removeFromModel) *removeFromModel = true;
INFO_LOG() << "Plan overlay will be removed: name = " << planItem.m_fileName;
INFO_LOG(m_logger) << "Plan overlay will be removed: name = " << planItem.m_fileName;
return;
}
@@ -747,7 +747,7 @@ void InterfaceImpl::onReloadPlanByName(const PlanOverlaysPlugin::PlanOverlayMode
const QByteArray &planXMLContent = LtsUtils::toQByteArray(reply.content());
if (planXMLContent.isEmpty())
{
ERROR_LOG() << Q_FUNC_INFO << "Error plan [" << nameOfPlan << "] is empty";
ERROR_LOG(m_logger) << Q_FUNC_INFO << "Error plan [" << nameOfPlan << "] is empty";
return false;
}
else
@@ -757,13 +757,13 @@ void InterfaceImpl::onReloadPlanByName(const PlanOverlaysPlugin::PlanOverlayMode
if (!m_internal->m_foreignSitmapIfc->planOverlayRemove(pi.m_fileId))
{
ERROR_LOG() << Q_FUNC_INFO << "Error removing plan overlay from map failed [" << nameOfPlan << "]";
ERROR_LOG(m_logger) << Q_FUNC_INFO << "Error removing plan overlay from map failed [" << nameOfPlan << "]";
}
if (!m_internal->m_foreignSitmapIfc->planOverlaySetContent(fileContent.id(), nameOfPlan, planXMLContent))
{
ERROR_LOG() << Q_FUNC_INFO << "Error rendering planContent [" << nameOfPlan << "]";
ERROR_LOG(m_logger) << Q_FUNC_INFO << "Error rendering planContent [" << nameOfPlan << "]";
return false;
}
@@ -797,7 +797,7 @@ void InterfaceImpl::onReloadPlanByName(const PlanOverlaysPlugin::PlanOverlayMode
if (!ok)
{
ERROR_LOG() << Q_FUNC_INFO << "Error reading planContent [" << nameOfPlan << "]";
ERROR_LOG(m_logger) << Q_FUNC_INFO << "Error reading planContent [" << nameOfPlan << "]";
const QString & msg = tr("Reading plan '%1' from database failed").arg(nameOfPlan);
LtsWidgets::LtsMessageDialog::showMessage(m_session->baseLayout(), msg, m_internal->m_messageBoxTitle);
}
@@ -809,7 +809,7 @@ TopicEditorBase::TopicEditor *InterfaceImpl::createTopicEditor(const TopicEditor
{
std::shared_ptr<FileManagement::Interface::Dtc> flmDtc;
if (!m_session->getDtc<FileManagement::DataInterface>(flmDtc))
WARNING_LOG() << "flm dtc missing - plan topic compatibility mode file name resolution not available";
WARNING_LOG(m_logger) << "flm dtc missing - plan topic compatibility mode file name resolution not available";
PlanTopicEditor *editor = new PlanTopicEditor(&m_foreignIfc, flmDtc);
editor->setTopicData(data);
@@ -839,7 +839,7 @@ bool InterfaceImpl::TopicReplayInterface::playbackInit(const QJsonObject &attrib
{
if (!m_foreignSitmapIfc)
{
ERROR_LOG() << Q_FUNC_INFO << "No foreign sitMapIfc, use PlanOverlaysPlugin::ForeignGuiInterface::setForeignSitMapGuiIfc() to define SituationMapGuiPlugin interface. Can't load tactical plan for playback ...";
ERROR_LOG(m_logger) << Q_FUNC_INFO << "No foreign sitMapIfc, use PlanOverlaysPlugin::ForeignGuiInterface::setForeignSitMapGuiIfc() to define SituationMapGuiPlugin interface. Can't load tactical plan for playback ...";
return false;
}
@@ -849,8 +849,8 @@ bool InterfaceImpl::TopicReplayInterface::playbackInit(const QJsonObject &attrib
if (planFileId != -1)
{
WARNING_LOG() << "Plan Overlays topic in compatibility mode!";
DEBUG_LOG() << "Loading plan id = " << planFileId;
WARNING_LOG(m_logger) << "Plan Overlays topic in compatibility mode!";
DEBUG_LOG(m_logger) << "Loading plan id = " << planFileId;
if (!m_ovr->loadPlan(planFileId, false, m_foreignSitmapIfc))
return false;
@@ -866,7 +866,7 @@ bool InterfaceImpl::TopicReplayInterface::playbackInit(const QJsonObject &attrib
{
if (!planItemValue.isObject())
{
ERROR_LOG() << "PlanItem from json array is not an object! " << planItemValue.type();
ERROR_LOG(m_logger) << "PlanItem from json array is not an object! " << planItemValue.type();
continue;
}
@@ -875,7 +875,7 @@ bool InterfaceImpl::TopicReplayInterface::playbackInit(const QJsonObject &attrib
if (!m_ovr->loadPlan(planFileId, planItemObj))
{
ERROR_LOG() << "could not load plan with file id " << planFileId;
ERROR_LOG(m_logger) << "could not load plan with file id " << planFileId;
continue;
}
@@ -891,16 +891,16 @@ bool InterfaceImpl::TopicReplayInterface::playbackStop()
{
if (nullptr == m_foreignSitmapIfc)
{
ERROR_LOG() << Q_FUNC_INFO << "Use PlanOverlaysPlugin::ForeignGuiInterface::setForeignSitMapGuiIfc() to define SituationMapGuiPlugin interface ...";
ERROR_LOG(m_logger) << Q_FUNC_INFO << "Use PlanOverlaysPlugin::ForeignGuiInterface::setForeignSitMapGuiIfc() to define SituationMapGuiPlugin interface ...";
return false;
}
while (!m_loadedPlanFileIds.isEmpty())
{
int planFileId = m_loadedPlanFileIds.takeFirst();
DEBUG_LOG() << " removePlan with file id " << planFileId;
DEBUG_LOG(m_logger) << " removePlan with file id " << planFileId;
if (!m_ovr->removePlan(planFileId, m_foreignSitmapIfc))
ERROR_LOG() << "could not unload plan with file id " << planFileId;
ERROR_LOG(m_logger) << "could not unload plan with file id " << planFileId;
}
return true;
@@ -111,6 +111,9 @@ public:
private:
NGL::INGLLogger &m_logger;
void onReloadPlanById(int planId);