Start download thread when requested.
This commit is contained in:
parent
392b849a9b
commit
6005fddc66
@ -9,10 +9,14 @@ History:
|
||||
#include "sendWRcmd.h"
|
||||
#include "controlBus.h"
|
||||
#include "storeINdata.h"
|
||||
#include "download_thread.h"
|
||||
|
||||
|
||||
#include <QDebug>
|
||||
#include <datei.h>
|
||||
#include <QDir>
|
||||
|
||||
#include <QString>
|
||||
#include <QDateTime>
|
||||
|
||||
|
||||
|
||||
@ -54,8 +58,10 @@ static uint8_t datif_pNextCmd, datif_sendSlowCmd;
|
||||
//#define DATIF_CTR_GOTRESPVAL 100
|
||||
|
||||
|
||||
T_datif::T_datif(QObject *parent) : QObject(parent)
|
||||
T_datif::T_datif(hwinf *hw, QObject *parent) : QObject(parent)
|
||||
{
|
||||
m_hw = hw;
|
||||
|
||||
QByteArray myBA;
|
||||
QDir myDir("../dmd");
|
||||
|
||||
@ -170,10 +176,22 @@ char T_datif::datif_cycleSend()
|
||||
// b) Antwort meldet Fehler -> 2x wiederholen (nach einer Luecke von 10ms )
|
||||
// c) gar keine Antwort, Timeout nach 100ms -> 2x wiederholen (nach einer Luecke von 10ms )
|
||||
// cycl_running=0: nichts zu tun 1: Mitteilung: Kommando wurde soeben abgesendet, 2,3,4 = Wiederholung
|
||||
if (cycl_running == 0) {
|
||||
if (m_hw) {
|
||||
if (m_hw->dcDownloadRequested()) { // only happens in ca-master
|
||||
qCritical() << "DOWNLOAD REQUESTED";
|
||||
if (!m_hw->dcDownloadThreadStart()) {
|
||||
qCritical() << "DOWNLOAD-THREAD NOT RUNNING WITHIN 1000ms";
|
||||
} else {
|
||||
qCritical() << "DOWNLOAD-THREAD RUNNING";
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 21.9.23 doRepeat hier raus sonst gehts warten auch nicht mehr (BL)
|
||||
// if (cycl_running && doRepeat)
|
||||
|
||||
if (cycl_running) // 21.9.23 doRepeat hier raus sonst gehts warten auch nicht mehr (BL)
|
||||
// if (cycl_running && doRepeat)
|
||||
{
|
||||
// request is still running, wait for response before next sending
|
||||
//qDebug()<< "datif wait for response";
|
||||
datif_trigger->stop();
|
||||
|
Loading…
Reference in New Issue
Block a user