From fd58f41c87c78e4a50938311a61f3b1f76dd40ce Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Sat, 2 Dec 2023 09:47:51 +0100 Subject: [PATCH] Implement helpers: virtual void dcDownloadStart() {}^M virtual bool dcDownloadRequested() const { return false; }^M virtual void dcDownloadResetRequest() {}^M virtual QString dcDownloadFileName() const { return ""; }^M virtual void dcDownloadReportStart() {}^M --- src/hwapi.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/hwapi.cpp b/src/hwapi.cpp index 0cb5632..6e91dd1 100644 --- a/src/hwapi.cpp +++ b/src/hwapi.cpp @@ -51,7 +51,7 @@ hwapi::hwapi(QWidget *parent) : QObject(parent) // { #ifdef THIS_IS_CA_MASTER - myDatif = new T_datif(); // für die CAslave-Lib auskommentieren! + myDatif = new T_datif(this); // für die CAslave-Lib auskommentieren! #else qCritical()<<"hwapi: error CAslave cannot include T_datif"; #endif @@ -4383,7 +4383,7 @@ void hwapi::dcDownloadInit(QString const &dcFileToDownload) { SharedMem::getData()->m_downLoadDC.m_totalBlocks = 0; SharedMem::getData()->m_downLoadDC.m_currentblockNumber = 0; - SharedMem::getData()->m_downLoadDC.m_started = false; + SharedMem::getData()->m_downLoadDC.m_started = true; SharedMem::getData()->m_downLoadDC.m_running = false; SharedMem::getData()->m_downLoadDC.m_finished = false; } @@ -4395,6 +4395,18 @@ void hwapi::dcDownloadReportStart() { } +bool hwapi::dcDownloadRequested() const { + return SharedMem::getDataConst()->m_downLoadDC.m_started; +} + +void hwapi::dcDownloadResetRequest() { + SharedMem::getData()->m_downLoadDC.m_started = false; +} + +QString hwapi::dcDownloadFileName() const { + return SharedMem::getDataConst()->m_downLoadDC.m_filename; +} + void hwapi::dcDownloadSetTotalBlockNumber(uint16_t totalBlockNumber) { SharedMem::getData()->m_downLoadDC.m_totalBlocks = totalBlockNumber; }