mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-05-23 10:48:41 -04:00
Web API: new generator with lazy instantiation and some memory leak fixes. Implemented in webapi classes (part 1)
This commit is contained in:
parent
5f062a24bf
commit
a1f69ebc2b
@ -16922,7 +16922,7 @@ except ApiException as e:
|
||||
</div>
|
||||
<div id="generator">
|
||||
<div class="content">
|
||||
Generated 2018-02-12T16:42:25.289+01:00
|
||||
Generated 2018-02-14T00:45:07.183+01:00
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -125,6 +125,7 @@ public:
|
||||
* returns the Http status code (default 501: not implemented)
|
||||
*/
|
||||
virtual int instanceLoggingPut(
|
||||
SWGSDRangel::SWGLoggingInfo& query __attribute__((unused)),
|
||||
SWGSDRangel::SWGLoggingInfo& response __attribute__((unused)),
|
||||
SWGSDRangel::SWGErrorResponse& error)
|
||||
{
|
||||
|
@ -241,6 +241,7 @@ void WebAPIRequestMapper::instanceChannelsService(qtwebapp::HttpRequest& request
|
||||
|
||||
void WebAPIRequestMapper::instanceLoggingService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response)
|
||||
{
|
||||
SWGSDRangel::SWGLoggingInfo query;
|
||||
SWGSDRangel::SWGLoggingInfo normalResponse;
|
||||
SWGSDRangel::SWGErrorResponse errorResponse;
|
||||
response.setHeader("Content-Type", "application/json");
|
||||
@ -263,8 +264,8 @@ void WebAPIRequestMapper::instanceLoggingService(qtwebapp::HttpRequest& request,
|
||||
|
||||
if (parseJsonBody(jsonStr, jsonObject, response))
|
||||
{
|
||||
normalResponse.fromJson(jsonStr);
|
||||
int status = m_adapter->instanceLoggingPut(normalResponse, errorResponse);
|
||||
query.fromJson(jsonStr);
|
||||
int status = m_adapter->instanceLoggingPut(query, normalResponse, errorResponse);
|
||||
response.setStatus(status);
|
||||
|
||||
if (status/100 == 2) {
|
||||
|
@ -56,6 +56,7 @@
|
||||
#include "SWGChannelSettings.h"
|
||||
#include "SWGSuccessResponse.h"
|
||||
#include "SWGErrorResponse.h"
|
||||
#include "SWGDeviceState.h"
|
||||
|
||||
#include "webapiadaptergui.h"
|
||||
|
||||
@ -72,7 +73,7 @@ int WebAPIAdapterGUI::instanceSummary(
|
||||
SWGSDRangel::SWGInstanceSummaryResponse& response,
|
||||
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
|
||||
{
|
||||
|
||||
response.init();
|
||||
*response.getAppname() = qApp->applicationName();
|
||||
*response.getVersion() = qApp->applicationVersion();
|
||||
*response.getQtVersion() = QString(QT_VERSION_STR);
|
||||
@ -114,6 +115,7 @@ int WebAPIAdapterGUI::instanceDevices(
|
||||
SWGSDRangel::SWGInstanceDevicesResponse& response,
|
||||
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
|
||||
{
|
||||
response.init();
|
||||
int nbSamplingDevices = tx ? DeviceEnumerator::instance()->getNbTxSamplingDevices() : DeviceEnumerator::instance()->getNbRxSamplingDevices();
|
||||
response.setDevicecount(nbSamplingDevices);
|
||||
QList<SWGSDRangel::SWGDeviceListItem*> *devices = response.getDevices();
|
||||
@ -122,6 +124,7 @@ int WebAPIAdapterGUI::instanceDevices(
|
||||
{
|
||||
PluginInterface::SamplingDevice samplingDevice = tx ? DeviceEnumerator::instance()->getTxSamplingDevice(i) : DeviceEnumerator::instance()->getRxSamplingDevice(i);
|
||||
devices->append(new SWGSDRangel::SWGDeviceListItem);
|
||||
devices->back()->init();
|
||||
*devices->back()->getDisplayedName() = samplingDevice.displayedName;
|
||||
*devices->back()->getHwType() = samplingDevice.hardwareId;
|
||||
*devices->back()->getSerial() = samplingDevice.serial;
|
||||
@ -140,6 +143,7 @@ int WebAPIAdapterGUI::instanceChannels(
|
||||
SWGSDRangel::SWGInstanceChannelsResponse& response,
|
||||
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
|
||||
{
|
||||
response.init();
|
||||
PluginAPI::ChannelRegistrations *channelRegistrations = tx ? m_mainWindow.m_pluginManager->getTxChannelRegistrations() : m_mainWindow.m_pluginManager->getRxChannelRegistrations();
|
||||
int nbChannelDevices = channelRegistrations->size();
|
||||
response.setChannelcount(nbChannelDevices);
|
||||
@ -148,6 +152,7 @@ int WebAPIAdapterGUI::instanceChannels(
|
||||
for (int i = 0; i < nbChannelDevices; i++)
|
||||
{
|
||||
channels->append(new SWGSDRangel::SWGChannelListItem);
|
||||
channels->back()->init();
|
||||
PluginInterface *channelInterface = channelRegistrations->at(i).m_plugin;
|
||||
const PluginDescriptor& pluginDescriptor = channelInterface->getPluginDescriptor();
|
||||
*channels->back()->getVersion() = pluginDescriptor.version;
|
||||
@ -165,6 +170,7 @@ int WebAPIAdapterGUI::instanceLoggingGet(
|
||||
SWGSDRangel::SWGLoggingInfo& response,
|
||||
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
|
||||
{
|
||||
response.init();
|
||||
response.setDumpToFile(m_mainWindow.m_logger->getUseFileLogger() ? 1 : 0);
|
||||
|
||||
if (response.getDumpToFile()) {
|
||||
@ -178,14 +184,15 @@ int WebAPIAdapterGUI::instanceLoggingGet(
|
||||
}
|
||||
|
||||
int WebAPIAdapterGUI::instanceLoggingPut(
|
||||
SWGSDRangel::SWGLoggingInfo& query,
|
||||
SWGSDRangel::SWGLoggingInfo& response,
|
||||
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
|
||||
{
|
||||
// response input is the query actually
|
||||
bool dumpToFile = (response.getDumpToFile() != 0);
|
||||
QString* consoleLevel = response.getConsoleLevel();
|
||||
QString* fileLevel = response.getFileLevel();
|
||||
QString* fileName = response.getFileName();
|
||||
bool dumpToFile = (query.getDumpToFile() != 0);
|
||||
QString* consoleLevel = query.getConsoleLevel();
|
||||
QString* fileLevel = query.getFileLevel();
|
||||
QString* fileName = query.getFileName();
|
||||
|
||||
// perform actions
|
||||
if (consoleLevel) {
|
||||
@ -235,12 +242,14 @@ int WebAPIAdapterGUI::instanceAudioGet(
|
||||
for (int i = 0; i < nbInputDevices; i++)
|
||||
{
|
||||
inputDevices->append(new SWGSDRangel::SWGAudioDevice);
|
||||
inputDevices->back()->init();
|
||||
*inputDevices->back()->getName() = audioInputDevices.at(i).deviceName();
|
||||
}
|
||||
|
||||
for (int i = 0; i < nbOutputDevices; i++)
|
||||
{
|
||||
outputDevices->append(new SWGSDRangel::SWGAudioDevice);
|
||||
outputDevices->back()->init();
|
||||
*outputDevices->back()->getName() = audioOutputDevices.at(i).deviceName();
|
||||
}
|
||||
|
||||
@ -284,6 +293,7 @@ int WebAPIAdapterGUI::instanceLocationGet(
|
||||
SWGSDRangel::SWGLocationInformation& response,
|
||||
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
|
||||
{
|
||||
response.init();
|
||||
response.setLatitude(m_mainWindow.m_settings.getLatitude());
|
||||
response.setLongitude(m_mainWindow.m_settings.getLongitude());
|
||||
|
||||
@ -331,6 +341,7 @@ int WebAPIAdapterGUI::instanceDVSerialPatch(
|
||||
while (it != deviceNames.end())
|
||||
{
|
||||
deviceNamesList->append(new SWGSDRangel::SWGDVSerialDevice);
|
||||
deviceNamesList->back()->init();
|
||||
*deviceNamesList->back()->getDeviceName() = QString::fromStdString(*it);
|
||||
++it;
|
||||
}
|
||||
@ -843,6 +854,8 @@ int WebAPIAdapterGUI::devicesetDeviceRunGet(
|
||||
SWGSDRangel::SWGDeviceState& response,
|
||||
SWGSDRangel::SWGErrorResponse& error)
|
||||
{
|
||||
error.init();
|
||||
|
||||
if ((deviceSetIndex >= 0) && (deviceSetIndex < (int) m_mainWindow.m_deviceUIs.size()))
|
||||
{
|
||||
DeviceUISet *deviceSet = m_mainWindow.m_deviceUIs[deviceSetIndex];
|
||||
@ -850,25 +863,24 @@ int WebAPIAdapterGUI::devicesetDeviceRunGet(
|
||||
if (deviceSet->m_deviceSourceEngine) // Rx
|
||||
{
|
||||
DeviceSampleSource *source = deviceSet->m_deviceSourceAPI->getSampleSource();
|
||||
response.init();
|
||||
return source->webapiRunGet(response, *error.getMessage());
|
||||
}
|
||||
else if (deviceSet->m_deviceSinkEngine) // Tx
|
||||
{
|
||||
DeviceSampleSink *sink = deviceSet->m_deviceSinkAPI->getSampleSink();
|
||||
response.init();
|
||||
return sink->webapiRunGet(response, *error.getMessage());
|
||||
}
|
||||
else
|
||||
{
|
||||
error.init();
|
||||
*error.getMessage() = QString("DeviceSet error");
|
||||
return 500;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
error.init();
|
||||
*error.getMessage() = QString("There is no device set with index %1").arg(deviceSetIndex);
|
||||
|
||||
return 404;
|
||||
}
|
||||
}
|
||||
@ -878,6 +890,8 @@ int WebAPIAdapterGUI::devicesetDeviceRunPost(
|
||||
SWGSDRangel::SWGDeviceState& response,
|
||||
SWGSDRangel::SWGErrorResponse& error)
|
||||
{
|
||||
error.init();
|
||||
|
||||
if ((deviceSetIndex >= 0) && (deviceSetIndex < (int) m_mainWindow.m_deviceUIs.size()))
|
||||
{
|
||||
DeviceUISet *deviceSet = m_mainWindow.m_deviceUIs[deviceSetIndex];
|
||||
@ -885,25 +899,24 @@ int WebAPIAdapterGUI::devicesetDeviceRunPost(
|
||||
if (deviceSet->m_deviceSourceEngine) // Rx
|
||||
{
|
||||
DeviceSampleSource *source = deviceSet->m_deviceSourceAPI->getSampleSource();
|
||||
response.init();
|
||||
return source->webapiRun(true, response, *error.getMessage());
|
||||
}
|
||||
else if (deviceSet->m_deviceSinkEngine) // Tx
|
||||
{
|
||||
DeviceSampleSink *sink = deviceSet->m_deviceSinkAPI->getSampleSink();
|
||||
response.init();
|
||||
return sink->webapiRun(true, response, *error.getMessage());
|
||||
}
|
||||
else
|
||||
{
|
||||
error.init();
|
||||
*error.getMessage() = QString("DeviceSet error");
|
||||
return 500;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
error.init();
|
||||
*error.getMessage() = QString("There is no device set with index %1").arg(deviceSetIndex);
|
||||
|
||||
return 404;
|
||||
}
|
||||
}
|
||||
@ -913,6 +926,8 @@ int WebAPIAdapterGUI::devicesetDeviceRunDelete(
|
||||
SWGSDRangel::SWGDeviceState& response,
|
||||
SWGSDRangel::SWGErrorResponse& error)
|
||||
{
|
||||
error.init();
|
||||
|
||||
if ((deviceSetIndex >= 0) && (deviceSetIndex < (int) m_mainWindow.m_deviceUIs.size()))
|
||||
{
|
||||
DeviceUISet *deviceSet = m_mainWindow.m_deviceUIs[deviceSetIndex];
|
||||
@ -920,25 +935,24 @@ int WebAPIAdapterGUI::devicesetDeviceRunDelete(
|
||||
if (deviceSet->m_deviceSourceEngine) // Rx
|
||||
{
|
||||
DeviceSampleSource *source = deviceSet->m_deviceSourceAPI->getSampleSource();
|
||||
response.init();
|
||||
return source->webapiRun(false, response, *error.getMessage());
|
||||
}
|
||||
}
|
||||
else if (deviceSet->m_deviceSinkEngine) // Tx
|
||||
{
|
||||
DeviceSampleSink *sink = deviceSet->m_deviceSinkAPI->getSampleSink();
|
||||
response.init();
|
||||
return sink->webapiRun(false, response, *error.getMessage());
|
||||
}
|
||||
else
|
||||
{
|
||||
error.init();
|
||||
*error.getMessage() = QString("DeviceSet error");
|
||||
return 500;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
error.init();
|
||||
*error.getMessage() = QString("There is no device set with index %1").arg(deviceSetIndex);
|
||||
|
||||
return 404;
|
||||
}
|
||||
}
|
||||
|
@ -54,6 +54,7 @@ public:
|
||||
SWGSDRangel::SWGErrorResponse& error);
|
||||
|
||||
virtual int instanceLoggingPut(
|
||||
SWGSDRangel::SWGLoggingInfo& query,
|
||||
SWGSDRangel::SWGLoggingInfo& response,
|
||||
SWGSDRangel::SWGErrorResponse& error);
|
||||
|
||||
|
@ -39,6 +39,7 @@
|
||||
#include "SWGChannelSettings.h"
|
||||
#include "SWGSuccessResponse.h"
|
||||
#include "SWGErrorResponse.h"
|
||||
#include "SWGDeviceState.h"
|
||||
|
||||
#include "maincore.h"
|
||||
#include "loggerwithfile.h"
|
||||
@ -68,7 +69,7 @@ int WebAPIAdapterSrv::instanceSummary(
|
||||
SWGSDRangel::SWGInstanceSummaryResponse& response,
|
||||
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
|
||||
{
|
||||
|
||||
response.init();
|
||||
*response.getAppname() = QCoreApplication::applicationName();
|
||||
*response.getVersion() = QCoreApplication::applicationVersion();
|
||||
*response.getQtVersion() = QString(QT_VERSION_STR);
|
||||
@ -115,6 +116,7 @@ int WebAPIAdapterSrv::instanceDevices(
|
||||
SWGSDRangel::SWGInstanceDevicesResponse& response,
|
||||
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
|
||||
{
|
||||
response.init();
|
||||
int nbSamplingDevices = tx ? DeviceEnumerator::instance()->getNbTxSamplingDevices() : DeviceEnumerator::instance()->getNbRxSamplingDevices();
|
||||
response.setDevicecount(nbSamplingDevices);
|
||||
QList<SWGSDRangel::SWGDeviceListItem*> *devices = response.getDevices();
|
||||
@ -123,6 +125,7 @@ int WebAPIAdapterSrv::instanceDevices(
|
||||
{
|
||||
PluginInterface::SamplingDevice samplingDevice = tx ? DeviceEnumerator::instance()->getTxSamplingDevice(i) : DeviceEnumerator::instance()->getRxSamplingDevice(i);
|
||||
devices->append(new SWGSDRangel::SWGDeviceListItem);
|
||||
devices->back()->init();
|
||||
*devices->back()->getDisplayedName() = samplingDevice.displayedName;
|
||||
*devices->back()->getHwType() = samplingDevice.hardwareId;
|
||||
*devices->back()->getSerial() = samplingDevice.serial;
|
||||
@ -141,6 +144,7 @@ int WebAPIAdapterSrv::instanceChannels(
|
||||
SWGSDRangel::SWGInstanceChannelsResponse& response,
|
||||
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
|
||||
{
|
||||
response.init();
|
||||
PluginAPI::ChannelRegistrations *channelRegistrations = tx ? m_mainCore.m_pluginManager->getTxChannelRegistrations() : m_mainCore.m_pluginManager->getRxChannelRegistrations();
|
||||
int nbChannelDevices = channelRegistrations->size();
|
||||
response.setChannelcount(nbChannelDevices);
|
||||
@ -149,6 +153,7 @@ int WebAPIAdapterSrv::instanceChannels(
|
||||
for (int i = 0; i < nbChannelDevices; i++)
|
||||
{
|
||||
channels->append(new SWGSDRangel::SWGChannelListItem);
|
||||
channels->back()->init();
|
||||
PluginInterface *channelInterface = channelRegistrations->at(i).m_plugin;
|
||||
const PluginDescriptor& pluginDescriptor = channelInterface->getPluginDescriptor();
|
||||
*channels->back()->getVersion() = pluginDescriptor.version;
|
||||
@ -166,6 +171,7 @@ int WebAPIAdapterSrv::instanceLoggingGet(
|
||||
SWGSDRangel::SWGLoggingInfo& response,
|
||||
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
|
||||
{
|
||||
response.init();
|
||||
response.setDumpToFile(m_mainCore.m_logger->getUseFileLogger() ? 1 : 0);
|
||||
|
||||
if (response.getDumpToFile()) {
|
||||
@ -179,14 +185,15 @@ int WebAPIAdapterSrv::instanceLoggingGet(
|
||||
}
|
||||
|
||||
int WebAPIAdapterSrv::instanceLoggingPut(
|
||||
SWGSDRangel::SWGLoggingInfo& query,
|
||||
SWGSDRangel::SWGLoggingInfo& response,
|
||||
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
|
||||
{
|
||||
// response input is the query actually
|
||||
bool dumpToFile = (response.getDumpToFile() != 0);
|
||||
QString* consoleLevel = response.getConsoleLevel();
|
||||
QString* fileLevel = response.getFileLevel();
|
||||
QString* fileName = response.getFileName();
|
||||
bool dumpToFile = (query.getDumpToFile() != 0);
|
||||
QString* consoleLevel = query.getConsoleLevel();
|
||||
QString* fileLevel = query.getFileLevel();
|
||||
QString* fileName = query.getFileName();
|
||||
|
||||
// perform actions
|
||||
if (consoleLevel) {
|
||||
@ -236,12 +243,14 @@ int WebAPIAdapterSrv::instanceAudioGet(
|
||||
for (int i = 0; i < nbInputDevices; i++)
|
||||
{
|
||||
inputDevices->append(new SWGSDRangel::SWGAudioDevice);
|
||||
inputDevices->back()->init();
|
||||
*inputDevices->back()->getName() = audioInputDevices.at(i).deviceName();
|
||||
}
|
||||
|
||||
for (int i = 0; i < nbOutputDevices; i++)
|
||||
{
|
||||
outputDevices->append(new SWGSDRangel::SWGAudioDevice);
|
||||
outputDevices->back()->init();
|
||||
*outputDevices->back()->getName() = audioOutputDevices.at(i).deviceName();
|
||||
}
|
||||
|
||||
@ -285,6 +294,7 @@ int WebAPIAdapterSrv::instanceLocationGet(
|
||||
SWGSDRangel::SWGLocationInformation& response,
|
||||
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
|
||||
{
|
||||
response.init();
|
||||
response.setLatitude(m_mainCore.m_settings.getLatitude());
|
||||
response.setLongitude(m_mainCore.m_settings.getLongitude());
|
||||
|
||||
@ -331,6 +341,7 @@ int WebAPIAdapterSrv::instanceDVSerialPatch(
|
||||
while (it != deviceNames.end())
|
||||
{
|
||||
deviceNamesList->append(new SWGSDRangel::SWGDVSerialDevice);
|
||||
deviceNamesList->back()->init();
|
||||
*deviceNamesList->back()->getDeviceName() = QString::fromStdString(*it);
|
||||
++it;
|
||||
}
|
||||
@ -948,6 +959,8 @@ int WebAPIAdapterSrv::devicesetDeviceRunGet(
|
||||
SWGSDRangel::SWGDeviceState& response,
|
||||
SWGSDRangel::SWGErrorResponse& error)
|
||||
{
|
||||
error.init();
|
||||
|
||||
if ((deviceSetIndex >= 0) && (deviceSetIndex < (int) m_mainCore.m_deviceSets.size()))
|
||||
{
|
||||
DeviceSet *deviceSet = m_mainCore.m_deviceSets[deviceSetIndex];
|
||||
@ -955,25 +968,24 @@ int WebAPIAdapterSrv::devicesetDeviceRunGet(
|
||||
if (deviceSet->m_deviceSourceEngine) // Rx
|
||||
{
|
||||
DeviceSampleSource *source = deviceSet->m_deviceSourceAPI->getSampleSource();
|
||||
response.init();
|
||||
return source->webapiRunGet(response, *error.getMessage());
|
||||
}
|
||||
else if (deviceSet->m_deviceSinkEngine) // Tx
|
||||
{
|
||||
DeviceSampleSink *sink = deviceSet->m_deviceSinkAPI->getSampleSink();
|
||||
response.init();
|
||||
return sink->webapiRunGet(response, *error.getMessage());
|
||||
}
|
||||
else
|
||||
{
|
||||
error.init();
|
||||
*error.getMessage() = QString("DeviceSet error");
|
||||
return 500;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
error.init();
|
||||
*error.getMessage() = QString("There is no device set with index %1").arg(deviceSetIndex);
|
||||
|
||||
return 404;
|
||||
}
|
||||
}
|
||||
@ -983,6 +995,8 @@ int WebAPIAdapterSrv::devicesetDeviceRunPost(
|
||||
SWGSDRangel::SWGDeviceState& response,
|
||||
SWGSDRangel::SWGErrorResponse& error)
|
||||
{
|
||||
error.init();
|
||||
|
||||
if ((deviceSetIndex >= 0) && (deviceSetIndex < (int) m_mainCore.m_deviceSets.size()))
|
||||
{
|
||||
DeviceSet *deviceSet = m_mainCore.m_deviceSets[deviceSetIndex];
|
||||
@ -990,25 +1004,24 @@ int WebAPIAdapterSrv::devicesetDeviceRunPost(
|
||||
if (deviceSet->m_deviceSourceEngine) // Rx
|
||||
{
|
||||
DeviceSampleSource *source = deviceSet->m_deviceSourceAPI->getSampleSource();
|
||||
response.init();
|
||||
return source->webapiRun(true, response, *error.getMessage());
|
||||
}
|
||||
else if (deviceSet->m_deviceSinkEngine) // Tx
|
||||
{
|
||||
DeviceSampleSink *sink = deviceSet->m_deviceSinkAPI->getSampleSink();
|
||||
response.init();
|
||||
return sink->webapiRun(true, response, *error.getMessage());
|
||||
}
|
||||
else
|
||||
{
|
||||
error.init();
|
||||
*error.getMessage() = QString("DeviceSet error");
|
||||
return 500;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
error.init();
|
||||
*error.getMessage() = QString("There is no device set with index %1").arg(deviceSetIndex);
|
||||
|
||||
return 404;
|
||||
}
|
||||
}
|
||||
@ -1018,6 +1031,8 @@ int WebAPIAdapterSrv::devicesetDeviceRunDelete(
|
||||
SWGSDRangel::SWGDeviceState& response,
|
||||
SWGSDRangel::SWGErrorResponse& error)
|
||||
{
|
||||
error.init();
|
||||
|
||||
if ((deviceSetIndex >= 0) && (deviceSetIndex < (int) m_mainCore.m_deviceSets.size()))
|
||||
{
|
||||
DeviceSet *deviceSet = m_mainCore.m_deviceSets[deviceSetIndex];
|
||||
@ -1025,25 +1040,24 @@ int WebAPIAdapterSrv::devicesetDeviceRunDelete(
|
||||
if (deviceSet->m_deviceSourceEngine) // Rx
|
||||
{
|
||||
DeviceSampleSource *source = deviceSet->m_deviceSourceAPI->getSampleSource();
|
||||
response.init();
|
||||
return source->webapiRun(false, response, *error.getMessage());
|
||||
}
|
||||
else if (deviceSet->m_deviceSinkEngine) // Tx
|
||||
{
|
||||
DeviceSampleSink *sink = deviceSet->m_deviceSinkAPI->getSampleSink();
|
||||
response.init();
|
||||
return sink->webapiRun(false, response, *error.getMessage());
|
||||
}
|
||||
else
|
||||
{
|
||||
error.init();
|
||||
*error.getMessage() = QString("DeviceSet error");
|
||||
return 500;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
error.init();
|
||||
*error.getMessage() = QString("There is no device set with index %1").arg(deviceSetIndex);
|
||||
|
||||
return 404;
|
||||
}
|
||||
}
|
||||
|
@ -55,6 +55,7 @@ public:
|
||||
SWGSDRangel::SWGErrorResponse& error);
|
||||
|
||||
virtual int instanceLoggingPut(
|
||||
SWGSDRangel::SWGLoggingInfo& query,
|
||||
SWGSDRangel::SWGLoggingInfo& response,
|
||||
SWGSDRangel::SWGErrorResponse& error);
|
||||
|
||||
|
@ -16922,7 +16922,7 @@ except ApiException as e:
|
||||
</div>
|
||||
<div id="generator">
|
||||
<div class="content">
|
||||
Generated 2018-02-12T16:42:25.289+01:00
|
||||
Generated 2018-02-14T00:45:07.183+01:00
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -22,13 +22,14 @@
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGAudioDevice::SWGAudioDevice(QString json) {
|
||||
SWGAudioDevice::SWGAudioDevice(QString* json) {
|
||||
init();
|
||||
this->fromJson(json);
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGAudioDevice::SWGAudioDevice() {
|
||||
init();
|
||||
name = nullptr;
|
||||
m_name_isSet = false;
|
||||
}
|
||||
|
||||
SWGAudioDevice::~SWGAudioDevice() {
|
||||
@ -49,7 +50,7 @@ SWGAudioDevice::cleanup() {
|
||||
}
|
||||
|
||||
SWGAudioDevice*
|
||||
SWGAudioDevice::fromJson(QString json) {
|
||||
SWGAudioDevice::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
@ -58,7 +59,7 @@ SWGAudioDevice::fromJson(QString json) {
|
||||
}
|
||||
|
||||
void
|
||||
SWGAudioDevice::fromJsonObject(QJsonObject pJson) {
|
||||
SWGAudioDevice::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&name, pJson["name"], "QString", "QString");
|
||||
|
||||
}
|
||||
@ -66,15 +67,17 @@ SWGAudioDevice::fromJsonObject(QJsonObject pJson) {
|
||||
QString
|
||||
SWGAudioDevice::asJson ()
|
||||
{
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
QJsonObject*
|
||||
SWGAudioDevice::asJsonObject() {
|
||||
QJsonObject obj;
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(name != nullptr && *name != QString("")){
|
||||
toJsonValue(QString("name"), name, obj, QString("QString"));
|
||||
}
|
||||
|
@ -31,15 +31,15 @@ namespace SWGSDRangel {
|
||||
class SWGAudioDevice: public SWGObject {
|
||||
public:
|
||||
SWGAudioDevice();
|
||||
SWGAudioDevice(QString json);
|
||||
~SWGAudioDevice();
|
||||
SWGAudioDevice(QString* json);
|
||||
virtual ~SWGAudioDevice();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject asJsonObject();
|
||||
void fromJsonObject(QJsonObject json);
|
||||
SWGAudioDevice* fromJson(QString jsonString);
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGAudioDevice* fromJson(QString &jsonString);
|
||||
|
||||
QString* getName();
|
||||
void setName(QString* name);
|
||||
|
@ -22,13 +22,26 @@
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGAudioDevices::SWGAudioDevices(QString json) {
|
||||
SWGAudioDevices::SWGAudioDevices(QString* json) {
|
||||
init();
|
||||
this->fromJson(json);
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGAudioDevices::SWGAudioDevices() {
|
||||
init();
|
||||
input_volume = 0.0f;
|
||||
m_input_volume_isSet = false;
|
||||
nb_input_devices = 0;
|
||||
m_nb_input_devices_isSet = false;
|
||||
input_device_selected_index = 0;
|
||||
m_input_device_selected_index_isSet = false;
|
||||
input_devices = nullptr;
|
||||
m_input_devices_isSet = false;
|
||||
nb_output_devices = 0;
|
||||
m_nb_output_devices_isSet = false;
|
||||
output_device_selected_index = 0;
|
||||
m_output_device_selected_index_isSet = false;
|
||||
output_devices = nullptr;
|
||||
m_output_devices_isSet = false;
|
||||
}
|
||||
|
||||
SWGAudioDevices::~SWGAudioDevices() {
|
||||
@ -77,7 +90,7 @@ SWGAudioDevices::cleanup() {
|
||||
}
|
||||
|
||||
SWGAudioDevices*
|
||||
SWGAudioDevices::fromJson(QString json) {
|
||||
SWGAudioDevices::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
@ -86,7 +99,7 @@ SWGAudioDevices::fromJson(QString json) {
|
||||
}
|
||||
|
||||
void
|
||||
SWGAudioDevices::fromJsonObject(QJsonObject pJson) {
|
||||
SWGAudioDevices::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&input_volume, pJson["inputVolume"], "float", "");
|
||||
|
||||
::SWGSDRangel::setValue(&nb_input_devices, pJson["nbInputDevices"], "qint32", "");
|
||||
@ -106,32 +119,34 @@ SWGAudioDevices::fromJsonObject(QJsonObject pJson) {
|
||||
QString
|
||||
SWGAudioDevices::asJson ()
|
||||
{
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
QJsonObject*
|
||||
SWGAudioDevices::asJsonObject() {
|
||||
QJsonObject obj;
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(m_input_volume_isSet){
|
||||
obj.insert("inputVolume", QJsonValue(input_volume));
|
||||
obj->insert("inputVolume", QJsonValue(input_volume));
|
||||
}
|
||||
if(m_nb_input_devices_isSet){
|
||||
obj.insert("nbInputDevices", QJsonValue(nb_input_devices));
|
||||
obj->insert("nbInputDevices", QJsonValue(nb_input_devices));
|
||||
}
|
||||
if(m_input_device_selected_index_isSet){
|
||||
obj.insert("inputDeviceSelectedIndex", QJsonValue(input_device_selected_index));
|
||||
obj->insert("inputDeviceSelectedIndex", QJsonValue(input_device_selected_index));
|
||||
}
|
||||
if(input_devices->size() > 0){
|
||||
toJsonArray((QList<void*>*)input_devices, obj, "inputDevices", "SWGAudioDevice");
|
||||
}
|
||||
if(m_nb_output_devices_isSet){
|
||||
obj.insert("nbOutputDevices", QJsonValue(nb_output_devices));
|
||||
obj->insert("nbOutputDevices", QJsonValue(nb_output_devices));
|
||||
}
|
||||
if(m_output_device_selected_index_isSet){
|
||||
obj.insert("outputDeviceSelectedIndex", QJsonValue(output_device_selected_index));
|
||||
obj->insert("outputDeviceSelectedIndex", QJsonValue(output_device_selected_index));
|
||||
}
|
||||
if(output_devices->size() > 0){
|
||||
toJsonArray((QList<void*>*)output_devices, obj, "outputDevices", "SWGAudioDevice");
|
||||
|
@ -32,15 +32,15 @@ namespace SWGSDRangel {
|
||||
class SWGAudioDevices: public SWGObject {
|
||||
public:
|
||||
SWGAudioDevices();
|
||||
SWGAudioDevices(QString json);
|
||||
~SWGAudioDevices();
|
||||
SWGAudioDevices(QString* json);
|
||||
virtual ~SWGAudioDevices();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject asJsonObject();
|
||||
void fromJsonObject(QJsonObject json);
|
||||
SWGAudioDevices* fromJson(QString jsonString);
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGAudioDevices* fromJson(QString &jsonString);
|
||||
|
||||
float getInputVolume();
|
||||
void setInputVolume(float input_volume);
|
||||
|
@ -22,13 +22,18 @@
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGAudioDevicesSelect::SWGAudioDevicesSelect(QString json) {
|
||||
SWGAudioDevicesSelect::SWGAudioDevicesSelect(QString* json) {
|
||||
init();
|
||||
this->fromJson(json);
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGAudioDevicesSelect::SWGAudioDevicesSelect() {
|
||||
init();
|
||||
input_volume = 0.0f;
|
||||
m_input_volume_isSet = false;
|
||||
input_index = 0;
|
||||
m_input_index_isSet = false;
|
||||
output_index = 0;
|
||||
m_output_index_isSet = false;
|
||||
}
|
||||
|
||||
SWGAudioDevicesSelect::~SWGAudioDevicesSelect() {
|
||||
@ -53,7 +58,7 @@ SWGAudioDevicesSelect::cleanup() {
|
||||
}
|
||||
|
||||
SWGAudioDevicesSelect*
|
||||
SWGAudioDevicesSelect::fromJson(QString json) {
|
||||
SWGAudioDevicesSelect::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
@ -62,7 +67,7 @@ SWGAudioDevicesSelect::fromJson(QString json) {
|
||||
}
|
||||
|
||||
void
|
||||
SWGAudioDevicesSelect::fromJsonObject(QJsonObject pJson) {
|
||||
SWGAudioDevicesSelect::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&input_volume, pJson["inputVolume"], "float", "");
|
||||
|
||||
::SWGSDRangel::setValue(&input_index, pJson["inputIndex"], "qint32", "");
|
||||
@ -74,23 +79,25 @@ SWGAudioDevicesSelect::fromJsonObject(QJsonObject pJson) {
|
||||
QString
|
||||
SWGAudioDevicesSelect::asJson ()
|
||||
{
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
QJsonObject*
|
||||
SWGAudioDevicesSelect::asJsonObject() {
|
||||
QJsonObject obj;
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(m_input_volume_isSet){
|
||||
obj.insert("inputVolume", QJsonValue(input_volume));
|
||||
obj->insert("inputVolume", QJsonValue(input_volume));
|
||||
}
|
||||
if(m_input_index_isSet){
|
||||
obj.insert("inputIndex", QJsonValue(input_index));
|
||||
obj->insert("inputIndex", QJsonValue(input_index));
|
||||
}
|
||||
if(m_output_index_isSet){
|
||||
obj.insert("outputIndex", QJsonValue(output_index));
|
||||
obj->insert("outputIndex", QJsonValue(output_index));
|
||||
}
|
||||
|
||||
return obj;
|
||||
|
@ -30,15 +30,15 @@ namespace SWGSDRangel {
|
||||
class SWGAudioDevicesSelect: public SWGObject {
|
||||
public:
|
||||
SWGAudioDevicesSelect();
|
||||
SWGAudioDevicesSelect(QString json);
|
||||
~SWGAudioDevicesSelect();
|
||||
SWGAudioDevicesSelect(QString* json);
|
||||
virtual ~SWGAudioDevicesSelect();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject asJsonObject();
|
||||
void fromJsonObject(QJsonObject json);
|
||||
SWGAudioDevicesSelect* fromJson(QString jsonString);
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGAudioDevicesSelect* fromJson(QString &jsonString);
|
||||
|
||||
float getInputVolume();
|
||||
void setInputVolume(float input_volume);
|
||||
|
@ -22,13 +22,22 @@
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGCWKeyerSettings::SWGCWKeyerSettings(QString json) {
|
||||
SWGCWKeyerSettings::SWGCWKeyerSettings(QString* json) {
|
||||
init();
|
||||
this->fromJson(json);
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGCWKeyerSettings::SWGCWKeyerSettings() {
|
||||
init();
|
||||
sample_rate = 0;
|
||||
m_sample_rate_isSet = false;
|
||||
wpm = 0;
|
||||
m_wpm_isSet = false;
|
||||
mode = 0;
|
||||
m_mode_isSet = false;
|
||||
text = nullptr;
|
||||
m_text_isSet = false;
|
||||
loop = 0;
|
||||
m_loop_isSet = false;
|
||||
}
|
||||
|
||||
SWGCWKeyerSettings::~SWGCWKeyerSettings() {
|
||||
@ -61,7 +70,7 @@ SWGCWKeyerSettings::cleanup() {
|
||||
}
|
||||
|
||||
SWGCWKeyerSettings*
|
||||
SWGCWKeyerSettings::fromJson(QString json) {
|
||||
SWGCWKeyerSettings::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
@ -70,7 +79,7 @@ SWGCWKeyerSettings::fromJson(QString json) {
|
||||
}
|
||||
|
||||
void
|
||||
SWGCWKeyerSettings::fromJsonObject(QJsonObject pJson) {
|
||||
SWGCWKeyerSettings::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&sample_rate, pJson["sampleRate"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&wpm, pJson["wpm"], "qint32", "");
|
||||
@ -86,29 +95,31 @@ SWGCWKeyerSettings::fromJsonObject(QJsonObject pJson) {
|
||||
QString
|
||||
SWGCWKeyerSettings::asJson ()
|
||||
{
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
QJsonObject*
|
||||
SWGCWKeyerSettings::asJsonObject() {
|
||||
QJsonObject obj;
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(m_sample_rate_isSet){
|
||||
obj.insert("sampleRate", QJsonValue(sample_rate));
|
||||
obj->insert("sampleRate", QJsonValue(sample_rate));
|
||||
}
|
||||
if(m_wpm_isSet){
|
||||
obj.insert("wpm", QJsonValue(wpm));
|
||||
obj->insert("wpm", QJsonValue(wpm));
|
||||
}
|
||||
if(m_mode_isSet){
|
||||
obj.insert("mode", QJsonValue(mode));
|
||||
obj->insert("mode", QJsonValue(mode));
|
||||
}
|
||||
if(text != nullptr && *text != QString("")){
|
||||
toJsonValue(QString("text"), text, obj, QString("QString"));
|
||||
}
|
||||
if(m_loop_isSet){
|
||||
obj.insert("loop", QJsonValue(loop));
|
||||
obj->insert("loop", QJsonValue(loop));
|
||||
}
|
||||
|
||||
return obj;
|
||||
|
@ -31,15 +31,15 @@ namespace SWGSDRangel {
|
||||
class SWGCWKeyerSettings: public SWGObject {
|
||||
public:
|
||||
SWGCWKeyerSettings();
|
||||
SWGCWKeyerSettings(QString json);
|
||||
~SWGCWKeyerSettings();
|
||||
SWGCWKeyerSettings(QString* json);
|
||||
virtual ~SWGCWKeyerSettings();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject asJsonObject();
|
||||
void fromJsonObject(QJsonObject json);
|
||||
SWGCWKeyerSettings* fromJson(QString jsonString);
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGCWKeyerSettings* fromJson(QString &jsonString);
|
||||
|
||||
qint32 getSampleRate();
|
||||
void setSampleRate(qint32 sample_rate);
|
||||
|
@ -22,13 +22,22 @@
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGChannel::SWGChannel(QString json) {
|
||||
SWGChannel::SWGChannel(QString* json) {
|
||||
init();
|
||||
this->fromJson(json);
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGChannel::SWGChannel() {
|
||||
init();
|
||||
index = 0;
|
||||
m_index_isSet = false;
|
||||
id = nullptr;
|
||||
m_id_isSet = false;
|
||||
uid = 0L;
|
||||
m_uid_isSet = false;
|
||||
title = nullptr;
|
||||
m_title_isSet = false;
|
||||
delta_frequency = 0;
|
||||
m_delta_frequency_isSet = false;
|
||||
}
|
||||
|
||||
SWGChannel::~SWGChannel() {
|
||||
@ -63,7 +72,7 @@ SWGChannel::cleanup() {
|
||||
}
|
||||
|
||||
SWGChannel*
|
||||
SWGChannel::fromJson(QString json) {
|
||||
SWGChannel::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
@ -72,7 +81,7 @@ SWGChannel::fromJson(QString json) {
|
||||
}
|
||||
|
||||
void
|
||||
SWGChannel::fromJsonObject(QJsonObject pJson) {
|
||||
SWGChannel::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&index, pJson["index"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&id, pJson["id"], "QString", "QString");
|
||||
@ -88,29 +97,31 @@ SWGChannel::fromJsonObject(QJsonObject pJson) {
|
||||
QString
|
||||
SWGChannel::asJson ()
|
||||
{
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
QJsonObject*
|
||||
SWGChannel::asJsonObject() {
|
||||
QJsonObject obj;
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(m_index_isSet){
|
||||
obj.insert("index", QJsonValue(index));
|
||||
obj->insert("index", QJsonValue(index));
|
||||
}
|
||||
if(id != nullptr && *id != QString("")){
|
||||
toJsonValue(QString("id"), id, obj, QString("QString"));
|
||||
}
|
||||
if(m_uid_isSet){
|
||||
obj.insert("uid", QJsonValue(uid));
|
||||
obj->insert("uid", QJsonValue(uid));
|
||||
}
|
||||
if(title != nullptr && *title != QString("")){
|
||||
toJsonValue(QString("title"), title, obj, QString("QString"));
|
||||
}
|
||||
if(m_delta_frequency_isSet){
|
||||
obj.insert("deltaFrequency", QJsonValue(delta_frequency));
|
||||
obj->insert("deltaFrequency", QJsonValue(delta_frequency));
|
||||
}
|
||||
|
||||
return obj;
|
||||
|
@ -31,15 +31,15 @@ namespace SWGSDRangel {
|
||||
class SWGChannel: public SWGObject {
|
||||
public:
|
||||
SWGChannel();
|
||||
SWGChannel(QString json);
|
||||
~SWGChannel();
|
||||
SWGChannel(QString* json);
|
||||
virtual ~SWGChannel();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject asJsonObject();
|
||||
void fromJsonObject(QJsonObject json);
|
||||
SWGChannel* fromJson(QString jsonString);
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGChannel* fromJson(QString &jsonString);
|
||||
|
||||
qint32 getIndex();
|
||||
void setIndex(qint32 index);
|
||||
|
@ -22,13 +22,24 @@
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGChannelListItem::SWGChannelListItem(QString json) {
|
||||
SWGChannelListItem::SWGChannelListItem(QString* json) {
|
||||
init();
|
||||
this->fromJson(json);
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGChannelListItem::SWGChannelListItem() {
|
||||
init();
|
||||
name = nullptr;
|
||||
m_name_isSet = false;
|
||||
id_uri = nullptr;
|
||||
m_id_uri_isSet = false;
|
||||
id = nullptr;
|
||||
m_id_isSet = false;
|
||||
tx = 0;
|
||||
m_tx_isSet = false;
|
||||
version = nullptr;
|
||||
m_version_isSet = false;
|
||||
index = 0;
|
||||
m_index_isSet = false;
|
||||
}
|
||||
|
||||
SWGChannelListItem::~SWGChannelListItem() {
|
||||
@ -70,7 +81,7 @@ SWGChannelListItem::cleanup() {
|
||||
}
|
||||
|
||||
SWGChannelListItem*
|
||||
SWGChannelListItem::fromJson(QString json) {
|
||||
SWGChannelListItem::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
@ -79,7 +90,7 @@ SWGChannelListItem::fromJson(QString json) {
|
||||
}
|
||||
|
||||
void
|
||||
SWGChannelListItem::fromJsonObject(QJsonObject pJson) {
|
||||
SWGChannelListItem::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&name, pJson["name"], "QString", "QString");
|
||||
|
||||
::SWGSDRangel::setValue(&id_uri, pJson["idURI"], "QString", "QString");
|
||||
@ -97,15 +108,17 @@ SWGChannelListItem::fromJsonObject(QJsonObject pJson) {
|
||||
QString
|
||||
SWGChannelListItem::asJson ()
|
||||
{
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
QJsonObject*
|
||||
SWGChannelListItem::asJsonObject() {
|
||||
QJsonObject obj;
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(name != nullptr && *name != QString("")){
|
||||
toJsonValue(QString("name"), name, obj, QString("QString"));
|
||||
}
|
||||
@ -116,13 +129,13 @@ SWGChannelListItem::asJsonObject() {
|
||||
toJsonValue(QString("id"), id, obj, QString("QString"));
|
||||
}
|
||||
if(m_tx_isSet){
|
||||
obj.insert("tx", QJsonValue(tx));
|
||||
obj->insert("tx", QJsonValue(tx));
|
||||
}
|
||||
if(version != nullptr && *version != QString("")){
|
||||
toJsonValue(QString("version"), version, obj, QString("QString"));
|
||||
}
|
||||
if(m_index_isSet){
|
||||
obj.insert("index", QJsonValue(index));
|
||||
obj->insert("index", QJsonValue(index));
|
||||
}
|
||||
|
||||
return obj;
|
||||
|
@ -31,15 +31,15 @@ namespace SWGSDRangel {
|
||||
class SWGChannelListItem: public SWGObject {
|
||||
public:
|
||||
SWGChannelListItem();
|
||||
SWGChannelListItem(QString json);
|
||||
~SWGChannelListItem();
|
||||
SWGChannelListItem(QString* json);
|
||||
virtual ~SWGChannelListItem();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject asJsonObject();
|
||||
void fromJsonObject(QJsonObject json);
|
||||
SWGChannelListItem* fromJson(QString jsonString);
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGChannelListItem* fromJson(QString &jsonString);
|
||||
|
||||
QString* getName();
|
||||
void setName(QString* name);
|
||||
|
@ -22,13 +22,20 @@
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGChannelSettings::SWGChannelSettings(QString json) {
|
||||
SWGChannelSettings::SWGChannelSettings(QString* json) {
|
||||
init();
|
||||
this->fromJson(json);
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGChannelSettings::SWGChannelSettings() {
|
||||
init();
|
||||
channel_type = nullptr;
|
||||
m_channel_type_isSet = false;
|
||||
tx = 0;
|
||||
m_tx_isSet = false;
|
||||
nfm_demod_settings = nullptr;
|
||||
m_nfm_demod_settings_isSet = false;
|
||||
nfm_mod_settings = nullptr;
|
||||
m_nfm_mod_settings_isSet = false;
|
||||
}
|
||||
|
||||
SWGChannelSettings::~SWGChannelSettings() {
|
||||
@ -62,7 +69,7 @@ SWGChannelSettings::cleanup() {
|
||||
}
|
||||
|
||||
SWGChannelSettings*
|
||||
SWGChannelSettings::fromJson(QString json) {
|
||||
SWGChannelSettings::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
@ -71,7 +78,7 @@ SWGChannelSettings::fromJson(QString json) {
|
||||
}
|
||||
|
||||
void
|
||||
SWGChannelSettings::fromJsonObject(QJsonObject pJson) {
|
||||
SWGChannelSettings::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&channel_type, pJson["channelType"], "QString", "QString");
|
||||
|
||||
::SWGSDRangel::setValue(&tx, pJson["tx"], "qint32", "");
|
||||
@ -85,20 +92,22 @@ SWGChannelSettings::fromJsonObject(QJsonObject pJson) {
|
||||
QString
|
||||
SWGChannelSettings::asJson ()
|
||||
{
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
QJsonObject*
|
||||
SWGChannelSettings::asJsonObject() {
|
||||
QJsonObject obj;
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(channel_type != nullptr && *channel_type != QString("")){
|
||||
toJsonValue(QString("channelType"), channel_type, obj, QString("QString"));
|
||||
}
|
||||
if(m_tx_isSet){
|
||||
obj.insert("tx", QJsonValue(tx));
|
||||
obj->insert("tx", QJsonValue(tx));
|
||||
}
|
||||
if((nfm_demod_settings != nullptr) && (nfm_demod_settings->isSet())){
|
||||
toJsonValue(QString("NFMDemodSettings"), nfm_demod_settings, obj, QString("SWGNFMDemodSettings"));
|
||||
|
@ -33,15 +33,15 @@ namespace SWGSDRangel {
|
||||
class SWGChannelSettings: public SWGObject {
|
||||
public:
|
||||
SWGChannelSettings();
|
||||
SWGChannelSettings(QString json);
|
||||
~SWGChannelSettings();
|
||||
SWGChannelSettings(QString* json);
|
||||
virtual ~SWGChannelSettings();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject asJsonObject();
|
||||
void fromJsonObject(QJsonObject json);
|
||||
SWGChannelSettings* fromJson(QString jsonString);
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGChannelSettings* fromJson(QString &jsonString);
|
||||
|
||||
QString* getChannelType();
|
||||
void setChannelType(QString* channel_type);
|
||||
|
@ -22,13 +22,16 @@
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGDVSeralDevices::SWGDVSeralDevices(QString json) {
|
||||
SWGDVSeralDevices::SWGDVSeralDevices(QString* json) {
|
||||
init();
|
||||
this->fromJson(json);
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGDVSeralDevices::SWGDVSeralDevices() {
|
||||
init();
|
||||
nb_devices = 0;
|
||||
m_nb_devices_isSet = false;
|
||||
dv_serial_devices = nullptr;
|
||||
m_dv_serial_devices_isSet = false;
|
||||
}
|
||||
|
||||
SWGDVSeralDevices::~SWGDVSeralDevices() {
|
||||
@ -56,7 +59,7 @@ SWGDVSeralDevices::cleanup() {
|
||||
}
|
||||
|
||||
SWGDVSeralDevices*
|
||||
SWGDVSeralDevices::fromJson(QString json) {
|
||||
SWGDVSeralDevices::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
@ -65,7 +68,7 @@ SWGDVSeralDevices::fromJson(QString json) {
|
||||
}
|
||||
|
||||
void
|
||||
SWGDVSeralDevices::fromJsonObject(QJsonObject pJson) {
|
||||
SWGDVSeralDevices::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&nb_devices, pJson["nbDevices"], "qint32", "");
|
||||
|
||||
|
||||
@ -75,17 +78,19 @@ SWGDVSeralDevices::fromJsonObject(QJsonObject pJson) {
|
||||
QString
|
||||
SWGDVSeralDevices::asJson ()
|
||||
{
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
QJsonObject*
|
||||
SWGDVSeralDevices::asJsonObject() {
|
||||
QJsonObject obj;
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(m_nb_devices_isSet){
|
||||
obj.insert("nbDevices", QJsonValue(nb_devices));
|
||||
obj->insert("nbDevices", QJsonValue(nb_devices));
|
||||
}
|
||||
if(dv_serial_devices->size() > 0){
|
||||
toJsonArray((QList<void*>*)dv_serial_devices, obj, "dvSerialDevices", "SWGDVSerialDevice");
|
||||
|
@ -32,15 +32,15 @@ namespace SWGSDRangel {
|
||||
class SWGDVSeralDevices: public SWGObject {
|
||||
public:
|
||||
SWGDVSeralDevices();
|
||||
SWGDVSeralDevices(QString json);
|
||||
~SWGDVSeralDevices();
|
||||
SWGDVSeralDevices(QString* json);
|
||||
virtual ~SWGDVSeralDevices();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject asJsonObject();
|
||||
void fromJsonObject(QJsonObject json);
|
||||
SWGDVSeralDevices* fromJson(QString jsonString);
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGDVSeralDevices* fromJson(QString &jsonString);
|
||||
|
||||
qint32 getNbDevices();
|
||||
void setNbDevices(qint32 nb_devices);
|
||||
|
@ -22,13 +22,14 @@
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGDVSerialDevice::SWGDVSerialDevice(QString json) {
|
||||
SWGDVSerialDevice::SWGDVSerialDevice(QString* json) {
|
||||
init();
|
||||
this->fromJson(json);
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGDVSerialDevice::SWGDVSerialDevice() {
|
||||
init();
|
||||
device_name = nullptr;
|
||||
m_device_name_isSet = false;
|
||||
}
|
||||
|
||||
SWGDVSerialDevice::~SWGDVSerialDevice() {
|
||||
@ -49,7 +50,7 @@ SWGDVSerialDevice::cleanup() {
|
||||
}
|
||||
|
||||
SWGDVSerialDevice*
|
||||
SWGDVSerialDevice::fromJson(QString json) {
|
||||
SWGDVSerialDevice::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
@ -58,7 +59,7 @@ SWGDVSerialDevice::fromJson(QString json) {
|
||||
}
|
||||
|
||||
void
|
||||
SWGDVSerialDevice::fromJsonObject(QJsonObject pJson) {
|
||||
SWGDVSerialDevice::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&device_name, pJson["deviceName"], "QString", "QString");
|
||||
|
||||
}
|
||||
@ -66,15 +67,17 @@ SWGDVSerialDevice::fromJsonObject(QJsonObject pJson) {
|
||||
QString
|
||||
SWGDVSerialDevice::asJson ()
|
||||
{
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
QJsonObject*
|
||||
SWGDVSerialDevice::asJsonObject() {
|
||||
QJsonObject obj;
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(device_name != nullptr && *device_name != QString("")){
|
||||
toJsonValue(QString("deviceName"), device_name, obj, QString("QString"));
|
||||
}
|
||||
|
@ -31,15 +31,15 @@ namespace SWGSDRangel {
|
||||
class SWGDVSerialDevice: public SWGObject {
|
||||
public:
|
||||
SWGDVSerialDevice();
|
||||
SWGDVSerialDevice(QString json);
|
||||
~SWGDVSerialDevice();
|
||||
SWGDVSerialDevice(QString* json);
|
||||
virtual ~SWGDVSerialDevice();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject asJsonObject();
|
||||
void fromJsonObject(QJsonObject json);
|
||||
SWGDVSerialDevice* fromJson(QString jsonString);
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGDVSerialDevice* fromJson(QString &jsonString);
|
||||
|
||||
QString* getDeviceName();
|
||||
void setDeviceName(QString* device_name);
|
||||
|
@ -22,13 +22,30 @@
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGDeviceListItem::SWGDeviceListItem(QString json) {
|
||||
SWGDeviceListItem::SWGDeviceListItem(QString* json) {
|
||||
init();
|
||||
this->fromJson(json);
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGDeviceListItem::SWGDeviceListItem() {
|
||||
init();
|
||||
displayed_name = nullptr;
|
||||
m_displayed_name_isSet = false;
|
||||
hw_type = nullptr;
|
||||
m_hw_type_isSet = false;
|
||||
serial = nullptr;
|
||||
m_serial_isSet = false;
|
||||
sequence = 0;
|
||||
m_sequence_isSet = false;
|
||||
tx = 0;
|
||||
m_tx_isSet = false;
|
||||
nb_streams = 0;
|
||||
m_nb_streams_isSet = false;
|
||||
stream_index = 0;
|
||||
m_stream_index_isSet = false;
|
||||
device_set_index = 0;
|
||||
m_device_set_index_isSet = false;
|
||||
index = 0;
|
||||
m_index_isSet = false;
|
||||
}
|
||||
|
||||
SWGDeviceListItem::~SWGDeviceListItem() {
|
||||
@ -77,7 +94,7 @@ SWGDeviceListItem::cleanup() {
|
||||
}
|
||||
|
||||
SWGDeviceListItem*
|
||||
SWGDeviceListItem::fromJson(QString json) {
|
||||
SWGDeviceListItem::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
@ -86,7 +103,7 @@ SWGDeviceListItem::fromJson(QString json) {
|
||||
}
|
||||
|
||||
void
|
||||
SWGDeviceListItem::fromJsonObject(QJsonObject pJson) {
|
||||
SWGDeviceListItem::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&displayed_name, pJson["displayedName"], "QString", "QString");
|
||||
|
||||
::SWGSDRangel::setValue(&hw_type, pJson["hwType"], "QString", "QString");
|
||||
@ -110,15 +127,17 @@ SWGDeviceListItem::fromJsonObject(QJsonObject pJson) {
|
||||
QString
|
||||
SWGDeviceListItem::asJson ()
|
||||
{
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
QJsonObject*
|
||||
SWGDeviceListItem::asJsonObject() {
|
||||
QJsonObject obj;
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(displayed_name != nullptr && *displayed_name != QString("")){
|
||||
toJsonValue(QString("displayedName"), displayed_name, obj, QString("QString"));
|
||||
}
|
||||
@ -129,22 +148,22 @@ SWGDeviceListItem::asJsonObject() {
|
||||
toJsonValue(QString("serial"), serial, obj, QString("QString"));
|
||||
}
|
||||
if(m_sequence_isSet){
|
||||
obj.insert("sequence", QJsonValue(sequence));
|
||||
obj->insert("sequence", QJsonValue(sequence));
|
||||
}
|
||||
if(m_tx_isSet){
|
||||
obj.insert("tx", QJsonValue(tx));
|
||||
obj->insert("tx", QJsonValue(tx));
|
||||
}
|
||||
if(m_nb_streams_isSet){
|
||||
obj.insert("nbStreams", QJsonValue(nb_streams));
|
||||
obj->insert("nbStreams", QJsonValue(nb_streams));
|
||||
}
|
||||
if(m_stream_index_isSet){
|
||||
obj.insert("streamIndex", QJsonValue(stream_index));
|
||||
obj->insert("streamIndex", QJsonValue(stream_index));
|
||||
}
|
||||
if(m_device_set_index_isSet){
|
||||
obj.insert("deviceSetIndex", QJsonValue(device_set_index));
|
||||
obj->insert("deviceSetIndex", QJsonValue(device_set_index));
|
||||
}
|
||||
if(m_index_isSet){
|
||||
obj.insert("index", QJsonValue(index));
|
||||
obj->insert("index", QJsonValue(index));
|
||||
}
|
||||
|
||||
return obj;
|
||||
|
@ -31,15 +31,15 @@ namespace SWGSDRangel {
|
||||
class SWGDeviceListItem: public SWGObject {
|
||||
public:
|
||||
SWGDeviceListItem();
|
||||
SWGDeviceListItem(QString json);
|
||||
~SWGDeviceListItem();
|
||||
SWGDeviceListItem(QString* json);
|
||||
virtual ~SWGDeviceListItem();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject asJsonObject();
|
||||
void fromJsonObject(QJsonObject json);
|
||||
SWGDeviceListItem* fromJson(QString jsonString);
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGDeviceListItem* fromJson(QString &jsonString);
|
||||
|
||||
QString* getDisplayedName();
|
||||
void setDisplayedName(QString* displayed_name);
|
||||
|
@ -22,13 +22,18 @@
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGDeviceSet::SWGDeviceSet(QString json) {
|
||||
SWGDeviceSet::SWGDeviceSet(QString* json) {
|
||||
init();
|
||||
this->fromJson(json);
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGDeviceSet::SWGDeviceSet() {
|
||||
init();
|
||||
sampling_device = nullptr;
|
||||
m_sampling_device_isSet = false;
|
||||
channelcount = 0;
|
||||
m_channelcount_isSet = false;
|
||||
channels = nullptr;
|
||||
m_channels_isSet = false;
|
||||
}
|
||||
|
||||
SWGDeviceSet::~SWGDeviceSet() {
|
||||
@ -61,7 +66,7 @@ SWGDeviceSet::cleanup() {
|
||||
}
|
||||
|
||||
SWGDeviceSet*
|
||||
SWGDeviceSet::fromJson(QString json) {
|
||||
SWGDeviceSet::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
@ -70,7 +75,7 @@ SWGDeviceSet::fromJson(QString json) {
|
||||
}
|
||||
|
||||
void
|
||||
SWGDeviceSet::fromJsonObject(QJsonObject pJson) {
|
||||
SWGDeviceSet::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&sampling_device, pJson["samplingDevice"], "SWGSamplingDevice", "SWGSamplingDevice");
|
||||
|
||||
::SWGSDRangel::setValue(&channelcount, pJson["channelcount"], "qint32", "");
|
||||
@ -82,20 +87,22 @@ SWGDeviceSet::fromJsonObject(QJsonObject pJson) {
|
||||
QString
|
||||
SWGDeviceSet::asJson ()
|
||||
{
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
QJsonObject*
|
||||
SWGDeviceSet::asJsonObject() {
|
||||
QJsonObject obj;
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if((sampling_device != nullptr) && (sampling_device->isSet())){
|
||||
toJsonValue(QString("samplingDevice"), sampling_device, obj, QString("SWGSamplingDevice"));
|
||||
}
|
||||
if(m_channelcount_isSet){
|
||||
obj.insert("channelcount", QJsonValue(channelcount));
|
||||
obj->insert("channelcount", QJsonValue(channelcount));
|
||||
}
|
||||
if(channels->size() > 0){
|
||||
toJsonArray((QList<void*>*)channels, obj, "channels", "SWGChannel");
|
||||
|
@ -33,15 +33,15 @@ namespace SWGSDRangel {
|
||||
class SWGDeviceSet: public SWGObject {
|
||||
public:
|
||||
SWGDeviceSet();
|
||||
SWGDeviceSet(QString json);
|
||||
~SWGDeviceSet();
|
||||
SWGDeviceSet(QString* json);
|
||||
virtual ~SWGDeviceSet();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject asJsonObject();
|
||||
void fromJsonObject(QJsonObject json);
|
||||
SWGDeviceSet* fromJson(QString jsonString);
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGDeviceSet* fromJson(QString &jsonString);
|
||||
|
||||
SWGSamplingDevice* getSamplingDevice();
|
||||
void setSamplingDevice(SWGSamplingDevice* sampling_device);
|
||||
|
@ -22,13 +22,18 @@
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGDeviceSetList::SWGDeviceSetList(QString json) {
|
||||
SWGDeviceSetList::SWGDeviceSetList(QString* json) {
|
||||
init();
|
||||
this->fromJson(json);
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGDeviceSetList::SWGDeviceSetList() {
|
||||
init();
|
||||
devicesetcount = 0;
|
||||
m_devicesetcount_isSet = false;
|
||||
devicesetfocus = 0;
|
||||
m_devicesetfocus_isSet = false;
|
||||
device_sets = nullptr;
|
||||
m_device_sets_isSet = false;
|
||||
}
|
||||
|
||||
SWGDeviceSetList::~SWGDeviceSetList() {
|
||||
@ -59,7 +64,7 @@ SWGDeviceSetList::cleanup() {
|
||||
}
|
||||
|
||||
SWGDeviceSetList*
|
||||
SWGDeviceSetList::fromJson(QString json) {
|
||||
SWGDeviceSetList::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
@ -68,7 +73,7 @@ SWGDeviceSetList::fromJson(QString json) {
|
||||
}
|
||||
|
||||
void
|
||||
SWGDeviceSetList::fromJsonObject(QJsonObject pJson) {
|
||||
SWGDeviceSetList::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&devicesetcount, pJson["devicesetcount"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&devicesetfocus, pJson["devicesetfocus"], "qint32", "");
|
||||
@ -80,20 +85,22 @@ SWGDeviceSetList::fromJsonObject(QJsonObject pJson) {
|
||||
QString
|
||||
SWGDeviceSetList::asJson ()
|
||||
{
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
QJsonObject*
|
||||
SWGDeviceSetList::asJsonObject() {
|
||||
QJsonObject obj;
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(m_devicesetcount_isSet){
|
||||
obj.insert("devicesetcount", QJsonValue(devicesetcount));
|
||||
obj->insert("devicesetcount", QJsonValue(devicesetcount));
|
||||
}
|
||||
if(m_devicesetfocus_isSet){
|
||||
obj.insert("devicesetfocus", QJsonValue(devicesetfocus));
|
||||
obj->insert("devicesetfocus", QJsonValue(devicesetfocus));
|
||||
}
|
||||
if(device_sets->size() > 0){
|
||||
toJsonArray((QList<void*>*)device_sets, obj, "deviceSets", "SWGDeviceSet");
|
||||
|
@ -32,15 +32,15 @@ namespace SWGSDRangel {
|
||||
class SWGDeviceSetList: public SWGObject {
|
||||
public:
|
||||
SWGDeviceSetList();
|
||||
SWGDeviceSetList(QString json);
|
||||
~SWGDeviceSetList();
|
||||
SWGDeviceSetList(QString* json);
|
||||
virtual ~SWGDeviceSetList();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject asJsonObject();
|
||||
void fromJsonObject(QJsonObject json);
|
||||
SWGDeviceSetList* fromJson(QString jsonString);
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGDeviceSetList* fromJson(QString &jsonString);
|
||||
|
||||
qint32 getDevicesetcount();
|
||||
void setDevicesetcount(qint32 devicesetcount);
|
||||
|
@ -22,13 +22,28 @@
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGDeviceSettings::SWGDeviceSettings(QString json) {
|
||||
SWGDeviceSettings::SWGDeviceSettings(QString* json) {
|
||||
init();
|
||||
this->fromJson(json);
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGDeviceSettings::SWGDeviceSettings() {
|
||||
init();
|
||||
device_hw_type = nullptr;
|
||||
m_device_hw_type_isSet = false;
|
||||
tx = 0;
|
||||
m_tx_isSet = false;
|
||||
file_source_settings = nullptr;
|
||||
m_file_source_settings_isSet = false;
|
||||
hack_rf_input_settings = nullptr;
|
||||
m_hack_rf_input_settings_isSet = false;
|
||||
hack_rf_output_settings = nullptr;
|
||||
m_hack_rf_output_settings_isSet = false;
|
||||
lime_sdr_input_settings = nullptr;
|
||||
m_lime_sdr_input_settings_isSet = false;
|
||||
lime_sdr_output_settings = nullptr;
|
||||
m_lime_sdr_output_settings_isSet = false;
|
||||
rtl_sdr_settings = nullptr;
|
||||
m_rtl_sdr_settings_isSet = false;
|
||||
}
|
||||
|
||||
SWGDeviceSettings::~SWGDeviceSettings() {
|
||||
@ -82,7 +97,7 @@ SWGDeviceSettings::cleanup() {
|
||||
}
|
||||
|
||||
SWGDeviceSettings*
|
||||
SWGDeviceSettings::fromJson(QString json) {
|
||||
SWGDeviceSettings::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
@ -91,7 +106,7 @@ SWGDeviceSettings::fromJson(QString json) {
|
||||
}
|
||||
|
||||
void
|
||||
SWGDeviceSettings::fromJsonObject(QJsonObject pJson) {
|
||||
SWGDeviceSettings::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&device_hw_type, pJson["deviceHwType"], "QString", "QString");
|
||||
|
||||
::SWGSDRangel::setValue(&tx, pJson["tx"], "qint32", "");
|
||||
@ -113,20 +128,22 @@ SWGDeviceSettings::fromJsonObject(QJsonObject pJson) {
|
||||
QString
|
||||
SWGDeviceSettings::asJson ()
|
||||
{
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
QJsonObject*
|
||||
SWGDeviceSettings::asJsonObject() {
|
||||
QJsonObject obj;
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(device_hw_type != nullptr && *device_hw_type != QString("")){
|
||||
toJsonValue(QString("deviceHwType"), device_hw_type, obj, QString("QString"));
|
||||
}
|
||||
if(m_tx_isSet){
|
||||
obj.insert("tx", QJsonValue(tx));
|
||||
obj->insert("tx", QJsonValue(tx));
|
||||
}
|
||||
if((file_source_settings != nullptr) && (file_source_settings->isSet())){
|
||||
toJsonValue(QString("fileSourceSettings"), file_source_settings, obj, QString("SWGFileSourceSettings"));
|
||||
|
@ -37,15 +37,15 @@ namespace SWGSDRangel {
|
||||
class SWGDeviceSettings: public SWGObject {
|
||||
public:
|
||||
SWGDeviceSettings();
|
||||
SWGDeviceSettings(QString json);
|
||||
~SWGDeviceSettings();
|
||||
SWGDeviceSettings(QString* json);
|
||||
virtual ~SWGDeviceSettings();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject asJsonObject();
|
||||
void fromJsonObject(QJsonObject json);
|
||||
SWGDeviceSettings* fromJson(QString jsonString);
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGDeviceSettings* fromJson(QString &jsonString);
|
||||
|
||||
QString* getDeviceHwType();
|
||||
void setDeviceHwType(QString* device_hw_type);
|
||||
|
@ -22,13 +22,14 @@
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGDeviceState::SWGDeviceState(QString json) {
|
||||
SWGDeviceState::SWGDeviceState(QString* json) {
|
||||
init();
|
||||
this->fromJson(json);
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGDeviceState::SWGDeviceState() {
|
||||
init();
|
||||
state = nullptr;
|
||||
m_state_isSet = false;
|
||||
}
|
||||
|
||||
SWGDeviceState::~SWGDeviceState() {
|
||||
@ -49,7 +50,7 @@ SWGDeviceState::cleanup() {
|
||||
}
|
||||
|
||||
SWGDeviceState*
|
||||
SWGDeviceState::fromJson(QString json) {
|
||||
SWGDeviceState::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
@ -58,7 +59,7 @@ SWGDeviceState::fromJson(QString json) {
|
||||
}
|
||||
|
||||
void
|
||||
SWGDeviceState::fromJsonObject(QJsonObject pJson) {
|
||||
SWGDeviceState::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&state, pJson["state"], "QString", "QString");
|
||||
|
||||
}
|
||||
@ -66,15 +67,17 @@ SWGDeviceState::fromJsonObject(QJsonObject pJson) {
|
||||
QString
|
||||
SWGDeviceState::asJson ()
|
||||
{
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
QJsonObject*
|
||||
SWGDeviceState::asJsonObject() {
|
||||
QJsonObject obj;
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(state != nullptr && *state != QString("")){
|
||||
toJsonValue(QString("state"), state, obj, QString("QString"));
|
||||
}
|
||||
|
@ -31,15 +31,15 @@ namespace SWGSDRangel {
|
||||
class SWGDeviceState: public SWGObject {
|
||||
public:
|
||||
SWGDeviceState();
|
||||
SWGDeviceState(QString json);
|
||||
~SWGDeviceState();
|
||||
SWGDeviceState(QString* json);
|
||||
virtual ~SWGDeviceState();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject asJsonObject();
|
||||
void fromJsonObject(QJsonObject json);
|
||||
SWGDeviceState* fromJson(QString jsonString);
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGDeviceState* fromJson(QString &jsonString);
|
||||
|
||||
QString* getState();
|
||||
void setState(QString* state);
|
||||
|
@ -22,13 +22,14 @@
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGErrorResponse::SWGErrorResponse(QString json) {
|
||||
SWGErrorResponse::SWGErrorResponse(QString* json) {
|
||||
init();
|
||||
this->fromJson(json);
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGErrorResponse::SWGErrorResponse() {
|
||||
init();
|
||||
message = nullptr;
|
||||
m_message_isSet = false;
|
||||
}
|
||||
|
||||
SWGErrorResponse::~SWGErrorResponse() {
|
||||
@ -49,7 +50,7 @@ SWGErrorResponse::cleanup() {
|
||||
}
|
||||
|
||||
SWGErrorResponse*
|
||||
SWGErrorResponse::fromJson(QString json) {
|
||||
SWGErrorResponse::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
@ -58,7 +59,7 @@ SWGErrorResponse::fromJson(QString json) {
|
||||
}
|
||||
|
||||
void
|
||||
SWGErrorResponse::fromJsonObject(QJsonObject pJson) {
|
||||
SWGErrorResponse::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&message, pJson["message"], "QString", "QString");
|
||||
|
||||
}
|
||||
@ -66,15 +67,17 @@ SWGErrorResponse::fromJsonObject(QJsonObject pJson) {
|
||||
QString
|
||||
SWGErrorResponse::asJson ()
|
||||
{
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
QJsonObject*
|
||||
SWGErrorResponse::asJsonObject() {
|
||||
QJsonObject obj;
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(message != nullptr && *message != QString("")){
|
||||
toJsonValue(QString("message"), message, obj, QString("QString"));
|
||||
}
|
||||
|
@ -31,15 +31,15 @@ namespace SWGSDRangel {
|
||||
class SWGErrorResponse: public SWGObject {
|
||||
public:
|
||||
SWGErrorResponse();
|
||||
SWGErrorResponse(QString json);
|
||||
~SWGErrorResponse();
|
||||
SWGErrorResponse(QString* json);
|
||||
virtual ~SWGErrorResponse();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject asJsonObject();
|
||||
void fromJsonObject(QJsonObject json);
|
||||
SWGErrorResponse* fromJson(QString jsonString);
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGErrorResponse* fromJson(QString &jsonString);
|
||||
|
||||
QString* getMessage();
|
||||
void setMessage(QString* message);
|
||||
|
@ -22,13 +22,14 @@
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGFileSourceSettings::SWGFileSourceSettings(QString json) {
|
||||
SWGFileSourceSettings::SWGFileSourceSettings(QString* json) {
|
||||
init();
|
||||
this->fromJson(json);
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGFileSourceSettings::SWGFileSourceSettings() {
|
||||
init();
|
||||
file_name = nullptr;
|
||||
m_file_name_isSet = false;
|
||||
}
|
||||
|
||||
SWGFileSourceSettings::~SWGFileSourceSettings() {
|
||||
@ -49,7 +50,7 @@ SWGFileSourceSettings::cleanup() {
|
||||
}
|
||||
|
||||
SWGFileSourceSettings*
|
||||
SWGFileSourceSettings::fromJson(QString json) {
|
||||
SWGFileSourceSettings::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
@ -58,7 +59,7 @@ SWGFileSourceSettings::fromJson(QString json) {
|
||||
}
|
||||
|
||||
void
|
||||
SWGFileSourceSettings::fromJsonObject(QJsonObject pJson) {
|
||||
SWGFileSourceSettings::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&file_name, pJson["fileName"], "QString", "QString");
|
||||
|
||||
}
|
||||
@ -66,15 +67,17 @@ SWGFileSourceSettings::fromJsonObject(QJsonObject pJson) {
|
||||
QString
|
||||
SWGFileSourceSettings::asJson ()
|
||||
{
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
QJsonObject*
|
||||
SWGFileSourceSettings::asJsonObject() {
|
||||
QJsonObject obj;
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(file_name != nullptr && *file_name != QString("")){
|
||||
toJsonValue(QString("fileName"), file_name, obj, QString("QString"));
|
||||
}
|
||||
|
@ -31,15 +31,15 @@ namespace SWGSDRangel {
|
||||
class SWGFileSourceSettings: public SWGObject {
|
||||
public:
|
||||
SWGFileSourceSettings();
|
||||
SWGFileSourceSettings(QString json);
|
||||
~SWGFileSourceSettings();
|
||||
SWGFileSourceSettings(QString* json);
|
||||
virtual ~SWGFileSourceSettings();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject asJsonObject();
|
||||
void fromJsonObject(QJsonObject json);
|
||||
SWGFileSourceSettings* fromJson(QString jsonString);
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGFileSourceSettings* fromJson(QString &jsonString);
|
||||
|
||||
QString* getFileName();
|
||||
void setFileName(QString* file_name);
|
||||
|
@ -22,13 +22,38 @@
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGHackRFInputSettings::SWGHackRFInputSettings(QString json) {
|
||||
SWGHackRFInputSettings::SWGHackRFInputSettings(QString* json) {
|
||||
init();
|
||||
this->fromJson(json);
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGHackRFInputSettings::SWGHackRFInputSettings() {
|
||||
init();
|
||||
center_frequency = 0L;
|
||||
m_center_frequency_isSet = false;
|
||||
l_oppm_tenths = 0;
|
||||
m_l_oppm_tenths_isSet = false;
|
||||
bandwidth = 0;
|
||||
m_bandwidth_isSet = false;
|
||||
lna_gain = 0;
|
||||
m_lna_gain_isSet = false;
|
||||
vga_gain = 0;
|
||||
m_vga_gain_isSet = false;
|
||||
log2_decim = 0;
|
||||
m_log2_decim_isSet = false;
|
||||
fc_pos = 0;
|
||||
m_fc_pos_isSet = false;
|
||||
dev_sample_rate = 0;
|
||||
m_dev_sample_rate_isSet = false;
|
||||
bias_t = 0;
|
||||
m_bias_t_isSet = false;
|
||||
lna_ext = 0;
|
||||
m_lna_ext_isSet = false;
|
||||
dc_block = 0;
|
||||
m_dc_block_isSet = false;
|
||||
iq_correction = 0;
|
||||
m_iq_correction_isSet = false;
|
||||
link_tx_frequency = 0;
|
||||
m_link_tx_frequency_isSet = false;
|
||||
}
|
||||
|
||||
SWGHackRFInputSettings::~SWGHackRFInputSettings() {
|
||||
@ -83,7 +108,7 @@ SWGHackRFInputSettings::cleanup() {
|
||||
}
|
||||
|
||||
SWGHackRFInputSettings*
|
||||
SWGHackRFInputSettings::fromJson(QString json) {
|
||||
SWGHackRFInputSettings::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
@ -92,7 +117,7 @@ SWGHackRFInputSettings::fromJson(QString json) {
|
||||
}
|
||||
|
||||
void
|
||||
SWGHackRFInputSettings::fromJsonObject(QJsonObject pJson) {
|
||||
SWGHackRFInputSettings::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(¢er_frequency, pJson["centerFrequency"], "qint64", "");
|
||||
|
||||
::SWGSDRangel::setValue(&l_oppm_tenths, pJson["LOppmTenths"], "qint32", "");
|
||||
@ -124,53 +149,55 @@ SWGHackRFInputSettings::fromJsonObject(QJsonObject pJson) {
|
||||
QString
|
||||
SWGHackRFInputSettings::asJson ()
|
||||
{
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
QJsonObject*
|
||||
SWGHackRFInputSettings::asJsonObject() {
|
||||
QJsonObject obj;
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(m_center_frequency_isSet){
|
||||
obj.insert("centerFrequency", QJsonValue(center_frequency));
|
||||
obj->insert("centerFrequency", QJsonValue(center_frequency));
|
||||
}
|
||||
if(m_l_oppm_tenths_isSet){
|
||||
obj.insert("LOppmTenths", QJsonValue(l_oppm_tenths));
|
||||
obj->insert("LOppmTenths", QJsonValue(l_oppm_tenths));
|
||||
}
|
||||
if(m_bandwidth_isSet){
|
||||
obj.insert("bandwidth", QJsonValue(bandwidth));
|
||||
obj->insert("bandwidth", QJsonValue(bandwidth));
|
||||
}
|
||||
if(m_lna_gain_isSet){
|
||||
obj.insert("lnaGain", QJsonValue(lna_gain));
|
||||
obj->insert("lnaGain", QJsonValue(lna_gain));
|
||||
}
|
||||
if(m_vga_gain_isSet){
|
||||
obj.insert("vgaGain", QJsonValue(vga_gain));
|
||||
obj->insert("vgaGain", QJsonValue(vga_gain));
|
||||
}
|
||||
if(m_log2_decim_isSet){
|
||||
obj.insert("log2Decim", QJsonValue(log2_decim));
|
||||
obj->insert("log2Decim", QJsonValue(log2_decim));
|
||||
}
|
||||
if(m_fc_pos_isSet){
|
||||
obj.insert("fcPos", QJsonValue(fc_pos));
|
||||
obj->insert("fcPos", QJsonValue(fc_pos));
|
||||
}
|
||||
if(m_dev_sample_rate_isSet){
|
||||
obj.insert("devSampleRate", QJsonValue(dev_sample_rate));
|
||||
obj->insert("devSampleRate", QJsonValue(dev_sample_rate));
|
||||
}
|
||||
if(m_bias_t_isSet){
|
||||
obj.insert("biasT", QJsonValue(bias_t));
|
||||
obj->insert("biasT", QJsonValue(bias_t));
|
||||
}
|
||||
if(m_lna_ext_isSet){
|
||||
obj.insert("lnaExt", QJsonValue(lna_ext));
|
||||
obj->insert("lnaExt", QJsonValue(lna_ext));
|
||||
}
|
||||
if(m_dc_block_isSet){
|
||||
obj.insert("dcBlock", QJsonValue(dc_block));
|
||||
obj->insert("dcBlock", QJsonValue(dc_block));
|
||||
}
|
||||
if(m_iq_correction_isSet){
|
||||
obj.insert("iqCorrection", QJsonValue(iq_correction));
|
||||
obj->insert("iqCorrection", QJsonValue(iq_correction));
|
||||
}
|
||||
if(m_link_tx_frequency_isSet){
|
||||
obj.insert("linkTxFrequency", QJsonValue(link_tx_frequency));
|
||||
obj->insert("linkTxFrequency", QJsonValue(link_tx_frequency));
|
||||
}
|
||||
|
||||
return obj;
|
||||
|
@ -30,15 +30,15 @@ namespace SWGSDRangel {
|
||||
class SWGHackRFInputSettings: public SWGObject {
|
||||
public:
|
||||
SWGHackRFInputSettings();
|
||||
SWGHackRFInputSettings(QString json);
|
||||
~SWGHackRFInputSettings();
|
||||
SWGHackRFInputSettings(QString* json);
|
||||
virtual ~SWGHackRFInputSettings();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject asJsonObject();
|
||||
void fromJsonObject(QJsonObject json);
|
||||
SWGHackRFInputSettings* fromJson(QString jsonString);
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGHackRFInputSettings* fromJson(QString &jsonString);
|
||||
|
||||
qint64 getCenterFrequency();
|
||||
void setCenterFrequency(qint64 center_frequency);
|
||||
|
@ -22,13 +22,28 @@
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGHackRFOutputSettings::SWGHackRFOutputSettings(QString json) {
|
||||
SWGHackRFOutputSettings::SWGHackRFOutputSettings(QString* json) {
|
||||
init();
|
||||
this->fromJson(json);
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGHackRFOutputSettings::SWGHackRFOutputSettings() {
|
||||
init();
|
||||
center_frequency = 0L;
|
||||
m_center_frequency_isSet = false;
|
||||
l_oppm_tenths = 0;
|
||||
m_l_oppm_tenths_isSet = false;
|
||||
bandwidth = 0;
|
||||
m_bandwidth_isSet = false;
|
||||
vga_gain = 0;
|
||||
m_vga_gain_isSet = false;
|
||||
log2_interp = 0;
|
||||
m_log2_interp_isSet = false;
|
||||
dev_sample_rate = 0;
|
||||
m_dev_sample_rate_isSet = false;
|
||||
bias_t = 0;
|
||||
m_bias_t_isSet = false;
|
||||
lna_ext = 0;
|
||||
m_lna_ext_isSet = false;
|
||||
}
|
||||
|
||||
SWGHackRFOutputSettings::~SWGHackRFOutputSettings() {
|
||||
@ -68,7 +83,7 @@ SWGHackRFOutputSettings::cleanup() {
|
||||
}
|
||||
|
||||
SWGHackRFOutputSettings*
|
||||
SWGHackRFOutputSettings::fromJson(QString json) {
|
||||
SWGHackRFOutputSettings::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
@ -77,7 +92,7 @@ SWGHackRFOutputSettings::fromJson(QString json) {
|
||||
}
|
||||
|
||||
void
|
||||
SWGHackRFOutputSettings::fromJsonObject(QJsonObject pJson) {
|
||||
SWGHackRFOutputSettings::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(¢er_frequency, pJson["centerFrequency"], "qint64", "");
|
||||
|
||||
::SWGSDRangel::setValue(&l_oppm_tenths, pJson["LOppmTenths"], "qint32", "");
|
||||
@ -99,38 +114,40 @@ SWGHackRFOutputSettings::fromJsonObject(QJsonObject pJson) {
|
||||
QString
|
||||
SWGHackRFOutputSettings::asJson ()
|
||||
{
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
QJsonObject*
|
||||
SWGHackRFOutputSettings::asJsonObject() {
|
||||
QJsonObject obj;
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(m_center_frequency_isSet){
|
||||
obj.insert("centerFrequency", QJsonValue(center_frequency));
|
||||
obj->insert("centerFrequency", QJsonValue(center_frequency));
|
||||
}
|
||||
if(m_l_oppm_tenths_isSet){
|
||||
obj.insert("LOppmTenths", QJsonValue(l_oppm_tenths));
|
||||
obj->insert("LOppmTenths", QJsonValue(l_oppm_tenths));
|
||||
}
|
||||
if(m_bandwidth_isSet){
|
||||
obj.insert("bandwidth", QJsonValue(bandwidth));
|
||||
obj->insert("bandwidth", QJsonValue(bandwidth));
|
||||
}
|
||||
if(m_vga_gain_isSet){
|
||||
obj.insert("vgaGain", QJsonValue(vga_gain));
|
||||
obj->insert("vgaGain", QJsonValue(vga_gain));
|
||||
}
|
||||
if(m_log2_interp_isSet){
|
||||
obj.insert("log2Interp", QJsonValue(log2_interp));
|
||||
obj->insert("log2Interp", QJsonValue(log2_interp));
|
||||
}
|
||||
if(m_dev_sample_rate_isSet){
|
||||
obj.insert("devSampleRate", QJsonValue(dev_sample_rate));
|
||||
obj->insert("devSampleRate", QJsonValue(dev_sample_rate));
|
||||
}
|
||||
if(m_bias_t_isSet){
|
||||
obj.insert("biasT", QJsonValue(bias_t));
|
||||
obj->insert("biasT", QJsonValue(bias_t));
|
||||
}
|
||||
if(m_lna_ext_isSet){
|
||||
obj.insert("lnaExt", QJsonValue(lna_ext));
|
||||
obj->insert("lnaExt", QJsonValue(lna_ext));
|
||||
}
|
||||
|
||||
return obj;
|
||||
|
@ -30,15 +30,15 @@ namespace SWGSDRangel {
|
||||
class SWGHackRFOutputSettings: public SWGObject {
|
||||
public:
|
||||
SWGHackRFOutputSettings();
|
||||
SWGHackRFOutputSettings(QString json);
|
||||
~SWGHackRFOutputSettings();
|
||||
SWGHackRFOutputSettings(QString* json);
|
||||
virtual ~SWGHackRFOutputSettings();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject asJsonObject();
|
||||
void fromJsonObject(QJsonObject json);
|
||||
SWGHackRFOutputSettings* fromJson(QString jsonString);
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGHackRFOutputSettings* fromJson(QString &jsonString);
|
||||
|
||||
qint64 getCenterFrequency();
|
||||
void setCenterFrequency(qint64 center_frequency);
|
||||
|
@ -41,7 +41,7 @@ setValue(void* value, QJsonValue obj, QString type, QString complexType) {
|
||||
}
|
||||
else if(QStringLiteral("float").compare(type) == 0) {
|
||||
float *val = static_cast<float*>(value);
|
||||
*val = static_cast<float>(obj.toDouble());
|
||||
*val = obj.toDouble();
|
||||
}
|
||||
else if(QStringLiteral("double").compare(type) == 0) {
|
||||
double *val = static_cast<double*>(value);
|
||||
@ -51,14 +51,20 @@ setValue(void* value, QJsonValue obj, QString type, QString complexType) {
|
||||
QString **val = static_cast<QString**>(value);
|
||||
if(val != nullptr) {
|
||||
if(!obj.isNull()) {
|
||||
(*val)->clear();
|
||||
(*val)->append(obj.toString());
|
||||
// create a new value and return
|
||||
if(*val != nullptr) delete *val;
|
||||
*val = new QString(obj.toString());
|
||||
return;
|
||||
}
|
||||
else {
|
||||
(*val)->clear();
|
||||
// set target to nullptr
|
||||
if(*val != nullptr) delete *val;
|
||||
*val = nullptr;
|
||||
}
|
||||
}
|
||||
else {
|
||||
qDebug() << "Can't set value because the target pointer is nullptr";
|
||||
}
|
||||
}
|
||||
else if (QStringLiteral("QDateTime").compare(type) == 0) {
|
||||
QDateTime **val = static_cast<QDateTime**>(value);
|
||||
@ -374,74 +380,78 @@ setValue(void* value, QJsonValue obj, QString type, QString complexType) {
|
||||
}
|
||||
|
||||
void
|
||||
toJsonValue(QString name, void* value, QJsonObject& output, QString type) {
|
||||
toJsonValue(QString name, void* value, QJsonObject* output, QString type) {
|
||||
if(value == nullptr) {
|
||||
return;
|
||||
}
|
||||
if(type.startsWith("SWG")) {
|
||||
SWGObject *SWGobject = reinterpret_cast<SWGObject *>(value);
|
||||
if(SWGobject != nullptr) {
|
||||
QJsonObject o = SWGobject->asJsonObject();
|
||||
if(!name.isNull()) {
|
||||
output.insert(name, o);
|
||||
QJsonObject* o = (*SWGobject).asJsonObject();
|
||||
if(name != nullptr) {
|
||||
output->insert(name, *o);
|
||||
if(o != nullptr) delete o;
|
||||
}
|
||||
else {
|
||||
output.empty();
|
||||
for(QString key : o.keys()) {
|
||||
output.insert(key, o.value(key));
|
||||
output->empty();
|
||||
for(QString key : o->keys()) {
|
||||
output->insert(key, o->value(key));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(QStringLiteral("QString").compare(type) == 0) {
|
||||
QString* str = static_cast<QString*>(value);
|
||||
output.insert(name, QJsonValue(*str));
|
||||
output->insert(name, QJsonValue(*str));
|
||||
}
|
||||
else if(QStringLiteral("qint32").compare(type) == 0) {
|
||||
qint32* str = static_cast<qint32*>(value);
|
||||
output.insert(name, QJsonValue(*str));
|
||||
output->insert(name, QJsonValue(*str));
|
||||
}
|
||||
else if(QStringLiteral("qint64").compare(type) == 0) {
|
||||
qint64* str = static_cast<qint64*>(value);
|
||||
output.insert(name, QJsonValue(*str));
|
||||
output->insert(name, QJsonValue(*str));
|
||||
}
|
||||
else if(QStringLiteral("bool").compare(type) == 0) {
|
||||
bool* str = static_cast<bool*>(value);
|
||||
output.insert(name, QJsonValue(*str));
|
||||
output->insert(name, QJsonValue(*str));
|
||||
}
|
||||
else if(QStringLiteral("float").compare(type) == 0) {
|
||||
float* str = static_cast<float*>(value);
|
||||
output.insert(name, QJsonValue((double)*str));
|
||||
output->insert(name, QJsonValue((double)*str));
|
||||
}
|
||||
else if(QStringLiteral("double").compare(type) == 0) {
|
||||
double* str = static_cast<double*>(value);
|
||||
output.insert(name, QJsonValue(*str));
|
||||
output->insert(name, QJsonValue(*str));
|
||||
}
|
||||
else if(QStringLiteral("QDate").compare(type) == 0) {
|
||||
QDate* date = static_cast<QDate*>(value);
|
||||
output.insert(name, QJsonValue(date->toString(Qt::ISODate)));
|
||||
output->insert(name, QJsonValue(date->toString(Qt::ISODate)));
|
||||
}
|
||||
else if(QStringLiteral("QDateTime").compare(type) == 0) {
|
||||
QDateTime* datetime = static_cast<QDateTime*>(value);
|
||||
output.insert(name, QJsonValue(datetime->toString(Qt::ISODate)));
|
||||
output->insert(name, QJsonValue(datetime->toString(Qt::ISODate)));
|
||||
}
|
||||
else if(QStringLiteral("QByteArray").compare(type) == 0) {
|
||||
QByteArray* byteArray = static_cast<QByteArray*>(value);
|
||||
output.insert(name, QJsonValue(QString(byteArray->toBase64())));
|
||||
output->insert(name, QJsonValue(QString(byteArray->toBase64())));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
toJsonArray(QList<void*>* value, QJsonObject& output, QString innerName, QString innerType) {
|
||||
if(value == nullptr) {
|
||||
toJsonArray(QList<void*>* value, QJsonObject* output, QString innerName, QString innerType) {
|
||||
if((value == nullptr) || (output == nullptr)) {
|
||||
return;
|
||||
}
|
||||
QJsonArray outputarray;
|
||||
if(innerType.startsWith("SWG")){
|
||||
for(void* obj : *value) {
|
||||
SWGObject *SWGobject = reinterpret_cast<SWGObject *>(obj);
|
||||
if(SWGobject != nullptr) {
|
||||
outputarray.append(SWGobject->asJsonObject());
|
||||
if(SWGobject != nullptr)
|
||||
{
|
||||
QJsonObject* o = SWGobject->asJsonObject();
|
||||
outputarray.append(*o);
|
||||
delete o;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -484,81 +494,81 @@ toJsonArray(QList<void*>* value, QJsonObject& output, QString innerName, QString
|
||||
for(double obj : *(reinterpret_cast<QList<double>*>(value)))
|
||||
outputarray.append(QJsonValue(obj));
|
||||
}
|
||||
output.insert(innerName, outputarray);
|
||||
output->insert(innerName, outputarray);
|
||||
}
|
||||
|
||||
void
|
||||
toJsonMap(QMap<QString, void*>* value, QJsonObject& output, QString innerName, QString innerType) {
|
||||
if(value == nullptr) {
|
||||
toJsonMap(QMap<QString, void*>* value, QJsonObject* output, QString innerName, QString innerType) {
|
||||
if((value == nullptr) || (output == nullptr)) {
|
||||
return;
|
||||
}
|
||||
QJsonObject mapobj;
|
||||
if(innerType.startsWith("SWG")){
|
||||
auto items = reinterpret_cast< QMap<QString, SWGObject*> *>(value);
|
||||
for(auto itemkey: items->keys()) {
|
||||
::SWGSDRangel::toJsonValue(itemkey, items->value(itemkey),mapobj, innerType);
|
||||
::SWGSDRangel::toJsonValue(itemkey, items->value(itemkey), &mapobj, innerType);
|
||||
}
|
||||
}
|
||||
else if(QStringLiteral("QString").compare(innerType) == 0) {
|
||||
auto items = reinterpret_cast< QMap<QString, QString*> *>(value);
|
||||
for(auto itemkey: items->keys()) {
|
||||
::SWGSDRangel::toJsonValue(itemkey, items->value(itemkey), mapobj, innerType);
|
||||
::SWGSDRangel::toJsonValue(itemkey, items->value(itemkey), &mapobj, innerType);
|
||||
}
|
||||
}
|
||||
else if(QStringLiteral("QDate").compare(innerType) == 0) {
|
||||
auto items = reinterpret_cast< QMap<QString, QDate*> *>(value);
|
||||
for(auto itemkey: items->keys()) {
|
||||
::SWGSDRangel::toJsonValue(itemkey, items->value(itemkey), mapobj, innerType);
|
||||
::SWGSDRangel::toJsonValue(itemkey, items->value(itemkey), &mapobj, innerType);
|
||||
}
|
||||
}
|
||||
else if(QStringLiteral("QDateTime").compare(innerType) == 0) {
|
||||
auto items = reinterpret_cast< QMap<QString, QDateTime*> *>(value);
|
||||
for(auto itemkey: items->keys()) {
|
||||
::SWGSDRangel::toJsonValue(itemkey, items->value(itemkey), mapobj, innerType);
|
||||
::SWGSDRangel::toJsonValue(itemkey, items->value(itemkey), &mapobj, innerType);
|
||||
}
|
||||
}
|
||||
else if(QStringLiteral("QByteArray").compare(innerType) == 0) {
|
||||
auto items = reinterpret_cast< QMap<QString, QByteArray*> *>(value);
|
||||
for(auto itemkey: items->keys()) {
|
||||
::SWGSDRangel::toJsonValue(itemkey, items->value(itemkey), mapobj, innerType);
|
||||
::SWGSDRangel::toJsonValue(itemkey, items->value(itemkey), &mapobj, innerType);
|
||||
}
|
||||
}
|
||||
else if(QStringLiteral("qint32").compare(innerType) == 0) {
|
||||
auto items = reinterpret_cast< QMap<QString, qint32> *>(value);
|
||||
for(auto itemkey: items->keys()) {
|
||||
auto val = items->value(itemkey);
|
||||
::SWGSDRangel::toJsonValue(itemkey, &val, mapobj, innerType);
|
||||
::SWGSDRangel::toJsonValue(itemkey, &val, &mapobj, innerType);
|
||||
}
|
||||
}
|
||||
else if(QStringLiteral("qint64").compare(innerType) == 0) {
|
||||
auto items = reinterpret_cast< QMap<QString, qint64> *>(value);
|
||||
for(auto itemkey: items->keys()) {
|
||||
auto val = items->value(itemkey);
|
||||
::SWGSDRangel::toJsonValue(itemkey, &val, mapobj, innerType);
|
||||
::SWGSDRangel::toJsonValue(itemkey, &val, &mapobj, innerType);
|
||||
}
|
||||
}
|
||||
else if(QStringLiteral("bool").compare(innerType) == 0) {
|
||||
auto items = reinterpret_cast< QMap<QString, bool> *>(value);
|
||||
for(auto itemkey: items->keys()) {
|
||||
auto val = items->value(itemkey);
|
||||
::SWGSDRangel::toJsonValue(itemkey, &val, mapobj, innerType);
|
||||
::SWGSDRangel::toJsonValue(itemkey, &val, &mapobj, innerType);
|
||||
}
|
||||
}
|
||||
else if(QStringLiteral("float").compare(innerType) == 0) {
|
||||
auto items = reinterpret_cast< QMap<QString, float> *>(value);
|
||||
for(auto itemkey: items->keys()) {
|
||||
auto val = items->value(itemkey);
|
||||
::SWGSDRangel::toJsonValue(itemkey, &val, mapobj, innerType);
|
||||
::SWGSDRangel::toJsonValue(itemkey, &val, &mapobj, innerType);
|
||||
}
|
||||
}
|
||||
else if(QStringLiteral("double").compare(innerType) == 0) {
|
||||
auto items = reinterpret_cast< QMap<QString, double> *>(value);
|
||||
for(auto itemkey: items->keys() ) {
|
||||
auto val = items->value(itemkey);
|
||||
::SWGSDRangel::toJsonValue(itemkey, &val, mapobj, innerType);
|
||||
::SWGSDRangel::toJsonValue(itemkey, &val, &mapobj, innerType);
|
||||
}
|
||||
}
|
||||
output.insert(innerName, mapobj);
|
||||
output->insert(innerName, mapobj);
|
||||
}
|
||||
|
||||
QString
|
||||
|
@ -20,9 +20,9 @@
|
||||
namespace SWGSDRangel {
|
||||
|
||||
void setValue(void* value, QJsonValue obj, QString type, QString complexType);
|
||||
void toJsonArray(QList<void*>* value, QJsonObject& output, QString innerName, QString innerType);
|
||||
void toJsonValue(QString name, void* value, QJsonObject& output, QString type);
|
||||
void toJsonMap(QMap<QString, void*>* value, QJsonObject& output, QString innerName, QString innerType);
|
||||
void toJsonArray(QList<void*>* value, QJsonObject* output, QString innerName, QString innerType);
|
||||
void toJsonValue(QString name, void* value, QJsonObject* output, QString type);
|
||||
void toJsonMap(QMap<QString, void*>* value, QJsonObject* output, QString innerName, QString innerType);
|
||||
bool isCompatibleJsonValue(QString type);
|
||||
QString stringValue(QString* value);
|
||||
QString stringValue(qint32 value);
|
||||
|
@ -56,7 +56,7 @@ SWGHttpRequestWorker::SWGHttpRequestWorker(QObject *parent)
|
||||
qsrand(QDateTime::currentDateTime().toTime_t());
|
||||
|
||||
manager = new QNetworkAccessManager(this);
|
||||
connect(manager, &QNetworkAccessManager::finished, this, &SWGHttpRequestWorker::on_manager_finished);
|
||||
connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(on_manager_finished(QNetworkReply*)));
|
||||
}
|
||||
|
||||
SWGHttpRequestWorker::~SWGHttpRequestWorker() {
|
||||
|
@ -22,13 +22,16 @@
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGInstanceChannelsResponse::SWGInstanceChannelsResponse(QString json) {
|
||||
SWGInstanceChannelsResponse::SWGInstanceChannelsResponse(QString* json) {
|
||||
init();
|
||||
this->fromJson(json);
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGInstanceChannelsResponse::SWGInstanceChannelsResponse() {
|
||||
init();
|
||||
channelcount = 0;
|
||||
m_channelcount_isSet = false;
|
||||
channels = nullptr;
|
||||
m_channels_isSet = false;
|
||||
}
|
||||
|
||||
SWGInstanceChannelsResponse::~SWGInstanceChannelsResponse() {
|
||||
@ -56,7 +59,7 @@ SWGInstanceChannelsResponse::cleanup() {
|
||||
}
|
||||
|
||||
SWGInstanceChannelsResponse*
|
||||
SWGInstanceChannelsResponse::fromJson(QString json) {
|
||||
SWGInstanceChannelsResponse::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
@ -65,7 +68,7 @@ SWGInstanceChannelsResponse::fromJson(QString json) {
|
||||
}
|
||||
|
||||
void
|
||||
SWGInstanceChannelsResponse::fromJsonObject(QJsonObject pJson) {
|
||||
SWGInstanceChannelsResponse::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&channelcount, pJson["channelcount"], "qint32", "");
|
||||
|
||||
|
||||
@ -75,17 +78,19 @@ SWGInstanceChannelsResponse::fromJsonObject(QJsonObject pJson) {
|
||||
QString
|
||||
SWGInstanceChannelsResponse::asJson ()
|
||||
{
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
QJsonObject*
|
||||
SWGInstanceChannelsResponse::asJsonObject() {
|
||||
QJsonObject obj;
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(m_channelcount_isSet){
|
||||
obj.insert("channelcount", QJsonValue(channelcount));
|
||||
obj->insert("channelcount", QJsonValue(channelcount));
|
||||
}
|
||||
if(channels->size() > 0){
|
||||
toJsonArray((QList<void*>*)channels, obj, "channels", "SWGChannelListItem");
|
||||
|
@ -32,15 +32,15 @@ namespace SWGSDRangel {
|
||||
class SWGInstanceChannelsResponse: public SWGObject {
|
||||
public:
|
||||
SWGInstanceChannelsResponse();
|
||||
SWGInstanceChannelsResponse(QString json);
|
||||
~SWGInstanceChannelsResponse();
|
||||
SWGInstanceChannelsResponse(QString* json);
|
||||
virtual ~SWGInstanceChannelsResponse();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject asJsonObject();
|
||||
void fromJsonObject(QJsonObject json);
|
||||
SWGInstanceChannelsResponse* fromJson(QString jsonString);
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGInstanceChannelsResponse* fromJson(QString &jsonString);
|
||||
|
||||
qint32 getChannelcount();
|
||||
void setChannelcount(qint32 channelcount);
|
||||
|
@ -22,13 +22,16 @@
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGInstanceDevicesResponse::SWGInstanceDevicesResponse(QString json) {
|
||||
SWGInstanceDevicesResponse::SWGInstanceDevicesResponse(QString* json) {
|
||||
init();
|
||||
this->fromJson(json);
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGInstanceDevicesResponse::SWGInstanceDevicesResponse() {
|
||||
init();
|
||||
devicecount = 0;
|
||||
m_devicecount_isSet = false;
|
||||
devices = nullptr;
|
||||
m_devices_isSet = false;
|
||||
}
|
||||
|
||||
SWGInstanceDevicesResponse::~SWGInstanceDevicesResponse() {
|
||||
@ -56,7 +59,7 @@ SWGInstanceDevicesResponse::cleanup() {
|
||||
}
|
||||
|
||||
SWGInstanceDevicesResponse*
|
||||
SWGInstanceDevicesResponse::fromJson(QString json) {
|
||||
SWGInstanceDevicesResponse::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
@ -65,7 +68,7 @@ SWGInstanceDevicesResponse::fromJson(QString json) {
|
||||
}
|
||||
|
||||
void
|
||||
SWGInstanceDevicesResponse::fromJsonObject(QJsonObject pJson) {
|
||||
SWGInstanceDevicesResponse::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&devicecount, pJson["devicecount"], "qint32", "");
|
||||
|
||||
|
||||
@ -75,17 +78,19 @@ SWGInstanceDevicesResponse::fromJsonObject(QJsonObject pJson) {
|
||||
QString
|
||||
SWGInstanceDevicesResponse::asJson ()
|
||||
{
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
QJsonObject*
|
||||
SWGInstanceDevicesResponse::asJsonObject() {
|
||||
QJsonObject obj;
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(m_devicecount_isSet){
|
||||
obj.insert("devicecount", QJsonValue(devicecount));
|
||||
obj->insert("devicecount", QJsonValue(devicecount));
|
||||
}
|
||||
if(devices->size() > 0){
|
||||
toJsonArray((QList<void*>*)devices, obj, "devices", "SWGDeviceListItem");
|
||||
|
@ -32,15 +32,15 @@ namespace SWGSDRangel {
|
||||
class SWGInstanceDevicesResponse: public SWGObject {
|
||||
public:
|
||||
SWGInstanceDevicesResponse();
|
||||
SWGInstanceDevicesResponse(QString json);
|
||||
~SWGInstanceDevicesResponse();
|
||||
SWGInstanceDevicesResponse(QString* json);
|
||||
virtual ~SWGInstanceDevicesResponse();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject asJsonObject();
|
||||
void fromJsonObject(QJsonObject json);
|
||||
SWGInstanceDevicesResponse* fromJson(QString jsonString);
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGInstanceDevicesResponse* fromJson(QString &jsonString);
|
||||
|
||||
qint32 getDevicecount();
|
||||
void setDevicecount(qint32 devicecount);
|
||||
|
@ -22,13 +22,32 @@
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGInstanceSummaryResponse::SWGInstanceSummaryResponse(QString json) {
|
||||
SWGInstanceSummaryResponse::SWGInstanceSummaryResponse(QString* json) {
|
||||
init();
|
||||
this->fromJson(json);
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGInstanceSummaryResponse::SWGInstanceSummaryResponse() {
|
||||
init();
|
||||
version = nullptr;
|
||||
m_version_isSet = false;
|
||||
qt_version = nullptr;
|
||||
m_qt_version_isSet = false;
|
||||
dsp_rx_bits = 0;
|
||||
m_dsp_rx_bits_isSet = false;
|
||||
dsp_tx_bits = 0;
|
||||
m_dsp_tx_bits_isSet = false;
|
||||
pid = 0;
|
||||
m_pid_isSet = false;
|
||||
appname = nullptr;
|
||||
m_appname_isSet = false;
|
||||
architecture = nullptr;
|
||||
m_architecture_isSet = false;
|
||||
os = nullptr;
|
||||
m_os_isSet = false;
|
||||
logging = nullptr;
|
||||
m_logging_isSet = false;
|
||||
devicesetlist = nullptr;
|
||||
m_devicesetlist_isSet = false;
|
||||
}
|
||||
|
||||
SWGInstanceSummaryResponse::~SWGInstanceSummaryResponse() {
|
||||
@ -88,7 +107,7 @@ SWGInstanceSummaryResponse::cleanup() {
|
||||
}
|
||||
|
||||
SWGInstanceSummaryResponse*
|
||||
SWGInstanceSummaryResponse::fromJson(QString json) {
|
||||
SWGInstanceSummaryResponse::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
@ -97,7 +116,7 @@ SWGInstanceSummaryResponse::fromJson(QString json) {
|
||||
}
|
||||
|
||||
void
|
||||
SWGInstanceSummaryResponse::fromJsonObject(QJsonObject pJson) {
|
||||
SWGInstanceSummaryResponse::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&version, pJson["version"], "QString", "QString");
|
||||
|
||||
::SWGSDRangel::setValue(&qt_version, pJson["qtVersion"], "QString", "QString");
|
||||
@ -123,15 +142,17 @@ SWGInstanceSummaryResponse::fromJsonObject(QJsonObject pJson) {
|
||||
QString
|
||||
SWGInstanceSummaryResponse::asJson ()
|
||||
{
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
QJsonObject*
|
||||
SWGInstanceSummaryResponse::asJsonObject() {
|
||||
QJsonObject obj;
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(version != nullptr && *version != QString("")){
|
||||
toJsonValue(QString("version"), version, obj, QString("QString"));
|
||||
}
|
||||
@ -139,13 +160,13 @@ SWGInstanceSummaryResponse::asJsonObject() {
|
||||
toJsonValue(QString("qtVersion"), qt_version, obj, QString("QString"));
|
||||
}
|
||||
if(m_dsp_rx_bits_isSet){
|
||||
obj.insert("dspRxBits", QJsonValue(dsp_rx_bits));
|
||||
obj->insert("dspRxBits", QJsonValue(dsp_rx_bits));
|
||||
}
|
||||
if(m_dsp_tx_bits_isSet){
|
||||
obj.insert("dspTxBits", QJsonValue(dsp_tx_bits));
|
||||
obj->insert("dspTxBits", QJsonValue(dsp_tx_bits));
|
||||
}
|
||||
if(m_pid_isSet){
|
||||
obj.insert("pid", QJsonValue(pid));
|
||||
obj->insert("pid", QJsonValue(pid));
|
||||
}
|
||||
if(appname != nullptr && *appname != QString("")){
|
||||
toJsonValue(QString("appname"), appname, obj, QString("QString"));
|
||||
|
@ -33,15 +33,15 @@ namespace SWGSDRangel {
|
||||
class SWGInstanceSummaryResponse: public SWGObject {
|
||||
public:
|
||||
SWGInstanceSummaryResponse();
|
||||
SWGInstanceSummaryResponse(QString json);
|
||||
~SWGInstanceSummaryResponse();
|
||||
SWGInstanceSummaryResponse(QString* json);
|
||||
virtual ~SWGInstanceSummaryResponse();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject asJsonObject();
|
||||
void fromJsonObject(QJsonObject json);
|
||||
SWGInstanceSummaryResponse* fromJson(QString jsonString);
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGInstanceSummaryResponse* fromJson(QString &jsonString);
|
||||
|
||||
QString* getVersion();
|
||||
void setVersion(QString* version);
|
||||
|
@ -22,13 +22,50 @@
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGLimeSdrInputSettings::SWGLimeSdrInputSettings(QString json) {
|
||||
SWGLimeSdrInputSettings::SWGLimeSdrInputSettings(QString* json) {
|
||||
init();
|
||||
this->fromJson(json);
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGLimeSdrInputSettings::SWGLimeSdrInputSettings() {
|
||||
init();
|
||||
center_frequency = 0L;
|
||||
m_center_frequency_isSet = false;
|
||||
dev_sample_rate = 0;
|
||||
m_dev_sample_rate_isSet = false;
|
||||
log2_hard_decim = 0;
|
||||
m_log2_hard_decim_isSet = false;
|
||||
dc_block = 0;
|
||||
m_dc_block_isSet = false;
|
||||
iq_correction = 0;
|
||||
m_iq_correction_isSet = false;
|
||||
log2_soft_decim = 0;
|
||||
m_log2_soft_decim_isSet = false;
|
||||
lpf_bw = 0;
|
||||
m_lpf_bw_isSet = false;
|
||||
lpf_fir_enable = 0;
|
||||
m_lpf_fir_enable_isSet = false;
|
||||
lpf_firbw = 0;
|
||||
m_lpf_firbw_isSet = false;
|
||||
gain = 0;
|
||||
m_gain_isSet = false;
|
||||
nco_enable = 0;
|
||||
m_nco_enable_isSet = false;
|
||||
nco_frequency = 0;
|
||||
m_nco_frequency_isSet = false;
|
||||
antenna_path = 0;
|
||||
m_antenna_path_isSet = false;
|
||||
gain_mode = 0;
|
||||
m_gain_mode_isSet = false;
|
||||
lna_gain = 0;
|
||||
m_lna_gain_isSet = false;
|
||||
tia_gain = 0;
|
||||
m_tia_gain_isSet = false;
|
||||
pga_gain = 0;
|
||||
m_pga_gain_isSet = false;
|
||||
ext_clock = 0;
|
||||
m_ext_clock_isSet = false;
|
||||
ext_clock_freq = 0;
|
||||
m_ext_clock_freq_isSet = false;
|
||||
}
|
||||
|
||||
SWGLimeSdrInputSettings::~SWGLimeSdrInputSettings() {
|
||||
@ -101,7 +138,7 @@ SWGLimeSdrInputSettings::cleanup() {
|
||||
}
|
||||
|
||||
SWGLimeSdrInputSettings*
|
||||
SWGLimeSdrInputSettings::fromJson(QString json) {
|
||||
SWGLimeSdrInputSettings::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
@ -110,7 +147,7 @@ SWGLimeSdrInputSettings::fromJson(QString json) {
|
||||
}
|
||||
|
||||
void
|
||||
SWGLimeSdrInputSettings::fromJsonObject(QJsonObject pJson) {
|
||||
SWGLimeSdrInputSettings::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(¢er_frequency, pJson["centerFrequency"], "qint64", "");
|
||||
|
||||
::SWGSDRangel::setValue(&dev_sample_rate, pJson["devSampleRate"], "qint32", "");
|
||||
@ -154,71 +191,73 @@ SWGLimeSdrInputSettings::fromJsonObject(QJsonObject pJson) {
|
||||
QString
|
||||
SWGLimeSdrInputSettings::asJson ()
|
||||
{
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
QJsonObject*
|
||||
SWGLimeSdrInputSettings::asJsonObject() {
|
||||
QJsonObject obj;
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(m_center_frequency_isSet){
|
||||
obj.insert("centerFrequency", QJsonValue(center_frequency));
|
||||
obj->insert("centerFrequency", QJsonValue(center_frequency));
|
||||
}
|
||||
if(m_dev_sample_rate_isSet){
|
||||
obj.insert("devSampleRate", QJsonValue(dev_sample_rate));
|
||||
obj->insert("devSampleRate", QJsonValue(dev_sample_rate));
|
||||
}
|
||||
if(m_log2_hard_decim_isSet){
|
||||
obj.insert("log2HardDecim", QJsonValue(log2_hard_decim));
|
||||
obj->insert("log2HardDecim", QJsonValue(log2_hard_decim));
|
||||
}
|
||||
if(m_dc_block_isSet){
|
||||
obj.insert("dcBlock", QJsonValue(dc_block));
|
||||
obj->insert("dcBlock", QJsonValue(dc_block));
|
||||
}
|
||||
if(m_iq_correction_isSet){
|
||||
obj.insert("iqCorrection", QJsonValue(iq_correction));
|
||||
obj->insert("iqCorrection", QJsonValue(iq_correction));
|
||||
}
|
||||
if(m_log2_soft_decim_isSet){
|
||||
obj.insert("log2SoftDecim", QJsonValue(log2_soft_decim));
|
||||
obj->insert("log2SoftDecim", QJsonValue(log2_soft_decim));
|
||||
}
|
||||
if(m_lpf_bw_isSet){
|
||||
obj.insert("lpfBW", QJsonValue(lpf_bw));
|
||||
obj->insert("lpfBW", QJsonValue(lpf_bw));
|
||||
}
|
||||
if(m_lpf_fir_enable_isSet){
|
||||
obj.insert("lpfFIREnable", QJsonValue(lpf_fir_enable));
|
||||
obj->insert("lpfFIREnable", QJsonValue(lpf_fir_enable));
|
||||
}
|
||||
if(m_lpf_firbw_isSet){
|
||||
obj.insert("lpfFIRBW", QJsonValue(lpf_firbw));
|
||||
obj->insert("lpfFIRBW", QJsonValue(lpf_firbw));
|
||||
}
|
||||
if(m_gain_isSet){
|
||||
obj.insert("gain", QJsonValue(gain));
|
||||
obj->insert("gain", QJsonValue(gain));
|
||||
}
|
||||
if(m_nco_enable_isSet){
|
||||
obj.insert("ncoEnable", QJsonValue(nco_enable));
|
||||
obj->insert("ncoEnable", QJsonValue(nco_enable));
|
||||
}
|
||||
if(m_nco_frequency_isSet){
|
||||
obj.insert("ncoFrequency", QJsonValue(nco_frequency));
|
||||
obj->insert("ncoFrequency", QJsonValue(nco_frequency));
|
||||
}
|
||||
if(m_antenna_path_isSet){
|
||||
obj.insert("antennaPath", QJsonValue(antenna_path));
|
||||
obj->insert("antennaPath", QJsonValue(antenna_path));
|
||||
}
|
||||
if(m_gain_mode_isSet){
|
||||
obj.insert("gainMode", QJsonValue(gain_mode));
|
||||
obj->insert("gainMode", QJsonValue(gain_mode));
|
||||
}
|
||||
if(m_lna_gain_isSet){
|
||||
obj.insert("lnaGain", QJsonValue(lna_gain));
|
||||
obj->insert("lnaGain", QJsonValue(lna_gain));
|
||||
}
|
||||
if(m_tia_gain_isSet){
|
||||
obj.insert("tiaGain", QJsonValue(tia_gain));
|
||||
obj->insert("tiaGain", QJsonValue(tia_gain));
|
||||
}
|
||||
if(m_pga_gain_isSet){
|
||||
obj.insert("pgaGain", QJsonValue(pga_gain));
|
||||
obj->insert("pgaGain", QJsonValue(pga_gain));
|
||||
}
|
||||
if(m_ext_clock_isSet){
|
||||
obj.insert("extClock", QJsonValue(ext_clock));
|
||||
obj->insert("extClock", QJsonValue(ext_clock));
|
||||
}
|
||||
if(m_ext_clock_freq_isSet){
|
||||
obj.insert("extClockFreq", QJsonValue(ext_clock_freq));
|
||||
obj->insert("extClockFreq", QJsonValue(ext_clock_freq));
|
||||
}
|
||||
|
||||
return obj;
|
||||
|
@ -30,15 +30,15 @@ namespace SWGSDRangel {
|
||||
class SWGLimeSdrInputSettings: public SWGObject {
|
||||
public:
|
||||
SWGLimeSdrInputSettings();
|
||||
SWGLimeSdrInputSettings(QString json);
|
||||
~SWGLimeSdrInputSettings();
|
||||
SWGLimeSdrInputSettings(QString* json);
|
||||
virtual ~SWGLimeSdrInputSettings();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject asJsonObject();
|
||||
void fromJsonObject(QJsonObject json);
|
||||
SWGLimeSdrInputSettings* fromJson(QString jsonString);
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGLimeSdrInputSettings* fromJson(QString &jsonString);
|
||||
|
||||
qint64 getCenterFrequency();
|
||||
void setCenterFrequency(qint64 center_frequency);
|
||||
|
@ -22,13 +22,38 @@
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGLimeSdrOutputSettings::SWGLimeSdrOutputSettings(QString json) {
|
||||
SWGLimeSdrOutputSettings::SWGLimeSdrOutputSettings(QString* json) {
|
||||
init();
|
||||
this->fromJson(json);
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGLimeSdrOutputSettings::SWGLimeSdrOutputSettings() {
|
||||
init();
|
||||
center_frequency = 0L;
|
||||
m_center_frequency_isSet = false;
|
||||
dev_sample_rate = 0;
|
||||
m_dev_sample_rate_isSet = false;
|
||||
log2_hard_interp = 0;
|
||||
m_log2_hard_interp_isSet = false;
|
||||
log2_soft_interp = 0;
|
||||
m_log2_soft_interp_isSet = false;
|
||||
lpf_bw = 0;
|
||||
m_lpf_bw_isSet = false;
|
||||
lpf_fir_enable = 0;
|
||||
m_lpf_fir_enable_isSet = false;
|
||||
lpf_firbw = 0;
|
||||
m_lpf_firbw_isSet = false;
|
||||
gain = 0;
|
||||
m_gain_isSet = false;
|
||||
nco_enable = 0;
|
||||
m_nco_enable_isSet = false;
|
||||
nco_frequency = 0;
|
||||
m_nco_frequency_isSet = false;
|
||||
antenna_path = 0;
|
||||
m_antenna_path_isSet = false;
|
||||
ext_clock = 0;
|
||||
m_ext_clock_isSet = false;
|
||||
ext_clock_freq = 0;
|
||||
m_ext_clock_freq_isSet = false;
|
||||
}
|
||||
|
||||
SWGLimeSdrOutputSettings::~SWGLimeSdrOutputSettings() {
|
||||
@ -83,7 +108,7 @@ SWGLimeSdrOutputSettings::cleanup() {
|
||||
}
|
||||
|
||||
SWGLimeSdrOutputSettings*
|
||||
SWGLimeSdrOutputSettings::fromJson(QString json) {
|
||||
SWGLimeSdrOutputSettings::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
@ -92,7 +117,7 @@ SWGLimeSdrOutputSettings::fromJson(QString json) {
|
||||
}
|
||||
|
||||
void
|
||||
SWGLimeSdrOutputSettings::fromJsonObject(QJsonObject pJson) {
|
||||
SWGLimeSdrOutputSettings::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(¢er_frequency, pJson["centerFrequency"], "qint64", "");
|
||||
|
||||
::SWGSDRangel::setValue(&dev_sample_rate, pJson["devSampleRate"], "qint32", "");
|
||||
@ -124,53 +149,55 @@ SWGLimeSdrOutputSettings::fromJsonObject(QJsonObject pJson) {
|
||||
QString
|
||||
SWGLimeSdrOutputSettings::asJson ()
|
||||
{
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
QJsonObject*
|
||||
SWGLimeSdrOutputSettings::asJsonObject() {
|
||||
QJsonObject obj;
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(m_center_frequency_isSet){
|
||||
obj.insert("centerFrequency", QJsonValue(center_frequency));
|
||||
obj->insert("centerFrequency", QJsonValue(center_frequency));
|
||||
}
|
||||
if(m_dev_sample_rate_isSet){
|
||||
obj.insert("devSampleRate", QJsonValue(dev_sample_rate));
|
||||
obj->insert("devSampleRate", QJsonValue(dev_sample_rate));
|
||||
}
|
||||
if(m_log2_hard_interp_isSet){
|
||||
obj.insert("log2HardInterp", QJsonValue(log2_hard_interp));
|
||||
obj->insert("log2HardInterp", QJsonValue(log2_hard_interp));
|
||||
}
|
||||
if(m_log2_soft_interp_isSet){
|
||||
obj.insert("log2SoftInterp", QJsonValue(log2_soft_interp));
|
||||
obj->insert("log2SoftInterp", QJsonValue(log2_soft_interp));
|
||||
}
|
||||
if(m_lpf_bw_isSet){
|
||||
obj.insert("lpfBW", QJsonValue(lpf_bw));
|
||||
obj->insert("lpfBW", QJsonValue(lpf_bw));
|
||||
}
|
||||
if(m_lpf_fir_enable_isSet){
|
||||
obj.insert("lpfFIREnable", QJsonValue(lpf_fir_enable));
|
||||
obj->insert("lpfFIREnable", QJsonValue(lpf_fir_enable));
|
||||
}
|
||||
if(m_lpf_firbw_isSet){
|
||||
obj.insert("lpfFIRBW", QJsonValue(lpf_firbw));
|
||||
obj->insert("lpfFIRBW", QJsonValue(lpf_firbw));
|
||||
}
|
||||
if(m_gain_isSet){
|
||||
obj.insert("gain", QJsonValue(gain));
|
||||
obj->insert("gain", QJsonValue(gain));
|
||||
}
|
||||
if(m_nco_enable_isSet){
|
||||
obj.insert("ncoEnable", QJsonValue(nco_enable));
|
||||
obj->insert("ncoEnable", QJsonValue(nco_enable));
|
||||
}
|
||||
if(m_nco_frequency_isSet){
|
||||
obj.insert("ncoFrequency", QJsonValue(nco_frequency));
|
||||
obj->insert("ncoFrequency", QJsonValue(nco_frequency));
|
||||
}
|
||||
if(m_antenna_path_isSet){
|
||||
obj.insert("antennaPath", QJsonValue(antenna_path));
|
||||
obj->insert("antennaPath", QJsonValue(antenna_path));
|
||||
}
|
||||
if(m_ext_clock_isSet){
|
||||
obj.insert("extClock", QJsonValue(ext_clock));
|
||||
obj->insert("extClock", QJsonValue(ext_clock));
|
||||
}
|
||||
if(m_ext_clock_freq_isSet){
|
||||
obj.insert("extClockFreq", QJsonValue(ext_clock_freq));
|
||||
obj->insert("extClockFreq", QJsonValue(ext_clock_freq));
|
||||
}
|
||||
|
||||
return obj;
|
||||
|
@ -30,15 +30,15 @@ namespace SWGSDRangel {
|
||||
class SWGLimeSdrOutputSettings: public SWGObject {
|
||||
public:
|
||||
SWGLimeSdrOutputSettings();
|
||||
SWGLimeSdrOutputSettings(QString json);
|
||||
~SWGLimeSdrOutputSettings();
|
||||
SWGLimeSdrOutputSettings(QString* json);
|
||||
virtual ~SWGLimeSdrOutputSettings();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject asJsonObject();
|
||||
void fromJsonObject(QJsonObject json);
|
||||
SWGLimeSdrOutputSettings* fromJson(QString jsonString);
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGLimeSdrOutputSettings* fromJson(QString &jsonString);
|
||||
|
||||
qint64 getCenterFrequency();
|
||||
void setCenterFrequency(qint64 center_frequency);
|
||||
|
@ -22,13 +22,16 @@
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGLocationInformation::SWGLocationInformation(QString json) {
|
||||
SWGLocationInformation::SWGLocationInformation(QString* json) {
|
||||
init();
|
||||
this->fromJson(json);
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGLocationInformation::SWGLocationInformation() {
|
||||
init();
|
||||
latitude = 0.0f;
|
||||
m_latitude_isSet = false;
|
||||
longitude = 0.0f;
|
||||
m_longitude_isSet = false;
|
||||
}
|
||||
|
||||
SWGLocationInformation::~SWGLocationInformation() {
|
||||
@ -50,7 +53,7 @@ SWGLocationInformation::cleanup() {
|
||||
}
|
||||
|
||||
SWGLocationInformation*
|
||||
SWGLocationInformation::fromJson(QString json) {
|
||||
SWGLocationInformation::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
@ -59,7 +62,7 @@ SWGLocationInformation::fromJson(QString json) {
|
||||
}
|
||||
|
||||
void
|
||||
SWGLocationInformation::fromJsonObject(QJsonObject pJson) {
|
||||
SWGLocationInformation::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&latitude, pJson["latitude"], "float", "");
|
||||
|
||||
::SWGSDRangel::setValue(&longitude, pJson["longitude"], "float", "");
|
||||
@ -69,20 +72,22 @@ SWGLocationInformation::fromJsonObject(QJsonObject pJson) {
|
||||
QString
|
||||
SWGLocationInformation::asJson ()
|
||||
{
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
QJsonObject*
|
||||
SWGLocationInformation::asJsonObject() {
|
||||
QJsonObject obj;
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(m_latitude_isSet){
|
||||
obj.insert("latitude", QJsonValue(latitude));
|
||||
obj->insert("latitude", QJsonValue(latitude));
|
||||
}
|
||||
if(m_longitude_isSet){
|
||||
obj.insert("longitude", QJsonValue(longitude));
|
||||
obj->insert("longitude", QJsonValue(longitude));
|
||||
}
|
||||
|
||||
return obj;
|
||||
|
@ -30,15 +30,15 @@ namespace SWGSDRangel {
|
||||
class SWGLocationInformation: public SWGObject {
|
||||
public:
|
||||
SWGLocationInformation();
|
||||
SWGLocationInformation(QString json);
|
||||
~SWGLocationInformation();
|
||||
SWGLocationInformation(QString* json);
|
||||
virtual ~SWGLocationInformation();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject asJsonObject();
|
||||
void fromJsonObject(QJsonObject json);
|
||||
SWGLocationInformation* fromJson(QString jsonString);
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGLocationInformation* fromJson(QString &jsonString);
|
||||
|
||||
float getLatitude();
|
||||
void setLatitude(float latitude);
|
||||
|
@ -22,13 +22,20 @@
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGLoggingInfo::SWGLoggingInfo(QString json) {
|
||||
SWGLoggingInfo::SWGLoggingInfo(QString* json) {
|
||||
init();
|
||||
this->fromJson(json);
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGLoggingInfo::SWGLoggingInfo() {
|
||||
init();
|
||||
console_level = nullptr;
|
||||
m_console_level_isSet = false;
|
||||
file_level = nullptr;
|
||||
m_file_level_isSet = false;
|
||||
dump_to_file = 0;
|
||||
m_dump_to_file_isSet = false;
|
||||
file_name = nullptr;
|
||||
m_file_name_isSet = false;
|
||||
}
|
||||
|
||||
SWGLoggingInfo::~SWGLoggingInfo() {
|
||||
@ -62,7 +69,7 @@ SWGLoggingInfo::cleanup() {
|
||||
}
|
||||
|
||||
SWGLoggingInfo*
|
||||
SWGLoggingInfo::fromJson(QString json) {
|
||||
SWGLoggingInfo::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
@ -71,7 +78,7 @@ SWGLoggingInfo::fromJson(QString json) {
|
||||
}
|
||||
|
||||
void
|
||||
SWGLoggingInfo::fromJsonObject(QJsonObject pJson) {
|
||||
SWGLoggingInfo::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&console_level, pJson["consoleLevel"], "QString", "QString");
|
||||
|
||||
::SWGSDRangel::setValue(&file_level, pJson["fileLevel"], "QString", "QString");
|
||||
@ -85,15 +92,17 @@ SWGLoggingInfo::fromJsonObject(QJsonObject pJson) {
|
||||
QString
|
||||
SWGLoggingInfo::asJson ()
|
||||
{
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
QJsonObject*
|
||||
SWGLoggingInfo::asJsonObject() {
|
||||
QJsonObject obj;
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(console_level != nullptr && *console_level != QString("")){
|
||||
toJsonValue(QString("consoleLevel"), console_level, obj, QString("QString"));
|
||||
}
|
||||
@ -101,7 +110,7 @@ SWGLoggingInfo::asJsonObject() {
|
||||
toJsonValue(QString("fileLevel"), file_level, obj, QString("QString"));
|
||||
}
|
||||
if(m_dump_to_file_isSet){
|
||||
obj.insert("dumpToFile", QJsonValue(dump_to_file));
|
||||
obj->insert("dumpToFile", QJsonValue(dump_to_file));
|
||||
}
|
||||
if(file_name != nullptr && *file_name != QString("")){
|
||||
toJsonValue(QString("fileName"), file_name, obj, QString("QString"));
|
||||
|
@ -31,15 +31,15 @@ namespace SWGSDRangel {
|
||||
class SWGLoggingInfo: public SWGObject {
|
||||
public:
|
||||
SWGLoggingInfo();
|
||||
SWGLoggingInfo(QString json);
|
||||
~SWGLoggingInfo();
|
||||
SWGLoggingInfo(QString* json);
|
||||
virtual ~SWGLoggingInfo();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject asJsonObject();
|
||||
void fromJsonObject(QJsonObject json);
|
||||
SWGLoggingInfo* fromJson(QString jsonString);
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGLoggingInfo* fromJson(QString &jsonString);
|
||||
|
||||
QString* getConsoleLevel();
|
||||
void setConsoleLevel(QString* console_level);
|
||||
|
@ -171,12 +171,13 @@ namespace SWGSDRangel {
|
||||
}
|
||||
|
||||
inline void* create(QString json, QString type) {
|
||||
void* val = create(type);
|
||||
if(val != nullptr) {
|
||||
SWGObject* obj = static_cast<SWGObject*>(val);
|
||||
return obj->fromJson(json);
|
||||
}
|
||||
if(type.startsWith("QString")) {
|
||||
return new QString();
|
||||
}
|
||||
auto val = static_cast<SWGObject*>(create(type));
|
||||
if(val != nullptr) {
|
||||
return val->fromJson(json);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -22,13 +22,46 @@
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGNFMDemodSettings::SWGNFMDemodSettings(QString json) {
|
||||
SWGNFMDemodSettings::SWGNFMDemodSettings(QString* json) {
|
||||
init();
|
||||
this->fromJson(json);
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGNFMDemodSettings::SWGNFMDemodSettings() {
|
||||
init();
|
||||
input_frequency_offset = 0L;
|
||||
m_input_frequency_offset_isSet = false;
|
||||
rf_bandwidth = 0.0f;
|
||||
m_rf_bandwidth_isSet = false;
|
||||
af_bandwidth = 0.0f;
|
||||
m_af_bandwidth_isSet = false;
|
||||
fm_deviation = 0;
|
||||
m_fm_deviation_isSet = false;
|
||||
squelch_gate = 0;
|
||||
m_squelch_gate_isSet = false;
|
||||
delta_squelch = 0;
|
||||
m_delta_squelch_isSet = false;
|
||||
squelch = 0.0f;
|
||||
m_squelch_isSet = false;
|
||||
volume = 0.0f;
|
||||
m_volume_isSet = false;
|
||||
ctcss_on = 0;
|
||||
m_ctcss_on_isSet = false;
|
||||
audio_mute = 0;
|
||||
m_audio_mute_isSet = false;
|
||||
ctcss_index = 0;
|
||||
m_ctcss_index_isSet = false;
|
||||
audio_sample_rate = 0;
|
||||
m_audio_sample_rate_isSet = false;
|
||||
copy_audio_to_udp = 0;
|
||||
m_copy_audio_to_udp_isSet = false;
|
||||
udp_address = nullptr;
|
||||
m_udp_address_isSet = false;
|
||||
udp_port = 0;
|
||||
m_udp_port_isSet = false;
|
||||
rgb_color = 0;
|
||||
m_rgb_color_isSet = false;
|
||||
title = nullptr;
|
||||
m_title_isSet = false;
|
||||
}
|
||||
|
||||
SWGNFMDemodSettings::~SWGNFMDemodSettings() {
|
||||
@ -99,7 +132,7 @@ SWGNFMDemodSettings::cleanup() {
|
||||
}
|
||||
|
||||
SWGNFMDemodSettings*
|
||||
SWGNFMDemodSettings::fromJson(QString json) {
|
||||
SWGNFMDemodSettings::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
@ -108,7 +141,7 @@ SWGNFMDemodSettings::fromJson(QString json) {
|
||||
}
|
||||
|
||||
void
|
||||
SWGNFMDemodSettings::fromJsonObject(QJsonObject pJson) {
|
||||
SWGNFMDemodSettings::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&input_frequency_offset, pJson["inputFrequencyOffset"], "qint64", "");
|
||||
|
||||
::SWGSDRangel::setValue(&rf_bandwidth, pJson["rfBandwidth"], "float", "");
|
||||
@ -148,62 +181,64 @@ SWGNFMDemodSettings::fromJsonObject(QJsonObject pJson) {
|
||||
QString
|
||||
SWGNFMDemodSettings::asJson ()
|
||||
{
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
QJsonObject*
|
||||
SWGNFMDemodSettings::asJsonObject() {
|
||||
QJsonObject obj;
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(m_input_frequency_offset_isSet){
|
||||
obj.insert("inputFrequencyOffset", QJsonValue(input_frequency_offset));
|
||||
obj->insert("inputFrequencyOffset", QJsonValue(input_frequency_offset));
|
||||
}
|
||||
if(m_rf_bandwidth_isSet){
|
||||
obj.insert("rfBandwidth", QJsonValue(rf_bandwidth));
|
||||
obj->insert("rfBandwidth", QJsonValue(rf_bandwidth));
|
||||
}
|
||||
if(m_af_bandwidth_isSet){
|
||||
obj.insert("afBandwidth", QJsonValue(af_bandwidth));
|
||||
obj->insert("afBandwidth", QJsonValue(af_bandwidth));
|
||||
}
|
||||
if(m_fm_deviation_isSet){
|
||||
obj.insert("fmDeviation", QJsonValue(fm_deviation));
|
||||
obj->insert("fmDeviation", QJsonValue(fm_deviation));
|
||||
}
|
||||
if(m_squelch_gate_isSet){
|
||||
obj.insert("squelchGate", QJsonValue(squelch_gate));
|
||||
obj->insert("squelchGate", QJsonValue(squelch_gate));
|
||||
}
|
||||
if(m_delta_squelch_isSet){
|
||||
obj.insert("deltaSquelch", QJsonValue(delta_squelch));
|
||||
obj->insert("deltaSquelch", QJsonValue(delta_squelch));
|
||||
}
|
||||
if(m_squelch_isSet){
|
||||
obj.insert("squelch", QJsonValue(squelch));
|
||||
obj->insert("squelch", QJsonValue(squelch));
|
||||
}
|
||||
if(m_volume_isSet){
|
||||
obj.insert("volume", QJsonValue(volume));
|
||||
obj->insert("volume", QJsonValue(volume));
|
||||
}
|
||||
if(m_ctcss_on_isSet){
|
||||
obj.insert("ctcssOn", QJsonValue(ctcss_on));
|
||||
obj->insert("ctcssOn", QJsonValue(ctcss_on));
|
||||
}
|
||||
if(m_audio_mute_isSet){
|
||||
obj.insert("audioMute", QJsonValue(audio_mute));
|
||||
obj->insert("audioMute", QJsonValue(audio_mute));
|
||||
}
|
||||
if(m_ctcss_index_isSet){
|
||||
obj.insert("ctcssIndex", QJsonValue(ctcss_index));
|
||||
obj->insert("ctcssIndex", QJsonValue(ctcss_index));
|
||||
}
|
||||
if(m_audio_sample_rate_isSet){
|
||||
obj.insert("audioSampleRate", QJsonValue(audio_sample_rate));
|
||||
obj->insert("audioSampleRate", QJsonValue(audio_sample_rate));
|
||||
}
|
||||
if(m_copy_audio_to_udp_isSet){
|
||||
obj.insert("copyAudioToUDP", QJsonValue(copy_audio_to_udp));
|
||||
obj->insert("copyAudioToUDP", QJsonValue(copy_audio_to_udp));
|
||||
}
|
||||
if(udp_address != nullptr && *udp_address != QString("")){
|
||||
toJsonValue(QString("udpAddress"), udp_address, obj, QString("QString"));
|
||||
}
|
||||
if(m_udp_port_isSet){
|
||||
obj.insert("udpPort", QJsonValue(udp_port));
|
||||
obj->insert("udpPort", QJsonValue(udp_port));
|
||||
}
|
||||
if(m_rgb_color_isSet){
|
||||
obj.insert("rgbColor", QJsonValue(rgb_color));
|
||||
obj->insert("rgbColor", QJsonValue(rgb_color));
|
||||
}
|
||||
if(title != nullptr && *title != QString("")){
|
||||
toJsonValue(QString("title"), title, obj, QString("QString"));
|
||||
|
@ -31,15 +31,15 @@ namespace SWGSDRangel {
|
||||
class SWGNFMDemodSettings: public SWGObject {
|
||||
public:
|
||||
SWGNFMDemodSettings();
|
||||
SWGNFMDemodSettings(QString json);
|
||||
~SWGNFMDemodSettings();
|
||||
SWGNFMDemodSettings(QString* json);
|
||||
virtual ~SWGNFMDemodSettings();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject asJsonObject();
|
||||
void fromJsonObject(QJsonObject json);
|
||||
SWGNFMDemodSettings* fromJson(QString jsonString);
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGNFMDemodSettings* fromJson(QString &jsonString);
|
||||
|
||||
qint64 getInputFrequencyOffset();
|
||||
void setInputFrequencyOffset(qint64 input_frequency_offset);
|
||||
|
@ -22,13 +22,42 @@
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGNFMModSettings::SWGNFMModSettings(QString json) {
|
||||
SWGNFMModSettings::SWGNFMModSettings(QString* json) {
|
||||
init();
|
||||
this->fromJson(json);
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGNFMModSettings::SWGNFMModSettings() {
|
||||
init();
|
||||
input_frequency_offset = 0L;
|
||||
m_input_frequency_offset_isSet = false;
|
||||
rf_bandwidth = 0.0f;
|
||||
m_rf_bandwidth_isSet = false;
|
||||
af_bandwidth = 0.0f;
|
||||
m_af_bandwidth_isSet = false;
|
||||
fm_deviation = 0.0f;
|
||||
m_fm_deviation_isSet = false;
|
||||
tone_frequency = 0.0f;
|
||||
m_tone_frequency_isSet = false;
|
||||
volume_factor = 0.0f;
|
||||
m_volume_factor_isSet = false;
|
||||
audio_sample_rate = 0;
|
||||
m_audio_sample_rate_isSet = false;
|
||||
channel_mute = 0;
|
||||
m_channel_mute_isSet = false;
|
||||
play_loop = 0;
|
||||
m_play_loop_isSet = false;
|
||||
ctcss_on = 0;
|
||||
m_ctcss_on_isSet = false;
|
||||
ctcss_index = 0;
|
||||
m_ctcss_index_isSet = false;
|
||||
rgb_color = 0;
|
||||
m_rgb_color_isSet = false;
|
||||
title = nullptr;
|
||||
m_title_isSet = false;
|
||||
mod_af_input = 0;
|
||||
m_mod_af_input_isSet = false;
|
||||
cw_keyer = nullptr;
|
||||
m_cw_keyer_isSet = false;
|
||||
}
|
||||
|
||||
SWGNFMModSettings::~SWGNFMModSettings() {
|
||||
@ -93,7 +122,7 @@ SWGNFMModSettings::cleanup() {
|
||||
}
|
||||
|
||||
SWGNFMModSettings*
|
||||
SWGNFMModSettings::fromJson(QString json) {
|
||||
SWGNFMModSettings::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
@ -102,7 +131,7 @@ SWGNFMModSettings::fromJson(QString json) {
|
||||
}
|
||||
|
||||
void
|
||||
SWGNFMModSettings::fromJsonObject(QJsonObject pJson) {
|
||||
SWGNFMModSettings::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&input_frequency_offset, pJson["inputFrequencyOffset"], "qint64", "");
|
||||
|
||||
::SWGSDRangel::setValue(&rf_bandwidth, pJson["rfBandwidth"], "float", "");
|
||||
@ -138,56 +167,58 @@ SWGNFMModSettings::fromJsonObject(QJsonObject pJson) {
|
||||
QString
|
||||
SWGNFMModSettings::asJson ()
|
||||
{
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
QJsonObject*
|
||||
SWGNFMModSettings::asJsonObject() {
|
||||
QJsonObject obj;
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(m_input_frequency_offset_isSet){
|
||||
obj.insert("inputFrequencyOffset", QJsonValue(input_frequency_offset));
|
||||
obj->insert("inputFrequencyOffset", QJsonValue(input_frequency_offset));
|
||||
}
|
||||
if(m_rf_bandwidth_isSet){
|
||||
obj.insert("rfBandwidth", QJsonValue(rf_bandwidth));
|
||||
obj->insert("rfBandwidth", QJsonValue(rf_bandwidth));
|
||||
}
|
||||
if(m_af_bandwidth_isSet){
|
||||
obj.insert("afBandwidth", QJsonValue(af_bandwidth));
|
||||
obj->insert("afBandwidth", QJsonValue(af_bandwidth));
|
||||
}
|
||||
if(m_fm_deviation_isSet){
|
||||
obj.insert("fmDeviation", QJsonValue(fm_deviation));
|
||||
obj->insert("fmDeviation", QJsonValue(fm_deviation));
|
||||
}
|
||||
if(m_tone_frequency_isSet){
|
||||
obj.insert("toneFrequency", QJsonValue(tone_frequency));
|
||||
obj->insert("toneFrequency", QJsonValue(tone_frequency));
|
||||
}
|
||||
if(m_volume_factor_isSet){
|
||||
obj.insert("volumeFactor", QJsonValue(volume_factor));
|
||||
obj->insert("volumeFactor", QJsonValue(volume_factor));
|
||||
}
|
||||
if(m_audio_sample_rate_isSet){
|
||||
obj.insert("audioSampleRate", QJsonValue(audio_sample_rate));
|
||||
obj->insert("audioSampleRate", QJsonValue(audio_sample_rate));
|
||||
}
|
||||
if(m_channel_mute_isSet){
|
||||
obj.insert("channelMute", QJsonValue(channel_mute));
|
||||
obj->insert("channelMute", QJsonValue(channel_mute));
|
||||
}
|
||||
if(m_play_loop_isSet){
|
||||
obj.insert("playLoop", QJsonValue(play_loop));
|
||||
obj->insert("playLoop", QJsonValue(play_loop));
|
||||
}
|
||||
if(m_ctcss_on_isSet){
|
||||
obj.insert("ctcssOn", QJsonValue(ctcss_on));
|
||||
obj->insert("ctcssOn", QJsonValue(ctcss_on));
|
||||
}
|
||||
if(m_ctcss_index_isSet){
|
||||
obj.insert("ctcssIndex", QJsonValue(ctcss_index));
|
||||
obj->insert("ctcssIndex", QJsonValue(ctcss_index));
|
||||
}
|
||||
if(m_rgb_color_isSet){
|
||||
obj.insert("rgbColor", QJsonValue(rgb_color));
|
||||
obj->insert("rgbColor", QJsonValue(rgb_color));
|
||||
}
|
||||
if(title != nullptr && *title != QString("")){
|
||||
toJsonValue(QString("title"), title, obj, QString("QString"));
|
||||
}
|
||||
if(m_mod_af_input_isSet){
|
||||
obj.insert("modAFInput", QJsonValue(mod_af_input));
|
||||
obj->insert("modAFInput", QJsonValue(mod_af_input));
|
||||
}
|
||||
if((cw_keyer != nullptr) && (cw_keyer->isSet())){
|
||||
toJsonValue(QString("cwKeyer"), cw_keyer, obj, QString("SWGCWKeyerSettings"));
|
||||
|
@ -32,15 +32,15 @@ namespace SWGSDRangel {
|
||||
class SWGNFMModSettings: public SWGObject {
|
||||
public:
|
||||
SWGNFMModSettings();
|
||||
SWGNFMModSettings(QString json);
|
||||
~SWGNFMModSettings();
|
||||
SWGNFMModSettings(QString* json);
|
||||
virtual ~SWGNFMModSettings();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject asJsonObject();
|
||||
void fromJsonObject(QJsonObject json);
|
||||
SWGNFMModSettings* fromJson(QString jsonString);
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGNFMModSettings* fromJson(QString &jsonString);
|
||||
|
||||
qint64 getInputFrequencyOffset();
|
||||
void setInputFrequencyOffset(qint64 input_frequency_offset);
|
||||
|
@ -19,15 +19,15 @@ namespace SWGSDRangel {
|
||||
|
||||
class SWGObject {
|
||||
public:
|
||||
virtual QJsonObject asJsonObject() {
|
||||
return QJsonObject();
|
||||
virtual QJsonObject* asJsonObject() {
|
||||
return new QJsonObject();
|
||||
}
|
||||
virtual ~SWGObject() {}
|
||||
virtual SWGObject* fromJson(QString jsonString) {
|
||||
virtual SWGObject* fromJson(QString &jsonString) {
|
||||
Q_UNUSED(jsonString);
|
||||
return new SWGObject();
|
||||
}
|
||||
virtual void fromJsonObject(QJsonObject json) {
|
||||
virtual void fromJsonObject(QJsonObject &json) {
|
||||
Q_UNUSED(json);
|
||||
}
|
||||
virtual QString asJson() {
|
||||
|
@ -22,13 +22,16 @@
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGPresetExport::SWGPresetExport(QString json) {
|
||||
SWGPresetExport::SWGPresetExport(QString* json) {
|
||||
init();
|
||||
this->fromJson(json);
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGPresetExport::SWGPresetExport() {
|
||||
init();
|
||||
file_path = nullptr;
|
||||
m_file_path_isSet = false;
|
||||
preset = nullptr;
|
||||
m_preset_isSet = false;
|
||||
}
|
||||
|
||||
SWGPresetExport::~SWGPresetExport() {
|
||||
@ -54,7 +57,7 @@ SWGPresetExport::cleanup() {
|
||||
}
|
||||
|
||||
SWGPresetExport*
|
||||
SWGPresetExport::fromJson(QString json) {
|
||||
SWGPresetExport::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
@ -63,7 +66,7 @@ SWGPresetExport::fromJson(QString json) {
|
||||
}
|
||||
|
||||
void
|
||||
SWGPresetExport::fromJsonObject(QJsonObject pJson) {
|
||||
SWGPresetExport::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&file_path, pJson["filePath"], "QString", "QString");
|
||||
|
||||
::SWGSDRangel::setValue(&preset, pJson["preset"], "SWGPresetIdentifier", "SWGPresetIdentifier");
|
||||
@ -73,15 +76,17 @@ SWGPresetExport::fromJsonObject(QJsonObject pJson) {
|
||||
QString
|
||||
SWGPresetExport::asJson ()
|
||||
{
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
QJsonObject*
|
||||
SWGPresetExport::asJsonObject() {
|
||||
QJsonObject obj;
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(file_path != nullptr && *file_path != QString("")){
|
||||
toJsonValue(QString("filePath"), file_path, obj, QString("QString"));
|
||||
}
|
||||
|
@ -32,15 +32,15 @@ namespace SWGSDRangel {
|
||||
class SWGPresetExport: public SWGObject {
|
||||
public:
|
||||
SWGPresetExport();
|
||||
SWGPresetExport(QString json);
|
||||
~SWGPresetExport();
|
||||
SWGPresetExport(QString* json);
|
||||
virtual ~SWGPresetExport();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject asJsonObject();
|
||||
void fromJsonObject(QJsonObject json);
|
||||
SWGPresetExport* fromJson(QString jsonString);
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGPresetExport* fromJson(QString &jsonString);
|
||||
|
||||
QString* getFilePath();
|
||||
void setFilePath(QString* file_path);
|
||||
|
@ -22,13 +22,18 @@
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGPresetGroup::SWGPresetGroup(QString json) {
|
||||
SWGPresetGroup::SWGPresetGroup(QString* json) {
|
||||
init();
|
||||
this->fromJson(json);
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGPresetGroup::SWGPresetGroup() {
|
||||
init();
|
||||
group_name = nullptr;
|
||||
m_group_name_isSet = false;
|
||||
nb_presets = 0;
|
||||
m_nb_presets_isSet = false;
|
||||
presets = nullptr;
|
||||
m_presets_isSet = false;
|
||||
}
|
||||
|
||||
SWGPresetGroup::~SWGPresetGroup() {
|
||||
@ -61,7 +66,7 @@ SWGPresetGroup::cleanup() {
|
||||
}
|
||||
|
||||
SWGPresetGroup*
|
||||
SWGPresetGroup::fromJson(QString json) {
|
||||
SWGPresetGroup::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
@ -70,7 +75,7 @@ SWGPresetGroup::fromJson(QString json) {
|
||||
}
|
||||
|
||||
void
|
||||
SWGPresetGroup::fromJsonObject(QJsonObject pJson) {
|
||||
SWGPresetGroup::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&group_name, pJson["groupName"], "QString", "QString");
|
||||
|
||||
::SWGSDRangel::setValue(&nb_presets, pJson["nbPresets"], "qint32", "");
|
||||
@ -82,20 +87,22 @@ SWGPresetGroup::fromJsonObject(QJsonObject pJson) {
|
||||
QString
|
||||
SWGPresetGroup::asJson ()
|
||||
{
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
QJsonObject*
|
||||
SWGPresetGroup::asJsonObject() {
|
||||
QJsonObject obj;
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(group_name != nullptr && *group_name != QString("")){
|
||||
toJsonValue(QString("groupName"), group_name, obj, QString("QString"));
|
||||
}
|
||||
if(m_nb_presets_isSet){
|
||||
obj.insert("nbPresets", QJsonValue(nb_presets));
|
||||
obj->insert("nbPresets", QJsonValue(nb_presets));
|
||||
}
|
||||
if(presets->size() > 0){
|
||||
toJsonArray((QList<void*>*)presets, obj, "presets", "SWGPresetItem");
|
||||
|
@ -33,15 +33,15 @@ namespace SWGSDRangel {
|
||||
class SWGPresetGroup: public SWGObject {
|
||||
public:
|
||||
SWGPresetGroup();
|
||||
SWGPresetGroup(QString json);
|
||||
~SWGPresetGroup();
|
||||
SWGPresetGroup(QString* json);
|
||||
virtual ~SWGPresetGroup();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject asJsonObject();
|
||||
void fromJsonObject(QJsonObject json);
|
||||
SWGPresetGroup* fromJson(QString jsonString);
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGPresetGroup* fromJson(QString &jsonString);
|
||||
|
||||
QString* getGroupName();
|
||||
void setGroupName(QString* group_name);
|
||||
|
@ -22,13 +22,20 @@
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGPresetIdentifier::SWGPresetIdentifier(QString json) {
|
||||
SWGPresetIdentifier::SWGPresetIdentifier(QString* json) {
|
||||
init();
|
||||
this->fromJson(json);
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGPresetIdentifier::SWGPresetIdentifier() {
|
||||
init();
|
||||
group_name = nullptr;
|
||||
m_group_name_isSet = false;
|
||||
center_frequency = 0L;
|
||||
m_center_frequency_isSet = false;
|
||||
type = nullptr;
|
||||
m_type_isSet = false;
|
||||
name = nullptr;
|
||||
m_name_isSet = false;
|
||||
}
|
||||
|
||||
SWGPresetIdentifier::~SWGPresetIdentifier() {
|
||||
@ -62,7 +69,7 @@ SWGPresetIdentifier::cleanup() {
|
||||
}
|
||||
|
||||
SWGPresetIdentifier*
|
||||
SWGPresetIdentifier::fromJson(QString json) {
|
||||
SWGPresetIdentifier::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
@ -71,7 +78,7 @@ SWGPresetIdentifier::fromJson(QString json) {
|
||||
}
|
||||
|
||||
void
|
||||
SWGPresetIdentifier::fromJsonObject(QJsonObject pJson) {
|
||||
SWGPresetIdentifier::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&group_name, pJson["groupName"], "QString", "QString");
|
||||
|
||||
::SWGSDRangel::setValue(¢er_frequency, pJson["centerFrequency"], "qint64", "");
|
||||
@ -85,20 +92,22 @@ SWGPresetIdentifier::fromJsonObject(QJsonObject pJson) {
|
||||
QString
|
||||
SWGPresetIdentifier::asJson ()
|
||||
{
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
QJsonObject*
|
||||
SWGPresetIdentifier::asJsonObject() {
|
||||
QJsonObject obj;
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(group_name != nullptr && *group_name != QString("")){
|
||||
toJsonValue(QString("groupName"), group_name, obj, QString("QString"));
|
||||
}
|
||||
if(m_center_frequency_isSet){
|
||||
obj.insert("centerFrequency", QJsonValue(center_frequency));
|
||||
obj->insert("centerFrequency", QJsonValue(center_frequency));
|
||||
}
|
||||
if(type != nullptr && *type != QString("")){
|
||||
toJsonValue(QString("type"), type, obj, QString("QString"));
|
||||
|
@ -31,15 +31,15 @@ namespace SWGSDRangel {
|
||||
class SWGPresetIdentifier: public SWGObject {
|
||||
public:
|
||||
SWGPresetIdentifier();
|
||||
SWGPresetIdentifier(QString json);
|
||||
~SWGPresetIdentifier();
|
||||
SWGPresetIdentifier(QString* json);
|
||||
virtual ~SWGPresetIdentifier();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject asJsonObject();
|
||||
void fromJsonObject(QJsonObject json);
|
||||
SWGPresetIdentifier* fromJson(QString jsonString);
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGPresetIdentifier* fromJson(QString &jsonString);
|
||||
|
||||
QString* getGroupName();
|
||||
void setGroupName(QString* group_name);
|
||||
|
@ -22,13 +22,18 @@
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGPresetImport::SWGPresetImport(QString json) {
|
||||
SWGPresetImport::SWGPresetImport(QString* json) {
|
||||
init();
|
||||
this->fromJson(json);
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGPresetImport::SWGPresetImport() {
|
||||
init();
|
||||
group_name = nullptr;
|
||||
m_group_name_isSet = false;
|
||||
description = nullptr;
|
||||
m_description_isSet = false;
|
||||
file_path = nullptr;
|
||||
m_file_path_isSet = false;
|
||||
}
|
||||
|
||||
SWGPresetImport::~SWGPresetImport() {
|
||||
@ -59,7 +64,7 @@ SWGPresetImport::cleanup() {
|
||||
}
|
||||
|
||||
SWGPresetImport*
|
||||
SWGPresetImport::fromJson(QString json) {
|
||||
SWGPresetImport::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
@ -68,7 +73,7 @@ SWGPresetImport::fromJson(QString json) {
|
||||
}
|
||||
|
||||
void
|
||||
SWGPresetImport::fromJsonObject(QJsonObject pJson) {
|
||||
SWGPresetImport::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&group_name, pJson["groupName"], "QString", "QString");
|
||||
|
||||
::SWGSDRangel::setValue(&description, pJson["description"], "QString", "QString");
|
||||
@ -80,15 +85,17 @@ SWGPresetImport::fromJsonObject(QJsonObject pJson) {
|
||||
QString
|
||||
SWGPresetImport::asJson ()
|
||||
{
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
QJsonObject*
|
||||
SWGPresetImport::asJsonObject() {
|
||||
QJsonObject obj;
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(group_name != nullptr && *group_name != QString("")){
|
||||
toJsonValue(QString("groupName"), group_name, obj, QString("QString"));
|
||||
}
|
||||
|
@ -31,15 +31,15 @@ namespace SWGSDRangel {
|
||||
class SWGPresetImport: public SWGObject {
|
||||
public:
|
||||
SWGPresetImport();
|
||||
SWGPresetImport(QString json);
|
||||
~SWGPresetImport();
|
||||
SWGPresetImport(QString* json);
|
||||
virtual ~SWGPresetImport();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject asJsonObject();
|
||||
void fromJsonObject(QJsonObject json);
|
||||
SWGPresetImport* fromJson(QString jsonString);
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGPresetImport* fromJson(QString &jsonString);
|
||||
|
||||
QString* getGroupName();
|
||||
void setGroupName(QString* group_name);
|
||||
|
@ -22,13 +22,18 @@
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGPresetItem::SWGPresetItem(QString json) {
|
||||
SWGPresetItem::SWGPresetItem(QString* json) {
|
||||
init();
|
||||
this->fromJson(json);
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGPresetItem::SWGPresetItem() {
|
||||
init();
|
||||
center_frequency = 0L;
|
||||
m_center_frequency_isSet = false;
|
||||
type = nullptr;
|
||||
m_type_isSet = false;
|
||||
name = nullptr;
|
||||
m_name_isSet = false;
|
||||
}
|
||||
|
||||
SWGPresetItem::~SWGPresetItem() {
|
||||
@ -57,7 +62,7 @@ SWGPresetItem::cleanup() {
|
||||
}
|
||||
|
||||
SWGPresetItem*
|
||||
SWGPresetItem::fromJson(QString json) {
|
||||
SWGPresetItem::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
@ -66,7 +71,7 @@ SWGPresetItem::fromJson(QString json) {
|
||||
}
|
||||
|
||||
void
|
||||
SWGPresetItem::fromJsonObject(QJsonObject pJson) {
|
||||
SWGPresetItem::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(¢er_frequency, pJson["centerFrequency"], "qint64", "");
|
||||
|
||||
::SWGSDRangel::setValue(&type, pJson["type"], "QString", "QString");
|
||||
@ -78,17 +83,19 @@ SWGPresetItem::fromJsonObject(QJsonObject pJson) {
|
||||
QString
|
||||
SWGPresetItem::asJson ()
|
||||
{
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
QJsonObject*
|
||||
SWGPresetItem::asJsonObject() {
|
||||
QJsonObject obj;
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(m_center_frequency_isSet){
|
||||
obj.insert("centerFrequency", QJsonValue(center_frequency));
|
||||
obj->insert("centerFrequency", QJsonValue(center_frequency));
|
||||
}
|
||||
if(type != nullptr && *type != QString("")){
|
||||
toJsonValue(QString("type"), type, obj, QString("QString"));
|
||||
|
@ -31,15 +31,15 @@ namespace SWGSDRangel {
|
||||
class SWGPresetItem: public SWGObject {
|
||||
public:
|
||||
SWGPresetItem();
|
||||
SWGPresetItem(QString json);
|
||||
~SWGPresetItem();
|
||||
SWGPresetItem(QString* json);
|
||||
virtual ~SWGPresetItem();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject asJsonObject();
|
||||
void fromJsonObject(QJsonObject json);
|
||||
SWGPresetItem* fromJson(QString jsonString);
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGPresetItem* fromJson(QString &jsonString);
|
||||
|
||||
qint64 getCenterFrequency();
|
||||
void setCenterFrequency(qint64 center_frequency);
|
||||
|
@ -22,13 +22,16 @@
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGPresetTransfer::SWGPresetTransfer(QString json) {
|
||||
SWGPresetTransfer::SWGPresetTransfer(QString* json) {
|
||||
init();
|
||||
this->fromJson(json);
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGPresetTransfer::SWGPresetTransfer() {
|
||||
init();
|
||||
device_set_index = 0;
|
||||
m_device_set_index_isSet = false;
|
||||
preset = nullptr;
|
||||
m_preset_isSet = false;
|
||||
}
|
||||
|
||||
SWGPresetTransfer::~SWGPresetTransfer() {
|
||||
@ -52,7 +55,7 @@ SWGPresetTransfer::cleanup() {
|
||||
}
|
||||
|
||||
SWGPresetTransfer*
|
||||
SWGPresetTransfer::fromJson(QString json) {
|
||||
SWGPresetTransfer::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
@ -61,7 +64,7 @@ SWGPresetTransfer::fromJson(QString json) {
|
||||
}
|
||||
|
||||
void
|
||||
SWGPresetTransfer::fromJsonObject(QJsonObject pJson) {
|
||||
SWGPresetTransfer::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&device_set_index, pJson["deviceSetIndex"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&preset, pJson["preset"], "SWGPresetIdentifier", "SWGPresetIdentifier");
|
||||
@ -71,17 +74,19 @@ SWGPresetTransfer::fromJsonObject(QJsonObject pJson) {
|
||||
QString
|
||||
SWGPresetTransfer::asJson ()
|
||||
{
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
QJsonObject*
|
||||
SWGPresetTransfer::asJsonObject() {
|
||||
QJsonObject obj;
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(m_device_set_index_isSet){
|
||||
obj.insert("deviceSetIndex", QJsonValue(device_set_index));
|
||||
obj->insert("deviceSetIndex", QJsonValue(device_set_index));
|
||||
}
|
||||
if((preset != nullptr) && (preset->isSet())){
|
||||
toJsonValue(QString("preset"), preset, obj, QString("SWGPresetIdentifier"));
|
||||
|
@ -31,15 +31,15 @@ namespace SWGSDRangel {
|
||||
class SWGPresetTransfer: public SWGObject {
|
||||
public:
|
||||
SWGPresetTransfer();
|
||||
SWGPresetTransfer(QString json);
|
||||
~SWGPresetTransfer();
|
||||
SWGPresetTransfer(QString* json);
|
||||
virtual ~SWGPresetTransfer();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject asJsonObject();
|
||||
void fromJsonObject(QJsonObject json);
|
||||
SWGPresetTransfer* fromJson(QString jsonString);
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGPresetTransfer* fromJson(QString &jsonString);
|
||||
|
||||
qint32 getDeviceSetIndex();
|
||||
void setDeviceSetIndex(qint32 device_set_index);
|
||||
|
@ -22,13 +22,16 @@
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGPresets::SWGPresets(QString json) {
|
||||
SWGPresets::SWGPresets(QString* json) {
|
||||
init();
|
||||
this->fromJson(json);
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGPresets::SWGPresets() {
|
||||
init();
|
||||
nb_groups = 0;
|
||||
m_nb_groups_isSet = false;
|
||||
groups = nullptr;
|
||||
m_groups_isSet = false;
|
||||
}
|
||||
|
||||
SWGPresets::~SWGPresets() {
|
||||
@ -56,7 +59,7 @@ SWGPresets::cleanup() {
|
||||
}
|
||||
|
||||
SWGPresets*
|
||||
SWGPresets::fromJson(QString json) {
|
||||
SWGPresets::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
@ -65,7 +68,7 @@ SWGPresets::fromJson(QString json) {
|
||||
}
|
||||
|
||||
void
|
||||
SWGPresets::fromJsonObject(QJsonObject pJson) {
|
||||
SWGPresets::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&nb_groups, pJson["nbGroups"], "qint32", "");
|
||||
|
||||
|
||||
@ -75,17 +78,19 @@ SWGPresets::fromJsonObject(QJsonObject pJson) {
|
||||
QString
|
||||
SWGPresets::asJson ()
|
||||
{
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
QJsonObject*
|
||||
SWGPresets::asJsonObject() {
|
||||
QJsonObject obj;
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(m_nb_groups_isSet){
|
||||
obj.insert("nbGroups", QJsonValue(nb_groups));
|
||||
obj->insert("nbGroups", QJsonValue(nb_groups));
|
||||
}
|
||||
if(groups->size() > 0){
|
||||
toJsonArray((QList<void*>*)groups, obj, "groups", "SWGPresetGroup");
|
||||
|
@ -32,15 +32,15 @@ namespace SWGSDRangel {
|
||||
class SWGPresets: public SWGObject {
|
||||
public:
|
||||
SWGPresets();
|
||||
SWGPresets(QString json);
|
||||
~SWGPresets();
|
||||
SWGPresets(QString* json);
|
||||
virtual ~SWGPresets();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject asJsonObject();
|
||||
void fromJsonObject(QJsonObject json);
|
||||
SWGPresets* fromJson(QString jsonString);
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGPresets* fromJson(QString &jsonString);
|
||||
|
||||
qint32 getNbGroups();
|
||||
void setNbGroups(qint32 nb_groups);
|
||||
|
@ -22,13 +22,40 @@
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGRtlSdrSettings::SWGRtlSdrSettings(QString json) {
|
||||
SWGRtlSdrSettings::SWGRtlSdrSettings(QString* json) {
|
||||
init();
|
||||
this->fromJson(json);
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGRtlSdrSettings::SWGRtlSdrSettings() {
|
||||
init();
|
||||
dev_sample_rate = 0;
|
||||
m_dev_sample_rate_isSet = false;
|
||||
low_sample_rate = 0;
|
||||
m_low_sample_rate_isSet = false;
|
||||
center_frequency = 0L;
|
||||
m_center_frequency_isSet = false;
|
||||
gain = 0;
|
||||
m_gain_isSet = false;
|
||||
lo_ppm_correction = 0;
|
||||
m_lo_ppm_correction_isSet = false;
|
||||
log2_decim = 0;
|
||||
m_log2_decim_isSet = false;
|
||||
fc_pos = 0;
|
||||
m_fc_pos_isSet = false;
|
||||
dc_block = 0;
|
||||
m_dc_block_isSet = false;
|
||||
iq_imbalance = 0;
|
||||
m_iq_imbalance_isSet = false;
|
||||
agc = 0;
|
||||
m_agc_isSet = false;
|
||||
no_mod_mode = 0;
|
||||
m_no_mod_mode_isSet = false;
|
||||
transverter_mode = 0;
|
||||
m_transverter_mode_isSet = false;
|
||||
transverter_delta_frequency = 0L;
|
||||
m_transverter_delta_frequency_isSet = false;
|
||||
rf_bandwidth = 0;
|
||||
m_rf_bandwidth_isSet = false;
|
||||
}
|
||||
|
||||
SWGRtlSdrSettings::~SWGRtlSdrSettings() {
|
||||
@ -86,7 +113,7 @@ SWGRtlSdrSettings::cleanup() {
|
||||
}
|
||||
|
||||
SWGRtlSdrSettings*
|
||||
SWGRtlSdrSettings::fromJson(QString json) {
|
||||
SWGRtlSdrSettings::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
@ -95,7 +122,7 @@ SWGRtlSdrSettings::fromJson(QString json) {
|
||||
}
|
||||
|
||||
void
|
||||
SWGRtlSdrSettings::fromJsonObject(QJsonObject pJson) {
|
||||
SWGRtlSdrSettings::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&dev_sample_rate, pJson["devSampleRate"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&low_sample_rate, pJson["lowSampleRate"], "qint32", "");
|
||||
@ -129,56 +156,58 @@ SWGRtlSdrSettings::fromJsonObject(QJsonObject pJson) {
|
||||
QString
|
||||
SWGRtlSdrSettings::asJson ()
|
||||
{
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
QJsonObject*
|
||||
SWGRtlSdrSettings::asJsonObject() {
|
||||
QJsonObject obj;
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(m_dev_sample_rate_isSet){
|
||||
obj.insert("devSampleRate", QJsonValue(dev_sample_rate));
|
||||
obj->insert("devSampleRate", QJsonValue(dev_sample_rate));
|
||||
}
|
||||
if(m_low_sample_rate_isSet){
|
||||
obj.insert("lowSampleRate", QJsonValue(low_sample_rate));
|
||||
obj->insert("lowSampleRate", QJsonValue(low_sample_rate));
|
||||
}
|
||||
if(m_center_frequency_isSet){
|
||||
obj.insert("centerFrequency", QJsonValue(center_frequency));
|
||||
obj->insert("centerFrequency", QJsonValue(center_frequency));
|
||||
}
|
||||
if(m_gain_isSet){
|
||||
obj.insert("gain", QJsonValue(gain));
|
||||
obj->insert("gain", QJsonValue(gain));
|
||||
}
|
||||
if(m_lo_ppm_correction_isSet){
|
||||
obj.insert("loPpmCorrection", QJsonValue(lo_ppm_correction));
|
||||
obj->insert("loPpmCorrection", QJsonValue(lo_ppm_correction));
|
||||
}
|
||||
if(m_log2_decim_isSet){
|
||||
obj.insert("log2Decim", QJsonValue(log2_decim));
|
||||
obj->insert("log2Decim", QJsonValue(log2_decim));
|
||||
}
|
||||
if(m_fc_pos_isSet){
|
||||
obj.insert("fcPos", QJsonValue(fc_pos));
|
||||
obj->insert("fcPos", QJsonValue(fc_pos));
|
||||
}
|
||||
if(m_dc_block_isSet){
|
||||
obj.insert("dcBlock", QJsonValue(dc_block));
|
||||
obj->insert("dcBlock", QJsonValue(dc_block));
|
||||
}
|
||||
if(m_iq_imbalance_isSet){
|
||||
obj.insert("iqImbalance", QJsonValue(iq_imbalance));
|
||||
obj->insert("iqImbalance", QJsonValue(iq_imbalance));
|
||||
}
|
||||
if(m_agc_isSet){
|
||||
obj.insert("agc", QJsonValue(agc));
|
||||
obj->insert("agc", QJsonValue(agc));
|
||||
}
|
||||
if(m_no_mod_mode_isSet){
|
||||
obj.insert("noModMode", QJsonValue(no_mod_mode));
|
||||
obj->insert("noModMode", QJsonValue(no_mod_mode));
|
||||
}
|
||||
if(m_transverter_mode_isSet){
|
||||
obj.insert("transverterMode", QJsonValue(transverter_mode));
|
||||
obj->insert("transverterMode", QJsonValue(transverter_mode));
|
||||
}
|
||||
if(m_transverter_delta_frequency_isSet){
|
||||
obj.insert("transverterDeltaFrequency", QJsonValue(transverter_delta_frequency));
|
||||
obj->insert("transverterDeltaFrequency", QJsonValue(transverter_delta_frequency));
|
||||
}
|
||||
if(m_rf_bandwidth_isSet){
|
||||
obj.insert("rfBandwidth", QJsonValue(rf_bandwidth));
|
||||
obj->insert("rfBandwidth", QJsonValue(rf_bandwidth));
|
||||
}
|
||||
|
||||
return obj;
|
||||
|
@ -30,15 +30,15 @@ namespace SWGSDRangel {
|
||||
class SWGRtlSdrSettings: public SWGObject {
|
||||
public:
|
||||
SWGRtlSdrSettings();
|
||||
SWGRtlSdrSettings(QString json);
|
||||
~SWGRtlSdrSettings();
|
||||
SWGRtlSdrSettings(QString* json);
|
||||
virtual ~SWGRtlSdrSettings();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject asJsonObject();
|
||||
void fromJsonObject(QJsonObject json);
|
||||
SWGRtlSdrSettings* fromJson(QString jsonString);
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGRtlSdrSettings* fromJson(QString &jsonString);
|
||||
|
||||
qint32 getDevSampleRate();
|
||||
void setDevSampleRate(qint32 dev_sample_rate);
|
||||
|
@ -22,13 +22,32 @@
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGSamplingDevice::SWGSamplingDevice(QString json) {
|
||||
SWGSamplingDevice::SWGSamplingDevice(QString* json) {
|
||||
init();
|
||||
this->fromJson(json);
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGSamplingDevice::SWGSamplingDevice() {
|
||||
init();
|
||||
index = 0;
|
||||
m_index_isSet = false;
|
||||
hw_type = nullptr;
|
||||
m_hw_type_isSet = false;
|
||||
tx = 0;
|
||||
m_tx_isSet = false;
|
||||
nb_streams = 0;
|
||||
m_nb_streams_isSet = false;
|
||||
stream_index = 0;
|
||||
m_stream_index_isSet = false;
|
||||
sequence = 0;
|
||||
m_sequence_isSet = false;
|
||||
serial = nullptr;
|
||||
m_serial_isSet = false;
|
||||
center_frequency = 0L;
|
||||
m_center_frequency_isSet = false;
|
||||
bandwidth = 0;
|
||||
m_bandwidth_isSet = false;
|
||||
state = nullptr;
|
||||
m_state_isSet = false;
|
||||
}
|
||||
|
||||
SWGSamplingDevice::~SWGSamplingDevice() {
|
||||
@ -80,7 +99,7 @@ SWGSamplingDevice::cleanup() {
|
||||
}
|
||||
|
||||
SWGSamplingDevice*
|
||||
SWGSamplingDevice::fromJson(QString json) {
|
||||
SWGSamplingDevice::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
@ -89,7 +108,7 @@ SWGSamplingDevice::fromJson(QString json) {
|
||||
}
|
||||
|
||||
void
|
||||
SWGSamplingDevice::fromJsonObject(QJsonObject pJson) {
|
||||
SWGSamplingDevice::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&index, pJson["index"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&hw_type, pJson["hwType"], "QString", "QString");
|
||||
@ -115,41 +134,43 @@ SWGSamplingDevice::fromJsonObject(QJsonObject pJson) {
|
||||
QString
|
||||
SWGSamplingDevice::asJson ()
|
||||
{
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
QJsonObject*
|
||||
SWGSamplingDevice::asJsonObject() {
|
||||
QJsonObject obj;
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(m_index_isSet){
|
||||
obj.insert("index", QJsonValue(index));
|
||||
obj->insert("index", QJsonValue(index));
|
||||
}
|
||||
if(hw_type != nullptr && *hw_type != QString("")){
|
||||
toJsonValue(QString("hwType"), hw_type, obj, QString("QString"));
|
||||
}
|
||||
if(m_tx_isSet){
|
||||
obj.insert("tx", QJsonValue(tx));
|
||||
obj->insert("tx", QJsonValue(tx));
|
||||
}
|
||||
if(m_nb_streams_isSet){
|
||||
obj.insert("nbStreams", QJsonValue(nb_streams));
|
||||
obj->insert("nbStreams", QJsonValue(nb_streams));
|
||||
}
|
||||
if(m_stream_index_isSet){
|
||||
obj.insert("streamIndex", QJsonValue(stream_index));
|
||||
obj->insert("streamIndex", QJsonValue(stream_index));
|
||||
}
|
||||
if(m_sequence_isSet){
|
||||
obj.insert("sequence", QJsonValue(sequence));
|
||||
obj->insert("sequence", QJsonValue(sequence));
|
||||
}
|
||||
if(serial != nullptr && *serial != QString("")){
|
||||
toJsonValue(QString("serial"), serial, obj, QString("QString"));
|
||||
}
|
||||
if(m_center_frequency_isSet){
|
||||
obj.insert("centerFrequency", QJsonValue(center_frequency));
|
||||
obj->insert("centerFrequency", QJsonValue(center_frequency));
|
||||
}
|
||||
if(m_bandwidth_isSet){
|
||||
obj.insert("bandwidth", QJsonValue(bandwidth));
|
||||
obj->insert("bandwidth", QJsonValue(bandwidth));
|
||||
}
|
||||
if(state != nullptr && *state != QString("")){
|
||||
toJsonValue(QString("state"), state, obj, QString("QString"));
|
||||
|
@ -31,15 +31,15 @@ namespace SWGSDRangel {
|
||||
class SWGSamplingDevice: public SWGObject {
|
||||
public:
|
||||
SWGSamplingDevice();
|
||||
SWGSamplingDevice(QString json);
|
||||
~SWGSamplingDevice();
|
||||
SWGSamplingDevice(QString* json);
|
||||
virtual ~SWGSamplingDevice();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject asJsonObject();
|
||||
void fromJsonObject(QJsonObject json);
|
||||
SWGSamplingDevice* fromJson(QString jsonString);
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGSamplingDevice* fromJson(QString &jsonString);
|
||||
|
||||
qint32 getIndex();
|
||||
void setIndex(qint32 index);
|
||||
|
@ -22,13 +22,14 @@
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGSuccessResponse::SWGSuccessResponse(QString json) {
|
||||
SWGSuccessResponse::SWGSuccessResponse(QString* json) {
|
||||
init();
|
||||
this->fromJson(json);
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGSuccessResponse::SWGSuccessResponse() {
|
||||
init();
|
||||
message = nullptr;
|
||||
m_message_isSet = false;
|
||||
}
|
||||
|
||||
SWGSuccessResponse::~SWGSuccessResponse() {
|
||||
@ -49,7 +50,7 @@ SWGSuccessResponse::cleanup() {
|
||||
}
|
||||
|
||||
SWGSuccessResponse*
|
||||
SWGSuccessResponse::fromJson(QString json) {
|
||||
SWGSuccessResponse::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
@ -58,7 +59,7 @@ SWGSuccessResponse::fromJson(QString json) {
|
||||
}
|
||||
|
||||
void
|
||||
SWGSuccessResponse::fromJsonObject(QJsonObject pJson) {
|
||||
SWGSuccessResponse::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&message, pJson["message"], "QString", "QString");
|
||||
|
||||
}
|
||||
@ -66,15 +67,17 @@ SWGSuccessResponse::fromJsonObject(QJsonObject pJson) {
|
||||
QString
|
||||
SWGSuccessResponse::asJson ()
|
||||
{
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
QJsonObject*
|
||||
SWGSuccessResponse::asJsonObject() {
|
||||
QJsonObject obj;
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(message != nullptr && *message != QString("")){
|
||||
toJsonValue(QString("message"), message, obj, QString("QString"));
|
||||
}
|
||||
|
@ -31,15 +31,15 @@ namespace SWGSDRangel {
|
||||
class SWGSuccessResponse: public SWGObject {
|
||||
public:
|
||||
SWGSuccessResponse();
|
||||
SWGSuccessResponse(QString json);
|
||||
~SWGSuccessResponse();
|
||||
SWGSuccessResponse(QString* json);
|
||||
virtual ~SWGSuccessResponse();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject asJsonObject();
|
||||
void fromJsonObject(QJsonObject json);
|
||||
SWGSuccessResponse* fromJson(QString jsonString);
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGSuccessResponse* fromJson(QString &jsonString);
|
||||
|
||||
QString* getMessage();
|
||||
void setMessage(QString* message);
|
||||
|
Loading…
x
Reference in New Issue
Block a user