downLoadJson(): add more debug-output (visible in ISMAS as well)
to see what actuelly went wrong when downloading json-Files.
This commit is contained in:
parent
31bc2d0fa2
commit
8d18ae10fe
@ -400,17 +400,26 @@ bool Update::downloadJson(enum FileTypeJson type,
|
||||
qDebug() << "SET AUTO-REQUEST=TRUE";
|
||||
QThread::sleep(1); // make sure the auto-request flag is acknowledged
|
||||
|
||||
QStringList lst;
|
||||
bool ready = false;
|
||||
int nTry = 25;
|
||||
while ((ready = m_hw->sys_ready4sending()) == false) {
|
||||
QThread::msleep(200);
|
||||
if (--nTry <= 0) {
|
||||
Utils::printCriticalErrorMsg("SYS NOT READY FOR SENDING AFTER 5 SECONDS");
|
||||
QString msg("SYS NOT READY FOR SENDING AFTER 5 SECONDS");
|
||||
Utils::printCriticalErrorMsg(msg);
|
||||
lst << msg;
|
||||
|
||||
if (m_worker) {
|
||||
m_worker->ISMAS(lst) << (m_worker->GUI(lst) << (m_worker->CONSOLE(lst) << Worker::UPDATE_STEP::DOWNLOAD_FILES_TO_PSA_HARDWARE));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool ret = false;
|
||||
QString msg;
|
||||
lst.clear();
|
||||
if (ready) {
|
||||
QFile file(jsFileToSendToDC);
|
||||
QFileInfo fi(jsFileToSendToDC); // max. size of template file is 800 bytes
|
||||
@ -452,20 +461,48 @@ bool Update::downloadJson(enum FileTypeJson type,
|
||||
qCritical() << length << "MACHINE ID =" << ba.toHex(':');
|
||||
*/
|
||||
|
||||
if (m_worker) {
|
||||
m_worker->ISMAS(lst) << (m_worker->GUI(lst) << (m_worker->CONSOLE(lst) << Worker::UPDATE_STEP::DOWNLOAD_FILES_TO_PSA_HARDWARE));
|
||||
}
|
||||
|
||||
ret = true;
|
||||
} else {
|
||||
msg = QString("ERROR SEND JSON-FILE %1 TO DC").arg(file.fileName());
|
||||
Utils::printCriticalErrorMsg(msg);
|
||||
lst << msg;
|
||||
if (m_worker) {
|
||||
m_worker->ISMAS(lst) << (m_worker->GUI(lst) << (m_worker->CONSOLE(lst)
|
||||
<< Worker::UPDATE_STEP::DOWNLOAD_FILES_TO_PSA_HARDWARE));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Utils::printCriticalErrorMsg(
|
||||
QString("SIZE OF %1 TOO BIG (%2 BYTES)")
|
||||
.arg(jsFileToSendToDC).arg(fi.size()));
|
||||
msg = QString("SIZE OF %1 TOO BIG (%2 BYTES)").arg(jsFileToSendToDC).arg(fi.size());
|
||||
Utils::printCriticalErrorMsg(msg);
|
||||
lst << msg;
|
||||
if (m_worker) {
|
||||
m_worker->ISMAS(lst) << (m_worker->GUI(lst) << (m_worker->CONSOLE(lst)
|
||||
<< Worker::UPDATE_STEP::DOWNLOAD_FILES_TO_PSA_HARDWARE));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Utils::printCriticalErrorMsg(
|
||||
QString("CAN NOT OPEN ") + jsFileToSendToDC + " FOR READING");
|
||||
msg = QString("CAN NOT OPEN ") + jsFileToSendToDC + " FOR READING";
|
||||
Utils::printCriticalErrorMsg(msg);
|
||||
lst << msg;
|
||||
|
||||
if (m_worker) {
|
||||
m_worker->ISMAS(lst) << (m_worker->GUI(lst) << (m_worker->CONSOLE(lst)
|
||||
<< Worker::UPDATE_STEP::DOWNLOAD_FILES_TO_PSA_HARDWARE));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Utils::printCriticalErrorMsg(
|
||||
QString(jsFileToSendToDC) + " DOES NOT EXIST");
|
||||
msg = QString(jsFileToSendToDC) + " DOES NOT EXIST";
|
||||
Utils::printCriticalErrorMsg(msg);
|
||||
lst << msg;
|
||||
|
||||
if (m_worker) {
|
||||
m_worker->ISMAS(lst) << (m_worker->GUI(lst) << (m_worker->CONSOLE(lst)
|
||||
<< Worker::UPDATE_STEP::DOWNLOAD_FILES_TO_PSA_HARDWARE));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user