Save for the weekend.
This commit is contained in:
497
worker.cpp
497
worker.cpp
@@ -17,8 +17,6 @@
|
||||
#include <QJsonParseError>
|
||||
#include <Qt>
|
||||
|
||||
#include <thread>
|
||||
|
||||
#include "message_handler.h"
|
||||
#include "plugins/interfaces.h"
|
||||
#include "ismas/ismas_client.h"
|
||||
@@ -31,6 +29,8 @@ QString const Worker::UPDATE_STEP_DONE(" [done]");
|
||||
QString const Worker::UPDATE_STEP_FAIL(" [FAIL]");
|
||||
QString const Worker::UPDATE_STEP_SUCCESS(" [SUCCESS]");
|
||||
|
||||
Worker const *Worker::instance = nullptr;
|
||||
|
||||
Worker::Worker(int customerNr,
|
||||
int machineNr,
|
||||
int zoneNr,
|
||||
@@ -73,10 +73,12 @@ Worker::Worker(int customerNr,
|
||||
, m_updateProcessRunning(true)
|
||||
, m_returnCode(0)
|
||||
, m_mainWindow(nullptr) /* contains plugin */
|
||||
, m_progressValue(0)
|
||||
//, m_withoutIsmasDirectPort(true) /* useful for testing */ {
|
||||
, m_withoutIsmasDirectPort(false) /* useful for testing */ {
|
||||
|
||||
// TODO: turn object into singleton
|
||||
instance = this;
|
||||
|
||||
this->setObjectName("worker-object");
|
||||
QDir::setCurrent(m_workingDirectory);
|
||||
|
||||
@@ -127,19 +129,25 @@ Worker::~Worker() {
|
||||
}
|
||||
}
|
||||
|
||||
void Worker::setProgress(int progress) {
|
||||
void Worker::displayProgressInMainWindow(int progress) {
|
||||
if (m_mainWindow) {
|
||||
m_progressValue = progress;
|
||||
QApplication::postEvent(m_mainWindow, new ProgressEvent(this, progress));
|
||||
QApplication::postEvent(m_mainWindow,
|
||||
new ProgressEvent(this, progress));
|
||||
}
|
||||
}
|
||||
|
||||
void Worker::setProgress(int progress) {
|
||||
m_ismasClient.setProgressInPercent(progress);
|
||||
displayProgressInMainWindow(progress);
|
||||
}
|
||||
|
||||
|
||||
void Worker::startProgressLoop() {
|
||||
QApplication::postEvent(m_mainWindow, new ProgressEvent(this, MainWindow::START_PROGRESS_LOOP));
|
||||
displayProgressInMainWindow(MainWindow::START_PROGRESS_LOOP);
|
||||
}
|
||||
|
||||
void Worker::stopProgressLoop() {
|
||||
QApplication::postEvent(m_mainWindow, new ProgressEvent(this, MainWindow::STOP_PROGRESS_LOOP));
|
||||
displayProgressInMainWindow(MainWindow::STOP_PROGRESS_LOOP);
|
||||
}
|
||||
|
||||
static std::once_flag once;
|
||||
@@ -154,9 +162,10 @@ bool Worker::isRepositoryCorrupted() {
|
||||
QDir customerRepositoryEtc(QDir::cleanPath(m_customerRepository + QDir::separator() + "etc/"));
|
||||
QDir customerRepositoryOpt(QDir::cleanPath(m_customerRepository + QDir::separator() + "opt/"));
|
||||
QDir customerRepositoryGit(QDir::cleanPath(m_customerRepository + QDir::separator() + ".git/"));
|
||||
// etc-directory inside git-repository does not exist, which means the
|
||||
// git-repository is corrupted -> remove it and start from scratch
|
||||
if (!customerRepositoryEtc.exists()
|
||||
if (!m_gc.gitFsck()
|
||||
// etc-directory inside git-repository does not exist, which means the
|
||||
// git-repository is corrupted -> remove it and start from scratch
|
||||
|| !customerRepositoryEtc.exists()
|
||||
|| !customerRepositoryGit.exists()
|
||||
|| !customerRepositoryOpt.exists()) {
|
||||
// should never happen
|
||||
@@ -164,7 +173,6 @@ bool Worker::isRepositoryCorrupted() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -182,17 +190,14 @@ bool Worker::repairCorruptedRepository() {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
int Worker::sendCloneAndCheckoutFailure() {
|
||||
stopProgressLoop();
|
||||
setProgress(0);
|
||||
m_updateStatus = UpdateStatus(UPDATE_STATUS::GIT_CLONE_AND_CHECKOUT_FAILURE,
|
||||
QString("CLONE OR CHECKOUT FAILED: ") + m_customerRepository);
|
||||
IsmasClient::sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT,
|
||||
QString("#M=APISM#C=CMD_EVENT#J=") +
|
||||
m_ismasClient.errorGitClone(100, m_updateStatus.m_statusDescription));
|
||||
m_ismasClient.errorGitClone(m_updateStatus.m_statusDescription));
|
||||
|
||||
return CLONE_AND_CHECKOUT_FAILURE;
|
||||
}
|
||||
@@ -212,8 +217,6 @@ int Worker::sendCloneAndCheckoutSuccess() {
|
||||
}
|
||||
|
||||
int Worker::sendIsmasTriggerFailure() {
|
||||
stopProgressLoop();
|
||||
setProgress(0);
|
||||
m_updateStatus = UpdateStatus(UPDATE_STATUS::ISMAS_UPDATE_TRIGGER_SET_FAILURE,
|
||||
QString("ISMAS update trigger wrong"));
|
||||
IsmasClient::sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT,
|
||||
@@ -224,6 +227,172 @@ int Worker::sendIsmasTriggerFailure() {
|
||||
return ISMAS_TRIGGER_FAILURE;
|
||||
}
|
||||
|
||||
int Worker::sendCustomerEnvironmentConfigurationFailed() {
|
||||
m_updateStatus = UpdateStatus(UPDATE_STATUS::GIT_CHECKOUT_BRANCH_FAILURE,
|
||||
QString("Configuring customer environment failed"));
|
||||
IsmasClient::sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT,
|
||||
QString("#M=APISM#C=CMD_EVENT#J=") +
|
||||
m_ismasClient.updateOfPSAFailed(IsmasClient::RESULT_CODE::INSTALL_ERROR,
|
||||
"GIT-CHECKOUT-BRANCH",
|
||||
m_updateStatus.m_statusDescription));
|
||||
return ENVIRONMENT_CONFIG_FAILURE;
|
||||
}
|
||||
|
||||
int Worker::sendPullFailure() {
|
||||
m_updateStatus = UpdateStatus(UPDATE_STATUS::GIT_FETCH_UPDATES_REQUEST_FAILURE,
|
||||
QString("No files to update"));
|
||||
IsmasClient::sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT,
|
||||
QString("#M=APISM#C=CMD_EVENT#J=") +
|
||||
m_ismasClient.updateOfPSAFailed(IsmasClient::RESULT_CODE::INSTALL_ERROR,
|
||||
"FETCH-FILES-TO-UPDATE",
|
||||
m_updateStatus.m_statusDescription));
|
||||
return GIT_PULL_FAILURE;
|
||||
}
|
||||
|
||||
int Worker::sendFileUpdateFailure() {
|
||||
m_updateStatus = UpdateStatus(UPDATE_STATUS::PSA_UPDATE_FILES_FAILED,
|
||||
QString("Updating files failed"));
|
||||
IsmasClient::sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT,
|
||||
QString("#M=APISM#C=CMD_EVENT#J=") +
|
||||
m_ismasClient.updateOfPSAFailed(IsmasClient::RESULT_CODE::INSTALL_ERROR,
|
||||
"UPDATE-FILES",
|
||||
m_updateStatus.m_statusDescription));
|
||||
return UPDATE_FILES_FAILURE;
|
||||
}
|
||||
|
||||
int Worker::sendRsyncFailure() {
|
||||
m_updateStatus = UpdateStatus(UPDATE_STATUS::RSYNC_UPDATES_FAILURE,
|
||||
QString("Syncing files to update failed"));
|
||||
IsmasClient::sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT,
|
||||
QString("#M=APISM#C=CMD_EVENT#J=") +
|
||||
m_ismasClient.updateOfPSAFailed(IsmasClient::RESULT_CODE::INSTALL_ERROR,
|
||||
"RSYNC-UPDATE-FILES",
|
||||
m_updateStatus.m_statusDescription));
|
||||
|
||||
return RSYNC_FAILURE;
|
||||
}
|
||||
|
||||
int Worker::sendLastVersionFailure() {
|
||||
m_updateStatus = UpdateStatus(UPDATE_STATUS::ISMAS_SEND_LAST_VERSION_FAILED,
|
||||
QString("Sending ISMAS last version failed"));
|
||||
IsmasClient::sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT,
|
||||
QString("#M=APISM#C=CMD_EVENT#J=") +
|
||||
m_ismasClient.updateOfPSAFailed(IsmasClient::RESULT_CODE::INSTALL_ERROR,
|
||||
"ISMAS-SEND-LAST-VERSION",
|
||||
m_updateStatus.m_statusDescription));
|
||||
return SEND_LAST_VERSION_FAILURE;
|
||||
}
|
||||
|
||||
int Worker::sendSaveLogFilesFailure() {
|
||||
m_updateStatus = UpdateStatus(UPDATE_STATUS::SAVE_LOG_FILES_FAILED,
|
||||
QString("Saving log files failed"));
|
||||
IsmasClient::sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT,
|
||||
QString("#M=APISM#C=CMD_EVENT#J=") +
|
||||
m_ismasClient.updateOfPSAFailed(IsmasClient::RESULT_CODE::INSTALL_ERROR,
|
||||
"SAVE-LOG-FILES",
|
||||
m_updateStatus.m_statusDescription));
|
||||
return SAVE_LOG_FILES_FAILURE;
|
||||
}
|
||||
|
||||
int Worker::sendFoundFilesToUpdateSuccess() {
|
||||
m_updateStatus = UpdateStatus(UPDATE_STATUS::GIT_CHECK_FILES_TO_UPDATE_SUCCESS,
|
||||
QString("Files to update: ") + m_filesToUpdate.join(','));
|
||||
IsmasClient::sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT,
|
||||
QString("#M=APISM#C=CMD_EVENT#J=") +
|
||||
m_ismasClient.updateOfPSAContinues("CHECK-FILES-TO-UPDATE",
|
||||
m_updateStatus.m_statusDescription));
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Worker::sendUpdateSucceededAndActivated() {
|
||||
IsmasClient::sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT,
|
||||
QString("#M=APISM#C=CMD_EVENT#J=") +
|
||||
m_ismasClient.updateOfPSASucceeded(""));
|
||||
|
||||
//m_ismasClient.setProgressInPercent(100);
|
||||
|
||||
// mark update as activated -> this resets the WAIT button
|
||||
IsmasClient::sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT,
|
||||
QString("#M=APISM#C=CMD_EVENT#J=") +
|
||||
m_ismasClient.updateOfPSAActivated());
|
||||
|
||||
return UPDATE_SUCCESS_AND_ACTIVATED;
|
||||
}
|
||||
|
||||
int Worker::sendFinalResult() {
|
||||
m_updateStatus = UpdateStatus(UPDATE_STATUS::UPDATE_PROCESS_SUCCESS,
|
||||
QString("Update process succeeded. Reset WAIT."));
|
||||
if (std::optional<QString> s = m_ismasClient.finalResult(IsmasClient::RESULT_CODE::SUCCESS,
|
||||
m_updateStatus.m_statusDescription)) {
|
||||
IsmasClient::sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT,
|
||||
QString("#M=APISM#C=CMD_EVENT#J=") + s.value());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#if 0
|
||||
void Worker::printProgress(UPDATE_STEP step) {
|
||||
switch(step) {
|
||||
case UPDATE_STEP::SANITY_CHECK:
|
||||
Utils::printUpdateStatusMsg(
|
||||
QStringList()
|
||||
<< QString("STEP 1: CHECKED SANITY OF CUSTOMER REPOSITORY %1 DONE")
|
||||
.arg(m_customerRepository)
|
||||
<< QString("STEP 2: FETCH CUSTOMER REPOSITORY %1...")
|
||||
.arg(m_customerRepository));
|
||||
break;
|
||||
case UPDATE_STEP::FETCH_REPOSITORY:
|
||||
Utils::printUpdateStatusMsg(
|
||||
QStringList()
|
||||
<< QString("STEP 2: FETCHED CUSTOMER REPOSITORY %1 DONE")
|
||||
.arg(m_customerRepository)
|
||||
<< QString("STEP 3: CHECK ISMAS-UPDATE-TRIGGER FOR WAIT-STATUS..."));
|
||||
break;
|
||||
case UPDATE_STEP::CHECK_ISMAS_TRIGGER:
|
||||
Utils::printUpdateStatusMsg(
|
||||
QStringList()
|
||||
<< QString("STEP 3: CHECKED ISMAS-UPDATE-TRIGGER FOR WAIT-STATUS. SUCCESS.")
|
||||
<< QString("STEP 4: CHECK-OUT BRANCH %1...").arg(m_gc.branchName()));
|
||||
break;
|
||||
case UPDATE_STEP::CHECKED_OUT_BRANCH:
|
||||
Utils::printUpdateStatusMsg(
|
||||
QStringList()
|
||||
<< QString("STEP 4: CHECKED-OUT BRANCH %1 DONE")
|
||||
.arg(m_gc.branchName())
|
||||
<< QString("STEP 5: COMPUTE FILES-TO-UPDATE..."));
|
||||
break;
|
||||
case UPDATE_STEP::COMPUTE_FILES_TO_UPDATE:
|
||||
Utils::printUpdateStatusMsg(
|
||||
QStringList()
|
||||
<< QString("STEP 5: COMPUTE FILES-TO-UPDATE %1 DONE")
|
||||
.arg(m_filesToUpdate.join(','))
|
||||
<< QString("STEP 6: DOWNLOAD FILES-TO-DOWNLOAD %1 AND EXECUTE OPKG_COMMANDS...")
|
||||
.arg(m_filesToDownload.join(',')));
|
||||
break;
|
||||
case UPDATE_STEP::DOWNLOAD_FILES_TO_UPDATE:
|
||||
Utils::printUpdateStatusMsg(
|
||||
QStringList()
|
||||
<< QString("STEP 6: DOWNLOAD FILES-TO-DOWNLOAD %1 AND EXECUTE OPKG_COMMANDS DONE")
|
||||
.arg(m_filesToDownload.join(','))
|
||||
<< QString("STEP 7: SYNC CUSTOMER REPOSITORY %1 WITH FILESYSTEM...")
|
||||
.arg(m_customerRepository));
|
||||
break;
|
||||
case UPDATE_STEP::SYNC_CUSTOMER_REPOSITORY:
|
||||
Utils::printUpdateStatusMsg(
|
||||
QStringList()
|
||||
<< QString("STEP 7: SYNC CUSTOMER REPOSITORY %1 WITH FILESYSTEM DONE")
|
||||
.arg(m_customerRepository)
|
||||
<< QString("STEP 8: SEND-LAST-VERSION TO ISMAS..."));
|
||||
break;
|
||||
case UPDATE_STEP::UPDATE_SUCCESS:
|
||||
Utils::printUpdateStatusMsg(
|
||||
QStringList()
|
||||
<< QString("STEP 9: SAVE-LOG-FILES (FUTURE USE) DONE")
|
||||
<< QString("STEP 10: MARK UPDATE AS SUCCESSFUL AND ACTIVE..."));
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void Worker::privateUpdate() {
|
||||
if (!m_mainWindow) {
|
||||
@@ -269,14 +438,7 @@ void Worker::privateUpdate() {
|
||||
}
|
||||
|
||||
if (continueUpdate) {
|
||||
|
||||
Utils::printUpdateStatusMsg(
|
||||
QStringList()
|
||||
<< QString("STEP 1: CHECKED SANITY OF CUSTOMER REPOSITORY %1 DONE")
|
||||
.arg(m_customerRepository)
|
||||
<< QString("STEP 2: FETCH CUSTOMER REPOSITORY %1...")
|
||||
.arg(m_customerRepository));
|
||||
|
||||
// qDebug() << UPDATE_STEP::SANITY_CHECK;
|
||||
if ((continueUpdate = customerRepository.exists()) == false) {
|
||||
emit appendText("\nInitializing customer environment ...");
|
||||
startProgressLoop();
|
||||
@@ -292,7 +454,6 @@ void Worker::privateUpdate() {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
QThread::sleep(1); // maybe git needs more time
|
||||
}
|
||||
if (continueUpdate == false) {
|
||||
@@ -300,154 +461,79 @@ void Worker::privateUpdate() {
|
||||
m_returnCode = sendCloneAndCheckoutFailure();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (continueUpdate) { // repository is neither not existent nor
|
||||
// corrupted. check now if the ISMAS-trigger
|
||||
// (WAIT-BUTTON) is activated even in case of
|
||||
// initial checkout
|
||||
if (!initialClone) {
|
||||
|
||||
Utils::printUpdateStatusMsg(
|
||||
QStringList()
|
||||
<< QString("STEP 2: FETCHED CUSTOMER REPOSITORY %1 DONE")
|
||||
.arg(m_customerRepository)
|
||||
<< QString("STEP 3: CHECK ISMAS-UPDATE-TRIGGER FOR WAIT-STATUS..."));
|
||||
|
||||
//if ((continueUpdate = updateTriggerSet(10)) == false) {
|
||||
// m_returnCode = sendIsmasTriggerFailure();
|
||||
//}
|
||||
|
||||
if (updateTriggerSet(10)) {
|
||||
if (customerEnvironment(30)) {
|
||||
m_ismasClient.setProgressInPercent(50);
|
||||
if (filesToUpdate()) {
|
||||
// send message to ISMAS about files which have been
|
||||
// checked in into git repository
|
||||
m_updateStatus = UpdateStatus(UPDATE_STATUS::GIT_CHECK_FILES_TO_UPDATE_SUCCESS,
|
||||
QString("Files to update: ") + m_filesToUpdate.join(','));
|
||||
IsmasClient::sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT,
|
||||
QString("#M=APISM#C=CMD_EVENT#J=") +
|
||||
m_ismasClient.updateOfPSAContinues("CHECK-FILES-TO-UPDATE",
|
||||
m_updateStatus.m_statusDescription));
|
||||
if (updateFiles(60)) {
|
||||
m_ismasClient.setProgressInPercent(70);
|
||||
if (syncCustomerRepositoryAndFS()) {
|
||||
m_ismasClient.setProgressInPercent(80);
|
||||
if (sendIsmasLastVersionNotification()) {
|
||||
m_ismasClient.setProgressInPercent(90);
|
||||
sentIsmasLastVersionNotification = true;
|
||||
if (saveLogFile()) {
|
||||
IsmasClient::sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT,
|
||||
QString("#M=APISM#C=CMD_EVENT#J=") +
|
||||
m_ismasClient.updateOfPSASucceeded(""));
|
||||
|
||||
// mark update as activated -> this resets the WAIT button
|
||||
IsmasClient::sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT,
|
||||
QString("#M=APISM#C=CMD_EVENT#J=") +
|
||||
m_ismasClient.updateOfPSAActivated());
|
||||
|
||||
m_returnCode = 0;
|
||||
} else {
|
||||
m_updateStatus = UpdateStatus(UPDATE_STATUS::SAVE_LOG_FILES_FAILED,
|
||||
QString("Saving log files failed"));
|
||||
IsmasClient::sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT,
|
||||
QString("#M=APISM#C=CMD_EVENT#J=") +
|
||||
m_ismasClient.updateOfPSAFailed(IsmasClient::RESULT_CODE::INSTALL_ERROR,
|
||||
"SAVE-LOG-FILES",
|
||||
m_updateStatus.m_statusDescription));
|
||||
m_returnCode = -11;
|
||||
}
|
||||
} else {
|
||||
m_updateStatus = UpdateStatus(UPDATE_STATUS::ISMAS_SEND_LAST_VERSION_FAILED,
|
||||
QString("Sending ISMAS last version failed"));
|
||||
IsmasClient::sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT,
|
||||
QString("#M=APISM#C=CMD_EVENT#J=") +
|
||||
m_ismasClient.updateOfPSAFailed(IsmasClient::RESULT_CODE::INSTALL_ERROR,
|
||||
"ISMAS-SEND-LAST-VERSION",
|
||||
m_updateStatus.m_statusDescription));
|
||||
m_returnCode = -10;
|
||||
}
|
||||
} else {
|
||||
m_updateStatus = UpdateStatus(UPDATE_STATUS::RSYNC_UPDATES_FAILURE,
|
||||
QString("Syncing files to update failed"));
|
||||
IsmasClient::sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT,
|
||||
QString("#M=APISM#C=CMD_EVENT#J=") +
|
||||
m_ismasClient.updateOfPSAFailed(IsmasClient::RESULT_CODE::INSTALL_ERROR,
|
||||
"RSYNC-UPDATE-FILES",
|
||||
m_updateStatus.m_statusDescription));
|
||||
m_returnCode = -9;
|
||||
}
|
||||
} else {
|
||||
m_updateStatus = UpdateStatus(UPDATE_STATUS::PSA_UPDATE_FILES_FAILED,
|
||||
QString("Updating files failed"));
|
||||
IsmasClient::sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT,
|
||||
QString("#M=APISM#C=CMD_EVENT#J=") +
|
||||
m_ismasClient.updateOfPSAFailed(IsmasClient::RESULT_CODE::INSTALL_ERROR,
|
||||
"UPDATE-FILES",
|
||||
m_updateStatus.m_statusDescription));
|
||||
m_returnCode = -8;
|
||||
}
|
||||
} else {
|
||||
m_updateStatus = UpdateStatus(UPDATE_STATUS::GIT_FETCH_UPDATES_REQUEST_FAILURE,
|
||||
QString("No files to update"));
|
||||
IsmasClient::sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT,
|
||||
QString("#M=APISM#C=CMD_EVENT#J=") +
|
||||
m_ismasClient.updateOfPSAFailed(IsmasClient::RESULT_CODE::INSTALL_ERROR,
|
||||
"FETCH-FILES-TO-UPDATE",
|
||||
m_updateStatus.m_statusDescription));
|
||||
m_returnCode = -7;
|
||||
}
|
||||
} else {
|
||||
m_updateStatus = UpdateStatus(UPDATE_STATUS::GIT_CHECKOUT_BRANCH_FAILURE,
|
||||
QString("Configuring customer environment failed"));
|
||||
IsmasClient::sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT,
|
||||
QString("#M=APISM#C=CMD_EVENT#J=") +
|
||||
m_ismasClient.updateOfPSAFailed(IsmasClient::RESULT_CODE::INSTALL_ERROR,
|
||||
"GIT-CHECKOUT-BRANCH",
|
||||
m_updateStatus.m_statusDescription));
|
||||
m_returnCode = -6;
|
||||
}
|
||||
} else {
|
||||
m_returnCode = sendIsmasTriggerFailure();
|
||||
}
|
||||
} else { // initialClone
|
||||
// qDebug() << UPDATE_STEP::FETCH_REPOSITORY;
|
||||
} else {
|
||||
Utils::printUpdateStatusMsg(
|
||||
QString("STEP 2: FETCHED CUSTOMER REPOSITORY %1 DONE")
|
||||
.arg(m_customerRepository));
|
||||
} // repository is neither not existent nor
|
||||
} // corrupted. check now if the ISMAS-trigger
|
||||
if (continueUpdate) { // (WAIT-BUTTON) is activated even in case of
|
||||
// initial checkout
|
||||
if ((continueUpdate = updateTriggerSet(10)) == false) {
|
||||
m_returnCode = sendIsmasTriggerFailure();
|
||||
}
|
||||
if (continueUpdate) { // configure customer environment -> checkout
|
||||
// branch in case someone has change the zone_nr
|
||||
//qDebug() << UPDATE_STEP::CHECK_ISMAS_TRIGGER;
|
||||
if ((continueUpdate = customerEnvironment(30)) == false) {
|
||||
m_returnCode = sendCustomerEnvironmentConfigurationFailed();
|
||||
} // determine which files has to be updated:
|
||||
} // either sent to the hardware or rsynced with
|
||||
if (continueUpdate) { // the filesystem in case of tariff-files
|
||||
//qDebug() << UPDATE_STEP::CHECKED_OUT_BRANCH;
|
||||
if ((continueUpdate = filesToUpdate(50)) == false) {
|
||||
m_returnCode = sendPullFailure();
|
||||
}
|
||||
} // send message to ISMAS about files which have
|
||||
if (continueUpdate) { // been checked in into git repository
|
||||
//qDebug() << UPDATE_STEP::COMPUTE_FILES_TO_UPDATE;
|
||||
sendFoundFilesToUpdateSuccess();
|
||||
if ((continueUpdate = updateFiles(60)) == false) {
|
||||
m_returnCode = sendFileUpdateFailure();
|
||||
}
|
||||
}
|
||||
if (continueUpdate) { // rsync (changed) files to file system
|
||||
//qDebug() << UPDATE_STEP::DOWNLOAD_FILES_TO_UPDATE;
|
||||
// TODO: rsync das komplette repository
|
||||
if ((continueUpdate = syncCustomerRepositoryAndFS(70)) == false) {
|
||||
m_returnCode = sendRsyncFailure();
|
||||
}
|
||||
}
|
||||
if (continueUpdate) { // send message to ISMAS about installed versions
|
||||
//qDebug() << UPDATE_STEP::SYNC_CUSTOMER_REPOSITORY;
|
||||
if ((continueUpdate = sendIsmasLastVersionNotification(80)) == false) {
|
||||
m_returnCode = sendLastVersionFailure();
|
||||
}
|
||||
}
|
||||
if (continueUpdate) { // future use: save logs of update process
|
||||
sentIsmasLastVersionNotification = true;
|
||||
if ((continueUpdate = saveLogFile(90)) == false) {
|
||||
m_returnCode = sendSaveLogFilesFailure();
|
||||
}
|
||||
} // send message to ISMAS that update process
|
||||
if (continueUpdate) { // succeeded
|
||||
//qDebug() << UPDATE_STEP::UPDATE_SUCCESS;
|
||||
sendUpdateSucceededAndActivated();
|
||||
m_returnCode = UPDATE_SUCCESS_AND_ACTIVATED;
|
||||
}
|
||||
}
|
||||
|
||||
m_ismasClient.setProgressInPercent(100);
|
||||
setProgress(100);
|
||||
setProgress(100);
|
||||
|
||||
if (m_returnCode != 0) {
|
||||
stopProgressLoop();
|
||||
emit appendText(QString("UPDATE "), UPDATE_STEP_FAIL);
|
||||
|
||||
// m_updateStatus = UpdateStatus(UPDATE_STATUS::UPDATE_PROCESS_FAILURE,
|
||||
// QString("Update process failed"));
|
||||
// if (std::optional<QString> s = m_ismasClient.finalResult(IsmasClient::RESULT_CODE::INSTALL_ERROR,
|
||||
// m_updateStatus.m_statusDescription)) {
|
||||
// IsmasClient::sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT,
|
||||
// QString("#M=APISM#C=CMD_EVENT#J=") + s.value());
|
||||
// }
|
||||
|
||||
} else {
|
||||
emit appendText(QString("UPDATE "), UPDATE_STEP_SUCCESS);
|
||||
|
||||
m_updateStatus = UpdateStatus(UPDATE_STATUS::UPDATE_PROCESS_SUCCESS,
|
||||
QString("Update process succeeded. Reset WAIT."));
|
||||
if (std::optional<QString> s = m_ismasClient.finalResult(IsmasClient::RESULT_CODE::SUCCESS,
|
||||
m_updateStatus.m_statusDescription)) {
|
||||
IsmasClient::sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT,
|
||||
QString("#M=APISM#C=CMD_EVENT#J=") + s.value());
|
||||
if (m_returnCode != 0) {
|
||||
stopProgressLoop();
|
||||
emit appendText(QString("UPDATE "), UPDATE_STEP_FAIL);
|
||||
} else {
|
||||
emit appendText(QString("UPDATE "), UPDATE_STEP_SUCCESS);
|
||||
sendFinalResult();
|
||||
}
|
||||
}
|
||||
|
||||
if (!sentIsmasLastVersionNotification) {
|
||||
// try even if the backend is not connected
|
||||
sendIsmasLastVersionNotification();
|
||||
sendIsmasLastVersionNotification(100);
|
||||
}
|
||||
|
||||
m_updateProcessRunning = false;
|
||||
@@ -551,7 +637,7 @@ bool Worker::updateTriggerSet(int progress) {
|
||||
= IsmasClient::sendRequestReceiveResponse(
|
||||
IsmasClient::APISM::DIRECT_PORT, "#M=APISM#C=REQ_ISMASPARAMETER#J={}")) {
|
||||
stopProgressLoop();
|
||||
setProgress(m_mainWindow->progressValue()/10 + 11);
|
||||
// setProgress(m_mainWindow->progressValue()/10 + 11);
|
||||
|
||||
QString msg = result.value();
|
||||
|
||||
@@ -562,7 +648,7 @@ bool Worker::updateTriggerSet(int progress) {
|
||||
if (parseError.error != QJsonParseError::NoError) {
|
||||
qCritical() << "(2) INVALID JSON MSG: PARSING FAILED (msg=" << msg << "):"
|
||||
<< parseError.error << parseError.errorString();
|
||||
setProgress(100);
|
||||
//setProgress(100);
|
||||
m_updateStatus = UpdateStatus(UPDATE_STATUS::JSON_PARSE_FAILURE,
|
||||
QString("(2) INVALID JSON %1 %2 %3")
|
||||
.arg(msg)
|
||||
@@ -579,7 +665,7 @@ bool Worker::updateTriggerSet(int progress) {
|
||||
}
|
||||
if (!document.isObject()) {
|
||||
qCritical() << "FILE IS NOT A JSON OBJECT!";
|
||||
setProgress(100);
|
||||
//setProgress(100);
|
||||
m_updateStatus = UpdateStatus(UPDATE_STATUS::JSON_PARSE_FAILURE,
|
||||
QString("NOT A JSON-OBJECT %1").arg(msg));
|
||||
IsmasClient::sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT,
|
||||
@@ -590,13 +676,13 @@ bool Worker::updateTriggerSet(int progress) {
|
||||
emit replaceLast(CHECK_UPDATE_TRIGGER_SET, UPDATE_STEP_FAIL);
|
||||
return false;
|
||||
}
|
||||
setProgress(m_mainWindow->progressValue()/10 + 11);
|
||||
// setProgress(m_mainWindow->progressValue()/10 + 11);
|
||||
|
||||
QJsonObject obj = document.object();
|
||||
|
||||
// always look for an 'error' first
|
||||
if (obj.contains("error")) {
|
||||
setProgress(m_mainWindow->progressValue()/10 + 11);
|
||||
// setProgress(m_mainWindow->progressValue()/10 + 11);
|
||||
QString value = obj.value("error").toString();
|
||||
emit showErrorMessage("check update trigger", QString("REPEAT %1 error=<").arg(repeat) + value + ">");
|
||||
qInfo() << "REPEAT" << repeat << "In updateTriggerSet() error=<"
|
||||
@@ -617,7 +703,7 @@ bool Worker::updateTriggerSet(int progress) {
|
||||
int customerNr = c.toInt(-1);
|
||||
int machineNr = m.toInt(-1);
|
||||
if (customerNr != m_customerNr) {
|
||||
setProgress(100);
|
||||
//setProgress(100);
|
||||
m_updateStatus = UpdateStatus(UPDATE_STATUS::ISMAS_WAIT_STATE_CHECK_FAILURE,
|
||||
QString("CUSTOMER-NR (%1) != LOCAL CUSTOMER-NR (%2)")
|
||||
.arg(customerNr).arg(m_customerNr));
|
||||
@@ -630,7 +716,6 @@ bool Worker::updateTriggerSet(int progress) {
|
||||
return false;
|
||||
}
|
||||
if (machineNr != m_machineNr) {
|
||||
setProgress(100);
|
||||
m_updateStatus = UpdateStatus(UPDATE_STATUS::ISMAS_WAIT_STATE_CHECK_FAILURE,
|
||||
QString("MACHINE-NR (%1) != LOCAL MACHINE-NR (%2)")
|
||||
.arg(machineNr).arg(m_machineNr));
|
||||
@@ -646,7 +731,6 @@ bool Worker::updateTriggerSet(int progress) {
|
||||
qInfo() << "MACHINE-AND-CUSTOMER-CHECK" << m_updateStatus.m_statusDescription;
|
||||
|
||||
} else {
|
||||
setProgress(100);
|
||||
m_updateStatus = UpdateStatus(UPDATE_STATUS::ISMAS_WAIT_STATE_CHECK_FAILURE,
|
||||
"Dev_ID DOES NOT CONTAIN Custom_ID AND/OR Device_ID");
|
||||
IsmasClient::sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT,
|
||||
@@ -658,7 +742,6 @@ bool Worker::updateTriggerSet(int progress) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
setProgress(100);
|
||||
m_updateStatus = UpdateStatus(UPDATE_STATUS::ISMAS_WAIT_STATE_CHECK_FAILURE,
|
||||
"Dev_ID KEY NOT A JSON-OBJECT");
|
||||
IsmasClient::sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT,
|
||||
@@ -670,7 +753,6 @@ bool Worker::updateTriggerSet(int progress) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
setProgress(100);
|
||||
m_updateStatus = UpdateStatus(UPDATE_STATUS::ISMAS_WAIT_STATE_CHECK_FAILURE,
|
||||
"Dev_ID KEY NOT AVAILABLE");
|
||||
IsmasClient::sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT,
|
||||
@@ -681,7 +763,7 @@ bool Worker::updateTriggerSet(int progress) {
|
||||
emit replaceLast(CHECK_UPDATE_TRIGGER_SET, UPDATE_STEP_FAIL);
|
||||
return false;
|
||||
}
|
||||
setProgress(m_mainWindow->progressValue()/10 + 11);
|
||||
// setProgress(m_mainWindow->progressValue()/10 + 11);
|
||||
|
||||
if (obj.contains("Fileupload")) {
|
||||
QJsonValue v = obj.value("Fileupload");
|
||||
@@ -695,7 +777,6 @@ bool Worker::updateTriggerSet(int progress) {
|
||||
<< triggerValue << ">";
|
||||
|
||||
if (triggerValue == "WAIT") {
|
||||
setProgress(100);
|
||||
m_updateStatus = UpdateStatus(UPDATE_STATUS::ISMAS_SANITY_CHECK_OK,
|
||||
QString("MACHINE-NR (%1) AND CUST-NR (%2) OK")
|
||||
.arg(m_machineNr).arg(m_customerNr));
|
||||
@@ -721,13 +802,12 @@ bool Worker::updateTriggerSet(int progress) {
|
||||
} else
|
||||
if (QRegExp("\\s*").exactMatch(triggerValue)) { // check for whitespace
|
||||
stopProgressLoop();
|
||||
setProgress(m_mainWindow->progressValue()/10 + 11);
|
||||
// setProgress(m_mainWindow->progressValue()/10 + 11);
|
||||
emit showErrorMessage("check update trigger", "empty update-trigger");
|
||||
QThread::sleep(6);
|
||||
continue;
|
||||
} else {
|
||||
// if the download-button once has the wrong value, it will never recover
|
||||
setProgress(100);
|
||||
m_updateStatus = UpdateStatus(UPDATE_STATUS::ISMAS_WAIT_STATE_CHECK_FAILURE,
|
||||
QString("TRIGGER-VALUE=<") + triggerValue + "> NOT 'WAIT'");
|
||||
IsmasClient::sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT,
|
||||
@@ -739,7 +819,6 @@ bool Worker::updateTriggerSet(int progress) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
setProgress(100);
|
||||
m_updateStatus = UpdateStatus(UPDATE_STATUS::ISMAS_WAIT_STATE_CHECK_FAILURE,
|
||||
"TRG KEY NOT AVAILABLE");
|
||||
IsmasClient::sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT,
|
||||
@@ -751,7 +830,6 @@ bool Worker::updateTriggerSet(int progress) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
setProgress(100);
|
||||
m_updateStatus = UpdateStatus(UPDATE_STATUS::ISMAS_WAIT_STATE_CHECK_FAILURE,
|
||||
"Fileupload NOT A JSON-OBJECT");
|
||||
IsmasClient::sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT,
|
||||
@@ -763,7 +841,6 @@ bool Worker::updateTriggerSet(int progress) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
setProgress(100);
|
||||
m_updateStatus = UpdateStatus(UPDATE_STATUS::ISMAS_WAIT_STATE_CHECK_FAILURE,
|
||||
"Fileupload KEY NOT AVAILABLE");
|
||||
IsmasClient::sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT,
|
||||
@@ -776,13 +853,12 @@ bool Worker::updateTriggerSet(int progress) {
|
||||
}
|
||||
} else {
|
||||
stopProgressLoop();
|
||||
setProgress(m_mainWindow->progressValue()/10 + 11);
|
||||
//setProgress(m_mainWindow->progressValue()/10 + 11);
|
||||
emit showErrorMessage("check update trigger", "no ISMAS response");
|
||||
QThread::sleep(6);
|
||||
}
|
||||
}
|
||||
|
||||
setProgress(100);
|
||||
m_updateStatus = UpdateStatus(UPDATE_STATUS::ISMAS_UPDATE_TRIGGER_NOT_SET_OR_WRONG,
|
||||
QString("ISMAS_UPDATE-TRIGGER-NOT-SET-OR-WRONG: VALUE=(") +
|
||||
triggerValue + ")");
|
||||
@@ -798,7 +874,7 @@ bool Worker::customerEnvironment(int progress) {
|
||||
emit appendText("\nPrepare customer environment ...");
|
||||
if (QDir(m_customerRepository).exists()) {
|
||||
startProgressLoop();
|
||||
setProgress(m_mainWindow->progressValue()/10 + 11);
|
||||
// setProgress(m_mainWindow->progressValue()/10 + 11);
|
||||
if (m_gc.gitCheckoutBranch()) {
|
||||
stopProgressLoop();
|
||||
m_ismasClient.setProgressInPercent(progress);
|
||||
@@ -810,7 +886,6 @@ bool Worker::customerEnvironment(int progress) {
|
||||
QString("#M=APISM#C=CMD_EVENT#J=") +
|
||||
m_ismasClient.checkoutBranch(m_updateStatus.m_statusDescription, ""));
|
||||
|
||||
setProgress(100);
|
||||
emit replaceLast("Prepare customer environment ...", UPDATE_STEP_DONE);
|
||||
qInfo() << "PREPARE CUSTOMER ENVIRONMENT DONE";
|
||||
return true;
|
||||
@@ -827,12 +902,13 @@ bool Worker::customerEnvironment(int progress) {
|
||||
Utils::printCriticalErrorMsg(m_customerRepository + " DOES NOT EXIST");
|
||||
}
|
||||
|
||||
setProgress(100);
|
||||
emit replaceLast("Prepare customer environment ...", UPDATE_STEP_FAIL);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Worker::filesToUpdate() {
|
||||
bool Worker::filesToUpdate(int progress) {
|
||||
m_ismasClient.setProgressInPercent(progress);
|
||||
|
||||
emit appendText("\nFetch changes files ...");
|
||||
startProgressLoop();
|
||||
|
||||
@@ -840,17 +916,11 @@ bool Worker::filesToUpdate() {
|
||||
m_filesToUpdate << "etc/psa_update/opkg_commands";
|
||||
|
||||
if (std::optional<QString> changes = m_gc.gitPull()) {
|
||||
stopProgressLoop();
|
||||
int progress = (m_mainWindow->progressValue()/10) + 10;
|
||||
setProgress(progress);
|
||||
|
||||
m_updateStatus = UpdateStatus(UPDATE_STATUS::GIT_FETCH_UPDATES,
|
||||
QString("FETCHING OF ") + m_customerRepositoryPath +
|
||||
QString(" INTO ") + m_customerRepository);
|
||||
|
||||
setProgress(progress + 10);
|
||||
if (std::optional<QStringList> changedFileNames = m_gc.gitDiff(changes.value())) {
|
||||
setProgress(progress + 20);
|
||||
if (m_gc.gitPull()) {
|
||||
emit replaceLast(QString("Fetch changes files ..."), UPDATE_STEP_DONE);
|
||||
m_filesToUpdate << changedFileNames.value();
|
||||
@@ -859,10 +929,6 @@ bool Worker::filesToUpdate() {
|
||||
Utils::printCriticalErrorMsg("PULLING FILES FAILED");
|
||||
|
||||
emit replaceLast(QString("Fetch changes files ..."), UPDATE_STEP_FAIL);
|
||||
|
||||
stopProgressLoop();
|
||||
setProgress(100);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -880,15 +946,13 @@ bool Worker::filesToUpdate() {
|
||||
emit appendText("Found 1 file to update :", UPDATE_STEP_DONE);
|
||||
emit appendText(QString("\n ") + m_filesToUpdate.at(0));
|
||||
}
|
||||
|
||||
setProgress(progress + 30);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Worker::updateFiles(quint8 percent) {
|
||||
QStringList filesToDownload;
|
||||
bool Worker::updateFiles(int percent) {
|
||||
m_filesToDownload.clear();
|
||||
m_displayIndex = 0;
|
||||
startProgressLoop();
|
||||
for (int i = 0; i < m_filesToUpdate.size(); ++i) {
|
||||
@@ -941,8 +1005,6 @@ bool Worker::updateFiles(quint8 percent) {
|
||||
emit replaceLast(QString("(") + QString("%1").arg(m_displayIndex).rightJustified(3, ' ') + QString(")")
|
||||
+ QString(" Update opkg pakets ... "), UPDATE_STEP_FAIL);
|
||||
|
||||
stopProgressLoop();
|
||||
setProgress(100);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -953,24 +1015,21 @@ bool Worker::updateFiles(quint8 percent) {
|
||||
fName.contains("DC2C_device", Qt::CaseInsensitive) ||
|
||||
fName.contains("DC2C_conf", Qt::CaseInsensitive) ||
|
||||
fName.contains("DC2C_cash", Qt::CaseInsensitive)) {
|
||||
filesToDownload << fName; // download printer-config-files
|
||||
m_filesToDownload << fName; // download printer-config-files
|
||||
} else {
|
||||
static const QRegularExpression version("^.*dc2c[.][0-9]{1,2}[.][0-9]{1,2}[.]bin.*$");
|
||||
if (fName.contains(version)) {
|
||||
filesToDownload << fName; // download device controller
|
||||
m_filesToDownload << fName; // download device controller
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stopProgressLoop();
|
||||
setProgress(100);
|
||||
|
||||
if (filesToDownload.size() > 0) {
|
||||
Utils::printInfoMsg(QString("FILES_TO_DOWNLOAD_TO_PSA_HW ") + filesToDownload.join(','));
|
||||
if (m_filesToDownload.size() > 0) {
|
||||
Utils::printInfoMsg(QString("FILES_TO_DOWNLOAD_TO_PSA_HW ") + m_filesToDownload.join(','));
|
||||
|
||||
Update *update = m_mainWindow->getUpdate();
|
||||
if (update) {
|
||||
return update->doUpdate(m_displayIndex, filesToDownload);
|
||||
return update->doUpdate(m_displayIndex, m_filesToDownload);
|
||||
} else {
|
||||
Utils::printCriticalErrorMsg("UPDATE NOT SET");
|
||||
}
|
||||
@@ -981,9 +1040,9 @@ bool Worker::updateFiles(quint8 percent) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Worker::syncCustomerRepositoryAndFS() {
|
||||
bool Worker::syncCustomerRepositoryAndFS(int progress) {
|
||||
m_ismasClient.setProgressInPercent(progress);
|
||||
// this step is currently needed only for updating tariff-files
|
||||
setProgress(0);
|
||||
emit appendText("\nSync customer environment with filesystem ...");
|
||||
if (QDir(m_customerRepository).exists()) {
|
||||
if (QDir::setCurrent(m_customerRepository)) {
|
||||
@@ -992,8 +1051,6 @@ bool Worker::syncCustomerRepositoryAndFS() {
|
||||
QStringList() << "-c" << "mkdir -p /etc/psa_config /etc/dc /etc/psa_tariff")) {
|
||||
qCritical() << "COULD NOT EXECUTE '" << md.command() << "' exitCode=(" << md.exitCode() << ")";
|
||||
}
|
||||
int progress = 10;
|
||||
setProgress(progress);
|
||||
QString const params("-vvv "
|
||||
"--recursive "
|
||||
"--progress "
|
||||
@@ -1016,8 +1073,6 @@ bool Worker::syncCustomerRepositoryAndFS() {
|
||||
QString cmd;
|
||||
bool error = false;
|
||||
foreach (cmd, cmds) {
|
||||
progress += 5;
|
||||
setProgress(progress);
|
||||
if (!error) {
|
||||
Command c("bash");
|
||||
qInfo() << "EXECUTING CMD..." << cmd;
|
||||
@@ -1051,14 +1106,11 @@ bool Worker::syncCustomerRepositoryAndFS() {
|
||||
}
|
||||
}
|
||||
}
|
||||
progress += 5;
|
||||
setProgress(progress);
|
||||
if (!error) {
|
||||
// now check tariff-files in etc and /etc/psa_tariff
|
||||
QDir dir1(QDir::cleanPath(m_customerRepository + QDir::separator() + "etc/psa_tariff"));
|
||||
QDir dir2("/etc/psa_tariff");
|
||||
if (Utils::sameFilesInDirs(dir1, dir2)) {
|
||||
setProgress(100);
|
||||
emit replaceLast(QString("Sync customer environment with filesystem ..."), UPDATE_STEP_DONE);
|
||||
return true;
|
||||
} else {
|
||||
@@ -1067,12 +1119,12 @@ bool Worker::syncCustomerRepositoryAndFS() {
|
||||
}
|
||||
}
|
||||
}
|
||||
setProgress(100);
|
||||
emit replaceLast(QString("Sync customer environment with filesystem ..."), UPDATE_STEP_FAIL);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Worker::sendIsmasLastVersionNotification() {
|
||||
bool Worker::sendIsmasLastVersionNotification(int progress) {
|
||||
m_ismasClient.setProgressInPercent(progress);
|
||||
IsmasClient::sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT,
|
||||
QString("#M=APISM#C=CMD_SENDVERSION#J=") +
|
||||
m_ismasClient.updateOfPSASendVersion(getPSAInstalled()));
|
||||
@@ -1080,7 +1132,8 @@ bool Worker::sendIsmasLastVersionNotification() {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Worker::saveLogFile() {
|
||||
bool Worker::saveLogFile(int progress) {
|
||||
m_ismasClient.setProgressInPercent(progress);
|
||||
return true;
|
||||
}
|
||||
QString Worker::getOsVersion() const {
|
||||
@@ -1320,6 +1373,7 @@ hwinf const *Worker::getPlugin() const {
|
||||
/************************************************************************************************
|
||||
* operators
|
||||
*/
|
||||
#if 0
|
||||
QDebug operator<< (QDebug debug, UpdateStatus status) {
|
||||
switch(status.m_updateStatus) {
|
||||
case UPDATE_STATUS::ISMAS_SEND_LAST_VERSION_FAILED:
|
||||
@@ -1573,3 +1627,4 @@ QString& operator<< (QString& str, UpdateStatus status) {
|
||||
}
|
||||
return str;
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user