Comment: proposal: MachineEvents with JSON-Parameter
This commit is contained in:
		@@ -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);
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user