Merge remote-tracking branch 'UpdatePTUDevCtrl/dc-download'
This commit is contained in:
@@ -165,8 +165,14 @@ Worker::Worker(int customerNr,
|
||||
|
||||
// TODO: turn object into singleton
|
||||
instance = this;
|
||||
|
||||
m_lastFailedUpdateStep = UPDATE_STEP::NONE;
|
||||
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) {
|
||||
@@ -751,7 +761,7 @@ bool Worker::filesToUpdate() {
|
||||
}
|
||||
m_filesToUpdate.removeDuplicates();
|
||||
|
||||
qCritical() << __PRETTY_FUNCTION__ << "FILES-TO-UPDATE" << m_filesToUpdate;
|
||||
qCritical() << "(" << __func__ << ":" << __LINE__ << ") FILES-TO-UPDATE" << m_filesToUpdate;
|
||||
|
||||
GUI(m_filesToUpdate) << (CONSOLE(m_filesToUpdate) << UPDATE_STEP::FILES_TO_UPDATE);
|
||||
setProgress(_FILES_TO_UPDATE);
|
||||
@@ -888,15 +898,7 @@ bool Worker::downloadFilesToPSAHardware() {
|
||||
QStringList lst = m_filesToDownload;
|
||||
ISMAS(lst) << (CONSOLE(lst) << UPDATE_STEP::FILES_TO_DOWNLOAD);
|
||||
|
||||
Update update(this,
|
||||
QDir::cleanPath(m_workingDirectory + QDir::separator() + m_customerNrStr),
|
||||
m_customerNrStr,
|
||||
m_branchName,
|
||||
m_pluginDir,
|
||||
m_pluginName,
|
||||
m_workingDirectory);
|
||||
|
||||
if (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.
|
||||
|
||||
@@ -1060,6 +1062,17 @@ QString Worker::getAPISMYoctoInstallationStatus() {
|
||||
return "N/A";
|
||||
}
|
||||
|
||||
QString Worker::getDCVersionPreparedForDownload(QString const &filename) {
|
||||
if (QFile::exists(filename)) { // <customer-repo/etc/dc/dc2c.bin>
|
||||
QString const cmd = QString("strings %1 | grep -e DC2[Cc]\\. | head -n1").arg(filename);
|
||||
Command c("bash");
|
||||
if (c.execute("/tmp", QStringList() << "-c" << cmd)) {
|
||||
return c.getCommandResult(); // DC2c.04.42 14.09.2023
|
||||
}
|
||||
}
|
||||
return "N/A";
|
||||
}
|
||||
|
||||
|
||||
QString Worker::getATBQTVersion() const {
|
||||
QString const cmd = QString("echo -n $(/opt/app/ATBAPP/ATBQT -v | head -n 2 | cut -d':' -f2)");
|
||||
@@ -1184,7 +1197,9 @@ PSAInstalled Worker::getPSAInstalled() {
|
||||
if (m_versionInfo.size() == 3) {
|
||||
qCritical() << QString("***** %1:%2").arg(__func__).arg(__LINE__)
|
||||
<< "m_versionInfo" << m_versionInfo << "*****";
|
||||
psaInstalled.versionInfo.lastCommit = m_versionInfo.at(0);
|
||||
psaInstalled.versionInfo.lastCommit = QString("%1-%2")
|
||||
.arg(QCoreApplication::applicationPid())
|
||||
.arg(m_versionInfo.at(0));
|
||||
psaInstalled.versionInfo.reason = m_versionInfo.at(1);
|
||||
psaInstalled.versionInfo.created = m_versionInfo.at(2);
|
||||
}
|
||||
|
Reference in New Issue
Block a user