Newer
Older
ZXSSCJ / CounterAcq / protocol / dto / CounterDataDto.cpp
tan yue on 20 Oct 2021 565 bytes 20211020 mock counter data frame
#include "CounterDataDto.h"
#include "common/utils/SettingConfig.h"

CounterDataDto::CounterDataDto(QObject *parent) : QObject(parent)
{

}

QJsonObject CounterDataDto::toJSON()
{
    QJsonObject jsonObj;

    QJsonObject dataObj;
    dataObj.insert("channelRefNo", this->channelRefId);
    dataObj.insert("dataValue", QString("%1").arg(this->channelClockValue));
    dataObj.insert("frameId", this->frameId);

    jsonObj.insert("channelNo", this->channelId);
    jsonObj.insert("ts", this->milisecond);
    jsonObj.insert("data", dataObj);

    return jsonObj;
}