Compare commits
7 Commits
4e7ce2cd70
...
4b9dcc5e99
Author | SHA1 | Date | |
---|---|---|---|
4b9dcc5e99 | |||
53639b55c9 | |||
3a83efbd3f | |||
c9d6a8d245 | |||
91db59b9f3 | |||
1d81e6b650 | |||
6d57b45d1a |
@ -34,6 +34,7 @@ DEFINES += QT_DEPRECATED_WARNINGS
|
|||||||
# too small when updating apism.
|
# too small when updating apism.
|
||||||
# Fix display of UPDATE_SUCCESS when opkg_command fails. Detected when
|
# Fix display of UPDATE_SUCCESS when opkg_command fails. Detected when
|
||||||
# updating apsim failed.
|
# updating apsim failed.
|
||||||
|
# 1.3.11: Integrate version of ATBUpdateTool in SendLastVersion-ISMAS-message.
|
||||||
|
|
||||||
win32 {
|
win32 {
|
||||||
BUILD_DATE=$$system("date /t")
|
BUILD_DATE=$$system("date /t")
|
||||||
@ -43,7 +44,10 @@ win32 {
|
|||||||
BUILD_TIME=$$system("date +%H:%M:%S")
|
BUILD_TIME=$$system("date +%H:%M:%S")
|
||||||
}
|
}
|
||||||
|
|
||||||
VERSION="1.3.10"
|
GIT_COMMIT=$$system("git log -1 --format=oneline | cut -d' ' -f1")
|
||||||
|
|
||||||
|
VERSION="1.3.11"
|
||||||
|
EXTENDED_VERSION="$${VERSION}-$${GIT_COMMIT}"
|
||||||
|
|
||||||
INCLUDEPATH += plugins
|
INCLUDEPATH += plugins
|
||||||
|
|
||||||
@ -53,6 +57,7 @@ CONFIG += c++17
|
|||||||
DEFINES+=APP_VERSION=\\\"$$VERSION\\\"
|
DEFINES+=APP_VERSION=\\\"$$VERSION\\\"
|
||||||
DEFINES+=APP_BUILD_DATE=\\\"$$BUILD_DATE\\\"
|
DEFINES+=APP_BUILD_DATE=\\\"$$BUILD_DATE\\\"
|
||||||
DEFINES+=APP_BUILD_TIME=\\\"$$BUILD_TIME\\\"
|
DEFINES+=APP_BUILD_TIME=\\\"$$BUILD_TIME\\\"
|
||||||
|
DEFINES+=APP_EXTENDED_VERSION=\\\"$$EXTENDED_VERSION\\\"
|
||||||
|
|
||||||
QMAKE_CXXFLAGS += -g
|
QMAKE_CXXFLAGS += -g
|
||||||
QMAKE_CXXFLAGS += -Wno-deprecated-copy
|
QMAKE_CXXFLAGS += -Wno-deprecated-copy
|
||||||
|
@ -631,6 +631,9 @@ QString IsmasClient::updateOfPSASendVersion(PSAInstalled const &psa) {
|
|||||||
"},"
|
"},"
|
||||||
"\"ATBQT\" : {"
|
"\"ATBQT\" : {"
|
||||||
"\"VERSION\" : \"%s\""
|
"\"VERSION\" : \"%s\""
|
||||||
|
"},"
|
||||||
|
"\"ATB-UPDATE-TOOL\" : {"
|
||||||
|
"\"VERSION\" : \"%s\""
|
||||||
"}"
|
"}"
|
||||||
"},"
|
"},"
|
||||||
"\"PLUGINS\" : {"
|
"\"PLUGINS\" : {"
|
||||||
@ -758,6 +761,7 @@ QString IsmasClient::updateOfPSASendVersion(PSAInstalled const &psa) {
|
|||||||
|
|
||||||
psa.sw.apismVersion.toStdString().c_str(),
|
psa.sw.apismVersion.toStdString().c_str(),
|
||||||
psa.sw.atbQTVersion.toStdString().c_str(),
|
psa.sw.atbQTVersion.toStdString().c_str(),
|
||||||
|
psa.sw.atbUpdateToolVersion.toStdString().c_str(),
|
||||||
|
|
||||||
psa.pluginVersion.deviceController.toStdString().c_str(),
|
psa.pluginVersion.deviceController.toStdString().c_str(),
|
||||||
psa.pluginVersion.ingenicoISelfCC.toStdString().c_str(),
|
psa.pluginVersion.ingenicoISelfCC.toStdString().c_str(),
|
||||||
|
@ -48,6 +48,7 @@ struct PSAInstalled {
|
|||||||
struct SoftWare {
|
struct SoftWare {
|
||||||
QString apismVersion;
|
QString apismVersion;
|
||||||
QString atbQTVersion;
|
QString atbQTVersion;
|
||||||
|
QString atbUpdateToolVersion;
|
||||||
} sw;
|
} sw;
|
||||||
|
|
||||||
struct PluginVersion {
|
struct PluginVersion {
|
||||||
@ -98,6 +99,7 @@ struct PSAInstalled {
|
|||||||
|
|
||||||
sw.apismVersion = "N/A";
|
sw.apismVersion = "N/A";
|
||||||
sw.atbQTVersion = "N/A";
|
sw.atbQTVersion = "N/A";
|
||||||
|
sw.atbUpdateToolVersion = "N/A";
|
||||||
|
|
||||||
pluginVersion.deviceController = "N/A";
|
pluginVersion.deviceController = "N/A";
|
||||||
pluginVersion.ingenicoISelfCC = "N/A";
|
pluginVersion.ingenicoISelfCC = "N/A";
|
||||||
|
12
main.cpp
12
main.cpp
@ -112,14 +112,24 @@ int main(int argc, char *argv[]) {
|
|||||||
QCoreApplication::translate("main", "Start ATBUpdateTool in dry-run-mode. No actual actions."));
|
QCoreApplication::translate("main", "Start ATBUpdateTool in dry-run-mode. No actual actions."));
|
||||||
parser.addOption(dryRunOption);
|
parser.addOption(dryRunOption);
|
||||||
|
|
||||||
|
QCommandLineOption extendedVersionOption(QStringList() << "V" << "extended-version",
|
||||||
|
QCoreApplication::translate("main", "Show extended version (including last git commit)."));
|
||||||
|
parser.addOption(extendedVersionOption);
|
||||||
|
|
||||||
// Process the actual command line arguments given by the user
|
// Process the actual command line arguments given by the user
|
||||||
parser.process(a);
|
parser.process(a);
|
||||||
QString plugInDir = parser.value(pluginDirectoryOption);
|
QString plugInDir = parser.value(pluginDirectoryOption);
|
||||||
QString plugInName = parser.value(pluginNameOption);
|
QString plugInName = parser.value(pluginNameOption);
|
||||||
QString workingDir = parser.value(workingDirectoryOption);
|
QString workingDir = parser.value(workingDirectoryOption);
|
||||||
bool dryRun = parser.isSet(dryRunOption);
|
bool const dryRun = parser.isSet(dryRunOption);
|
||||||
|
bool const showExtendedVersion = parser.isSet(extendedVersionOption);
|
||||||
QString const rtPath = QCoreApplication::applicationDirPath();
|
QString const rtPath = QCoreApplication::applicationDirPath();
|
||||||
|
|
||||||
|
if (showExtendedVersion) {
|
||||||
|
printf(APP_EXTENDED_VERSION"\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (!QDir(plugInDir).exists()) {
|
if (!QDir(plugInDir).exists()) {
|
||||||
qCritical() << plugInDir
|
qCritical() << plugInDir
|
||||||
<< "does not exists, but has to contain dc-library";
|
<< "does not exists, but has to contain dc-library";
|
||||||
|
16
worker.cpp
16
worker.cpp
@ -58,6 +58,7 @@ Worker::Worker(int customerNr,
|
|||||||
, m_gc(m_customerNrStr, m_customerRepository, m_workingDirectory, m_branchName, this)
|
, m_gc(m_customerNrStr, m_customerRepository, m_workingDirectory, m_branchName, this)
|
||||||
, m_osVersion(getOsVersion())
|
, m_osVersion(getOsVersion())
|
||||||
, m_atbqtVersion(getATBQTVersion())
|
, m_atbqtVersion(getATBQTVersion())
|
||||||
|
, m_atbUpdateToolVersion(getATBUpdateToolVersion())
|
||||||
, m_cpuSerial(getCPUSerial())
|
, m_cpuSerial(getCPUSerial())
|
||||||
, m_pluginVersionATBDeciceController(getPluginVersion("/opt/app/ATBAPP/plugins/libATBDeviceControllerPlugin.so"))
|
, m_pluginVersionATBDeciceController(getPluginVersion("/opt/app/ATBAPP/plugins/libATBDeviceControllerPlugin.so"))
|
||||||
, m_pluginVersionIngenicoISelf(getPluginVersion("/opt/app/ATBAPP/plugins/libIngenicoISelf_CCPlugin.so"))
|
, m_pluginVersionIngenicoISelf(getPluginVersion("/opt/app/ATBAPP/plugins/libIngenicoISelf_CCPlugin.so"))
|
||||||
@ -71,6 +72,7 @@ Worker::Worker(int customerNr,
|
|||||||
, m_filesToUpdate()
|
, m_filesToUpdate()
|
||||||
, m_updateProcessRunning(true)
|
, m_updateProcessRunning(true)
|
||||||
, m_returnCode(0)
|
, m_returnCode(0)
|
||||||
|
, m_mainWindow(nullptr) /* contains plugin */
|
||||||
, m_progressValue(0)
|
, m_progressValue(0)
|
||||||
//, m_withoutIsmasDirectPort(true) /* useful for testing */ {
|
//, m_withoutIsmasDirectPort(true) /* useful for testing */ {
|
||||||
, m_withoutIsmasDirectPort(false) /* useful for testing */ {
|
, m_withoutIsmasDirectPort(false) /* useful for testing */ {
|
||||||
@ -78,12 +80,6 @@ Worker::Worker(int customerNr,
|
|||||||
this->setObjectName("worker-object");
|
this->setObjectName("worker-object");
|
||||||
QDir::setCurrent(m_workingDirectory);
|
QDir::setCurrent(m_workingDirectory);
|
||||||
|
|
||||||
// restart apism to make sure it is running ?
|
|
||||||
// Command c("systemctl restart apism");
|
|
||||||
// if (c.execute("/tmp")) {
|
|
||||||
// QThread::sleep(10); // give APISM some time to reconnect
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (std::optional<QString> v = getApismVersion()) {
|
if (std::optional<QString> v = getApismVersion()) {
|
||||||
m_apismVersion = v.value();
|
m_apismVersion = v.value();
|
||||||
}
|
}
|
||||||
@ -103,6 +99,7 @@ Worker::Worker(int customerNr,
|
|||||||
qInfo() << "PLUGIN_NAME ................" << m_pluginName;
|
qInfo() << "PLUGIN_NAME ................" << m_pluginName;
|
||||||
qInfo() << "WORKING_DIRECTORY .........." << m_workingDirectory;
|
qInfo() << "WORKING_DIRECTORY .........." << m_workingDirectory;
|
||||||
qInfo() << "APISM VERSION .............." << m_apismVersion;
|
qInfo() << "APISM VERSION .............." << m_apismVersion;
|
||||||
|
qInfo() << "ATB UPDATE TOOL VERSION ...." << m_atbUpdateToolVersion;
|
||||||
|
|
||||||
this->moveToThread(&m_workerThread);
|
this->moveToThread(&m_workerThread);
|
||||||
m_workerThread.start();
|
m_workerThread.start();
|
||||||
@ -993,6 +990,10 @@ QString Worker::getATBQTVersion() const {
|
|||||||
return "N/A";
|
return "N/A";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString Worker::getATBUpdateToolVersion() const {
|
||||||
|
return APP_EXTENDED_VERSION;
|
||||||
|
}
|
||||||
|
|
||||||
QString Worker::getCPUSerial() const {
|
QString Worker::getCPUSerial() const {
|
||||||
QString const cmd = QString("echo -n $(cat /proc/cpuinfo | grep -i Serial | cut -d':' -f2)");
|
QString const cmd = QString("echo -n $(cat /proc/cpuinfo | grep -i Serial | cut -d':' -f2)");
|
||||||
Command c("bash");
|
Command c("bash");
|
||||||
@ -1136,7 +1137,8 @@ PSAInstalled Worker::getPSAInstalled() {
|
|||||||
if (std::optional<QString> v = getApismVersion()) {
|
if (std::optional<QString> v = getApismVersion()) {
|
||||||
psaInstalled.sw.apismVersion = v.value();
|
psaInstalled.sw.apismVersion = v.value();
|
||||||
}
|
}
|
||||||
psaInstalled.sw.atbQTVersion = m_atbqtVersion;
|
psaInstalled.sw.atbQTVersion = getATBQTVersion();
|
||||||
|
psaInstalled.sw.atbUpdateToolVersion = m_atbUpdateToolVersion;
|
||||||
|
|
||||||
psaInstalled.pluginVersion.deviceController = m_pluginVersionATBDeciceController;
|
psaInstalled.pluginVersion.deviceController = m_pluginVersionATBDeciceController;
|
||||||
psaInstalled.pluginVersion.ingenicoISelfCC = m_pluginVersionIngenicoISelf;
|
psaInstalled.pluginVersion.ingenicoISelfCC = m_pluginVersionIngenicoISelf;
|
||||||
|
3
worker.h
3
worker.h
@ -92,6 +92,7 @@ class Worker : public QObject {
|
|||||||
GitClient m_gc;
|
GitClient m_gc;
|
||||||
QString const m_osVersion;
|
QString const m_osVersion;
|
||||||
QString const m_atbqtVersion;
|
QString const m_atbqtVersion;
|
||||||
|
QString const m_atbUpdateToolVersion;
|
||||||
QString const m_cpuSerial;
|
QString const m_cpuSerial;
|
||||||
QString const m_pluginVersionATBDeciceController;
|
QString const m_pluginVersionATBDeciceController;
|
||||||
QString const m_pluginVersionIngenicoISelf;
|
QString const m_pluginVersionIngenicoISelf;
|
||||||
@ -119,6 +120,7 @@ class Worker : public QObject {
|
|||||||
bool executeOpkgCommand(QString opkgCommand);
|
bool executeOpkgCommand(QString opkgCommand);
|
||||||
QString getOsVersion() const;
|
QString getOsVersion() const;
|
||||||
QString getATBQTVersion() const;
|
QString getATBQTVersion() const;
|
||||||
|
QString getATBUpdateToolVersion() const;
|
||||||
QString getCPUSerial() const;
|
QString getCPUSerial() const;
|
||||||
QString getRaucVersion() const;
|
QString getRaucVersion() const;
|
||||||
QString getOpkgVersion() const;
|
QString getOpkgVersion() const;
|
||||||
@ -162,6 +164,7 @@ public:
|
|||||||
int customerNr() const { return m_customerNr; }
|
int customerNr() const { return m_customerNr; }
|
||||||
int zoneNr() const { return m_zoneNr; }
|
int zoneNr() const { return m_zoneNr; }
|
||||||
QString apismVersion() const { return m_apismVersion; }
|
QString apismVersion() const { return m_apismVersion; }
|
||||||
|
QString atbUpdateToolVersion() const { return m_atbUpdateToolVersion; }
|
||||||
|
|
||||||
MainWindow *mainWindow() { return m_mainWindow; }
|
MainWindow *mainWindow() { return m_mainWindow; }
|
||||||
MainWindow const *mainWindow() const { return m_mainWindow; }
|
MainWindow const *mainWindow() const { return m_mainWindow; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user