Additinal UPDATE_STATE constants.
Added struct UpdateStatus for printing debug messages. Added member variables used for sending SENDCMD to ISMAS.A Added helper functions getATBQTVersion(), getCPUSerial(), getRaucVersion(), getOpkgVersion(), getPluginVersion(), getDCVersion(), getFileSize().
This commit is contained in:
parent
60084450e6
commit
088d7c8aa0
57
worker.h
57
worker.h
@ -28,15 +28,17 @@ enum class UPDATE_STATUS : quint8 {
|
|||||||
ISMAS_UPDATE_REQUEST_FAILURE,
|
ISMAS_UPDATE_REQUEST_FAILURE,
|
||||||
ISMAS_UPDATE_REQUEST_TIMEOUT,
|
ISMAS_UPDATE_REQUEST_TIMEOUT,
|
||||||
ISMAS_UPDATE_REQUEST_SUCCESS,
|
ISMAS_UPDATE_REQUEST_SUCCESS,
|
||||||
|
ISMAS_RESPONSE_RECEIVED,
|
||||||
GIT_CHECKOUT_BRANCH_REQUEST,
|
GIT_CHECKOUT_BRANCH_REQUEST,
|
||||||
GIT_CHECKOUT_BRANCH_REQUEST_FAILURE,
|
GIT_CHECKOUT_BRANCH_REQUEST_FAILURE,
|
||||||
GIT_CHECKOUT_BRANCH_NOT_EXISTS,
|
GIT_CHECKOUT_BRANCH_NOT_EXISTS,
|
||||||
GIT_CHECKOUT_BRANCH_CHECKOUT_ERROR,
|
GIT_CHECKOUT_BRANCH_CHECKOUT_ERROR,
|
||||||
GIT_FETCH_UPDATES_REQUEST,
|
GIT_FETCH_UPDATES_REQUEST,
|
||||||
GIT_FETCH_UPDATES_REQUEST_FAILURE,
|
GIT_FETCH_UPDATES_REQUEST_FAILURE,
|
||||||
GIT_FETCH_UPDATES_REQUEST_SSUCCESS,
|
GIT_FETCH_UPDATES_REQUEST_SUCCESS,
|
||||||
EXEC_OPKG_COMMANDS_REQUEST,
|
GIT_PULL_UPDATES_SUCCESS,
|
||||||
EXEC_OPKG_COMMANDS_FAILURE,
|
GIT_PULL_UPDATES_FAILURE,
|
||||||
|
EXEC_OPKG_COMMANDS,
|
||||||
EXEC_OPKG_COMMAND_FAILURE,
|
EXEC_OPKG_COMMAND_FAILURE,
|
||||||
EXEC_OPKG_COMMAND_SUCCESS,
|
EXEC_OPKG_COMMAND_SUCCESS,
|
||||||
EXEC_OPKG_COMMANDS_SUCCESS,
|
EXEC_OPKG_COMMANDS_SUCCESS,
|
||||||
@ -57,14 +59,27 @@ enum class UPDATE_STATUS : quint8 {
|
|||||||
ISMAS_CURRENT_PSA_STATUS_CONFIRM_SUCCESS
|
ISMAS_CURRENT_PSA_STATUS_CONFIRM_SUCCESS
|
||||||
};
|
};
|
||||||
|
|
||||||
#define ISMAS_UPDATE_REQUESTS (6)
|
struct UpdateStatus {
|
||||||
|
UPDATE_STATUS m_updateStatus;
|
||||||
|
QString m_statusDescription;
|
||||||
|
|
||||||
|
explicit UpdateStatus(UPDATE_STATUS s, QString const &d)
|
||||||
|
: m_updateStatus(s), m_statusDescription(d) {}
|
||||||
|
};
|
||||||
|
|
||||||
|
QDebug operator<<(QDebug debug, UpdateStatus status);
|
||||||
|
QString& operator<<(QString &str, UpdateStatus status);
|
||||||
|
|
||||||
|
#define ISMAS_UPDATE_REQUESTS (10)
|
||||||
|
|
||||||
class hwinf;
|
class hwinf;
|
||||||
class Worker : public QObject {
|
class Worker : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
hwinf *m_hw;
|
||||||
WorkerThread m_workerThread;
|
WorkerThread m_workerThread;
|
||||||
QTimer m_startUpdateProcess;
|
QTimer m_startUpdateProcess;
|
||||||
|
QTimer m_emergencyTimer;
|
||||||
Update *m_update;
|
Update *m_update;
|
||||||
ApismClient m_apismClient;
|
ApismClient m_apismClient;
|
||||||
int const m_customerNr;
|
int const m_customerNr;
|
||||||
@ -73,10 +88,23 @@ class Worker : public QObject {
|
|||||||
int const m_zoneNr;
|
int const m_zoneNr;
|
||||||
QString const m_workingDirectory;
|
QString const m_workingDirectory;
|
||||||
QString const m_branchName;
|
QString const m_branchName;
|
||||||
|
QString const m_customerRepositoryPath;
|
||||||
QString const m_customerRepository;
|
QString const m_customerRepository;
|
||||||
GitClient m_gc;
|
GitClient m_gc;
|
||||||
bool m_maintenanceMode;
|
bool m_maintenanceMode;
|
||||||
QString const m_osVersion;
|
QString const m_osVersion;
|
||||||
|
QString const m_atbqtVersion;
|
||||||
|
QString const m_cpuSerial;
|
||||||
|
QString const m_raucVersion;
|
||||||
|
QString const m_opkgVersion;
|
||||||
|
QString const m_pluginVersionATBDeciceController;
|
||||||
|
QString const m_pluginVersionIngenicoISelf;
|
||||||
|
QString const m_pluginVersionMobilisisCalc;
|
||||||
|
QString const m_pluginVersionMobilisisCalcConfig;
|
||||||
|
QString const m_pluginVersionPrmCalc;
|
||||||
|
QString const m_pluginVersionPrmCalcConfig;
|
||||||
|
QString const m_pluginVersionTcpZvt;
|
||||||
|
|
||||||
int m_ismasUpdateRequests;
|
int m_ismasUpdateRequests;
|
||||||
QTimer m_waitForNewUpdates;
|
QTimer m_waitForNewUpdates;
|
||||||
IsmasClient m_ismasClient;
|
IsmasClient m_ismasClient;
|
||||||
@ -84,9 +112,16 @@ class Worker : public QObject {
|
|||||||
UPDATE_STATUS m_updateStatus;
|
UPDATE_STATUS m_updateStatus;
|
||||||
QString m_statusDescription;
|
QString m_statusDescription;
|
||||||
|
|
||||||
|
|
||||||
void executeOpkgCommand(QString opkgCommand);
|
void executeOpkgCommand(QString opkgCommand);
|
||||||
QString getOsVersion() const;
|
QString getOsVersion() const;
|
||||||
|
QString getATBQTVersion() const;
|
||||||
|
QString getCPUSerial() const;
|
||||||
|
QString getRaucVersion() const;
|
||||||
|
QString getOpkgVersion() const;
|
||||||
|
QString getPluginVersion(QString const &pluginFileName) const;
|
||||||
|
QStringList getDCVersion() const;
|
||||||
|
|
||||||
|
qint64 getFileSize(QString const &fileName) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit Worker(hwinf *hw,
|
explicit Worker(hwinf *hw,
|
||||||
@ -105,6 +140,15 @@ public:
|
|||||||
|
|
||||||
static int read1stLineOfFile(QString fileName);
|
static int read1stLineOfFile(QString fileName);
|
||||||
|
|
||||||
|
//friend QDebug operator<<(QDebug debug, Worker const &w) {
|
||||||
|
// Q_UNUSED(w);
|
||||||
|
// return debug;
|
||||||
|
//}
|
||||||
|
//friend QString& operator<<(QString &str, Worker const &w) {
|
||||||
|
// Q_UNUSED(w);
|
||||||
|
// return str;
|
||||||
|
//}
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void handleChangedFiles(QStringList);
|
void handleChangedFiles(QStringList);
|
||||||
void summarizeUpload(QStringList);
|
void summarizeUpload(QStringList);
|
||||||
@ -126,7 +170,4 @@ private slots:
|
|||||||
void onHandleChangedFiles(QStringList);
|
void onHandleChangedFiles(QStringList);
|
||||||
};
|
};
|
||||||
|
|
||||||
//Q_DECLARE_METATYPE((QHash<QString, QString>))
|
|
||||||
//Q_DECLARE_ASSOCIATIVE_CONTAINER_METATYPE(QHash)
|
|
||||||
|
|
||||||
#endif // WORKER_H_INCLUDED
|
#endif // WORKER_H_INCLUDED
|
||||||
|
Loading…
Reference in New Issue
Block a user