Compare commits
No commits in common. "979afa37d3ad1513d90a9e154e8b635bec316e57" and "686e113c3aa082df9ae60630d6c0264f26a06491" have entirely different histories.
979afa37d3
...
686e113c3a
@ -81,21 +81,9 @@ DEFINES += QT_DEPRECATED_WARNINGS
|
||||
# Fix the path-names of the json-files and the device-controller.
|
||||
# Set automatic download of json-file in ATBUpdateTool.ini file for
|
||||
# a fresh clone of the repository.
|
||||
# 1.3.23: Added a 'break' to prevent a possible endless loop when checking if
|
||||
# 1.3.23 Added a 'break' to prevent a possible endless loop when checking if
|
||||
# the device is alive.
|
||||
#
|
||||
# NOTE: The versioning info has to be shifted up by one version, i.e. what
|
||||
# happened for 1.3.23 was actually done in 1.3.24.
|
||||
# 1.3.24
|
||||
#
|
||||
# 1.3._24_: Special version for szeged using a old dc-controller (4.42):
|
||||
# Changes:
|
||||
# (1) the ini-File now uses the libCAmaster.so.
|
||||
# 1.3._25_: Again special version for szeged, using interface.h, version 4.4.
|
||||
# 1.4.0 : Start with version at 1.4.0 (mainly to see a difference with Szeged)
|
||||
# Set hash-value in EVENT-objects. Set location (project), version
|
||||
# and info in send-last-version.
|
||||
VERSION="1.4.0"
|
||||
VERSION="1.3.24"
|
||||
|
||||
# PLANNED TODOS:
|
||||
# 1: Das Repository wird repariert bwz. neu geklont. Unabhaengig vom WAIT.
|
||||
@ -182,7 +170,7 @@ DEFINES+=APP_EXTENDED_VERSION=\\\"$$EXTENDED_VERSION\\\"
|
||||
# keep comments, as /* fall through */
|
||||
QMAKE_CXXFLAGS += -C
|
||||
QMAKE_CXXFLAGS += -g
|
||||
QMAKE_CXXFLAGS += -Wno-deprecated-copy -O
|
||||
QMAKE_CXXFLAGS += -Wno-deprecated-copy
|
||||
|
||||
contains( CONFIG, PTU5 ) {
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += serialport
|
||||
|
76
utils.cpp
76
utils.cpp
@ -30,82 +30,6 @@ int Utils::read1stLineOfFile(QString fileName) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
QString Utils::getLocation(QString fileName) {
|
||||
QString location("N/A");
|
||||
QFile f(fileName);
|
||||
if (f.exists()) {
|
||||
if (f.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
QTextStream in(&f);
|
||||
in.setCodec("UTF-8");
|
||||
while(!in.atEnd()) {
|
||||
QString const &line = in.readLine();
|
||||
if (line.indexOf("Project", Qt::CaseInsensitive) != -1) {
|
||||
int const c = line.indexOf(":");
|
||||
if (c != -1) {
|
||||
location = line.mid(c+1);
|
||||
if (!location.isEmpty()) {
|
||||
return location.replace(QChar('"'), QString("")).trimmed();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return location;
|
||||
}
|
||||
|
||||
QString Utils::getTariffVersion(QString fileName) {
|
||||
QString version("N/A");
|
||||
QFile f(fileName);
|
||||
if (f.exists()) {
|
||||
if (f.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
QTextStream in(&f);
|
||||
in.setCodec("UTF-8");
|
||||
while(!in.atEnd()) {
|
||||
QString const &line = in.readLine();
|
||||
if (line.indexOf("Version", Qt::CaseInsensitive) != -1) {
|
||||
int const c = line.indexOf(":");
|
||||
if (c != -1) {
|
||||
version = line.mid(c+1);
|
||||
if (!version.isEmpty()) {
|
||||
return version.replace(QChar('"'), QString("")).trimmed();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return version;
|
||||
}
|
||||
|
||||
QString Utils::getTariffInfo(QString fileName) {
|
||||
QString info("N/A");
|
||||
QFile f(fileName);
|
||||
if (f.exists()) {
|
||||
if (f.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
QTextStream in(&f);
|
||||
in.setCodec("UTF-8");
|
||||
while(!in.atEnd()) {
|
||||
QString const &line = in.readLine();
|
||||
if (line.indexOf("Info", Qt::CaseInsensitive) != -1) {
|
||||
int const c = line.indexOf(":");
|
||||
if (c != -1) {
|
||||
info = line.mid(c+1);
|
||||
if (!info.isEmpty()) {
|
||||
return info.replace(QChar('"'), QString("")).trimmed();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return info;
|
||||
|
||||
}
|
||||
|
||||
QString Utils::zoneName(quint8 i) {
|
||||
static constexpr char const *zName[] = {
|
||||
"",
|
||||
|
3
utils.h
3
utils.h
@ -12,9 +12,6 @@
|
||||
|
||||
namespace Utils {
|
||||
int read1stLineOfFile(QString fileName);
|
||||
QString getLocation(QString fileName);
|
||||
QString getTariffVersion(QString fileName);
|
||||
QString getTariffInfo(QString fileName);
|
||||
QString zoneName(quint8 i);
|
||||
void printCriticalErrorMsg(QString const &errorMsg, bool upper=false, bool lower=false);
|
||||
void printCriticalErrorMsg(QStringList const &errorMsg);
|
||||
|
30
worker.cpp
30
worker.cpp
@ -140,7 +140,6 @@ Worker::Worker(int customerNr,
|
||||
, m_serialInterface(serialInterface)
|
||||
, m_baudrate(baudrate)
|
||||
, m_gc(m_customerNrStr, m_customerRepository, m_workingDirectory, m_branchName, this)
|
||||
, m_versionInfo(QStringList())
|
||||
, m_osVersion(getOsVersion())
|
||||
, m_atbqtVersion(getATBQTVersion())
|
||||
, m_atbUpdateToolVersion(getATBUpdateToolVersion())
|
||||
@ -302,9 +301,6 @@ void Worker::privateUpdate() {
|
||||
setProgress(i); // and switch to branch
|
||||
if (m_gc.gitCloneAndCheckoutBranch()) {
|
||||
if (!isRepositoryCorrupted()) {
|
||||
if (m_versionInfo.size() == 0) {
|
||||
m_versionInfo = m_gc.gitShowReason(m_branchName);
|
||||
}
|
||||
GUI() << (ISMAS() << (CONSOLE() << UPDATE_STEP::CLONE_REPOSITORY_SUCCESS));
|
||||
continueUpdate = true;
|
||||
m_clone = true;
|
||||
@ -334,11 +330,6 @@ void Worker::privateUpdate() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (m_versionInfo.size() == 0) {
|
||||
m_versionInfo = m_gc.gitShowReason(m_branchName);
|
||||
}
|
||||
|
||||
CONSOLE() << UPDATE_STEP::CHECK_REPOSITORY_SUCCESS;
|
||||
setProgress(_CHECKOUT_REPOSITORY_SUCCESS);
|
||||
|
||||
@ -1127,14 +1118,15 @@ PSAInstalled Worker::getPSAInstalled() {
|
||||
QString absPathName;
|
||||
QString absPathNameRepository;
|
||||
|
||||
psaInstalled.versionInfo.lastCommit = "N/A";
|
||||
psaInstalled.versionInfo.reason = "N/A";
|
||||
psaInstalled.versionInfo.created = "N/A";
|
||||
psaInstalled.versionInfo.lastCommit = "";
|
||||
psaInstalled.versionInfo.reason = "";
|
||||
psaInstalled.versionInfo.created = "";
|
||||
|
||||
if (m_versionInfo.size() == 3) {
|
||||
psaInstalled.versionInfo.lastCommit = m_versionInfo.at(0);
|
||||
psaInstalled.versionInfo.reason = m_versionInfo.at(1);
|
||||
psaInstalled.versionInfo.created = m_versionInfo.at(2);
|
||||
QStringList versionInfo = m_gc.gitShowReason(m_branchName);
|
||||
if (versionInfo.size() == 3) {
|
||||
psaInstalled.versionInfo.lastCommit = versionInfo.at(0);
|
||||
psaInstalled.versionInfo.reason = versionInfo.at(1);
|
||||
psaInstalled.versionInfo.created = versionInfo.at(2);
|
||||
}
|
||||
|
||||
if (m_zoneNr != 0) {
|
||||
@ -1147,10 +1139,10 @@ PSAInstalled Worker::getPSAInstalled() {
|
||||
psaInstalled.tariff.size = getFileSize(absPathName);
|
||||
psaInstalled.tariff.zone = m_zoneNr;
|
||||
psaInstalled.tariff.loadTime = Utils::getTariffLoadTime(absPathName);
|
||||
psaInstalled.tariff.project = Utils::getLocation(absPathName);
|
||||
psaInstalled.tariff.version = Utils::getTariffVersion(absPathName);
|
||||
psaInstalled.tariff.info = Utils::getTariffInfo(absPathName);
|
||||
}
|
||||
psaInstalled.tariff.project = "Szeged";
|
||||
psaInstalled.tariff.info = "N/A";
|
||||
psaInstalled.tariff.version = "N/A";
|
||||
|
||||
psaInstalled.hw.linuxVersion = getOsVersion();
|
||||
psaInstalled.hw.cpuSerial = m_cpuSerial;
|
||||
|
39
worker.h
39
worker.h
@ -132,7 +132,6 @@ class Worker : public QThread{
|
||||
QString const m_baudrate;
|
||||
IsmasClient m_ismasClient;
|
||||
GitClient m_gc;
|
||||
QStringList m_versionInfo;
|
||||
QString const m_osVersion;
|
||||
QString const m_atbqtVersion;
|
||||
QString const m_atbUpdateToolVersion;
|
||||
@ -653,10 +652,8 @@ private:
|
||||
ismasClient.setProgressInPercent(_CHECK_REPOSITORY);
|
||||
break;
|
||||
case UPDATE_STEP::CHECK_REPOSITORY_SUCCESS:
|
||||
ismasClient.setProgressInPercent(_CHECK_REPOSITORY_SUCCESS);
|
||||
break;
|
||||
case UPDATE_STEP::CHECK_REPOSITORY_FAILURE:
|
||||
ismasClient.setProgressInPercent(_CHECK_REPOSITORY_FAILURE);
|
||||
break;
|
||||
case UPDATE_STEP::CHECK_SANITY:
|
||||
ismasClient.setProgressInPercent(_CHECK_SANITY);
|
||||
@ -668,10 +665,8 @@ private:
|
||||
ismasClient.setProgressInPercent(_CHECK_SANITY_FAILURE);
|
||||
break;
|
||||
case UPDATE_STEP::REPOSITORY_RECOVERED_SUCCESS:
|
||||
ismasClient.setProgressInPercent(_REPOSITORY_RECOVERED_SUCCESS);
|
||||
break;
|
||||
case UPDATE_STEP::REPOSITORY_RECOVERED_FAILURE:
|
||||
ismasClient.setProgressInPercent(_REPOSITORY_RECOVERED_FAILURE);
|
||||
break;
|
||||
case UPDATE_STEP::CLONE_REPOSITORY:
|
||||
ismasClient.setProgressInPercent(_CLONE_REPOSITORY);
|
||||
@ -688,7 +683,7 @@ private:
|
||||
QString("CLONED REPOSITORY %1 AND CHECKED OUT BRANCH %2")
|
||||
.arg(instance->m_customerRepository)
|
||||
.arg(instance->m_gc.branchName()).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;
|
||||
@ -704,7 +699,7 @@ private:
|
||||
QString("CLONING REPOSITORY %1 OR CHECKING OUT BRANCH %2 FAILED")
|
||||
.arg(instance->m_customerRepository)
|
||||
.arg(instance->m_gc.branchName()).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;
|
||||
@ -718,8 +713,7 @@ private:
|
||||
ismasClient.cloneAndCheckoutCustomerRepository(
|
||||
QString("CHECKED OUT REPOSITORY %1 AND CHECKED OUT BRANCH %2")
|
||||
.arg(instance->m_customerRepository)
|
||||
.arg(instance->m_gc.branchName()),
|
||||
instance->m_versionInfo.size() >= 1 ? instance->m_versionInfo.at(0).toUtf8().constData() : "N/A"));
|
||||
.arg(instance->m_gc.branchName())));
|
||||
break;
|
||||
case UPDATE_STEP::CHECKOUT_REPOSITORY_FAILURE:
|
||||
ismasClient.setProgressInPercent(_CHECKOUT_REPOSITORY_FAILURE);
|
||||
@ -731,8 +725,7 @@ private:
|
||||
ismasClient.setProgressInPercent(_CHECK_ISMAS_TRIGGER_SUCCESS);
|
||||
ismasClient.sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT,
|
||||
QString("#M=APISM#C=CMD_EVENT#J=") +
|
||||
ismasClient.updateTriggerSet("ISMAS TRIGGER SET",
|
||||
instance->m_versionInfo.size() >= 1 ? instance->m_versionInfo.at(0).toUtf8().constData() : "N/A"));
|
||||
ismasClient.updateTriggerSet("ISMAS TRIGGER SET", ""));
|
||||
break;
|
||||
case UPDATE_STEP::CHECK_ISMAS_TRIGGER_WRONG_VALUE:
|
||||
ismasClient.setProgressInPercent(_CHECK_ISMAS_TRIGGER_WRONG_VALUE);
|
||||
@ -747,7 +740,7 @@ private:
|
||||
IsmasClient::RESULT_CODE::INSTALL_ERROR,
|
||||
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;
|
||||
@ -770,7 +763,7 @@ private:
|
||||
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;
|
||||
@ -784,7 +777,7 @@ private:
|
||||
IsmasClient::RESULT_CODE::INSTALL_ERROR,
|
||||
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;
|
||||
@ -918,7 +911,7 @@ private:
|
||||
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;
|
||||
@ -935,7 +928,7 @@ private:
|
||||
IsmasClient::RESULT_CODE::INSTALL_ERROR,
|
||||
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;
|
||||
@ -961,7 +954,7 @@ private:
|
||||
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;
|
||||
@ -978,7 +971,7 @@ private:
|
||||
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;
|
||||
@ -998,7 +991,7 @@ private:
|
||||
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;
|
||||
@ -1018,7 +1011,7 @@ private:
|
||||
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;
|
||||
@ -1041,7 +1034,7 @@ private:
|
||||
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;
|
||||
@ -1055,7 +1048,7 @@ private:
|
||||
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;
|
||||
@ -1069,7 +1062,7 @@ private:
|
||||
IsmasClient::RESULT_CODE::INSTALL_ERROR,
|
||||
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user