From 40acd0e0c4007817f55200ff5bfdf376173b5b63 Mon Sep 17 00:00:00 2001 From: Siegfried Siegert Date: Thu, 12 Jun 2025 16:33:32 +0200 Subject: [PATCH 1/3] Diag: set E255 only once --- src/ATBAPP/DeviceControllerDiag.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/ATBAPP/DeviceControllerDiag.cpp b/src/ATBAPP/DeviceControllerDiag.cpp index be93ab3..50c951f 100644 --- a/src/ATBAPP/DeviceControllerDiag.cpp +++ b/src/ATBAPP/DeviceControllerDiag.cpp @@ -112,8 +112,10 @@ void DeviceControllerDiag::private_startDiag() if (this->flagInterruptDiag) { qCritical() << "DeviceControllerDiag::private_startDiag() interrupted!"; DCMachineEvent E255Event = DCMachineEvent(DeviceController::State::E255); - machineEventSet.insert(E255Event); - private_sendDiagEvent(E255Event, DeviceController::Action::SET); + if (!this->previousMachineEventSet.contains(E255Event)) { + machineEventSet.insert(E255Event); + private_sendDiagEvent(E255Event, DeviceController::Action::SET); + } if (this->E255counter > 5) { this->restartCArun(); // try it again, until success: @@ -173,8 +175,10 @@ void DeviceControllerDiag::sys_superviseSystem() qCritical() << "DeviceControllerDiag::sys_superviseSystem() interrupted!"; // send DCMachineEvent E255Event = DCMachineEvent(DeviceController::State::E255); - machineEventSet.insert(E255Event); - private_sendDiagEvent(E255Event, DeviceController::Action::SET); + if (!this->previousMachineEventSet.contains(E255Event)) { + machineEventSet.insert(E255Event); + private_sendDiagEvent(E255Event, DeviceController::Action::SET); + } if (this->E255counter > 5) { this->restartCArun(); } else { this->E255counter++; } QTimer::singleShot(400, this, &DeviceControllerDiag::diagRequest); From 1165c4b92f3f6af49dc294fb8376a41509569770 Mon Sep 17 00:00:00 2001 From: Siegfried Siegert Date: Tue, 24 Jun 2025 15:03:21 +0200 Subject: [PATCH 2/3] Diag: set W255 only once --- src/ATBAPP/DeviceControllerDiag.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ATBAPP/DeviceControllerDiag.cpp b/src/ATBAPP/DeviceControllerDiag.cpp index 50c951f..f276126 100644 --- a/src/ATBAPP/DeviceControllerDiag.cpp +++ b/src/ATBAPP/DeviceControllerDiag.cpp @@ -715,8 +715,10 @@ void DeviceControllerDiag::restartCArun() DCMachineEvent W255Event = DCMachineEvent(DeviceController::State::W255); - machineEventSet.insert(W255Event); - private_sendDiagEvent(W255Event, DeviceController::Action::SET); + if (!this->previousMachineEventSet.contains(W255Event)) { + machineEventSet.insert(W255Event); + private_sendDiagEvent(W255Event, DeviceController::Action::SET); + } QProcess::startDetached("/bin/systemctl", {"restart", "carun"}); } From e1470d13f15aede168e1ddca9e67a51be6ce58c3 Mon Sep 17 00:00:00 2001 From: Siegfried Siegert Date: Tue, 24 Jun 2025 15:18:45 +0200 Subject: [PATCH 3/3] Diag: clear machine machineEventSet on valid data This is allowed only here: dc-data is valid (i.e. check for E255 was sucessfull). This method sub_componentAssessment() will check all criteria of dc-module conditions. --- src/ATBAPP/DeviceControllerDiag.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ATBAPP/DeviceControllerDiag.cpp b/src/ATBAPP/DeviceControllerDiag.cpp index f276126..80256ea 100644 --- a/src/ATBAPP/DeviceControllerDiag.cpp +++ b/src/ATBAPP/DeviceControllerDiag.cpp @@ -231,6 +231,8 @@ void DeviceControllerDiag::sys_superviseSystem() void DeviceControllerDiag::sub_componentAssessment() { + this->machineEventSet.clear(); + bool flag_sendOperate = true; struct T_moduleCondition modCond = {};