SDRdaemon: changed generic channel settings to sink channel settings

This commit is contained in:
f4exb 2018-08-23 17:38:25 +02:00
parent 0ace2e9499
commit 5bf657cd9a
14 changed files with 94 additions and 82 deletions

View File

@ -21,7 +21,7 @@
<file>webapi/doc/swagger/include/Perseus.yaml</file>
<file>webapi/doc/swagger/include/PlutoSdr.yaml</file>
<file>webapi/doc/swagger/include/RtlSdr.yaml</file>
<file>webapi/doc/swagger/include/SDRDaemonChannel.yaml</file>
<file>webapi/doc/swagger/include/SDRDaemonChannelSink.yaml</file>
<file>webapi/doc/swagger/include/SDRDaemonSource.yaml</file>
<file>webapi/doc/swagger/include/SDRDaemonSink.yaml</file>
<file>webapi/doc/swagger/include/SDRPlay.yaml</file>

View File

@ -1467,8 +1467,8 @@ margin-bottom: 20px;
"NFMModSettings" : {
"$ref" : "#/definitions/NFMModSettings"
},
"SDRDaemonChannelSettings" : {
"$ref" : "#/definitions/SDRDaemonChannelSettings"
"SDRDaemonChannelSinkSettings" : {
"$ref" : "#/definitions/SDRDaemonChannelSinkSettings"
},
"SSBModSettings" : {
"$ref" : "#/definitions/SSBModSettings"
@ -3146,7 +3146,7 @@ margin-bottom: 20px;
},
"description" : "RTLSDR"
};
defs.SDRDaemonChannelSettings = {
defs.SDRDaemonChannelSinkSettings = {
"properties" : {
"nbFECBlocks" : {
"type" : "integer",
@ -28215,7 +28215,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2018-08-23T14:53:21.934+02:00
Generated 2018-08-23T17:21:24.907+02:00
</div>
</div>
</div>

View File

@ -1,4 +1,4 @@
SDRDaemonChannelSettings:
SDRDaemonChannelSinkSettings:
description: "Data handling details for SDRDaemon"
properties:
nbFECBlocks:

View File

@ -2194,8 +2194,8 @@ definitions:
$ref: "/doc/swagger/include/NFMDemod.yaml#/NFMDemodSettings"
NFMModSettings:
$ref: "/doc/swagger/include/NFMMod.yaml#/NFMModSettings"
SDRDaemonChannelSettings:
$ref: "/doc/swagger/include/SDRDaemonChannel.yaml#/SDRDaemonChannelSettings"
SDRDaemonChannelSinkSettings:
$ref: "/doc/swagger/include/SDRDaemonChannelSink.yaml#/SDRDaemonChannelSinkSettings"
SSBModSettings:
$ref: "/doc/swagger/include/SSBMod.yaml#/SSBModSettings"
SSBDemodSettings:

View File

@ -2146,13 +2146,19 @@ bool WebAPIRequestMapper::validateChannelSettings(
return false;
}
}
else if (*channelType == "SDRDaemonChannel")
else if (*channelType == "SDRDaemonChannelSink")
{
QJsonObject sdrDaemonChannelSettingsJsonObject = jsonObject["SDRDaemonChannelSettings"].toObject();
channelSettingsKeys = sdrDaemonChannelSettingsJsonObject.keys();
channelSettings.setSdrDaemonChannelSettings(new SWGSDRangel::SWGSDRDaemonChannelSettings());
channelSettings.getSdrDaemonChannelSettings()->fromJsonObject(sdrDaemonChannelSettingsJsonObject);
return true;
if (channelSettings.getTx() == 0)
{
QJsonObject sdrDaemonChannelSinkSettingsJsonObject = jsonObject["SDRDaemonChannelSinkSettings"].toObject();
channelSettingsKeys = sdrDaemonChannelSinkSettingsJsonObject.keys();
channelSettings.setSdrDaemonChannelSinkSettings(new SWGSDRangel::SWGSDRDaemonChannelSinkSettings());
channelSettings.getSdrDaemonChannelSinkSettings()->fromJsonObject(sdrDaemonChannelSinkSettingsJsonObject);
return true;
}
else {
return false;
}
}
else if (*channelType == "SSBDemod")
{
@ -2392,7 +2398,7 @@ void WebAPIRequestMapper::resetChannelSettings(SWGSDRangel::SWGChannelSettings&
channelSettings.setDsdDemodSettings(0);
channelSettings.setNfmDemodSettings(0);
channelSettings.setNfmModSettings(0);
channelSettings.setSdrDaemonChannelSettings(0);
channelSettings.setSdrDaemonChannelSinkSettings(0);
channelSettings.setSsbDemodSettings(0);
channelSettings.setSsbModSettings(0);
channelSettings.setUdpSinkSettings(0);

View File

@ -545,13 +545,19 @@ bool WebAPIRequestMapper::validateChannelSettings(
return false;
}
}
else if (*channelType == "SDRDaemonChannel")
else if (*channelType == "SDRDaemonChannelSink")
{
QJsonObject sdrDaemonChannelSettingsJsonObject = jsonObject["SDRDaemonChannelSettings"].toObject();
channelSettingsKeys = sdrDaemonChannelSettingsJsonObject.keys();
channelSettings.setSdrDaemonChannelSettings(new SWGSDRangel::SWGSDRDaemonChannelSettings());
channelSettings.getSdrDaemonChannelSettings()->fromJsonObject(sdrDaemonChannelSettingsJsonObject);
return true;
if (channelSettings.getTx() == 0)
{
QJsonObject sdrDaemonChannelSinkSettingsJsonObject = jsonObject["SDRDaemonChannelSinkSettings"].toObject();
channelSettingsKeys = sdrDaemonChannelSinkSettingsJsonObject.keys();
channelSettings.setSdrDaemonChannelSinkSettings(new SWGSDRangel::SWGSDRDaemonChannelSinkSettings());
channelSettings.getSdrDaemonChannelSinkSettings()->fromJsonObject(sdrDaemonChannelSinkSettingsJsonObject);
return true;
}
else {
return false;
}
}
else if (*channelType == "SSBDemod")
{
@ -985,7 +991,7 @@ void WebAPIRequestMapper::resetChannelSettings(SWGSDRangel::SWGChannelSettings&
channelSettings.setDsdDemodSettings(0);
channelSettings.setNfmDemodSettings(0);
channelSettings.setNfmModSettings(0);
channelSettings.setSdrDaemonChannelSettings(0);
channelSettings.setSdrDaemonChannelSinkSettings(0);
channelSettings.setSsbDemodSettings(0);
channelSettings.setSsbModSettings(0);
channelSettings.setUdpSinkSettings(0);

View File

@ -1,4 +1,4 @@
SDRDaemonChannelSettings:
SDRDaemonChannelSinkSettings:
description: "Data handling details for SDRDaemon"
properties:
nbFECBlocks:

View File

@ -2194,8 +2194,8 @@ definitions:
$ref: "http://localhost:8081/api/swagger/include/NFMDemod.yaml#/NFMDemodSettings"
NFMModSettings:
$ref: "http://localhost:8081/api/swagger/include/NFMMod.yaml#/NFMModSettings"
SDRDaemonChannelSettings:
$ref: "http://localhost:8081/api/swagger/include/SDRDaemonChannel.yaml#/SDRDaemonChannelSettings"
SDRDaemonChannelSinkSettings:
$ref: "http://localhost:8081/api/swagger/include/SDRDaemonChannelSink.yaml#/SDRDaemonChannelSinkSettings"
SSBModSettings:
$ref: "http://localhost:8081/api/swagger/include/SSBMod.yaml#/SSBModSettings"
SSBDemodSettings:

View File

@ -1467,8 +1467,8 @@ margin-bottom: 20px;
"NFMModSettings" : {
"$ref" : "#/definitions/NFMModSettings"
},
"SDRDaemonChannelSettings" : {
"$ref" : "#/definitions/SDRDaemonChannelSettings"
"SDRDaemonChannelSinkSettings" : {
"$ref" : "#/definitions/SDRDaemonChannelSinkSettings"
},
"SSBModSettings" : {
"$ref" : "#/definitions/SSBModSettings"
@ -3146,7 +3146,7 @@ margin-bottom: 20px;
},
"description" : "RTLSDR"
};
defs.SDRDaemonChannelSettings = {
defs.SDRDaemonChannelSinkSettings = {
"properties" : {
"nbFECBlocks" : {
"type" : "integer",
@ -28215,7 +28215,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2018-08-23T14:53:21.934+02:00
Generated 2018-08-23T17:21:24.907+02:00
</div>
</div>
</div>

View File

@ -46,8 +46,8 @@ SWGChannelSettings::SWGChannelSettings() {
m_nfm_demod_settings_isSet = false;
nfm_mod_settings = nullptr;
m_nfm_mod_settings_isSet = false;
sdr_daemon_channel_settings = nullptr;
m_sdr_daemon_channel_settings_isSet = false;
sdr_daemon_channel_sink_settings = nullptr;
m_sdr_daemon_channel_sink_settings_isSet = false;
ssb_mod_settings = nullptr;
m_ssb_mod_settings_isSet = false;
ssb_demod_settings = nullptr;
@ -86,8 +86,8 @@ SWGChannelSettings::init() {
m_nfm_demod_settings_isSet = false;
nfm_mod_settings = new SWGNFMModSettings();
m_nfm_mod_settings_isSet = false;
sdr_daemon_channel_settings = new SWGSDRDaemonChannelSettings();
m_sdr_daemon_channel_settings_isSet = false;
sdr_daemon_channel_sink_settings = new SWGSDRDaemonChannelSinkSettings();
m_sdr_daemon_channel_sink_settings_isSet = false;
ssb_mod_settings = new SWGSSBModSettings();
m_ssb_mod_settings_isSet = false;
ssb_demod_settings = new SWGSSBDemodSettings();
@ -129,8 +129,8 @@ SWGChannelSettings::cleanup() {
if(nfm_mod_settings != nullptr) {
delete nfm_mod_settings;
}
if(sdr_daemon_channel_settings != nullptr) {
delete sdr_daemon_channel_settings;
if(sdr_daemon_channel_sink_settings != nullptr) {
delete sdr_daemon_channel_sink_settings;
}
if(ssb_mod_settings != nullptr) {
delete ssb_mod_settings;
@ -181,7 +181,7 @@ SWGChannelSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&nfm_mod_settings, pJson["NFMModSettings"], "SWGNFMModSettings", "SWGNFMModSettings");
::SWGSDRangel::setValue(&sdr_daemon_channel_settings, pJson["SDRDaemonChannelSettings"], "SWGSDRDaemonChannelSettings", "SWGSDRDaemonChannelSettings");
::SWGSDRangel::setValue(&sdr_daemon_channel_sink_settings, pJson["SDRDaemonChannelSinkSettings"], "SWGSDRDaemonChannelSinkSettings", "SWGSDRDaemonChannelSinkSettings");
::SWGSDRangel::setValue(&ssb_mod_settings, pJson["SSBModSettings"], "SWGSSBModSettings", "SWGSSBModSettings");
@ -238,8 +238,8 @@ SWGChannelSettings::asJsonObject() {
if((nfm_mod_settings != nullptr) && (nfm_mod_settings->isSet())){
toJsonValue(QString("NFMModSettings"), nfm_mod_settings, obj, QString("SWGNFMModSettings"));
}
if((sdr_daemon_channel_settings != nullptr) && (sdr_daemon_channel_settings->isSet())){
toJsonValue(QString("SDRDaemonChannelSettings"), sdr_daemon_channel_settings, obj, QString("SWGSDRDaemonChannelSettings"));
if((sdr_daemon_channel_sink_settings != nullptr) && (sdr_daemon_channel_sink_settings->isSet())){
toJsonValue(QString("SDRDaemonChannelSinkSettings"), sdr_daemon_channel_sink_settings, obj, QString("SWGSDRDaemonChannelSinkSettings"));
}
if((ssb_mod_settings != nullptr) && (ssb_mod_settings->isSet())){
toJsonValue(QString("SSBModSettings"), ssb_mod_settings, obj, QString("SWGSSBModSettings"));
@ -353,14 +353,14 @@ SWGChannelSettings::setNfmModSettings(SWGNFMModSettings* nfm_mod_settings) {
this->m_nfm_mod_settings_isSet = true;
}
SWGSDRDaemonChannelSettings*
SWGChannelSettings::getSdrDaemonChannelSettings() {
return sdr_daemon_channel_settings;
SWGSDRDaemonChannelSinkSettings*
SWGChannelSettings::getSdrDaemonChannelSinkSettings() {
return sdr_daemon_channel_sink_settings;
}
void
SWGChannelSettings::setSdrDaemonChannelSettings(SWGSDRDaemonChannelSettings* sdr_daemon_channel_settings) {
this->sdr_daemon_channel_settings = sdr_daemon_channel_settings;
this->m_sdr_daemon_channel_settings_isSet = true;
SWGChannelSettings::setSdrDaemonChannelSinkSettings(SWGSDRDaemonChannelSinkSettings* sdr_daemon_channel_sink_settings) {
this->sdr_daemon_channel_sink_settings = sdr_daemon_channel_sink_settings;
this->m_sdr_daemon_channel_sink_settings_isSet = true;
}
SWGSSBModSettings*
@ -437,7 +437,7 @@ SWGChannelSettings::isSet(){
if(dsd_demod_settings != nullptr && dsd_demod_settings->isSet()){ isObjectUpdated = true; break;}
if(nfm_demod_settings != nullptr && nfm_demod_settings->isSet()){ isObjectUpdated = true; break;}
if(nfm_mod_settings != nullptr && nfm_mod_settings->isSet()){ isObjectUpdated = true; break;}
if(sdr_daemon_channel_settings != nullptr && sdr_daemon_channel_settings->isSet()){ isObjectUpdated = true; break;}
if(sdr_daemon_channel_sink_settings != nullptr && sdr_daemon_channel_sink_settings->isSet()){ isObjectUpdated = true; break;}
if(ssb_mod_settings != nullptr && ssb_mod_settings->isSet()){ isObjectUpdated = true; break;}
if(ssb_demod_settings != nullptr && ssb_demod_settings->isSet()){ isObjectUpdated = true; break;}
if(udp_sink_settings != nullptr && udp_sink_settings->isSet()){ isObjectUpdated = true; break;}

View File

@ -29,7 +29,7 @@
#include "SWGDSDDemodSettings.h"
#include "SWGNFMDemodSettings.h"
#include "SWGNFMModSettings.h"
#include "SWGSDRDaemonChannelSettings.h"
#include "SWGSDRDaemonChannelSinkSettings.h"
#include "SWGSSBDemodSettings.h"
#include "SWGSSBModSettings.h"
#include "SWGUDPSinkSettings.h"
@ -83,8 +83,8 @@ public:
SWGNFMModSettings* getNfmModSettings();
void setNfmModSettings(SWGNFMModSettings* nfm_mod_settings);
SWGSDRDaemonChannelSettings* getSdrDaemonChannelSettings();
void setSdrDaemonChannelSettings(SWGSDRDaemonChannelSettings* sdr_daemon_channel_settings);
SWGSDRDaemonChannelSinkSettings* getSdrDaemonChannelSinkSettings();
void setSdrDaemonChannelSinkSettings(SWGSDRDaemonChannelSinkSettings* sdr_daemon_channel_sink_settings);
SWGSSBModSettings* getSsbModSettings();
void setSsbModSettings(SWGSSBModSettings* ssb_mod_settings);
@ -135,8 +135,8 @@ private:
SWGNFMModSettings* nfm_mod_settings;
bool m_nfm_mod_settings_isSet;
SWGSDRDaemonChannelSettings* sdr_daemon_channel_settings;
bool m_sdr_daemon_channel_settings_isSet;
SWGSDRDaemonChannelSinkSettings* sdr_daemon_channel_sink_settings;
bool m_sdr_daemon_channel_sink_settings_isSet;
SWGSSBModSettings* ssb_mod_settings;
bool m_ssb_mod_settings_isSet;

View File

@ -89,7 +89,7 @@
#include "SWGRDSReport_altFrequencies.h"
#include "SWGRtlSdrReport.h"
#include "SWGRtlSdrSettings.h"
#include "SWGSDRDaemonChannelSettings.h"
#include "SWGSDRDaemonChannelSinkSettings.h"
#include "SWGSDRPlayReport.h"
#include "SWGSDRPlaySettings.h"
#include "SWGSDRdaemonSinkReport.h"
@ -341,8 +341,8 @@ namespace SWGSDRangel {
if(QString("SWGRtlSdrSettings").compare(type) == 0) {
return new SWGRtlSdrSettings();
}
if(QString("SWGSDRDaemonChannelSettings").compare(type) == 0) {
return new SWGSDRDaemonChannelSettings();
if(QString("SWGSDRDaemonChannelSinkSettings").compare(type) == 0) {
return new SWGSDRDaemonChannelSinkSettings();
}
if(QString("SWGSDRPlayReport").compare(type) == 0) {
return new SWGSDRPlayReport();

View File

@ -11,7 +11,7 @@
*/
#include "SWGSDRDaemonChannelSettings.h"
#include "SWGSDRDaemonChannelSinkSettings.h"
#include "SWGHelpers.h"
@ -22,12 +22,12 @@
namespace SWGSDRangel {
SWGSDRDaemonChannelSettings::SWGSDRDaemonChannelSettings(QString* json) {
SWGSDRDaemonChannelSinkSettings::SWGSDRDaemonChannelSinkSettings(QString* json) {
init();
this->fromJson(*json);
}
SWGSDRDaemonChannelSettings::SWGSDRDaemonChannelSettings() {
SWGSDRDaemonChannelSinkSettings::SWGSDRDaemonChannelSinkSettings() {
nb_fec_blocks = 0;
m_nb_fec_blocks_isSet = false;
data_address = nullptr;
@ -38,12 +38,12 @@ SWGSDRDaemonChannelSettings::SWGSDRDaemonChannelSettings() {
m_tx_delay_isSet = false;
}
SWGSDRDaemonChannelSettings::~SWGSDRDaemonChannelSettings() {
SWGSDRDaemonChannelSinkSettings::~SWGSDRDaemonChannelSinkSettings() {
this->cleanup();
}
void
SWGSDRDaemonChannelSettings::init() {
SWGSDRDaemonChannelSinkSettings::init() {
nb_fec_blocks = 0;
m_nb_fec_blocks_isSet = false;
data_address = new QString("");
@ -55,7 +55,7 @@ SWGSDRDaemonChannelSettings::init() {
}
void
SWGSDRDaemonChannelSettings::cleanup() {
SWGSDRDaemonChannelSinkSettings::cleanup() {
if(data_address != nullptr) {
delete data_address;
@ -64,8 +64,8 @@ SWGSDRDaemonChannelSettings::cleanup() {
}
SWGSDRDaemonChannelSettings*
SWGSDRDaemonChannelSettings::fromJson(QString &json) {
SWGSDRDaemonChannelSinkSettings*
SWGSDRDaemonChannelSinkSettings::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
@ -74,7 +74,7 @@ SWGSDRDaemonChannelSettings::fromJson(QString &json) {
}
void
SWGSDRDaemonChannelSettings::fromJsonObject(QJsonObject &pJson) {
SWGSDRDaemonChannelSinkSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&nb_fec_blocks, pJson["nbFECBlocks"], "qint32", "");
::SWGSDRangel::setValue(&data_address, pJson["dataAddress"], "QString", "QString");
@ -86,7 +86,7 @@ SWGSDRDaemonChannelSettings::fromJsonObject(QJsonObject &pJson) {
}
QString
SWGSDRDaemonChannelSettings::asJson ()
SWGSDRDaemonChannelSinkSettings::asJson ()
{
QJsonObject* obj = this->asJsonObject();
@ -97,7 +97,7 @@ SWGSDRDaemonChannelSettings::asJson ()
}
QJsonObject*
SWGSDRDaemonChannelSettings::asJsonObject() {
SWGSDRDaemonChannelSinkSettings::asJsonObject() {
QJsonObject* obj = new QJsonObject();
if(m_nb_fec_blocks_isSet){
obj->insert("nbFECBlocks", QJsonValue(nb_fec_blocks));
@ -116,48 +116,48 @@ SWGSDRDaemonChannelSettings::asJsonObject() {
}
qint32
SWGSDRDaemonChannelSettings::getNbFecBlocks() {
SWGSDRDaemonChannelSinkSettings::getNbFecBlocks() {
return nb_fec_blocks;
}
void
SWGSDRDaemonChannelSettings::setNbFecBlocks(qint32 nb_fec_blocks) {
SWGSDRDaemonChannelSinkSettings::setNbFecBlocks(qint32 nb_fec_blocks) {
this->nb_fec_blocks = nb_fec_blocks;
this->m_nb_fec_blocks_isSet = true;
}
QString*
SWGSDRDaemonChannelSettings::getDataAddress() {
SWGSDRDaemonChannelSinkSettings::getDataAddress() {
return data_address;
}
void
SWGSDRDaemonChannelSettings::setDataAddress(QString* data_address) {
SWGSDRDaemonChannelSinkSettings::setDataAddress(QString* data_address) {
this->data_address = data_address;
this->m_data_address_isSet = true;
}
qint32
SWGSDRDaemonChannelSettings::getDataPort() {
SWGSDRDaemonChannelSinkSettings::getDataPort() {
return data_port;
}
void
SWGSDRDaemonChannelSettings::setDataPort(qint32 data_port) {
SWGSDRDaemonChannelSinkSettings::setDataPort(qint32 data_port) {
this->data_port = data_port;
this->m_data_port_isSet = true;
}
qint32
SWGSDRDaemonChannelSettings::getTxDelay() {
SWGSDRDaemonChannelSinkSettings::getTxDelay() {
return tx_delay;
}
void
SWGSDRDaemonChannelSettings::setTxDelay(qint32 tx_delay) {
SWGSDRDaemonChannelSinkSettings::setTxDelay(qint32 tx_delay) {
this->tx_delay = tx_delay;
this->m_tx_delay_isSet = true;
}
bool
SWGSDRDaemonChannelSettings::isSet(){
SWGSDRDaemonChannelSinkSettings::isSet(){
bool isObjectUpdated = false;
do{
if(m_nb_fec_blocks_isSet){ isObjectUpdated = true; break;}

View File

@ -11,13 +11,13 @@
*/
/*
* SWGSDRDaemonChannelSettings.h
* SWGSDRDaemonChannelSinkSettings.h
*
* Data handling details for SDRDaemon
*/
#ifndef SWGSDRDaemonChannelSettings_H_
#define SWGSDRDaemonChannelSettings_H_
#ifndef SWGSDRDaemonChannelSinkSettings_H_
#define SWGSDRDaemonChannelSinkSettings_H_
#include <QJsonObject>
@ -29,18 +29,18 @@
namespace SWGSDRangel {
class SWG_API SWGSDRDaemonChannelSettings: public SWGObject {
class SWG_API SWGSDRDaemonChannelSinkSettings: public SWGObject {
public:
SWGSDRDaemonChannelSettings();
SWGSDRDaemonChannelSettings(QString* json);
virtual ~SWGSDRDaemonChannelSettings();
SWGSDRDaemonChannelSinkSettings();
SWGSDRDaemonChannelSinkSettings(QString* json);
virtual ~SWGSDRDaemonChannelSinkSettings();
void init();
void cleanup();
virtual QString asJson () override;
virtual QJsonObject* asJsonObject() override;
virtual void fromJsonObject(QJsonObject &json) override;
virtual SWGSDRDaemonChannelSettings* fromJson(QString &jsonString) override;
virtual SWGSDRDaemonChannelSinkSettings* fromJson(QString &jsonString) override;
qint32 getNbFecBlocks();
void setNbFecBlocks(qint32 nb_fec_blocks);
@ -74,4 +74,4 @@ private:
}
#endif /* SWGSDRDaemonChannelSettings_H_ */
#endif /* SWGSDRDaemonChannelSinkSettings_H_ */