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

@@ -165,7 +165,7 @@ void ExerciseManagementDialog::onEditExercise()
if (ex.id() <= 0)
return;
DEBUG_LOG() << "current EXId: " << ex.id();
DEBUG_LOG(m_logger) << "current EXId: " << ex.id();
ExerciseManagementEditDialog *dialog = new ExerciseManagementEditDialog(this);
@@ -42,6 +42,8 @@ private slots:
void onRemoveExercise();
private:
NGL::INGLLogger &m_logger;
void retranslate() override;
void onExerciseRemoveReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
void onFolderRemoveReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
@@ -83,7 +83,7 @@ bool ExerciseManagementDialogModel::initModel(const std::shared_ptr<ExerciseMana
addImagePreload(ex.id());
});
INFO_LOG() << "initModel - #exercises: " << m_vecData.size();
INFO_LOG(m_logger) << "initModel - #exercises: " << m_vecData.size();
return true;
}
@@ -144,7 +144,7 @@ GetExerciseImageRequester *ExerciseManagementDialogModel::createGetExerciseImage
for (const std::string &arg : std::as_const(reply.errorParams()))
msg = msg.arg(QString::fromStdString(arg));
ERROR_LOG() << "image preload failed: " << msg;
ERROR_LOG(m_logger) << "image preload failed: " << msg;
}
QTimer::singleShot(1, this, &ExerciseManagementDialogModel::preloadNextImage);
@@ -37,6 +37,8 @@ class GetExerciseImageRequester
Q_OBJECT
private:
NGL::INGLLogger &m_logger;
GetExerciseImageRequester() = default;
public:
@@ -330,7 +330,7 @@ void ExerciseManagementEditDialog::onGetExerciseImageReply(const GetExerciseImag
for (const std::string &arg : std::as_const(reply.errorParams()))
msg = msg.arg(QString::fromStdString(arg));
ERROR_LOG() << "loading exercise image failed: " << msg;
ERROR_LOG(m_logger) << "loading exercise image failed: " << msg;
@@ -440,7 +440,7 @@ void ExerciseManagementEditDialog::onEditVisibleParties()
if (operatorId <= 0 || isChecked == false || !visibleParties)
return;
DEBUG_LOG() << "current Operator Id: " << operatorId;
DEBUG_LOG(m_logger) << "current Operator Id: " << operatorId;
ExerciseEditPartyDialog *dialog = new ExerciseEditPartyDialog(operatorId, m_exerciseId, m_menuGroup, this);
@@ -459,7 +459,7 @@ void ExerciseManagementEditDialog::onEditExercisePhase()
if (exPhase.id() <= 0)
return;
DEBUG_LOG() << "current exPhase Id: " << exPhase.id();
DEBUG_LOG(m_logger) << "current exPhase Id: " << exPhase.id();
ExerciseManagementPhaseEditDialog *dialog = new ExerciseManagementPhaseEditDialog(this);
@@ -471,21 +471,21 @@ void ExerciseManagementEditDialog::onEditExercisePhase()
void ExerciseManagementEditDialog::onExport()
{
DEBUG_LOG() << "onExport";
DEBUG_LOG(m_logger) << "onExport";
const QByteArray byteArray = exerciseToJson();
DEBUG_LOG() << "Exporting: " << byteArray;
DEBUG_LOG(m_logger) << "Exporting: " << byteArray;
int fileId = m_flmGui->saveFileContent(this, FileManagement::FileType::Xml, 0, byteArray);
if (fileId > 0)
DEBUG_LOG() << "Saved file with id = " << fileId;
DEBUG_LOG(m_logger) << "Saved file with id = " << fileId;
else
ERROR_LOG() << "Could not save file in library ";
ERROR_LOG(m_logger) << "Could not save file in library ";
}
void ExerciseManagementEditDialog::onImport()
{
DEBUG_LOG() << "onImport";
DEBUG_LOG(m_logger) << "onImport";
QByteArray content;
int fileId = m_flmGui->loadFileContent(this, content, {FileManagement::FileType::Xml}, 0, JsonKeys::XMLTYPEVALUE());
@@ -504,7 +504,7 @@ void ExerciseManagementEditDialog::onImport()
else
{
ExerciseModifyRequest req = jsonToExercise(content);
DEBUG_LOG() << "Importing: " << req;
DEBUG_LOG(m_logger) << "Importing: " << req;
m_ui->pteForces->setPlainText(QString::fromStdString(req.forces()));
m_ui->pteDescription->setPlainText(QString::fromStdString(req.description()));
@@ -893,7 +893,7 @@ bool ExerciseManagementEditDialog::apply()
int newExId = m_requestHelper->getRepliedId();
DEBUG_LOG() << "Created new exercise with id " << newExId;
DEBUG_LOG(m_logger) << "Created new exercise with id " << newExId;
if (newExId > 0)
{
@@ -905,7 +905,7 @@ bool ExerciseManagementEditDialog::apply()
return m_ftc->exerciseImageModifyRequest(exImgRequest, this);
}))
{
WARNING_LOG() << "Unable to set default exercise picture";
WARNING_LOG(m_logger) << "Unable to set default exercise picture";
LtsWidgets::LtsMessageDialog::showMessage(this, tr("Unable to set default exercise picture"));
}
@@ -915,7 +915,7 @@ bool ExerciseManagementEditDialog::apply()
if (!createFolders(newExId))
{
WARNING_LOG() << "Unable to create exercise folders in document library.";
WARNING_LOG(m_logger) << "Unable to create exercise folders in document library.";
LtsWidgets::LtsMessageDialog::showMessage(this, tr("Unable to create exercise folders in document library."));
}
@@ -944,7 +944,7 @@ void ExerciseManagementEditDialog::sendModifiedOperators(int thisExerciseId)
std::shared_ptr<OperatorManagement::Interface::Ftc> opmFtc;
if (!m_session->getFtc<OperatorManagement::DataInterface>(opmFtc))
{
ERROR_LOG() << "Cannot change add/remove Operators to/from Exercise as the OPM-FTC could not be fetched." ;
ERROR_LOG(m_logger) << "Cannot change add/remove Operators to/from Exercise as the OPM-FTC could not be fetched." ;
return;
}
@@ -970,10 +970,10 @@ void ExerciseManagementEditDialog::sendModifiedOperators(int thisExerciseId)
req.visibleExercises() = user.exerciseIds();
req.visiblePartiesByExercise() = user.visiblePartiesByExercise();
DEBUG_LOG() << "Adding request: " << req;
DEBUG_LOG(m_logger) << "Adding request: " << req;
m_requestHelper->addRequest([this, req, opmFtc]()
{
DEBUG_LOG() << "Executing request: " << req;
DEBUG_LOG(m_logger) << "Executing request: " << req;
return opmFtc->operatorCreateModifyRequest(req, this);
});
@@ -991,7 +991,7 @@ bool ExerciseManagementEditDialog::createFolders(int newExId)
if (folderId <= 0)
return false;
DEBUG_LOG() << "Exercise Folder created with id = " << folderId;
DEBUG_LOG(m_logger) << "Exercise Folder created with id = " << folderId;
folderName = QStringLiteral("Documents") ;
@@ -1000,7 +1000,7 @@ bool ExerciseManagementEditDialog::createFolders(int newExId)
if (subFolderId <= 0)
return false;
DEBUG_LOG() << "Sub Folder Documents created with id = " << subFolderId;
DEBUG_LOG(m_logger) << "Sub Folder Documents created with id = " << subFolderId;
QStringList folderNames;
@@ -1008,7 +1008,7 @@ bool ExerciseManagementEditDialog::createFolders(int newExId)
folderNames << QStringLiteral("Incidents") << QStringLiteral("Instructions");
bool ok = createExerciseFolders(subFolderId, folderNames);
DEBUG_LOG() << "Created sub-folders Documents: " << ok;
DEBUG_LOG(m_logger) << "Created sub-folders Documents: " << ok;
LtsUtils::ProjectSettings *ps = LtsUtils::ProjectSettings::getInstance();
@@ -1019,7 +1019,7 @@ bool ExerciseManagementEditDialog::createFolders(int newExId)
folderName = QStringLiteral("Phase Documents");
int folderPhaseDocsId = createFolder(subFolderId, folderName);
DEBUG_LOG() << "Phase Documents Folder created with id = " << folderPhaseDocsId;
DEBUG_LOG(m_logger) << "Phase Documents Folder created with id = " << folderPhaseDocsId;
if (folderPhaseDocsId > 0)
@@ -1027,14 +1027,14 @@ bool ExerciseManagementEditDialog::createFolders(int newExId)
int phId = m_dtc->exercise(newExId).activePhaseId();
const QString &phaseName = m_flmDtc->getPhaseFolderName(phId);
int folderPhaseId = createFolder(folderPhaseDocsId, phaseName);
DEBUG_LOG() << "Phase Folder created with id = " << folderPhaseId;
DEBUG_LOG(m_logger) << "Phase Folder created with id = " << folderPhaseId;
}
}
folderName = QStringLiteral("Markers");
subFolderId = createFolder(folderId, folderName);
DEBUG_LOG() << "Markers Folder created with id = " << subFolderId;
DEBUG_LOG(m_logger) << "Markers Folder created with id = " << subFolderId;
FileManagement::PathCreateRequest req;
req.parentId(folderId);
@@ -1045,25 +1045,25 @@ bool ExerciseManagementEditDialog::createFolders(int newExId)
bool success = m_flmFtc->pathCreateRequest(req);
if (!success)
ERROR_LOG() << "Planning/TNE Lists could not be created";
ERROR_LOG(m_logger) << "Planning/TNE Lists could not be created";
req.path({"Tactical Plans", "BDA"});
success = m_flmFtc->pathCreateRequest(req);
if (!success)
ERROR_LOG() << "Tactical Plans/BDA could not be created";
ERROR_LOG(m_logger) << "Tactical Plans/BDA could not be created";
req.path({"Tactical Plans", "HQ Data"});
success = m_flmFtc->pathCreateRequest(req);
if (!success)
ERROR_LOG() << "Tactical Plans/HQ Data could not be created";
ERROR_LOG(m_logger) << "Tactical Plans/HQ Data could not be created";
folderNames.clear();
folderNames << QStringLiteral("Reports") << QStringLiteral("Snapshots");
ok = createExerciseFolders(folderId, folderNames);
DEBUG_LOG() << "Created last exercise documents: " << ok;
DEBUG_LOG(m_logger) << "Created last exercise documents: " << ok;
return true;
}
@@ -1086,7 +1086,7 @@ int ExerciseManagementEditDialog::createFolder(int parentFolderId, const QString
return m_flmFtc->folderModifyRequest(req, this);
});
DEBUG_LOG() << "Created folder id = " << m_requestHelper->getRepliedId();
DEBUG_LOG(m_logger) << "Created folder id = " << m_requestHelper->getRepliedId();
return m_requestHelper->getRepliedId();
}
@@ -1239,13 +1239,13 @@ ExerciseModifyRequest ExerciseManagementEditDialog::jsonToExercise(const QByteAr
void ExerciseManagementEditDialog::onCreateFolders()
{
DEBUG_LOG() << "onCreateFolders";
DEBUG_LOG(m_logger) << "onCreateFolders";
if (m_exerciseId > 0 && getExerciseFolder() <= 0 )
{
bool ok = createFolders(m_exerciseId);
if (!ok)
{
WARNING_LOG() << "Could not create exercise folders";
WARNING_LOG(m_logger) << "Could not create exercise folders";
LtsWidgets::LtsMessageDialog::showMessage(this, tr("Could not create exercise folders"));
}
else
@@ -1262,7 +1262,7 @@ int ExerciseManagementEditDialog::getExerciseFolder()
return 0;
const int folderId = m_flmDtc->getExerciseFolderId(m_exerciseId);
DEBUG_LOG() << "getExerciseFolder: folderId = " << folderId;
DEBUG_LOG(m_logger) << "getExerciseFolder: folderId = " << folderId;
return folderId;
}
@@ -78,6 +78,8 @@ public:
~ExerciseManagementEditDialog();
protected:
NGL::INGLLogger &m_logger;
void onExerciseCreateReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
void onExerciseModifyReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
void onExerciseImageModifyReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); imageModifyError(); }
@@ -90,7 +90,7 @@ bool ExerciseEditPartyDialog::init(LtsSession::LtsSessionDataDds *session)
bool ExerciseEditPartyDialog::operatorUpdateVisiblePartiesByExercise(const OperatorManagement::OperatorUpdateVisiblePartiesByExerciseRequest &req)
{
DEBUG_LOG() << Q_FUNC_INFO;
DEBUG_LOG(m_logger) << Q_FUNC_INFO;
return m_requestHelper->startSingleRequest([this, req]()
{
return m_opmFtc->operatorUpdateVisiblePartiesByExerciseRequest(req, this);
@@ -143,7 +143,7 @@ void ExerciseEditPartyDialog::setAdlerVisiblePartiesUncheckable()
bool ExerciseEditPartyDialog::apply()
{
DEBUG_LOG() << Q_FUNC_INFO;
DEBUG_LOG(m_logger) << Q_FUNC_INFO;
if (m_operatorId <= 0)
return true;
@@ -163,9 +163,9 @@ bool ExerciseEditPartyDialog::apply()
const QVector<int> hiddenPartyIds = m_visiblePartiesModel->getUncheckedIds();
for (const int visible : visiblePartyIds)
DEBUG_LOG() << "visible party: " << visible;
DEBUG_LOG(m_logger) << "visible party: " << visible;
for (const int hidden : hiddenPartyIds)
DEBUG_LOG() << "hidden party: " << hidden;
DEBUG_LOG(m_logger) << "hidden party: " << hidden;
req.hiddenParties().set({});
req.visibleParties().set({});
std::copy(hiddenPartyIds.begin(), hiddenPartyIds.end(), std::back_inserter(req.hiddenParties().get()));
@@ -173,7 +173,7 @@ bool ExerciseEditPartyDialog::apply()
req.properties(adlerVisiblePartiesToJson().toStdString());
DEBUG_LOG() << "----------------- opId: " << req.id() << ", exId:" << req.exerciseId() << ", req.hiddenParties.size:" << hiddenPartyIds.size()
DEBUG_LOG(m_logger) << "----------------- opId: " << req.id() << ", exId:" << req.exerciseId() << ", req.hiddenParties.size:" << hiddenPartyIds.size()
<< "adlerVisibleParties: " << req.properties();
return operatorUpdateVisiblePartiesByExercise(req);
@@ -206,7 +206,7 @@ void ExerciseEditPartyDialog::onSwitchCheckbox(const QModelIndex &index)
return;
}
DEBUG_LOG() << Q_FUNC_INFO << "index.row():" << index.row();
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "index.row():" << index.row();
const QPair<bool, ParticipantManagement::Party> row = m_visiblePartiesModel->getRowData(index.row());
QPair<bool, ParticipantManagement::Party> rowAdler = m_adlerVisiblePartiesModel->getRowData(index.row());
@@ -222,7 +222,7 @@ void ExerciseEditPartyDialog::onDoubleClicked(const QModelIndex &index)
return;
}
DEBUG_LOG() << Q_FUNC_INFO << "index.row():" << index.row();
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "index.row():" << index.row();
bool isChecked = m_visiblePartiesModel->getRowData(index.row()).first;
@@ -42,6 +42,8 @@ public:
void onOperatorUpdateVisiblePartiesByExerciseReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
private:
NGL::INGLLogger &m_logger;
void retranslate() override;
bool apply() override final;
QByteArray adlerVisiblePartiesToJson() const;
@@ -43,6 +43,8 @@ signals:
void sendData(const ExerciseManagement::ExercisePhase &data);
private:
NGL::INGLLogger &m_logger;
void retranslate() override;
bool apply() override final;
@@ -110,7 +110,7 @@ void ExerciseManagementOperatorEdit::sendModifiedOperators(int thisExerciseId)
std::shared_ptr<OperatorManagement::Interface::Ftc> opmFtc;
if (!m_session->getFtc<OperatorManagement::DataInterface>(opmFtc))
{
ERROR_LOG() << "Cannot change add/remove Operators to/from Exercise as the OPM-FTC could not be fetched." ;
ERROR_LOG(m_logger) << "Cannot change add/remove Operators to/from Exercise as the OPM-FTC could not be fetched." ;
return;
}
@@ -94,7 +94,7 @@ void ExerciseManagementPhaseEdit::onEditExercisePhase()
if (exPhase.id() <= 0)
return;
DEBUG_LOG() << "current exPhase Id: " << exPhase.id();
DEBUG_LOG(m_logger) << "current exPhase Id: " << exPhase.id();
ExerciseManagementPhaseEditDialog *dialog = new ExerciseManagementPhaseEditDialog(this);
@@ -30,7 +30,7 @@ bool ExercisePhaseModel::initModel(int exerciseId, const std::shared_ptr<Exercis
m_exmDtc->exercisePhases([this](const ExercisePhase &item) { insertRow(item); });
INFO_LOG() << "initModel - #exercise phases: " << m_vecData.size();
INFO_LOG(m_logger) << "initModel - #exercise phases: " << m_vecData.size();
return true;
}
@@ -36,6 +36,8 @@ public:
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override final;
protected:
NGL::INGLLogger &m_logger;
bool isFiltered(const ExercisePhase &data, DataModification modType) const override
{
if (data.exerciseId() != m_exerciseId)