2023-07-31 16:56:16 +02:00
|
|
|
QT += core gui
|
2023-07-10 15:59:28 +02:00
|
|
|
QT += widgets serialport network
|
2023-07-31 16:56:16 +02:00
|
|
|
|
|
|
|
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
2023-05-25 10:21:42 +02:00
|
|
|
|
2023-06-19 15:58:15 +02:00
|
|
|
TARGET = ATBUpdateTool
|
2023-05-25 10:21:42 +02:00
|
|
|
|
2023-07-31 16:56:16 +02:00
|
|
|
# The following define makes your compiler emit warnings if you use
|
|
|
|
# any Qt feature that has been marked deprecated (the exact warnings
|
|
|
|
# depend on your compiler). Please consult the documentation of the
|
|
|
|
# deprecated API in order to know how to port your code away from it.
|
|
|
|
DEFINES += QT_DEPRECATED_WARNINGS
|
|
|
|
|
|
|
|
# You can also make your code fail to compile if it uses deprecated APIs.
|
|
|
|
# In order to do so, uncomment the following line.
|
|
|
|
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
|
|
|
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
2023-10-04 13:23:06 +02:00
|
|
|
|
|
|
|
# 1.3.6 : Do not update device-controller/json files, but have the library
|
|
|
|
# (in a later step) do that.
|
|
|
|
# Fixed sending messages to ISMAS.
|
|
|
|
# Always execute contents of opkg_commands-file (even if there are no
|
|
|
|
# changes).
|
2023-10-05 10:54:19 +02:00
|
|
|
# 1.3.7 : Wait forever for git-commands to finish in QProcess executing such
|
|
|
|
# a command.
|
2023-10-06 13:02:23 +02:00
|
|
|
# 1.3.8 : Remove accessing opkg_commands under file-system-path /etc/psa_update.
|
|
|
|
# Activate download of json-configuration files.
|
2023-10-09 15:57:11 +02:00
|
|
|
# 1.3.9 : Fix sendLastVersion: use configured branch and not master branch in
|
|
|
|
# git show origin/master -s --format="c=%h m=%s d=%cI" ==>
|
|
|
|
# git show origin/zg1/zone1 -s --format="c=%h m=%s d=%cI"
|
|
|
|
# Use dynamic values for os-release and apism-version when sending
|
|
|
|
# last version info.
|
2023-10-10 16:05:16 +02:00
|
|
|
# 1.3.10: Fix premature killing opkg-commands: detected timeout of 100s was
|
|
|
|
# too small when updating apism.
|
|
|
|
# Fix display of UPDATE_SUCCESS when opkg_command fails. Detected when
|
|
|
|
# updating apsim failed.
|
2023-10-12 12:13:49 +02:00
|
|
|
# 1.3.11: Integrate version of ATBUpdateTool in SendLastVersion-ISMAS-message.
|
2023-10-18 11:45:54 +02:00
|
|
|
# 1.3.12: Add command parameters for output of yocto-infos about ATBUpdateTool.
|
|
|
|
# Use 'git pull' instead of 'git fetch'.
|
|
|
|
# Use 'git clone --filter=blob:none' instead of 'git clone' to speed
|
|
|
|
# up cloning of customer repository.
|
2023-10-19 13:45:52 +02:00
|
|
|
# 1.3.13: Fix: if the customer repository is corrupted, remove it and re-clone
|
|
|
|
# the repository (without checking the ISMAS-trigger (WAIT-)button.
|
2023-10-20 13:55:18 +02:00
|
|
|
# 1.3.14: Add additional check for sanity of customer repository using
|
|
|
|
# "git fsck".
|
2023-10-30 15:35:38 +01:00
|
|
|
# Stream-lined code of update process: massive refactoring.
|
|
|
|
# Added functionality: If WAIT button is not active, then an existing
|
|
|
|
# customer repository will be repaired, or a not existing repository
|
|
|
|
# will be cloned. The process stops then.
|
|
|
|
# However, if the WAIT button is active, the at least the commands in
|
|
|
|
# opkg_commands will be executed. Changed files in the customer
|
|
|
|
# repository will be worked on: tariff-files will be synced with the
|
|
|
|
# local filesystem, json-files will be downloaded to firmware.
|
|
|
|
# The device-controller firmware will be handled in a later version.
|
2023-11-07 11:44:22 +01:00
|
|
|
# 1.3.15: Bug fixes found during testing.
|
2023-12-17 15:23:00 +01:00
|
|
|
# Do not disable Exit-button during update-process.
|
2023-11-07 09:24:32 +01:00
|
|
|
# Removed worker-thread with an own event-loop: only the GUI thread
|
|
|
|
# has an event loop. Tested JSON-downloads several times successfully
|
|
|
|
# (using the slave lib where the CA helper tool was active as master).
|
|
|
|
# Turned previous worker-object into its own thread, but without any
|
|
|
|
# own event-loop (so it cannot block anything inside the CA-plugin).
|
2023-11-16 14:19:19 +01:00
|
|
|
# 1.3.16: Bug fixes found during testing.
|
2023-11-21 15:27:34 +01:00
|
|
|
# 1.3.17: Add ATBUpdateTool.ini and custom command line parser. Settings
|
2023-11-17 13:14:02 +01:00
|
|
|
# given in ATBUpdateTool.ini can be overwritten on the command-line.
|
2023-11-21 15:27:34 +01:00
|
|
|
# 1.3.18: Bug fixes found during testing.
|
2023-11-21 16:18:17 +01:00
|
|
|
# 1.3.19: Bug fixes found during testing.
|
2023-11-29 11:30:50 +01:00
|
|
|
# 1.3.20: Bug fixes found during testing.
|
2023-12-13 14:00:21 +01:00
|
|
|
# 1.3.21: Bug fixes found during testing:
|
|
|
|
# Fix directory of ATBUpdateTool.ini to be the working directory of
|
|
|
|
# the application rather than just ".".
|
|
|
|
# Check existance of etc-directory inside customer repository.
|
|
|
|
# Check for valid ISMAS trigger (button) 15x (=90s).
|
|
|
|
# NOTE: if the customer repository is cloned (or repaired and cloned
|
|
|
|
# again), and if the settings always-download-config=true and
|
|
|
|
# always-download-dc=true in the ATBUpdateTool.ini file, the download
|
|
|
|
# the printer-json files and the device controller file, even without
|
|
|
|
# an activated ISMAS trigger (button). The tariff-files are rsynced to
|
|
|
|
# the local filesystem for such clone.
|
|
|
|
# Set new filename for device controller: dc2c.bin.
|
2023-12-15 09:48:14 +01:00
|
|
|
# 1.3.22: Bug fixes found during testing:
|
|
|
|
# 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.
|
2024-01-17 15:32:26 +01:00
|
|
|
# 1.3.23: Added a 'break' to prevent a possible endless loop when checking if
|
2023-12-19 14:30:58 +01:00
|
|
|
# the device is alive.
|
2024-01-17 15:32:26 +01:00
|
|
|
#
|
|
|
|
# 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)
|
2024-01-17 15:38:05 +01:00
|
|
|
# Set hash-value in EVENT-objects. Set location (project), version
|
|
|
|
# and info in send-last-version.
|
2024-01-25 15:13:56 +01:00
|
|
|
# If the customer repository does not exist, then do not check the
|
|
|
|
# ISMAS trigger, but proceed with the update procedure. Otherwise,
|
|
|
|
# check the ISMAS update-trigger as first step.
|
2024-01-19 13:11:12 +01:00
|
|
|
# If the current time is between 0.00 - 4.00 o'clock, then a wrong
|
2024-01-25 15:13:56 +01:00
|
|
|
# trigger-value will result in an UPDATE_STEP_NOT_NECESSARY.
|
2024-01-19 13:11:12 +01:00
|
|
|
# Move final processing to subclass UpdateProcessRunning.
|
2024-01-25 09:01:04 +01:00
|
|
|
# Disable EXIT-button for the whole update-process, except for the
|
|
|
|
# checking of the ISMAS-trigger-button (aka WAIT-button).
|
2024-01-17 15:32:26 +01:00
|
|
|
VERSION="1.4.0"
|
2023-10-30 15:35:38 +01:00
|
|
|
|
|
|
|
# PLANNED TODOS:
|
|
|
|
# 1: Das Repository wird repariert bwz. neu geklont. Unabhaengig vom WAIT.
|
|
|
|
# 2: Wenn der WAIT-Button aktiv ist, dann wird ein Repository repariert (neu
|
|
|
|
# geklont), aber zusaetzlich werden alle verfuegbaren Dateien als neu
|
|
|
|
# angesehen und die entsprechenden Aktionen durchgefuehrt: tariff-files
|
|
|
|
# spiegeln, json-files laden und dc laden. Also VORSICHT: das repository
|
|
|
|
# muss in diesem fall wirklich in ordnung sein.
|
|
|
|
# 3: Wurde keine Datei geaendert, kein initiales Clone und der WAIT-button
|
|
|
|
# nicht aktiv, so (passiert natuerlich nichts) kann man davon ausgehen,
|
|
|
|
# dass es sich um ein automatisches Update handelt. Dann koennte man im
|
|
|
|
# ISMAS eine entsprechende Meldung anzeigen als Teil von SEND-LAST-VERSION.
|
|
|
|
# Wenn der WAIT-button aktiv ist, dann werden zumindest die opkg-commands
|
|
|
|
# ausgefuehrt.
|
|
|
|
# 4: rsync: immer alle Dateien soiegeln (bis auf opkg-commands)
|
|
|
|
# 5: Falls das Tool mal abstuerzt, dann einen Signal-Handler (fuer TERM)
|
2023-11-07 09:24:32 +01:00
|
|
|
# installieren, sodass zumnidest SEND-LAST-VERSION mit rausgeht.
|
2023-10-30 15:35:38 +01:00
|
|
|
# 6: rsync: explizites Binary, nicht das in busybox enthaltene.
|
2023-11-16 14:19:19 +01:00
|
|
|
# 7: Versionen der Json-Files lassen sich auslesen.
|
2023-11-21 10:09:52 +01:00
|
|
|
# Problem: Einstellungen in den Json-Files lassen sich auch mittels
|
|
|
|
# Funktionen in der CD-Library ueberschreiben. Damit ist dann wieder nicht
|
|
|
|
# mehr so klar, was jetzt eigentlich aktiv ist.
|
|
|
|
# 8: m_alwaysDownloadConfig und m_alwaysDownloadDC: vorbereitet: man koennte
|
|
|
|
# es so arrangieren, dass der DC plus die Json-files im Repository immer
|
|
|
|
# runtergeladen werden, obwohl sich im Repository gar nicts veraendert
|
|
|
|
# hat. Eeventuell nuetzlich beim initialen Setuo eines PSA.
|
2023-11-24 14:08:19 +01:00
|
|
|
# 9: Das Kunden-Repository sollte immer gezogen werden, unabhaengig von der
|
|
|
|
# Stellung des WAIT-Button. Grund: es koennte sein, dass andernfalls ein
|
|
|
|
# PSA weit hiter anderen steht, und dann ploetzlich einmal alle vorher-
|
|
|
|
# gehenden Aenderungen anzieht, die gar nicht fuer ihn gemeint waren.
|
2023-12-13 10:06:04 +01:00
|
|
|
# 10: Bei einer Neuinstallation (Neuhauser) immer JSON files runterladen,
|
|
|
|
# Tariff-Files syncen (d.h. nur wenn noch kein Repo vorhanden ist), und
|
|
|
|
# zwar auch ohne WAIT-Button.
|
2023-12-15 09:48:14 +01:00
|
|
|
# 11: Das Edit-Fenster teilen um die Anzeige zu verbessern.
|
2023-12-17 15:23:00 +01:00
|
|
|
# 12: Bei einem Update muss immer ersichtlich sein, warum es ueberhaupt
|
|
|
|
# angestossen wurde. Steht kein "WAIT" im ISMAS-Trigger, dann kann man
|
|
|
|
# davon ausgehen, dass es sich um ein automatisches Update handelt.
|
|
|
|
# In jedem Fall wird bei einem automatischen Update, bei dem der WAIT-
|
|
|
|
# Button nicht gesetzt war, ein "OK" gesendet, falls sonst nichts weiter
|
|
|
|
# zu tun ist. Beachte aber: wir haben auch noch den Fall, dass eine SD-
|
|
|
|
# Karte gesteckt wird. In diesem Fall wird ein komplettes Update gefahren,
|
|
|
|
# und zwar explizit auch ohne WAIT-Button.
|
|
|
|
# Am Ende eines Updates steht im ISMAS entweder ein "OK" oder ein "FAIL".
|
|
|
|
# 13: SendLastVersion: fuer jedes erfolgreich installierte Paket eine
|
|
|
|
# Send-Last-Version-Nachricht an ISMAS. Dadurch entsteht im ISMAS eine
|
|
|
|
# History (Christian darueber informieren).
|
|
|
|
# 14: Installiert werden nur Dateien, die neu sind oder geaendert wurden.
|
|
|
|
# Nicht etwas Dateien, die geloescht wurden: sicherstellen, dass man hier
|
|
|
|
# immer direkt im repository arbeitet, nicht auf dem Filesystem.
|
|
|
|
# Ferner: der DeviceController heisst dc2c.bin, auch fuer die Jsons
|
|
|
|
# sind Dtandard-Namen vergeben. Alternativ: alle vorhandenen Jsons
|
|
|
|
# werden runtergeladen: Thomas ist eh fuer deren Inhalte verantworlich.
|
|
|
|
# WICHTIG: immer ueberpruefen, ob die Dateien im Customer-Repository
|
|
|
|
# wirklich die richtigen Dateien sind.
|
|
|
|
# 15: Der WAIT-Button laesst sich auf WAIT zuruecksetzen (etwa wenn git
|
|
|
|
# selber Probleme hatte).
|
|
|
|
# 16: Der Download-Thread sollte sowohl die auto-Variable auf false setzen
|
|
|
|
# als auch den cycle-Timer stoppen, damit sichergestellt ist, dass der
|
|
|
|
# Download des DC nicht gestoert wird.
|
2023-11-21 10:09:52 +01:00
|
|
|
|
2023-10-04 13:23:06 +02:00
|
|
|
|
2023-10-04 14:34:54 +02:00
|
|
|
win32 {
|
|
|
|
BUILD_DATE=$$system("date /t")
|
|
|
|
BUILD_TIME=$$system("time /t")
|
|
|
|
} else {
|
|
|
|
BUILD_DATE=$$system("date +%d-%m-%y")
|
|
|
|
BUILD_TIME=$$system("date +%H:%M:%S")
|
|
|
|
}
|
2023-07-06 14:11:28 +02:00
|
|
|
|
2023-10-12 12:13:49 +02:00
|
|
|
GIT_COMMIT=$$system("git log -1 --format=oneline | cut -d' ' -f1")
|
|
|
|
|
|
|
|
EXTENDED_VERSION="$${VERSION}-$${GIT_COMMIT}"
|
2023-06-16 16:47:56 +02:00
|
|
|
|
2023-10-04 14:34:54 +02:00
|
|
|
INCLUDEPATH += plugins
|
2023-10-04 13:23:06 +02:00
|
|
|
|
|
|
|
CONFIG += c++17
|
2023-05-25 10:21:42 +02:00
|
|
|
# CONFIG -= app_bundle
|
|
|
|
|
2023-07-06 14:11:28 +02:00
|
|
|
DEFINES+=APP_VERSION=\\\"$$VERSION\\\"
|
2023-10-04 14:34:54 +02:00
|
|
|
DEFINES+=APP_BUILD_DATE=\\\"$$BUILD_DATE\\\"
|
|
|
|
DEFINES+=APP_BUILD_TIME=\\\"$$BUILD_TIME\\\"
|
2023-10-12 12:13:49 +02:00
|
|
|
DEFINES+=APP_EXTENDED_VERSION=\\\"$$EXTENDED_VERSION\\\"
|
2023-05-25 10:21:42 +02:00
|
|
|
|
2023-10-30 15:35:38 +01:00
|
|
|
# keep comments, as /* fall through */
|
|
|
|
QMAKE_CXXFLAGS += -C
|
2023-07-19 16:46:29 +02:00
|
|
|
QMAKE_CXXFLAGS += -g
|
2024-01-17 15:32:26 +01:00
|
|
|
QMAKE_CXXFLAGS += -Wno-deprecated-copy -O
|
2023-05-25 10:21:42 +02:00
|
|
|
|
|
|
|
contains( CONFIG, PTU5 ) {
|
|
|
|
greaterThan(QT_MAJOR_VERSION, 4): QT += serialport
|
|
|
|
CONFIG += link_pkgconfig
|
|
|
|
lessThan(QT_MAJOR_VERSION, 5): PKGCONFIG += qextserialport
|
2023-09-28 12:11:47 +02:00
|
|
|
QMAKE_CXXFLAGS += -O2 -std=c++17 # for GCC >= 4.7
|
2023-10-30 15:35:38 +01:00
|
|
|
# QMAKE_CXXFLAGS += -Wno-deprecated-copy
|
2023-05-25 10:21:42 +02:00
|
|
|
ARCH = PTU5
|
|
|
|
DEFINES+=PTU5
|
|
|
|
}
|
2023-06-22 17:46:09 +02:00
|
|
|
contains( CONFIG, PTU5_YOCTO ) {
|
|
|
|
greaterThan(QT_MAJOR_VERSION, 4): QT += serialport
|
2023-07-20 09:06:07 +02:00
|
|
|
QMAKE_CXXFLAGS += -std=c++17 # for GCC >= 4.7
|
2023-10-30 15:35:38 +01:00
|
|
|
# QMAKE_CXXFLAGS += -Wno-deprecated-copy
|
2023-06-22 17:46:09 +02:00
|
|
|
PTU5BASEPATH = /opt/devel/ptu5
|
|
|
|
ARCH = PTU5
|
|
|
|
DEFINES+=PTU5
|
|
|
|
|
|
|
|
# add qmqtt lib
|
|
|
|
#LIBS += -lQt5Qmqtt
|
|
|
|
}
|
2023-05-25 10:21:42 +02:00
|
|
|
contains( CONFIG, DesktopLinux ) {
|
|
|
|
greaterThan(QT_MAJOR_VERSION, 4): QT += serialport
|
|
|
|
lessThan(QT_MAJOR_VERSION, 5): CONFIG += extserialport
|
|
|
|
# QMAKE_CC = ccache $$QMAKE_CC
|
|
|
|
# QMAKE_CXX = ccache $$QMAKE_CXX
|
2023-07-11 16:59:49 +02:00
|
|
|
QMAKE_CXXFLAGS += -std=c++17
|
2023-10-30 15:35:38 +01:00
|
|
|
# QMAKE_CXXFLAGS += -Wno-deprecated-copy
|
2023-05-25 10:21:42 +02:00
|
|
|
linux-clang { QMAKE_CXXFLAGS += -Qunused-arguments }
|
|
|
|
ARCH = DesktopLinux
|
|
|
|
DEFINES+=DesktopLinux
|
|
|
|
}
|
|
|
|
|
|
|
|
SOURCES += \
|
|
|
|
main.cpp \
|
2023-08-04 14:10:47 +02:00
|
|
|
progress_event.cpp \
|
2023-09-09 15:08:03 +02:00
|
|
|
update_dc_event.cpp \
|
2023-07-31 16:56:16 +02:00
|
|
|
mainwindow.cpp \
|
|
|
|
utils.cpp \
|
2023-05-25 10:21:42 +02:00
|
|
|
update.cpp \
|
2023-07-10 15:59:28 +02:00
|
|
|
git/git_client.cpp \
|
2023-07-11 16:59:49 +02:00
|
|
|
ismas/ismas_client.cpp \
|
2023-07-10 15:59:28 +02:00
|
|
|
process/command.cpp \
|
2023-06-16 16:47:56 +02:00
|
|
|
message_handler.cpp \
|
2023-11-16 14:17:20 +01:00
|
|
|
worker.cpp \
|
|
|
|
commandline_parser.cpp
|
2023-05-25 10:21:42 +02:00
|
|
|
|
|
|
|
HEADERS += \
|
|
|
|
update.h \
|
2023-08-04 14:10:47 +02:00
|
|
|
progress_event.h \
|
2023-09-09 15:08:03 +02:00
|
|
|
update_dc_event.h \
|
2023-07-31 16:56:16 +02:00
|
|
|
utils.h \
|
|
|
|
mainwindow.h \
|
2023-07-10 15:59:28 +02:00
|
|
|
git/git_client.h \
|
|
|
|
apism/ismas_data.h \
|
2023-07-11 16:59:49 +02:00
|
|
|
ismas/ismas_client.h \
|
2023-07-10 15:59:28 +02:00
|
|
|
process/command.h \
|
2023-05-25 10:21:42 +02:00
|
|
|
message_handler.h \
|
2023-06-16 16:47:56 +02:00
|
|
|
worker.h \
|
2023-11-16 14:17:20 +01:00
|
|
|
commandline_parser.h \
|
2023-06-16 16:47:56 +02:00
|
|
|
plugins/interfaces.h
|
2023-05-25 10:21:42 +02:00
|
|
|
|
2023-11-16 14:17:20 +01:00
|
|
|
OTHER_FILES += \
|
|
|
|
ATBUpdateTool.ini
|
|
|
|
|
2023-07-31 16:56:16 +02:00
|
|
|
FORMS += \
|
|
|
|
mainwindow.ui
|
|
|
|
|
2023-08-03 09:50:26 +02:00
|
|
|
|
|
|
|
##########################################################################################
|
|
|
|
# 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
|
|
|
|
}
|