mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-26 01:39:05 -05:00
Reverse API: UDP source
This commit is contained in:
parent
f8f01d928f
commit
dc05df2bcc
@ -15,6 +15,9 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <QDebug>
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QNetworkReply>
|
||||
#include <QBuffer>
|
||||
|
||||
#include "SWGChannelSettings.h"
|
||||
#include "SWGChannelReport.h"
|
||||
@ -78,10 +81,15 @@ UDPSource::UDPSource(DeviceSinkAPI *deviceAPI) :
|
||||
m_threadedChannelizer = new ThreadedBasebandSampleSource(m_channelizer, this);
|
||||
m_deviceAPI->addThreadedSource(m_threadedChannelizer);
|
||||
m_deviceAPI->addChannelAPI(this);
|
||||
|
||||
m_networkManager = new QNetworkAccessManager();
|
||||
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
}
|
||||
|
||||
UDPSource::~UDPSource()
|
||||
{
|
||||
disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
delete m_networkManager;
|
||||
m_deviceAPI->removeChannelAPI(this);
|
||||
m_deviceAPI->removeThreadedSource(m_threadedChannelizer);
|
||||
delete m_threadedChannelizer;
|
||||
@ -489,6 +497,7 @@ void UDPSource::applySettings(const UDPSourceSettings& settings, bool force)
|
||||
<< " m_rfBandwidth: " << settings.m_rfBandwidth
|
||||
<< " m_lowCutoff: " << settings.m_lowCutoff
|
||||
<< " m_fmDeviation: " << settings.m_fmDeviation
|
||||
<< " m_amModFactor: " << settings.m_amModFactor
|
||||
<< " m_udpAddressStr: " << settings.m_udpAddress
|
||||
<< " m_udpPort: " << settings.m_udpPort
|
||||
<< " m_channelMute: " << settings.m_channelMute
|
||||
@ -501,6 +510,60 @@ void UDPSource::applySettings(const UDPSourceSettings& settings, bool force)
|
||||
<< " m_stereoInput: " << settings.m_stereoInput
|
||||
<< " force: " << force;
|
||||
|
||||
QList<QString> reverseAPIKeys;
|
||||
|
||||
if ((settings.m_inputFrequencyOffset != m_settings.m_inputFrequencyOffset) || force) {
|
||||
reverseAPIKeys.append("inputFrequencyOffset");
|
||||
}
|
||||
if ((settings.m_sampleFormat != m_settings.m_sampleFormat) || force) {
|
||||
reverseAPIKeys.append("sampleFormat");
|
||||
}
|
||||
if ((settings.m_inputSampleRate != m_settings.m_inputSampleRate) || force) {
|
||||
reverseAPIKeys.append("inputSampleRate");
|
||||
}
|
||||
if ((settings.m_rfBandwidth != m_settings.m_rfBandwidth) || force) {
|
||||
reverseAPIKeys.append("rfBandwidth");
|
||||
}
|
||||
if ((settings.m_lowCutoff != m_settings.m_lowCutoff) || force) {
|
||||
reverseAPIKeys.append("lowCutoff");
|
||||
}
|
||||
if ((settings.m_fmDeviation != m_settings.m_fmDeviation) || force) {
|
||||
reverseAPIKeys.append("fmDeviation");
|
||||
}
|
||||
if ((settings.m_amModFactor != m_settings.m_amModFactor) || force) {
|
||||
reverseAPIKeys.append("amModFactor");
|
||||
}
|
||||
if ((settings.m_udpAddress != m_settings.m_udpAddress) || force) {
|
||||
reverseAPIKeys.append("udpAddress");
|
||||
}
|
||||
if ((settings.m_udpPort != m_settings.m_udpPort) || force) {
|
||||
reverseAPIKeys.append("udpPort");
|
||||
}
|
||||
if ((settings.m_channelMute != m_settings.m_channelMute) || force) {
|
||||
reverseAPIKeys.append("channelMute");
|
||||
}
|
||||
if ((settings.m_gainIn != m_settings.m_gainIn) || force) {
|
||||
reverseAPIKeys.append("gainIn");
|
||||
}
|
||||
if ((settings.m_gainOut != m_settings.m_gainOut) || force) {
|
||||
reverseAPIKeys.append("gainOut");
|
||||
}
|
||||
if ((settings.m_squelchGate != m_settings.m_squelchGate) || force) {
|
||||
reverseAPIKeys.append("squelchGate");
|
||||
}
|
||||
if ((settings.m_squelch != m_settings.m_squelch) || force) {
|
||||
reverseAPIKeys.append("squelch");
|
||||
}
|
||||
if ((settings.m_squelchEnabled != m_settings.m_squelchEnabled) || force) {
|
||||
reverseAPIKeys.append("squelchEnabled");
|
||||
}
|
||||
if ((settings.m_autoRWBalance != m_settings.m_autoRWBalance) || force) {
|
||||
reverseAPIKeys.append("autoRWBalance");
|
||||
}
|
||||
if ((settings.m_stereoInput != m_settings.m_stereoInput) || force) {
|
||||
reverseAPIKeys.append("stereoInput");
|
||||
}
|
||||
|
||||
if((settings.m_rfBandwidth != m_settings.m_rfBandwidth) ||
|
||||
(settings.m_lowCutoff != m_settings.m_lowCutoff) ||
|
||||
(settings.m_inputSampleRate != m_settings.m_inputSampleRate) || force)
|
||||
@ -572,6 +635,16 @@ void UDPSource::applySettings(const UDPSourceSettings& settings, bool force)
|
||||
m_settingsMutex.unlock();
|
||||
}
|
||||
|
||||
if (settings.m_useReverseAPI)
|
||||
{
|
||||
bool fullUpdate = ((m_settings.m_useReverseAPI != settings.m_useReverseAPI) && settings.m_useReverseAPI) ||
|
||||
(m_settings.m_reverseAPIAddress != settings.m_reverseAPIAddress) ||
|
||||
(m_settings.m_reverseAPIPort != settings.m_reverseAPIPort) ||
|
||||
(m_settings.m_reverseAPIDeviceIndex != settings.m_reverseAPIDeviceIndex) ||
|
||||
(m_settings.m_reverseAPIChannelIndex != settings.m_reverseAPIChannelIndex);
|
||||
webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force);
|
||||
}
|
||||
|
||||
m_settings = settings;
|
||||
}
|
||||
|
||||
@ -677,6 +750,21 @@ int UDPSource::webapiSettingsPutPatch(
|
||||
if (channelSettingsKeys.contains("title")) {
|
||||
settings.m_title = *response.getUdpSourceSettings()->getTitle();
|
||||
}
|
||||
if (channelSettingsKeys.contains("useReverseAPI")) {
|
||||
settings.m_useReverseAPI = response.getUdpSourceSettings()->getUseReverseApi() != 0;
|
||||
}
|
||||
if (channelSettingsKeys.contains("reverseAPIAddress")) {
|
||||
settings.m_reverseAPIAddress = *response.getUdpSourceSettings()->getReverseApiAddress() != 0;
|
||||
}
|
||||
if (channelSettingsKeys.contains("reverseAPIPort")) {
|
||||
settings.m_reverseAPIPort = response.getUdpSourceSettings()->getReverseApiPort();
|
||||
}
|
||||
if (channelSettingsKeys.contains("reverseAPIDeviceIndex")) {
|
||||
settings.m_reverseAPIDeviceIndex = response.getUdpSourceSettings()->getReverseApiDeviceIndex();
|
||||
}
|
||||
if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
|
||||
settings.m_reverseAPIChannelIndex = response.getUdpSourceSettings()->getReverseApiChannelIndex();
|
||||
}
|
||||
|
||||
if (frequencyOffsetChanged)
|
||||
{
|
||||
@ -743,6 +831,18 @@ void UDPSource::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& res
|
||||
} else {
|
||||
response.getUdpSourceSettings()->setTitle(new QString(settings.m_title));
|
||||
}
|
||||
|
||||
response.getUdpSourceSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
|
||||
|
||||
if (response.getUdpSourceSettings()->getReverseApiAddress()) {
|
||||
*response.getUdpSourceSettings()->getReverseApiAddress() = settings.m_reverseAPIAddress;
|
||||
} else {
|
||||
response.getUdpSourceSettings()->setReverseApiAddress(new QString(settings.m_reverseAPIAddress));
|
||||
}
|
||||
|
||||
response.getUdpSourceSettings()->setReverseApiPort(settings.m_reverseAPIPort);
|
||||
response.getUdpSourceSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
|
||||
response.getUdpSourceSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex);
|
||||
}
|
||||
|
||||
void UDPSource::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
|
||||
@ -753,3 +853,108 @@ void UDPSource::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& respons
|
||||
response.getUdpSourceReport()->setBufferGauge(getBufferGauge());
|
||||
response.getUdpSourceReport()->setChannelSampleRate(m_outputSampleRate);
|
||||
}
|
||||
|
||||
void UDPSource::webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const UDPSourceSettings& settings, bool force)
|
||||
{
|
||||
SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings();
|
||||
swgChannelSettings->setTx(1);
|
||||
swgChannelSettings->setChannelType(new QString("UDPSource"));
|
||||
swgChannelSettings->setUdpSourceSettings(new SWGSDRangel::SWGUDPSourceSettings());
|
||||
SWGSDRangel::SWGUDPSourceSettings *swgUDPSourceSettings = swgChannelSettings->getUdpSourceSettings();
|
||||
|
||||
// transfer data that has been modified. When force is on transfer all data except reverse API data
|
||||
|
||||
if (channelSettingsKeys.contains("sampleFormat") || force) {
|
||||
swgUDPSourceSettings->setSampleFormat((int) settings.m_sampleFormat);
|
||||
}
|
||||
if (channelSettingsKeys.contains("inputSampleRate") || force) {
|
||||
swgUDPSourceSettings->setInputSampleRate(settings.m_inputSampleRate);
|
||||
}
|
||||
if (channelSettingsKeys.contains("inputFrequencyOffset") || force) {
|
||||
swgUDPSourceSettings->setInputFrequencyOffset(settings.m_inputFrequencyOffset);
|
||||
}
|
||||
if (channelSettingsKeys.contains("rfBandwidth") || force) {
|
||||
swgUDPSourceSettings->setRfBandwidth(settings.m_rfBandwidth);
|
||||
}
|
||||
if (channelSettingsKeys.contains("lowCutoff") || force) {
|
||||
swgUDPSourceSettings->setLowCutoff(settings.m_lowCutoff);
|
||||
}
|
||||
if (channelSettingsKeys.contains("fmDeviation") || force) {
|
||||
swgUDPSourceSettings->setFmDeviation(settings.m_fmDeviation);
|
||||
}
|
||||
if (channelSettingsKeys.contains("amModFactor") || force) {
|
||||
swgUDPSourceSettings->setAmModFactor(settings.m_amModFactor);
|
||||
}
|
||||
if (channelSettingsKeys.contains("channelMute") || force) {
|
||||
swgUDPSourceSettings->setChannelMute(settings.m_channelMute ? 1 : 0);
|
||||
}
|
||||
if (channelSettingsKeys.contains("gainIn") || force) {
|
||||
swgUDPSourceSettings->setGainIn(settings.m_gainIn);
|
||||
}
|
||||
if (channelSettingsKeys.contains("gainOut") || force) {
|
||||
swgUDPSourceSettings->setGainOut(settings.m_gainOut);
|
||||
}
|
||||
if (channelSettingsKeys.contains("squelch") || force) {
|
||||
swgUDPSourceSettings->setSquelch(settings.m_squelch);
|
||||
}
|
||||
if (channelSettingsKeys.contains("squelchGate") || force) {
|
||||
swgUDPSourceSettings->setSquelchGate(settings.m_squelchGate);
|
||||
}
|
||||
if (channelSettingsKeys.contains("squelchEnabled") || force) {
|
||||
swgUDPSourceSettings->setSquelchEnabled(settings.m_squelchEnabled ? 1 : 0);
|
||||
}
|
||||
if (channelSettingsKeys.contains("autoRWBalance") || force) {
|
||||
swgUDPSourceSettings->setAutoRwBalance(settings.m_autoRWBalance ? 1 : 0);
|
||||
}
|
||||
if (channelSettingsKeys.contains("stereoInput") || force) {
|
||||
swgUDPSourceSettings->setStereoInput(settings.m_stereoInput ? 1 : 0);
|
||||
}
|
||||
if (channelSettingsKeys.contains("rgbColor") || force) {
|
||||
swgUDPSourceSettings->setRgbColor(settings.m_rgbColor);
|
||||
}
|
||||
if (channelSettingsKeys.contains("udpAddress") || force) {
|
||||
swgUDPSourceSettings->setUdpAddress(new QString(settings.m_udpAddress));
|
||||
}
|
||||
if (channelSettingsKeys.contains("udpPort") || force) {
|
||||
swgUDPSourceSettings->setUdpPort(settings.m_udpPort);
|
||||
}
|
||||
if (channelSettingsKeys.contains("title") || force) {
|
||||
swgUDPSourceSettings->setTitle(new QString(settings.m_title));
|
||||
}
|
||||
|
||||
QString channelSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/channel/%4/settings")
|
||||
.arg(settings.m_reverseAPIAddress)
|
||||
.arg(settings.m_reverseAPIPort)
|
||||
.arg(settings.m_reverseAPIDeviceIndex)
|
||||
.arg(settings.m_reverseAPIChannelIndex);
|
||||
m_networkRequest.setUrl(QUrl(channelSettingsURL));
|
||||
m_networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
||||
|
||||
QBuffer *buffer=new QBuffer();
|
||||
buffer->open((QBuffer::ReadWrite));
|
||||
buffer->write(swgChannelSettings->asJson().toUtf8());
|
||||
buffer->seek(0);
|
||||
|
||||
// Always use PATCH to avoid passing reverse API settings
|
||||
m_networkManager->sendCustomRequest(m_networkRequest, "PATCH", buffer);
|
||||
|
||||
delete swgChannelSettings;
|
||||
}
|
||||
|
||||
void UDPSource::networkManagerFinished(QNetworkReply *reply)
|
||||
{
|
||||
QNetworkReply::NetworkError replyError = reply->error();
|
||||
|
||||
if (replyError)
|
||||
{
|
||||
qWarning() << "UDPSource::networkManagerFinished:"
|
||||
<< " error(" << (int) replyError
|
||||
<< "): " << replyError
|
||||
<< ": " << reply->errorString();
|
||||
return;
|
||||
}
|
||||
|
||||
QString answer = reply->readAll();
|
||||
answer.chop(1); // remove last \n
|
||||
qDebug("UDPSource::networkManagerFinished: reply:\n%s", answer.toStdString().c_str());
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
#define PLUGINS_CHANNELTX_UDPSINK_UDPSOURCE_H_
|
||||
|
||||
#include <QObject>
|
||||
#include <QNetworkRequest>
|
||||
|
||||
#include "dsp/basebandsamplesource.h"
|
||||
#include "channel/channelsourceapi.h"
|
||||
@ -31,6 +32,8 @@
|
||||
#include "udpsourcesettings.h"
|
||||
#include "udpsourceudphandler.h"
|
||||
|
||||
class QNetworkAccessManager;
|
||||
class QNetworkReply;
|
||||
class DeviceSinkAPI;
|
||||
class ThreadedBasebandSampleSource;
|
||||
class UpChannelizer;
|
||||
@ -138,6 +141,9 @@ signals:
|
||||
*/
|
||||
void levelChanged(qreal rmsLevel, qreal peakLevel, int numSamples);
|
||||
|
||||
private slots:
|
||||
void networkManagerFinished(QNetworkReply *reply);
|
||||
|
||||
private:
|
||||
class MsgUDPSourceSpectrum : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
@ -226,6 +232,9 @@ private:
|
||||
Complex* m_SSBFilterBuffer;
|
||||
int m_SSBFilterBufferIndex;
|
||||
|
||||
QNetworkAccessManager *m_networkManager;
|
||||
QNetworkRequest m_networkRequest;
|
||||
|
||||
QMutex m_settingsMutex;
|
||||
|
||||
static const int m_sampleRateAverageItems = 17;
|
||||
@ -239,6 +248,7 @@ private:
|
||||
|
||||
void webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const UDPSourceSettings& settings);
|
||||
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
|
||||
void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const UDPSourceSettings& settings, bool force);
|
||||
|
||||
inline void calculateSquelch(double value)
|
||||
{
|
||||
|
@ -472,11 +472,22 @@ void UDPSourceGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
void UDPSourceGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
dialog.setReverseAPIAddress(m_settings.m_reverseAPIAddress);
|
||||
dialog.setReverseAPIPort(m_settings.m_reverseAPIPort);
|
||||
dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex);
|
||||
dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex);
|
||||
|
||||
dialog.move(p);
|
||||
dialog.exec();
|
||||
|
||||
m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency();
|
||||
m_settings.m_rgbColor = m_channelMarker.getColor().rgb();
|
||||
m_settings.m_useReverseAPI = dialog.useReverseAPI();
|
||||
m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress();
|
||||
m_settings.m_reverseAPIPort = dialog.getReverseAPIPort();
|
||||
m_settings.m_reverseAPIDeviceIndex = dialog.getReverseAPIDeviceIndex();
|
||||
m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex();
|
||||
|
||||
setWindowTitle(m_channelMarker.getTitle());
|
||||
setTitleColor(m_settings.m_rgbColor);
|
||||
|
@ -50,6 +50,11 @@ void UDPSourceSettings::resetToDefaults()
|
||||
m_udpPort = 9998;
|
||||
m_rgbColor = QColor(225, 25, 99).rgb();
|
||||
m_title = "UDP Sample Source";
|
||||
m_useReverseAPI = false;
|
||||
m_reverseAPIAddress = "127.0.0.1";
|
||||
m_reverseAPIPort = 8888;
|
||||
m_reverseAPIDeviceIndex = 0;
|
||||
m_reverseAPIChannelIndex = 0;
|
||||
}
|
||||
|
||||
QByteArray UDPSourceSettings::serialize() const
|
||||
@ -79,6 +84,11 @@ QByteArray UDPSourceSettings::serialize() const
|
||||
s.writeString(18, m_udpAddress);
|
||||
s.writeU32(19, m_udpPort);
|
||||
s.writeString(20, m_title);
|
||||
s.writeBool(21, m_useReverseAPI);
|
||||
s.writeString(22, m_reverseAPIAddress);
|
||||
s.writeU32(23, m_reverseAPIPort);
|
||||
s.writeU32(24, m_reverseAPIDeviceIndex);
|
||||
s.writeU32(25, m_reverseAPIChannelIndex);
|
||||
|
||||
return s.final();
|
||||
}
|
||||
@ -156,6 +166,21 @@ bool UDPSourceSettings::deserialize(const QByteArray& data)
|
||||
|
||||
d.readString(20, &m_title, "UDP Sample Sink");
|
||||
|
||||
d.readBool(21, &m_useReverseAPI, false);
|
||||
d.readString(22, &m_reverseAPIAddress, "127.0.0.1");
|
||||
d.readU32(23, &u32tmp, 0);
|
||||
|
||||
if ((u32tmp > 1023) && (u32tmp < 65535)) {
|
||||
m_reverseAPIPort = u32tmp;
|
||||
} else {
|
||||
m_reverseAPIPort = 8888;
|
||||
}
|
||||
|
||||
d.readU32(24, &u32tmp, 0);
|
||||
m_reverseAPIDeviceIndex = u32tmp > 99 ? 99 : u32tmp;
|
||||
d.readU32(25, &u32tmp, 0);
|
||||
m_reverseAPIChannelIndex = u32tmp > 99 ? 99 : u32tmp;
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
@ -58,6 +58,12 @@ struct UDPSourceSettings
|
||||
|
||||
QString m_title;
|
||||
|
||||
bool m_useReverseAPI;
|
||||
QString m_reverseAPIAddress;
|
||||
uint16_t m_reverseAPIPort;
|
||||
uint16_t m_reverseAPIDeviceIndex;
|
||||
uint16_t m_reverseAPIChannelIndex;
|
||||
|
||||
Serializable *m_channelMarker;
|
||||
Serializable *m_spectrumGUI;
|
||||
|
||||
|
@ -4638,6 +4638,22 @@ margin-bottom: 20px;
|
||||
},
|
||||
"title" : {
|
||||
"type" : "string"
|
||||
},
|
||||
"useReverseAPI" : {
|
||||
"type" : "integer",
|
||||
"description" : "Synchronize with reverse API (1 for yes, 0 for no)"
|
||||
},
|
||||
"reverseAPIAddress" : {
|
||||
"type" : "string"
|
||||
},
|
||||
"reverseAPIPort" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"reverseAPIDeviceIndex" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"reverseAPIChannelIndex" : {
|
||||
"type" : "integer"
|
||||
}
|
||||
},
|
||||
"description" : "UDPSource"
|
||||
@ -23813,7 +23829,7 @@ except ApiException as e:
|
||||
</div>
|
||||
<div id="generator">
|
||||
<div class="content">
|
||||
Generated 2018-12-21T16:19:50.202+01:00
|
||||
Generated 2018-12-21T16:57:30.140+01:00
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -49,6 +49,17 @@ UDPSourceSettings:
|
||||
format: uint16
|
||||
title:
|
||||
type: string
|
||||
useReverseAPI:
|
||||
description: Synchronize with reverse API (1 for yes, 0 for no)
|
||||
type: integer
|
||||
reverseAPIAddress:
|
||||
type: string
|
||||
reverseAPIPort:
|
||||
type: integer
|
||||
reverseAPIDeviceIndex:
|
||||
type: integer
|
||||
reverseAPIChannelIndex:
|
||||
type: integer
|
||||
|
||||
UDPSourceReport:
|
||||
description: UDPSource
|
||||
@ -69,4 +80,3 @@ UDPSourceReport:
|
||||
type: integer
|
||||
channelSampleRate:
|
||||
type: integer
|
||||
|
@ -49,6 +49,17 @@ UDPSourceSettings:
|
||||
format: uint16
|
||||
title:
|
||||
type: string
|
||||
useReverseAPI:
|
||||
description: Synchronize with reverse API (1 for yes, 0 for no)
|
||||
type: integer
|
||||
reverseAPIAddress:
|
||||
type: string
|
||||
reverseAPIPort:
|
||||
type: integer
|
||||
reverseAPIDeviceIndex:
|
||||
type: integer
|
||||
reverseAPIChannelIndex:
|
||||
type: integer
|
||||
|
||||
UDPSourceReport:
|
||||
description: UDPSource
|
||||
@ -69,4 +80,3 @@ UDPSourceReport:
|
||||
type: integer
|
||||
channelSampleRate:
|
||||
type: integer
|
||||
|
@ -4638,6 +4638,22 @@ margin-bottom: 20px;
|
||||
},
|
||||
"title" : {
|
||||
"type" : "string"
|
||||
},
|
||||
"useReverseAPI" : {
|
||||
"type" : "integer",
|
||||
"description" : "Synchronize with reverse API (1 for yes, 0 for no)"
|
||||
},
|
||||
"reverseAPIAddress" : {
|
||||
"type" : "string"
|
||||
},
|
||||
"reverseAPIPort" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"reverseAPIDeviceIndex" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"reverseAPIChannelIndex" : {
|
||||
"type" : "integer"
|
||||
}
|
||||
},
|
||||
"description" : "UDPSource"
|
||||
@ -23813,7 +23829,7 @@ except ApiException as e:
|
||||
</div>
|
||||
<div id="generator">
|
||||
<div class="content">
|
||||
Generated 2018-12-21T16:19:50.202+01:00
|
||||
Generated 2018-12-21T16:57:30.140+01:00
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -66,6 +66,16 @@ SWGUDPSourceSettings::SWGUDPSourceSettings() {
|
||||
m_udp_port_isSet = false;
|
||||
title = nullptr;
|
||||
m_title_isSet = false;
|
||||
use_reverse_api = 0;
|
||||
m_use_reverse_api_isSet = false;
|
||||
reverse_api_address = nullptr;
|
||||
m_reverse_api_address_isSet = false;
|
||||
reverse_api_port = 0;
|
||||
m_reverse_api_port_isSet = false;
|
||||
reverse_api_device_index = 0;
|
||||
m_reverse_api_device_index_isSet = false;
|
||||
reverse_api_channel_index = 0;
|
||||
m_reverse_api_channel_index_isSet = false;
|
||||
}
|
||||
|
||||
SWGUDPSourceSettings::~SWGUDPSourceSettings() {
|
||||
@ -112,6 +122,16 @@ SWGUDPSourceSettings::init() {
|
||||
m_udp_port_isSet = false;
|
||||
title = new QString("");
|
||||
m_title_isSet = false;
|
||||
use_reverse_api = 0;
|
||||
m_use_reverse_api_isSet = false;
|
||||
reverse_api_address = new QString("");
|
||||
m_reverse_api_address_isSet = false;
|
||||
reverse_api_port = 0;
|
||||
m_reverse_api_port_isSet = false;
|
||||
reverse_api_device_index = 0;
|
||||
m_reverse_api_device_index_isSet = false;
|
||||
reverse_api_channel_index = 0;
|
||||
m_reverse_api_channel_index_isSet = false;
|
||||
}
|
||||
|
||||
void
|
||||
@ -139,6 +159,13 @@ SWGUDPSourceSettings::cleanup() {
|
||||
if(title != nullptr) {
|
||||
delete title;
|
||||
}
|
||||
|
||||
if(reverse_api_address != nullptr) {
|
||||
delete reverse_api_address;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
SWGUDPSourceSettings*
|
||||
@ -190,6 +217,16 @@ SWGUDPSourceSettings::fromJsonObject(QJsonObject &pJson) {
|
||||
|
||||
::SWGSDRangel::setValue(&title, pJson["title"], "QString", "QString");
|
||||
|
||||
::SWGSDRangel::setValue(&use_reverse_api, pJson["useReverseAPI"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&reverse_api_address, pJson["reverseAPIAddress"], "QString", "QString");
|
||||
|
||||
::SWGSDRangel::setValue(&reverse_api_port, pJson["reverseAPIPort"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&reverse_api_device_index, pJson["reverseAPIDeviceIndex"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&reverse_api_channel_index, pJson["reverseAPIChannelIndex"], "qint32", "");
|
||||
|
||||
}
|
||||
|
||||
QString
|
||||
@ -263,6 +300,21 @@ SWGUDPSourceSettings::asJsonObject() {
|
||||
if(title != nullptr && *title != QString("")){
|
||||
toJsonValue(QString("title"), title, obj, QString("QString"));
|
||||
}
|
||||
if(m_use_reverse_api_isSet){
|
||||
obj->insert("useReverseAPI", QJsonValue(use_reverse_api));
|
||||
}
|
||||
if(reverse_api_address != nullptr && *reverse_api_address != QString("")){
|
||||
toJsonValue(QString("reverseAPIAddress"), reverse_api_address, obj, QString("QString"));
|
||||
}
|
||||
if(m_reverse_api_port_isSet){
|
||||
obj->insert("reverseAPIPort", QJsonValue(reverse_api_port));
|
||||
}
|
||||
if(m_reverse_api_device_index_isSet){
|
||||
obj->insert("reverseAPIDeviceIndex", QJsonValue(reverse_api_device_index));
|
||||
}
|
||||
if(m_reverse_api_channel_index_isSet){
|
||||
obj->insert("reverseAPIChannelIndex", QJsonValue(reverse_api_channel_index));
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
@ -457,6 +509,56 @@ SWGUDPSourceSettings::setTitle(QString* title) {
|
||||
this->m_title_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGUDPSourceSettings::getUseReverseApi() {
|
||||
return use_reverse_api;
|
||||
}
|
||||
void
|
||||
SWGUDPSourceSettings::setUseReverseApi(qint32 use_reverse_api) {
|
||||
this->use_reverse_api = use_reverse_api;
|
||||
this->m_use_reverse_api_isSet = true;
|
||||
}
|
||||
|
||||
QString*
|
||||
SWGUDPSourceSettings::getReverseApiAddress() {
|
||||
return reverse_api_address;
|
||||
}
|
||||
void
|
||||
SWGUDPSourceSettings::setReverseApiAddress(QString* reverse_api_address) {
|
||||
this->reverse_api_address = reverse_api_address;
|
||||
this->m_reverse_api_address_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGUDPSourceSettings::getReverseApiPort() {
|
||||
return reverse_api_port;
|
||||
}
|
||||
void
|
||||
SWGUDPSourceSettings::setReverseApiPort(qint32 reverse_api_port) {
|
||||
this->reverse_api_port = reverse_api_port;
|
||||
this->m_reverse_api_port_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGUDPSourceSettings::getReverseApiDeviceIndex() {
|
||||
return reverse_api_device_index;
|
||||
}
|
||||
void
|
||||
SWGUDPSourceSettings::setReverseApiDeviceIndex(qint32 reverse_api_device_index) {
|
||||
this->reverse_api_device_index = reverse_api_device_index;
|
||||
this->m_reverse_api_device_index_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGUDPSourceSettings::getReverseApiChannelIndex() {
|
||||
return reverse_api_channel_index;
|
||||
}
|
||||
void
|
||||
SWGUDPSourceSettings::setReverseApiChannelIndex(qint32 reverse_api_channel_index) {
|
||||
this->reverse_api_channel_index = reverse_api_channel_index;
|
||||
this->m_reverse_api_channel_index_isSet = true;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
SWGUDPSourceSettings::isSet(){
|
||||
@ -481,6 +583,11 @@ SWGUDPSourceSettings::isSet(){
|
||||
if(udp_address != nullptr && *udp_address != QString("")){ isObjectUpdated = true; break;}
|
||||
if(m_udp_port_isSet){ isObjectUpdated = true; break;}
|
||||
if(title != nullptr && *title != QString("")){ isObjectUpdated = true; break;}
|
||||
if(m_use_reverse_api_isSet){ isObjectUpdated = true; break;}
|
||||
if(reverse_api_address != nullptr && *reverse_api_address != QString("")){ isObjectUpdated = true; break;}
|
||||
if(m_reverse_api_port_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_reverse_api_device_index_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_reverse_api_channel_index_isSet){ isObjectUpdated = true; break;}
|
||||
}while(false);
|
||||
return isObjectUpdated;
|
||||
}
|
||||
|
@ -99,6 +99,21 @@ public:
|
||||
QString* getTitle();
|
||||
void setTitle(QString* title);
|
||||
|
||||
qint32 getUseReverseApi();
|
||||
void setUseReverseApi(qint32 use_reverse_api);
|
||||
|
||||
QString* getReverseApiAddress();
|
||||
void setReverseApiAddress(QString* reverse_api_address);
|
||||
|
||||
qint32 getReverseApiPort();
|
||||
void setReverseApiPort(qint32 reverse_api_port);
|
||||
|
||||
qint32 getReverseApiDeviceIndex();
|
||||
void setReverseApiDeviceIndex(qint32 reverse_api_device_index);
|
||||
|
||||
qint32 getReverseApiChannelIndex();
|
||||
void setReverseApiChannelIndex(qint32 reverse_api_channel_index);
|
||||
|
||||
|
||||
virtual bool isSet() override;
|
||||
|
||||
@ -160,6 +175,21 @@ private:
|
||||
QString* title;
|
||||
bool m_title_isSet;
|
||||
|
||||
qint32 use_reverse_api;
|
||||
bool m_use_reverse_api_isSet;
|
||||
|
||||
QString* reverse_api_address;
|
||||
bool m_reverse_api_address_isSet;
|
||||
|
||||
qint32 reverse_api_port;
|
||||
bool m_reverse_api_port_isSet;
|
||||
|
||||
qint32 reverse_api_device_index;
|
||||
bool m_reverse_api_device_index_isSet;
|
||||
|
||||
qint32 reverse_api_channel_index;
|
||||
bool m_reverse_api_channel_index_isSet;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user