Diag: add single exit method for ReqDiag

This commit is contained in:
Siegfried Siegert 2025-06-12 08:35:00 +02:00
parent ccc2b8120d
commit 18a35acf20
Signed by: SiegfriedSiegert
GPG Key ID: 68371E015E8F0B03
2 changed files with 16 additions and 1 deletions

View File

@ -130,6 +130,7 @@ void DeviceControllerDiag::private_startDiag()
* - diag is called again in ModeOOO wokeup() * - diag is called again in ModeOOO wokeup()
*/ */
} }
this->private_finishDiag();
return; return;
} }
@ -174,6 +175,7 @@ void DeviceControllerDiag::sys_superviseSystem()
if (this->E255counter > 5) { this->restartCArun(); } if (this->E255counter > 5) { this->restartCArun(); }
else { this->E255counter++; } else { this->E255counter++; }
QTimer::singleShot(400, this, &DeviceControllerDiag::diagRequest); QTimer::singleShot(400, this, &DeviceControllerDiag::diagRequest);
this->private_finishDiag();
return; return;
} }
@ -188,6 +190,7 @@ void DeviceControllerDiag::sys_superviseSystem()
if (this->E255counter > 5) { this->restartCArun(); } if (this->E255counter > 5) { this->restartCArun(); }
else { this->E255counter++; } else { this->E255counter++; }
QTimer::singleShot(400, this, &DeviceControllerDiag::diagRequest); QTimer::singleShot(400, this, &DeviceControllerDiag::diagRequest);
this->private_finishDiag();
return; return;
} }
@ -462,7 +465,17 @@ void DeviceControllerDiag::sub_componentAssessment()
// finish diag // finish diag
this->private_finishDiag();
}
/**
* @brief DeviceControllerDiag::private_finishDiag
*
* Single point to finish a diag process:
* -
*/
void DeviceControllerDiag::private_finishDiag()
{
this->diagRequestTimeoutTimer->stop(); this->diagRequestTimeoutTimer->stop();
this->isRequestRunning = false; this->isRequestRunning = false;
this->flagInterruptDiag = false; this->flagInterruptDiag = false;
@ -474,10 +487,10 @@ void DeviceControllerDiag::sub_componentAssessment()
this->isDiagBackgroundTask = false; this->isDiagBackgroundTask = false;
this->dbus->finishedBackgroundTask("E255"); this->dbus->finishedBackgroundTask("E255");
} }
} }
/** /**
* @brief DeviceControllerDiag::private_setDiagEvent * @brief DeviceControllerDiag::private_setDiagEvent
* @param result - result value from 'sub_componentAssessment()', * @param result - result value from 'sub_componentAssessment()',

View File

@ -171,6 +171,8 @@ private slots:
void private_setDiagEvent(DeviceController::State result); void private_setDiagEvent(DeviceController::State result);
void private_sendDiagEvent(DCMachineEvent result, DeviceController::Action action); void private_sendDiagEvent(DCMachineEvent result, DeviceController::Action action);
void private_finishDiag();
void sys_superviseSystem(); void sys_superviseSystem();
}; };