Web API: changed namespace and some namings

This commit is contained in:
f4exb 2017-12-02 05:45:30 +01:00
parent 384aa242cb
commit 8d3541c5ad
70 changed files with 3106 additions and 2967 deletions

File diff suppressed because it is too large Load Diff

View File

@ -22,7 +22,7 @@
#include <QString>
#include <regex>
namespace Swagger
namespace SWGSDRangel
{
class SWGInstanceSummaryResponse;
class SWGInstanceDevicesResponse;
@ -51,8 +51,8 @@ public:
* returns the Http status code (default 501: not implemented)
*/
virtual int instanceSummary(
Swagger::SWGInstanceSummaryResponse& response __attribute__((unused)),
Swagger::SWGErrorResponse& error __attribute__((unused)))
SWGSDRangel::SWGInstanceSummaryResponse& response __attribute__((unused)),
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
{ return 501; }
/**
@ -61,8 +61,8 @@ public:
*/
virtual int instanceDevices(
bool tx __attribute__((unused)),
Swagger::SWGInstanceDevicesResponse& response __attribute__((unused)),
Swagger::SWGErrorResponse& error __attribute__((unused)))
SWGSDRangel::SWGInstanceDevicesResponse& response __attribute__((unused)),
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
{ return 501; }
/**
@ -71,8 +71,8 @@ public:
*/
virtual int instanceChannels(
bool tx __attribute__((unused)),
Swagger::SWGInstanceChannelsResponse& response __attribute__((unused)),
Swagger::SWGErrorResponse& error __attribute__((unused)))
SWGSDRangel::SWGInstanceChannelsResponse& response __attribute__((unused)),
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
{ return 501; }
/**
@ -80,8 +80,8 @@ public:
* returns the Http status code (default 501: not implemented)
*/
virtual int instanceLoggingGet(
Swagger::SWGLoggingInfo& response __attribute__((unused)),
Swagger::SWGErrorResponse& error __attribute__((unused)))
SWGSDRangel::SWGLoggingInfo& response __attribute__((unused)),
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
{ return 501; }
/**
@ -89,8 +89,8 @@ public:
* returns the Http status code (default 501: not implemented)
*/
virtual int instanceLoggingPut(
Swagger::SWGLoggingInfo& response __attribute__((unused)),
Swagger::SWGErrorResponse& error __attribute__((unused)))
SWGSDRangel::SWGLoggingInfo& response __attribute__((unused)),
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
{ return 501; }
/**
@ -98,8 +98,8 @@ public:
* returns the Http status code (default 501: not implemented)
*/
virtual int instanceAudioGet(
Swagger::SWGAudioDevices& response __attribute__((unused)),
Swagger::SWGErrorResponse& error __attribute__((unused)))
SWGSDRangel::SWGAudioDevices& response __attribute__((unused)),
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
{ return 501; }
/**
@ -107,8 +107,8 @@ public:
* returns the Http status code (default 501: not implemented)
*/
virtual int instanceAudioPatch(
Swagger::SWGAudioDevicesSelect& response __attribute__((unused)),
Swagger::SWGErrorResponse& error __attribute__((unused)))
SWGSDRangel::SWGAudioDevicesSelect& response __attribute__((unused)),
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
{ return 501; }
/**
@ -116,8 +116,8 @@ public:
* returns the Http status code (default 501: not implemented)
*/
virtual int instanceLocationGet(
Swagger::SWGLocationInformation& response __attribute__((unused)),
Swagger::SWGErrorResponse& error __attribute__((unused)))
SWGSDRangel::SWGLocationInformation& response __attribute__((unused)),
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
{ return 501; }
/**
@ -125,8 +125,8 @@ public:
* returns the Http status code (default 501: not implemented)
*/
virtual int instanceLocationPut(
Swagger::SWGLocationInformation& response __attribute__((unused)),
Swagger::SWGErrorResponse& error __attribute__((unused)))
SWGSDRangel::SWGLocationInformation& response __attribute__((unused)),
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
{ return 501; }
/**
@ -135,8 +135,8 @@ public:
*/
virtual int instanceDVSerialPatch(
bool dvserial __attribute__((unused)),
Swagger::SWGDVSeralDevices& response __attribute__((unused)),
Swagger::SWGErrorResponse& error __attribute__((unused)))
SWGSDRangel::SWGDVSeralDevices& response __attribute__((unused)),
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
{ return 501; }
/**
@ -144,8 +144,8 @@ public:
* returns the Http status code (default 501: not implemented)
*/
virtual int instancePresetGet(
Swagger::SWGPresets& response __attribute__((unused)),
Swagger::SWGErrorResponse& error __attribute__((unused)))
SWGSDRangel::SWGPresets& response __attribute__((unused)),
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
{ return 501; }
/**
@ -153,9 +153,9 @@ public:
* returns the Http status code (default 501: not implemented)
*/
virtual int instancePresetPatch(
Swagger::SWGPresetTransfer& query __attribute__((unused)),
Swagger::SWGPresetIdentifier& response __attribute__((unused)),
Swagger::SWGErrorResponse& error __attribute__((unused)))
SWGSDRangel::SWGPresetTransfer& query __attribute__((unused)),
SWGSDRangel::SWGPresetIdentifier& response __attribute__((unused)),
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
{ return 501; }
/**
@ -163,9 +163,9 @@ public:
* returns the Http status code (default 501: not implemented)
*/
virtual int instancePresetPut(
Swagger::SWGPresetTransfer& query __attribute__((unused)),
Swagger::SWGPresetIdentifier& response __attribute__((unused)),
Swagger::SWGErrorResponse& error __attribute__((unused)))
SWGSDRangel::SWGPresetTransfer& query __attribute__((unused)),
SWGSDRangel::SWGPresetIdentifier& response __attribute__((unused)),
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
{ return 501; }
/**
@ -173,9 +173,9 @@ public:
* returns the Http status code (default 501: not implemented)
*/
virtual int instancePresetPost(
Swagger::SWGPresetTransfer& query __attribute__((unused)),
Swagger::SWGPresetIdentifier& response __attribute__((unused)),
Swagger::SWGErrorResponse& error __attribute__((unused)))
SWGSDRangel::SWGPresetTransfer& query __attribute__((unused)),
SWGSDRangel::SWGPresetIdentifier& response __attribute__((unused)),
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
{ return 501; }
/**
@ -183,8 +183,8 @@ public:
* returns the Http status code (default 501: not implemented)
*/
virtual int instancePresetDelete(
Swagger::SWGPresetIdentifier& response __attribute__((unused)),
Swagger::SWGErrorResponse& error __attribute__((unused)))
SWGSDRangel::SWGPresetIdentifier& response __attribute__((unused)),
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
{ return 501; }
/**
@ -192,8 +192,8 @@ public:
* returns the Http status code (default 501: not implemented)
*/
virtual int instanceDeviceSetsGet(
Swagger::SWGDeviceSetList& response __attribute__((unused)),
Swagger::SWGErrorResponse& error __attribute__((unused)))
SWGSDRangel::SWGDeviceSetList& response __attribute__((unused)),
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
{ return 501; }
/**
@ -202,8 +202,8 @@ public:
*/
virtual int instanceDeviceSetsPost(
bool tx __attribute__((unused)),
Swagger::SWGDeviceSet& response __attribute__((unused)),
Swagger::SWGErrorResponse& error __attribute__((unused)))
SWGSDRangel::SWGDeviceSet& response __attribute__((unused)),
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
{ return 501; }
/**
@ -211,8 +211,8 @@ public:
* returns the Http status code (default 501: not implemented)
*/
virtual int instanceDeviceSetsDelete(
Swagger::SWGDeviceSetList& response __attribute__((unused)),
Swagger::SWGErrorResponse& error __attribute__((unused)))
SWGSDRangel::SWGDeviceSetList& response __attribute__((unused)),
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
{ return 501; }
/**
@ -221,8 +221,8 @@ public:
*/
virtual int devicesetGet(
int deviceSetIndex __attribute__((unused)),
Swagger::SWGDeviceSet& response __attribute__((unused)),
Swagger::SWGErrorResponse& error __attribute__((unused)))
SWGSDRangel::SWGDeviceSet& response __attribute__((unused)),
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
{ return 501; }
/**
@ -231,8 +231,8 @@ public:
*/
virtual int devicesetDevicePut(
int deviceSetIndex __attribute__((unused)),
Swagger::SWGDeviceListItem& response __attribute__((unused)),
Swagger::SWGErrorResponse& error __attribute__((unused)))
SWGSDRangel::SWGDeviceListItem& response __attribute__((unused)),
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
{ return 501; }
static QString instanceSummaryURL;

View File

@ -109,8 +109,8 @@ void WebAPIRequestMapper::instanceSummaryService(qtwebapp::HttpRequest& request,
{
if (request.getMethod() == "GET")
{
Swagger::SWGInstanceSummaryResponse normalResponse;
Swagger::SWGErrorResponse errorResponse;
SWGSDRangel::SWGInstanceSummaryResponse normalResponse;
SWGSDRangel::SWGErrorResponse errorResponse;
int status = m_adapter->instanceSummary(normalResponse, errorResponse);
response.setStatus(status);
@ -130,8 +130,8 @@ void WebAPIRequestMapper::instanceSummaryService(qtwebapp::HttpRequest& request,
void WebAPIRequestMapper::instanceDevicesService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response)
{
Swagger::SWGInstanceDevicesResponse normalResponse;
Swagger::SWGErrorResponse errorResponse;
SWGSDRangel::SWGInstanceDevicesResponse normalResponse;
SWGSDRangel::SWGErrorResponse errorResponse;
if (request.getMethod() == "GET")
{
@ -160,8 +160,8 @@ void WebAPIRequestMapper::instanceDevicesService(qtwebapp::HttpRequest& request,
void WebAPIRequestMapper::instanceChannelsService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response)
{
Swagger::SWGInstanceChannelsResponse normalResponse;
Swagger::SWGErrorResponse errorResponse;
SWGSDRangel::SWGInstanceChannelsResponse normalResponse;
SWGSDRangel::SWGErrorResponse errorResponse;
if (request.getMethod() == "GET")
{
@ -190,8 +190,8 @@ void WebAPIRequestMapper::instanceChannelsService(qtwebapp::HttpRequest& request
void WebAPIRequestMapper::instanceLoggingService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response)
{
Swagger::SWGLoggingInfo normalResponse;
Swagger::SWGErrorResponse errorResponse;
SWGSDRangel::SWGLoggingInfo normalResponse;
SWGSDRangel::SWGErrorResponse errorResponse;
if (request.getMethod() == "GET")
{
@ -230,11 +230,11 @@ void WebAPIRequestMapper::instanceLoggingService(qtwebapp::HttpRequest& request,
void WebAPIRequestMapper::instanceAudioService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response)
{
Swagger::SWGErrorResponse errorResponse;
SWGSDRangel::SWGErrorResponse errorResponse;
if (request.getMethod() == "GET")
{
Swagger::SWGAudioDevices normalResponse;
SWGSDRangel::SWGAudioDevices normalResponse;
int status = m_adapter->instanceAudioGet(normalResponse, errorResponse);
response.setStatus(status);
@ -247,7 +247,7 @@ void WebAPIRequestMapper::instanceAudioService(qtwebapp::HttpRequest& request, q
}
else if (request.getMethod() == "PATCH")
{
Swagger::SWGAudioDevicesSelect normalResponse;
SWGSDRangel::SWGAudioDevicesSelect normalResponse;
QString jsonStr = request.getBody();
if (parseJsonBody(jsonStr, response))
@ -272,11 +272,11 @@ void WebAPIRequestMapper::instanceAudioService(qtwebapp::HttpRequest& request, q
void WebAPIRequestMapper::instanceLocationService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response)
{
Swagger::SWGErrorResponse errorResponse;
SWGSDRangel::SWGErrorResponse errorResponse;
if (request.getMethod() == "GET")
{
Swagger::SWGLocationInformation normalResponse;
SWGSDRangel::SWGLocationInformation normalResponse;
int status = m_adapter->instanceLocationGet(normalResponse, errorResponse);
response.setStatus(status);
@ -289,7 +289,7 @@ void WebAPIRequestMapper::instanceLocationService(qtwebapp::HttpRequest& request
}
else if (request.getMethod() == "PUT")
{
Swagger::SWGLocationInformation normalResponse;
SWGSDRangel::SWGLocationInformation normalResponse;
QString jsonStr = request.getBody();
if (parseJsonBody(jsonStr, response))
@ -314,7 +314,7 @@ void WebAPIRequestMapper::instanceLocationService(qtwebapp::HttpRequest& request
void WebAPIRequestMapper::instanceDVSerialService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response)
{
Swagger::SWGErrorResponse errorResponse;
SWGSDRangel::SWGErrorResponse errorResponse;
if (request.getMethod() == "PATCH")
{
@ -325,7 +325,7 @@ void WebAPIRequestMapper::instanceDVSerialService(qtwebapp::HttpRequest& request
dvserial = !(dvserialStr == "0");
}
Swagger::SWGDVSeralDevices normalResponse;
SWGSDRangel::SWGDVSeralDevices normalResponse;
int status = m_adapter->instanceDVSerialPatch(dvserial, normalResponse, errorResponse);
response.setStatus(status);
@ -345,11 +345,11 @@ void WebAPIRequestMapper::instanceDVSerialService(qtwebapp::HttpRequest& request
void WebAPIRequestMapper::instancePresetService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response)
{
Swagger::SWGErrorResponse errorResponse;
SWGSDRangel::SWGErrorResponse errorResponse;
if (request.getMethod() == "GET")
{
Swagger::SWGPresets normalResponse;
SWGSDRangel::SWGPresets normalResponse;
int status = m_adapter->instancePresetGet(normalResponse, errorResponse);
response.setStatus(status);
@ -361,8 +361,8 @@ void WebAPIRequestMapper::instancePresetService(qtwebapp::HttpRequest& request,
}
else if (request.getMethod() == "PATCH")
{
Swagger::SWGPresetTransfer query;
Swagger::SWGPresetIdentifier normalResponse;
SWGSDRangel::SWGPresetTransfer query;
SWGSDRangel::SWGPresetIdentifier normalResponse;
QString jsonStr = request.getBody();
if (parseJsonBody(jsonStr, response))
@ -391,8 +391,8 @@ void WebAPIRequestMapper::instancePresetService(qtwebapp::HttpRequest& request,
}
else if (request.getMethod() == "PUT")
{
Swagger::SWGPresetTransfer query;
Swagger::SWGPresetIdentifier normalResponse;
SWGSDRangel::SWGPresetTransfer query;
SWGSDRangel::SWGPresetIdentifier normalResponse;
QString jsonStr = request.getBody();
if (parseJsonBody(jsonStr, response))
@ -421,8 +421,8 @@ void WebAPIRequestMapper::instancePresetService(qtwebapp::HttpRequest& request,
}
else if (request.getMethod() == "POST")
{
Swagger::SWGPresetTransfer query;
Swagger::SWGPresetIdentifier normalResponse;
SWGSDRangel::SWGPresetTransfer query;
SWGSDRangel::SWGPresetIdentifier normalResponse;
QString jsonStr = request.getBody();
if (parseJsonBody(jsonStr, response))
@ -451,7 +451,7 @@ void WebAPIRequestMapper::instancePresetService(qtwebapp::HttpRequest& request,
}
else if (request.getMethod() == "DELETE")
{
Swagger::SWGPresetIdentifier normalResponse;
SWGSDRangel::SWGPresetIdentifier normalResponse;
QString jsonStr = request.getBody();
if (parseJsonBody(jsonStr, response))
@ -487,11 +487,11 @@ void WebAPIRequestMapper::instancePresetService(qtwebapp::HttpRequest& request,
void WebAPIRequestMapper::instanceDeviceSetsService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response)
{
Swagger::SWGErrorResponse errorResponse;
SWGSDRangel::SWGErrorResponse errorResponse;
if (request.getMethod() == "GET")
{
Swagger::SWGDeviceSetList normalResponse;
SWGSDRangel::SWGDeviceSetList normalResponse;
int status = m_adapter->instanceDeviceSetsGet(normalResponse, errorResponse);
response.setStatus(status);
@ -503,7 +503,7 @@ void WebAPIRequestMapper::instanceDeviceSetsService(qtwebapp::HttpRequest& reque
}
else if (request.getMethod() == "POST")
{
Swagger::SWGDeviceSet normalResponse;
SWGSDRangel::SWGDeviceSet normalResponse;
QByteArray txStr = request.getParameter("tx");
bool tx = false;
@ -522,7 +522,7 @@ void WebAPIRequestMapper::instanceDeviceSetsService(qtwebapp::HttpRequest& reque
}
else if (request.getMethod() == "DELETE")
{
Swagger::SWGDeviceSetList normalResponse;
SWGSDRangel::SWGDeviceSetList normalResponse;
int status = m_adapter->instanceDeviceSetsDelete(normalResponse, errorResponse);
response.setStatus(status);
@ -541,13 +541,13 @@ void WebAPIRequestMapper::instanceDeviceSetsService(qtwebapp::HttpRequest& reque
void WebAPIRequestMapper::deviceset(const std::string& indexStr, qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response)
{
Swagger::SWGErrorResponse errorResponse;
SWGSDRangel::SWGErrorResponse errorResponse;
if (request.getMethod() == "GET")
{
try
{
Swagger::SWGDeviceSet normalResponse;
SWGSDRangel::SWGDeviceSet normalResponse;
int deviceSetIndex = boost::lexical_cast<int>(indexStr);
int status = m_adapter->devicesetGet(deviceSetIndex, normalResponse, errorResponse);
response.setStatus(status);
@ -575,7 +575,7 @@ void WebAPIRequestMapper::deviceset(const std::string& indexStr, qtwebapp::HttpR
void WebAPIRequestMapper::devicesetDevice(const std::string& indexStr, qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response)
{
Swagger::SWGErrorResponse errorResponse;
SWGSDRangel::SWGErrorResponse errorResponse;
try
{
@ -583,7 +583,7 @@ void WebAPIRequestMapper::devicesetDevice(const std::string& indexStr, qtwebapp:
if (request.getMethod() == "PUT")
{
Swagger::SWGDeviceListItem normalResponse;
SWGSDRangel::SWGDeviceListItem normalResponse;
QString jsonStr = request.getBody();
if (parseJsonBody(jsonStr, response))
@ -617,7 +617,7 @@ void WebAPIRequestMapper::devicesetDevice(const std::string& indexStr, qtwebapp:
bool WebAPIRequestMapper::parseJsonBody(QString& jsonStr, qtwebapp::HttpResponse& response)
{
Swagger::SWGErrorResponse errorResponse;
SWGSDRangel::SWGErrorResponse errorResponse;
try
{
@ -648,9 +648,9 @@ bool WebAPIRequestMapper::parseJsonBody(QString& jsonStr, qtwebapp::HttpResponse
}
}
bool WebAPIRequestMapper::validatePresetTransfer(Swagger::SWGPresetTransfer& presetTransfer)
bool WebAPIRequestMapper::validatePresetTransfer(SWGSDRangel::SWGPresetTransfer& presetTransfer)
{
Swagger::SWGPresetIdentifier *presetIdentifier = presetTransfer.getPreset();
SWGSDRangel::SWGPresetIdentifier *presetIdentifier = presetTransfer.getPreset();
if (presetIdentifier == 0) {
return false;
@ -659,7 +659,7 @@ bool WebAPIRequestMapper::validatePresetTransfer(Swagger::SWGPresetTransfer& pre
return validatePresetIdentifer(*presetIdentifier);
}
bool WebAPIRequestMapper::validatePresetIdentifer(Swagger::SWGPresetIdentifier& presetIdentifier)
bool WebAPIRequestMapper::validatePresetIdentifer(SWGSDRangel::SWGPresetIdentifier& presetIdentifier)
{
return (presetIdentifier.getGroupName() && presetIdentifier.getName() && presetIdentifier.getType());
}

View File

@ -27,7 +27,7 @@
#include "staticfilecontroller.h"
#include "webapiadapterinterface.h"
namespace Swagger
namespace SWGSDRangel
{
class SWGPresetTransfer;
class SWGPresetIdentifier;
@ -58,8 +58,8 @@ private:
void deviceset(const std::string& indexStr, qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response);
void devicesetDevice(const std::string& indexStr, qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response);
bool validatePresetTransfer(Swagger::SWGPresetTransfer& presetTransfer);
bool validatePresetIdentifer(Swagger::SWGPresetIdentifier& presetIdentifier);
bool validatePresetTransfer(SWGSDRangel::SWGPresetTransfer& presetTransfer);
bool validatePresetIdentifer(SWGSDRangel::SWGPresetIdentifier& presetIdentifier);
bool parseJsonBody(QString& jsonStr, qtwebapp::HttpResponse& response);
};

View File

@ -64,13 +64,13 @@ WebAPIAdapterGUI::~WebAPIAdapterGUI()
}
int WebAPIAdapterGUI::instanceSummary(
Swagger::SWGInstanceSummaryResponse& response,
Swagger::SWGErrorResponse& error __attribute__((unused)))
SWGSDRangel::SWGInstanceSummaryResponse& response,
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
{
*response.getVersion() = qApp->applicationVersion();
Swagger::SWGLoggingInfo *logging = response.getLogging();
SWGSDRangel::SWGLoggingInfo *logging = response.getLogging();
logging->init();
logging->setDumpToFile(m_mainWindow.m_logger->getUseFileLogger() ? 1 : 0);
@ -81,7 +81,7 @@ int WebAPIAdapterGUI::instanceSummary(
m_mainWindow.m_logger->getConsoleMinMessageLevelStr(*logging->getConsoleLevel());
Swagger::SWGDeviceSetList *deviceSetList = response.getDevicesetlist();
SWGSDRangel::SWGDeviceSetList *deviceSetList = response.getDevicesetlist();
getDeviceSetList(deviceSetList);
return 200;
@ -89,17 +89,17 @@ int WebAPIAdapterGUI::instanceSummary(
int WebAPIAdapterGUI::instanceDevices(
bool tx,
Swagger::SWGInstanceDevicesResponse& response,
Swagger::SWGErrorResponse& error __attribute__((unused)))
SWGSDRangel::SWGInstanceDevicesResponse& response,
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
{
int nbSamplingDevices = tx ? DeviceEnumerator::instance()->getNbTxSamplingDevices() : DeviceEnumerator::instance()->getNbRxSamplingDevices();
response.setDevicecount(nbSamplingDevices);
QList<Swagger::SWGDeviceListItem*> *devices = response.getDevices();
QList<SWGSDRangel::SWGDeviceListItem*> *devices = response.getDevices();
for (int i = 0; i < nbSamplingDevices; i++)
{
PluginInterface::SamplingDevice samplingDevice = tx ? DeviceEnumerator::instance()->getTxSamplingDevice(i) : DeviceEnumerator::instance()->getRxSamplingDevice(i);
devices->append(new Swagger::SWGDeviceListItem);
devices->append(new SWGSDRangel::SWGDeviceListItem);
*devices->back()->getDisplayedName() = samplingDevice.displayedName;
*devices->back()->getHwType() = samplingDevice.hardwareId;
*devices->back()->getSerial() = samplingDevice.serial;
@ -115,17 +115,17 @@ int WebAPIAdapterGUI::instanceDevices(
int WebAPIAdapterGUI::instanceChannels(
bool tx,
Swagger::SWGInstanceChannelsResponse& response,
Swagger::SWGErrorResponse& error __attribute__((unused)))
SWGSDRangel::SWGInstanceChannelsResponse& response,
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
{
PluginAPI::ChannelRegistrations *channelRegistrations = tx ? m_mainWindow.m_pluginManager->getTxChannelRegistrations() : m_mainWindow.m_pluginManager->getRxChannelRegistrations();
int nbChannelDevices = channelRegistrations->size();
response.setChannelcount(nbChannelDevices);
QList<Swagger::SWGChannelListItem*> *channels = response.getChannels();
QList<SWGSDRangel::SWGChannelListItem*> *channels = response.getChannels();
for (int i = 0; i < nbChannelDevices; i++)
{
channels->append(new Swagger::SWGChannelListItem);
channels->append(new SWGSDRangel::SWGChannelListItem);
PluginInterface *channelInterface = channelRegistrations->at(i).m_plugin;
const PluginDescriptor& pluginDescriptor = channelInterface->getPluginDescriptor();
*channels->back()->getVersion() = pluginDescriptor.version;
@ -140,8 +140,8 @@ int WebAPIAdapterGUI::instanceChannels(
}
int WebAPIAdapterGUI::instanceLoggingGet(
Swagger::SWGLoggingInfo& response,
Swagger::SWGErrorResponse& error __attribute__((unused)))
SWGSDRangel::SWGLoggingInfo& response,
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
{
response.setDumpToFile(m_mainWindow.m_logger->getUseFileLogger() ? 1 : 0);
@ -156,8 +156,8 @@ int WebAPIAdapterGUI::instanceLoggingGet(
}
int WebAPIAdapterGUI::instanceLoggingPut(
Swagger::SWGLoggingInfo& response,
Swagger::SWGErrorResponse& error __attribute__((unused)))
SWGSDRangel::SWGLoggingInfo& response,
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
{
// response input is the query actually
bool dumpToFile = (response.getDumpToFile() != 0);
@ -193,8 +193,8 @@ int WebAPIAdapterGUI::instanceLoggingPut(
}
int WebAPIAdapterGUI::instanceAudioGet(
Swagger::SWGAudioDevices& response,
Swagger::SWGErrorResponse& error __attribute__((unused)))
SWGSDRangel::SWGAudioDevices& response,
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
{
const QList<QAudioDeviceInfo>& audioInputDevices = m_mainWindow.m_audioDeviceInfo.getInputDevices();
const QList<QAudioDeviceInfo>& audioOutputDevices = m_mainWindow.m_audioDeviceInfo.getOutputDevices();
@ -207,18 +207,18 @@ int WebAPIAdapterGUI::instanceAudioGet(
response.setNbOutputDevices(nbOutputDevices);
response.setOutputDeviceSelectedIndex(m_mainWindow.m_audioDeviceInfo.getOutputDeviceIndex());
response.setInputVolume(m_mainWindow.m_audioDeviceInfo.getInputVolume());
QList<Swagger::SWGAudioDevice*> *inputDevices = response.getInputDevices();
QList<Swagger::SWGAudioDevice*> *outputDevices = response.getOutputDevices();
QList<SWGSDRangel::SWGAudioDevice*> *inputDevices = response.getInputDevices();
QList<SWGSDRangel::SWGAudioDevice*> *outputDevices = response.getOutputDevices();
for (int i = 0; i < nbInputDevices; i++)
{
inputDevices->append(new Swagger::SWGAudioDevice);
inputDevices->append(new SWGSDRangel::SWGAudioDevice);
*inputDevices->back()->getName() = audioInputDevices.at(i).deviceName();
}
for (int i = 0; i < nbOutputDevices; i++)
{
outputDevices->append(new Swagger::SWGAudioDevice);
outputDevices->append(new SWGSDRangel::SWGAudioDevice);
*outputDevices->back()->getName() = audioOutputDevices.at(i).deviceName();
}
@ -226,8 +226,8 @@ int WebAPIAdapterGUI::instanceAudioGet(
}
int WebAPIAdapterGUI::instanceAudioPatch(
Swagger::SWGAudioDevicesSelect& response,
Swagger::SWGErrorResponse& error __attribute__((unused)))
SWGSDRangel::SWGAudioDevicesSelect& response,
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
{
// response input is the query actually
float inputVolume = response.getInputVolume();
@ -259,8 +259,8 @@ int WebAPIAdapterGUI::instanceAudioPatch(
}
int WebAPIAdapterGUI::instanceLocationGet(
Swagger::SWGLocationInformation& response,
Swagger::SWGErrorResponse& error __attribute__((unused)))
SWGSDRangel::SWGLocationInformation& response,
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
{
response.setLatitude(m_mainWindow.m_settings.getLatitude());
response.setLongitude(m_mainWindow.m_settings.getLongitude());
@ -269,8 +269,8 @@ int WebAPIAdapterGUI::instanceLocationGet(
}
int WebAPIAdapterGUI::instanceLocationPut(
Swagger::SWGLocationInformation& response,
Swagger::SWGErrorResponse& error __attribute__((unused)))
SWGSDRangel::SWGLocationInformation& response,
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
{
float latitude = response.getLatitude();
float longitude = response.getLongitude();
@ -289,8 +289,8 @@ int WebAPIAdapterGUI::instanceLocationPut(
int WebAPIAdapterGUI::instanceDVSerialPatch(
bool dvserial,
Swagger::SWGDVSeralDevices& response,
Swagger::SWGErrorResponse& error __attribute__((unused)))
SWGSDRangel::SWGDVSeralDevices& response,
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
{
m_mainWindow.m_dspEngine->setDVSerialSupport(dvserial);
m_mainWindow.ui->action_DV_Serial->setChecked(dvserial);
@ -301,14 +301,14 @@ int WebAPIAdapterGUI::instanceDVSerialPatch(
std::vector<std::string> deviceNames;
m_mainWindow.m_dspEngine->getDVSerialNames(deviceNames);
response.setNbDevices((int) deviceNames.size());
QList<Swagger::SWGDVSerialDevice*> *deviceNamesList = response.getDvSerialDevices();
QList<SWGSDRangel::SWGDVSerialDevice*> *deviceNamesList = response.getDvSerialDevices();
std::vector<std::string>::iterator it = deviceNames.begin();
std::string deviceNamesStr = "DV Serial devices found: ";
while (it != deviceNames.end())
{
deviceNamesList->append(new Swagger::SWGDVSerialDevice);
deviceNamesList->append(new SWGSDRangel::SWGDVSerialDevice);
*deviceNamesList->back()->getDeviceName() = QString::fromStdString(*it);
++it;
}
@ -322,16 +322,16 @@ int WebAPIAdapterGUI::instanceDVSerialPatch(
}
int WebAPIAdapterGUI::instancePresetGet(
Swagger::SWGPresets& response,
Swagger::SWGErrorResponse& error __attribute__((unused)))
SWGSDRangel::SWGPresets& response,
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
{
int nbPresets = m_mainWindow.m_settings.getPresetCount();
int nbGroups = 0;
int nbPresetsThisGroup = 0;
QString groupName;
response.init();
QList<Swagger::SWGPresetGroup*> *groups = response.getGroups();
QList<Swagger::SWGPresetItem*> *swgPresets = 0;
QList<SWGSDRangel::SWGPresetGroup*> *groups = response.getGroups();
QList<SWGSDRangel::SWGPresetItem*> *swgPresets = 0;
int i = 0;
// Presets are sorted by group first
@ -343,7 +343,7 @@ int WebAPIAdapterGUI::instancePresetGet(
if ((i == 0) || (groupName != preset->getGroup())) // new group
{
if (i > 0) { groups->back()->setNbPresets(nbPresetsThisGroup); }
groups->append(new Swagger::SWGPresetGroup);
groups->append(new SWGSDRangel::SWGPresetGroup);
groups->back()->init();
groupName = preset->getGroup();
*groups->back()->getGroupName() = groupName;
@ -352,7 +352,7 @@ int WebAPIAdapterGUI::instancePresetGet(
nbPresetsThisGroup = 0;
}
swgPresets->append(new Swagger::SWGPresetItem);
swgPresets->append(new SWGSDRangel::SWGPresetItem);
swgPresets->back()->setCenterFrequency(preset->getCenterFrequency());
*swgPresets->back()->getType() = preset->isSourcePreset() ? "R" : "T";
*swgPresets->back()->getName() = preset->getDescription();
@ -366,12 +366,12 @@ int WebAPIAdapterGUI::instancePresetGet(
}
int WebAPIAdapterGUI::instancePresetPatch(
Swagger::SWGPresetTransfer& query,
Swagger::SWGPresetIdentifier& response,
Swagger::SWGErrorResponse& error)
SWGSDRangel::SWGPresetTransfer& query,
SWGSDRangel::SWGPresetIdentifier& response,
SWGSDRangel::SWGErrorResponse& error)
{
int deviceSetIndex = query.getDeviceSetIndex();
Swagger::SWGPresetIdentifier *presetIdentifier = query.getPreset();
SWGSDRangel::SWGPresetIdentifier *presetIdentifier = query.getPreset();
int nbDeviceSets = m_mainWindow.m_deviceUIs.size();
if (deviceSetIndex > nbDeviceSets)
@ -420,12 +420,12 @@ int WebAPIAdapterGUI::instancePresetPatch(
}
int WebAPIAdapterGUI::instancePresetPut(
Swagger::SWGPresetTransfer& query,
Swagger::SWGPresetIdentifier& response,
Swagger::SWGErrorResponse& error)
SWGSDRangel::SWGPresetTransfer& query,
SWGSDRangel::SWGPresetIdentifier& response,
SWGSDRangel::SWGErrorResponse& error)
{
int deviceSetIndex = query.getDeviceSetIndex();
Swagger::SWGPresetIdentifier *presetIdentifier = query.getPreset();
SWGSDRangel::SWGPresetIdentifier *presetIdentifier = query.getPreset();
int nbDeviceSets = m_mainWindow.m_deviceUIs.size();
if (deviceSetIndex > nbDeviceSets)
@ -476,12 +476,12 @@ int WebAPIAdapterGUI::instancePresetPut(
}
int WebAPIAdapterGUI::instancePresetPost(
Swagger::SWGPresetTransfer& query,
Swagger::SWGPresetIdentifier& response,
Swagger::SWGErrorResponse& error)
SWGSDRangel::SWGPresetTransfer& query,
SWGSDRangel::SWGPresetIdentifier& response,
SWGSDRangel::SWGErrorResponse& error)
{
int deviceSetIndex = query.getDeviceSetIndex();
Swagger::SWGPresetIdentifier *presetIdentifier = query.getPreset();
SWGSDRangel::SWGPresetIdentifier *presetIdentifier = query.getPreset();
int nbDeviceSets = m_mainWindow.m_deviceUIs.size();
if (deviceSetIndex > nbDeviceSets)
@ -520,8 +520,8 @@ int WebAPIAdapterGUI::instancePresetPost(
}
int WebAPIAdapterGUI::instancePresetDelete(
Swagger::SWGPresetIdentifier& response,
Swagger::SWGErrorResponse& error)
SWGSDRangel::SWGPresetIdentifier& response,
SWGSDRangel::SWGErrorResponse& error)
{
const Preset *selectedPreset = m_mainWindow.m_settings.getPreset(*response.getGroupName(),
response.getCenterFrequency(),
@ -548,8 +548,8 @@ int WebAPIAdapterGUI::instancePresetDelete(
}
int WebAPIAdapterGUI::instanceDeviceSetsGet(
Swagger::SWGDeviceSetList& response,
Swagger::SWGErrorResponse& error __attribute__((unused)))
SWGSDRangel::SWGDeviceSetList& response,
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
{
getDeviceSetList(&response);
return 200;
@ -557,8 +557,8 @@ int WebAPIAdapterGUI::instanceDeviceSetsGet(
int WebAPIAdapterGUI::instanceDeviceSetsPost(
bool tx,
Swagger::SWGDeviceSet& response,
Swagger::SWGErrorResponse& error __attribute__((unused)))
SWGSDRangel::SWGDeviceSet& response,
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
{
MainWindow::MsgAddDeviceSet *msg = MainWindow::MsgAddDeviceSet::create(tx);
m_mainWindow.m_inputMessageQueue.push(msg);
@ -572,8 +572,8 @@ int WebAPIAdapterGUI::instanceDeviceSetsPost(
}
int WebAPIAdapterGUI::instanceDeviceSetsDelete(
Swagger::SWGDeviceSetList& response,
Swagger::SWGErrorResponse& error)
SWGSDRangel::SWGDeviceSetList& response,
SWGSDRangel::SWGErrorResponse& error)
{
if (m_mainWindow.m_deviceUIs.size() > 1)
{
@ -597,8 +597,8 @@ int WebAPIAdapterGUI::instanceDeviceSetsDelete(
int WebAPIAdapterGUI::devicesetGet(
int deviceSetIndex,
Swagger::SWGDeviceSet& response,
Swagger::SWGErrorResponse& error)
SWGSDRangel::SWGDeviceSet& response,
SWGSDRangel::SWGErrorResponse& error)
{
if ((deviceSetIndex >= 0) && (deviceSetIndex < (int) m_mainWindow.m_deviceUIs.size()))
{
@ -618,8 +618,8 @@ int WebAPIAdapterGUI::devicesetGet(
int WebAPIAdapterGUI::devicesetDevicePut(
int deviceSetIndex,
Swagger::SWGDeviceListItem& response,
Swagger::SWGErrorResponse& error)
SWGSDRangel::SWGDeviceListItem& response,
SWGSDRangel::SWGErrorResponse& error)
{
if ((deviceSetIndex >= 0) && (deviceSetIndex < (int) m_mainWindow.m_deviceUIs.size()))
{
@ -693,7 +693,7 @@ int WebAPIAdapterGUI::devicesetDevicePut(
}
}
void WebAPIAdapterGUI::getDeviceSetList(Swagger::SWGDeviceSetList* deviceSetList)
void WebAPIAdapterGUI::getDeviceSetList(SWGSDRangel::SWGDeviceSetList* deviceSetList)
{
deviceSetList->init();
deviceSetList->setDevicesetcount((int) m_mainWindow.m_deviceUIs.size());
@ -702,16 +702,16 @@ void WebAPIAdapterGUI::getDeviceSetList(Swagger::SWGDeviceSetList* deviceSetList
for (int i = 0; it != m_mainWindow.m_deviceUIs.end(); ++it, i++)
{
QList<Swagger::SWGDeviceSet*> *deviceSets = deviceSetList->getDeviceSets();
deviceSets->append(new Swagger::SWGDeviceSet());
QList<SWGSDRangel::SWGDeviceSet*> *deviceSets = deviceSetList->getDeviceSets();
deviceSets->append(new SWGSDRangel::SWGDeviceSet());
getDeviceSet(deviceSets->back(), *it, i);
}
}
void WebAPIAdapterGUI::getDeviceSet(Swagger::SWGDeviceSet *deviceSet, const DeviceUISet* deviceUISet, int deviceUISetIndex)
void WebAPIAdapterGUI::getDeviceSet(SWGSDRangel::SWGDeviceSet *deviceSet, const DeviceUISet* deviceUISet, int deviceUISetIndex)
{
Swagger::SWGSamplingDevice *samplingDevice = deviceSet->getSamplingDevice();
SWGSDRangel::SWGSamplingDevice *samplingDevice = deviceSet->getSamplingDevice();
samplingDevice->init();
samplingDevice->setIndex(deviceUISetIndex);
samplingDevice->setTx(deviceUISet->m_deviceSinkEngine != 0);
@ -732,11 +732,11 @@ void WebAPIAdapterGUI::getDeviceSet(Swagger::SWGDeviceSet *deviceSet, const Devi
}
deviceSet->setChannelcount(deviceUISet->m_deviceSinkAPI->getNbChannels());
QList<Swagger::SWGChannel*> *channels = deviceSet->getChannels();
QList<SWGSDRangel::SWGChannel*> *channels = deviceSet->getChannels();
for (int i = 0; i < deviceSet->getChannelcount(); i++)
{
channels->append(new Swagger::SWGChannel);
channels->append(new SWGSDRangel::SWGChannel);
ChannelSourceAPI *channel = deviceUISet->m_deviceSinkAPI->getChanelAPIAt(i);
channels->back()->setDeltaFrequency(channel->getDeltaFrequency());
channels->back()->setIndex(channel->getIndexInDeviceSet());
@ -762,11 +762,11 @@ void WebAPIAdapterGUI::getDeviceSet(Swagger::SWGDeviceSet *deviceSet, const Devi
}
deviceSet->setChannelcount(deviceUISet->m_deviceSourceAPI->getNbChannels());
QList<Swagger::SWGChannel*> *channels = deviceSet->getChannels();
QList<SWGSDRangel::SWGChannel*> *channels = deviceSet->getChannels();
for (int i = 0; i < deviceSet->getChannelcount(); i++)
{
channels->append(new Swagger::SWGChannel);
channels->append(new SWGSDRangel::SWGChannel);
ChannelSinkAPI *channel = deviceUISet->m_deviceSourceAPI->getChanelAPIAt(i);
channels->back()->setDeltaFrequency(channel->getDeltaFrequency());
channels->back()->setIndex(channel->getIndexInDeviceSet());

View File

@ -32,99 +32,99 @@ public:
virtual ~WebAPIAdapterGUI();
virtual int instanceSummary(
Swagger::SWGInstanceSummaryResponse& response,
Swagger::SWGErrorResponse& error);
SWGSDRangel::SWGInstanceSummaryResponse& response,
SWGSDRangel::SWGErrorResponse& error);
virtual int instanceDevices(
bool tx,
Swagger::SWGInstanceDevicesResponse& response,
Swagger::SWGErrorResponse& error);
SWGSDRangel::SWGInstanceDevicesResponse& response,
SWGSDRangel::SWGErrorResponse& error);
virtual int instanceChannels(
bool tx,
Swagger::SWGInstanceChannelsResponse& response,
Swagger::SWGErrorResponse& error);
SWGSDRangel::SWGInstanceChannelsResponse& response,
SWGSDRangel::SWGErrorResponse& error);
virtual int instanceLoggingGet(
Swagger::SWGLoggingInfo& response,
Swagger::SWGErrorResponse& error);
SWGSDRangel::SWGLoggingInfo& response,
SWGSDRangel::SWGErrorResponse& error);
virtual int instanceLoggingPut(
Swagger::SWGLoggingInfo& response,
Swagger::SWGErrorResponse& error);
SWGSDRangel::SWGLoggingInfo& response,
SWGSDRangel::SWGErrorResponse& error);
virtual int instanceAudioGet(
Swagger::SWGAudioDevices& response,
Swagger::SWGErrorResponse& error);
SWGSDRangel::SWGAudioDevices& response,
SWGSDRangel::SWGErrorResponse& error);
virtual int instanceAudioPatch(
Swagger::SWGAudioDevicesSelect& response,
Swagger::SWGErrorResponse& error);
SWGSDRangel::SWGAudioDevicesSelect& response,
SWGSDRangel::SWGErrorResponse& error);
virtual int instanceLocationGet(
Swagger::SWGLocationInformation& response,
Swagger::SWGErrorResponse& error);
SWGSDRangel::SWGLocationInformation& response,
SWGSDRangel::SWGErrorResponse& error);
virtual int instanceLocationPut(
Swagger::SWGLocationInformation& response,
Swagger::SWGErrorResponse& error);
SWGSDRangel::SWGLocationInformation& response,
SWGSDRangel::SWGErrorResponse& error);
virtual int instanceDVSerialPatch(
bool dvserial,
Swagger::SWGDVSeralDevices& response,
Swagger::SWGErrorResponse& error);
SWGSDRangel::SWGDVSeralDevices& response,
SWGSDRangel::SWGErrorResponse& error);
virtual int instancePresetGet(
Swagger::SWGPresets& response,
Swagger::SWGErrorResponse& error);
SWGSDRangel::SWGPresets& response,
SWGSDRangel::SWGErrorResponse& error);
virtual int instancePresetPatch(
Swagger::SWGPresetTransfer& query,
Swagger::SWGPresetIdentifier& response,
Swagger::SWGErrorResponse& error);
SWGSDRangel::SWGPresetTransfer& query,
SWGSDRangel::SWGPresetIdentifier& response,
SWGSDRangel::SWGErrorResponse& error);
virtual int instancePresetPut(
Swagger::SWGPresetTransfer& query,
Swagger::SWGPresetIdentifier& response,
Swagger::SWGErrorResponse& error);
SWGSDRangel::SWGPresetTransfer& query,
SWGSDRangel::SWGPresetIdentifier& response,
SWGSDRangel::SWGErrorResponse& error);
virtual int instancePresetPost(
Swagger::SWGPresetTransfer& query,
Swagger::SWGPresetIdentifier& response,
Swagger::SWGErrorResponse& error);
SWGSDRangel::SWGPresetTransfer& query,
SWGSDRangel::SWGPresetIdentifier& response,
SWGSDRangel::SWGErrorResponse& error);
virtual int instancePresetDelete(
Swagger::SWGPresetIdentifier& response,
Swagger::SWGErrorResponse& error);
SWGSDRangel::SWGPresetIdentifier& response,
SWGSDRangel::SWGErrorResponse& error);
virtual int instanceDeviceSetsGet(
Swagger::SWGDeviceSetList& response,
Swagger::SWGErrorResponse& error);
SWGSDRangel::SWGDeviceSetList& response,
SWGSDRangel::SWGErrorResponse& error);
virtual int instanceDeviceSetsPost(
bool tx,
Swagger::SWGDeviceSet& response,
Swagger::SWGErrorResponse& error);
SWGSDRangel::SWGDeviceSet& response,
SWGSDRangel::SWGErrorResponse& error);
virtual int instanceDeviceSetsDelete(
Swagger::SWGDeviceSetList& response,
Swagger::SWGErrorResponse& error);
SWGSDRangel::SWGDeviceSetList& response,
SWGSDRangel::SWGErrorResponse& error);
virtual int devicesetGet(
int deviceSetIndex,
Swagger::SWGDeviceSet& response,
Swagger::SWGErrorResponse& error);
SWGSDRangel::SWGDeviceSet& response,
SWGSDRangel::SWGErrorResponse& error);
virtual int devicesetDevicePut(
int deviceSetIndex,
Swagger::SWGDeviceListItem& response,
Swagger::SWGErrorResponse& error);
SWGSDRangel::SWGDeviceListItem& response,
SWGSDRangel::SWGErrorResponse& error);
private:
MainWindow& m_mainWindow;
void getDeviceSetList(Swagger::SWGDeviceSetList* deviceSetList);
void getDeviceSet(Swagger::SWGDeviceSet *deviceSet, const DeviceUISet* deviceUISet, int deviceUISetIndex);
void getDeviceSetList(SWGSDRangel::SWGDeviceSetList* deviceSetList);
void getDeviceSet(SWGSDRangel::SWGDeviceSet *deviceSet, const DeviceUISet* deviceUISet, int deviceUISetIndex);
static QtMsgType getMsgTypeFromString(const QString& msgTypeString);
static void getMsgTypeString(const QtMsgType& msgType, QString& level);
};

View File

@ -87,7 +87,7 @@ Do not forget to start the http server for includes as described before for the
Eventually to generate the code for Qt5 in the code/qt5 directory do:
```shell
/opt/install/swagger/swagger-codegen generate -i api/swagger/swagger.yaml -l qt5cpp -o code/qt5
/opt/install/swagger/swagger-codegen generate -i api/swagger/swagger.yaml -l qt5cpp -c qt5cpp-config.json -o code/qt5
```
The language option `-l` allows to generate code or documentation in a lot of languages (invoke the command without any parameter to get a list). The most commonly used are:
@ -95,6 +95,18 @@ The language option `-l` allows to generate code or documentation in a lot of la
- html2: documentation as a single HTML file pretty printed. Used to document the API in code/html2
- python: Python client
- angular2: Typescript for Angular2 client
The configuration option `-c` lets you specify a configuration file which is in JSON format and for which the key, value pairs are documented in the config-help of the specified codegen language. For example the following command will return the possible key values for Qt5 C++ generator:
```shell
/opt/install/swagger/swagger-codegen config-help -l qt5cpp
```
The following configuration files have been defined for generation in the SDRangel context:
- `qt5cpp-config.json` for Qt5/C++
- `html2-config.json` for HTML2
- `python-config.json` for Python
<h3>Links</h3>

View File

@ -5,16 +5,15 @@ info:
title: SDRangel
contact:
url: "https://github.com/f4exb/sdrangel"
email: "f4exb06@gmail.com"
email: "f4exb06@gmail.com"
# during dev, should point to your local machine
host: localhost:10010
host: localhost:8091
# basePath prefixes all resource paths
basePath: /
#
schemes:
# tip: remove http to make production-grade
- http
- https
# format of bodies a client can send (Content-Type)
consumes:
- application/json
@ -29,6 +28,8 @@ paths:
description: SDRangel instance summary
# used as the method name of the controller
operationId: instanceSummary
tags:
- Instance
responses:
"200":
description: Success
@ -47,6 +48,8 @@ paths:
get:
description: Get a list of sampling devices that can be used to take part in a device set
operationId: instanceDevices
tags:
- Instance
parameters:
- name: tx
in: query
@ -69,6 +72,8 @@ paths:
get:
description: Get a list of channel plugins available in this instance
operationId: instanceChannels
tags:
- Instance
parameters:
- name: tx
in: query
@ -91,6 +96,8 @@ paths:
get:
description: Get logging information for this instance
operationId: instanceLoggingGet
tags:
- Instance
responses:
"200":
description: Success
@ -105,6 +112,8 @@ paths:
put:
description: Change logging parmeters for this instance
operationId: instanceLoggingPut
tags:
- Instance
consumes:
- application/json
parameters:
@ -120,7 +129,7 @@ paths:
schema:
$ref: "#/definitions/LoggingInfo"
"400":
description: Invallid data
description: Invalid data
schema:
$ref: "#/definitions/ErrorResponse"
"500":
@ -134,6 +143,8 @@ paths:
get:
description: Get audio devices list available to this instance
operationId: instanceAudioGet
tags:
- Instance
responses:
"200":
description: Success
@ -148,6 +159,8 @@ paths:
patch:
description: Set audio devices
operationId: instanceAudioPatch
tags:
- Instance
consumes:
- application/json
parameters:
@ -173,6 +186,8 @@ paths:
get:
description: Get instance geolocation information
operationId: instanceLocationGet
tags:
- Instance
responses:
"200":
description: On success return location
@ -187,6 +202,8 @@ paths:
put:
description: Set instance geolocation information
operationId: instanceLocationPut
tags:
- Instance
consumes:
- application/json
parameters:
@ -214,6 +231,8 @@ paths:
patch:
description: Set or reset DV serial processing for AMBE frames decoding in digital voice modes
operationId: instanceDVSerialPatch
tags:
- Instance
parameters:
- name: dvserial
in: query
@ -236,6 +255,8 @@ paths:
get:
description: List all presets in the instance
operationId: instancePresetGet
tags:
- Instance
responses:
"200":
description: On success return preset list
@ -250,6 +271,8 @@ paths:
patch:
description: Load a preset in a device set
operationId: instancePresetPatch
tags:
- Instance
consumes:
- application/json
parameters:
@ -281,6 +304,8 @@ paths:
put:
description: Update device set settings on an existing preset.
operationId: instancePresetPut
tags:
- Instance
consumes:
- application/json
parameters:
@ -312,6 +337,8 @@ paths:
post:
description: Create a new preset from a device set settings. Frequency and type is ignored and taken from the the device set values.
operationId: instancePresetPost
tags:
- Instance
consumes:
- application/json
parameters:
@ -347,6 +374,8 @@ paths:
delete:
description: Deletes a preset
operationId: instancePresetDelete
tags:
- Instance
consumes:
- application/json
parameters:
@ -380,6 +409,8 @@ paths:
get:
description: Get summary information about device sets opened in the instance
operationId: instanceDeviceSetsGet
tags:
- Instance
responses:
"200":
description: On success return device set list
@ -394,6 +425,8 @@ paths:
post:
description: Add (append) a new device set with default values
operationId: instanceDeviceSetsPost
tags:
- Instance
parameters:
- name: tx
in: query
@ -414,6 +447,8 @@ paths:
delete:
description: Remove last device set except the first device
operationId: instanceDeviceSetsDelete
tags:
- Instance
responses:
"200":
description: On success return new list of device sets
@ -434,6 +469,8 @@ paths:
get:
description: Get device set information
operationId: devicesetGet
tags:
- DeviceSet
parameters:
- in: path
name: deviceSetIndex
@ -460,6 +497,8 @@ paths:
put:
description: Set the device used in the device set
operationId: devicesetDevicePut
tags:
- DeviceSet
parameters:
- in: path
name: deviceSetIndex
@ -474,7 +513,7 @@ paths:
$ref: "#/definitions/DeviceListItem"
responses:
"200":
description: On success return details on the device
description: On success return details on the selected device
schema:
$ref: "#/definitions/DeviceListItem"
"400":

File diff suppressed because it is too large Load Diff

View File

@ -1,201 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@ -20,7 +20,7 @@
#include <QObject>
#include <QDebug>
namespace Swagger {
namespace SWGSDRangel {
SWGAudioDevice::SWGAudioDevice(QString* json) {
init();
@ -59,7 +59,7 @@ SWGAudioDevice::fromJson(QString &json) {
void
SWGAudioDevice::fromJsonObject(QJsonObject &pJson) {
::Swagger::setValue(&name, pJson["name"], "QString", "QString");
::SWGSDRangel::setValue(&name, pJson["name"], "QString", "QString");
}
QString

View File

@ -27,7 +27,7 @@
#include "SWGObject.h"
namespace Swagger {
namespace SWGSDRangel {
class SWGAudioDevice: public SWGObject {
public:

View File

@ -20,7 +20,7 @@
#include <QObject>
#include <QDebug>
namespace Swagger {
namespace SWGSDRangel {
SWGAudioDevices::SWGAudioDevices(QString* json) {
init();
@ -82,16 +82,16 @@ SWGAudioDevices::fromJson(QString &json) {
void
SWGAudioDevices::fromJsonObject(QJsonObject &pJson) {
::Swagger::setValue(&input_volume, pJson["inputVolume"], "float", "");
::Swagger::setValue(&nb_input_devices, pJson["nbInputDevices"], "qint32", "");
::Swagger::setValue(&input_device_selected_index, pJson["inputDeviceSelectedIndex"], "qint32", "");
::SWGSDRangel::setValue(&input_volume, pJson["inputVolume"], "float", "");
::SWGSDRangel::setValue(&nb_input_devices, pJson["nbInputDevices"], "qint32", "");
::SWGSDRangel::setValue(&input_device_selected_index, pJson["inputDeviceSelectedIndex"], "qint32", "");
::Swagger::setValue(&input_devices, pJson["inputDevices"], "QList", "SWGAudioDevice");
::SWGSDRangel::setValue(&input_devices, pJson["inputDevices"], "QList", "SWGAudioDevice");
::Swagger::setValue(&nb_output_devices, pJson["nbOutputDevices"], "qint32", "");
::Swagger::setValue(&output_device_selected_index, pJson["outputDeviceSelectedIndex"], "qint32", "");
::SWGSDRangel::setValue(&nb_output_devices, pJson["nbOutputDevices"], "qint32", "");
::SWGSDRangel::setValue(&output_device_selected_index, pJson["outputDeviceSelectedIndex"], "qint32", "");
::Swagger::setValue(&output_devices, pJson["outputDevices"], "QList", "SWGAudioDevice");
::SWGSDRangel::setValue(&output_devices, pJson["outputDevices"], "QList", "SWGAudioDevice");
}

View File

@ -28,7 +28,7 @@
#include "SWGObject.h"
namespace Swagger {
namespace SWGSDRangel {
class SWGAudioDevices: public SWGObject {
public:

View File

@ -20,7 +20,7 @@
#include <QObject>
#include <QDebug>
namespace Swagger {
namespace SWGSDRangel {
SWGAudioDevicesSelect::SWGAudioDevicesSelect(QString* json) {
init();
@ -60,9 +60,9 @@ SWGAudioDevicesSelect::fromJson(QString &json) {
void
SWGAudioDevicesSelect::fromJsonObject(QJsonObject &pJson) {
::Swagger::setValue(&input_volume, pJson["inputVolume"], "float", "");
::Swagger::setValue(&input_index, pJson["inputIndex"], "qint32", "");
::Swagger::setValue(&output_index, pJson["outputIndex"], "qint32", "");
::SWGSDRangel::setValue(&input_volume, pJson["inputVolume"], "float", "");
::SWGSDRangel::setValue(&input_index, pJson["inputIndex"], "qint32", "");
::SWGSDRangel::setValue(&output_index, pJson["outputIndex"], "qint32", "");
}
QString

View File

@ -26,7 +26,7 @@
#include "SWGObject.h"
namespace Swagger {
namespace SWGSDRangel {
class SWGAudioDevicesSelect: public SWGObject {
public:

View File

@ -20,7 +20,7 @@
#include <QObject>
#include <QDebug>
namespace Swagger {
namespace SWGSDRangel {
SWGChannel::SWGChannel(QString* json) {
init();
@ -70,11 +70,11 @@ SWGChannel::fromJson(QString &json) {
void
SWGChannel::fromJsonObject(QJsonObject &pJson) {
::Swagger::setValue(&index, pJson["index"], "qint32", "");
::Swagger::setValue(&id, pJson["id"], "QString", "QString");
::Swagger::setValue(&uid, pJson["uid"], "qint64", "");
::Swagger::setValue(&title, pJson["title"], "QString", "QString");
::Swagger::setValue(&delta_frequency, pJson["deltaFrequency"], "qint32", "");
::SWGSDRangel::setValue(&index, pJson["index"], "qint32", "");
::SWGSDRangel::setValue(&id, pJson["id"], "QString", "QString");
::SWGSDRangel::setValue(&uid, pJson["uid"], "qint64", "");
::SWGSDRangel::setValue(&title, pJson["title"], "QString", "QString");
::SWGSDRangel::setValue(&delta_frequency, pJson["deltaFrequency"], "qint32", "");
}
QString

View File

@ -27,7 +27,7 @@
#include "SWGObject.h"
namespace Swagger {
namespace SWGSDRangel {
class SWGChannel: public SWGObject {
public:

View File

@ -20,7 +20,7 @@
#include <QObject>
#include <QDebug>
namespace Swagger {
namespace SWGSDRangel {
SWGChannelListItem::SWGChannelListItem(QString* json) {
init();
@ -78,12 +78,12 @@ SWGChannelListItem::fromJson(QString &json) {
void
SWGChannelListItem::fromJsonObject(QJsonObject &pJson) {
::Swagger::setValue(&name, pJson["name"], "QString", "QString");
::Swagger::setValue(&id_uri, pJson["idURI"], "QString", "QString");
::Swagger::setValue(&id, pJson["id"], "QString", "QString");
::Swagger::setValue(&tx, pJson["tx"], "qint32", "");
::Swagger::setValue(&version, pJson["version"], "QString", "QString");
::Swagger::setValue(&index, pJson["index"], "qint32", "");
::SWGSDRangel::setValue(&name, pJson["name"], "QString", "QString");
::SWGSDRangel::setValue(&id_uri, pJson["idURI"], "QString", "QString");
::SWGSDRangel::setValue(&id, pJson["id"], "QString", "QString");
::SWGSDRangel::setValue(&tx, pJson["tx"], "qint32", "");
::SWGSDRangel::setValue(&version, pJson["version"], "QString", "QString");
::SWGSDRangel::setValue(&index, pJson["index"], "qint32", "");
}
QString

View File

@ -27,7 +27,7 @@
#include "SWGObject.h"
namespace Swagger {
namespace SWGSDRangel {
class SWGChannelListItem: public SWGObject {
public:

View File

@ -20,7 +20,7 @@
#include <QObject>
#include <QDebug>
namespace Swagger {
namespace SWGSDRangel {
SWGDVSeralDevices::SWGDVSeralDevices(QString* json) {
init();
@ -65,9 +65,9 @@ SWGDVSeralDevices::fromJson(QString &json) {
void
SWGDVSeralDevices::fromJsonObject(QJsonObject &pJson) {
::Swagger::setValue(&nb_devices, pJson["nbDevices"], "qint32", "");
::SWGSDRangel::setValue(&nb_devices, pJson["nbDevices"], "qint32", "");
::Swagger::setValue(&dv_serial_devices, pJson["dvSerialDevices"], "QList", "SWGDVSerialDevice");
::SWGSDRangel::setValue(&dv_serial_devices, pJson["dvSerialDevices"], "QList", "SWGDVSerialDevice");
}

View File

@ -28,7 +28,7 @@
#include "SWGObject.h"
namespace Swagger {
namespace SWGSDRangel {
class SWGDVSeralDevices: public SWGObject {
public:

View File

@ -20,7 +20,7 @@
#include <QObject>
#include <QDebug>
namespace Swagger {
namespace SWGSDRangel {
SWGDVSerialDevice::SWGDVSerialDevice(QString* json) {
init();
@ -59,7 +59,7 @@ SWGDVSerialDevice::fromJson(QString &json) {
void
SWGDVSerialDevice::fromJsonObject(QJsonObject &pJson) {
::Swagger::setValue(&device_name, pJson["deviceName"], "QString", "QString");
::SWGSDRangel::setValue(&device_name, pJson["deviceName"], "QString", "QString");
}
QString

View File

@ -27,7 +27,7 @@
#include "SWGObject.h"
namespace Swagger {
namespace SWGSDRangel {
class SWGDVSerialDevice: public SWGObject {
public:

View File

@ -20,7 +20,7 @@
#include <QObject>
#include <QDebug>
namespace Swagger {
namespace SWGSDRangel {
SWGDeviceListItem::SWGDeviceListItem(QString* json) {
init();
@ -81,15 +81,15 @@ SWGDeviceListItem::fromJson(QString &json) {
void
SWGDeviceListItem::fromJsonObject(QJsonObject &pJson) {
::Swagger::setValue(&displayed_name, pJson["displayedName"], "QString", "QString");
::Swagger::setValue(&hw_type, pJson["hwType"], "QString", "QString");
::Swagger::setValue(&serial, pJson["serial"], "QString", "QString");
::Swagger::setValue(&sequence, pJson["sequence"], "qint32", "");
::Swagger::setValue(&tx, pJson["tx"], "qint32", "");
::Swagger::setValue(&nb_streams, pJson["nbStreams"], "qint32", "");
::Swagger::setValue(&stream_index, pJson["streamIndex"], "qint32", "");
::Swagger::setValue(&device_set_index, pJson["deviceSetIndex"], "qint32", "");
::Swagger::setValue(&index, pJson["index"], "qint32", "");
::SWGSDRangel::setValue(&displayed_name, pJson["displayedName"], "QString", "QString");
::SWGSDRangel::setValue(&hw_type, pJson["hwType"], "QString", "QString");
::SWGSDRangel::setValue(&serial, pJson["serial"], "QString", "QString");
::SWGSDRangel::setValue(&sequence, pJson["sequence"], "qint32", "");
::SWGSDRangel::setValue(&tx, pJson["tx"], "qint32", "");
::SWGSDRangel::setValue(&nb_streams, pJson["nbStreams"], "qint32", "");
::SWGSDRangel::setValue(&stream_index, pJson["streamIndex"], "qint32", "");
::SWGSDRangel::setValue(&device_set_index, pJson["deviceSetIndex"], "qint32", "");
::SWGSDRangel::setValue(&index, pJson["index"], "qint32", "");
}
QString

View File

@ -27,7 +27,7 @@
#include "SWGObject.h"
namespace Swagger {
namespace SWGSDRangel {
class SWGDeviceListItem: public SWGObject {
public:

View File

@ -20,7 +20,7 @@
#include <QObject>
#include <QDebug>
namespace Swagger {
namespace SWGSDRangel {
SWGDeviceSet::SWGDeviceSet(QString* json) {
init();
@ -70,10 +70,10 @@ SWGDeviceSet::fromJson(QString &json) {
void
SWGDeviceSet::fromJsonObject(QJsonObject &pJson) {
::Swagger::setValue(&sampling_device, pJson["samplingDevice"], "SWGSamplingDevice", "SWGSamplingDevice");
::Swagger::setValue(&channelcount, pJson["channelcount"], "qint32", "");
::SWGSDRangel::setValue(&sampling_device, pJson["samplingDevice"], "SWGSamplingDevice", "SWGSamplingDevice");
::SWGSDRangel::setValue(&channelcount, pJson["channelcount"], "qint32", "");
::Swagger::setValue(&channels, pJson["channels"], "QList", "SWGChannel");
::SWGSDRangel::setValue(&channels, pJson["channels"], "QList", "SWGChannel");
}

View File

@ -29,7 +29,7 @@
#include "SWGObject.h"
namespace Swagger {
namespace SWGSDRangel {
class SWGDeviceSet: public SWGObject {
public:

View File

@ -0,0 +1,134 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
#include "SWGDeviceSetApi.h"
#include "SWGHelpers.h"
#include "SWGModelFactory.h"
#include <QJsonArray>
#include <QJsonDocument>
namespace SWGSDRangel {
SWGDeviceSetApi::SWGDeviceSetApi() {}
SWGDeviceSetApi::~SWGDeviceSetApi() {}
SWGDeviceSetApi::SWGDeviceSetApi(QString host, QString basePath) {
this->host = host;
this->basePath = basePath;
}
void
SWGDeviceSetApi::devicesetDevicePut(qint32 device_set_index, SWGDeviceListItem body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}/device");
QString device_set_indexPathParam("{"); device_set_indexPathParam.append("deviceSetIndex").append("}");
fullPath.replace(device_set_indexPathParam, stringValue(device_set_index));
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "PUT");
QString output = body.asJson();
input.request_body.append(output);
foreach(QString key, this->defaultHeaders.keys()) {
input.headers.insert(key, this->defaultHeaders.value(key));
}
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDeviceSetApi::devicesetDevicePutCallback);
worker->execute(&input);
}
void
SWGDeviceSetApi::devicesetDevicePutCallback(HttpRequestWorker * worker) {
QString msg;
QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
QString json(worker->response);
SWGDeviceListItem* output = static_cast<SWGDeviceListItem*>(create(json, QString("SWGDeviceListItem")));
worker->deleteLater();
emit devicesetDevicePutSignal(output);
emit devicesetDevicePutSignalE(output, error_type, error_str);
}
void
SWGDeviceSetApi::devicesetGet(qint32 device_set_index) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}");
QString device_set_indexPathParam("{"); device_set_indexPathParam.append("deviceSetIndex").append("}");
fullPath.replace(device_set_indexPathParam, stringValue(device_set_index));
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "GET");
foreach(QString key, this->defaultHeaders.keys()) {
input.headers.insert(key, this->defaultHeaders.value(key));
}
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDeviceSetApi::devicesetGetCallback);
worker->execute(&input);
}
void
SWGDeviceSetApi::devicesetGetCallback(HttpRequestWorker * worker) {
QString msg;
QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
QString json(worker->response);
SWGDeviceSet* output = static_cast<SWGDeviceSet*>(create(json, QString("SWGDeviceSet")));
worker->deleteLater();
emit devicesetGetSignal(output);
emit devicesetGetSignalE(output, error_type, error_str);
}
}

View File

@ -0,0 +1,55 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
#ifndef _SWG_SWGDeviceSetApi_H_
#define _SWG_SWGDeviceSetApi_H_
#include "SWGHttpRequest.h"
#include "SWGDeviceListItem.h"
#include "SWGDeviceSet.h"
#include "SWGErrorResponse.h"
#include <QObject>
namespace SWGSDRangel {
class SWGDeviceSetApi: public QObject {
Q_OBJECT
public:
SWGDeviceSetApi();
SWGDeviceSetApi(QString host, QString basePath);
~SWGDeviceSetApi();
QString host;
QString basePath;
QMap<QString, QString> defaultHeaders;
void devicesetDevicePut(qint32 device_set_index, SWGDeviceListItem body);
void devicesetGet(qint32 device_set_index);
private:
void devicesetDevicePutCallback (HttpRequestWorker * worker);
void devicesetGetCallback (HttpRequestWorker * worker);
signals:
void devicesetDevicePutSignal(SWGDeviceListItem* summary);
void devicesetGetSignal(SWGDeviceSet* summary);
void devicesetDevicePutSignalE(SWGDeviceListItem* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void devicesetGetSignalE(SWGDeviceSet* summary, QNetworkReply::NetworkError error_type, QString& error_str);
};
}
#endif

View File

@ -20,7 +20,7 @@
#include <QObject>
#include <QDebug>
namespace Swagger {
namespace SWGSDRangel {
SWGDeviceSetList::SWGDeviceSetList(QString* json) {
init();
@ -65,9 +65,9 @@ SWGDeviceSetList::fromJson(QString &json) {
void
SWGDeviceSetList::fromJsonObject(QJsonObject &pJson) {
::Swagger::setValue(&devicesetcount, pJson["devicesetcount"], "qint32", "");
::SWGSDRangel::setValue(&devicesetcount, pJson["devicesetcount"], "qint32", "");
::Swagger::setValue(&device_sets, pJson["deviceSets"], "QList", "SWGDeviceSet");
::SWGSDRangel::setValue(&device_sets, pJson["deviceSets"], "QList", "SWGDeviceSet");
}

View File

@ -28,7 +28,7 @@
#include "SWGObject.h"
namespace Swagger {
namespace SWGSDRangel {
class SWGDeviceSetList: public SWGObject {
public:

View File

@ -20,7 +20,7 @@
#include <QObject>
#include <QDebug>
namespace Swagger {
namespace SWGSDRangel {
SWGErrorResponse::SWGErrorResponse(QString* json) {
init();
@ -59,7 +59,7 @@ SWGErrorResponse::fromJson(QString &json) {
void
SWGErrorResponse::fromJsonObject(QJsonObject &pJson) {
::Swagger::setValue(&message, pJson["message"], "QString", "QString");
::SWGSDRangel::setValue(&message, pJson["message"], "QString", "QString");
}
QString

View File

@ -27,7 +27,7 @@
#include "SWGObject.h"
namespace Swagger {
namespace SWGSDRangel {
class SWGErrorResponse: public SWGObject {
public:

View File

@ -19,7 +19,7 @@
#include <QDateTime>
namespace Swagger {
namespace SWGSDRangel {
void
setValue(void* value, QJsonValue obj, QString type, QString complexType) {
@ -131,7 +131,7 @@ setValue(void* value, QJsonValue obj, QString type, QString complexType) {
else if(type.startsWith("SWG") && obj.isObject()) {
// complex type
QJsonObject jsonObj = obj.toObject();
SWGObject * so = (SWGObject*)::Swagger::create(type);
SWGObject * so = (SWGObject*)::SWGSDRangel::create(type);
if(so != nullptr) {
so->fromJsonObject(jsonObj);
SWGObject **val = static_cast<SWGObject**>(value);

View File

@ -15,7 +15,7 @@
#include <QJsonValue>
namespace Swagger {
namespace SWGSDRangel {
void setValue(void* value, QJsonValue obj, QString type, QString complexType);
void toJsonArray(QList<void*>* value, QJsonArray* output, QString innerName, QString innerType);

View File

@ -18,7 +18,7 @@
#include <QtGlobal>
namespace Swagger {
namespace SWGSDRangel {
HttpRequestInput::HttpRequestInput() {
initialize();

View File

@ -27,7 +27,7 @@
enum HttpRequestVarLayout {NOT_SET, ADDRESS, URL_ENCODED, MULTIPART};
namespace Swagger {
namespace SWGSDRangel {
class SWGHttpRequestInputFileElement {

View File

@ -10,126 +10,26 @@
* Do not edit the class manually.
*/
#include "SWGDefaultApi.h"
#include "SWGInstanceApi.h"
#include "SWGHelpers.h"
#include "SWGModelFactory.h"
#include <QJsonArray>
#include <QJsonDocument>
namespace Swagger {
namespace SWGSDRangel {
SWGDefaultApi::SWGDefaultApi() {}
SWGInstanceApi::SWGInstanceApi() {}
SWGDefaultApi::~SWGDefaultApi() {}
SWGInstanceApi::~SWGInstanceApi() {}
SWGDefaultApi::SWGDefaultApi(QString host, QString basePath) {
SWGInstanceApi::SWGInstanceApi(QString host, QString basePath) {
this->host = host;
this->basePath = basePath;
}
void
SWGDefaultApi::devicesetDevicePut(qint32 device_set_index) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}/device");
QString device_set_indexPathParam("{"); device_set_indexPathParam.append("deviceSetIndex").append("}");
fullPath.replace(device_set_indexPathParam, stringValue(device_set_index));
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "PUT");
foreach(QString key, this->defaultHeaders.keys()) {
input.headers.insert(key, this->defaultHeaders.value(key));
}
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::devicesetDevicePutCallback);
worker->execute(&input);
}
void
SWGDefaultApi::devicesetDevicePutCallback(HttpRequestWorker * worker) {
QString msg;
QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
QString json(worker->response);
SWGDeviceSet* output = static_cast<SWGDeviceSet*>(create(json, QString("SWGDeviceSet")));
worker->deleteLater();
emit devicesetDevicePutSignal(output);
emit devicesetDevicePutSignalE(output, error_type, error_str);
}
void
SWGDefaultApi::devicesetGet(qint32 device_set_index) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}");
QString device_set_indexPathParam("{"); device_set_indexPathParam.append("deviceSetIndex").append("}");
fullPath.replace(device_set_indexPathParam, stringValue(device_set_index));
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "GET");
foreach(QString key, this->defaultHeaders.keys()) {
input.headers.insert(key, this->defaultHeaders.value(key));
}
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::devicesetGetCallback);
worker->execute(&input);
}
void
SWGDefaultApi::devicesetGetCallback(HttpRequestWorker * worker) {
QString msg;
QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
QString json(worker->response);
SWGDeviceSet* output = static_cast<SWGDeviceSet*>(create(json, QString("SWGDeviceSet")));
worker->deleteLater();
emit devicesetGetSignal(output);
emit devicesetGetSignalE(output, error_type, error_str);
}
void
SWGDefaultApi::instanceAudioGet() {
SWGInstanceApi::instanceAudioGet() {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/audio");
@ -149,13 +49,13 @@ SWGDefaultApi::instanceAudioGet() {
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instanceAudioGetCallback);
&SWGInstanceApi::instanceAudioGetCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instanceAudioGetCallback(HttpRequestWorker * worker) {
SWGInstanceApi::instanceAudioGetCallback(HttpRequestWorker * worker) {
QString msg;
QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type;
@ -177,7 +77,7 @@ SWGDefaultApi::instanceAudioGetCallback(HttpRequestWorker * worker) {
}
void
SWGDefaultApi::instanceAudioPatch(SWGAudioDevicesSelect body) {
SWGInstanceApi::instanceAudioPatch(SWGAudioDevicesSelect body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/audio");
@ -199,13 +99,13 @@ SWGDefaultApi::instanceAudioPatch(SWGAudioDevicesSelect body) {
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instanceAudioPatchCallback);
&SWGInstanceApi::instanceAudioPatchCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instanceAudioPatchCallback(HttpRequestWorker * worker) {
SWGInstanceApi::instanceAudioPatchCallback(HttpRequestWorker * worker) {
QString msg;
QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type;
@ -227,7 +127,7 @@ SWGDefaultApi::instanceAudioPatchCallback(HttpRequestWorker * worker) {
}
void
SWGDefaultApi::instanceChannels(qint32 tx) {
SWGInstanceApi::instanceChannels(qint32 tx) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/channels");
@ -255,13 +155,13 @@ SWGDefaultApi::instanceChannels(qint32 tx) {
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instanceChannelsCallback);
&SWGInstanceApi::instanceChannelsCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instanceChannelsCallback(HttpRequestWorker * worker) {
SWGInstanceApi::instanceChannelsCallback(HttpRequestWorker * worker) {
QString msg;
QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type;
@ -283,7 +183,7 @@ SWGDefaultApi::instanceChannelsCallback(HttpRequestWorker * worker) {
}
void
SWGDefaultApi::instanceDVSerialPatch(qint32 dvserial) {
SWGInstanceApi::instanceDVSerialPatch(qint32 dvserial) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/dvserial");
@ -311,13 +211,13 @@ SWGDefaultApi::instanceDVSerialPatch(qint32 dvserial) {
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instanceDVSerialPatchCallback);
&SWGInstanceApi::instanceDVSerialPatchCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instanceDVSerialPatchCallback(HttpRequestWorker * worker) {
SWGInstanceApi::instanceDVSerialPatchCallback(HttpRequestWorker * worker) {
QString msg;
QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type;
@ -339,7 +239,7 @@ SWGDefaultApi::instanceDVSerialPatchCallback(HttpRequestWorker * worker) {
}
void
SWGDefaultApi::instanceDeviceSetsDelete() {
SWGInstanceApi::instanceDeviceSetsDelete() {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/devicesets");
@ -359,13 +259,13 @@ SWGDefaultApi::instanceDeviceSetsDelete() {
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instanceDeviceSetsDeleteCallback);
&SWGInstanceApi::instanceDeviceSetsDeleteCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instanceDeviceSetsDeleteCallback(HttpRequestWorker * worker) {
SWGInstanceApi::instanceDeviceSetsDeleteCallback(HttpRequestWorker * worker) {
QString msg;
QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type;
@ -387,7 +287,7 @@ SWGDefaultApi::instanceDeviceSetsDeleteCallback(HttpRequestWorker * worker) {
}
void
SWGDefaultApi::instanceDeviceSetsGet() {
SWGInstanceApi::instanceDeviceSetsGet() {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/devicesets");
@ -407,13 +307,13 @@ SWGDefaultApi::instanceDeviceSetsGet() {
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instanceDeviceSetsGetCallback);
&SWGInstanceApi::instanceDeviceSetsGetCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instanceDeviceSetsGetCallback(HttpRequestWorker * worker) {
SWGInstanceApi::instanceDeviceSetsGetCallback(HttpRequestWorker * worker) {
QString msg;
QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type;
@ -435,7 +335,7 @@ SWGDefaultApi::instanceDeviceSetsGetCallback(HttpRequestWorker * worker) {
}
void
SWGDefaultApi::instanceDeviceSetsPost(qint32 tx) {
SWGInstanceApi::instanceDeviceSetsPost(qint32 tx) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/devicesets");
@ -463,13 +363,13 @@ SWGDefaultApi::instanceDeviceSetsPost(qint32 tx) {
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instanceDeviceSetsPostCallback);
&SWGInstanceApi::instanceDeviceSetsPostCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instanceDeviceSetsPostCallback(HttpRequestWorker * worker) {
SWGInstanceApi::instanceDeviceSetsPostCallback(HttpRequestWorker * worker) {
QString msg;
QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type;
@ -491,7 +391,7 @@ SWGDefaultApi::instanceDeviceSetsPostCallback(HttpRequestWorker * worker) {
}
void
SWGDefaultApi::instanceDevices(qint32 tx) {
SWGInstanceApi::instanceDevices(qint32 tx) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/devices");
@ -519,13 +419,13 @@ SWGDefaultApi::instanceDevices(qint32 tx) {
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instanceDevicesCallback);
&SWGInstanceApi::instanceDevicesCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instanceDevicesCallback(HttpRequestWorker * worker) {
SWGInstanceApi::instanceDevicesCallback(HttpRequestWorker * worker) {
QString msg;
QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type;
@ -547,7 +447,7 @@ SWGDefaultApi::instanceDevicesCallback(HttpRequestWorker * worker) {
}
void
SWGDefaultApi::instanceLocationGet() {
SWGInstanceApi::instanceLocationGet() {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/location");
@ -567,13 +467,13 @@ SWGDefaultApi::instanceLocationGet() {
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instanceLocationGetCallback);
&SWGInstanceApi::instanceLocationGetCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instanceLocationGetCallback(HttpRequestWorker * worker) {
SWGInstanceApi::instanceLocationGetCallback(HttpRequestWorker * worker) {
QString msg;
QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type;
@ -595,7 +495,7 @@ SWGDefaultApi::instanceLocationGetCallback(HttpRequestWorker * worker) {
}
void
SWGDefaultApi::instanceLocationPut(SWGLocationInformation body) {
SWGInstanceApi::instanceLocationPut(SWGLocationInformation body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/location");
@ -617,13 +517,13 @@ SWGDefaultApi::instanceLocationPut(SWGLocationInformation body) {
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instanceLocationPutCallback);
&SWGInstanceApi::instanceLocationPutCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instanceLocationPutCallback(HttpRequestWorker * worker) {
SWGInstanceApi::instanceLocationPutCallback(HttpRequestWorker * worker) {
QString msg;
QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type;
@ -645,7 +545,7 @@ SWGDefaultApi::instanceLocationPutCallback(HttpRequestWorker * worker) {
}
void
SWGDefaultApi::instanceLoggingGet() {
SWGInstanceApi::instanceLoggingGet() {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/logging");
@ -665,13 +565,13 @@ SWGDefaultApi::instanceLoggingGet() {
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instanceLoggingGetCallback);
&SWGInstanceApi::instanceLoggingGetCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instanceLoggingGetCallback(HttpRequestWorker * worker) {
SWGInstanceApi::instanceLoggingGetCallback(HttpRequestWorker * worker) {
QString msg;
QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type;
@ -693,7 +593,7 @@ SWGDefaultApi::instanceLoggingGetCallback(HttpRequestWorker * worker) {
}
void
SWGDefaultApi::instanceLoggingPut(SWGLoggingInfo body) {
SWGInstanceApi::instanceLoggingPut(SWGLoggingInfo body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/logging");
@ -715,13 +615,13 @@ SWGDefaultApi::instanceLoggingPut(SWGLoggingInfo body) {
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instanceLoggingPutCallback);
&SWGInstanceApi::instanceLoggingPutCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instanceLoggingPutCallback(HttpRequestWorker * worker) {
SWGInstanceApi::instanceLoggingPutCallback(HttpRequestWorker * worker) {
QString msg;
QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type;
@ -743,7 +643,7 @@ SWGDefaultApi::instanceLoggingPutCallback(HttpRequestWorker * worker) {
}
void
SWGDefaultApi::instancePresetDelete(SWGPresetIdentifier body) {
SWGInstanceApi::instancePresetDelete(SWGPresetIdentifier body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/preset");
@ -765,13 +665,13 @@ SWGDefaultApi::instancePresetDelete(SWGPresetIdentifier body) {
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instancePresetDeleteCallback);
&SWGInstanceApi::instancePresetDeleteCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instancePresetDeleteCallback(HttpRequestWorker * worker) {
SWGInstanceApi::instancePresetDeleteCallback(HttpRequestWorker * worker) {
QString msg;
QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type;
@ -793,7 +693,7 @@ SWGDefaultApi::instancePresetDeleteCallback(HttpRequestWorker * worker) {
}
void
SWGDefaultApi::instancePresetGet() {
SWGInstanceApi::instancePresetGet() {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/preset");
@ -813,13 +713,13 @@ SWGDefaultApi::instancePresetGet() {
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instancePresetGetCallback);
&SWGInstanceApi::instancePresetGetCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instancePresetGetCallback(HttpRequestWorker * worker) {
SWGInstanceApi::instancePresetGetCallback(HttpRequestWorker * worker) {
QString msg;
QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type;
@ -841,7 +741,7 @@ SWGDefaultApi::instancePresetGetCallback(HttpRequestWorker * worker) {
}
void
SWGDefaultApi::instancePresetPatch(SWGPresetTransfer body) {
SWGInstanceApi::instancePresetPatch(SWGPresetTransfer body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/preset");
@ -863,13 +763,13 @@ SWGDefaultApi::instancePresetPatch(SWGPresetTransfer body) {
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instancePresetPatchCallback);
&SWGInstanceApi::instancePresetPatchCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instancePresetPatchCallback(HttpRequestWorker * worker) {
SWGInstanceApi::instancePresetPatchCallback(HttpRequestWorker * worker) {
QString msg;
QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type;
@ -891,7 +791,7 @@ SWGDefaultApi::instancePresetPatchCallback(HttpRequestWorker * worker) {
}
void
SWGDefaultApi::instancePresetPost(SWGPresetTransfer body) {
SWGInstanceApi::instancePresetPost(SWGPresetTransfer body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/preset");
@ -913,13 +813,13 @@ SWGDefaultApi::instancePresetPost(SWGPresetTransfer body) {
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instancePresetPostCallback);
&SWGInstanceApi::instancePresetPostCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instancePresetPostCallback(HttpRequestWorker * worker) {
SWGInstanceApi::instancePresetPostCallback(HttpRequestWorker * worker) {
QString msg;
QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type;
@ -941,7 +841,7 @@ SWGDefaultApi::instancePresetPostCallback(HttpRequestWorker * worker) {
}
void
SWGDefaultApi::instancePresetPut(SWGPresetTransfer body) {
SWGInstanceApi::instancePresetPut(SWGPresetTransfer body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/preset");
@ -963,13 +863,13 @@ SWGDefaultApi::instancePresetPut(SWGPresetTransfer body) {
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instancePresetPutCallback);
&SWGInstanceApi::instancePresetPutCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instancePresetPutCallback(HttpRequestWorker * worker) {
SWGInstanceApi::instancePresetPutCallback(HttpRequestWorker * worker) {
QString msg;
QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type;
@ -991,7 +891,7 @@ SWGDefaultApi::instancePresetPutCallback(HttpRequestWorker * worker) {
}
void
SWGDefaultApi::instanceSummary() {
SWGInstanceApi::instanceSummary() {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel");
@ -1011,13 +911,13 @@ SWGDefaultApi::instanceSummary() {
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instanceSummaryCallback);
&SWGInstanceApi::instanceSummaryCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instanceSummaryCallback(HttpRequestWorker * worker) {
SWGInstanceApi::instanceSummaryCallback(HttpRequestWorker * worker) {
QString msg;
QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type;

View File

@ -10,8 +10,8 @@
* Do not edit the class manually.
*/
#ifndef _SWG_SWGDefaultApi_H_
#define _SWG_SWGDefaultApi_H_
#ifndef _SWG_SWGInstanceApi_H_
#define _SWG_SWGInstanceApi_H_
#include "SWGHttpRequest.h"
@ -32,22 +32,20 @@
#include <QObject>
namespace Swagger {
namespace SWGSDRangel {
class SWGDefaultApi: public QObject {
class SWGInstanceApi: public QObject {
Q_OBJECT
public:
SWGDefaultApi();
SWGDefaultApi(QString host, QString basePath);
~SWGDefaultApi();
SWGInstanceApi();
SWGInstanceApi(QString host, QString basePath);
~SWGInstanceApi();
QString host;
QString basePath;
QMap<QString, QString> defaultHeaders;
void devicesetDevicePut(qint32 device_set_index);
void devicesetGet(qint32 device_set_index);
void instanceAudioGet();
void instanceAudioPatch(SWGAudioDevicesSelect body);
void instanceChannels(qint32 tx);
@ -68,8 +66,6 @@ public:
void instanceSummary();
private:
void devicesetDevicePutCallback (HttpRequestWorker * worker);
void devicesetGetCallback (HttpRequestWorker * worker);
void instanceAudioGetCallback (HttpRequestWorker * worker);
void instanceAudioPatchCallback (HttpRequestWorker * worker);
void instanceChannelsCallback (HttpRequestWorker * worker);
@ -90,8 +86,6 @@ private:
void instanceSummaryCallback (HttpRequestWorker * worker);
signals:
void devicesetDevicePutSignal(SWGDeviceSet* summary);
void devicesetGetSignal(SWGDeviceSet* summary);
void instanceAudioGetSignal(SWGAudioDevices* summary);
void instanceAudioPatchSignal(SWGAudioDevicesSelect* summary);
void instanceChannelsSignal(SWGInstanceChannelsResponse* summary);
@ -111,8 +105,6 @@ signals:
void instancePresetPutSignal(SWGPresetIdentifier* summary);
void instanceSummarySignal(SWGInstanceSummaryResponse* summary);
void devicesetDevicePutSignalE(SWGDeviceSet* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void devicesetGetSignalE(SWGDeviceSet* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void instanceAudioGetSignalE(SWGAudioDevices* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void instanceAudioPatchSignalE(SWGAudioDevicesSelect* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void instanceChannelsSignalE(SWGInstanceChannelsResponse* summary, QNetworkReply::NetworkError error_type, QString& error_str);

View File

@ -20,7 +20,7 @@
#include <QObject>
#include <QDebug>
namespace Swagger {
namespace SWGSDRangel {
SWGInstanceChannelsResponse::SWGInstanceChannelsResponse(QString* json) {
init();
@ -65,9 +65,9 @@ SWGInstanceChannelsResponse::fromJson(QString &json) {
void
SWGInstanceChannelsResponse::fromJsonObject(QJsonObject &pJson) {
::Swagger::setValue(&channelcount, pJson["channelcount"], "qint32", "");
::SWGSDRangel::setValue(&channelcount, pJson["channelcount"], "qint32", "");
::Swagger::setValue(&channels, pJson["channels"], "QList", "SWGChannelListItem");
::SWGSDRangel::setValue(&channels, pJson["channels"], "QList", "SWGChannelListItem");
}

View File

@ -28,7 +28,7 @@
#include "SWGObject.h"
namespace Swagger {
namespace SWGSDRangel {
class SWGInstanceChannelsResponse: public SWGObject {
public:

View File

@ -20,7 +20,7 @@
#include <QObject>
#include <QDebug>
namespace Swagger {
namespace SWGSDRangel {
SWGInstanceDevicesResponse::SWGInstanceDevicesResponse(QString* json) {
init();
@ -65,9 +65,9 @@ SWGInstanceDevicesResponse::fromJson(QString &json) {
void
SWGInstanceDevicesResponse::fromJsonObject(QJsonObject &pJson) {
::Swagger::setValue(&devicecount, pJson["devicecount"], "qint32", "");
::SWGSDRangel::setValue(&devicecount, pJson["devicecount"], "qint32", "");
::Swagger::setValue(&devices, pJson["devices"], "QList", "SWGDeviceListItem");
::SWGSDRangel::setValue(&devices, pJson["devices"], "QList", "SWGDeviceListItem");
}

View File

@ -28,7 +28,7 @@
#include "SWGObject.h"
namespace Swagger {
namespace SWGSDRangel {
class SWGInstanceDevicesResponse: public SWGObject {
public:

View File

@ -20,7 +20,7 @@
#include <QObject>
#include <QDebug>
namespace Swagger {
namespace SWGSDRangel {
SWGInstanceSummaryResponse::SWGInstanceSummaryResponse(QString* json) {
init();
@ -74,10 +74,10 @@ SWGInstanceSummaryResponse::fromJson(QString &json) {
void
SWGInstanceSummaryResponse::fromJsonObject(QJsonObject &pJson) {
::Swagger::setValue(&version, pJson["version"], "QString", "QString");
::Swagger::setValue(&logging, pJson["logging"], "SWGLoggingInfo", "SWGLoggingInfo");
::Swagger::setValue(&devicesetlist, pJson["devicesetlist"], "SWGDeviceSetList", "SWGDeviceSetList");
::Swagger::setValue(&user, pJson["user"], "SWGUser", "SWGUser");
::SWGSDRangel::setValue(&version, pJson["version"], "QString", "QString");
::SWGSDRangel::setValue(&logging, pJson["logging"], "SWGLoggingInfo", "SWGLoggingInfo");
::SWGSDRangel::setValue(&devicesetlist, pJson["devicesetlist"], "SWGDeviceSetList", "SWGDeviceSetList");
::SWGSDRangel::setValue(&user, pJson["user"], "SWGUser", "SWGUser");
}
QString

View File

@ -30,7 +30,7 @@
#include "SWGObject.h"
namespace Swagger {
namespace SWGSDRangel {
class SWGInstanceSummaryResponse: public SWGObject {
public:

View File

@ -20,7 +20,7 @@
#include <QObject>
#include <QDebug>
namespace Swagger {
namespace SWGSDRangel {
SWGLocationInformation::SWGLocationInformation(QString* json) {
init();
@ -58,8 +58,8 @@ SWGLocationInformation::fromJson(QString &json) {
void
SWGLocationInformation::fromJsonObject(QJsonObject &pJson) {
::Swagger::setValue(&latitude, pJson["latitude"], "float", "");
::Swagger::setValue(&longitude, pJson["longitude"], "float", "");
::SWGSDRangel::setValue(&latitude, pJson["latitude"], "float", "");
::SWGSDRangel::setValue(&longitude, pJson["longitude"], "float", "");
}
QString

View File

@ -26,7 +26,7 @@
#include "SWGObject.h"
namespace Swagger {
namespace SWGSDRangel {
class SWGLocationInformation: public SWGObject {
public:

View File

@ -20,7 +20,7 @@
#include <QObject>
#include <QDebug>
namespace Swagger {
namespace SWGSDRangel {
SWGLoggingInfo::SWGLoggingInfo(QString* json) {
init();
@ -71,10 +71,10 @@ SWGLoggingInfo::fromJson(QString &json) {
void
SWGLoggingInfo::fromJsonObject(QJsonObject &pJson) {
::Swagger::setValue(&console_level, pJson["consoleLevel"], "QString", "QString");
::Swagger::setValue(&file_level, pJson["fileLevel"], "QString", "QString");
::Swagger::setValue(&dump_to_file, pJson["dumpToFile"], "qint32", "");
::Swagger::setValue(&file_name, pJson["fileName"], "QString", "QString");
::SWGSDRangel::setValue(&console_level, pJson["consoleLevel"], "QString", "QString");
::SWGSDRangel::setValue(&file_level, pJson["fileLevel"], "QString", "QString");
::SWGSDRangel::setValue(&dump_to_file, pJson["dumpToFile"], "qint32", "");
::SWGSDRangel::setValue(&file_name, pJson["fileName"], "QString", "QString");
}
QString

View File

@ -27,7 +27,7 @@
#include "SWGObject.h"
namespace Swagger {
namespace SWGSDRangel {
class SWGLoggingInfo: public SWGObject {
public:

View File

@ -38,7 +38,7 @@
#include "SWGSamplingDevice.h"
#include "SWGUser.h"
namespace Swagger {
namespace SWGSDRangel {
inline void* create(QString type) {
if(QString("SWGAudioDevice").compare(type) == 0) {

View File

@ -15,7 +15,7 @@
#include <QJsonValue>
namespace Swagger {
namespace SWGSDRangel {
class SWGObject {
public:

View File

@ -20,7 +20,7 @@
#include <QObject>
#include <QDebug>
namespace Swagger {
namespace SWGSDRangel {
SWGPresetGroup::SWGPresetGroup(QString* json) {
init();
@ -70,10 +70,10 @@ SWGPresetGroup::fromJson(QString &json) {
void
SWGPresetGroup::fromJsonObject(QJsonObject &pJson) {
::Swagger::setValue(&group_name, pJson["groupName"], "QString", "QString");
::Swagger::setValue(&nb_presets, pJson["nbPresets"], "qint32", "");
::SWGSDRangel::setValue(&group_name, pJson["groupName"], "QString", "QString");
::SWGSDRangel::setValue(&nb_presets, pJson["nbPresets"], "qint32", "");
::Swagger::setValue(&presets, pJson["presets"], "QList", "SWGPresetItem");
::SWGSDRangel::setValue(&presets, pJson["presets"], "QList", "SWGPresetItem");
}

View File

@ -29,7 +29,7 @@
#include "SWGObject.h"
namespace Swagger {
namespace SWGSDRangel {
class SWGPresetGroup: public SWGObject {
public:

View File

@ -20,7 +20,7 @@
#include <QObject>
#include <QDebug>
namespace Swagger {
namespace SWGSDRangel {
SWGPresetIdentifier::SWGPresetIdentifier(QString* json) {
init();
@ -71,10 +71,10 @@ SWGPresetIdentifier::fromJson(QString &json) {
void
SWGPresetIdentifier::fromJsonObject(QJsonObject &pJson) {
::Swagger::setValue(&group_name, pJson["groupName"], "QString", "QString");
::Swagger::setValue(&center_frequency, pJson["centerFrequency"], "qint64", "");
::Swagger::setValue(&type, pJson["type"], "QString", "QString");
::Swagger::setValue(&name, pJson["name"], "QString", "QString");
::SWGSDRangel::setValue(&group_name, pJson["groupName"], "QString", "QString");
::SWGSDRangel::setValue(&center_frequency, pJson["centerFrequency"], "qint64", "");
::SWGSDRangel::setValue(&type, pJson["type"], "QString", "QString");
::SWGSDRangel::setValue(&name, pJson["name"], "QString", "QString");
}
QString

View File

@ -27,7 +27,7 @@
#include "SWGObject.h"
namespace Swagger {
namespace SWGSDRangel {
class SWGPresetIdentifier: public SWGObject {
public:

View File

@ -20,7 +20,7 @@
#include <QObject>
#include <QDebug>
namespace Swagger {
namespace SWGSDRangel {
SWGPresetItem::SWGPresetItem(QString* json) {
init();
@ -66,9 +66,9 @@ SWGPresetItem::fromJson(QString &json) {
void
SWGPresetItem::fromJsonObject(QJsonObject &pJson) {
::Swagger::setValue(&center_frequency, pJson["centerFrequency"], "qint64", "");
::Swagger::setValue(&type, pJson["type"], "QString", "QString");
::Swagger::setValue(&name, pJson["name"], "QString", "QString");
::SWGSDRangel::setValue(&center_frequency, pJson["centerFrequency"], "qint64", "");
::SWGSDRangel::setValue(&type, pJson["type"], "QString", "QString");
::SWGSDRangel::setValue(&name, pJson["name"], "QString", "QString");
}
QString

View File

@ -27,7 +27,7 @@
#include "SWGObject.h"
namespace Swagger {
namespace SWGSDRangel {
class SWGPresetItem: public SWGObject {
public:

View File

@ -20,7 +20,7 @@
#include <QObject>
#include <QDebug>
namespace Swagger {
namespace SWGSDRangel {
SWGPresetTransfer::SWGPresetTransfer(QString* json) {
init();
@ -61,8 +61,8 @@ SWGPresetTransfer::fromJson(QString &json) {
void
SWGPresetTransfer::fromJsonObject(QJsonObject &pJson) {
::Swagger::setValue(&device_set_index, pJson["deviceSetIndex"], "qint32", "");
::Swagger::setValue(&preset, pJson["preset"], "SWGPresetIdentifier", "SWGPresetIdentifier");
::SWGSDRangel::setValue(&device_set_index, pJson["deviceSetIndex"], "qint32", "");
::SWGSDRangel::setValue(&preset, pJson["preset"], "SWGPresetIdentifier", "SWGPresetIdentifier");
}
QString

View File

@ -27,7 +27,7 @@
#include "SWGObject.h"
namespace Swagger {
namespace SWGSDRangel {
class SWGPresetTransfer: public SWGObject {
public:

View File

@ -20,7 +20,7 @@
#include <QObject>
#include <QDebug>
namespace Swagger {
namespace SWGSDRangel {
SWGPresets::SWGPresets(QString* json) {
init();
@ -65,9 +65,9 @@ SWGPresets::fromJson(QString &json) {
void
SWGPresets::fromJsonObject(QJsonObject &pJson) {
::Swagger::setValue(&nb_groups, pJson["nbGroups"], "qint32", "");
::SWGSDRangel::setValue(&nb_groups, pJson["nbGroups"], "qint32", "");
::Swagger::setValue(&groups, pJson["groups"], "QList", "SWGPresetGroup");
::SWGSDRangel::setValue(&groups, pJson["groups"], "QList", "SWGPresetGroup");
}

View File

@ -28,7 +28,7 @@
#include "SWGObject.h"
namespace Swagger {
namespace SWGSDRangel {
class SWGPresets: public SWGObject {
public:

View File

@ -20,7 +20,7 @@
#include <QObject>
#include <QDebug>
namespace Swagger {
namespace SWGSDRangel {
SWGSamplingDevice::SWGSamplingDevice(QString* json) {
init();
@ -83,16 +83,16 @@ SWGSamplingDevice::fromJson(QString &json) {
void
SWGSamplingDevice::fromJsonObject(QJsonObject &pJson) {
::Swagger::setValue(&index, pJson["index"], "qint32", "");
::Swagger::setValue(&hw_type, pJson["hwType"], "QString", "QString");
::Swagger::setValue(&tx, pJson["tx"], "qint32", "");
::Swagger::setValue(&nb_streams, pJson["nbStreams"], "qint32", "");
::Swagger::setValue(&stream_index, pJson["streamIndex"], "qint32", "");
::Swagger::setValue(&sequence, pJson["sequence"], "qint32", "");
::Swagger::setValue(&serial, pJson["serial"], "QString", "QString");
::Swagger::setValue(&center_frequency, pJson["centerFrequency"], "qint64", "");
::Swagger::setValue(&bandwidth, pJson["bandwidth"], "qint32", "");
::Swagger::setValue(&state, pJson["state"], "QString", "QString");
::SWGSDRangel::setValue(&index, pJson["index"], "qint32", "");
::SWGSDRangel::setValue(&hw_type, pJson["hwType"], "QString", "QString");
::SWGSDRangel::setValue(&tx, pJson["tx"], "qint32", "");
::SWGSDRangel::setValue(&nb_streams, pJson["nbStreams"], "qint32", "");
::SWGSDRangel::setValue(&stream_index, pJson["streamIndex"], "qint32", "");
::SWGSDRangel::setValue(&sequence, pJson["sequence"], "qint32", "");
::SWGSDRangel::setValue(&serial, pJson["serial"], "QString", "QString");
::SWGSDRangel::setValue(&center_frequency, pJson["centerFrequency"], "qint64", "");
::SWGSDRangel::setValue(&bandwidth, pJson["bandwidth"], "qint32", "");
::SWGSDRangel::setValue(&state, pJson["state"], "QString", "QString");
}
QString

View File

@ -27,7 +27,7 @@
#include "SWGObject.h"
namespace Swagger {
namespace SWGSDRangel {
class SWGSamplingDevice: public SWGObject {
public:

View File

@ -20,7 +20,7 @@
#include <QObject>
#include <QDebug>
namespace Swagger {
namespace SWGSDRangel {
SWGUser::SWGUser(QString* json) {
init();
@ -61,8 +61,8 @@ SWGUser::fromJson(QString &json) {
void
SWGUser::fromJsonObject(QJsonObject &pJson) {
::Swagger::setValue(&index, pJson["index"], "qint32", "");
::Swagger::setValue(&name, pJson["name"], "QString", "QString");
::SWGSDRangel::setValue(&index, pJson["index"], "qint32", "");
::SWGSDRangel::setValue(&name, pJson["name"], "QString", "QString");
}
QString

View File

@ -27,7 +27,7 @@
#include "SWGObject.h"
namespace Swagger {
namespace SWGSDRangel {
class SWGUser: public SWGObject {
public:

View File

@ -1,3 +0,0 @@
#!/bin/sh
BASEDIR=$(dirname "$0")
sed -i '1s/^/#include <QDateTime>\n/' ${BASEDIR}/../client/SWGHelpers.cpp

View File

@ -0,0 +1,7 @@
{
"perlModuleName": "SWGSDRangel",
"pythonPackageName": "swagger_sdrangel",
"packageName": "SWGSDRangel",
"invokerPackage": "SWGSDRangel",
"phpInvokerPackage": "SWGSDRangel"
}

View File

@ -0,0 +1,3 @@
{
"packageName": "swagger_sdrangel"
}

View File

@ -0,0 +1,3 @@
{
"cppNamespace": "SWGSDRangel"
}