Diag: new constructor for DCMachineEvent

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

View File

@ -698,3 +698,17 @@ void DeviceControllerDiag::restartCArun()
this->private_setDiagEvent(DeviceController::State::W255); this->private_setDiagEvent(DeviceController::State::W255);
QProcess::startDetached("/bin/systemctl", {"restart", "carun"}); QProcess::startDetached("/bin/systemctl", {"restart", "carun"});
} }
/****************************************************************************************************
*
* DCMachineEvent
*/
DCMachineEvent::DCMachineEvent(DeviceController::State state) : state(state)
{
this->eventId = QUuid::createUuid().toString(QUuid::WithoutBraces).mid(0, 8);
}

View File

@ -78,7 +78,7 @@ namespace DeviceController {
class DCMachineEvent { class DCMachineEvent {
public: public:
DCMachineEvent() = default; DCMachineEvent() = default;
DCMachineEvent(DeviceController::State state, const QString& id) : state(state), eventId(id) {} DCMachineEvent(DeviceController::State state);
DeviceController::State state; DeviceController::State state;
QString eventId; QString eventId;