From 175b8fd3a182625f0264aae30f0fe7ee7719edcf Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Tue, 19 Mar 2024 12:41:42 +0100 Subject: [PATCH] If the update-trigger (aka WAIT-button) is empty and we have an automatic update (i.e. time is 0:00 - 4:00 am), then do not inform ISMAS with an U0003 error signal, but send an U0002 (setting the trigger-value to "OK"). --- UpdatePTUDevCtrl/worker.cpp | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/UpdatePTUDevCtrl/worker.cpp b/UpdatePTUDevCtrl/worker.cpp index edb7343..e016a0c 100644 --- a/UpdatePTUDevCtrl/worker.cpp +++ b/UpdatePTUDevCtrl/worker.cpp @@ -518,6 +518,8 @@ bool Worker::updateTriggerSet() { GUI() << (CONSOLE() << UPDATE_STEP::CHECK_ISMAS_TRIGGER); + bool const automaticUpdate = (QDateTime::currentDateTime().time().hour() < 4); + QString triggerValue("NOT CHECKED YET"); static constexpr int const repeats = 15; for (int repeat = 1; repeat <= repeats; ++repeat) { @@ -639,9 +641,17 @@ bool Worker::updateTriggerSet() { ISMAS(lst) << (GUI(lst) << (CONSOLE(lst) << (m_lastFailedUpdateStep = UPDATE_STEP::CHECK_ISMAS_TRIGGER_WRONG_VALUE))); // if the customer repository has just been cloned return false; // it is OK the ISMAS trigger might not be 'WAIT' - } else { - CONSOLE(lst) << (m_lastFailedUpdateStep = UPDATE_STEP::CHECK_ISMAS_TRIGGER_FAILURE); } + // not a clone and empty update-trigger + if (automaticUpdate) { + // do not inform ISMAS in case of automatic update, because the + // update is not necessary as the trigger-button is not set to WAIT. + GUI(lst) << (CONSOLE(lst) << (m_lastFailedUpdateStep = UPDATE_STEP::CHECK_ISMAS_TRIGGER_WRONG_VALUE)); + return false; + } + + CONSOLE(lst) << (m_lastFailedUpdateStep = UPDATE_STEP::CHECK_ISMAS_TRIGGER_FAILURE); + QThread::sleep(6); continue; } else { @@ -649,11 +659,21 @@ bool Worker::updateTriggerSet() { if (m_clone) { m_ismasTriggerStatusMessage = QStringList(QString("TRIGGER-VALUE='%1' != 'WAIT'").arg(triggerValue)); QStringList lst = m_ismasTriggerStatusMessage; - ISMAS(lst) << (GUI(lst) << (CONSOLE(lst) << (m_lastFailedUpdateStep = UPDATE_STEP::CHECK_ISMAS_TRIGGER_WRONG_VALUE))); + if (automaticUpdate) { + // do not inform ISMAS in case of automatic update + GUI(lst) << (CONSOLE(lst) << (m_lastFailedUpdateStep = UPDATE_STEP::CHECK_ISMAS_TRIGGER_WRONG_VALUE)); + } else { + ISMAS(lst) << (GUI(lst) << (CONSOLE(lst) << (m_lastFailedUpdateStep = UPDATE_STEP::CHECK_ISMAS_TRIGGER_WRONG_VALUE))); + } } else { m_ismasTriggerStatusMessage = QStringList(QString("TRIGGER-VALUE='%1' != 'WAIT'").arg(triggerValue)); QStringList lst = m_ismasTriggerStatusMessage; - ISMAS(lst) << (GUI(lst) << (CONSOLE(lst) << (m_lastFailedUpdateStep = UPDATE_STEP::CHECK_ISMAS_TRIGGER_FAILURE))); + if (automaticUpdate) { + // do not inform ISMAS in case of automatic update + GUI(lst) << (CONSOLE(lst) << (m_lastFailedUpdateStep = UPDATE_STEP::CHECK_ISMAS_TRIGGER_WRONG_VALUE)); + } else { + ISMAS(lst) << (GUI(lst) << (CONSOLE(lst) << (m_lastFailedUpdateStep = UPDATE_STEP::CHECK_ISMAS_TRIGGER_FAILURE))); + } } return false; }