save for christmas
This commit is contained in:
@@ -8,6 +8,8 @@
|
||||
#include <QByteArray>
|
||||
#include <QProcess>
|
||||
#include <QPluginLoader>
|
||||
#include <QDateTime>
|
||||
#include <cmath>
|
||||
|
||||
#include <initializer_list>
|
||||
|
||||
@@ -30,12 +32,20 @@ class Update : public QObject {
|
||||
QString m_branchName;
|
||||
QString m_pluginName;
|
||||
QString m_workingDir;
|
||||
QString m_psaDcDir;
|
||||
QString m_dcFileName;
|
||||
bool m_maintenanceMode;
|
||||
bool m_dryRun;
|
||||
bool m_sys_areDCdataValid;
|
||||
|
||||
static QPluginLoader pluginLoader;
|
||||
|
||||
QDateTime m_start;
|
||||
QString nextTimePoint() const {
|
||||
float const secs = m_start.msecsTo(QDateTime::currentDateTime()) / 1000.0;
|
||||
return QStringLiteral("+%1s").arg(secs, 7, 'f', 2, QChar('0'));
|
||||
}
|
||||
|
||||
public:
|
||||
enum class DownloadResult {OK, ERROR, TIMEOUT, NOP};
|
||||
enum class FileTypeJson {CONFIG=1, DEVICE=2, CASH=3, SERIAL=4, TIME=5, PRINTER=6};
|
||||
@@ -44,13 +54,13 @@ public:
|
||||
static bool unloadDCPlugin();
|
||||
static QStringList split(QString line, QChar sep = ',');
|
||||
|
||||
|
||||
explicit Update(QString customerRepository,
|
||||
QString customerNrStr,
|
||||
QString branchName,
|
||||
QString plugInDir,
|
||||
QString pluginName,
|
||||
QString workingDir,
|
||||
QString psaDcDir,
|
||||
bool dryRun = false,
|
||||
QObject *parent = nullptr,
|
||||
char const *serialInterface = SERIAL_PORT,
|
||||
@@ -58,7 +68,7 @@ public:
|
||||
|
||||
virtual ~Update() override;
|
||||
|
||||
bool doUpdate();
|
||||
bool doUpdate(QString const &dcFileName);
|
||||
static QString dcVersion(QString const &dcBinFile);
|
||||
|
||||
private:
|
||||
@@ -72,7 +82,7 @@ private:
|
||||
DownloadResult dcDownloadBinary(QByteArray const &b) const;
|
||||
|
||||
QString m_fileToDownload;
|
||||
|
||||
uint16_t m_totalBlocks = 0;
|
||||
/*
|
||||
private:
|
||||
static QString jsonType(enum FileTypeJson type);
|
||||
|
Reference in New Issue
Block a user