From 6b9e7952067904b4495c8ffdfff5a4568b43a80c Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Fri, 8 Dec 2023 12:44:53 +0100 Subject: [PATCH] Reordered and extended interface-api for download-thread and reporting-thread: virtual bool dcDownloadRequest(QString const &fileToDownload) const; virtual bool dcDownloadRequested() const; virtual bool dcDownloadResetRequest() const; virtual bool dcDownloadRequestAck() const; virtual bool dcDownloadRunning() const; virtual bool dcDownloadFinished(); virtual bool dcDownloadReportStart() const; virtual bool dcDownloadReportRunning() const; virtual bool dcDownloadReportFinished(); virtual bool dcDownloadThreadStart(); virtual bool dcDownloadThreadRunning() const; virtual void dcDownloadThreadFinalize(DownloadThread *); virtual bool dcDownloadThreadFinished() const; virtual bool dcDownloadReportThreadStart(); virtual bool dcDownloadReportThreadRunning() const; virtual void dcDownloadReportThreadFinalize(); virtual void dcDownloadReportThreadQuit(); virtual bool dcDownloadReportThreadFinished() const; virtual QString dcDownloadFileName() const; virtual bool dcDownloadSetRequested(bool requested); virtual bool dcDownloadSetRunning(bool running); virtual bool dcDownloadSetFinished(bool finished); virtual void dcDownloadSetTotalBlockNumber(uint16_t totalBlockNumber); virtual void dcDownloadSetCurrentBlockNumber(uint16_t currentBlockNumber); virtual bool dcDownloadGetRequested() const; virtual bool dcDownloadGetRunning() const; virtual bool dcDownloadGetFinished() const; virtual uint16_t dcDownloadGetTotalBlockNumber() const; virtual uint16_t dcDownloadGetCurrentBlockNumber() const; --- include/interfaces.h | 44 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/include/interfaces.h b/include/interfaces.h index 5169476..b072f18 100755 --- a/include/interfaces.h +++ b/include/interfaces.h @@ -399,6 +399,7 @@ struct T_bna }; class hwapi; +class DownloadThread; class hwinf { @@ -2276,30 +2277,53 @@ public: // download device controller - virtual void dcDownloadStart() {} - virtual bool dcDownloadFinished() { return true; } - virtual bool dcDownloadRequest(QString const &fileToDownload) { + virtual bool dcDownloadRequest(QString const &fileToDownload) const { Q_UNUSED(fileToDownload); return false; } virtual bool dcDownloadRequested() const { return false; } - virtual bool dcDownloadResetRequest() { return false; } - virtual QString dcDownloadFileName() const { return ""; } - virtual void dcDownloadReportStart() {} - virtual bool dcDownloadReportRunning() { return true; } + virtual bool dcDownloadResetRequest() const { return false; } + virtual bool dcDownloadRequestAck() const { return false; } + virtual bool dcDownloadRunning() const { return false; } + virtual bool dcDownloadFinished() { return false; } + + virtual bool dcDownloadReportStart() const { return false; } + virtual bool dcDownloadReportRunning() const { return true; } virtual bool dcDownloadReportFinished() { return true; } + + virtual bool dcDownloadThreadStart() { return false; } + virtual bool dcDownloadThreadRunning() const { return true; } + virtual void dcDownloadThreadFinalize(DownloadThread *) {} + virtual bool dcDownloadThreadFinished() const { return true; } + virtual bool dcDownloadReportThreadStart() { return false; } + virtual bool dcDownloadReportThreadRunning() const { return true; } + virtual void dcDownloadReportThreadFinalize() {} + virtual void dcDownloadReportThreadQuit() {} + virtual bool dcDownloadReportThreadFinished() const { return true; } + + + virtual QString dcDownloadFileName() const { return ""; } + virtual bool dcDownloadSetRequested(bool requested) { + Q_UNUSED(requested); return false; + } + virtual bool dcDownloadSetRunning(bool running) { + Q_UNUSED(running); return false; + } + virtual bool dcDownloadSetFinished(bool finished) { + Q_UNUSED(finished); return false; + } virtual void dcDownloadSetTotalBlockNumber(uint16_t totalBlockNumber) { Q_UNUSED(totalBlockNumber); } virtual void dcDownloadSetCurrentBlockNumber(uint16_t currentBlockNumber) { Q_UNUSED(currentBlockNumber); } + virtual bool dcDownloadGetRequested() const { return false; } + virtual bool dcDownloadGetRunning() const { return false; } + virtual bool dcDownloadGetFinished() const { return false; } virtual uint16_t dcDownloadGetTotalBlockNumber() const { return 0; } virtual uint16_t dcDownloadGetCurrentBlockNumber() const { return 0; } - virtual bool dcDownloadRunning() const { return false; } - virtual bool dcDownloadFinished() const { return false; } - virtual QObject const *getAPI() { return nullptr; } signals: // for download