diff --git a/src/ATBAPP/DeviceControllerDiag.cpp b/src/ATBAPP/DeviceControllerDiag.cpp index 1af4ff3..ffff726 100644 --- a/src/ATBAPP/DeviceControllerDiag.cpp +++ b/src/ATBAPP/DeviceControllerDiag.cpp @@ -62,7 +62,6 @@ void DeviceControllerDiag::diagRequest() qCritical() << "DeviceControllerDiag::diagRequest() is already running"; return; } - this->machineEventSet.clear(); this->isRequestRunning = true; this->diagRequestTimeoutTimer->start(); @@ -114,7 +113,7 @@ void DeviceControllerDiag::private_startDiag() qCritical() << "DeviceControllerDiag::private_startDiag() interrupted!"; DCMachineEvent E255Event = DCMachineEvent(DeviceController::State::E255); if (!this->previousMachineEventSet.contains(E255Event)) { - previousMachineEventSet.insert(E255Event); + machineEventSet.insert(E255Event); private_sendDiagEvent(E255Event, DeviceController::Action::SET); } if (this->E255counter > 5) { @@ -179,7 +178,7 @@ void DeviceControllerDiag::sys_superviseSystem() // send DCMachineEvent E255Event = DCMachineEvent(DeviceController::State::E255); if (!this->previousMachineEventSet.contains(E255Event)) { - previousMachineEventSet.insert(E255Event); + machineEventSet.insert(E255Event); private_sendDiagEvent(E255Event, DeviceController::Action::SET); } if (this->E255counter > 5) { this->restartCArun(); } @@ -238,6 +237,8 @@ void DeviceControllerDiag::sys_superviseSystem() void DeviceControllerDiag::sub_componentAssessment() { + this->machineEventSet.clear(); + bool flag_sendOperate = true; struct T_moduleCondition modCond = {}; @@ -722,8 +723,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"}); }