From 5c66abfd87b32ae6b009c7890d349ae470dbbdae Mon Sep 17 00:00:00 2001 From: Siegfried Siegert Date: Tue, 27 May 2025 13:00:34 +0200 Subject: [PATCH] Improve E255 handling: - start BackgroundTask on first data not valid - in any case of E255/data-no-valid: try to restart diag; This is because there were only 'returns' without initiating something, so that next check/restart carun happened first on next wokeup. --- src/ATBAPP/DeviceControllerDiag.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/ATBAPP/DeviceControllerDiag.cpp b/src/ATBAPP/DeviceControllerDiag.cpp index b109895..dd41033 100644 --- a/src/ATBAPP/DeviceControllerDiag.cpp +++ b/src/ATBAPP/DeviceControllerDiag.cpp @@ -112,6 +112,8 @@ void DeviceControllerDiag::private_startDiag() this->flagInterruptDiag = false; if (this->E255counter > 5) { this->restartCArun(); + // try it again, until success: + QTimer::singleShot(1000, this, &DeviceControllerDiag::diagRequest); } else { this->E255counter++; @@ -137,8 +139,14 @@ void DeviceControllerDiag::private_startDiag() else { qCritical() << "DeviceControllerDiag::private_startDiag() DCdata is +++not+++ valid"; - // try it again hw->dc_autoRequest(true); + + if (! this->isDiagBackgroundTask) { + this->isDiagBackgroundTask = true; + this->dbus->startBackgroundTask("E255"); + } + + // try it again QTimer::singleShot(200, this, &DeviceControllerDiag::private_startDiag); } } @@ -161,6 +169,7 @@ void DeviceControllerDiag::sys_superviseSystem() this->isRequestRunning = false; if (this->E255counter > 5) { this->restartCArun(); } else { this->E255counter++; } + QTimer::singleShot(400, this, &DeviceControllerDiag::diagRequest); return; } @@ -174,6 +183,7 @@ void DeviceControllerDiag::sys_superviseSystem() this->isRequestRunning = false; if (this->E255counter > 5) { this->restartCArun(); } else { this->E255counter++; } + QTimer::singleShot(400, this, &DeviceControllerDiag::diagRequest); return; } @@ -439,6 +449,11 @@ void DeviceControllerDiag::sub_componentAssessment() this->previousMachineEventSet = machineEventSet; this->machineEventSet.clear(); + + if (this->isDiagBackgroundTask) { + this->isDiagBackgroundTask = false; + this->dbus->finishedBackgroundTask("E255"); + } }