Reset.
Add helper functions read1stLineOfFile() and zoneNr().
This commit is contained in:
41
utils.h
41
utils.h
@@ -5,42 +5,9 @@
|
||||
#include <QString>
|
||||
#include <QFile>
|
||||
|
||||
#include <memory>
|
||||
namespace Utils {
|
||||
int read1stLineOfFile(QString fileName);
|
||||
QString zoneName(quint8 i);
|
||||
}
|
||||
|
||||
#include "interfaces.h"
|
||||
#include "DCPlugin/include/hwapi.h"
|
||||
|
||||
#ifdef PTU5
|
||||
#define SERIAL_PORT "ttymxc2"
|
||||
#else
|
||||
#define SERIAL_PORT "ttyUSB0"
|
||||
#endif
|
||||
|
||||
class Utils : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
std::unique_ptr<hwinf> m_hw;
|
||||
char const *m_serialInterface;
|
||||
char const *m_baudrate;
|
||||
QFile m_update_ctrl_file;
|
||||
QFile m_update_ctrl_file_copy;
|
||||
QTextStream m_in;
|
||||
QTextStream m_out;
|
||||
|
||||
bool m_init;
|
||||
|
||||
void updateBinary(char const *fileToSendToDC);
|
||||
void updatePrinterConf(int nrOfTemplate, char const *fileToSendToDC);
|
||||
bool finishUpdate(bool finish);
|
||||
QStringList getOpenLines();
|
||||
static constexpr QChar SEPARATOR = QChar(',');
|
||||
|
||||
public:
|
||||
explicit Utils(QString update_ctrl_file,
|
||||
QObject *parent = nullptr,
|
||||
char const *serialInterface = SERIAL_PORT,
|
||||
char const *baudrate = "115200");
|
||||
virtual ~Utils() override;
|
||||
bool doUpdate();
|
||||
};
|
||||
#endif // UTILS_H_INCLUDED
|
||||
|
Reference in New Issue
Block a user