Compare commits
No commits in common. "6176285b89196b5ba2cabba3d7fe5fb6132f4be7" and "fd58f41c87c78e4a50938311a61f3b1f76dd40ce" have entirely different histories.
6176285b89
...
fd58f41c87
@ -75,8 +75,7 @@ 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
|
||||
{
|
||||
@ -88,8 +87,7 @@ private:
|
||||
void sub_storeSendingText(QByteArray *buf) const;
|
||||
QTimer *hwapi_TimerPayment;
|
||||
QSharedMemory *m_sharedMem;
|
||||
ReportingThread *m_reportingThread;
|
||||
DownloadThread *m_downloadThread;
|
||||
//QTimer *hwapi_triggerBL;
|
||||
|
||||
public:
|
||||
explicit hwapi(QWidget *parent = nullptr);
|
||||
@ -1308,8 +1306,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;
|
||||
@ -1322,13 +1320,12 @@ public:
|
||||
void dcDownloadSetCurrentBlockNumber(uint16_t currentBlockNumber) override;
|
||||
uint16_t dcDownloadGetTotalBlockNumber() const override;
|
||||
uint16_t dcDownloadGetCurrentBlockNumber() const override;
|
||||
|
||||
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;
|
||||
void hwapi_reportDCDownloadStatus(QString const &status);
|
||||
void hwapi_reportDCDownloadSuccess(QString const &msg);
|
||||
void hwapi_reportDCDownloadFailure(QString const &errorMsg);
|
||||
|
||||
signals:
|
||||
// already declared in interfaces.h
|
||||
void hwapi_templatePrintFinished_OK(void) const;
|
||||
void hwapi_templatePrintFinished_Err(void) const;
|
||||
|
@ -2,7 +2,6 @@
|
||||
#define INTERFACE_H
|
||||
|
||||
#include <QtPlugin>
|
||||
#include <QString>
|
||||
|
||||
|
||||
|
||||
@ -398,7 +397,6 @@ struct T_bna
|
||||
|
||||
};
|
||||
|
||||
class hwapi;
|
||||
class hwinf
|
||||
{
|
||||
|
||||
@ -2276,10 +2274,10 @@ public:
|
||||
|
||||
|
||||
// download device controller
|
||||
virtual void dcDownloadStart() {}
|
||||
virtual void dcDownloadRequest(QString const &fileToDownload) {
|
||||
virtual void dcDownloadInit(QString const &fileToDownload) {
|
||||
Q_UNUSED(fileToDownload);
|
||||
}
|
||||
virtual void dcDownloadStart() {}
|
||||
virtual bool dcDownloadRequested() const { return false; }
|
||||
virtual void dcDownloadResetRequest() {}
|
||||
virtual QString dcDownloadFileName() const { return ""; }
|
||||
@ -2297,13 +2295,12 @@ public:
|
||||
virtual bool dcDownloadRunning() const { return false; }
|
||||
virtual bool dcDownloadFinished() const { return false; }
|
||||
|
||||
virtual hwapi *getAPI() { return nullptr; }
|
||||
|
||||
signals: // for download
|
||||
void hwapi_reportDCDownloadStatus(QString const &) const;
|
||||
void hwapi_reportDCDownloadSuccess(QString const &) const;
|
||||
void hwapi_reportDCDownloadFailure(QString const &) const;
|
||||
void hwapi_reportDCDownloadStatus(QString const &status);
|
||||
void hwapi_reportDCDownloadSuccess(QString const &msg);
|
||||
void hwapi_reportDCDownloadFailure(QString const &errorMsg);
|
||||
|
||||
signals:
|
||||
// NOTE: declaring a "pure virtual" "signal" should be an error and thus not valid.
|
||||
void hwapi_templatePrintFinished_OK() const;
|
||||
void hwapi_templatePrintFinished_Err() const;
|
||||
|
@ -20,9 +20,6 @@
|
||||
*/
|
||||
|
||||
#include "hwapi.h"
|
||||
#include "reporting_thread.h"
|
||||
#include "download_thread.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
|
||||
@ -4376,11 +4373,7 @@ uint16_t hwapi::bna_getStackerLevel(uint32_t *amountInStacker, uint16_t *countOf
|
||||
return anzahl;
|
||||
}
|
||||
|
||||
hwapi *hwapi::getAPI() {
|
||||
return this;
|
||||
}
|
||||
|
||||
void hwapi::dcDownloadRequest(QString const &dcFileToDownload) {
|
||||
void hwapi::dcDownloadInit(QString const &dcFileToDownload) {
|
||||
char *fNameBuffer = SharedMem::getData()->m_downLoadDC.m_filename;
|
||||
size_t const size = sizeof(SharedMem::getData()->m_downLoadDC.m_filename);
|
||||
|
||||
@ -4399,11 +4392,7 @@ void hwapi::dcDownloadStart() {
|
||||
}
|
||||
|
||||
void hwapi::dcDownloadReportStart() {
|
||||
if (SharedMem::getDataConst()->m_downLoadDC.m_started ||
|
||||
SharedMem::getDataConst()->m_downLoadDC.m_running) {
|
||||
m_reportingThread = new ReportingThread(this);
|
||||
m_reportingThread->start();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
bool hwapi::dcDownloadRequested() const {
|
||||
|
@ -13,13 +13,7 @@ ReportingThread::~ReportingThread() {
|
||||
// download thread running in ca-slave sends reports download process to
|
||||
// update tool
|
||||
void ReportingThread::run() {
|
||||
hwapi *hw = m_hw->getAPI();
|
||||
emit hw->hwapi_reportDCDownloadStatus("test");
|
||||
|
||||
qCritical() << "nach emit";
|
||||
QThread::sleep(4);
|
||||
|
||||
#if 0
|
||||
int cnt = 10;
|
||||
while (!m_hw->dcDownloadRunning()) {
|
||||
if (--cnt > 0) {
|
||||
@ -58,5 +52,4 @@ void ReportingThread::run() {
|
||||
QString("ERROR DOWNLOADING %1 (total blocks=%2, sent blocks=%3)")
|
||||
.arg(m_fileToDownload).arg(tnr).arg(cnr));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user