Compare commits
68 Commits
6a4a852fd6
...
v1.1.1
Author | SHA1 | Date | |
---|---|---|---|
effe41bac9 | |||
4968942cc2 | |||
769626581f | |||
0e97ce7dc2 | |||
34334676fc | |||
853787cd4b | |||
a932ed5471 | |||
c338884fc7 | |||
ed6df98653 | |||
9eb458c4c5 | |||
202e83268b | |||
8f26bfee0f | |||
1af136e39d | |||
a550d55004 | |||
a37a22d3f9 | |||
a8941f4ef4 | |||
746565dbe0 | |||
79906df12e | |||
edf1d105e7 | |||
6c4b02cb56 | |||
04d5061d79 | |||
042e6dfa38 | |||
e523d3cc2c | |||
927197d0d1 | |||
72cb738af5 | |||
0fb38013f7 | |||
5f1376cf1e | |||
5db7b4224e | |||
7c7adc94e6 | |||
89c2d3a8ae | |||
c2b52aa91d | |||
329c770aa0 | |||
cdb045b72b | |||
6d43cf4c9f | |||
4caa0c0d83 | |||
4d2d38e45c | |||
9a55ce18e4 | |||
223c7a8f8d | |||
ce72d3d14d | |||
8b66c47e49 | |||
4ff3b0efdf | |||
1fd2269753 | |||
a8994423f4 | |||
4594c913e0 | |||
cf9033e898 | |||
b09ccfd4f5 | |||
6b4c486549 | |||
9c44656104 | |||
d57914957d | |||
c4f12ce75a | |||
4ad370ea46 | |||
44ad3caf2b | |||
427a272f8f | |||
96fb50e68d | |||
19274546c9 | |||
d2d730589b | |||
f88b0edb2a | |||
c62299aa72 | |||
c054668eac | |||
82352713f1 | |||
48073ab1f0 | |||
c6e98f50c2 | |||
ef88fdc9a4 | |||
8889aaca2a | |||
9b08420ac1 | |||
0ee92f0181 | |||
a995cae000 | |||
0b7d504a7a |
@@ -77,6 +77,7 @@ contains( CONFIG, DesktopLinux ) {
|
|||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
main.cpp \
|
main.cpp \
|
||||||
|
progress_event.cpp \
|
||||||
mainwindow.cpp \
|
mainwindow.cpp \
|
||||||
utils.cpp \
|
utils.cpp \
|
||||||
update.cpp \
|
update.cpp \
|
||||||
@@ -89,6 +90,7 @@ SOURCES += \
|
|||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
update.h \
|
update.h \
|
||||||
|
progress_event.h \
|
||||||
utils.h \
|
utils.h \
|
||||||
mainwindow.h \
|
mainwindow.h \
|
||||||
git/git_client.h \
|
git/git_client.h \
|
||||||
@@ -114,7 +116,12 @@ OTHER_FILES += \
|
|||||||
# git subtree pull --prefix DCPlugin https://git.mimbach49.de/GerhardHoffmann/DCPlugin.git master --squash
|
# git subtree pull --prefix DCPlugin https://git.mimbach49.de/GerhardHoffmann/DCPlugin.git master --squash
|
||||||
# include(./DCPlugin/DCPlugin.pri)
|
# include(./DCPlugin/DCPlugin.pri)
|
||||||
|
|
||||||
# Default rules for deployment.
|
|
||||||
qnx: target.path = /tmp/$${TARGET}/bin
|
|
||||||
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
##########################################################################################
|
||||||
!isEmpty(target.path): INSTALLS += target
|
# for running program on target through QtCreator
|
||||||
|
contains( CONFIG, PTU5 ) {
|
||||||
|
qnx: target.path = /tmp/$${TARGET}/bin
|
||||||
|
else: unix:!android: target.path = /opt/app/tools/atbupdate/
|
||||||
|
!isEmpty(target.path): INSTALLS += target
|
||||||
|
}
|
||||||
|
@@ -48,8 +48,7 @@ bool GitClient::gitCloneCustomerRepository() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
qCritical() << "ERROR CLONE RESULT HAS WRONG FORMAT. CLONE_RESULT="
|
Utils::printCriticalErrorMsg(QString("ERROR CLONE RESULT HAS WRONG FORMAT. CLONE_RESULT=") + result);
|
||||||
<< result;
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -86,7 +85,7 @@ bool GitClient::gitCheckoutBranch() {
|
|||||||
// TODO: nachsehen, ob der Branch ueberhaupt existiert
|
// TODO: nachsehen, ob der Branch ueberhaupt existiert
|
||||||
|
|
||||||
if (QDir(m_customerRepository).exists()) {
|
if (QDir(m_customerRepository).exists()) {
|
||||||
int zoneNr = Utils::read1stLineOfFile("/etc/zone_nr");
|
int zoneNr = Utils::read1stLineOfFile("/mnt/system_data/zone_nr");
|
||||||
m_branchName = (zoneNr != 0)
|
m_branchName = (zoneNr != 0)
|
||||||
? QString("zg1/zone%1").arg(zoneNr) : "master";
|
? QString("zg1/zone%1").arg(zoneNr) : "master";
|
||||||
|
|
||||||
@@ -96,7 +95,7 @@ bool GitClient::gitCheckoutBranch() {
|
|||||||
Command c(gitCommand);
|
Command c(gitCommand);
|
||||||
return c.execute(m_customerRepository); // execute command in customerRepo
|
return c.execute(m_customerRepository); // execute command in customerRepo
|
||||||
}
|
}
|
||||||
qCritical() << "ERROR" << m_customerRepository << "DOES NOT EXIST";
|
Utils::printCriticalErrorMsg(QString("ERROR ") + m_customerRepository + " DOES NOT EXIST");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,13 +107,10 @@ bool GitClient::gitCloneAndCheckoutBranch() {
|
|||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
// TODO
|
// TODO
|
||||||
// m_worker->terminateUpdateProcess();
|
|
||||||
}
|
}
|
||||||
//}
|
//}
|
||||||
} else {
|
|
||||||
// TODO
|
|
||||||
//m_worker->terminateUpdateProcess();
|
|
||||||
}
|
}
|
||||||
|
Utils::printCriticalErrorMsg(QString("CLONE ") + m_repositoryPath + " AND CHECKOUT FAILED");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,24 +127,37 @@ std::optional<QStringList> GitClient::gitDiff(QString const &commits) {
|
|||||||
Command c(gitCommand);
|
Command c(gitCommand);
|
||||||
if (c.execute(m_customerRepository)) { // execute command in local customerRepo
|
if (c.execute(m_customerRepository)) { // execute command in local customerRepo
|
||||||
QString s = c.getCommandResult().trimmed();
|
QString s = c.getCommandResult().trimmed();
|
||||||
|
Utils::printInfoMsg("GIT DIFF RESULT " + s);
|
||||||
|
|
||||||
QStringList lines = Update::split(s, '\n');
|
QStringList lines = Update::split(s, '\n');
|
||||||
QStringList fileNames;
|
QStringList fileNames;
|
||||||
// each line has the format "etc/psa_config/DC2C_print01.json | 1 +
|
// each line has the format "etc/psa_config/DC2C_print01.json | 1 +
|
||||||
// or the format "etc/psa_config/DC2C_print01.json (new) | 1 +
|
// or the format "etc/psa_config/DC2C_print01.json (new) | 1 +
|
||||||
// the filenames are relativ to the repository
|
// the filenames are relativ to the repository
|
||||||
for (int i = 0; i < lines.size(); ++i) {
|
for (int i = 0; i < lines.size(); ++i) {
|
||||||
// TODO: koennte auch (delete) kommen ?
|
QString const &line = lines.at(i);
|
||||||
int newIndex = lines.at(i).indexOf("(new)"); // for new files
|
int newIndex = line.indexOf("(new"); // for new files
|
||||||
// int goneIndex = lines.at(i).indexOf("(gone)"); // for removed files
|
int goneIndex = line.indexOf("(gone"); // for removed files
|
||||||
|
int modeIndex = line.indexOf("(mode");
|
||||||
|
int pipeIndex = line.indexOf('|');
|
||||||
if (newIndex != -1) {
|
if (newIndex != -1) {
|
||||||
QString fileName = lines.at(i).mid(0, newIndex).trimmed();
|
QString file = line.left(newIndex).trimmed();
|
||||||
fileNames << fileName;
|
qInfo() << "FILE (NEW)" << file;
|
||||||
} else {
|
fileNames << file;
|
||||||
int pipeIndex = lines.at(i).indexOf('|');
|
} else
|
||||||
if (pipeIndex != -1) {
|
if (modeIndex != -1) {
|
||||||
QString fileName = lines.at(i).mid(0, pipeIndex).trimmed();
|
QString const file = line.left(modeIndex).trimmed();
|
||||||
fileNames << fileName;
|
qInfo() << "FILE (MODE)" << file;
|
||||||
}
|
fileNames << file;
|
||||||
|
} else
|
||||||
|
if (goneIndex != -1) {
|
||||||
|
QString const file = line.left(goneIndex).trimmed();
|
||||||
|
qCritical() << "FILE (GONE)" << file;
|
||||||
|
} else
|
||||||
|
if (pipeIndex != -1) {
|
||||||
|
QString const file = line.left(pipeIndex).trimmed();
|
||||||
|
qInfo() << "FILE (PIPE)" << file;
|
||||||
|
fileNames << file;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!fileNames.isEmpty()) {
|
if (!fileNames.isEmpty()) {
|
||||||
@@ -164,14 +173,7 @@ std::optional<QStringList> GitClient::gitDiff(QString const &commits) {
|
|||||||
*/
|
*/
|
||||||
std::optional<QString> GitClient::gitFetch() {
|
std::optional<QString> GitClient::gitFetch() {
|
||||||
if (QDir(m_customerRepository).exists()) {
|
if (QDir(m_customerRepository).exists()) {
|
||||||
|
qInfo() << "BRANCH NAME" << m_branchName;
|
||||||
// TODO
|
|
||||||
UpdateStatus status (UPDATE_STATUS::GIT_FETCH_UPDATES, "GIT FETCH UPDATES");
|
|
||||||
qInfo() << status;
|
|
||||||
|
|
||||||
//emit m_worker->sendCmdEventToIsmas(
|
|
||||||
// m_worker->getIsmasClient().updateOfPSAContinues(
|
|
||||||
// "GIT FETCH UPDATES", status.m_statusDescription));
|
|
||||||
|
|
||||||
Command c("git fetch");
|
Command c("git fetch");
|
||||||
if (c.execute(m_customerRepository)) {
|
if (c.execute(m_customerRepository)) {
|
||||||
@@ -179,36 +181,54 @@ std::optional<QString> GitClient::gitFetch() {
|
|||||||
if (!s.isEmpty()) {
|
if (!s.isEmpty()) {
|
||||||
QStringList lines = Update::split(s, '\n');
|
QStringList lines = Update::split(s, '\n');
|
||||||
if (!lines.empty()) {
|
if (!lines.empty()) {
|
||||||
// 409f198..6c22726 zg1/zone1 -> origin/zg1/zone1
|
int zoneNr = Utils::read1stLineOfFile("/mnt/system_data/zone_nr");
|
||||||
static QRegularExpression re("(^\\s*)([0-9A-Fa-f]+..[0-9A-Fa-f]+)(.*$)");
|
m_branchName = (zoneNr != 0) ? QString("zg1/zone%1").arg(zoneNr) : "master";
|
||||||
QRegularExpressionMatch match = re.match(lines.last());
|
// lines can look like this:
|
||||||
if (match.hasMatch()) {
|
// From https://git.mimbach49.de/GerhardHoffmann/customer_281
|
||||||
if (re.captureCount() == 3) { // start with full match (0), then the other 3 matches
|
// 41ec581..5d25ac3 master -> origin/master
|
||||||
// TODO
|
// ff10f57..43530a1 zg1/zone1 -> origin/zg1/zone1
|
||||||
status = UpdateStatus(UPDATE_STATUS::GIT_FETCH_UPDATES_REQUEST_SUCCESS,
|
// 6ed893f..5d9882c zg1/zone2 -> origin/zg1/zone2
|
||||||
QString("GIT SUCCESSFULLY FETCHED ") + m_customerRepository);
|
// 4384d17..77045d8 zg1/zone3 -> origin/zg1/zone3
|
||||||
qInfo() << status;
|
// 89d2812..36a0d74 zg1/zone5 -> origin/zg1/zone5
|
||||||
|
bool found = false;
|
||||||
//emit m_worker->sendCmdEventToIsmas(
|
for (int i=0; i < lines.size(); ++i) {
|
||||||
// m_worker->getIsmasClient().updateOfPSAContinues(
|
if (lines.at(i).contains(m_branchName)) {
|
||||||
// "GIT_FETCH_UPDATES SUCCESS", status.m_statusDescription));
|
found = true;
|
||||||
|
// 409f198..6c22726 zg1/zone1 -> origin/zg1/zone1
|
||||||
return match.captured(2);
|
static QRegularExpression re("(^\\s*)([0-9A-Fa-f]+..[0-9A-Fa-f]+)(.*$)");
|
||||||
} else {
|
QRegularExpressionMatch match = re.match(lines.at(i));
|
||||||
qCritical() << "ERROR WRONG CAPTURE COUNT FOR 'GIT FETCH'" << re.captureCount();
|
if (match.hasMatch()) {
|
||||||
|
if (re.captureCount() == 3) { // start with full match (0), then the other 3 matches
|
||||||
|
return match.captured(2);
|
||||||
|
} else {
|
||||||
|
emit m_worker->showErrorMessage("git fetch",
|
||||||
|
QString("(wrong cap-count (%1)").arg(re.captureCount()));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
emit m_worker->showErrorMessage("git fetch",
|
||||||
|
"no regex-match for commits");
|
||||||
|
Utils::printCriticalErrorMsg("NO REGEX MATCH FOR COMMITS");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
qCritical() << "ERROR NO MATCH OF COMMITS FOR 'GIT FETCH'";
|
if (!found) {
|
||||||
|
emit m_worker->showErrorMessage("git fetch",
|
||||||
|
QString("unkown branch name ") + m_branchName);
|
||||||
|
Utils::printCriticalErrorMsg("UNKNOWN BRANCH NAME " + m_branchName);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
qCritical() << "ERROR WRONG FORMAT FOR RESULT FOR 'GIT FETCH'" << s;
|
emit m_worker->showErrorMessage("git fetch",
|
||||||
|
QString("wrong format for result of 'git fetch' ") + s);
|
||||||
|
Utils::printCriticalErrorMsg(QString("WRONG FORMAT FOR RESULT OF 'GIT FETCH' ") + s);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
qCritical() << "ERROR EMPTY RESULT FROM 'GIT FETCH'";
|
emit m_worker->showErrorMessage("git fetch", "empty result for 'git fetch'");
|
||||||
|
Utils::printCriticalErrorMsg("EMPTY RESULT FOR 'GIT FETCH'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
qCritical() << "ERROR" << m_customerRepository << "DOES NOT EXIST";
|
emit m_worker->showErrorMessage("git fetch", QString("repository ") + m_customerRepository + " does not exist");
|
||||||
|
Utils::printCriticalErrorMsg(QString("REPOSITORY ") + m_customerRepository + " DOES NOT EXIST");
|
||||||
}
|
}
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
@@ -229,7 +249,7 @@ bool GitClient::gitPull() {
|
|||||||
qInfo() << "PULLED INTO" << m_customerRepository;
|
qInfo() << "PULLED INTO" << m_customerRepository;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
qCritical() << "PULL INTO" << m_customerRepository << "FAILED";
|
Utils::printCriticalErrorMsg(QString("PULL INTO " + m_customerRepository + " FAILED"));
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -248,13 +268,15 @@ QString GitClient::gitLastCommit(QString fileName) {
|
|||||||
if (QDir(m_customerRepository).exists()) {
|
if (QDir(m_customerRepository).exists()) {
|
||||||
QString const filePath
|
QString const filePath
|
||||||
= QDir::cleanPath(m_customerRepository + QDir::separator() + fileName);
|
= QDir::cleanPath(m_customerRepository + QDir::separator() + fileName);
|
||||||
QString const gitCommand = QString("git log %1 | head -n 1").arg(fileName);
|
if (QFile(filePath).exists()) {
|
||||||
Command c("bash");
|
QString const gitCommand = QString("git log %1 | head -n 1").arg(fileName);
|
||||||
if (c.execute(m_customerRepository, QStringList() << "-c" << gitCommand)) {
|
Command c("bash");
|
||||||
QString const r = c.getCommandResult();
|
if (c.execute(m_customerRepository, QStringList() << "-c" << gitCommand)) {
|
||||||
int const idx = r.indexOf("commit ");
|
QString const r = c.getCommandResult();
|
||||||
if (idx != -1) {
|
int const idx = r.indexOf("commit ");
|
||||||
return r.mid(idx + 8).trimmed();
|
if (idx != -1) {
|
||||||
|
return r.mid(idx + 8).trimmed();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -148,6 +148,7 @@ IsmasClient::sendRequestReceiveResponse(int port, QString const &request) {
|
|||||||
int const bytesToWrite = strlen(request.toStdString().c_str());
|
int const bytesToWrite = strlen(request.toStdString().c_str());
|
||||||
strncpy(buf, request.toStdString().c_str(), sizeof(buf)-1);
|
strncpy(buf, request.toStdString().c_str(), sizeof(buf)-1);
|
||||||
|
|
||||||
|
int loop = 0;
|
||||||
int bytesWritten = 0;
|
int bytesWritten = 0;
|
||||||
while (bytesWritten < bytesToWrite) {
|
while (bytesWritten < bytesToWrite) {
|
||||||
int n = ::sendto(sockfd, buf+bytesWritten, bytesToWrite-bytesWritten, 0, NULL, 0);
|
int n = ::sendto(sockfd, buf+bytesWritten, bytesToWrite-bytesWritten, 0, NULL, 0);
|
||||||
@@ -155,14 +156,18 @@ IsmasClient::sendRequestReceiveResponse(int port, QString const &request) {
|
|||||||
bytesWritten += n;
|
bytesWritten += n;
|
||||||
} else {
|
} else {
|
||||||
if (errno == EWOULDBLOCK) {
|
if (errno == EWOULDBLOCK) {
|
||||||
|
if (++loop < 10) {
|
||||||
|
QThread::msleep(500);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
printErrorMessage(port, clientIP, clientPort,
|
printErrorMessage(port, clientIP, clientPort,
|
||||||
QString("TIMEOUT (") + strerror(errno) + ")");
|
QString("WRITE TIMEOUT %1(").arg(loop) + strerror(errno) + ")");
|
||||||
::close(sockfd);
|
::close(sockfd);
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
} else
|
} else
|
||||||
if (errno == EINTR) {
|
if (errno == EINTR) {
|
||||||
printErrorMessage(port, clientIP, clientPort,
|
printErrorMessage(port, clientIP, clientPort,
|
||||||
QString("INTERRUPTED BY SIGNAL (1) (") + strerror(errno) + ")");
|
QString("WRITE INTERRUPTED BY SIGNAL (1) (") + strerror(errno) + ")");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -177,6 +182,7 @@ IsmasClient::sendRequestReceiveResponse(int port, QString const &request) {
|
|||||||
|
|
||||||
printInfoMessage(port, clientIP, clientPort, QString("MESSAGE SENT ") + buf);
|
printInfoMessage(port, clientIP, clientPort, QString("MESSAGE SENT ") + buf);
|
||||||
|
|
||||||
|
loop = 0;
|
||||||
bzero(buf, sizeof(buf));
|
bzero(buf, sizeof(buf));
|
||||||
int bytesToRead = sizeof(buf)-1;
|
int bytesToRead = sizeof(buf)-1;
|
||||||
int bytesRead = 0;
|
int bytesRead = 0;
|
||||||
@@ -196,8 +202,12 @@ IsmasClient::sendRequestReceiveResponse(int port, QString const &request) {
|
|||||||
} else
|
} else
|
||||||
if (n < 0) {
|
if (n < 0) {
|
||||||
if (errno == EWOULDBLOCK) {
|
if (errno == EWOULDBLOCK) {
|
||||||
|
if (++loop < 10) {
|
||||||
|
QThread::msleep(500);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
printErrorMessage(port, clientIP, clientPort,
|
printErrorMessage(port, clientIP, clientPort,
|
||||||
QString("TIMEOUT (") + strerror(errno) + ")");
|
QString("READ TIMEOUT %1(").arg(loop) + strerror(errno) + ")");
|
||||||
::close(sockfd);
|
::close(sockfd);
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
@@ -214,8 +224,8 @@ IsmasClient::sendRequestReceiveResponse(int port, QString const &request) {
|
|||||||
if (int idx = response.indexOf("{\"error\":\"ISMAS is offline\"}")) {
|
if (int idx = response.indexOf("{\"error\":\"ISMAS is offline\"}")) {
|
||||||
response = response.mid(0, idx);
|
response = response.mid(0, idx);
|
||||||
} else
|
} else
|
||||||
if (response == "RECORD SAVED") {
|
if (response.contains("RECORD")) { // RECORD SAVED or RECORD WRITE ABORTED
|
||||||
printInfoMessage(port, clientIP, clientPort, "IGNORED 'RECORD SAVED' RESPONSE");
|
printInfoMessage(port, clientIP, clientPort, QString("IGNORED '") + response + "' RESPONSE");
|
||||||
::close(sockfd);
|
::close(sockfd);
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
@@ -283,6 +293,15 @@ QString IsmasClient::errorBackendNotConnected(QString const &info,
|
|||||||
version.toStdString().c_str());
|
version.toStdString().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString IsmasClient::errorGitClone(int percent, QString const &info, QString const &version) {
|
||||||
|
return updateNewsToIsmas("U0003",
|
||||||
|
percent,
|
||||||
|
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",
|
return updateNewsToIsmas("U0010",
|
||||||
m_progressInPercent,
|
m_progressInPercent,
|
||||||
@@ -734,11 +753,42 @@ QString IsmasClient::sanityCheckFailed(int resultCode, QString reason, QString c
|
|||||||
version.toStdString().c_str());
|
version.toStdString().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
QString IsmasClient::updateOfPSAFailed(int resultCode, QString reason, QString const &version) {
|
QString IsmasClient::jsonParseFailed(int resultCode, QString reason, QString const &version) {
|
||||||
return updateNewsToIsmas("U0003",
|
return updateNewsToIsmas("U0003",
|
||||||
m_progressInPercent,
|
m_progressInPercent,
|
||||||
resultCode,
|
resultCode,
|
||||||
"UPDATE ERROR",
|
"JSON-PARSE-ERROR",
|
||||||
|
reason.toStdString().c_str(),
|
||||||
|
version.toStdString().c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
std::optional<QString> IsmasClient::finalResult(int resultCode, QString reason, QString const &version) {
|
||||||
|
m_progressInPercent = 0;
|
||||||
|
if (resultCode == RESULT_CODE::SUCCESS) {
|
||||||
|
return updateNewsToIsmas("U0002",
|
||||||
|
m_progressInPercent,
|
||||||
|
RESULT_CODE::SUCCESS,
|
||||||
|
"FINAL-UPDATE-RESULT",
|
||||||
|
"(re-)set WAIT state",
|
||||||
|
version.toStdString().c_str());
|
||||||
|
}
|
||||||
|
if (resultCode == RESULT_CODE::INSTALL_ERROR) {
|
||||||
|
return updateNewsToIsmas("U0003",
|
||||||
|
m_progressInPercent,
|
||||||
|
resultCode,
|
||||||
|
"FINAL-UPDATE-RESULT",
|
||||||
|
reason.toStdString().c_str(),
|
||||||
|
version.toStdString().c_str());
|
||||||
|
}
|
||||||
|
return std::nullopt;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString IsmasClient::updateOfPSAFailed(int resultCode, QString step,
|
||||||
|
QString reason, QString const &version) {
|
||||||
|
return updateNewsToIsmas("U0003",
|
||||||
|
m_progressInPercent,
|
||||||
|
resultCode,
|
||||||
|
step.toStdString().c_str(),
|
||||||
reason.toStdString().c_str(),
|
reason.toStdString().c_str(),
|
||||||
version.toStdString().c_str());
|
version.toStdString().c_str());
|
||||||
}
|
}
|
||||||
|
@@ -4,6 +4,8 @@
|
|||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
|
#include <optional>
|
||||||
|
|
||||||
struct PSAInstalled {
|
struct PSAInstalled {
|
||||||
struct Tariff {
|
struct Tariff {
|
||||||
QString name;
|
QString name;
|
||||||
@@ -12,6 +14,7 @@ struct PSAInstalled {
|
|||||||
int zone;
|
int zone;
|
||||||
int size;
|
int size;
|
||||||
QString blob;
|
QString blob;
|
||||||
|
QString lastCommit;
|
||||||
QString info;
|
QString info;
|
||||||
QString loadTime;
|
QString loadTime;
|
||||||
} tariff;
|
} tariff;
|
||||||
@@ -144,6 +147,7 @@ public:
|
|||||||
QString cloneAndCheckoutCustomerRepository(QString const &info, QString const &version = QString()); // clone and checkout customer repository
|
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 checkoutBranch(QString const &info, QString const &version = QString()); // checkout branch
|
||||||
QString errorBackendNotConnected(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 backendConnected(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 updateTriggerSet(QString const &info, QString const &version = QString());
|
||||||
QString errorUpdateTrigger(QString const &info, QString const &version = QString());
|
QString errorUpdateTrigger(QString const &info, QString const &version = QString());
|
||||||
@@ -154,8 +158,10 @@ public:
|
|||||||
// and update accepted
|
// and update accepted
|
||||||
QString updateOfPSASucceeded(QString const &version = QString()); // update process succeeded
|
QString updateOfPSASucceeded(QString const &version = QString()); // update process succeeded
|
||||||
QString updateOfPSAContinues(QString currentStage, QString currentStageInfo, QString const &version = QString());
|
QString updateOfPSAContinues(QString currentStage, QString currentStageInfo, QString const &version = QString());
|
||||||
QString updateOfPSAFailed(int resultCode, QString reason, QString const &version = QString());
|
QString updateOfPSAFailed(int resultCode, QString step, QString reason, QString const &version = QString());
|
||||||
QString sanityCheckFailed(int resultCode, QString reason, QString const &version = QString());
|
QString sanityCheckFailed(int resultCode, QString reason, QString const &version = QString());
|
||||||
|
QString jsonParseFailed(int resultCode, QString reason, QString const &version = QString());
|
||||||
|
std::optional<QString> finalResult(int resultCode, QString reason, QString const &version = QString());
|
||||||
|
|
||||||
QString updateOfPSASendVersion(PSAInstalled const &psa);
|
QString updateOfPSASendVersion(PSAInstalled const &psa);
|
||||||
|
|
||||||
|
8
main.cpp
8
main.cpp
@@ -46,14 +46,15 @@ int main(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
// qputenv("XDG_RUNTIME_DIR", "/run/user/0");
|
// qputenv("XDG_RUNTIME_DIR", "/run/user/0");
|
||||||
|
|
||||||
|
openlog("ATB-UPDATE", LOG_PERROR | LOG_PID | LOG_CONS, LOG_USER);
|
||||||
|
|
||||||
QApplication a(argc, argv);
|
QApplication a(argc, argv);
|
||||||
QApplication::setApplicationName("ATBUpdateTool");
|
QApplication::setApplicationName("ATBUpdateTool");
|
||||||
QApplication::setApplicationVersion(APP_VERSION);
|
QApplication::setApplicationVersion(APP_VERSION);
|
||||||
|
|
||||||
if (!messageHandlerInstalled()) { // change internal qt-QDebug-handling
|
if (!messageHandlerInstalled()) { // change internal qt-QDebug-handling
|
||||||
atbInstallMessageHandler(atbDebugOutput);
|
atbInstallMessageHandler(atbDebugOutput);
|
||||||
setDebugLevel(QtMsgType::QtInfoMsg);
|
setDebugLevel(LOG_NOTICE);
|
||||||
//setDebugLevel(QtMsgType::QtDebugMsg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QCommandLineParser parser;
|
QCommandLineParser parser;
|
||||||
@@ -145,7 +146,10 @@ int main(int argc, char *argv[]) {
|
|||||||
dryRun);
|
dryRun);
|
||||||
|
|
||||||
MainWindow mw(&worker);
|
MainWindow mw(&worker);
|
||||||
|
worker.setMainWindow(&mw);
|
||||||
|
|
||||||
mw.setWindowFlags(Qt::Window | Qt::FramelessWindowHint);
|
mw.setWindowFlags(Qt::Window | Qt::FramelessWindowHint);
|
||||||
|
mw.setWindowState(Qt::WindowFullScreen);
|
||||||
mw.show();
|
mw.show();
|
||||||
|
|
||||||
return a.exec();
|
return a.exec();
|
||||||
|
182
mainwindow.cpp
182
mainwindow.cpp
@@ -2,6 +2,7 @@
|
|||||||
#include "ui_mainwindow.h"
|
#include "ui_mainwindow.h"
|
||||||
#include "worker.h"
|
#include "worker.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
#include "progress_event.h"
|
||||||
|
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
@@ -11,32 +12,14 @@ MainWindow::MainWindow(Worker *worker, QWidget *parent)
|
|||||||
: QMainWindow(parent)
|
: QMainWindow(parent)
|
||||||
, ui(new Ui::MainWindow)
|
, ui(new Ui::MainWindow)
|
||||||
, m_worker(worker)
|
, m_worker(worker)
|
||||||
, m_width(52) {
|
, m_width(70)
|
||||||
|
, m_progressRunning(false)
|
||||||
|
, m_progressValue(0) {
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
ui->updateProgress->setRange(1, 100);
|
ui->updateProgress->setRange(0, 100);
|
||||||
ui->updateProgress->reset();
|
ui->updateProgress->reset();
|
||||||
|
|
||||||
m_startTimer = new QTimer(this);
|
|
||||||
connect(m_startTimer, SIGNAL(timeout()), ui->start, SLOT(click()));
|
|
||||||
m_startTimer->setSingleShot(true);
|
|
||||||
m_startTimer->start(5 * 1000);
|
|
||||||
|
|
||||||
m_exitTimer = new QTimer(this);
|
|
||||||
connect(m_exitTimer, SIGNAL(timeout()), ui->exit, SLOT(click()));
|
|
||||||
m_exitTimer->setSingleShot(true);
|
|
||||||
m_exitTimer->start(1800 * 1000);
|
|
||||||
|
|
||||||
connect(m_startTimer, SIGNAL(timeout()), ui->start, SLOT(click()));
|
|
||||||
connect(m_exitTimer, SIGNAL(timeout()), ui->exit, SLOT(click()));
|
|
||||||
connect(ui->start, SIGNAL(clicked()), m_worker, SLOT(update()));
|
|
||||||
connect(ui->exit, SIGNAL(clicked()), this, SLOT(onQuit()));
|
|
||||||
connect(m_worker, SIGNAL(stopStartTimer()), this, SLOT(onStopStartTimer()));
|
|
||||||
connect(m_worker, SIGNAL(restartExitTimer()), this, SLOT(onRestartExitTimer()));
|
|
||||||
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(setProgress(quint8)), this, SLOT(onSetProgress(quint8)));
|
|
||||||
|
|
||||||
QStringList lst;
|
QStringList lst;
|
||||||
QString start = QDateTime::currentDateTime().toString(Qt::ISODate);
|
QString start = QDateTime::currentDateTime().toString(Qt::ISODate);
|
||||||
lst << QString("Start: ") + start.leftJustified(m_width-10);
|
lst << QString("Start: ") + start.leftJustified(m_width-10);
|
||||||
@@ -48,6 +31,28 @@ MainWindow::MainWindow(Worker *worker, QWidget *parent)
|
|||||||
|
|
||||||
ui->updateStatus->setText(lst.join('\n'));
|
ui->updateStatus->setText(lst.join('\n'));
|
||||||
ui->updateStatus->setEnabled(true);
|
ui->updateStatus->setEnabled(true);
|
||||||
|
|
||||||
|
m_startTimer = new QTimer(this);
|
||||||
|
connect(m_startTimer, SIGNAL(timeout()), m_worker, SLOT(update()));
|
||||||
|
m_startTimer->setSingleShot(true);
|
||||||
|
m_startTimer->start(1000);
|
||||||
|
|
||||||
|
m_exitTimer = new QTimer(this);
|
||||||
|
connect(m_exitTimer, SIGNAL(timeout()), ui->exit, SLOT(click()));
|
||||||
|
m_exitTimer->setSingleShot(true);
|
||||||
|
m_exitTimer->start(1800 * 1000);
|
||||||
|
|
||||||
|
connect(ui->exit, SIGNAL(clicked()), this, SLOT(onQuit()));
|
||||||
|
connect(m_worker, SIGNAL(disableExit()), this, SLOT(onDisableExit()));
|
||||||
|
connect(m_worker, SIGNAL(enableExit()), this, SLOT(onEnableExit()));
|
||||||
|
connect(m_worker, SIGNAL(stopStartTimer()), this, SLOT(onStopStartTimer()));
|
||||||
|
connect(m_worker, SIGNAL(restartExitTimer()), this, SLOT(onRestartExitTimer()));
|
||||||
|
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(replaceLast(QString, QString)), this, SLOT(onReplaceLast(QString,QString)));
|
||||||
|
|
||||||
|
ui->updateStatus->setText(lst.join('\n'));
|
||||||
|
ui->updateStatus->setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWindow::~MainWindow() {
|
MainWindow::~MainWindow() {
|
||||||
@@ -56,42 +61,137 @@ MainWindow::~MainWindow() {
|
|||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::customEvent(QEvent *event) {
|
||||||
|
if (event->type() == ProgressEvent::type()) {
|
||||||
|
ProgressEvent *pevent = (ProgressEvent *)event;
|
||||||
|
int const progress = pevent->progressPercent();
|
||||||
|
QObject const *sender = pevent->sender();
|
||||||
|
if (sender == this) {
|
||||||
|
switch(progress) {
|
||||||
|
case 0: {
|
||||||
|
ui->updateProgress->reset();
|
||||||
|
} break;
|
||||||
|
case START_PROGRESS_LOOP: {
|
||||||
|
m_progressRunning = true;
|
||||||
|
ui->updateProgress->reset();
|
||||||
|
m_progressValue = 10;
|
||||||
|
QApplication::postEvent(this, new ProgressEvent(this, m_progressValue));
|
||||||
|
} break;
|
||||||
|
case STOP_PROGRESS_LOOP: {
|
||||||
|
m_progressRunning = false;
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
if (sender == m_worker) {
|
||||||
|
switch(progress) {
|
||||||
|
case 0: {
|
||||||
|
ui->updateProgress->reset();
|
||||||
|
} break;
|
||||||
|
case START_PROGRESS_LOOP: {
|
||||||
|
QApplication::postEvent(this, new ProgressEvent(this, START_PROGRESS_LOOP));
|
||||||
|
} break;
|
||||||
|
case STOP_PROGRESS_LOOP: {
|
||||||
|
QApplication::postEvent(this, new ProgressEvent(this, STOP_PROGRESS_LOOP));
|
||||||
|
} break;
|
||||||
|
default:{
|
||||||
|
ui->updateProgress->setValue(progress);
|
||||||
|
}}
|
||||||
|
} else {
|
||||||
|
qCritical() << "!!! UNKNOWN SENDER !!!";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QThread::yieldCurrentThread();
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::onStopStartTimer() {
|
void MainWindow::onStopStartTimer() {
|
||||||
m_startTimer->stop();
|
m_startTimer->stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::onDisableExit() {
|
||||||
|
ui->exit->setEnabled(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::onEnableExit() {
|
||||||
|
ui->exit->setEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::onRestartExitTimer() {
|
void MainWindow::onRestartExitTimer() {
|
||||||
m_exitTimer->stop();
|
m_exitTimer->stop();
|
||||||
m_exitTimer->start(5 * 1000);
|
m_exitTimer->start(60 * 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::onQuit() {
|
void MainWindow::onQuit() {
|
||||||
if (!m_worker->updateProcessRunning()) {
|
m_exitTimer->stop();
|
||||||
qApp->quit();
|
qCritical() << QString("ON QUIT: EXIT CODE %1").arg(m_worker->returnCode());
|
||||||
}
|
qApp->exit(m_worker->returnCode());
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::onSetProgress(quint8 v) {
|
|
||||||
ui->updateProgress->setValue(v);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::onAppendText(QString text, QString suffix) {
|
void MainWindow::onAppendText(QString text, QString suffix) {
|
||||||
QString editText = ui->updateStatus->toPlainText();
|
QString editText = ui->updateStatus->toPlainText();
|
||||||
QStringList lines = editText.split('\n');
|
if (!suffix.isNull() && suffix.size() > 0) {
|
||||||
for (int i=0; i<lines.size(); ++i) {
|
qInfo() << "TEXT" << text << "SUFFIX" << suffix;
|
||||||
qCritical() << lines.at(i);
|
if (suffix == Worker::UPDATE_STEP_SUCCESS || suffix == Worker::UPDATE_STEP_FAIL) {
|
||||||
}
|
editText += QString("\n").leftJustified(m_width-3, '=');
|
||||||
if (!suffix.contains("[SUCCESS]")) {
|
editText += " ";
|
||||||
editText += text.leftJustified(m_width-9) + suffix;
|
}
|
||||||
ui->updateStatus->setPlainText(editText);
|
editText += (QString("\n") + text).leftJustified(m_width - (2 + suffix.size()) ) + suffix;
|
||||||
} else {
|
} else {
|
||||||
editText += QString("\n").leftJustified(m_width-3, '=');
|
editText += text.leftJustified(m_width-9);
|
||||||
editText += QString("\n").leftJustified(m_width-12) + " [SUCCESS]";
|
|
||||||
}
|
}
|
||||||
ui->updateStatus->setText(editText);
|
|
||||||
|
Utils::printLineEditInfo(editText.split('\n'));
|
||||||
|
|
||||||
|
ui->updateStatus->setPlainText(editText.trimmed());
|
||||||
|
ui->updateStatus->setEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::onReplaceLast(QString text, QString suffix) {
|
||||||
|
qInfo() << "REPL TEXT" << text << "SUFFIX" << suffix;
|
||||||
|
|
||||||
|
QString editText = ui->updateStatus->toPlainText();
|
||||||
|
QStringList lines = editText.split('\n');
|
||||||
|
if (lines.size() > 0) {
|
||||||
|
lines.removeLast();
|
||||||
|
if (!suffix.isNull() && suffix.size() > 0 && suffix != "\n") {
|
||||||
|
lines += text.leftJustified(m_width-10) + suffix;
|
||||||
|
} else {
|
||||||
|
lines += text.leftJustified(m_width-10);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Utils::printLineEditInfo(lines);
|
||||||
|
|
||||||
|
ui->updateStatus->setText(lines.join('\n').trimmed());
|
||||||
ui->updateStatus->setEnabled(true);
|
ui->updateStatus->setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::onShowErrorMessage(QString title, QString text) {
|
void MainWindow::onShowErrorMessage(QString title, QString text) {
|
||||||
QMessageBox::critical(this, title, text, QMessageBox::Ok);
|
text = text.leftJustified(50, ' ');
|
||||||
|
QMessageBox msgBox(QMessageBox::NoIcon, title,
|
||||||
|
text, QMessageBox::Ok,
|
||||||
|
nullptr, Qt::FramelessWindowHint);
|
||||||
|
msgBox.setDefaultButton(QMessageBox::Ok);
|
||||||
|
msgBox.defaultButton()->setVisible(false);
|
||||||
|
|
||||||
|
QTimer *t = new QTimer(this);
|
||||||
|
connect(t, SIGNAL(timeout()), msgBox.defaultButton(), SLOT(click()));
|
||||||
|
t->setSingleShot(true);
|
||||||
|
t->start(5 * 1000);
|
||||||
|
|
||||||
|
if(msgBox.exec() == QMessageBox::Ok) {
|
||||||
|
// do something
|
||||||
|
} else {
|
||||||
|
// do something else
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
16
mainwindow.h
16
mainwindow.h
@@ -13,16 +13,26 @@ QT_END_NAMESPACE
|
|||||||
class MainWindow : public QMainWindow {
|
class MainWindow : public QMainWindow {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void customEvent(QEvent *event) override;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MainWindow(Worker *worker, QWidget *parent = nullptr);
|
MainWindow(Worker *worker, QWidget *parent = nullptr);
|
||||||
~MainWindow();
|
~MainWindow();
|
||||||
|
|
||||||
|
static const int START_PROGRESS_LOOP = -1;
|
||||||
|
static const int STOP_PROGRESS_LOOP = -2;
|
||||||
|
|
||||||
|
int progressValue() const { return m_progressValue; }
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void onAppendText(QString, QString);
|
void onAppendText(QString, QString suffix = "");
|
||||||
|
void onReplaceLast(QString, QString suffix = "");
|
||||||
void onShowErrorMessage(QString, QString);
|
void onShowErrorMessage(QString, QString);
|
||||||
void onSetProgress(quint8);
|
|
||||||
void onStopStartTimer();
|
void onStopStartTimer();
|
||||||
void onRestartExitTimer();
|
void onRestartExitTimer();
|
||||||
|
void onEnableExit();
|
||||||
|
void onDisableExit();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void onQuit();
|
void onQuit();
|
||||||
@@ -33,5 +43,7 @@ private:
|
|||||||
int m_width;
|
int m_width;
|
||||||
QTimer *m_startTimer;
|
QTimer *m_startTimer;
|
||||||
QTimer *m_exitTimer;
|
QTimer *m_exitTimer;
|
||||||
|
bool m_progressRunning;
|
||||||
|
int m_progressValue;
|
||||||
};
|
};
|
||||||
#endif // MAINWINDOW_H
|
#endif // MAINWINDOW_H
|
||||||
|
@@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>370</width>
|
<width>800</width>
|
||||||
<height>358</height>
|
<height>480</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="font">
|
<property name="font">
|
||||||
@@ -19,56 +19,44 @@
|
|||||||
<string>MainWindow</string>
|
<string>MainWindow</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="centralwidget">
|
<widget class="QWidget" name="centralwidget">
|
||||||
<widget class="QWidget" name="">
|
<widget class="QWidget" name="layoutWidget">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>10</x>
|
||||||
<y>11</y>
|
<y>10</y>
|
||||||
<width>351</width>
|
<width>781</width>
|
||||||
<height>341</height>
|
<height>461</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="0" column="0" colspan="2">
|
<item row="3" column="2">
|
||||||
<widget class="QTextEdit" name="updateStatus">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<family>Noto Sans</family>
|
|
||||||
<pointsize>8</pointsize>
|
|
||||||
<bold>false</bold>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0" colspan="2">
|
|
||||||
<widget class="QProgressBar" name="updateProgress">
|
|
||||||
<property name="value">
|
|
||||||
<number>24</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QPushButton" name="start">
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<family>Terminus</family>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Start</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
|
||||||
<widget class="QPushButton" name="exit">
|
<widget class="QPushButton" name="exit">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Exit</string>
|
<string>Exit</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="3" column="1">
|
||||||
|
<widget class="QProgressBar" name="updateProgress">
|
||||||
|
<property name="value">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0" rowspan="3" colspan="3">
|
||||||
|
<widget class="QTextEdit" name="updateStatus">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<family>Misc Fixed</family>
|
||||||
|
<pointsize>11</pointsize>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
|
@@ -6,13 +6,13 @@
|
|||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QMessageLogContext>
|
#include <QMessageLogContext>
|
||||||
|
|
||||||
#define OUTPUT_LEN (1024*8)
|
|
||||||
|
|
||||||
|
static char const *DBG_NAME[] = { "DBG ", "WARN ", "CRIT ", "FATAL", "INFO " };
|
||||||
static bool installedMsgHandler = false;
|
static bool installedMsgHandler = false;
|
||||||
static QtMsgType debugLevel = QtInfoMsg;
|
static int debugLevel = LOG_NOTICE;
|
||||||
|
|
||||||
QtMsgType getDebugLevel() { return debugLevel; }
|
int getDebugLevel() { return debugLevel; }
|
||||||
void setDebugLevel(QtMsgType newDebugLevel) {
|
void setDebugLevel(int newDebugLevel) {
|
||||||
debugLevel = newDebugLevel;
|
debugLevel = newDebugLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,75 +45,51 @@ QtMessageHandler atbInstallMessageHandler(QtMessageHandler handler) {
|
|||||||
///
|
///
|
||||||
#if (QT_VERSION > QT_VERSION_CHECK(5, 0, 0) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
#if (QT_VERSION > QT_VERSION_CHECK(5, 0, 0) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
void atbDebugOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg) {
|
void atbDebugOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg) {
|
||||||
// static constexpr const char *format = "dd.MM.yyyy hh:mm:ss";
|
Q_UNUSED(context);
|
||||||
QByteArray localMsg = msg.toLocal8Bit();
|
QString const localMsg = QString(DBG_NAME[type]) + msg.toLocal8Bit();
|
||||||
QString fileName(context.file ? context.file : "N/A");
|
|
||||||
QString function(context.function ? context.function : "N/A");
|
switch (debugLevel) {
|
||||||
char buf[OUTPUT_LEN]{};
|
case LOG_DEBUG: { // debug-level message
|
||||||
memset(buf, 0x00, sizeof(buf));
|
syslog(LOG_DEBUG, "%s", localMsg.toStdString().c_str());
|
||||||
QString const datetime = QDateTime::currentDateTime().toString(Qt::ISODateWithMs);
|
} break;
|
||||||
switch (type) {
|
case LOG_INFO: { // informational message
|
||||||
case QtDebugMsg: {
|
if (type != QtDebugMsg) {
|
||||||
if (debugLevel == QtDebugMsg) {
|
syslog(LOG_DEBUG, "%s", localMsg.toStdString().c_str());
|
||||||
snprintf(buf, sizeof(buf)-1, "%s DEBG [%s:%s:%04u] %s",
|
|
||||||
datetime.toStdString().c_str(),
|
|
||||||
function.toStdString().c_str(),
|
|
||||||
fileName.toStdString().c_str(),
|
|
||||||
context.line,
|
|
||||||
localMsg.constData());
|
|
||||||
fprintf(stderr, "%s\n", buf);
|
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case QtInfoMsg: {
|
case LOG_NOTICE: { // normal, but significant, condition
|
||||||
if (debugLevel == QtInfoMsg || debugLevel == QtDebugMsg) {
|
if (type != QtDebugMsg) {
|
||||||
snprintf(buf, sizeof(buf)-1, "%s DEBG [%s:%s:%04u] %s",
|
syslog(LOG_DEBUG, "%s", localMsg.toStdString().c_str());
|
||||||
datetime.toStdString().c_str(),
|
|
||||||
function.toStdString().c_str(),
|
|
||||||
fileName.toStdString().c_str(),
|
|
||||||
context.line,
|
|
||||||
localMsg.constData());
|
|
||||||
fprintf(stderr, "%s\n", buf);
|
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case QtWarningMsg: {
|
case LOG_WARNING: { // warning conditions
|
||||||
if (debugLevel == QtInfoMsg || debugLevel == QtDebugMsg || debugLevel == QtWarningMsg) {
|
if (type != QtInfoMsg && type != QtDebugMsg) {
|
||||||
snprintf(buf, sizeof(buf)-1, "%s DEBG [%s:%s:%04u] %s",
|
syslog(LOG_DEBUG, "%s", localMsg.toStdString().c_str());
|
||||||
datetime.toStdString().c_str(),
|
|
||||||
function.toStdString().c_str(),
|
|
||||||
fileName.toStdString().c_str(),
|
|
||||||
context.line,
|
|
||||||
localMsg.constData());
|
|
||||||
fprintf(stderr, "%s\n", buf);
|
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case QtCriticalMsg: {
|
case LOG_ERR: { // error conditions
|
||||||
if (debugLevel == QtInfoMsg || debugLevel == QtDebugMsg
|
if (type != QtInfoMsg && type != QtDebugMsg && type != QtWarningMsg) {
|
||||||
|| debugLevel == QtWarningMsg || debugLevel == QtCriticalMsg) {
|
syslog(LOG_DEBUG, "%s", localMsg.toStdString().c_str());
|
||||||
snprintf(buf, sizeof(buf)-1, "%s DEBG [%s:%s:%04u] %s",
|
|
||||||
datetime.toStdString().c_str(),
|
|
||||||
function.toStdString().c_str(),
|
|
||||||
fileName.toStdString().c_str(),
|
|
||||||
context.line,
|
|
||||||
localMsg.constData());
|
|
||||||
fprintf(stderr, "%s\n", buf);
|
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case QtFatalMsg: {
|
case LOG_CRIT: { // critical conditions
|
||||||
if (debugLevel == QtInfoMsg || debugLevel == QtDebugMsg
|
if (type != QtInfoMsg && type != QtDebugMsg && type != QtWarningMsg) {
|
||||||
|| debugLevel == QtWarningMsg || debugLevel == QtCriticalMsg
|
syslog(LOG_DEBUG, "%s", localMsg.toStdString().c_str());
|
||||||
|| debugLevel == QtFatalMsg) {
|
}
|
||||||
snprintf(buf, sizeof(buf)-1, "%s DEBG [%s:%s:%04u] %s",
|
} break;
|
||||||
datetime.toStdString().c_str(),
|
case LOG_ALERT: { // action must be taken immediately
|
||||||
function.toStdString().c_str(),
|
if (type != QtInfoMsg && type != QtDebugMsg && type != QtWarningMsg) {
|
||||||
fileName.toStdString().c_str(),
|
syslog(LOG_DEBUG, "%s", localMsg.toStdString().c_str());
|
||||||
context.line,
|
}
|
||||||
localMsg.constData());
|
} break;
|
||||||
fprintf(stderr, "%s\n", buf);
|
case LOG_EMERG: { // system is unusable
|
||||||
|
if (type != QtInfoMsg && type != QtDebugMsg && type != QtWarningMsg) {
|
||||||
|
syslog(LOG_DEBUG, "%s", localMsg.toStdString().c_str());
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
default: {
|
default: {
|
||||||
fprintf(stderr, "%s No ErrorLevel defined! %s\n",
|
//fprintf(stderr, "%s No ErrorLevel defined! %s\n",
|
||||||
datetime.toStdString().c_str(), msg.toStdString().c_str());
|
// datetime.toStdString().c_str(), msg.toStdString().c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2,9 +2,12 @@
|
|||||||
#define MESSAGE_HANDLER_H_INCLUDED
|
#define MESSAGE_HANDLER_H_INCLUDED
|
||||||
|
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
#ifdef __linux__
|
||||||
|
#include <syslog.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
QtMsgType getDebugLevel();
|
int getDebugLevel();
|
||||||
void setDebugLevel(QtMsgType newDebugLevel);
|
void setDebugLevel(int newDebugLevel);
|
||||||
|
|
||||||
bool messageHandlerInstalled();
|
bool messageHandlerInstalled();
|
||||||
QtMessageHandler atbInstallMessageHandler(QtMessageHandler handler);
|
QtMessageHandler atbInstallMessageHandler(QtMessageHandler handler);
|
||||||
|
@@ -128,13 +128,11 @@ struct T_vaultRecord
|
|||||||
uint32_t AbsReserve;
|
uint32_t AbsReserve;
|
||||||
uint32_t AbsNrOfCuts;
|
uint32_t AbsNrOfCuts;
|
||||||
|
|
||||||
//16
|
|
||||||
char label3buffer[4]; // mw >
|
char label3buffer[4]; // mw >
|
||||||
|
|
||||||
// Verkauf, Tuer zu:
|
// Verkauf, Tuer zu:
|
||||||
uint32_t VKcoinsInserted[16]; // nur fuer Wechsler, soviel wurde eingeworfen
|
uint32_t VKcoinsInserted[16]; // nur fuer Wechsler, soviel wurde eingeworfen
|
||||||
uint32_t VKcoinsReturned[6]; // nur fuer Wechsler, Anzahl Muenzen pro Typ, soviel wurde zurueckgegeben
|
uint32_t VKcoinsReturned[6]; // nur fuer Wechsler, Anzahl Muenzen pro Typ, soviel wurde zurueckgegeben
|
||||||
//88
|
|
||||||
|
|
||||||
// Service, Tuer offen:
|
// Service, Tuer offen:
|
||||||
uint16_t ServCoinsInserted[16]; // nur fuer Wechsler, soviel wurde eingeworfen
|
uint16_t ServCoinsInserted[16]; // nur fuer Wechsler, soviel wurde eingeworfen
|
||||||
@@ -144,12 +142,10 @@ struct T_vaultRecord
|
|||||||
uint16_t currentTubeContent[6]; // nur fuer Wechsler, aktueller Fuellstand
|
uint16_t currentTubeContent[6]; // nur fuer Wechsler, aktueller Fuellstand
|
||||||
uint16_t resint5;
|
uint16_t resint5;
|
||||||
uint16_t resint6;
|
uint16_t resint6;
|
||||||
// 56
|
|
||||||
|
|
||||||
char label4buffer[4]; // box>
|
char label4buffer[4]; // box>
|
||||||
uint16_t coinsInVault[16];
|
uint16_t coinsInVault[16];
|
||||||
uint16_t billsInStacker[8];
|
uint16_t billsInStacker[8];
|
||||||
// 48
|
|
||||||
|
|
||||||
char label5buffer[4]; // val>
|
char label5buffer[4]; // val>
|
||||||
// actually constant unless exchange rate is changed
|
// actually constant unless exchange rate is changed
|
||||||
@@ -159,11 +155,17 @@ struct T_vaultRecord
|
|||||||
uint16_t exchangeRate;
|
uint16_t exchangeRate;
|
||||||
uint16_t resint9;
|
uint16_t resint9;
|
||||||
|
|
||||||
// 64
|
// new from 1.8.23
|
||||||
|
uint32_t cutsSinceCBchange;
|
||||||
|
uint32_t CBcontent_cent;
|
||||||
|
uint32_t CBnrofCoins;
|
||||||
|
|
||||||
char endofblock[4]; // end>
|
char endofblock[4]; // end
|
||||||
|
// 332 bytes
|
||||||
|
|
||||||
// 316 byte Block im Speicher
|
uint16_t CRC16; // Xmodem16 from startbuffer[0] to endofblock[3]
|
||||||
|
uint16_t resint11;
|
||||||
|
char endofRecord[4]; // ----
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -317,7 +319,8 @@ struct T_devices
|
|||||||
UCHAR kindOfPrinter; // 0:off 1:Gebe
|
UCHAR kindOfPrinter; // 0:off 1:Gebe
|
||||||
UCHAR kindOfCoinChecker; // 0: without 1=EMP820 2=EMP900 3=currenza Csquare (MW)
|
UCHAR kindOfCoinChecker; // 0: without 1=EMP820 2=EMP900 3=currenza Csquare (MW)
|
||||||
UCHAR kindOfMifareReader; // by now only stronglink SL025 =1
|
UCHAR kindOfMifareReader; // by now only stronglink SL025 =1
|
||||||
UCHAR suppressSleepMode; // 0:sleep allowed 1: no sleep
|
UCHAR solarPower; // 1:sleep allowed 0: no sleep
|
||||||
|
//UCHAR suppressSleepMode; // 0:sleep allowed 1: no sleep
|
||||||
|
|
||||||
UCHAR kindOfModem; // 0:off 1:Sunlink
|
UCHAR kindOfModem; // 0:off 1:Sunlink
|
||||||
UCHAR kindOfCreditcard; // 0:off 1:Feig NFC
|
UCHAR kindOfCreditcard; // 0:off 1:Feig NFC
|
||||||
@@ -336,6 +339,8 @@ struct T_devices
|
|||||||
|
|
||||||
UINT VaultFullWarnLevel;
|
UINT VaultFullWarnLevel;
|
||||||
UINT VaultFullErrorLevel;
|
UINT VaultFullErrorLevel;
|
||||||
|
UINT BattEmptyWarnLevel;
|
||||||
|
UINT BattEmptyErrorLevel;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1151,14 +1156,13 @@ public:
|
|||||||
// to be forwarded to Ismas
|
// to be forwarded to Ismas
|
||||||
|
|
||||||
virtual bool prn_printAccountReceipt(void) const =0;
|
virtual bool prn_printAccountReceipt(void) const =0;
|
||||||
|
// print all 8 backuped accounting receipts
|
||||||
// return true if sending to DC OK, false if cmd-stack is full
|
// return true if sending to DC OK, false if cmd-stack is full
|
||||||
|
|
||||||
virtual bool prn_printTestTicket(void) const =0;
|
virtual bool prn_printTestTicket(void) const =0;
|
||||||
// return true if sending to DC OK, false if cmd-stack is full
|
// return true if sending to DC OK, false if cmd-stack is full
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
virtual bool cash_startPayment(uint32_t amount) const =0;
|
virtual bool cash_startPayment(uint32_t amount) const =0;
|
||||||
// 17.4.23TS: extended to 32bit
|
// 17.4.23TS: extended to 32bit
|
||||||
|
|
||||||
@@ -1273,7 +1277,7 @@ public:
|
|||||||
|
|
||||||
virtual uint16_t log_getLatestAccountNumber(void) const=0;
|
virtual uint16_t log_getLatestAccountNumber(void) const=0;
|
||||||
// new function 27.6.2023
|
// new function 27.6.2023
|
||||||
// latest = highest
|
// latest = highest of the backup's
|
||||||
|
|
||||||
virtual uint8_t log_getAvailableVaultBlocks(void) const=0;
|
virtual uint8_t log_getAvailableVaultBlocks(void) const=0;
|
||||||
// return 0x0011 1111 if all 6 blocks are loaded (one bit per block)
|
// return 0x0011 1111 if all 6 blocks are loaded (one bit per block)
|
||||||
@@ -1297,7 +1301,45 @@ public:
|
|||||||
// 2: done and error
|
// 2: done and error
|
||||||
|
|
||||||
virtual bool log_getVaultData(uint8_t *data) const =0;
|
virtual bool log_getVaultData(uint8_t *data) const =0;
|
||||||
// get vault record in linear 8bit buffer with 320 byte
|
// get vault record in linear 8bit buffer with 384 byte
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// new from 1.8.23
|
||||||
|
virtual bool prn_printOneAccountReceipt(uint16_t accountNr) const =0;
|
||||||
|
// print one out of eight stored last accounting receipts
|
||||||
|
// function log_getHoldAccountNumbers() gives a list of acc-Nr. of the stored receipts
|
||||||
|
|
||||||
|
virtual bool prn_printAllAvailAccountReceipts(void) const =0;
|
||||||
|
// same as: prn_printAccountReceipt() from line 1153
|
||||||
|
// return true if sending to DC OK, false if cmd-stack is full
|
||||||
|
|
||||||
|
virtual bool log_verifyVaultRecordByCrc(void) const =0;
|
||||||
|
// return true if CRC16 is correct, data are 100% OK. Security level 1:65536
|
||||||
|
// verification is strongly recommended before further processing
|
||||||
|
// in case of "false"-result please reload from DC
|
||||||
|
|
||||||
|
|
||||||
|
virtual uint16_t log_DC_getNextAccountNumber(void) const=0;
|
||||||
|
// the current cash box content will be backuped with this number on next cashbox-change
|
||||||
|
|
||||||
|
virtual void log_DC_setNextAccountNumber(uint16_t newAccountingNumber) const=0;
|
||||||
|
// the current cash box content will be backuped with this number on next cashbox-change
|
||||||
|
// use only in case of hardware replacements or errors which derailed the number
|
||||||
|
|
||||||
|
virtual void log_DC_deleteAllVaultrecordsInDc(void) const=0;
|
||||||
|
// use only in case of hardware replacements or errors which derailed the number
|
||||||
|
|
||||||
|
virtual void log_DC_deleteAllTotalCounters(void) const=0;
|
||||||
|
// use only in case of hardware replacements or errors which derailed the number
|
||||||
|
|
||||||
|
virtual void dc_setNewCustomerNumber(uint16_t newCustNr) const =0;
|
||||||
|
|
||||||
|
virtual void dc_setNewMachineNumber(uint16_t newMachNr) const =0;
|
||||||
|
|
||||||
|
virtual void dc_setNewBorough(uint16_t newBorough) const =0;
|
||||||
|
|
||||||
|
virtual void dc_setNewZone(uint16_t newZone) const =0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1356,6 +1398,10 @@ signals:
|
|||||||
// 15.06.2023 V4.2 bring into same order as hwapi in order to set the THIS_IS_CA_MASTER correct
|
// 15.06.2023 V4.2 bring into same order as hwapi in order to set the THIS_IS_CA_MASTER correct
|
||||||
// 19.06.2023 V4.3 added some qCriticals to see emits
|
// 19.06.2023 V4.3 added some qCriticals to see emits
|
||||||
|
|
||||||
|
// 01.08.2023 V4.4 some new values at the end of struct T_vaultRecord
|
||||||
|
// two more values in struct T_devices
|
||||||
|
// 7 new functions at the end of the file
|
||||||
|
|
||||||
|
|
||||||
//#define HWINF_iid "Atb.Psa2020.software.HWapi/3.1"
|
//#define HWINF_iid "Atb.Psa2020.software.HWapi/3.1"
|
||||||
//#define HWINF_iid "Atb.Psa1256ptu5.software.HWapi/3.1"
|
//#define HWINF_iid "Atb.Psa1256ptu5.software.HWapi/3.1"
|
||||||
@@ -1366,7 +1412,8 @@ signals:
|
|||||||
//#define HWINF_iid "Atb.Psa1256ptu5.software.HWapi/4.0"
|
//#define HWINF_iid "Atb.Psa1256ptu5.software.HWapi/4.0"
|
||||||
//#define HWINF_iid "Atb.Psa1256ptu5.software.HWapi/4.1"
|
//#define HWINF_iid "Atb.Psa1256ptu5.software.HWapi/4.1"
|
||||||
//#define HWINF_iid "Atb.Psa1256ptu5.software.HWapi/4.2"
|
//#define HWINF_iid "Atb.Psa1256ptu5.software.HWapi/4.2"
|
||||||
#define HWINF_iid "Atb.Psa1256ptu5.software.HWapi/4.3"
|
//#define HWINF_iid "Atb.Psa1256ptu5.software.HWapi/4.3"
|
||||||
|
#define HWINF_iid "Atb.Psa1256ptu5.software.HWapi/4.4"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -62,10 +62,11 @@ bool Command::execute(QString workingDirectory, QStringList args) {
|
|||||||
if (p->waitForFinished(m_waitForFinishTimeout)) {
|
if (p->waitForFinished(m_waitForFinishTimeout)) {
|
||||||
//qDebug() << "PROCESS" << m_command << "FINISHED";
|
//qDebug() << "PROCESS" << m_command << "FINISHED";
|
||||||
if (p->exitStatus() == QProcess::NormalExit) {
|
if (p->exitStatus() == QProcess::NormalExit) {
|
||||||
//qInfo() << "EXECUTED" << m_command
|
if (p->exitCode() == 0) {
|
||||||
// << "with code" << p->exitCode();
|
return true;
|
||||||
// qInfo() << "RESULT" << m_commandResult;
|
} else {
|
||||||
return true;
|
qCritical() << "EXECUTED" << m_command << "with code" << p->exitCode();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
qCritical() << "PROCESS" << m_command << "CRASHED with code"
|
qCritical() << "PROCESS" << m_command << "CRASHED with code"
|
||||||
<< p->exitCode();
|
<< p->exitCode();
|
||||||
|
20
progress_event.cpp
Normal file
20
progress_event.cpp
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
#include "progress_event.h"
|
||||||
|
|
||||||
|
QEvent::Type ProgressEvent::customEventType = QEvent::None;
|
||||||
|
|
||||||
|
ProgressEvent::ProgressEvent(QObject const *sender, int progressPercent)
|
||||||
|
: QEvent(ProgressEvent::type())
|
||||||
|
, m_sender(sender)
|
||||||
|
, m_progressPercent(progressPercent) {
|
||||||
|
}
|
||||||
|
|
||||||
|
ProgressEvent::~ProgressEvent() {
|
||||||
|
}
|
||||||
|
|
||||||
|
QEvent::Type ProgressEvent::type() {
|
||||||
|
if (customEventType == QEvent::None) {
|
||||||
|
int generatedType = QEvent::registerEventType();
|
||||||
|
customEventType = static_cast<QEvent::Type>(generatedType);
|
||||||
|
}
|
||||||
|
return customEventType;
|
||||||
|
}
|
26
progress_event.h
Normal file
26
progress_event.h
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
#ifndef PROGRESS_EVENT_H_INCLUDED
|
||||||
|
#define PROGRESS_EVENT_H_INCLUDED
|
||||||
|
|
||||||
|
#include <QEvent>
|
||||||
|
|
||||||
|
class ProgressEvent : public QEvent {
|
||||||
|
|
||||||
|
QObject const *m_sender;
|
||||||
|
int m_progressPercent;
|
||||||
|
public:
|
||||||
|
explicit ProgressEvent(QObject const *sender, int progressPercent);
|
||||||
|
virtual ~ProgressEvent();
|
||||||
|
static QEvent::Type type();
|
||||||
|
|
||||||
|
QObject const *sender() { return m_sender; }
|
||||||
|
QObject const *sender() const { return m_sender; }
|
||||||
|
|
||||||
|
void setProgress(int progressPercent) { m_progressPercent = progressPercent; }
|
||||||
|
int progressPercent() { return m_progressPercent; }
|
||||||
|
int progressPercent() const { return m_progressPercent; }
|
||||||
|
private:
|
||||||
|
static QEvent::Type customEventType;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif // PROGRESS_EVENT_H_INCLUDED
|
73
update.cpp
73
update.cpp
@@ -8,6 +8,7 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
|
#include <QRegExp>
|
||||||
|
|
||||||
//#include <iostream>
|
//#include <iostream>
|
||||||
//#include <fstream>
|
//#include <fstream>
|
||||||
@@ -350,21 +351,25 @@ bool Update::downloadBinaryToDC(QString const &bFile) const {
|
|||||||
10 : bl_stopBL() // leave bl and start (the new) application
|
10 : bl_stopBL() // leave bl and start (the new) application
|
||||||
*/
|
*/
|
||||||
bool Update::updateBinary(char const *fileToSendToDC) {
|
bool Update::updateBinary(char const *fileToSendToDC) {
|
||||||
qInfo() << "updating device controller binary" << fileToSendToDC;
|
qInfo() << "UPDATING DEVICE CONTROLLER BINARY" << fileToSendToDC;
|
||||||
QFile fn(fileToSendToDC);
|
QFile fn(fileToSendToDC);
|
||||||
bool r;
|
bool r;
|
||||||
if ((r = fn.exists()) == true) {
|
if ((r = fn.exists()) == true) {
|
||||||
QString const linkTarget = fn.symLinkTarget();
|
QFileInfo fi(fn);
|
||||||
QFileInfo fi(linkTarget);
|
qInfo() << " UPDATING BINARY" << fi.fileName() << "(size=" << fi.size() << ")";
|
||||||
qInfo() << " updating binary (size=" << linkTarget << fi.size() << ")";
|
if ((r = updateDC(fileToSendToDC)) == true) {
|
||||||
if ((r = updateDC(linkTarget)) == true) {
|
qCritical() << QString(80, '*');
|
||||||
qInfo() << " updating binary (size=" << linkTarget << fi.size() << ") done";
|
qInfo() << " UPDATING BINARY" << fi.fileName() << "(size=" << fi.size() << ") DONE";
|
||||||
|
qCritical() << QString(80, '*');
|
||||||
} else {
|
} else {
|
||||||
qCritical() << "updating binary (size=" << linkTarget << fi.size() << ")... FAILED";
|
qCritical() << QString(80, '*');
|
||||||
|
qCritical() << " UPDATING BINARY" << fi.fileName() << "(size=" << fi.size() << ") FAILED";
|
||||||
|
qCritical() << QString(80, '*');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
qCritical() << "symlink" << fileToSendToDC
|
qCritical() << QString(80, '*');
|
||||||
<< "does not exist -> NO UPDATE OF DC FIRMWARE";
|
qCritical() << fileToSendToDC << "does not exist -> NO UPDATE OF DC FIRMWARE";
|
||||||
|
qCritical() << QString(80, '*');
|
||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
@@ -514,7 +519,6 @@ void Update::finished(int /*exitCode*/, QProcess::ExitStatus /*exitStatus*/) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Update::doUpdate(int &displayIndex, QStringList const &filesToWorkOn) {
|
bool Update::doUpdate(int &displayIndex, QStringList const &filesToWorkOn) {
|
||||||
|
|
||||||
//
|
//
|
||||||
// ACHTUNG !!!
|
// ACHTUNG !!!
|
||||||
//
|
//
|
||||||
@@ -523,11 +527,6 @@ bool Update::doUpdate(int &displayIndex, QStringList const &filesToWorkOn) {
|
|||||||
bool serialOpened = false;
|
bool serialOpened = false;
|
||||||
bool serialOpen = false;
|
bool serialOpen = false;
|
||||||
|
|
||||||
if (filesToWorkOn.size() == 0) {
|
|
||||||
qCritical() << "NOTHING TO UPDATE";
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!serialOpen) {
|
if (!serialOpen) {
|
||||||
if (!isSerialOpen()) { // open serial only if not already open
|
if (!isSerialOpen()) { // open serial only if not already open
|
||||||
if ((serialOpened = openSerial(baudrateMap.value(m_baudrate), m_baudrate, m_serialInterface)) == false) {
|
if ((serialOpened = openSerial(baudrateMap.value(m_baudrate), m_baudrate, m_serialInterface)) == false) {
|
||||||
@@ -537,18 +536,23 @@ bool Update::doUpdate(int &displayIndex, QStringList const &filesToWorkOn) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
serialOpen = true;
|
serialOpen = true;
|
||||||
qCritical() << "SERIAL OPEN" << m_serialInterface << "(BAUDRATE=" << m_baudrate << ")";
|
qInfo() << "SERIAL OPEN" << m_serialInterface << "(BAUDRATE=" << m_baudrate << ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool res = false;
|
||||||
QList<QString>::const_iterator it;
|
QList<QString>::const_iterator it;
|
||||||
for (it = filesToWorkOn.cbegin(); it != filesToWorkOn.cend(); ++it) {
|
for (it = filesToWorkOn.cbegin(); it != filesToWorkOn.cend(); ++it) {
|
||||||
bool res = false;
|
m_worker->startProgressLoop();
|
||||||
QString fToWorkOn = (*it).trimmed();
|
QString fToWorkOn = (*it).trimmed();
|
||||||
|
fToWorkOn = QDir::cleanPath(m_customerRepository + QDir::separator() + fToWorkOn);
|
||||||
|
|
||||||
if (fToWorkOn.contains("dc2c", Qt::CaseInsensitive) &&
|
static const QRegularExpression version("^.*dc2c[.][0-9][0-9][.][0-9][0-9][.]bin.*$");
|
||||||
fToWorkOn.endsWith(".bin", Qt::CaseInsensitive)) {
|
if (fToWorkOn.contains(version)) {
|
||||||
|
|
||||||
|
qInfo() << QString(80, '*');
|
||||||
|
qInfo() << "DO-UPDATE FILE-TO-WORK-ON" << fToWorkOn;
|
||||||
|
qInfo() << QString(80, '*');
|
||||||
|
|
||||||
qDebug() << "sending sw/hw-requests...";
|
|
||||||
for (int i=0; i < 3; ++i) { // send explicit reuests to get
|
for (int i=0; i < 3; ++i) { // send explicit reuests to get
|
||||||
// current SW/HW-versions
|
// current SW/HW-versions
|
||||||
m_hw->request_DC2_SWversion();
|
m_hw->request_DC2_SWversion();
|
||||||
@@ -558,12 +562,16 @@ bool Update::doUpdate(int &displayIndex, QStringList const &filesToWorkOn) {
|
|||||||
|
|
||||||
QString const hwVersion = m_hw->dc_getHWversion().toLower();
|
QString const hwVersion = m_hw->dc_getHWversion().toLower();
|
||||||
QString const fwVersion = m_hw->dc_getSWversion().toLower();
|
QString const fwVersion = m_hw->dc_getSWversion().toLower();
|
||||||
|
|
||||||
qInfo() << "current dc-hardware-version" << hwVersion;
|
qInfo() << "current dc-hardware-version" << hwVersion;
|
||||||
qInfo() << "current dc-firmware-version" << fwVersion;
|
qInfo() << "current dc-firmware-version" << fwVersion;
|
||||||
|
|
||||||
QFile fn(fToWorkOn);
|
QFile fn(fToWorkOn);
|
||||||
QFileInfo linkTarget(fn.symLinkTarget());
|
QFileInfo finfo(fn);
|
||||||
if (!linkTarget.exists()) { // check for broken link
|
if (!fn.exists()) { // check for broken link
|
||||||
|
qCritical() << QString(80, '*');
|
||||||
|
qCritical() << "FILE-TO-WORK-ON" << fn << "DOES NOT EXIST";
|
||||||
|
qCritical() << QString(80, '*');
|
||||||
res = false;
|
res = false;
|
||||||
} else {
|
} else {
|
||||||
if (false) {
|
if (false) {
|
||||||
@@ -574,13 +582,12 @@ bool Update::doUpdate(int &displayIndex, QStringList const &filesToWorkOn) {
|
|||||||
} else {
|
} else {
|
||||||
res = true;
|
res = true;
|
||||||
|
|
||||||
qCritical() << "downloading" << fToWorkOn.trimmed() << "->"
|
qInfo() << "DOWNLOADING" << finfo.completeBaseName() << "TO DC";
|
||||||
<< linkTarget.completeBaseName() << "to DC";
|
|
||||||
#if UPDATE_DC == 1
|
#if UPDATE_DC == 1
|
||||||
m_hw->dc_autoRequest(false);// default: turn auto-request setting off
|
m_hw->dc_autoRequest(false);// default: turn auto-request setting off
|
||||||
QThread::sleep(1); // wait to be sure that there are no more
|
QThread::sleep(1); // wait to be sure that there are no more
|
||||||
// commands sent to dc-hardware
|
// commands sent to dc-hardware
|
||||||
qDebug() << "SET AUTO-REQUEST=FALSE";
|
qInfo() << "SET AUTO-REQUEST=FALSE";
|
||||||
|
|
||||||
if ((res = updateBinary(fToWorkOn.toStdString().c_str())) == true) {
|
if ((res = updateBinary(fToWorkOn.toStdString().c_str())) == true) {
|
||||||
qCritical() << "downloaded binary" << fToWorkOn;
|
qCritical() << "downloaded binary" << fToWorkOn;
|
||||||
@@ -591,13 +598,13 @@ bool Update::doUpdate(int &displayIndex, QStringList const &filesToWorkOn) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_hw->dc_autoRequest(true); // turn auto-request setting on
|
m_hw->dc_autoRequest(true); // turn auto-request setting on
|
||||||
qDebug() << "SET AUTO-REQUEST=TRUE";
|
qInfo() << "SET AUTO-REQUEST=TRUE";
|
||||||
qDebug() << "WAIT 10 SECS TO RECEIVE RESPONSES...";
|
qInfo() << "WAIT 10 SECS TO RECEIVE RESPONSES...";
|
||||||
|
|
||||||
QThread::sleep(10); // wait to be sure that responses
|
QThread::sleep(10); // wait to be sure that responses
|
||||||
// have been received
|
// have been received
|
||||||
qCritical() << "updated dc-hardware-version" << m_hw->dc_getHWversion();
|
qInfo() << "updated dc-hardware-version" << m_hw->dc_getHWversion();
|
||||||
qCritical() << "updated dc-firmware-version" << m_hw->dc_getSWversion();
|
qInfo() << "updated dc-firmware-version" << m_hw->dc_getSWversion();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -660,10 +667,16 @@ bool Update::doUpdate(int &displayIndex, QStringList const &filesToWorkOn) {
|
|||||||
qCritical() << "UNKNOWN JSON FILE NAME" << fToWorkOn;
|
qCritical() << "UNKNOWN JSON FILE NAME" << fToWorkOn;
|
||||||
res = false;
|
res = false;
|
||||||
}
|
}
|
||||||
|
m_worker->stopProgressLoop();
|
||||||
|
m_worker->setProgress(100);
|
||||||
|
|
||||||
|
if (res == false) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
} // for (it = openLines.cbegin(); it != openLines.end(); ++it) {
|
} // for (it = openLines.cbegin(); it != openLines.end(); ++it) {
|
||||||
|
|
||||||
m_hw->dc_autoRequest(true); // ALWAYS turn autoRequest ON
|
m_hw->dc_autoRequest(true); // ALWAYS turn autoRequest ON
|
||||||
qDebug() << "SET AUTO-REQUEST=TRUE";
|
qDebug() << "SET AUTO-REQUEST=TRUE";
|
||||||
|
|
||||||
return true;
|
return res;
|
||||||
}
|
}
|
||||||
|
46
utils.cpp
46
utils.cpp
@@ -1,8 +1,9 @@
|
|||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
#include "message_handler.h"
|
||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
int Utils::read1stLineOfFile(QString fileName) {
|
int Utils::read1stLineOfFile(QString fileName) {
|
||||||
QFile f(fileName);
|
QFile f(fileName);
|
||||||
@@ -33,3 +34,46 @@ QString Utils::zoneName(quint8 i) {
|
|||||||
}
|
}
|
||||||
return "N/A";
|
return "N/A";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Utils::printCriticalErrorMsg(QString const &errorMsg) {
|
||||||
|
qCritical() << QString(80, '!');
|
||||||
|
qCritical() << errorMsg;
|
||||||
|
qCritical() << QString(80, '!');
|
||||||
|
}
|
||||||
|
|
||||||
|
void Utils::printInfoMsg(QString const &infoMsg) {
|
||||||
|
qCritical() << QString(80, '=');
|
||||||
|
qCritical() << infoMsg;
|
||||||
|
qCritical() << QString(80, '=');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void Utils::printLineEditInfo(QStringList const &lines) {
|
||||||
|
if (getDebugLevel() == LOG_DEBUG) {
|
||||||
|
for (int i=0; i<lines.size(); ++i) {
|
||||||
|
qInfo() << lines.at(i);
|
||||||
|
} qInfo() << ""; qInfo() << "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QString Utils::getTariffLoadTime(QString fileName) {
|
||||||
|
QFileInfo fInfo(fileName);
|
||||||
|
if (fInfo.exists()) {
|
||||||
|
QDateTime lastModifiedTime = fInfo.lastModified();
|
||||||
|
if (lastModifiedTime.isValid()) {
|
||||||
|
return lastModifiedTime.toString(Qt::ISODateWithMs);
|
||||||
|
} else {
|
||||||
|
printCriticalErrorMsg(fileName + " HAS INVALID MODIFIED-TIME");
|
||||||
|
QDateTime birthTime = fInfo.birthTime();
|
||||||
|
if (birthTime.isValid()) {
|
||||||
|
return birthTime.toString(Qt::ISODateWithMs);
|
||||||
|
} else {
|
||||||
|
printCriticalErrorMsg(fileName + " HAS INVALID BIRTH-TIME");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
printCriticalErrorMsg(fileName + " DOES NOT EXIST");
|
||||||
|
}
|
||||||
|
return "N/A";
|
||||||
|
}
|
||||||
|
|
||||||
|
7
utils.h
7
utils.h
@@ -3,11 +3,18 @@
|
|||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
#include <QStringList>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
#include <QFileInfo>
|
||||||
|
#include <QDateTime>
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
int read1stLineOfFile(QString fileName);
|
int read1stLineOfFile(QString fileName);
|
||||||
QString zoneName(quint8 i);
|
QString zoneName(quint8 i);
|
||||||
|
void printCriticalErrorMsg(QString const &errorMsg);
|
||||||
|
void printInfoMsg(QString const &infoMsg);
|
||||||
|
void printLineEditInfo(QStringList const &lines);
|
||||||
|
QString getTariffLoadTime(QString fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // UTILS_H_INCLUDED
|
#endif // UTILS_H_INCLUDED
|
||||||
|
848
worker.cpp
848
worker.cpp
File diff suppressed because it is too large
Load Diff
30
worker.h
30
worker.h
@@ -32,6 +32,9 @@ enum class UPDATE_STATUS : quint8 {
|
|||||||
ISMAS_WAIT_STATE_CHECK_SUCCESS,
|
ISMAS_WAIT_STATE_CHECK_SUCCESS,
|
||||||
ISMAS_RESPONSE_RECEIVED,
|
ISMAS_RESPONSE_RECEIVED,
|
||||||
BACKEND_CONNECTED,
|
BACKEND_CONNECTED,
|
||||||
|
BACKEND_CHECK,
|
||||||
|
BACKEND_CHECK_FAILURE,
|
||||||
|
ISMAS_BACKEND_CHECK_FAILURE,
|
||||||
BACKEND_NOT_CONNECTED,
|
BACKEND_NOT_CONNECTED,
|
||||||
UPDATE_TRIGGER_SET,
|
UPDATE_TRIGGER_SET,
|
||||||
UPDATE_TRIGGER_NOT_SET_OR_WRONG,
|
UPDATE_TRIGGER_NOT_SET_OR_WRONG,
|
||||||
@@ -59,6 +62,7 @@ enum class UPDATE_STATUS : quint8 {
|
|||||||
DEVICE_CONTROLLER_UPDATE_SUCCESS,
|
DEVICE_CONTROLLER_UPDATE_SUCCESS,
|
||||||
JSON_UPDATE,
|
JSON_UPDATE,
|
||||||
JSON_UPDATE_FAILURE,
|
JSON_UPDATE_FAILURE,
|
||||||
|
JSON_PARSE_FAILURE,
|
||||||
JSON_UPDATE_SUCCESS,
|
JSON_UPDATE_SUCCESS,
|
||||||
UPDATE_PROCESS_SUCCESS,
|
UPDATE_PROCESS_SUCCESS,
|
||||||
UPDATE_PROCESS_FAILURE,
|
UPDATE_PROCESS_FAILURE,
|
||||||
@@ -67,7 +71,13 @@ enum class UPDATE_STATUS : quint8 {
|
|||||||
ISMAS_UPDATE_INFO_CONFIRM_SUCCESS,
|
ISMAS_UPDATE_INFO_CONFIRM_SUCCESS,
|
||||||
ISMAS_CURRENT_PSA_STATUS_CONFIRM,
|
ISMAS_CURRENT_PSA_STATUS_CONFIRM,
|
||||||
ISMAS_CURRENT_PSA_STATUS_CONFIRM_FAILURE,
|
ISMAS_CURRENT_PSA_STATUS_CONFIRM_FAILURE,
|
||||||
ISMAS_CURRENT_PSA_STATUS_CONFIRM_SUCCESS
|
ISMAS_CURRENT_PSA_STATUS_CONFIRM_SUCCESS,
|
||||||
|
ISMAS_SANITY_CHECK_OK,
|
||||||
|
ISMAS_UPDATE_TRIGGER_SET_FAILURE,
|
||||||
|
PSA_UPDATE_FILES_FAILED,
|
||||||
|
GIT_CHECK_FILES_TO_UPDATE_SUCCESS,
|
||||||
|
ISMAS_SEND_LAST_VERSION_FAILED,
|
||||||
|
SAVE_LOG_FILES_FAILED
|
||||||
};
|
};
|
||||||
|
|
||||||
struct UpdateStatus {
|
struct UpdateStatus {
|
||||||
@@ -84,6 +94,7 @@ QString& operator<<(QString &str, UpdateStatus status);
|
|||||||
|
|
||||||
#define ISMAS_UPDATE_REQUESTS (10)
|
#define ISMAS_UPDATE_REQUESTS (10)
|
||||||
|
|
||||||
|
class MainWindow;
|
||||||
class hwinf;
|
class hwinf;
|
||||||
class Worker : public QObject {
|
class Worker : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -122,6 +133,11 @@ class Worker : public QObject {
|
|||||||
QStringList m_filesToUpdate;
|
QStringList m_filesToUpdate;
|
||||||
bool m_updateProcessRunning;
|
bool m_updateProcessRunning;
|
||||||
int m_displayIndex;
|
int m_displayIndex;
|
||||||
|
int m_returnCode;
|
||||||
|
|
||||||
|
MainWindow *m_mainWindow;
|
||||||
|
int m_progressValue;
|
||||||
|
bool m_withoutIsmasDirectPort;
|
||||||
|
|
||||||
bool executeOpkgCommand(QString opkgCommand);
|
bool executeOpkgCommand(QString opkgCommand);
|
||||||
QString getOsVersion() const;
|
QString getOsVersion() const;
|
||||||
@@ -152,10 +168,16 @@ public:
|
|||||||
char const *baudrate = "115200");
|
char const *baudrate = "115200");
|
||||||
~Worker();
|
~Worker();
|
||||||
|
|
||||||
|
void setMainWindow(MainWindow *mainWindow) { m_mainWindow = mainWindow; }
|
||||||
|
void setProgress(int progress);
|
||||||
|
void startProgressLoop();
|
||||||
|
void stopProgressLoop();
|
||||||
|
|
||||||
IsmasClient &getIsmasClient() { return m_ismasClient; }
|
IsmasClient &getIsmasClient() { return m_ismasClient; }
|
||||||
IsmasClient const &getIsmasClient() const { return m_ismasClient; }
|
IsmasClient const &getIsmasClient() const { return m_ismasClient; }
|
||||||
|
|
||||||
bool updateProcessRunning() const { return m_updateProcessRunning; }
|
bool updateProcessRunning() const { return m_updateProcessRunning; }
|
||||||
|
int returnCode() const { return m_returnCode; }
|
||||||
|
|
||||||
int machineNr() const { return m_machineNr; }
|
int machineNr() const { return m_machineNr; }
|
||||||
int customerNr() const { return m_customerNr; }
|
int customerNr() const { return m_customerNr; }
|
||||||
@@ -171,11 +193,13 @@ public:
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void appendText(QString, QString);
|
void appendText(QString, QString suffix = "");
|
||||||
|
void replaceLast(QString, QString);
|
||||||
void showErrorMessage(QString title, QString description);
|
void showErrorMessage(QString title, QString description);
|
||||||
void setProgress(quint8);
|
|
||||||
void stopStartTimer();
|
void stopStartTimer();
|
||||||
void restartExitTimer();
|
void restartExitTimer();
|
||||||
|
void enableExit();
|
||||||
|
void disableExit();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void update();
|
void update();
|
||||||
|
Reference in New Issue
Block a user