Comment: proposal: MachineEvents with JSON-Parameter
This commit is contained in:
parent
ec18ac45e4
commit
5a999a0494
@ -5,6 +5,9 @@
|
|||||||
#include <QUuid>
|
#include <QUuid>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
|
#include "support/JSON.h"
|
||||||
|
|
||||||
|
|
||||||
DeviceControllerDiag::DeviceControllerDiag(PersistentData *pData, QObject *parent)
|
DeviceControllerDiag::DeviceControllerDiag(PersistentData *pData, QObject *parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
, coinProcessorType(nsDeviceControllerInterface::COIN_PROCESSOR::ESCROW)
|
, coinProcessorType(nsDeviceControllerInterface::COIN_PROCESSOR::ESCROW)
|
||||||
@ -543,6 +546,16 @@ void DeviceControllerDiag::private_sendDiagEvent(DeviceController::State result)
|
|||||||
|
|
||||||
this->lastState = 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(
|
ATBMachineEvent *machineEvent = new ATBMachineEvent(
|
||||||
eventId,
|
eventId,
|
||||||
"DC",
|
"DC",
|
||||||
@ -553,8 +566,6 @@ void DeviceControllerDiag::private_sendDiagEvent(DeviceController::State result)
|
|||||||
"" // second level info
|
"" // second level info
|
||||||
);
|
);
|
||||||
|
|
||||||
//emit diagResponse(machineEvent);
|
|
||||||
|
|
||||||
QCoreApplication::postEvent(eventReceiver, machineEvent);
|
QCoreApplication::postEvent(eventReceiver, machineEvent);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user