Compare commits
23 Commits
Author | SHA1 | Date | |
---|---|---|---|
4b3a39b0e6 | |||
a44b780d93 | |||
19dfae9b56 | |||
bef0d4fe12 | |||
72a2fc781c | |||
fc264689b1 | |||
fc587456d5 | |||
a2b933ab71 | |||
7d0fdf4d6d | |||
c2ce44c79b | |||
16a9556863 | |||
48896f97ec | |||
4486317cb2 | |||
6b9b88ea19 | |||
99a99d95a1 | |||
d4ddbbee21 | |||
34e5189945 | |||
c44c805238 | |||
196f1a730e | |||
7dc04c4422 | |||
5efac2619b | |||
9b0f741b9b | |||
81c5f8ee7e |
@@ -41,6 +41,36 @@ DEFINES += QT_DEPRECATED_WARNINGS
|
||||
# up cloning of customer repository.
|
||||
# 1.3.13: Fix: if the customer repository is corrupted, remove it and re-clone
|
||||
# the repository (without checking the ISMAS-trigger (WAIT-)button.
|
||||
VERSION="1.3.14"
|
||||
# 1.3.14: Add additional check for sanity of customer repository using
|
||||
# "git fsck".
|
||||
# Stream-lined code of update process: massive refactoring.
|
||||
# Added functionality: If WAIT button is not active, then an existing
|
||||
# customer repository will be repaired, or a not existing repository
|
||||
# will be cloned. The process stops then.
|
||||
# However, if the WAIT button is active, the at least the commands in
|
||||
# opkg_commands will be executed. Changed files in the customer
|
||||
# repository will be worked on: tariff-files will be synced with the
|
||||
# local filesystem, json-files will be downloaded to firmware.
|
||||
# The device-controller firmware will be handled in a later version.
|
||||
|
||||
# PLANNED TODOS:
|
||||
# 1: Das Repository wird repariert bwz. neu geklont. Unabhaengig vom WAIT.
|
||||
# 2: Wenn der WAIT-Button aktiv ist, dann wird ein Repository repariert (neu
|
||||
# geklont), aber zusaetzlich werden alle verfuegbaren Dateien als neu
|
||||
# angesehen und die entsprechenden Aktionen durchgefuehrt: tariff-files
|
||||
# spiegeln, json-files laden und dc laden. Also VORSICHT: das repository
|
||||
# muss in diesem fall wirklich in ordnung sein.
|
||||
# 3: Wurde keine Datei geaendert, kein initiales Clone und der WAIT-button
|
||||
# nicht aktiv, so (passiert natuerlich nichts) kann man davon ausgehen,
|
||||
# dass es sich um ein automatisches Update handelt. Dann koennte man im
|
||||
# ISMAS eine entsprechende Meldung anzeigen als Teil von SEND-LAST-VERSION.
|
||||
# Wenn der WAIT-button aktiv ist, dann werden zumindest die opkg-commands
|
||||
# ausgefuehrt.
|
||||
# 4: rsync: immer alle Dateien soiegeln (bis auf opkg-commands)
|
||||
# 5: Falls das Tool mal abstuerzt, dann einen Signal-Handler (fuer TERM)
|
||||
# installieren, sodass zumnidest SEND-LASt-VERSION mit rausgeht.
|
||||
# 6: rsync: explizites Binary, nicht das in busybox enthaltene.
|
||||
|
||||
win32 {
|
||||
BUILD_DATE=$$system("date /t")
|
||||
@@ -52,7 +82,6 @@ win32 {
|
||||
|
||||
GIT_COMMIT=$$system("git log -1 --format=oneline | cut -d' ' -f1")
|
||||
|
||||
VERSION="1.3.11"
|
||||
EXTENDED_VERSION="$${VERSION}-$${GIT_COMMIT}"
|
||||
|
||||
INCLUDEPATH += plugins
|
||||
@@ -65,6 +94,8 @@ DEFINES+=APP_BUILD_DATE=\\\"$$BUILD_DATE\\\"
|
||||
DEFINES+=APP_BUILD_TIME=\\\"$$BUILD_TIME\\\"
|
||||
DEFINES+=APP_EXTENDED_VERSION=\\\"$$EXTENDED_VERSION\\\"
|
||||
|
||||
# keep comments, as /* fall through */
|
||||
QMAKE_CXXFLAGS += -C
|
||||
QMAKE_CXXFLAGS += -g
|
||||
QMAKE_CXXFLAGS += -Wno-deprecated-copy
|
||||
|
||||
@@ -73,14 +104,14 @@ contains( CONFIG, PTU5 ) {
|
||||
CONFIG += link_pkgconfig
|
||||
lessThan(QT_MAJOR_VERSION, 5): PKGCONFIG += qextserialport
|
||||
QMAKE_CXXFLAGS += -O2 -std=c++17 # for GCC >= 4.7
|
||||
QMAKE_CXXFLAGS += -Wno-deprecated-copy
|
||||
# QMAKE_CXXFLAGS += -Wno-deprecated-copy
|
||||
ARCH = PTU5
|
||||
DEFINES+=PTU5
|
||||
}
|
||||
contains( CONFIG, PTU5_YOCTO ) {
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += serialport
|
||||
QMAKE_CXXFLAGS += -std=c++17 # for GCC >= 4.7
|
||||
QMAKE_CXXFLAGS += -Wno-deprecated-copy
|
||||
# QMAKE_CXXFLAGS += -Wno-deprecated-copy
|
||||
PTU5BASEPATH = /opt/devel/ptu5
|
||||
ARCH = PTU5
|
||||
DEFINES+=PTU5
|
||||
@@ -94,7 +125,7 @@ contains( CONFIG, DesktopLinux ) {
|
||||
# QMAKE_CC = ccache $$QMAKE_CC
|
||||
# QMAKE_CXX = ccache $$QMAKE_CXX
|
||||
QMAKE_CXXFLAGS += -std=c++17
|
||||
QMAKE_CXXFLAGS += -Wno-deprecated-copy
|
||||
# QMAKE_CXXFLAGS += -Wno-deprecated-copy
|
||||
linux-clang { QMAKE_CXXFLAGS += -Qunused-arguments }
|
||||
ARCH = DesktopLinux
|
||||
DEFINES+=DesktopLinux
|
||||
|
@@ -279,6 +279,17 @@ std::optional<QStringList> GitClient::gitDiff(QString const &commits) {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
bool GitClient::gitFsck() {
|
||||
bool r = false;
|
||||
if (QDir(m_customerRepository).exists()) {
|
||||
Command c("git fsck");
|
||||
if ((r = c.execute(m_customerRepository)) == false) {
|
||||
QString const &s = c.getCommandResult().trimmed();
|
||||
Utils::printCriticalErrorMsg(QString("GIT FSCK FAILED: %1").arg(s));
|
||||
}
|
||||
}
|
||||
return r;
|
||||
}
|
||||
/*
|
||||
Hat sich nichts geaendert, so werden auch keine Commits <>..<> angezeigt
|
||||
*/
|
||||
@@ -291,55 +302,61 @@ std::optional<QString> GitClient::gitPull() {
|
||||
QString const s = c.getCommandResult().trimmed();
|
||||
if (!s.isEmpty()) {
|
||||
QStringList lines = Update::split(s, '\n');
|
||||
worker()->CONSOLE(lines) << Worker::UPDATE_STEP::UPDATE_REPOSITORY;
|
||||
if (!lines.empty()) {
|
||||
int zoneNr = Utils::read1stLineOfFile("/mnt/system_data/zone_nr");
|
||||
m_branchName = (zoneNr != 0) ? QString("zg1/zone%1").arg(zoneNr) : "master";
|
||||
// lines can look like this:
|
||||
// From https://git.mimbach49.de/GerhardHoffmann/customer_281
|
||||
// 41ec581..5d25ac3 master -> origin/master
|
||||
// ff10f57..43530a1 zg1/zone1 -> origin/zg1/zone1
|
||||
// 6ed893f..5d9882c zg1/zone2 -> origin/zg1/zone2
|
||||
// 4384d17..77045d8 zg1/zone3 -> origin/zg1/zone3
|
||||
// 89d2812..36a0d74 zg1/zone5 -> origin/zg1/zone5
|
||||
bool found = false;
|
||||
for (int i=0; i < lines.size(); ++i) {
|
||||
if (lines.at(i).contains(m_branchName)) {
|
||||
found = true;
|
||||
// 409f198..6c22726 zg1/zone1 -> origin/zg1/zone1
|
||||
static QRegularExpression re("(^\\s*)([0-9A-Fa-f]+..[0-9A-Fa-f]+)(.*$)");
|
||||
QRegularExpressionMatch match = re.match(lines.at(i));
|
||||
if (match.hasMatch()) {
|
||||
if (re.captureCount() == 3) { // start with full match (0), then the other 3 matches
|
||||
return match.captured(2);
|
||||
static const QRegularExpression alreadyUpToDate("^\\s*Already\\s+up\\s+to\\s+date.*$");
|
||||
if (std::none_of(lines.cbegin(), lines.cend(),
|
||||
[](QString const &s) { return s.contains(alreadyUpToDate); })) {
|
||||
int zoneNr = Utils::read1stLineOfFile("/mnt/system_data/zone_nr");
|
||||
m_branchName = (zoneNr != 0) ? QString("zg1/zone%1").arg(zoneNr) : "master";
|
||||
// lines can look like this:
|
||||
// From https://git.mimbach49.de/GerhardHoffmann/customer_281
|
||||
// 41ec581..5d25ac3 master -> origin/master
|
||||
// ff10f57..43530a1 zg1/zone1 -> origin/zg1/zone1
|
||||
// 6ed893f..5d9882c zg1/zone2 -> origin/zg1/zone2
|
||||
// 4384d17..77045d8 zg1/zone3 -> origin/zg1/zone3
|
||||
// 89d2812..36a0d74 zg1/zone5 -> origin/zg1/zone5
|
||||
bool found = false;
|
||||
for (int i=0; i < lines.size(); ++i) {
|
||||
if (lines.at(i).contains(m_branchName)) {
|
||||
found = true;
|
||||
// 409f198..6c22726 zg1/zone1 -> origin/zg1/zone1
|
||||
static QRegularExpression re("(^\\s*)([0-9A-Fa-f]+..[0-9A-Fa-f]+)(.*$)");
|
||||
QRegularExpressionMatch match = re.match(lines.at(i));
|
||||
if (match.hasMatch()) {
|
||||
if (re.captureCount() == 3) { // start with full match (0), then the other 3 matches
|
||||
QString const matchCaptured = match.captured(2);
|
||||
worker()->CONSOLE(QStringList(matchCaptured)) << Worker::UPDATE_STEP::UPDATE_REPOSITORY;
|
||||
return matchCaptured;
|
||||
} else {
|
||||
QStringList lst(QString("(wrong capture count (%1)").arg(re.captureCount()));
|
||||
worker()->GUI(lst) << (worker()->CONSOLE(lst) << Worker::UPDATE_STEP::UPDATE_REPOSITORY_FAILURE);
|
||||
}
|
||||
} else {
|
||||
emit m_worker->showErrorMessage("git pull",
|
||||
QString("(wrong cap-count (%1)").arg(re.captureCount()));
|
||||
QStringList lst("no regex-match for commits");
|
||||
worker()->GUI(lst) << (worker()->CONSOLE(lst) << Worker::UPDATE_STEP::UPDATE_REPOSITORY_FAILURE);
|
||||
}
|
||||
} else {
|
||||
emit m_worker->showErrorMessage("git pull",
|
||||
"no regex-match for commits");
|
||||
Utils::printCriticalErrorMsg("NO REGEX MATCH FOR COMMITS");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
emit m_worker->showErrorMessage("git pull",
|
||||
QString("unkown branch name ") + m_branchName);
|
||||
Utils::printCriticalErrorMsg("UNKNOWN BRANCH NAME " + m_branchName);
|
||||
if (!found) {
|
||||
QStringList lst(QString("unknown branch name ") + m_branchName);
|
||||
worker()->GUI(lst) << (worker()->CONSOLE(lst) << Worker::UPDATE_STEP::UPDATE_REPOSITORY_FAILURE);
|
||||
}
|
||||
} else {
|
||||
return "Already up to date";
|
||||
}
|
||||
} else {
|
||||
emit m_worker->showErrorMessage("git pull",
|
||||
QString("wrong format for result of 'git pull' ") + s);
|
||||
Utils::printCriticalErrorMsg(QString("WRONG FORMAT FOR RESULT OF 'GIT FETCH' ") + s);
|
||||
QStringList lst(QString("WRONG FORMAT FOR RESULT OF 'GIT PULL' ") + s);
|
||||
worker()->GUI(lst) << (worker()->CONSOLE(lst) << Worker::UPDATE_STEP::UPDATE_REPOSITORY_FAILURE);
|
||||
}
|
||||
} else {
|
||||
// emit m_worker->showErrorMessage("git fetch", "empty result for 'git fetch'");
|
||||
Utils::printInfoMsg("EMPTY RESULT FOR 'GIT PULL'");
|
||||
QStringList lst("EMPTY RESULT FOR 'GIT PULL'");
|
||||
worker()->GUI(lst) << (worker()->CONSOLE(lst) << Worker::UPDATE_STEP::UPDATE_REPOSITORY_FAILURE);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
emit m_worker->showErrorMessage("git pull", QString("repository ") + m_customerRepository + " does not exist");
|
||||
Utils::printCriticalErrorMsg(QString("REPOSITORY ") + m_customerRepository + " DOES NOT EXIST");
|
||||
QStringList lst(QString("REPOSITORY ") + m_customerRepository + " DOES NOT EXIST");
|
||||
worker()->GUI(lst) << (worker()->CONSOLE(lst) << Worker::UPDATE_STEP::UPDATE_REPOSITORY_FAILURE);
|
||||
}
|
||||
return std::nullopt;
|
||||
}
|
||||
|
@@ -43,10 +43,15 @@ class GitClient : public QObject {
|
||||
|
||||
bool gitCloneAndCheckoutBranch();
|
||||
|
||||
Worker *worker() { return m_worker; }
|
||||
Worker const *worker() const { return m_worker; }
|
||||
|
||||
std::optional<QString> gitPull();
|
||||
std::optional<QStringList> gitDiff(QString const &commit);
|
||||
std::optional<QStringList> gitMerge();
|
||||
|
||||
bool gitFsck();
|
||||
|
||||
QString gitLastCommit(QString fileName);
|
||||
QStringList gitShowReason(QString branchName);
|
||||
static QString gitBlob(QString fileName);
|
||||
|
@@ -56,7 +56,7 @@ void IsmasClient::printDebugMessage(int port,
|
||||
QString const &clientIP,
|
||||
int clientPort,
|
||||
QString const &message) {
|
||||
#if 1
|
||||
#if 0
|
||||
Q_UNUSED(port);
|
||||
Q_UNUSED(clientIP);
|
||||
Q_UNUSED(clientPort);
|
||||
@@ -77,7 +77,7 @@ void IsmasClient::printInfoMessage(int port,
|
||||
QString const &clientIP,
|
||||
int clientPort,
|
||||
QString const &message) {
|
||||
#if 1
|
||||
#if 0
|
||||
Q_UNUSED(port);
|
||||
Q_UNUSED(clientIP);
|
||||
Q_UNUSED(clientPort);
|
||||
@@ -315,7 +315,7 @@ IsmasClient::sendRequestReceiveResponse(int port, QString const &request) {
|
||||
}
|
||||
}
|
||||
|
||||
printInfoMessage(port, clientIP, clientPort, QString("MESSAGE RECEIVED ") + buf);
|
||||
// printInfoMessage(port, clientIP, clientPort, QString("MESSAGE RECEIVED ") + buf);
|
||||
QString response(buf);
|
||||
|
||||
if (int idx = response.indexOf("{\"error\":\"ISMAS is offline\"}")) {
|
||||
@@ -390,16 +390,18 @@ QString IsmasClient::errorBackendNotConnected(QString const &info,
|
||||
version.toStdString().c_str());
|
||||
}
|
||||
|
||||
QString IsmasClient::errorGitClone(int percent, QString const &info, QString const &version) {
|
||||
QString IsmasClient::errorGitClone(QString const &info,
|
||||
QString const &version) {
|
||||
return updateNewsToIsmas("U0003",
|
||||
percent,
|
||||
m_progressInPercent,
|
||||
RESULT_CODE::INSTALL_ERROR,
|
||||
"CLONE CUSTOMER REPOSITORY FAILED",
|
||||
info.toStdString().c_str(),
|
||||
version.toStdString().c_str());
|
||||
}
|
||||
|
||||
QString IsmasClient::backendConnected(QString const &info, QString const &version) {
|
||||
QString IsmasClient::backendConnected(QString const &info,
|
||||
QString const &version) {
|
||||
return updateNewsToIsmas("U0010",
|
||||
m_progressInPercent,
|
||||
RESULT_CODE::SUCCESS,
|
||||
@@ -408,7 +410,8 @@ QString IsmasClient::backendConnected(QString const &info, QString const &versio
|
||||
version.toStdString().c_str());
|
||||
}
|
||||
|
||||
QString IsmasClient::execOpkgCommand(QString const &info, QString const &version) {
|
||||
QString IsmasClient::execOpkgCommand(QString const &info,
|
||||
QString const &version) {
|
||||
return updateNewsToIsmas("U0010",
|
||||
m_progressInPercent,
|
||||
RESULT_CODE::SUCCESS,
|
||||
|
@@ -177,7 +177,7 @@ public:
|
||||
QString cloneAndCheckoutCustomerRepository(QString const &info, QString const &version = QString()); // clone and checkout customer repository
|
||||
QString checkoutBranch(QString const &info, QString const &version = QString()); // checkout branch
|
||||
QString errorBackendNotConnected(QString const &info, QString const &version = QString()); // checkout branch
|
||||
QString errorGitClone(int percent, QString const &info, QString const &version = QString());
|
||||
QString errorGitClone(QString const &info, QString const &version = QString());
|
||||
QString backendConnected(QString const &info, QString const &version = QString());
|
||||
QString updateTriggerSet(QString const &info, QString const &version = QString());
|
||||
QString errorUpdateTrigger(QString const &info, QString const &version = QString());
|
||||
|
@@ -96,7 +96,7 @@ MainWindow::MainWindow(hwinf *hw, Worker *worker, Update *update, QWidget *paren
|
||||
, m_worker(worker)
|
||||
, m_width(70)
|
||||
, m_progressRunning(false)
|
||||
, m_progressValue(0)
|
||||
// , m_progressValue(0)
|
||||
, m_update(update)
|
||||
, m_updateStep(UpdateDcEvent::UpdateStep::NONE) {
|
||||
|
||||
@@ -155,6 +155,8 @@ MainWindow::MainWindow(hwinf *hw, Worker *worker, Update *update, QWidget *paren
|
||||
connect(m_worker, SIGNAL(appendText(QString,QString)),this,SLOT(onAppendText(QString,QString)));
|
||||
connect(m_worker, SIGNAL(showErrorMessage(QString,QString)),this, SLOT(onShowErrorMessage(QString,QString)));
|
||||
connect(m_worker, SIGNAL(showStatusMessage(QString,QString)),this, SLOT(onShowStatusMessage(QString,QString)));
|
||||
connect(m_worker, SIGNAL(showErrorMessage(QStringList)),this, SLOT(onShowErrorMessage(QStringList)));
|
||||
connect(m_worker, SIGNAL(showStatusMessage(QString,QString)),this, SLOT(onShowStatusMessage(QString,QString)));
|
||||
connect(m_worker, SIGNAL(replaceLast(QString,QString)),this,SLOT(onReplaceLast(QString,QString)));
|
||||
connect(m_worker, SIGNAL(replaceLast(QStringList,QString)),this, SLOT(onReplaceLast(QStringList,QString)));
|
||||
}
|
||||
@@ -178,22 +180,22 @@ void MainWindow::customEvent(QEvent *event) {
|
||||
case START_PROGRESS_LOOP: {
|
||||
m_progressRunning = true;
|
||||
ui->updateProgress->reset();
|
||||
m_progressValue = 10;
|
||||
QApplication::postEvent(this, new ProgressEvent(this, m_progressValue));
|
||||
// m_progressValue = 10;
|
||||
QApplication::postEvent(this, new ProgressEvent(this, 1));
|
||||
} break;
|
||||
case STOP_PROGRESS_LOOP: {
|
||||
m_progressRunning = false;
|
||||
m_progressValue -= 10;
|
||||
m_worker->setProgress(m_progressValue/10);
|
||||
// m_progressValue -= 10;
|
||||
// m_worker->setProgress(m_progressValue/10);
|
||||
} break;
|
||||
default: {
|
||||
if (m_progressRunning) {
|
||||
m_progressValue = progress;
|
||||
ui->updateProgress->setValue(progress/10);
|
||||
QApplication::postEvent(this, new ProgressEvent(this, progress+10));
|
||||
QThread::msleep(500);
|
||||
}
|
||||
}
|
||||
if (m_progressRunning) {
|
||||
// m_progressValue = progress;
|
||||
ui->updateProgress->setValue(progress);
|
||||
// ueberpruefen: hauptfenster schickt sich selber ein event
|
||||
// QApplication::postEvent(this, new ProgressEvent(this, progress));
|
||||
// QThread::msleep(500);
|
||||
}}
|
||||
}
|
||||
} else
|
||||
if (sender == m_worker) {
|
||||
@@ -327,8 +329,18 @@ void MainWindow::onRestartExitTimer() {
|
||||
|
||||
void MainWindow::onQuit() {
|
||||
m_exitTimer->stop();
|
||||
qCritical() << QString("ON QUIT: EXIT CODE %1").arg(m_worker->returnCode());
|
||||
qApp->exit(m_worker->returnCode());
|
||||
int errorCode = 0;
|
||||
|
||||
qCritical()
|
||||
<< QString("ON QUIT: CURRENT STEP %1")
|
||||
.arg(m_worker->getSmap()[m_worker->currentStep()]);
|
||||
|
||||
// TODO: replace SEND_LAST_VERSION with UPDATE_SUCCEEDED
|
||||
if (m_worker->currentStep() != Worker::UPDATE_STEP::SEND_LAST_VERSION) {
|
||||
errorCode = -1;
|
||||
}
|
||||
qCritical() << QString("ON QUIT: EXIT CODE %1").arg(errorCode);
|
||||
qApp->exit(errorCode);
|
||||
}
|
||||
|
||||
void MainWindow::scrollDownTextEdit() {
|
||||
@@ -448,3 +460,21 @@ void MainWindow::onShowErrorMessage(QString title, QString text) {
|
||||
void MainWindow::onShowStatusMessage(QString title, QString text) {
|
||||
onShowMessage(title, text);
|
||||
}
|
||||
|
||||
void MainWindow::onShowErrorMessage(QStringList lst) {
|
||||
if (lst.size() >= 2) {
|
||||
onShowMessage(lst.at(0), lst.at(1));
|
||||
}
|
||||
if (lst.size() == 1) {
|
||||
onShowMessage(lst.at(0), "");
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::onShowStatusMessage(QStringList lst) {
|
||||
if (lst.size() >= 2) {
|
||||
onShowMessage(lst.at(0), lst.at(1));
|
||||
}
|
||||
if (lst.size() == 1) {
|
||||
onShowMessage(lst.at(0), "");
|
||||
}
|
||||
}
|
||||
|
@@ -34,7 +34,7 @@ public:
|
||||
static const int BL_IS_UP_COUNT = 5;
|
||||
static const int BL_STOP_COUNT = 5;
|
||||
|
||||
int progressValue() const { return m_progressValue; }
|
||||
// int progressValue() const { return m_progressValue; }
|
||||
hwinf *getPlugin() { return m_hw; }
|
||||
hwinf const *getPlugin() const { return m_hw; }
|
||||
Update *getUpdate() { return m_update; }
|
||||
@@ -48,6 +48,8 @@ public slots:
|
||||
void onReplaceLast(QString, QString suffix = "");
|
||||
void onShowErrorMessage(QString, QString);
|
||||
void onShowStatusMessage(QString, QString);
|
||||
void onShowErrorMessage(QStringList);
|
||||
void onShowStatusMessage(QStringList);
|
||||
void onStopStartTimer();
|
||||
void onRestartExitTimer();
|
||||
void onEnableExit();
|
||||
@@ -76,7 +78,7 @@ private:
|
||||
QTimer *m_startTimer;
|
||||
QTimer *m_exitTimer;
|
||||
bool m_progressRunning;
|
||||
int m_progressValue;
|
||||
//int m_progressValue;
|
||||
Update *m_update;
|
||||
UpdateDcEvent::UpdateStep m_updateStep;
|
||||
};
|
||||
|
@@ -846,8 +846,8 @@ bool Update::doUpdate(int &displayIndex, QStringList const &filesToWorkOn) {
|
||||
qCritical() << "UNKNOWN JSON FILE NAME" << fToWorkOn;
|
||||
res = false;
|
||||
}
|
||||
m_worker->stopProgressLoop();
|
||||
m_worker->setProgress(100);
|
||||
// m_worker->stopProgressLoop();
|
||||
// m_worker->setProgress(100);
|
||||
|
||||
if (res == false) {
|
||||
break;
|
||||
|
42
utils.cpp
42
utils.cpp
@@ -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,30 @@ 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::printUpdateStatusMsg(QDebug &debug, QString const &updateMsg,
|
||||
bool upper, bool lower) {
|
||||
if (upper) debug << QString(80, 'U');
|
||||
|
||||
debug << updateMsg;
|
||||
|
||||
if (lower) debug << QString(80, 'U');
|
||||
|
||||
}
|
||||
|
||||
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) {
|
||||
|
9
utils.h
9
utils.h
@@ -8,16 +8,19 @@
|
||||
#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 printUpdateStatusMsg(QDebug &debug, QString const &updateMsg, bool upper=false, bool lower=false);
|
||||
void printLineEditInfo(QStringList const &lines);
|
||||
QString getTariffLoadTime(QString fileName);
|
||||
QString rstrip(QString const &str);
|
||||
|
1443
worker.cpp
1443
worker.cpp
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user