to be continued on monday

This commit is contained in:
Gerhard Hoffmann 2023-10-22 19:44:45 +02:00
parent 81c5f8ee7e
commit 9b0f741b9b
4 changed files with 325 additions and 74 deletions

View File

@ -46,10 +46,12 @@ QString Utils::zoneName(quint8 i) {
return "N/A";
}
void Utils::printCriticalErrorMsg(QString const &errorMsg) {
qCritical() << QString(80, 'E');
void Utils::printCriticalErrorMsg(QString const &errorMsg, bool upper, bool lower) {
if (upper) qCritical() << QString(80, 'E');
qCritical() << errorMsg;
qCritical() << QString(80, 'E');
if (lower) qCritical() << QString(80, 'E');
}
void Utils::printCriticalErrorMsg(QStringList const &errorMsg) {
@ -60,6 +62,14 @@ void Utils::printCriticalErrorMsg(QStringList const &errorMsg) {
qCritical() << QString(80, 'E');
}
void Utils::printUpdateStatusMsg(QDebug &debug, QStringList const &updateMsg) {
debug << QString(80, 'U');
for (int i = 0; i < updateMsg.size(); ++i) {
debug << updateMsg.at(i);
}
debug << QString(80, 'U');
}
void Utils::printUpdateStatusMsg(QStringList const &updateMsg) {
qCritical() << QString(80, 'U');
for (int i = 0; i < updateMsg.size(); ++i) {
@ -68,16 +78,20 @@ void Utils::printUpdateStatusMsg(QStringList const &updateMsg) {
qCritical() << QString(80, 'U');
}
void Utils::printUpdateStatusMsg(QString const &updateMsg) {
qCritical() << QString(80, 'U');
void Utils::printUpdateStatusMsg(QString const &updateMsg, bool upper, bool lower) {
if (upper) qCritical() << QString(80, 'U');
qCritical() << updateMsg;
qCritical() << QString(80, 'U');
if (lower) qCritical() << QString(80, 'U');
}
void Utils::printInfoMsg(QString const &infoMsg) {
qCritical() << QString(80, 'I');
void Utils::printInfoMsg(QString const &infoMsg, bool upper, bool lower) {
if (upper) qCritical() << QString(80, 'I');
qCritical() << infoMsg;
qCritical() << QString(80, 'I');
if (lower) qCritical() << QString(80, 'I');
}
void Utils::printInfoMsg(QStringList const &infoMsg) {

View File

@ -8,16 +8,18 @@
#include <QFileInfo>
#include <QDateTime>
#include <QDir>
#include <QDebug>
namespace Utils {
int read1stLineOfFile(QString fileName);
QString zoneName(quint8 i);
void printCriticalErrorMsg(QString const &errorMsg);
void printCriticalErrorMsg(QString const &errorMsg, bool upper=false, bool lower=false);
void printCriticalErrorMsg(QStringList const &errorMsg);
void printInfoMsg(QString const &infoMsg);
void printInfoMsg(QString const &infoMsg, bool upper=false, bool lower=false);
void printInfoMsg(QStringList const &infoMsg);
void printUpdateStatusMsg(QDebug &debug, QStringList const &updateMsg);
void printUpdateStatusMsg(QStringList const &updateMsg);
void printUpdateStatusMsg(QString const &updateMsg);
void printUpdateStatusMsg(QString const &updateMsg, bool upper=false, bool lower=false);
void printLineEditInfo(QStringList const &lines);
QString getTariffLoadTime(QString fileName);
QString rstrip(QString const &str);

View File

@ -24,6 +24,11 @@
#include "mainwindow.h"
#include "utils.h"
#define CONSOLE() qDebug()
#define ISMAS() m_ismasClient
#define GUI() m_mainWindow
QString const Worker::UPDATE_STEP_OK(" [ ok]");
QString const Worker::UPDATE_STEP_DONE(" [done]");
QString const Worker::UPDATE_STEP_FAIL(" [FAIL]");
@ -86,23 +91,6 @@ Worker::Worker(int customerNr,
m_apismVersion = v.value();
}
Utils::printInfoMsg("STARTING PTU-UPDATE");
qInfo() << "CURRENT TIME ..............." << QDateTime::currentDateTime().toString(Qt::ISODate);
qInfo() << "OS VERSION ................." << m_osVersion;
qInfo() << "ATBQT VERSION .............." << m_atbqtVersion;
qInfo() << "CPU SERIAL ................." << m_cpuSerial;
qInfo() << "CUSTOMER_NR ................" << m_customerNr;
qInfo() << "CUSTOMER_NR_STR ............" << m_customerNrStr;
qInfo() << "CUSTOMER_REPOSITORY_PATH ..." << m_customerRepositoryPath;
qInfo() << "CUSTOMER_REPOSITORY ........" << m_customerRepository;
qInfo() << "MACHINE_NR ................." << m_machineNr;
qInfo() << "ZONE_NR ...................." << m_zoneNr;
qInfo() << "BRANCH_NAME ................" << m_branchName;
qInfo() << "PLUGIN_NAME ................" << m_pluginName;
qInfo() << "WORKING_DIRECTORY .........." << m_workingDirectory;
qInfo() << "APISM VERSION .............." << m_apismVersion;
qInfo() << "ATB UPDATE TOOL VERSION ...." << m_atbUpdateToolVersion;
this->moveToThread(&m_workerThread);
m_workerThread.start();
@ -400,6 +388,8 @@ void Worker::privateUpdate() {
return;
}
GUI() << (ISMAS() << (CONSOLE() << UPDATE_STEP::STARTED));
m_updateProcessRunning = true;
bool sentIsmasLastVersionNotification = false;
@ -438,7 +428,7 @@ void Worker::privateUpdate() {
}
if (continueUpdate) {
// qDebug() << UPDATE_STEP::SANITY_CHECK;
CONSOLE() << UPDATE_STEP::CHECK_SANITY;
if ((continueUpdate = customerRepository.exists()) == false) {
emit appendText("\nInitializing customer environment ...");
startProgressLoop();

333
worker.h
View File

@ -26,6 +26,45 @@
#define SERIAL_PORT "ttyUSB0"
#endif
#define _STARTED (1)
#define _CHECK_REPOSITORY (2)
#define _CHECK_SANITY (3)
#define _CHECK_SANITY_SUCCESS (4)
#define _CHECK_SANITY_FAILURE (5)
#define _CLONE_REPOSITORY (6)
#define _CLONE_REPOSITORY_SUCCESS (7)
#define _CLONE_REPOSITORY_FAILURE (8)
#define _SWITCH_BRANCH (12)
#define _SWITCH_BRANCH_SUCCESS (13)
#define _SWITCH_BRANCH_FAILURE (14)
#define _CHECK_ISMAS_TRIGGER (15)
#define _CHECK_ISMAS_TRIGGER_SUCCESS (23)
#define _CHECK_ISMAS_TRIGGER_FAILURE (24)
#define _UPDATE_REPOSITORY (25)
#define _UPDATE_REPOSITORY_SUCCESS (28)
#define _UPDATE_REPOSITORY_FAILURE (29)
#define _CHECK_FOR_REPOSITORY_CHANGES (30)
#define _CHECK_FOR_REPOSITORY_CHANGES_SUCCESS (38)
#define _CHECK_FOR_REPOSITORY_CHANGES_FAILURE (39)
#define _APPLY_REPOSITORY_CHANGES (40)
#define _DOWNLOAD_CONFIG_FILE (41)
#define _DOWNLOAD_CONFIG_FILE_SUCCESS (63)
#define _DOWNLOAD_CONFIG_FILE_FAILURE (64)
#define _DOWNLOAD_DEVICE_CONTROLLER (65)
#define _DOWNLOAD_DEVICE_CONTROLLER_SUCCESS (86)
#define _DOWNLOAD_DEVICE_CONTROLLER_FAILURE (87)
#define _APPLY_REPOSITORY_CHANGES_SUCCESS (88)
#define _APPLY_REPOSITORY_CHANGES_FAILURE (89)
#define _SYNC_CUSTOMER_REPOSITORY (90)
#define _SYNC_CUSTOMER_REPOSITORY_SUCCESS (91)
#define _SYNC_CUSTOMER_REPOSITORY_FAILURE (92)
#define _SAVE_LOGS (94)
#define _SAVE_LOGS_SUCCESS (95)
#define _SAVE_LOGS_FAILURE (96)
#define _SEND_LAST_VERSION (97)
#define _UPDATE_SUCCEEDED (98)
#define _UPDATE_FAILED (99)
#define _FINISHED (100)
enum class UPDATE_STATUS : quint8 {
NOT_DEFINED,
@ -159,45 +198,45 @@ class Worker : public QObject {
static constexpr const int SAVE_LOG_FILES_FAILURE = -11;
enum class UPDATE_STEP {
STARTED = 1,
CHECK_REPOSITORY = 2,
CHECK_SANITY = 3,
CHECK_SANITY_SUCCESS = 4,
CHECK_SANITY_FAILURE = 5,
CLONE_REPOSITORY = 6,
CLONE_REPOSITORY_SUCCESS = 7,
CLONE_REPOSITORY_FAILURE = 8,
SWITCH_BRANCH = 12,
SWITCH_BRANCH_SUCCESS = 13,
SWITCH_BRANCH_FAILURE = 14,
CHECK_ISMAS_TRIGGER = 15,
CHECK_ISMAS_TRIGGER_SUCCESS = 23,
CHECK_ISMAS_TRIGGER_FAILURE = 24,
UPDATE_REPOSITORY = 25,
UPDATE_REPOSITORY_SUCCESS = 28,
UPDATE_REPOSITORY_FAILURE = 29,
CHECK_FOR_REPOSITORY_CHANGES = 30,
CHECK_FOR_REPOSITORY_CHANGES_SUCCESS = 38,
CHECK_FOR_REPOSITORY_CHANGES_FAILURE = 39,
APPLY_REPOSITORY_CHANGES = 40,
DOWNLOAD_CONFIG_FILE = 41,
DOWNLOAD_CONFIG_FILE_SUCCESS = 63,
DOWNLOAD_CONFIG_FILE_FAILURE = 64,
DOWNLOAD_DEVICE_CONTROLLER = 65,
DOWNLOAD_DEVICE_CONTROLLER_SUCCESS = 86,
DOWNLOAD_DEVICE_CONTROLLER_FAILURE = 87,
APPLY_REPOSITORY_CHANGES_SUCCESS = 88,
APPLY_REPOSITORY_CHANGES_FAILURE = 89,
SYNC_CUSTOMER_REPOSITORY = 90,
SYNC_CUSTOMER_REPOSITORY_SUCCESS = 91,
SYNC_CUSTOMER_REPOSITORY_FAILURE = 92,
SAVE_LOGS = 94,
SAVE_LOGS_SUCCESS = 95,
SAVE_LOGS_FAILURE = 96,
SEND_LAST_VERSION = 97,
UPDATE_SUCCEEDED = 98,
UPDATE_FAILED = 99,
FINISHED = 100
STARTED = _STARTED,
CHECK_REPOSITORY = _CHECK_REPOSITORY,
CHECK_SANITY = _CHECK_SANITY,
CHECK_SANITY_SUCCESS = _CHECK_SANITY_SUCCESS,
CHECK_SANITY_FAILURE = _CHECK_SANITY_FAILURE,
CLONE_REPOSITORY = _CLONE_REPOSITORY,
CLONE_REPOSITORY_SUCCESS = _CLONE_REPOSITORY_SUCCESS,
CLONE_REPOSITORY_FAILURE = _CLONE_REPOSITORY_FAILURE,
SWITCH_BRANCH = _SWITCH_BRANCH,
SWITCH_BRANCH_SUCCESS = _SWITCH_BRANCH_SUCCESS,
SWITCH_BRANCH_FAILURE = _SWITCH_BRANCH_FAILURE,
CHECK_ISMAS_TRIGGER = _CHECK_ISMAS_TRIGGER,
CHECK_ISMAS_TRIGGER_SUCCESS = _CHECK_ISMAS_TRIGGER_SUCCESS,
CHECK_ISMAS_TRIGGER_FAILURE = _CHECK_ISMAS_TRIGGER_FAILURE,
UPDATE_REPOSITORY = _UPDATE_REPOSITORY,
UPDATE_REPOSITORY_SUCCESS = _UPDATE_REPOSITORY_SUCCESS,
UPDATE_REPOSITORY_FAILURE = _UPDATE_REPOSITORY_FAILURE,
CHECK_FOR_REPOSITORY_CHANGES = _CHECK_FOR_REPOSITORY_CHANGES,
CHECK_FOR_REPOSITORY_CHANGES_SUCCESS = _CHECK_FOR_REPOSITORY_CHANGES_SUCCESS,
CHECK_FOR_REPOSITORY_CHANGES_FAILURE = _CHECK_FOR_REPOSITORY_CHANGES_FAILURE,
APPLY_REPOSITORY_CHANGES = _APPLY_REPOSITORY_CHANGES,
DOWNLOAD_CONFIG_FILE = _DOWNLOAD_CONFIG_FILE,
DOWNLOAD_CONFIG_FILE_SUCCESS = _DOWNLOAD_CONFIG_FILE_SUCCESS,
DOWNLOAD_CONFIG_FILE_FAILURE = _DOWNLOAD_CONFIG_FILE_FAILURE,
DOWNLOAD_DEVICE_CONTROLLER = _DOWNLOAD_DEVICE_CONTROLLER,
DOWNLOAD_DEVICE_CONTROLLER_SUCCESS = _DOWNLOAD_DEVICE_CONTROLLER_SUCCESS,
DOWNLOAD_DEVICE_CONTROLLER_FAILURE = _DOWNLOAD_DEVICE_CONTROLLER_FAILURE,
APPLY_REPOSITORY_CHANGES_SUCCESS = _APPLY_REPOSITORY_CHANGES_SUCCESS,
APPLY_REPOSITORY_CHANGES_FAILURE = _APPLY_REPOSITORY_CHANGES_FAILURE,
SYNC_CUSTOMER_REPOSITORY = _SYNC_CUSTOMER_REPOSITORY,
SYNC_CUSTOMER_REPOSITORY_SUCCESS = _SYNC_CUSTOMER_REPOSITORY_SUCCESS,
SYNC_CUSTOMER_REPOSITORY_FAILURE = _SYNC_CUSTOMER_REPOSITORY_FAILURE,
SAVE_LOGS = _SAVE_LOGS,
SAVE_LOGS_SUCCESS = _SAVE_LOGS_SUCCESS,
SAVE_LOGS_FAILURE = _SAVE_LOGS_FAILURE,
SEND_LAST_VERSION = _SEND_LAST_VERSION,
UPDATE_SUCCEEDED = _UPDATE_SUCCEEDED,
UPDATE_FAILED = _UPDATE_FAILED,
FINISHED = _FINISHED
};
static Worker const *instance;
@ -275,9 +314,11 @@ private:
std::optional<QString> getApismVersion();
void printProgress(UPDATE_STEP step);
friend QDebug operator<<(QDebug debug, UPDATE_STEP step) {
static const QMap<UPDATE_STEP, const char*> smap;
friend UPDATE_STEP operator<<(QDebug debug, UPDATE_STEP step) {
if (!Worker::instance) {
return debug;
return step;
}
static const QMap<UPDATE_STEP, const char*> smap (
@ -326,8 +367,26 @@ private:
});
switch (step) {
case UPDATE_STEP::STARTED:
break;
case UPDATE_STEP::STARTED: {
Utils::printUpdateStatusMsg(
debug,
QStringList(smap[step])
<< QString("CURRENT TIME ...............%1").arg(QDateTime::currentDateTime().toString(Qt::ISODate))
<< QString("OS VERSION .................%1").arg(instance->m_osVersion)
<< QString("ATBQT VERSION ..............%1").arg(instance->m_atbqtVersion)
<< QString("CPU SERIAL .................%1").arg(instance->m_cpuSerial)
<< QString("CUSTOMER_NR ................%1").arg(instance->m_customerNr)
<< QString("CUSTOMER_NR_STR ............%1").arg(instance->m_customerNrStr)
<< QString("CUSTOMER_REPOSITORY_PATH ...%1").arg(instance->m_customerRepositoryPath)
<< QString("CUSTOMER_REPOSITORY ........%1").arg(instance->m_customerRepository)
<< QString("MACHINE_NR .................%1").arg(instance->m_machineNr)
<< QString("ZONE_NR ....................%1").arg(instance->m_zoneNr)
<< QString("BRANCH_NAME ................%1").arg(instance->m_branchName)
<< QString("PLUGIN_NAME ................%1").arg(instance->m_pluginName)
<< QString("WORKING_DIRECTORY ..........%1").arg(instance->m_workingDirectory)
<< QString("APISM VERSION ..............%1").arg(instance->m_apismVersion)
<< QString("ATB UPDATE TOOL VERSION ....%1").arg(instance->m_atbUpdateToolVersion));
} break;
case UPDATE_STEP::CHECK_REPOSITORY:
break;
case UPDATE_STEP::CHECK_SANITY:
@ -405,6 +464,185 @@ private:
case UPDATE_STEP::FINISHED:
break;
}
return step;
}
friend UPDATE_STEP operator<<(IsmasClient &ismasClient, UPDATE_STEP step) {
if (!Worker::instance) {
return step;
}
static const QMap<UPDATE_STEP, const char*> smap (
std::initializer_list<std::pair<UPDATE_STEP, const char*>>{
#define INSERT_ELEMENT(p) std::pair(p, #p)
INSERT_ELEMENT(UPDATE_STEP::STARTED),
INSERT_ELEMENT(UPDATE_STEP::CHECK_REPOSITORY),
INSERT_ELEMENT(UPDATE_STEP::CHECK_SANITY),
INSERT_ELEMENT(UPDATE_STEP::CHECK_SANITY_SUCCESS),
INSERT_ELEMENT(UPDATE_STEP::CHECK_SANITY_FAILURE),
INSERT_ELEMENT(UPDATE_STEP::CLONE_REPOSITORY),
INSERT_ELEMENT(UPDATE_STEP::CLONE_REPOSITORY_SUCCESS),
INSERT_ELEMENT(UPDATE_STEP::CLONE_REPOSITORY_FAILURE),
INSERT_ELEMENT(UPDATE_STEP::SWITCH_BRANCH),
INSERT_ELEMENT(UPDATE_STEP::SWITCH_BRANCH_SUCCESS),
INSERT_ELEMENT(UPDATE_STEP::SWITCH_BRANCH_FAILURE),
INSERT_ELEMENT(UPDATE_STEP::CHECK_ISMAS_TRIGGER),
INSERT_ELEMENT(UPDATE_STEP::CHECK_ISMAS_TRIGGER_SUCCESS),
INSERT_ELEMENT(UPDATE_STEP::CHECK_ISMAS_TRIGGER_FAILURE),
INSERT_ELEMENT(UPDATE_STEP::UPDATE_REPOSITORY),
INSERT_ELEMENT(UPDATE_STEP::UPDATE_REPOSITORY_SUCCESS),
INSERT_ELEMENT(UPDATE_STEP::UPDATE_REPOSITORY_FAILURE),
INSERT_ELEMENT(UPDATE_STEP::CHECK_FOR_REPOSITORY_CHANGES),
INSERT_ELEMENT(UPDATE_STEP::CHECK_FOR_REPOSITORY_CHANGES_SUCCESS),
INSERT_ELEMENT(UPDATE_STEP::CHECK_FOR_REPOSITORY_CHANGES_FAILURE),
INSERT_ELEMENT(UPDATE_STEP::APPLY_REPOSITORY_CHANGES),
INSERT_ELEMENT(UPDATE_STEP::DOWNLOAD_CONFIG_FILE),
INSERT_ELEMENT(UPDATE_STEP::DOWNLOAD_CONFIG_FILE_SUCCESS),
INSERT_ELEMENT(UPDATE_STEP::DOWNLOAD_CONFIG_FILE_FAILURE),
INSERT_ELEMENT(UPDATE_STEP::DOWNLOAD_DEVICE_CONTROLLER),
INSERT_ELEMENT(UPDATE_STEP::DOWNLOAD_DEVICE_CONTROLLER_SUCCESS),
INSERT_ELEMENT(UPDATE_STEP::DOWNLOAD_DEVICE_CONTROLLER_FAILURE),
INSERT_ELEMENT(UPDATE_STEP::APPLY_REPOSITORY_CHANGES_SUCCESS),
INSERT_ELEMENT(UPDATE_STEP::APPLY_REPOSITORY_CHANGES_FAILURE),
INSERT_ELEMENT(UPDATE_STEP::SYNC_CUSTOMER_REPOSITORY),
INSERT_ELEMENT(UPDATE_STEP::SYNC_CUSTOMER_REPOSITORY_SUCCESS),
INSERT_ELEMENT(UPDATE_STEP::SYNC_CUSTOMER_REPOSITORY_FAILURE),
INSERT_ELEMENT(UPDATE_STEP::SAVE_LOGS),
INSERT_ELEMENT(UPDATE_STEP::SAVE_LOGS_SUCCESS),
INSERT_ELEMENT(UPDATE_STEP::SAVE_LOGS_FAILURE),
INSERT_ELEMENT(UPDATE_STEP::SEND_LAST_VERSION),
INSERT_ELEMENT(UPDATE_STEP::UPDATE_SUCCEEDED),
INSERT_ELEMENT(UPDATE_STEP::UPDATE_FAILED),
INSERT_ELEMENT(UPDATE_STEP::FINISHED)
#undef INSERT_ELEMENT
});
switch (step) {
case UPDATE_STEP::STARTED: {
ismasClient.setProgressInPercent(_STARTED);
} break;
case UPDATE_STEP::CHECK_REPOSITORY:
ismasClient.setProgressInPercent(_CHECK_REPOSITORY);
break;
case UPDATE_STEP::CHECK_SANITY:
ismasClient.setProgressInPercent(_CHECK_SANITY);
break;
case UPDATE_STEP::CHECK_SANITY_SUCCESS:
ismasClient.setProgressInPercent(_CHECK_SANITY_SUCCESS);
break;
case UPDATE_STEP::CHECK_SANITY_FAILURE:
ismasClient.setProgressInPercent(_CHECK_SANITY_FAILURE);
break;
case UPDATE_STEP::CLONE_REPOSITORY:
ismasClient.setProgressInPercent(_CLONE_REPOSITORY);
break;
case UPDATE_STEP::CLONE_REPOSITORY_SUCCESS:
ismasClient.setProgressInPercent(_CLONE_REPOSITORY_SUCCESS);
break;
case UPDATE_STEP::CLONE_REPOSITORY_FAILURE:
ismasClient.setProgressInPercent(_CLONE_REPOSITORY_FAILURE);
break;
case UPDATE_STEP::SWITCH_BRANCH:
ismasClient.setProgressInPercent(_SWITCH_BRANCH);
break;
case UPDATE_STEP::SWITCH_BRANCH_SUCCESS:
ismasClient.setProgressInPercent(_SWITCH_BRANCH_SUCCESS);
break;
case UPDATE_STEP::SWITCH_BRANCH_FAILURE:
ismasClient.setProgressInPercent(_SWITCH_BRANCH_FAILURE);
break;
case UPDATE_STEP::CHECK_ISMAS_TRIGGER:
ismasClient.setProgressInPercent(_CHECK_ISMAS_TRIGGER);
break;
case UPDATE_STEP::CHECK_ISMAS_TRIGGER_SUCCESS:
ismasClient.setProgressInPercent(_CHECK_ISMAS_TRIGGER_SUCCESS);
break;
case UPDATE_STEP::CHECK_ISMAS_TRIGGER_FAILURE:
ismasClient.setProgressInPercent(_CHECK_ISMAS_TRIGGER_FAILURE);
break;
case UPDATE_STEP::UPDATE_REPOSITORY:
ismasClient.setProgressInPercent(_UPDATE_REPOSITORY);
break;
case UPDATE_STEP::UPDATE_REPOSITORY_SUCCESS:
ismasClient.setProgressInPercent(_UPDATE_REPOSITORY_SUCCESS);
break;
case UPDATE_STEP::UPDATE_REPOSITORY_FAILURE:
ismasClient.setProgressInPercent(_UPDATE_REPOSITORY_FAILURE);
break;
case UPDATE_STEP::CHECK_FOR_REPOSITORY_CHANGES:
ismasClient.setProgressInPercent(_CHECK_FOR_REPOSITORY_CHANGES);
break;
case UPDATE_STEP::CHECK_FOR_REPOSITORY_CHANGES_SUCCESS:
ismasClient.setProgressInPercent(_CHECK_FOR_REPOSITORY_CHANGES_SUCCESS);
break;
case UPDATE_STEP::CHECK_FOR_REPOSITORY_CHANGES_FAILURE:
ismasClient.setProgressInPercent(_CHECK_FOR_REPOSITORY_CHANGES_FAILURE);
break;
case UPDATE_STEP::APPLY_REPOSITORY_CHANGES:
ismasClient.setProgressInPercent(_APPLY_REPOSITORY_CHANGES);
break;
case UPDATE_STEP::DOWNLOAD_CONFIG_FILE:
ismasClient.setProgressInPercent(_DOWNLOAD_CONFIG_FILE);
break;
case UPDATE_STEP::DOWNLOAD_CONFIG_FILE_SUCCESS:
ismasClient.setProgressInPercent(_DOWNLOAD_CONFIG_FILE_SUCCESS);
break;
case UPDATE_STEP::DOWNLOAD_CONFIG_FILE_FAILURE:
ismasClient.setProgressInPercent(_DOWNLOAD_CONFIG_FILE_FAILURE);
break;
case UPDATE_STEP::DOWNLOAD_DEVICE_CONTROLLER:
ismasClient.setProgressInPercent(_DOWNLOAD_DEVICE_CONTROLLER);
break;
case UPDATE_STEP::DOWNLOAD_DEVICE_CONTROLLER_SUCCESS:
ismasClient.setProgressInPercent(_DOWNLOAD_DEVICE_CONTROLLER_SUCCESS);
break;
case UPDATE_STEP::DOWNLOAD_DEVICE_CONTROLLER_FAILURE:
ismasClient.setProgressInPercent(_DOWNLOAD_DEVICE_CONTROLLER_FAILURE);
break;
case UPDATE_STEP::APPLY_REPOSITORY_CHANGES_SUCCESS:
ismasClient.setProgressInPercent(_APPLY_REPOSITORY_CHANGES_SUCCESS);
break;
case UPDATE_STEP::APPLY_REPOSITORY_CHANGES_FAILURE:
ismasClient.setProgressInPercent(_APPLY_REPOSITORY_CHANGES_FAILURE);
break;
case UPDATE_STEP::SYNC_CUSTOMER_REPOSITORY:
ismasClient.setProgressInPercent(_SYNC_CUSTOMER_REPOSITORY);
break;
case UPDATE_STEP::SYNC_CUSTOMER_REPOSITORY_SUCCESS:
ismasClient.setProgressInPercent(_SYNC_CUSTOMER_REPOSITORY_SUCCESS);
break;
case UPDATE_STEP::SYNC_CUSTOMER_REPOSITORY_FAILURE:
ismasClient.setProgressInPercent(_SYNC_CUSTOMER_REPOSITORY_FAILURE);
break;
case UPDATE_STEP::SAVE_LOGS:
ismasClient.setProgressInPercent(_SAVE_LOGS);
break;
case UPDATE_STEP::SAVE_LOGS_SUCCESS:
ismasClient.setProgressInPercent(_SAVE_LOGS_SUCCESS);
break;
case UPDATE_STEP::SAVE_LOGS_FAILURE:
ismasClient.setProgressInPercent(_SAVE_LOGS_FAILURE);
break;
case UPDATE_STEP::SEND_LAST_VERSION:
ismasClient.setProgressInPercent(_SEND_LAST_VERSION);
break;
case UPDATE_STEP::UPDATE_SUCCEEDED:
ismasClient.setProgressInPercent(_UPDATE_SUCCEEDED);
break;
case UPDATE_STEP::UPDATE_FAILED:
ismasClient.setProgressInPercent(_UPDATE_FAILED);
break;
case UPDATE_STEP::FINISHED:
ismasClient.setProgressInPercent(_FINISHED);
break;
break;
}
return step;
}
#if 0
case UPDATE_STEP::CHECK_SANITY:
Utils::printUpdateStatusMsg(
@ -465,7 +703,14 @@ private:
break;
}
#endif
return debug;
friend UPDATE_STEP operator<<(MainWindow *mainWindow, UPDATE_STEP step) {
if (!Worker::instance) {
return step;
}
return step;
}
};