Added helper functions.
This commit is contained in:
parent
f5198efab3
commit
9ed51d60e4
24
update.h
24
update.h
@ -9,6 +9,7 @@
|
|||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
|
|
||||||
#include "plugins/interfaces.h"
|
#include "plugins/interfaces.h"
|
||||||
|
#include "apism/apism_client.h"
|
||||||
|
|
||||||
#ifdef PTU5
|
#ifdef PTU5
|
||||||
#define SERIAL_PORT "ttymxc2"
|
#define SERIAL_PORT "ttymxc2"
|
||||||
@ -29,15 +30,20 @@ class Update : public QObject {
|
|||||||
char const *m_baudrate;
|
char const *m_baudrate;
|
||||||
QFile m_update_ctrl_file;
|
QFile m_update_ctrl_file;
|
||||||
QFile m_update_ctrl_file_copy;
|
QFile m_update_ctrl_file_copy;
|
||||||
|
QString m_repositoryPath;
|
||||||
|
QString m_customerId; // customer_281
|
||||||
|
QString m_branchName;
|
||||||
QString m_workingDir;
|
QString m_workingDir;
|
||||||
bool m_maintenanceMode;
|
bool m_maintenanceMode;
|
||||||
bool m_testMode;
|
bool m_testMode;
|
||||||
|
bool m_executeScriptOnly;
|
||||||
|
bool m_dryRun;
|
||||||
|
//ApismClient m_apismClient;
|
||||||
|
|
||||||
bool m_init;
|
bool m_init;
|
||||||
|
|
||||||
bool finishUpdate(bool finish);
|
bool finishUpdate(bool finish);
|
||||||
QStringList getLinesToWorkOn();
|
QStringList getLinesToWorkOn();
|
||||||
QStringList split(QString line, QChar sep = ',');
|
|
||||||
|
|
||||||
bool execUpdateScript();
|
bool execUpdateScript();
|
||||||
|
|
||||||
@ -51,15 +57,29 @@ public:
|
|||||||
|
|
||||||
explicit Update(hwinf *hw,
|
explicit Update(hwinf *hw,
|
||||||
QString update_ctrl_file,
|
QString update_ctrl_file,
|
||||||
|
QString repositoryPath,
|
||||||
|
QString customerId,
|
||||||
|
QString branchName,
|
||||||
QString workingDir = ".",
|
QString workingDir = ".",
|
||||||
bool maintenanceMode = false,
|
bool maintenanceMode = false,
|
||||||
bool testMode = false,
|
bool testMode = false,
|
||||||
|
bool executeScriptOnly = false,
|
||||||
|
bool dryRun = false,
|
||||||
QObject *parent = nullptr,
|
QObject *parent = nullptr,
|
||||||
char const *serialInterface = SERIAL_PORT,
|
char const *serialInterface = SERIAL_PORT,
|
||||||
char const *baudrate = "115200");
|
char const *baudrate = "115200");
|
||||||
virtual ~Update() override;
|
virtual ~Update() override;
|
||||||
bool doUpdate();
|
bool doUpdate();
|
||||||
|
|
||||||
|
QString customerId() { return m_customerId; }
|
||||||
|
QString const customerId() const { return m_customerId; }
|
||||||
|
|
||||||
|
QString branchName() { return m_branchName; }
|
||||||
|
QString const branchName() const { return m_branchName; }
|
||||||
|
|
||||||
|
QString repositoryPath() { return m_repositoryPath; }
|
||||||
|
QString const repositoryPath() const { return m_repositoryPath; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static QString jsonType(enum FileTypeJson type);
|
static QString jsonType(enum FileTypeJson type);
|
||||||
|
|
||||||
@ -85,6 +105,8 @@ private:
|
|||||||
bool downloadJson(enum FileTypeJson type, int templateIdx,
|
bool downloadJson(enum FileTypeJson type, int templateIdx,
|
||||||
QString jsFileToSendToDC) const;
|
QString jsFileToSendToDC) const;
|
||||||
|
|
||||||
|
bool executeProcess(QString const &cmd);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void readyReadStandardOutput();
|
void readyReadStandardOutput();
|
||||||
void readyReadStandardError();
|
void readyReadStandardError();
|
||||||
|
Loading…
Reference in New Issue
Block a user