Check if update-process was really necessary, i.e. NOT activated

by an automatic nightly update.
This commit is contained in:
Gerhard Hoffmann 2024-01-19 08:22:03 +01:00
parent 1ecb844b64
commit 0aa8d9ba5a

View File

@ -82,28 +82,31 @@
#define _DOWNLOAD_CONFIG_FILE_SUCCESS (56)
#define _DOWNLOAD_CONFIG_FILE_FAILURE (57)
#define _DOWNLOAD_DEVICE_CONTROLLER (65)
#define _DOWNLOAD_DEVICE_CONTROLLER_SUCCESS (86)
#define _DOWNLOAD_DEVICE_CONTROLLER_FAILURE (87)
#define _DOWNLOAD_FILES_TO_PSA_HARDWARE_FAILURE (88)
#define _DOWNLOAD_FILES_TO_PSA_HARDWARE_SUCCESS (89)
#define _SYNC_CUSTOMER_REPOSITORY (90)
#define _SYNC_CUSTOMER_REPOSITORY_FAILURE (91)
#define _SYNC_CUSTOMER_REPOSITORY_SUCCESS (92)
#define _SAVE_LOGS (93)
#define _SAVE_LOGS_FAILURE (94)
#define _SAVE_LOGS_SUCCESS (95)
#define _SEND_LAST_VERSION (96)
#define _UPDATE_SUCCEEDED (97)
#define _UPDATE_FAILED (98)
#define _UPDATE_ACTIVATED (99)
#define _DOWNLOAD_DEVICE_CONTROLLER_SUCCESS (85)
#define _DOWNLOAD_DEVICE_CONTROLLER_FAILURE (86)
#define _DOWNLOAD_FILES_TO_PSA_HARDWARE_FAILURE (87)
#define _DOWNLOAD_FILES_TO_PSA_HARDWARE_SUCCESS (88)
#define _SYNC_CUSTOMER_REPOSITORY (89)
#define _SYNC_CUSTOMER_REPOSITORY_FAILURE (90)
#define _SYNC_CUSTOMER_REPOSITORY_SUCCESS (91)
#define _SAVE_LOGS (92)
#define _SAVE_LOGS_FAILURE (93)
#define _SAVE_LOGS_SUCCESS (94)
#define _SEND_LAST_VERSION (95)
#define _UPDATE_SUCCEEDED (96)
#define _UPDATE_FAILED (97)
#define _UPDATE_ACTIVATED (98)
#define _UPDATE_NOT_NECESSARY (99)
#define _FINISHED (100)
#define _DEBUG (1000)
#define _ERROR (1001)
#define _NONE (1002)
#define _SEND_LAST_VERSION_CORRECTION (4)
#define _UPDATE_SUCCEEDED_CORRECTION (3)
#define _UPDATE_FAILED_CORRECTION (2)
#define _UPDATE_ACTIVATED_CORRECTION (1)
#define _SEND_LAST_VERSION_CORRECTION (5)
#define _UPDATE_SUCCEEDED_CORRECTION (4)
#define _UPDATE_FAILED_CORRECTION (3)
#define _UPDATE_ACTIVATED_CORRECTION (2)
#define _UPDATE_NOT_NECESSARY_CORRECTION (1)
#define ISMAS_UPDATE_REQUESTS (10)
#define CHECK_UPDATE_TRIGGER_SET "Check update trigger ..."
@ -276,10 +279,12 @@ public:
SEND_LAST_VERSION = _SEND_LAST_VERSION,
UPDATE_SUCCEEDED = _UPDATE_SUCCEEDED,
UPDATE_ACTIVATED = _UPDATE_ACTIVATED,
UPDATE_NOT_NECESSARY = _UPDATE_NOT_NECESSARY,
UPDATE_FAILED = _UPDATE_FAILED,
FINISHED = _FINISHED,
DEBUG = _DEBUG,
ERROR = _ERROR
ERROR = _ERROR,
NONE = _NONE
};
private:
@ -410,6 +415,8 @@ private:
QStringList lst = QStringList(smap[step]);
switch (step) {
case UPDATE_STEP::NONE: {
} break;
case UPDATE_STEP::STARTED: {
Utils::printUpdateStatusMsg(
debug,
@ -617,6 +624,10 @@ private:
lst << instance->m_debugMsg;
Utils::printUpdateStatusMsg(debug, lst);
break;
case UPDATE_STEP::UPDATE_NOT_NECESSARY:
lst << instance->m_debugMsg;
Utils::printUpdateStatusMsg(debug, lst);
break;
case UPDATE_STEP::UPDATE_FAILED:
break;
case UPDATE_STEP::FINISHED:
@ -650,6 +661,8 @@ private:
QStringList lst = QStringList(smap[step]);
switch (step) {
case UPDATE_STEP::NONE: {
} break;
case UPDATE_STEP::STARTED: {
ismasClient.setProgressInPercent(_STARTED);
} break;
@ -1063,6 +1076,20 @@ private:
ismasClient.sendRequestReceiveResponse(
IsmasClient::APISM::DB_PORT, ismasUpdateNews);
} break;
case UPDATE_STEP::UPDATE_NOT_NECESSARY: {
ismasClient.setProgressInPercent(_UPDATE_NOT_NECESSARY + _UPDATE_NOT_NECESSARY_CORRECTION);
QString const &ismasUpdateNews =
QString("#M=APISM#C=CMD_EVENT#J=") +
ismasClient.updateNewsToIsmas(
"U0002", // reset WAIT-button to "" (empty string)
ismasClient.getProgressInPercent(),
IsmasClient::RESULT_CODE::SUCCESS,
smap[step],
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::UPDATE_FAILED: {
ismasClient.setProgressInPercent(_UPDATE_FAILED);
QString const &ismasUpdateNews =
@ -1100,6 +1127,8 @@ private:
Worker::instance->m_currentStep = step;
switch (step) {
case UPDATE_STEP::NONE: {
} break;
case UPDATE_STEP::STARTED:
break;
case UPDATE_STEP::CHECK_REPOSITORY:
@ -1274,6 +1303,8 @@ private:
break;
case UPDATE_STEP::UPDATE_ACTIVATED:
break;
case UPDATE_STEP::UPDATE_NOT_NECESSARY:
break;
case UPDATE_STEP::UPDATE_FAILED:
emit worker->appendText(QString("UPDATE "), UPDATE_STEP_FAIL);
break;