8 Commits

Author SHA1 Message Date
7578746d2f make it explicit that no device-controller is loaded down with this version 2024-01-25 15:46:46 +01:00
0b1ed62df1 Optimization: if customer repository does not exist, do noy check the
ISMAS trigger, but proceed with the update procedure.
2024-01-25 15:14:42 +01:00
76ec41c291 Minor: add some comment. 2024-01-25 15:13:56 +01:00
630cd36f13 Minor: removed typo 2024-01-25 11:54:13 +01:00
cbe8bb7aeb Minor: add comment 2024-01-25 09:01:04 +01:00
e04636e3f7 Minor: add debug output 2024-01-24 13:07:39 +01:00
728185ddb9 Set
m_lastFailedUpdateStep = UPDATE_STEP::NONE
as last step in case of a successful update.
2024-01-24 08:31:22 +01:00
aaa485e2fc Send messages to ISMAS for checking/repairing the customer repository 2024-01-23 16:09:15 +01:00
4 changed files with 104 additions and 28 deletions

View File

@@ -95,10 +95,14 @@ DEFINES += QT_DEPRECATED_WARNINGS
# 1.4.0 : Start with version at 1.4.0 (mainly to see a difference with Szeged)
# Set hash-value in EVENT-objects. Set location (project), version
# and info in send-last-version.
# Check the ISMAS update-trigger as very first step.
# If the customer repository does not exist, then do not check the
# ISMAS trigger, but proceed with the update procedure. Otherwise,
# check the ISMAS update-trigger as first step.
# If the current time is between 0.00 - 4.00 o'clock, then a wrong
# trigger-value wil result in an UPDATE_STEP_NOT_NECESSARY.
# trigger-value will result in an UPDATE_STEP_NOT_NECESSARY.
# Move final processing to subclass UpdateProcessRunning.
# Disable EXIT-button for the whole update-process, except for the
# checking of the ISMAS-trigger-button (aka WAIT-button).
VERSION="1.4.0"
# PLANNED TODOS:

View File

@@ -605,19 +605,19 @@ bool Update::doUpdate(int &displayIndex, QStringList const &filesToWorkOn) {
// 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
if ((updateBinaryRes = updateBinary(fToWorkOn)) == true) {
// 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
// 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(),
Worker::UPDATE_STEP_DONE);
}
// ++displayIndex;
// emit m_worker->appendText(QString("\n(") + QString("%1").arg(displayIndex).rightJustified(2, ' ') + QString(")")
// + QString(" Update ") + QFileInfo(fToWorkOn).fileName(),
// Worker::UPDATE_STEP_DONE);
//}
m_hw->dc_autoRequest(true); // turn auto-request setting on

View File

@@ -272,22 +272,41 @@ void Worker::privateUpdate() {
m_ismasTriggerActive = false;
m_updateNotNecessary = false;
QDateTime const &current = QDateTime::currentDateTime();
m_automaticUpdate = (current.time().hour() < 4);
m_ismasTriggerActive = updateTriggerSet();
if (m_ismasTriggerActive == false) {
if (QDir(m_customerRepository).exists()) { // ignore a possibly corrupted repository
if (QDir(m_customerRepository).exists()) { // ignore a possibly corrupted repository
m_ismasTriggerActive = updateTriggerSet();
if (m_ismasTriggerActive == false) {
QDateTime const &current = QDateTime::currentDateTime();
m_automaticUpdate = (current.time().hour() < 4);
m_versionInfo = m_gc.gitShowReason(m_branchName);
qCritical() << "***";
qCritical() << "privateUpdate ............. m_versionInfo:" << m_versionInfo;
qCritical() << "privateUpdate ......... m_automaticUpdate:" << m_automaticUpdate;
if (m_automaticUpdate) { // update has been triggered within [00:00:00, 00:03:59]
m_updateNotNecessary = true;
m_ismasTriggerStatusMessage = QStringList(QString("NO UPDATE NECESSARY (%1)").arg(current.toString(Qt::ISODate)));
qCritical() << "privateUpdate m_ismasTriggerStatusMessage:" << QStringList(QString("NO UPDATE NECESSARY (%1)").arg(current.toString(Qt::ISODate)));
qCritical() << "***";
// the customer-repository does exist, but the ISMAS-trigger is
// *NOT* "WAIT", but from 00:00:00 - 00:03:59 this counts as an
// automatic update
m_lastFailedUpdateStep = UPDATE_STEP::NONE;
return;
}
qCritical() << "***";
// the customer-repository does exist, but the ISMAS-trigger is
// *NOT* "WAIT", so STOP the update procedure
return;
}
// the customer-repository does exist, and the ISMAS-trigger is "WAIT",
// so continue the update procedure
} else {
// the customer-repository does not exist, so PROCEED with the
// update procedure, even if ISMAS-trigger is not correctly set ("WAIT")
}
@@ -481,6 +500,7 @@ void Worker::privateUpdate() {
setProgress(_SAVE_LOGS_SUCCESS);
// final messages: see destructor of UpdateProcessRunning subclass
m_lastFailedUpdateStep = UPDATE_STEP::NONE;
}
bool Worker::updateTriggerSet() {

View File

@@ -714,21 +714,73 @@ private:
case UPDATE_STEP::CHECK_REPOSITORY:
ismasClient.setProgressInPercent(_CHECK_REPOSITORY);
break;
case UPDATE_STEP::CHECK_REPOSITORY_SUCCESS:
case UPDATE_STEP::CHECK_REPOSITORY_SUCCESS: {
ismasClient.setProgressInPercent(_CHECK_REPOSITORY_SUCCESS);
break;
case UPDATE_STEP::CHECK_REPOSITORY_FAILURE:
QString const &ismasUpdateNews =
QString("#M=APISM#C=CMD_EVENT#J=") +
ismasClient.updateNewsToIsmas(
"U0010",
_CHECKOUT_REPOSITORY_SUCCESS,
IsmasClient::RESULT_CODE::SUCCESS,
smap[UPDATE_STEP::CHECK_REPOSITORY],
QString("REPOSITORY %1 AND BRANCH %2 OK")
.arg(instance->m_customerRepository)
.arg(instance->m_gc.branchName()).toStdString().c_str(),
instance->m_versionInfo.size() >= 1 ? instance->m_versionInfo.at(0).toUtf8().constData() : "N/A");
ismasClient.sendRequestReceiveResponse(
IsmasClient::APISM::DB_PORT, ismasUpdateNews);
} break;
case UPDATE_STEP::CHECK_REPOSITORY_FAILURE: {
ismasClient.setProgressInPercent(_CHECK_REPOSITORY_FAILURE);
break;
case UPDATE_STEP::CHECK_SANITY:
QString const &ismasUpdateNews =
QString("#M=APISM#C=CMD_EVENT#J=") +
ismasClient.updateNewsToIsmas(
"U0010",
_CHECKOUT_REPOSITORY_FAILURE,
IsmasClient::RESULT_CODE::INSTALL_ERROR,
smap[UPDATE_STEP::CHECKOUT_REPOSITORY],
QString("REPOSITORY %1 and BRANCH %2 ***NOT OK***")
.arg(instance->m_customerRepository)
.arg(instance->m_gc.branchName()).toStdString().c_str(),
instance->m_versionInfo.size() >= 1 ? instance->m_versionInfo.at(0).toUtf8().constData() : "N/A");
ismasClient.sendRequestReceiveResponse(
IsmasClient::APISM::DB_PORT, ismasUpdateNews);
} break;
case UPDATE_STEP::CHECK_SANITY: {
ismasClient.setProgressInPercent(_CHECK_SANITY);
break;
case UPDATE_STEP::CHECK_SANITY_SUCCESS:
} break;
case UPDATE_STEP::CHECK_SANITY_SUCCESS: {
ismasClient.setProgressInPercent(_CHECK_SANITY_SUCCESS);
break;
case UPDATE_STEP::CHECK_SANITY_FAILURE:
QString const &ismasUpdateNews =
QString("#M=APISM#C=CMD_EVENT#J=") +
ismasClient.updateNewsToIsmas(
"U0010",
_CHECK_SANITY_SUCCESS,
IsmasClient::RESULT_CODE::SUCCESS,
smap[UPDATE_STEP::CHECK_SANITY],
QString("SANITY OF %1 (BRANCH %2) OK")
.arg(instance->m_customerRepository)
.arg(instance->m_gc.branchName()).toStdString().c_str(),
instance->m_versionInfo.size() >= 1 ? instance->m_versionInfo.at(0).toUtf8().constData() : "N/A");
ismasClient.sendRequestReceiveResponse(
IsmasClient::APISM::DB_PORT, ismasUpdateNews);
} break;
case UPDATE_STEP::CHECK_SANITY_FAILURE: {
ismasClient.setProgressInPercent(_CHECK_SANITY_FAILURE);
break;
QString const &ismasUpdateNews =
QString("#M=APISM#C=CMD_EVENT#J=") +
ismasClient.updateNewsToIsmas(
"U0010",
_CHECK_SANITY_FAILURE,
IsmasClient::RESULT_CODE::INSTALL_ERROR,
smap[UPDATE_STEP::CHECK_SANITY],
QString("SANITY OF %1 and BRANCH %2 ***NOT*** OK")
.arg(instance->m_customerRepository)
.arg(instance->m_gc.branchName()).toStdString().c_str(),
instance->m_versionInfo.size() >= 1 ? instance->m_versionInfo.at(0).toUtf8().constData() : "N/A");
ismasClient.sendRequestReceiveResponse(
IsmasClient::APISM::DB_PORT, ismasUpdateNews);
} break;
case UPDATE_STEP::REPOSITORY_RECOVERED_SUCCESS:
ismasClient.setProgressInPercent(_REPOSITORY_RECOVERED_SUCCESS);
break;