mirror of https://github.com/f4exb/sdrangel.git
228 lines
4.8 KiB
C++
228 lines
4.8 KiB
C++
/**
|
|
* SDRangel
|
|
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
|
|
*
|
|
* OpenAPI spec version: 4.0.0
|
|
* Contact: f4exb06@gmail.com
|
|
*
|
|
* NOTE: This class is auto generated by the swagger code generator program.
|
|
* https://github.com/swagger-api/swagger-codegen.git
|
|
* Do not edit the class manually.
|
|
*/
|
|
|
|
|
|
#include "SWGSamplingDevice.h"
|
|
|
|
#include "SWGHelpers.h"
|
|
|
|
#include <QJsonDocument>
|
|
#include <QJsonArray>
|
|
#include <QObject>
|
|
#include <QDebug>
|
|
|
|
namespace SWGSDRangel {
|
|
|
|
SWGSamplingDevice::SWGSamplingDevice(QString* json) {
|
|
init();
|
|
this->fromJson(*json);
|
|
}
|
|
|
|
SWGSamplingDevice::SWGSamplingDevice() {
|
|
init();
|
|
}
|
|
|
|
SWGSamplingDevice::~SWGSamplingDevice() {
|
|
this->cleanup();
|
|
}
|
|
|
|
void
|
|
SWGSamplingDevice::init() {
|
|
index = 0;
|
|
hw_type = new QString("");
|
|
tx = 0;
|
|
nb_streams = 0;
|
|
stream_index = 0;
|
|
sequence = 0;
|
|
serial = new QString("");
|
|
center_frequency = 0L;
|
|
bandwidth = 0;
|
|
state = new QString("");
|
|
}
|
|
|
|
void
|
|
SWGSamplingDevice::cleanup() {
|
|
|
|
|
|
if(hw_type != nullptr) {
|
|
delete hw_type;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(serial != nullptr) {
|
|
delete serial;
|
|
}
|
|
|
|
|
|
|
|
if(state != nullptr) {
|
|
delete state;
|
|
}
|
|
}
|
|
|
|
SWGSamplingDevice*
|
|
SWGSamplingDevice::fromJson(QString &json) {
|
|
QByteArray array (json.toStdString().c_str());
|
|
QJsonDocument doc = QJsonDocument::fromJson(array);
|
|
QJsonObject jsonObject = doc.object();
|
|
this->fromJsonObject(jsonObject);
|
|
return this;
|
|
}
|
|
|
|
void
|
|
SWGSamplingDevice::fromJsonObject(QJsonObject &pJson) {
|
|
::SWGSDRangel::setValue(&index, pJson["index"], "qint32", "");
|
|
::SWGSDRangel::setValue(&hw_type, pJson["hwType"], "QString", "QString");
|
|
::SWGSDRangel::setValue(&tx, pJson["tx"], "qint32", "");
|
|
::SWGSDRangel::setValue(&nb_streams, pJson["nbStreams"], "qint32", "");
|
|
::SWGSDRangel::setValue(&stream_index, pJson["streamIndex"], "qint32", "");
|
|
::SWGSDRangel::setValue(&sequence, pJson["sequence"], "qint32", "");
|
|
::SWGSDRangel::setValue(&serial, pJson["serial"], "QString", "QString");
|
|
::SWGSDRangel::setValue(¢er_frequency, pJson["centerFrequency"], "qint64", "");
|
|
::SWGSDRangel::setValue(&bandwidth, pJson["bandwidth"], "qint32", "");
|
|
::SWGSDRangel::setValue(&state, pJson["state"], "QString", "QString");
|
|
}
|
|
|
|
QString
|
|
SWGSamplingDevice::asJson ()
|
|
{
|
|
QJsonObject* obj = this->asJsonObject();
|
|
|
|
QJsonDocument doc(*obj);
|
|
QByteArray bytes = doc.toJson();
|
|
return QString(bytes);
|
|
}
|
|
|
|
QJsonObject*
|
|
SWGSamplingDevice::asJsonObject() {
|
|
QJsonObject* obj = new QJsonObject();
|
|
|
|
obj->insert("index", QJsonValue(index));
|
|
|
|
toJsonValue(QString("hwType"), hw_type, obj, QString("QString"));
|
|
|
|
obj->insert("tx", QJsonValue(tx));
|
|
|
|
obj->insert("nbStreams", QJsonValue(nb_streams));
|
|
|
|
obj->insert("streamIndex", QJsonValue(stream_index));
|
|
|
|
obj->insert("sequence", QJsonValue(sequence));
|
|
|
|
toJsonValue(QString("serial"), serial, obj, QString("QString"));
|
|
|
|
obj->insert("centerFrequency", QJsonValue(center_frequency));
|
|
|
|
obj->insert("bandwidth", QJsonValue(bandwidth));
|
|
|
|
toJsonValue(QString("state"), state, obj, QString("QString"));
|
|
|
|
return obj;
|
|
}
|
|
|
|
qint32
|
|
SWGSamplingDevice::getIndex() {
|
|
return index;
|
|
}
|
|
void
|
|
SWGSamplingDevice::setIndex(qint32 index) {
|
|
this->index = index;
|
|
}
|
|
|
|
QString*
|
|
SWGSamplingDevice::getHwType() {
|
|
return hw_type;
|
|
}
|
|
void
|
|
SWGSamplingDevice::setHwType(QString* hw_type) {
|
|
this->hw_type = hw_type;
|
|
}
|
|
|
|
qint32
|
|
SWGSamplingDevice::getTx() {
|
|
return tx;
|
|
}
|
|
void
|
|
SWGSamplingDevice::setTx(qint32 tx) {
|
|
this->tx = tx;
|
|
}
|
|
|
|
qint32
|
|
SWGSamplingDevice::getNbStreams() {
|
|
return nb_streams;
|
|
}
|
|
void
|
|
SWGSamplingDevice::setNbStreams(qint32 nb_streams) {
|
|
this->nb_streams = nb_streams;
|
|
}
|
|
|
|
qint32
|
|
SWGSamplingDevice::getStreamIndex() {
|
|
return stream_index;
|
|
}
|
|
void
|
|
SWGSamplingDevice::setStreamIndex(qint32 stream_index) {
|
|
this->stream_index = stream_index;
|
|
}
|
|
|
|
qint32
|
|
SWGSamplingDevice::getSequence() {
|
|
return sequence;
|
|
}
|
|
void
|
|
SWGSamplingDevice::setSequence(qint32 sequence) {
|
|
this->sequence = sequence;
|
|
}
|
|
|
|
QString*
|
|
SWGSamplingDevice::getSerial() {
|
|
return serial;
|
|
}
|
|
void
|
|
SWGSamplingDevice::setSerial(QString* serial) {
|
|
this->serial = serial;
|
|
}
|
|
|
|
qint64
|
|
SWGSamplingDevice::getCenterFrequency() {
|
|
return center_frequency;
|
|
}
|
|
void
|
|
SWGSamplingDevice::setCenterFrequency(qint64 center_frequency) {
|
|
this->center_frequency = center_frequency;
|
|
}
|
|
|
|
qint32
|
|
SWGSamplingDevice::getBandwidth() {
|
|
return bandwidth;
|
|
}
|
|
void
|
|
SWGSamplingDevice::setBandwidth(qint32 bandwidth) {
|
|
this->bandwidth = bandwidth;
|
|
}
|
|
|
|
QString*
|
|
SWGSamplingDevice::getState() {
|
|
return state;
|
|
}
|
|
void
|
|
SWGSamplingDevice::setState(QString* state) {
|
|
this->state = state;
|
|
}
|
|
|
|
|
|
}
|
|
|