Compare commits
2 Commits
3581dd4b1d
...
b0f1e0a493
Author | SHA1 | Date | |
---|---|---|---|
b0f1e0a493 | |||
0dffc1d1c2 |
21
update.cpp
21
update.cpp
@ -146,34 +146,33 @@ Update::Update(Worker *worker,
|
||||
QDebug critical = qCritical();
|
||||
critical << "connect() to onReportDCDownloadStatus() ...";
|
||||
if (!connect(obj,
|
||||
SIGNAL(hwapi_reportDCDownloadStatus(QString const&)), this,
|
||||
SLOT(onReportDCDownloadStatus(QString const &)))) {
|
||||
SIGNAL(hwapi_reportDCDownloadStatus(QString const&)),
|
||||
this,
|
||||
SLOT(onReportDCDownloadStatus(QString const &)))) {
|
||||
critical << "FAILED";
|
||||
}
|
||||
critical << "DONE";
|
||||
} else 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";
|
||||
} else 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";
|
||||
} else critical << "DONE";
|
||||
}
|
||||
}
|
||||
|
||||
Update::~Update() {
|
||||
}
|
||||
|
||||
|
||||
void Update::onReportDCDownloadStatus(QString const &status) {
|
||||
emit m_worker->showStatusMessage("DL", status);
|
||||
}
|
||||
@ -645,8 +644,8 @@ bool Update::doUpdate(int &displayIndex, QStringList const &filesToWorkOn) {
|
||||
m_worker->startProgressLoop();
|
||||
QString const &fToWorkOn = QDir::cleanPath(m_customerRepository + QDir::separator() + it->trimmed());
|
||||
if (fToWorkOn.endsWith("/dc2c.bin") && dcDownloadPossible) {
|
||||
qCritical() << "F-TO-WORK-ON" << fToWorkOn;
|
||||
// download for dc possible only once
|
||||
// download of device-controller should always be the last step
|
||||
dcDownloadPossible = false;
|
||||
|
||||
if (!m_hw->dcDownloadRequest(fToWorkOn)) { // initiate download process
|
||||
@ -684,11 +683,11 @@ bool Update::doUpdate(int &displayIndex, QStringList const &filesToWorkOn) {
|
||||
qCritical() << QDateTime::currentDateTime().toString(Qt::ISODate)
|
||||
<< "(" << __func__ << ":" << __LINE__ << ") DOWNLOAD REPORT RUNNING";
|
||||
|
||||
|
||||
while (m_hw->dcDownloadReportRunning()) {
|
||||
QThread::msleep(500);
|
||||
}
|
||||
|
||||
|
||||
bool updateBinaryRes = true;
|
||||
|
||||
// CONSOLE()
|
||||
|
22
worker.cpp
22
worker.cpp
@ -166,7 +166,13 @@ Worker::Worker(int customerNr,
|
||||
// TODO: turn object into singleton
|
||||
instance = this;
|
||||
m_lastFailedUpdateStep = UPDATE_STEP::NONE;
|
||||
m_update = nullptr;
|
||||
m_update = new Update(this,
|
||||
QDir::cleanPath(m_workingDirectory + QDir::separator() + m_customerNrStr),
|
||||
m_customerNrStr,
|
||||
m_branchName,
|
||||
m_pluginDir,
|
||||
m_pluginName,
|
||||
m_workingDirectory);
|
||||
|
||||
this->setObjectName("worker-object");
|
||||
QDir::setCurrent(m_workingDirectory);
|
||||
@ -175,6 +181,10 @@ Worker::Worker(int customerNr,
|
||||
}
|
||||
|
||||
Worker::~Worker() {
|
||||
if (m_update != nullptr) {
|
||||
delete m_update;
|
||||
m_update = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void Worker::displayProgressInMainWindow(int progress) {
|
||||
@ -889,15 +899,7 @@ bool Worker::downloadFilesToPSAHardware() {
|
||||
QStringList lst = m_filesToDownload;
|
||||
ISMAS(lst) << (CONSOLE(lst) << UPDATE_STEP::FILES_TO_DOWNLOAD);
|
||||
|
||||
m_update = new Update(this,
|
||||
QDir::cleanPath(m_workingDirectory + QDir::separator() + m_customerNrStr),
|
||||
m_customerNrStr,
|
||||
m_branchName,
|
||||
m_pluginDir,
|
||||
m_pluginName,
|
||||
m_workingDirectory);
|
||||
|
||||
if (m_update->doUpdate(m_displayIndex, m_filesToDownload)) {
|
||||
if (m_update && m_update->doUpdate(m_displayIndex, m_filesToDownload)) {
|
||||
// prepared for use: at the moment, the dc-library does not work
|
||||
// as expected.
|
||||
|
||||
|
4
worker.h
4
worker.h
@ -249,10 +249,6 @@ class Worker : public QThread{
|
||||
<< UPDATE_STEP::SEND_LAST_VERSION));
|
||||
}
|
||||
m_worker->stopProgressLoop();
|
||||
if (m_worker->m_update != nullptr) {
|
||||
delete m_worker->m_update;
|
||||
m_worker->m_update = nullptr;
|
||||
}
|
||||
m_worker->m_updateProcessRunning = false;
|
||||
emit m_worker->enableExit();
|
||||
emit m_worker->restartExitTimer();
|
||||
|
Loading…
x
Reference in New Issue
Block a user