Save as changing to master.
This commit is contained in:
		@@ -1309,12 +1309,14 @@ public:
 | 
			
		||||
 | 
			
		||||
    // download device controller
 | 
			
		||||
    void dcDownloadStart() override;
 | 
			
		||||
    void dcDownloadRequest(QString const &fileToDownload) override;
 | 
			
		||||
    bool dcDownloadFinished() override;
 | 
			
		||||
    bool dcDownloadRequest(QString const &fileToDownload) override;
 | 
			
		||||
    bool dcDownloadRequested() const override;
 | 
			
		||||
    QString dcDownloadFileName() const override;
 | 
			
		||||
    void dcDownloadResetRequest() override;
 | 
			
		||||
    bool dcDownloadResetRequest() override;
 | 
			
		||||
    void dcDownloadReportStart() override;
 | 
			
		||||
    bool dcDownloadStarted() const override;
 | 
			
		||||
    bool dcDownloadReportRunning() override;
 | 
			
		||||
    bool dcDownloadReportFinished() override;
 | 
			
		||||
    bool dcDownloadRunning() const override;
 | 
			
		||||
    bool dcDownloadFinished() const override;
 | 
			
		||||
 | 
			
		||||
@@ -1323,12 +1325,12 @@ public:
 | 
			
		||||
    uint16_t dcDownloadGetTotalBlockNumber() const override;
 | 
			
		||||
    uint16_t dcDownloadGetCurrentBlockNumber() const override;
 | 
			
		||||
 | 
			
		||||
    virtual hwapi *getAPI() override;
 | 
			
		||||
    virtual QObject const *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&) 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;
 | 
			
		||||
 
 | 
			
		||||
@@ -2277,13 +2277,17 @@ public:
 | 
			
		||||
 | 
			
		||||
    // download device controller
 | 
			
		||||
    virtual void dcDownloadStart() {}
 | 
			
		||||
    virtual void dcDownloadRequest(QString const &fileToDownload) {
 | 
			
		||||
       Q_UNUSED(fileToDownload);
 | 
			
		||||
    virtual bool dcDownloadFinished() { return true; }
 | 
			
		||||
    virtual bool dcDownloadRequest(QString const &fileToDownload) {
 | 
			
		||||
        Q_UNUSED(fileToDownload);
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
    virtual bool dcDownloadRequested() const { return false; }
 | 
			
		||||
    virtual void dcDownloadResetRequest() {}
 | 
			
		||||
    virtual bool dcDownloadResetRequest() { return false; }
 | 
			
		||||
    virtual QString dcDownloadFileName() const { return ""; }
 | 
			
		||||
    virtual void dcDownloadReportStart() {}
 | 
			
		||||
    virtual bool dcDownloadReportRunning() { return true; }
 | 
			
		||||
    virtual bool dcDownloadReportFinished() { return true; }
 | 
			
		||||
    virtual void dcDownloadSetTotalBlockNumber(uint16_t totalBlockNumber) {
 | 
			
		||||
       Q_UNUSED(totalBlockNumber);
 | 
			
		||||
    }
 | 
			
		||||
@@ -2293,16 +2297,15 @@ public:
 | 
			
		||||
    virtual uint16_t dcDownloadGetTotalBlockNumber() const { return 0; }
 | 
			
		||||
    virtual uint16_t dcDownloadGetCurrentBlockNumber() const { return 0; }
 | 
			
		||||
 | 
			
		||||
    virtual bool dcDownloadStarted() const { return false; }
 | 
			
		||||
    virtual bool dcDownloadRunning() const { return false; }
 | 
			
		||||
    virtual bool dcDownloadFinished() const { return false; }
 | 
			
		||||
 | 
			
		||||
    virtual hwapi *getAPI() { return nullptr; }
 | 
			
		||||
    virtual QObject const *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&) const;
 | 
			
		||||
    void hwapi_reportDCDownloadSuccess(QString const&) const;
 | 
			
		||||
    void hwapi_reportDCDownloadFailure(QString const&) const;
 | 
			
		||||
 | 
			
		||||
    // NOTE: declaring a "pure virtual" "signal" should be an error and thus not valid.
 | 
			
		||||
    void hwapi_templatePrintFinished_OK() const;
 | 
			
		||||
 
 | 
			
		||||
@@ -4,12 +4,12 @@
 | 
			
		||||
#include <QThread>
 | 
			
		||||
#include <QString>
 | 
			
		||||
 | 
			
		||||
class hwinf;
 | 
			
		||||
class hwapi;
 | 
			
		||||
class ReportingThread : public QThread {
 | 
			
		||||
    Q_OBJECT
 | 
			
		||||
 | 
			
		||||
public:
 | 
			
		||||
    ReportingThread(hwinf *hw);
 | 
			
		||||
    ReportingThread(hwapi *hw);
 | 
			
		||||
    ~ReportingThread();
 | 
			
		||||
 | 
			
		||||
protected:
 | 
			
		||||
@@ -18,7 +18,7 @@ protected:
 | 
			
		||||
    void run() override;
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
    hwinf *m_hw;
 | 
			
		||||
    hwapi *m_hw;
 | 
			
		||||
    QString m_fileToDownload;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -304,14 +304,13 @@ struct SharedMem
 | 
			
		||||
    // download of device controller and json files
 | 
			
		||||
    struct DCDownload {
 | 
			
		||||
        char m_filename[512];
 | 
			
		||||
        uint16_t m_totalBlocks;
 | 
			
		||||
        uint16_t m_currentblockNumber;
 | 
			
		||||
        bool m_running;
 | 
			
		||||
        bool m_started;
 | 
			
		||||
        bool m_finished;
 | 
			
		||||
        std::atomic_ushort m_totalBlocks;
 | 
			
		||||
        std::atomic_ushort m_currentblockNumber;
 | 
			
		||||
        std::atomic_bool m_requested{false};
 | 
			
		||||
        std::atomic_bool m_running{false};
 | 
			
		||||
        std::atomic_bool m_finished{false};
 | 
			
		||||
    } m_downLoadDC;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    static QSharedMemory *getShm(std::size_t s = 0);
 | 
			
		||||
 | 
			
		||||
    static SharedMem *getData()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user