Activate downloading device controller.
This commit is contained in:
parent
b45f3a04b4
commit
4e92522578
29
update.cpp
29
update.cpp
@ -488,28 +488,20 @@ bool Update::doUpdate(int &displayIndex, QStringList const &filesToWorkOn) {
|
||||
for (it = filesToWorkOn.cbegin(); it != filesToWorkOn.cend(); ++it) {
|
||||
m_worker->startProgressLoop();
|
||||
QString const &fToWorkOn = QDir::cleanPath(m_customerRepository + QDir::separator() + it->trimmed());
|
||||
#if UPDATE_DC == 1
|
||||
static const QRegularExpression version("^.*dc2c[.][0-9]{1,2}[.][0-9]{1,2}[.]bin.*$");
|
||||
if (fToWorkOn.contains(version)) {
|
||||
Utils::printInfoMsg("DO-UPDATE FILE-TO-WORK-ON " + fToWorkOn);
|
||||
|
||||
QFile fn(fToWorkOn);
|
||||
QFileInfo finfo(fn);
|
||||
if (!fn.exists()) { // check for broken link
|
||||
Utils::printCriticalErrorMsg("DO-UPDATE FILE-TO-WORK-ON "
|
||||
+ fToWorkOn + " DOES NOT EXIST");
|
||||
res = false;
|
||||
} else {
|
||||
bool updateBinaryRes = true;
|
||||
|
||||
qInfo() << "DOWNLOADING" << finfo.completeBaseName() << "TO DC";
|
||||
// CONSOLE()
|
||||
|
||||
m_hw->dc_autoRequest(false);// default: turn auto-request setting off
|
||||
QThread::sleep(1); // wait to be sure that there are no more
|
||||
// commands sent to dc-hardware
|
||||
qInfo() << "SET AUTO-REQUEST=FALSE";
|
||||
|
||||
if ((updateBinaryRes = updateBinary(fToWorkOn.toStdString().c_str())) == true) {
|
||||
qCritical() << "downloaded binary" << fToWorkOn;
|
||||
if ((updateBinaryRes = updateBinary(fToWorkOn)) == true) {
|
||||
|
||||
// qCritical() << "downloaded binary" << fToWorkOn;
|
||||
|
||||
++displayIndex;
|
||||
emit m_worker->appendText(QString("\n(") + QString("%1").arg(displayIndex).rightJustified(2, ' ') + QString(")")
|
||||
+ QString(" Update ") + QFileInfo(fToWorkOn).fileName(),
|
||||
@ -517,7 +509,8 @@ bool Update::doUpdate(int &displayIndex, QStringList const &filesToWorkOn) {
|
||||
}
|
||||
|
||||
m_hw->dc_autoRequest(true); // turn auto-request setting on
|
||||
qInfo() << "SET AUTO-REQUEST=TRUE";
|
||||
|
||||
// qInfo() << "SET AUTO-REQUEST=TRUE";
|
||||
|
||||
QStringList const &versions = Update::getDcSoftAndHardWareVersion();
|
||||
if (versions.size() >= 2) {
|
||||
@ -529,10 +522,10 @@ bool Update::doUpdate(int &displayIndex, QStringList const &filesToWorkOn) {
|
||||
qInfo() << "dc-firmware-version (NOT UPDATED)" << versions[1];
|
||||
}
|
||||
}
|
||||
|
||||
res = updateBinaryRes;
|
||||
}
|
||||
#endif
|
||||
if (fToWorkOn.contains("DC2C_print", Qt::CaseInsensitive)
|
||||
|
||||
} else if (fToWorkOn.contains("DC2C_print", Qt::CaseInsensitive)
|
||||
&& fToWorkOn.endsWith(".json", Qt::CaseInsensitive)) {
|
||||
res = true;
|
||||
int i = fToWorkOn.indexOf("DC2C_print", Qt::CaseInsensitive);
|
||||
|
Loading…
Reference in New Issue
Block a user