diff --git a/update.h b/update.h index ca1c71a..08b6478 100644 --- a/update.h +++ b/update.h @@ -33,10 +33,6 @@ class Update : public QObject { bool m_init; - bool updateBinary(char const *fileToSendToDC); - bool updatePrinterConf(int templateIdx, QString fileToSendToDC); - bool updateConf(QString fileToSendToDC); - bool updateCashConf(QString fileToSendToDC); bool finishUpdate(bool finish); QStringList getLinesToWorkOn(); QStringList split(QString line, QChar sep = ','); @@ -45,7 +41,7 @@ class Update : public QObject { public: enum class DownloadResult {OK, ERROR, TIMEOUT, NOP}; - enum class FileTypeJson {CONFIG=1, DEVICE, CASH, SERIAL, TIME, PRINTER}; + enum class FileTypeJson {CONFIG=1, DEVICE=2, CASH=3, SERIAL=4, TIME=5, PRINTER=6}; static hwinf *loadDCPlugin(QDir const &plugInDir, QString const &fn); @@ -61,6 +57,8 @@ public: bool doUpdate(); private: + static QString jsonType(enum FileTypeJson type); + DownloadResult sendStatus(int ret) const; DownloadResult sendNextAddress(int bNum) const; DownloadResult sendNextDataBlock(QByteArray const &b, int bNum) const; @@ -74,7 +72,12 @@ private: QByteArray loadBinaryDCFile(QString filename) const; bool downloadBinaryToDC(QString const &bFile) const; bool updateDC(QString bFile) const; - bool updatePrinterTemplate(enum FileTypeJson type, int templateIdx, - QString fname) const; + bool updatePrinterTemplate(int templateIdx, QString fname) const; + bool updateBinary(char const *fileToSendToDC); + bool updateConfig(QString jsFileToSendToDC); + bool updateCashConf(QString jsFileToSendToDC); + bool updateDeviceConf(QString jsFileToSendToDC); + bool downloadJson(enum FileTypeJson type, int templateIdx, + QString jsFileToSendToDC) const; }; #endif // UPDATE_H_INCLUDED