Connect slots

void onReportDCDownloadStatus(QString const &status);
    void onReportDCDownloadSuccess(QString const &msg);
    void onReportDCDownloadFailure(QString const &errorMsg);
This commit is contained in:
Gerhard Hoffmann 2024-02-05 16:30:41 +01:00
parent e2e7c0772d
commit 8d2d7bbb15

View File

@ -123,26 +123,51 @@ Update::Update(Worker *worker,
, m_dryRun(dryRun) , m_dryRun(dryRun)
, m_sys_areDCdataValid(false) { , m_sys_areDCdataValid(false) {
int tries = 20; if (!m_hw) {
while ((m_sys_areDCdataValid = m_hw->sys_areDCdataValid()) == false) { qCritical() << "(" << __func__ << ":" << __LINE__ << ") m_hw == nullptr -> ca-slave plugin loaded ???";
// must deliver 'true', only then are all data from hwapi valid } else {
if (--tries < 0) { int tries = 20;
qCritical() << "ERROR!!! DC DATA NOT VALID -> CA-MASTER-PLUGIN NOT CONNECTED"; while ((m_sys_areDCdataValid = m_hw->sys_areDCdataValid()) == false) {
break; // must deliver 'true', only then are all data from hwapi valid
if (--tries < 0) {
qCritical() << "ERROR!!! DC DATA NOT VALID -> CA-MASTER-PLUGIN NOT CONNECTED";
break;
}
m_hw->dc_autoRequest(true);
QThread::msleep(500);
} }
m_hw->dc_autoRequest(true);
QThread::msleep(500); qCritical() << "(" << __func__ << ":" << __LINE__ << ") m_sys_areDCDataValid ..."
<< m_sys_areDCdataValid;
QObject const *obj = m_hw->getAPI();
Q_ASSERT(obj != nullptr);
QDebug critical = qCritical();
critical << "connect() to onReportDCDownloadStatus() ...";
if (!connect(obj,
SIGNAL(hwapi_reportDCDownloadStatus(QString const&)), this,
SLOT(onReportDCDownloadStatus(QString const &)))) {
critical << "FAILED";
}
critical << "DONE";
critical = qCritical();
critical << "connect() to onReportDCDownloadSuccess() ...";
if (!connect(obj,
SIGNAL(hwapi_reportDCDownloadSuccess(QString const&)), this,
SLOT(onReportDCDownloadSuccess(QString const &)))) {
critical << "FAILED";
}
critical << "DONE";
critical = qCritical();
critical << "connect() to onReportDCDownloadFailure() ...";
if (!connect(obj,
SIGNAL(hwapi_reportDCDownloadFailure(QString const &)), this,
SLOT(onReportDCDownloadFailure(QString const &)))) {
critical << "FAILED";
}
critical << "DONE";
} }
qCritical() << __PRETTY_FUNCTION__ << "m_sys_areDCDataValid ..." << m_sys_areDCdataValid;
//qInfo() << "UPDATE: m_serialInterface ..." << m_serialInterface;
//qInfo() << "UPDATE: m_baudrate ..." << m_baudrate;
//qInfo() << "UPDATE: m_customerRepository ..." << m_customerRepository;
//qInfo() << "UPDATE: m_customerNr ..........." << m_customerNrStr;
//qInfo() << "UPDATE: m_branchName ..........." << m_branchName;
//qInfo() << "UPDATE: m_pluginName ..........." << m_pluginName;
//qInfo() << "UPDATE: m_workingDirectory ....." << m_workingDir;
} }
Update::~Update() { Update::~Update() {