Minor: Add debug messages or change debug message format.
This commit is contained in:
parent
7083f3b4f8
commit
30603317c6
28
update.cpp
28
update.cpp
@ -610,9 +610,12 @@ bool Update::downloadJson(enum FileTypeJson type,
|
||||
int templateIdx,
|
||||
QString jsFileToSendToDC) const {
|
||||
|
||||
qDebug() << "updating json-file:" << jsFileToSendToDC << "...";
|
||||
qDebug() << " template-index:" << templateIdx;
|
||||
qDebug() << " json-type:" << jsonType(type);
|
||||
|
||||
Utils::printInfoMsg(
|
||||
QString("UPDATING JSON-FILE=%1, TEMPLATE-INDEX=%2, JSON-TYPE=%3")
|
||||
.arg(jsFileToSendToDC)
|
||||
.arg(templateIdx)
|
||||
.arg(jsonType(type)));
|
||||
|
||||
m_hw->dc_autoRequest(true); // downloading Json needs the AutoEmission flag
|
||||
qDebug() << "SET AUTO-REQUEST=TRUE";
|
||||
@ -623,7 +626,7 @@ bool Update::downloadJson(enum FileTypeJson type,
|
||||
while ((ready = m_hw->sys_ready4sending()) == false) {
|
||||
QThread::msleep(200);
|
||||
if (--nTry <= 0) {
|
||||
qCritical() << "SYS NOT READY FOR SENDING AFTER 5 SECONDS";
|
||||
Utils::printCriticalErrorMsg("SYS NOT READY FOR SENDING AFTER 5 SECONDS");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -636,22 +639,27 @@ bool Update::downloadJson(enum FileTypeJson type,
|
||||
if (file.open(QIODevice::ReadOnly)) {
|
||||
if (fi.size() <= 800) {
|
||||
QByteArray ba = file.readAll();
|
||||
// kindOfFile: 1=config, 2=device, 3=cash, 4=serial, 5=time, 6=printer
|
||||
// nrOfTemplate=1...32 if kindOfFile==6
|
||||
// content = content of the Json file, max 800byte ascii signs
|
||||
if (m_hw->sys_sendJsonFileToDc((uint8_t)(type),
|
||||
templateIdx,
|
||||
(uint8_t *)ba.data())) {
|
||||
QThread::sleep(1);
|
||||
qDebug() << "SENT" << jsFileToSendToDC;
|
||||
ret = true;
|
||||
}
|
||||
} else {
|
||||
qCritical() << "SIZE OF" << jsFileToSendToDC
|
||||
<< "TOO BIG (" << fi.size() << "BYTES)";
|
||||
Utils::printCriticalErrorMsg(
|
||||
QString("SIZE OF %1 TOO BIG (%2 BYTES)")
|
||||
.arg(jsFileToSendToDC).arg(fi.size()));
|
||||
}
|
||||
} else {
|
||||
qCritical() << "CANNOT OPEN" << jsFileToSendToDC << "FOR READING";
|
||||
Utils::printCriticalErrorMsg(
|
||||
QString("CAN NOT OPEN ") + jsFileToSendToDC + " FOR READING");
|
||||
}
|
||||
} else {
|
||||
qCritical() << jsFileToSendToDC << "DOES NOT EXIST";
|
||||
Utils::printCriticalErrorMsg(
|
||||
QString(jsFileToSendToDC) + " DOES NOT EXIST");
|
||||
}
|
||||
}
|
||||
|
||||
@ -871,7 +879,7 @@ bool Update::doUpdate(int &displayIndex, QStringList const &filesToWorkOn) {
|
||||
res = true;
|
||||
#if UPDATE_CASH_TEMPLATE == 1
|
||||
if ((res = updateCashConf(fToWorkOn))) {
|
||||
qInfo() << "downloaded cash template"<< fToWorkOn;
|
||||
Utils::printInfoMsg(QString("DOWNLOADED CASH TEMPLATE %1").arg(fToWorkOn));
|
||||
++displayIndex;
|
||||
emit m_worker->appendText(QString("\n(") + QString("%1").arg(displayIndex).rightJustified(2, ' ') + QString(")")
|
||||
+ QString(" Update ") + QFileInfo(fToWorkOn).fileName(),
|
||||
|
Loading…
Reference in New Issue
Block a user