Diag: set E255 only once

This commit is contained in:
Siegfried Siegert 2025-06-12 16:33:32 +02:00
parent 91d8eb03b3
commit cc6dfee0e2
Signed by: SiegfriedSiegert
GPG Key ID: 68371E015E8F0B03

View File

@ -113,8 +113,10 @@ void DeviceControllerDiag::private_startDiag()
if (this->flagInterruptDiag) { if (this->flagInterruptDiag) {
qCritical() << "DeviceControllerDiag::private_startDiag() interrupted!"; qCritical() << "DeviceControllerDiag::private_startDiag() interrupted!";
DCMachineEvent E255Event = DCMachineEvent(DeviceController::State::E255); DCMachineEvent E255Event = DCMachineEvent(DeviceController::State::E255);
if (!this->previousMachineEventSet.contains(E255Event)) {
machineEventSet.insert(E255Event); machineEventSet.insert(E255Event);
private_sendDiagEvent(E255Event, DeviceController::Action::SET); private_sendDiagEvent(E255Event, DeviceController::Action::SET);
}
if (this->E255counter > 5) { if (this->E255counter > 5) {
this->restartCArun(); this->restartCArun();
// try it again, until success: // try it again, until success:
@ -174,8 +176,10 @@ void DeviceControllerDiag::sys_superviseSystem()
qCritical() << "DeviceControllerDiag::sys_superviseSystem() interrupted!"; qCritical() << "DeviceControllerDiag::sys_superviseSystem() interrupted!";
// send // send
DCMachineEvent E255Event = DCMachineEvent(DeviceController::State::E255); DCMachineEvent E255Event = DCMachineEvent(DeviceController::State::E255);
if (!this->previousMachineEventSet.contains(E255Event)) {
machineEventSet.insert(E255Event); machineEventSet.insert(E255Event);
private_sendDiagEvent(E255Event, DeviceController::Action::SET); private_sendDiagEvent(E255Event, DeviceController::Action::SET);
}
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);