Comment: proposal: MachineEvents with JSON-Parameter

This commit is contained in:
Siegfried Siegert 2024-05-16 17:38:03 +02:00
parent ec18ac45e4
commit 5a999a0494
Signed by: SiegfriedSiegert
GPG Key ID: 68371E015E8F0B03

View File

@ -5,6 +5,9 @@
#include <QUuid>
#include <QDebug>
#include "support/JSON.h"
DeviceControllerDiag::DeviceControllerDiag(PersistentData *pData, QObject *parent)
: QObject(parent)
, coinProcessorType(nsDeviceControllerInterface::COIN_PROCESSOR::ESCROW)
@ -543,6 +546,16 @@ void DeviceControllerDiag::private_sendDiagEvent(DeviceController::State result)
this->lastState = result;
/**
* Variant: send 'parameter' as JSON:
*
JSON::setPrettySerialize(false);
JSON::JsonObject json = JSON::objectBuilder()
->set("description", parameter)
->create();
QString parameterJsonString = JSON::serialize(json);
*/
ATBMachineEvent *machineEvent = new ATBMachineEvent(
eventId,
"DC",
@ -553,8 +566,6 @@ void DeviceControllerDiag::private_sendDiagEvent(DeviceController::State result)
"" // second level info
);
//emit diagResponse(machineEvent);
QCoreApplication::postEvent(eventReceiver, machineEvent);
}