From 8e287e31630e8d82ce0b8b0c5bea6e2ae26263f6 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Sun, 3 Dec 2023 19:52:48 +0100 Subject: [PATCH] Add reporting thread and download thread. --- include/hwapi.h | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/include/hwapi.h b/include/hwapi.h index 8464ae0..e1a8f5f 100644 --- a/include/hwapi.h +++ b/include/hwapi.h @@ -75,7 +75,8 @@ V4.0 6.9.2023: activating DC-Bootloader in slve-lib (SM) //for CAmaster: class QSharedMemory; - +class ReportingThread; +class DownloadThread; class hwapi : public QObject, public hwinf { @@ -87,7 +88,8 @@ private: void sub_storeSendingText(QByteArray *buf) const; QTimer *hwapi_TimerPayment; QSharedMemory *m_sharedMem; - //QTimer *hwapi_triggerBL; + ReportingThread *m_reportingThread; + DownloadThread *m_downloadThread; public: explicit hwapi(QWidget *parent = nullptr); @@ -1306,8 +1308,8 @@ public: // download device controller - void dcDownloadInit(QString const &fileToDownload) override; void dcDownloadStart() override; + void dcDownloadRequest(QString const &fileToDownload) override; bool dcDownloadRequested() const override; QString dcDownloadFileName() const override; void dcDownloadResetRequest() override; @@ -1320,12 +1322,13 @@ public: void dcDownloadSetCurrentBlockNumber(uint16_t currentBlockNumber) override; uint16_t dcDownloadGetTotalBlockNumber() const override; uint16_t dcDownloadGetCurrentBlockNumber() const override; -signals: // for download - void hwapi_reportDCDownloadStatus(QString const &status); - void hwapi_reportDCDownloadSuccess(QString const &msg); - void hwapi_reportDCDownloadFailure(QString const &errorMsg); -signals: + virtual hwapi *getAPI() override; + +signals: // for download + void hwapi_reportDCDownloadStatus(QString const &) const; + void hwapi_reportDCDownloadSuccess(QString const &) const; + void hwapi_reportDCDownloadFailure(QString const &) const; // already declared in interfaces.h void hwapi_templatePrintFinished_OK(void) const; void hwapi_templatePrintFinished_Err(void) const;