cleaning up source. rename doUndate() to run().
This commit is contained in:
@@ -17,27 +17,21 @@
|
||||
|
||||
#ifdef PTU5
|
||||
#define SERIAL_PORT "ttymxc2"
|
||||
#define BAUDRATE 115200
|
||||
#else
|
||||
#define SERIAL_PORT "ttyUSB0"
|
||||
#define BAUDRATE 115200
|
||||
#endif
|
||||
|
||||
class QSerialPort;
|
||||
class Update : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
QString m_dcFileName{};
|
||||
hwinf *m_hw = nullptr;
|
||||
char const *m_serialInterface;
|
||||
char const *m_baudrate;
|
||||
QString m_customerRepository;
|
||||
QString m_customerNrStr;
|
||||
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;
|
||||
bool m_sys_areDCdataValid{};
|
||||
bool m_debug;
|
||||
bool m_noaction;
|
||||
|
||||
static QPluginLoader pluginLoader;
|
||||
|
||||
@@ -47,34 +41,18 @@ class Update : public QObject {
|
||||
return QStringLiteral("+%1s").arg(secs, 7, 'f', 2, QChar('0'));
|
||||
}
|
||||
|
||||
bool openSerialPort();
|
||||
bool closeSerialPort();
|
||||
|
||||
QSerialPort *m_serial;
|
||||
|
||||
public:
|
||||
enum class DownloadResult {OK, ERROR, TIMEOUT, NOP};
|
||||
enum class FileTypeJson {CONFIG=1, DEVICE=2, CASH=3, SERIAL=4, TIME=5, PRINTER=6};
|
||||
enum class Result {SUCCESS=0, PLUGIN_LOAD_ERROR};
|
||||
|
||||
static hwinf *loadDCPlugin(QDir const &plugInDir, QString const &fn);
|
||||
static hwinf *loadDCPlugin(QString const &libCA = "/usr/lib/libCAslave.so");
|
||||
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,
|
||||
char const *baudrate = "115200");
|
||||
|
||||
explicit Update(QString const &dcBinFile, QString const &libCA, bool debug, bool noaction);
|
||||
virtual ~Update() override;
|
||||
|
||||
bool doUpdate(QString const &dcFileName);
|
||||
int run();
|
||||
static QString dcVersion(QString const &dcBinFile);
|
||||
|
||||
private:
|
||||
|
Reference in New Issue
Block a user