Improve output, esecially to ISMAS

This commit is contained in:
Gerhard Hoffmann 2024-01-23 15:30:31 +01:00
parent 4dba36a420
commit 0a43654f9b

View File

@ -212,13 +212,16 @@ class Worker : public QThread{
QStringList lst = m_worker->m_ismasTriggerStatusMessage;
m_worker->GUI(lst) << (m_worker->CONSOLE(lst) << (m_worker->ISMAS(lst) << UPDATE_STEP::UPDATE_NOT_NECESSARY));
} else {
m_worker->ISMAS() << (m_worker->GUI() << (m_worker->CONSOLE() << UPDATE_STEP::UPDATE_SUCCEEDED));
QStringList lst(QString(m_worker->smap[UPDATE_STEP::UPDATE_SUCCEEDED]));
m_worker->ISMAS(lst) << (m_worker->GUI(lst) << (m_worker->CONSOLE(lst) << UPDATE_STEP::UPDATE_SUCCEEDED));
m_worker->setProgress(_UPDATE_SUCCEEDED);
m_worker->ISMAS() << (m_worker->GUI() << (m_worker->CONSOLE() << UPDATE_STEP::UPDATE_ACTIVATED));
lst = QStringList(QString(m_worker->smap[UPDATE_STEP::UPDATE_ACTIVATED]));
m_worker->ISMAS(lst) << (m_worker->GUI(lst) << (m_worker->CONSOLE(lst) << UPDATE_STEP::UPDATE_ACTIVATED));
m_worker->setProgress(_UPDATE_ACTIVATED);
m_worker->ISMAS() << (m_worker->GUI() << (m_worker->CONSOLE() << UPDATE_STEP::FINISHED));
lst = QStringList(QString(m_worker->smap[UPDATE_STEP::FINISHED]));
m_worker->CONSOLE(lst) << UPDATE_STEP::FINISHED;
m_worker->setProgress(_FINISHED);
}
} else {
@ -233,14 +236,16 @@ class Worker : public QThread{
}
if (m_worker->m_automaticUpdate) {
QStringList lst = (QStringList() << "AUTOMATIC UPDATE");
QStringList lst(QString(m_worker->smap[UPDATE_STEP::SEND_LAST_VERSION]));
lst << "AUTOMATIC UPDATE";
if (m_worker->m_updateNotNecessary) {
lst << "UPDATE NOT NECESSARY";
}
m_worker->ISMAS(lst) << (m_worker->GUI(lst) << (m_worker->CONSOLE(lst)
<< UPDATE_STEP::SEND_LAST_VERSION));
} else {
m_worker->ISMAS() << (m_worker->GUI() << (m_worker->CONSOLE()
QStringList lst(QString(m_worker->smap[UPDATE_STEP::SEND_LAST_VERSION]));
m_worker->ISMAS(lst) << (m_worker->GUI(lst) << (m_worker->CONSOLE(lst)
<< UPDATE_STEP::SEND_LAST_VERSION));
}
m_worker->stopProgressLoop();
@ -741,7 +746,7 @@ private:
"U0010",
_CLONE_REPOSITORY_SUCCESS,
IsmasClient::RESULT_CODE::SUCCESS,
smap[step],
smap[UPDATE_STEP::CLONE_REPOSITORY],
QString("CLONED REPOSITORY %1 AND CHECKED OUT BRANCH %2")
.arg(instance->m_customerRepository)
.arg(instance->m_gc.branchName()).toStdString().c_str(),
@ -757,7 +762,7 @@ private:
"U0003",
_CLONE_REPOSITORY_FAILURE,
IsmasClient::RESULT_CODE::INSTALL_ERROR,
smap[step],
smap[UPDATE_STEP::CHECKOUT_REPOSITORY],
QString("CLONING REPOSITORY %1 OR CHECKING OUT BRANCH %2 FAILED")
.arg(instance->m_customerRepository)
.arg(instance->m_gc.branchName()).toStdString().c_str(),
@ -802,7 +807,7 @@ private:
"U0003",
_CHECK_ISMAS_TRIGGER_FAILURE,
IsmasClient::RESULT_CODE::INSTALL_ERROR,
smap[step],
smap[UPDATE_STEP::CHECK_ISMAS_TRIGGER],
instance->m_ismasMsg.join(' ').toStdString().c_str(),
instance->m_versionInfo.size() >= 1 ? instance->m_versionInfo.at(0).toUtf8().constData() : "N/A");
ismasClient.sendRequestReceiveResponse(
@ -814,9 +819,20 @@ private:
case UPDATE_STEP::INITIAL_CLONE_WITH_ACTIVE_ISMAS_TRIGGER:
ismasClient.setProgressInPercent(_INITIAL_CLONE_WITH_ACTIVE_ISMAS_TRIGGER);
break;
case UPDATE_STEP::CHECKOUT_BRANCH:
case UPDATE_STEP::CHECKOUT_BRANCH: {
ismasClient.setProgressInPercent(_CHECKOUT_BRANCH);
break;
QString const &ismasUpdateNews =
QString("#M=APISM#C=CMD_EVENT#J=") +
ismasClient.updateNewsToIsmas(
"U0010",
_CHECKOUT_BRANCH_SUCCESS,
IsmasClient::RESULT_CODE::SUCCESS,
smap[UPDATE_STEP::CHECKOUT_BRANCH],
instance->m_ismasMsg.join(' ').toStdString().c_str(),
instance->m_versionInfo.size() >= 1 ? instance->m_versionInfo.at(0).toUtf8().constData() : "N/A");
ismasClient.sendRequestReceiveResponse(
IsmasClient::APISM::DB_PORT, ismasUpdateNews);
} break;
case UPDATE_STEP::CHECKOUT_BRANCH_SUCCESS: {
ismasClient.setProgressInPercent(_CHECKOUT_BRANCH_SUCCESS);
QString const &ismasUpdateNews =
@ -825,7 +841,7 @@ private:
"U0010",
_CHECKOUT_BRANCH_SUCCESS,
IsmasClient::RESULT_CODE::SUCCESS,
smap[step],
smap[UPDATE_STEP::CHECKOUT_BRANCH],
instance->m_ismasMsg.join(' ').toStdString().c_str(),
instance->m_versionInfo.size() >= 1 ? instance->m_versionInfo.at(0).toUtf8().constData() : "N/A");
ismasClient.sendRequestReceiveResponse(
@ -839,7 +855,7 @@ private:
"U0003",
_CHECKOUT_BRANCH_FAILURE,
IsmasClient::RESULT_CODE::INSTALL_ERROR,
smap[step],
smap[UPDATE_STEP::CHECKOUT_BRANCH],
instance->m_ismasMsg.join(' ').toStdString().c_str(),
instance->m_versionInfo.size() >= 1 ? instance->m_versionInfo.at(0).toUtf8().constData() : "N/A");
ismasClient.sendRequestReceiveResponse(
@ -981,6 +997,17 @@ private:
} break;
case UPDATE_STEP::EXEC_OPKG_COMMAND_SUCCESS: {
ismasClient.setProgressInPercent(_EXEC_OPKG_COMMAND_SUCCESS);
QString const &ismasUpdateNews =
QString("#M=APISM#C=CMD_EVENT#J=") +
ismasClient.updateNewsToIsmas(
_ISMAS_CONTINUE,
ismasClient.getProgressInPercent(),
IsmasClient::RESULT_CODE::SUCCESS,
smap[UPDATE_STEP::EXEC_OPKG_COMMANDS],
instance->m_ismasMsg.join(' ').toStdString().c_str(),
instance->m_versionInfo.size() >= 1 ? instance->m_versionInfo.at(0).toUtf8().constData() : "N/A");
ismasClient.sendRequestReceiveResponse(
IsmasClient::APISM::DB_PORT, ismasUpdateNews);
} break;
case UPDATE_STEP::EXEC_OPKG_COMMAND_FAILURE: {
ismasClient.setProgressInPercent(_EXEC_OPKG_COMMAND_FAILURE);
@ -1016,7 +1043,7 @@ private:
_ISMAS_CONTINUE,
ismasClient.getProgressInPercent(),
IsmasClient::RESULT_CODE::SUCCESS,
smap[step],
smap[UPDATE_STEP::DOWNLOAD_DEVICE_CONTROLLER],
instance->m_ismasMsg.join(' ').toStdString().c_str(),
instance->m_versionInfo.size() >= 1 ? instance->m_versionInfo.at(0).toUtf8().constData() : "N/A");
ismasClient.sendRequestReceiveResponse(
@ -1033,7 +1060,7 @@ private:
_ISMAS_CONTINUE,
ismasClient.getProgressInPercent(),
IsmasClient::RESULT_CODE::SUCCESS,
smap[step],
smap[UPDATE_STEP::DOWNLOAD_FILES_TO_PSA_HARDWARE],
instance->m_ismasMsg.join(' ').toStdString().c_str(),
instance->m_versionInfo.size() >= 1 ? instance->m_versionInfo.at(0).toUtf8().constData() : "N/A");
ismasClient.sendRequestReceiveResponse(
@ -1053,7 +1080,7 @@ private:
_ISMAS_CONTINUE,
ismasClient.getProgressInPercent(),
IsmasClient::RESULT_CODE::SUCCESS,
smap[step],
smap[UPDATE_STEP::SYNC_CUSTOMER_REPOSITORY],
instance->m_ismasMsg.join(' ').toStdString().c_str(),
instance->m_versionInfo.size() >= 1 ? instance->m_versionInfo.at(0).toUtf8().constData() : "N/A");
ismasClient.sendRequestReceiveResponse(