REST API: Renamed UDPSrc to UDPSink

This commit is contained in:
f4exb 2018-09-12 00:36:30 +02:00
parent 06acb17e3a
commit fed7f72da1
21 changed files with 461 additions and 462 deletions

View File

@ -62,8 +62,7 @@ At present the following plugins are available:
- `NFMDemodXxx` classes in `plugins/channelrx/demodnfm`: Narrowband FM demodulator with audio output. - `NFMDemodXxx` classes in `plugins/channelrx/demodnfm`: Narrowband FM demodulator with audio output.
- `SSBDemodXxx` classes in `plugins/channelrx/demodssb`: SSB/DSB/CW demodulator with audio output. - `SSBDemodXxx` classes in `plugins/channelrx/demodssb`: SSB/DSB/CW demodulator with audio output.
- `WFMDemodXxx` classes in `plugins/channelrx/demodwfm`: Wideband FM demodulator with audio output. This is a basic demodulator. - `WFMDemodXxx` classes in `plugins/channelrx/demodwfm`: Wideband FM demodulator with audio output. This is a basic demodulator.
- `TCPSrcXxx` classes in `plugins/channelrx/tcpsrc`: Sends channel I/Q samples via TCP - `UDPSinkXxx` classes in `plugins/channelrx/udpsink`: Sends channel I/Q or FM demodulated samples via UDP
- `UDPSrcXxx` classes in `plugins/channelrx/udpsrc`: Sends channel I/Q or FM demodulated samples via UDP
<h3>Channel transmitter (Tx) plugins</h3> <h3>Channel transmitter (Tx) plugins</h3>
@ -104,11 +103,11 @@ The `plugins` subdirectory contains the associated plugins used to manage device
- `xxxanalyzergui.h/cpp` : Analyzer GUI - `xxxanalyzergui.h/cpp` : Analyzer GUI
- `xxxanalyzerplugin.h/cpp` : Analyzer plugin manager - `xxxanalyzerplugin.h/cpp` : Analyzer plugin manager
- `xxxanalyzer.pro` : Qt .pro file for Windows/Android build - `xxxanalyzer.pro` : Qt .pro file for Windows/Android build
- `xxxsrc` : Interface to the outside (e.g xxx = udp): - `xxxsink` : Interface to the outside (e.g xxx = udp):
- `xxxsrc.h/cpp` : Interface core - `xxxsink.h/cpp` : Interface core
- `xxxsrcgui.h/cpp` : Interface GUI - `xxxsinkgui.h/cpp` : Interface GUI
- `xxxsrcplugin/h/cpp` : Interface plugin manager - `xxxsinkplugin/h/cpp` : Interface plugin manager
- `xxxsrc.pro` : Qt .pro file for Windows/Android build - `xxxsink.pro` : Qt .pro file for Windows/Android build
- Transmitter functions (Tx): - Transmitter functions (Tx):
- `samplesink`: Device managers: - `samplesink`: Device managers:
@ -130,11 +129,11 @@ The `plugins` subdirectory contains the associated plugins used to manage device
- `xxxgeneratorgui.h/cpp` : Generator GUI - `xxxgeneratorgui.h/cpp` : Generator GUI
- `xxxgeneratorplugin.h/cpp` : Generator plugin manager - `xxxgeneratorplugin.h/cpp` : Generator plugin manager
- `xxxgenerator.pro` : Qt .pro file for Windows/Android build - `xxxgenerator.pro` : Qt .pro file for Windows/Android build
- `xxxsink` : Interface to the outside (e.g xxx = udp): - `xxxsource` : Interface to the outside (e.g xxx = udp):
- `xxxsink.h/cpp` : Interface core - `xxxsource.h/cpp` : Interface core
- `xxxsinkgui.h/cpp` : Interface GUI - `xxxsourcegui.h/cpp` : Interface GUI
- `xxxsinklugin/h/cpp` : Interface plugin manager - `xxxsourceplugin/h/cpp` : Interface plugin manager
- `xxxsink.pro` : Qt .pro file for Windows/Android build - `xxxsource.pro` : Qt .pro file for Windows/Android build
<h2>Device interface and GUI lifecycle</h2> <h2>Device interface and GUI lifecycle</h2>

View File

@ -19,9 +19,9 @@
#include <QHostAddress> #include <QHostAddress>
#include "SWGChannelSettings.h" #include "SWGChannelSettings.h"
#include "SWGUDPSrcSettings.h" #include "SWGUDPSinkSettings.h"
#include "SWGChannelReport.h" #include "SWGChannelReport.h"
#include "SWGUDPSrcReport.h" #include "SWGUDPSinkReport.h"
#include "dsp/dspengine.h" #include "dsp/dspengine.h"
#include "util/db.h" #include "util/db.h"
@ -38,8 +38,8 @@ MESSAGE_CLASS_DEFINITION(UDPSink::MsgConfigureUDPSrc, Message)
MESSAGE_CLASS_DEFINITION(UDPSink::MsgConfigureChannelizer, Message) MESSAGE_CLASS_DEFINITION(UDPSink::MsgConfigureChannelizer, Message)
MESSAGE_CLASS_DEFINITION(UDPSink::MsgUDPSrcSpectrum, Message) MESSAGE_CLASS_DEFINITION(UDPSink::MsgUDPSrcSpectrum, Message)
const QString UDPSink::m_channelIdURI = "sdrangel.channel.udpsrc"; const QString UDPSink::m_channelIdURI = "sdrangel.channel.udpsink";
const QString UDPSink::m_channelId = "UDPSrc"; const QString UDPSink::m_channelId = "UDPSink";
UDPSink::UDPSink(DeviceSourceAPI *deviceAPI) : UDPSink::UDPSink(DeviceSourceAPI *deviceAPI) :
ChannelSinkAPI(m_channelIdURI), ChannelSinkAPI(m_channelIdURI),
@ -90,12 +90,12 @@ UDPSink::UDPSink(DeviceSourceAPI *deviceAPI) :
if (m_audioSocket->bind(QHostAddress::LocalHost, m_settings.m_audioPort)) if (m_audioSocket->bind(QHostAddress::LocalHost, m_settings.m_audioPort))
{ {
qDebug("UDPSrc::UDPSrc: bind audio socket to port %d", m_settings.m_audioPort); qDebug("UDPSink::UDPSink: bind audio socket to port %d", m_settings.m_audioPort);
connect(m_audioSocket, SIGNAL(readyRead()), this, SLOT(audioReadyRead()), Qt::QueuedConnection); connect(m_audioSocket, SIGNAL(readyRead()), this, SLOT(audioReadyRead()), Qt::QueuedConnection);
} }
else else
{ {
qWarning("UDPSrc::UDPSrc: cannot bind audio port"); qWarning("UDPSink::UDPSink: cannot bind audio port");
} }
m_agc.setClampMax(SDR_RX_SCALED*SDR_RX_SCALED); m_agc.setClampMax(SDR_RX_SCALED*SDR_RX_SCALED);
@ -310,7 +310,7 @@ void UDPSink::feed(const SampleVector::const_iterator& begin, const SampleVector
} }
} }
//qDebug() << "UDPSrc::feed: " << m_sampleBuffer.size() * 4; //qDebug() << "UDPSink::feed: " << m_sampleBuffer.size() * 4;
if((m_spectrum != 0) && (m_spectrumEnabled)) if((m_spectrum != 0) && (m_spectrumEnabled))
{ {
@ -335,7 +335,7 @@ bool UDPSink::handleMessage(const Message& cmd)
if (DownChannelizer::MsgChannelizerNotification::match(cmd)) if (DownChannelizer::MsgChannelizerNotification::match(cmd))
{ {
DownChannelizer::MsgChannelizerNotification& notif = (DownChannelizer::MsgChannelizerNotification&) cmd; DownChannelizer::MsgChannelizerNotification& notif = (DownChannelizer::MsgChannelizerNotification&) cmd;
qDebug() << "UDPSrc::handleMessage: MsgChannelizerNotification: m_inputSampleRate: " << notif.getSampleRate() qDebug() << "UDPSink::handleMessage: MsgChannelizerNotification: m_inputSampleRate: " << notif.getSampleRate()
<< " frequencyOffset: " << notif.getFrequencyOffset(); << " frequencyOffset: " << notif.getFrequencyOffset();
applyChannelSettings(notif.getSampleRate(), notif.getFrequencyOffset()); applyChannelSettings(notif.getSampleRate(), notif.getFrequencyOffset());
@ -346,7 +346,7 @@ bool UDPSink::handleMessage(const Message& cmd)
else if (MsgConfigureChannelizer::match(cmd)) else if (MsgConfigureChannelizer::match(cmd))
{ {
MsgConfigureChannelizer& cfg = (MsgConfigureChannelizer&) cmd; MsgConfigureChannelizer& cfg = (MsgConfigureChannelizer&) cmd;
qDebug() << "UDPSrc::handleMessage: MsgConfigureChannelizer:" qDebug() << "UDPSink::handleMessage: MsgConfigureChannelizer:"
<< " sampleRate: " << cfg.getSampleRate() << " sampleRate: " << cfg.getSampleRate()
<< " centerFrequency: " << cfg.getCenterFrequency(); << " centerFrequency: " << cfg.getCenterFrequency();
@ -359,7 +359,7 @@ bool UDPSink::handleMessage(const Message& cmd)
else if (MsgConfigureUDPSrc::match(cmd)) else if (MsgConfigureUDPSrc::match(cmd))
{ {
MsgConfigureUDPSrc& cfg = (MsgConfigureUDPSrc&) cmd; MsgConfigureUDPSrc& cfg = (MsgConfigureUDPSrc&) cmd;
qDebug("UDPSrc::handleMessage: MsgConfigureUDPSrc"); qDebug("UDPSink::handleMessage: MsgConfigureUDPSrc");
applySettings(cfg.getSettings(), cfg.getForce()); applySettings(cfg.getSettings(), cfg.getForce());
@ -371,7 +371,7 @@ bool UDPSink::handleMessage(const Message& cmd)
m_spectrumEnabled = spc.getEnabled(); m_spectrumEnabled = spc.getEnabled();
qDebug() << "UDPSrc::handleMessage: MsgUDPSrcSpectrum: m_spectrumEnabled: " << m_spectrumEnabled; qDebug() << "UDPSink::handleMessage: MsgUDPSrcSpectrum: m_spectrumEnabled: " << m_spectrumEnabled;
return true; return true;
} }
@ -398,7 +398,7 @@ void UDPSink::audioReadyRead()
{ {
qint64 pendingDataSize = m_audioSocket->pendingDatagramSize(); qint64 pendingDataSize = m_audioSocket->pendingDatagramSize();
qint64 udpReadBytes = m_audioSocket->readDatagram(m_udpAudioBuf, pendingDataSize, 0, 0); qint64 udpReadBytes = m_audioSocket->readDatagram(m_udpAudioBuf, pendingDataSize, 0, 0);
//qDebug("UDPSrc::audioReadyRead: %lld", udpReadBytes); //qDebug("UDPSink::audioReadyRead: %lld", udpReadBytes);
if (m_settings.m_audioActive) if (m_settings.m_audioActive)
{ {
@ -418,7 +418,7 @@ void UDPSink::audioReadyRead()
if (res != m_audioBufferFill) if (res != m_audioBufferFill)
{ {
qDebug("UDPSrc::audioReadyRead: (stereo) lost %u samples", m_audioBufferFill - res); qDebug("UDPSink::audioReadyRead: (stereo) lost %u samples", m_audioBufferFill - res);
} }
m_audioBufferFill = 0; m_audioBufferFill = 0;
@ -440,7 +440,7 @@ void UDPSink::audioReadyRead()
if (res != m_audioBufferFill) if (res != m_audioBufferFill)
{ {
qDebug("UDPSrc::audioReadyRead: (mono) lost %u samples", m_audioBufferFill - res); qDebug("UDPSink::audioReadyRead: (mono) lost %u samples", m_audioBufferFill - res);
} }
m_audioBufferFill = 0; m_audioBufferFill = 0;
@ -450,19 +450,19 @@ void UDPSink::audioReadyRead()
if (m_audioFifo.write((const quint8*)&m_audioBuffer[0], m_audioBufferFill, 0) != m_audioBufferFill) if (m_audioFifo.write((const quint8*)&m_audioBuffer[0], m_audioBufferFill, 0) != m_audioBufferFill)
{ {
qDebug("UDPSrc::audioReadyRead: lost samples"); qDebug("UDPSink::audioReadyRead: lost samples");
} }
m_audioBufferFill = 0; m_audioBufferFill = 0;
} }
} }
//qDebug("UDPSrc::audioReadyRead: done"); //qDebug("UDPSink::audioReadyRead: done");
} }
void UDPSink::applyChannelSettings(int inputSampleRate, int inputFrequencyOffset, bool force) void UDPSink::applyChannelSettings(int inputSampleRate, int inputFrequencyOffset, bool force)
{ {
qDebug() << "UDPSrc::applyChannelSettings:" qDebug() << "UDPSink::applyChannelSettings:"
<< " inputSampleRate: " << inputSampleRate << " inputSampleRate: " << inputSampleRate
<< " inputFrequencyOffset: " << inputFrequencyOffset; << " inputFrequencyOffset: " << inputFrequencyOffset;
@ -486,7 +486,7 @@ void UDPSink::applyChannelSettings(int inputSampleRate, int inputFrequencyOffset
void UDPSink::applySettings(const UDPSinkSettings& settings, bool force) void UDPSink::applySettings(const UDPSinkSettings& settings, bool force)
{ {
qDebug() << "UDPSrc::applySettings:" qDebug() << "UDPSink::applySettings:"
<< " m_inputFrequencyOffset: " << settings.m_inputFrequencyOffset << " m_inputFrequencyOffset: " << settings.m_inputFrequencyOffset
<< " m_audioActive: " << settings.m_audioActive << " m_audioActive: " << settings.m_audioActive
<< " m_audioStereo: " << settings.m_audioStereo << " m_audioStereo: " << settings.m_audioStereo
@ -602,11 +602,11 @@ void UDPSink::applySettings(const UDPSinkSettings& settings, bool force)
if (m_audioSocket->bind(QHostAddress::LocalHost, settings.m_audioPort)) if (m_audioSocket->bind(QHostAddress::LocalHost, settings.m_audioPort))
{ {
connect(m_audioSocket, SIGNAL(readyRead()), this, SLOT(audioReadyRead()), Qt::QueuedConnection); connect(m_audioSocket, SIGNAL(readyRead()), this, SLOT(audioReadyRead()), Qt::QueuedConnection);
qDebug("UDPSrc::handleMessage: audio socket bound to port %d", settings.m_audioPort); qDebug("UDPSink::handleMessage: audio socket bound to port %d", settings.m_audioPort);
} }
else else
{ {
qWarning("UDPSrc::handleMessage: cannot bind audio socket"); qWarning("UDPSink::handleMessage: cannot bind audio socket");
} }
} }
@ -646,8 +646,8 @@ int UDPSink::webapiSettingsGet(
SWGSDRangel::SWGChannelSettings& response, SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage __attribute__((unused))) QString& errorMessage __attribute__((unused)))
{ {
response.setUdpSrcSettings(new SWGSDRangel::SWGUDPSrcSettings()); response.setUdpSinkSettings(new SWGSDRangel::SWGUDPSinkSettings());
response.getUdpSrcSettings()->init(); response.getUdpSinkSettings()->init();
webapiFormatChannelSettings(response, m_settings); webapiFormatChannelSettings(response, m_settings);
return 200; return 200;
} }
@ -662,63 +662,63 @@ int UDPSink::webapiSettingsPutPatch(
bool frequencyOffsetChanged = false; bool frequencyOffsetChanged = false;
if (channelSettingsKeys.contains("outputSampleRate")) { if (channelSettingsKeys.contains("outputSampleRate")) {
settings.m_outputSampleRate = response.getUdpSrcSettings()->getOutputSampleRate(); settings.m_outputSampleRate = response.getUdpSinkSettings()->getOutputSampleRate();
} }
if (channelSettingsKeys.contains("sampleFormat")) { if (channelSettingsKeys.contains("sampleFormat")) {
settings.m_sampleFormat = (UDPSinkSettings::SampleFormat) response.getUdpSrcSettings()->getSampleFormat(); settings.m_sampleFormat = (UDPSinkSettings::SampleFormat) response.getUdpSinkSettings()->getSampleFormat();
} }
if (channelSettingsKeys.contains("inputFrequencyOffset")) if (channelSettingsKeys.contains("inputFrequencyOffset"))
{ {
settings.m_inputFrequencyOffset = response.getUdpSrcSettings()->getInputFrequencyOffset(); settings.m_inputFrequencyOffset = response.getUdpSinkSettings()->getInputFrequencyOffset();
frequencyOffsetChanged = true; frequencyOffsetChanged = true;
} }
if (channelSettingsKeys.contains("rfBandwidth")) { if (channelSettingsKeys.contains("rfBandwidth")) {
settings.m_rfBandwidth = response.getUdpSrcSettings()->getRfBandwidth(); settings.m_rfBandwidth = response.getUdpSinkSettings()->getRfBandwidth();
} }
if (channelSettingsKeys.contains("fmDeviation")) { if (channelSettingsKeys.contains("fmDeviation")) {
settings.m_fmDeviation = response.getUdpSrcSettings()->getFmDeviation(); settings.m_fmDeviation = response.getUdpSinkSettings()->getFmDeviation();
} }
if (channelSettingsKeys.contains("channelMute")) { if (channelSettingsKeys.contains("channelMute")) {
settings.m_channelMute = response.getUdpSrcSettings()->getChannelMute() != 0; settings.m_channelMute = response.getUdpSinkSettings()->getChannelMute() != 0;
} }
if (channelSettingsKeys.contains("gain")) { if (channelSettingsKeys.contains("gain")) {
settings.m_gain = response.getUdpSrcSettings()->getGain(); settings.m_gain = response.getUdpSinkSettings()->getGain();
} }
if (channelSettingsKeys.contains("squelchDB")) { if (channelSettingsKeys.contains("squelchDB")) {
settings.m_squelchdB = response.getUdpSrcSettings()->getSquelchDb(); settings.m_squelchdB = response.getUdpSinkSettings()->getSquelchDb();
} }
if (channelSettingsKeys.contains("squelchGate")) { if (channelSettingsKeys.contains("squelchGate")) {
settings.m_squelchGate = response.getUdpSrcSettings()->getSquelchGate(); settings.m_squelchGate = response.getUdpSinkSettings()->getSquelchGate();
} }
if (channelSettingsKeys.contains("squelchEnabled")) { if (channelSettingsKeys.contains("squelchEnabled")) {
settings.m_squelchEnabled = response.getUdpSrcSettings()->getSquelchEnabled() != 0; settings.m_squelchEnabled = response.getUdpSinkSettings()->getSquelchEnabled() != 0;
} }
if (channelSettingsKeys.contains("agc")) { if (channelSettingsKeys.contains("agc")) {
settings.m_agc = response.getUdpSrcSettings()->getAgc() != 0; settings.m_agc = response.getUdpSinkSettings()->getAgc() != 0;
} }
if (channelSettingsKeys.contains("audioActive")) { if (channelSettingsKeys.contains("audioActive")) {
settings.m_audioActive = response.getUdpSrcSettings()->getAudioActive() != 0; settings.m_audioActive = response.getUdpSinkSettings()->getAudioActive() != 0;
} }
if (channelSettingsKeys.contains("audioStereo")) { if (channelSettingsKeys.contains("audioStereo")) {
settings.m_audioStereo = response.getUdpSrcSettings()->getAudioStereo() != 0; settings.m_audioStereo = response.getUdpSinkSettings()->getAudioStereo() != 0;
} }
if (channelSettingsKeys.contains("volume")) { if (channelSettingsKeys.contains("volume")) {
settings.m_volume = response.getUdpSrcSettings()->getVolume(); settings.m_volume = response.getUdpSinkSettings()->getVolume();
} }
if (channelSettingsKeys.contains("udpAddress")) { if (channelSettingsKeys.contains("udpAddress")) {
settings.m_udpAddress = *response.getUdpSrcSettings()->getUdpAddress(); settings.m_udpAddress = *response.getUdpSinkSettings()->getUdpAddress();
} }
if (channelSettingsKeys.contains("udpPort")) { if (channelSettingsKeys.contains("udpPort")) {
settings.m_udpPort = response.getUdpSrcSettings()->getUdpPort(); settings.m_udpPort = response.getUdpSinkSettings()->getUdpPort();
} }
if (channelSettingsKeys.contains("audioPort")) { if (channelSettingsKeys.contains("audioPort")) {
settings.m_audioPort = response.getUdpSrcSettings()->getAudioPort(); settings.m_audioPort = response.getUdpSinkSettings()->getAudioPort();
} }
if (channelSettingsKeys.contains("rgbColor")) { if (channelSettingsKeys.contains("rgbColor")) {
settings.m_rgbColor = response.getUdpSrcSettings()->getRgbColor(); settings.m_rgbColor = response.getUdpSinkSettings()->getRgbColor();
} }
if (channelSettingsKeys.contains("title")) { if (channelSettingsKeys.contains("title")) {
settings.m_title = *response.getUdpSrcSettings()->getTitle(); settings.m_title = *response.getUdpSinkSettings()->getTitle();
} }
if (frequencyOffsetChanged) if (frequencyOffsetChanged)
@ -732,7 +732,7 @@ int UDPSink::webapiSettingsPutPatch(
MsgConfigureUDPSrc *msg = MsgConfigureUDPSrc::create(settings, force); MsgConfigureUDPSrc *msg = MsgConfigureUDPSrc::create(settings, force);
m_inputMessageQueue.push(msg); m_inputMessageQueue.push(msg);
qDebug("UDPSrc::webapiSettingsPutPatch: forward to GUI: %p", m_guiMessageQueue); qDebug("getUdpSinkSettings::webapiSettingsPutPatch: forward to GUI: %p", m_guiMessageQueue);
if (m_guiMessageQueue) // forward to GUI if any if (m_guiMessageQueue) // forward to GUI if any
{ {
MsgConfigureUDPSrc *msgToGUI = MsgConfigureUDPSrc::create(settings, force); MsgConfigureUDPSrc *msgToGUI = MsgConfigureUDPSrc::create(settings, force);
@ -748,50 +748,50 @@ int UDPSink::webapiReportGet(
SWGSDRangel::SWGChannelReport& response, SWGSDRangel::SWGChannelReport& response,
QString& errorMessage __attribute__((unused))) QString& errorMessage __attribute__((unused)))
{ {
response.setUdpSrcReport(new SWGSDRangel::SWGUDPSrcReport()); response.setUdpSinkReport(new SWGSDRangel::SWGUDPSinkReport());
response.getUdpSrcReport()->init(); response.getUdpSinkReport()->init();
webapiFormatChannelReport(response); webapiFormatChannelReport(response);
return 200; return 200;
} }
void UDPSink::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const UDPSinkSettings& settings) void UDPSink::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const UDPSinkSettings& settings)
{ {
response.getUdpSrcSettings()->setOutputSampleRate(settings.m_outputSampleRate); response.getUdpSinkSettings()->setOutputSampleRate(settings.m_outputSampleRate);
response.getUdpSrcSettings()->setSampleFormat((int) settings.m_sampleFormat); response.getUdpSinkSettings()->setSampleFormat((int) settings.m_sampleFormat);
response.getUdpSrcSettings()->setInputFrequencyOffset(settings.m_inputFrequencyOffset); response.getUdpSinkSettings()->setInputFrequencyOffset(settings.m_inputFrequencyOffset);
response.getUdpSrcSettings()->setRfBandwidth(settings.m_rfBandwidth); response.getUdpSinkSettings()->setRfBandwidth(settings.m_rfBandwidth);
response.getUdpSrcSettings()->setFmDeviation(settings.m_fmDeviation); response.getUdpSinkSettings()->setFmDeviation(settings.m_fmDeviation);
response.getUdpSrcSettings()->setChannelMute(settings.m_channelMute ? 1 : 0); response.getUdpSinkSettings()->setChannelMute(settings.m_channelMute ? 1 : 0);
response.getUdpSrcSettings()->setGain(settings.m_gain); response.getUdpSinkSettings()->setGain(settings.m_gain);
response.getUdpSrcSettings()->setSquelchDb(settings.m_squelchdB); response.getUdpSinkSettings()->setSquelchDb(settings.m_squelchdB);
response.getUdpSrcSettings()->setSquelchGate(settings.m_squelchGate); response.getUdpSinkSettings()->setSquelchGate(settings.m_squelchGate);
response.getUdpSrcSettings()->setSquelchEnabled(settings.m_squelchEnabled ? 1 : 0); response.getUdpSinkSettings()->setSquelchEnabled(settings.m_squelchEnabled ? 1 : 0);
response.getUdpSrcSettings()->setAgc(settings.m_agc ? 1 : 0); response.getUdpSinkSettings()->setAgc(settings.m_agc ? 1 : 0);
response.getUdpSrcSettings()->setAudioActive(settings.m_audioActive ? 1 : 0); response.getUdpSinkSettings()->setAudioActive(settings.m_audioActive ? 1 : 0);
response.getUdpSrcSettings()->setAudioStereo(settings.m_audioStereo ? 1 : 0); response.getUdpSinkSettings()->setAudioStereo(settings.m_audioStereo ? 1 : 0);
response.getUdpSrcSettings()->setVolume(settings.m_volume); response.getUdpSinkSettings()->setVolume(settings.m_volume);
if (response.getUdpSrcSettings()->getUdpAddress()) { if (response.getUdpSinkSettings()->getUdpAddress()) {
*response.getUdpSrcSettings()->getUdpAddress() = settings.m_udpAddress; *response.getUdpSinkSettings()->getUdpAddress() = settings.m_udpAddress;
} else { } else {
response.getUdpSrcSettings()->setUdpAddress(new QString(settings.m_udpAddress)); response.getUdpSinkSettings()->setUdpAddress(new QString(settings.m_udpAddress));
} }
response.getUdpSrcSettings()->setUdpPort(settings.m_udpPort); response.getUdpSinkSettings()->setUdpPort(settings.m_udpPort);
response.getUdpSrcSettings()->setAudioPort(settings.m_audioPort); response.getUdpSinkSettings()->setAudioPort(settings.m_audioPort);
response.getUdpSrcSettings()->setRgbColor(settings.m_rgbColor); response.getUdpSinkSettings()->setRgbColor(settings.m_rgbColor);
if (response.getUdpSrcSettings()->getTitle()) { if (response.getUdpSinkSettings()->getTitle()) {
*response.getUdpSrcSettings()->getTitle() = settings.m_title; *response.getUdpSinkSettings()->getTitle() = settings.m_title;
} else { } else {
response.getUdpSrcSettings()->setTitle(new QString(settings.m_title)); response.getUdpSinkSettings()->setTitle(new QString(settings.m_title));
} }
} }
void UDPSink::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response) void UDPSink::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
{ {
response.getUdpSrcReport()->setChannelPowerDb(CalcDb::dbPower(getInMagSq())); response.getUdpSinkReport()->setChannelPowerDb(CalcDb::dbPower(getInMagSq()));
response.getUdpSrcReport()->setOutputPowerDb(CalcDb::dbPower(getMagSq())); response.getUdpSinkReport()->setOutputPowerDb(CalcDb::dbPower(getMagSq()));
response.getUdpSrcReport()->setSquelch(m_squelchOpen ? 1 : 0); response.getUdpSinkReport()->setSquelch(m_squelchOpen ? 1 : 0);
response.getUdpSrcReport()->setInputSampleRate(m_inputSampleRate); response.getUdpSinkReport()->setInputSampleRate(m_inputSampleRate);
} }

View File

@ -264,7 +264,7 @@ void UDPSinkGUI::displaySettings()
ui->squelch->setValue(m_settings.m_squelchdB); ui->squelch->setValue(m_settings.m_squelchdB);
ui->squelchText->setText(tr("%1").arg(ui->squelch->value()*1.0, 0, 'f', 0)); ui->squelchText->setText(tr("%1").arg(ui->squelch->value()*1.0, 0, 'f', 0));
qDebug("UDPSrcGUI::deserialize: m_squelchGate: %d", m_settings.m_squelchGate); qDebug("UDPSinkGUI::deserialize: m_squelchGate: %d", m_settings.m_squelchGate);
ui->squelchGate->setValue(m_settings.m_squelchGate); ui->squelchGate->setValue(m_settings.m_squelchGate);
ui->squelchGateText->setText(tr("%1").arg(m_settings.m_squelchGate*10.0, 0, 'f', 0)); ui->squelchGateText->setText(tr("%1").arg(m_settings.m_squelchGate*10.0, 0, 'f', 0));

View File

@ -31,7 +31,7 @@
<file>webapi/doc/swagger/include/Structs.yaml</file> <file>webapi/doc/swagger/include/Structs.yaml</file>
<file>webapi/doc/swagger/include/TestSource.yaml</file> <file>webapi/doc/swagger/include/TestSource.yaml</file>
<file>webapi/doc/swagger/include/UDPSource.yaml</file> <file>webapi/doc/swagger/include/UDPSource.yaml</file>
<file>webapi/doc/swagger/include/UDPSrc.yaml</file> <file>webapi/doc/swagger/include/UDPSink.yaml</file>
<file>webapi/doc/swagger/include/WFMDemod.yaml</file> <file>webapi/doc/swagger/include/WFMDemod.yaml</file>
<file>webapi/doc/swagger/include/WFMMod.yaml</file> <file>webapi/doc/swagger/include/WFMMod.yaml</file>
<file>webapi/doc/swagger-ui/swagger-ui.js.map</file> <file>webapi/doc/swagger-ui/swagger-ui.js.map</file>

View File

@ -1425,8 +1425,8 @@ margin-bottom: 20px;
"UDPSourceReport" : { "UDPSourceReport" : {
"$ref" : "#/definitions/UDPSourceReport" "$ref" : "#/definitions/UDPSourceReport"
}, },
"UDPSrcReport" : { "UDPSinkReport" : {
"$ref" : "#/definitions/UDPSrcReport" "$ref" : "#/definitions/UDPSinkReport"
}, },
"WFMDemodReport" : { "WFMDemodReport" : {
"$ref" : "#/definitions/WFMDemodReport" "$ref" : "#/definitions/WFMDemodReport"
@ -1485,8 +1485,8 @@ margin-bottom: 20px;
"UDPSourceSettings" : { "UDPSourceSettings" : {
"$ref" : "#/definitions/UDPSourceSettings" "$ref" : "#/definitions/UDPSourceSettings"
}, },
"UDPSrcSettings" : { "UDPSinkSettings" : {
"$ref" : "#/definitions/UDPSrcSettings" "$ref" : "#/definitions/UDPSinkSettings"
}, },
"WFMDemodSettings" : { "WFMDemodSettings" : {
"$ref" : "#/definitions/WFMDemodSettings" "$ref" : "#/definitions/WFMDemodSettings"
@ -3712,6 +3712,106 @@ margin-bottom: 20px;
} }
}, },
"description" : "TestSource" "description" : "TestSource"
};
defs.UDPSinkReport = {
"properties" : {
"outputPowerDB" : {
"type" : "number",
"format" : "float",
"description" : "power transmitted in channel (dB)"
},
"channelPowerDB" : {
"type" : "number",
"format" : "float",
"description" : "power received in channel (dB)"
},
"squelch" : {
"type" : "integer",
"description" : "squelch status (1 if open else 0)"
},
"inputSampleRate" : {
"type" : "integer"
}
},
"description" : "UDPSink"
};
defs.UDPSinkSettings = {
"properties" : {
"outputSampleRate" : {
"type" : "number",
"format" : "float"
},
"sampleFormat" : {
"type" : "integer"
},
"inputFrequencyOffset" : {
"type" : "integer",
"format" : "int64"
},
"rfBandwidth" : {
"type" : "number",
"format" : "float"
},
"fmDeviation" : {
"type" : "integer"
},
"channelMute" : {
"type" : "integer",
"description" : "channel mute (1 if muted else 0)"
},
"gain" : {
"type" : "number",
"format" : "float"
},
"squelchDB" : {
"type" : "integer",
"description" : "power dB"
},
"squelchGate" : {
"type" : "integer",
"description" : "100ths seconds"
},
"squelchEnabled" : {
"type" : "integer",
"description" : "squelch enable (1 if enabled else 0)"
},
"agc" : {
"type" : "integer",
"description" : "AGC enable (1 if enabled else 0)"
},
"audioActive" : {
"type" : "integer",
"description" : "Audio return enable (1 if enabled else 0)"
},
"audioStereo" : {
"type" : "integer",
"description" : "Audio return stereo (1 if stereo else 0)"
},
"volume" : {
"type" : "integer"
},
"udpAddress" : {
"type" : "string",
"description" : "destination UDP address (remote)"
},
"udpPort" : {
"type" : "integer",
"format" : "uint16",
"description" : "destination UDP port (remote)"
},
"audioPort" : {
"type" : "integer",
"format" : "uint16",
"description" : "audio return UDP port (local)"
},
"rgbColor" : {
"type" : "integer"
},
"title" : {
"type" : "string"
}
},
"description" : "UDPSink"
}; };
defs.UDPSourceReport = { defs.UDPSourceReport = {
"properties" : { "properties" : {
@ -3810,106 +3910,6 @@ margin-bottom: 20px;
} }
}, },
"description" : "UDPSource" "description" : "UDPSource"
};
defs.UDPSrcReport = {
"properties" : {
"outputPowerDB" : {
"type" : "number",
"format" : "float",
"description" : "power transmitted in channel (dB)"
},
"channelPowerDB" : {
"type" : "number",
"format" : "float",
"description" : "power received in channel (dB)"
},
"squelch" : {
"type" : "integer",
"description" : "squelch status (1 if open else 0)"
},
"inputSampleRate" : {
"type" : "integer"
}
},
"description" : "UDPSink"
};
defs.UDPSrcSettings = {
"properties" : {
"outputSampleRate" : {
"type" : "number",
"format" : "float"
},
"sampleFormat" : {
"type" : "integer"
},
"inputFrequencyOffset" : {
"type" : "integer",
"format" : "int64"
},
"rfBandwidth" : {
"type" : "number",
"format" : "float"
},
"fmDeviation" : {
"type" : "integer"
},
"channelMute" : {
"type" : "integer",
"description" : "channel mute (1 if muted else 0)"
},
"gain" : {
"type" : "number",
"format" : "float"
},
"squelchDB" : {
"type" : "integer",
"description" : "power dB"
},
"squelchGate" : {
"type" : "integer",
"description" : "100ths seconds"
},
"squelchEnabled" : {
"type" : "integer",
"description" : "squelch enable (1 if enabled else 0)"
},
"agc" : {
"type" : "integer",
"description" : "AGC enable (1 if enabled else 0)"
},
"audioActive" : {
"type" : "integer",
"description" : "Audio return enable (1 if enabled else 0)"
},
"audioStereo" : {
"type" : "integer",
"description" : "Audio return stereo (1 if stereo else 0)"
},
"volume" : {
"type" : "integer"
},
"udpAddress" : {
"type" : "string",
"description" : "destination UDP address (remote)"
},
"udpPort" : {
"type" : "integer",
"format" : "uint16",
"description" : "destination UDP port (remote)"
},
"audioPort" : {
"type" : "integer",
"format" : "uint16",
"description" : "audio return UDP port (local)"
},
"rgbColor" : {
"type" : "integer"
},
"title" : {
"type" : "string"
}
},
"description" : "UDPSrc"
}; };
defs.WFMDemodReport = { defs.WFMDemodReport = {
"properties" : { "properties" : {
@ -23066,7 +23066,7 @@ except ApiException as e:
</div> </div>
<div id="generator"> <div id="generator">
<div class="content"> <div class="content">
Generated 2018-09-11T22:44:27.082+02:00 Generated 2018-09-12T00:14:34.357+02:00
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,5 +1,5 @@
UDPSrcSettings: UDPSinkSettings:
description: UDPSrc description: UDPSink
properties: properties:
outputSampleRate: outputSampleRate:
type: number type: number
@ -56,7 +56,7 @@ UDPSrcSettings:
title: title:
type: string type: string
UDPSrcReport: UDPSinkReport:
description: UDPSink description: UDPSink
properties: properties:
outputPowerDB: outputPowerDB:

View File

@ -1874,8 +1874,8 @@ definitions:
$ref: "/doc/swagger/include/SSBDemod.yaml#/SSBDemodSettings" $ref: "/doc/swagger/include/SSBDemod.yaml#/SSBDemodSettings"
UDPSourceSettings: UDPSourceSettings:
$ref: "/doc/swagger/include/UDPSource.yaml#/UDPSourceSettings" $ref: "/doc/swagger/include/UDPSource.yaml#/UDPSourceSettings"
UDPSrcSettings: UDPSinkSettings:
$ref: "/doc/swagger/include/UDPSrc.yaml#/UDPSrcSettings" $ref: "/doc/swagger/include/UDPSink.yaml#/UDPSinkSettings"
WFMDemodSettings: WFMDemodSettings:
$ref: "/doc/swagger/include/WFMDemod.yaml#/WFMDemodSettings" $ref: "/doc/swagger/include/WFMDemod.yaml#/WFMDemodSettings"
WFMModSettings: WFMModSettings:
@ -1913,8 +1913,8 @@ definitions:
$ref: "/doc/swagger/include/SSBMod.yaml#/SSBModReport" $ref: "/doc/swagger/include/SSBMod.yaml#/SSBModReport"
UDPSourceReport: UDPSourceReport:
$ref: "/doc/swagger/include/UDPSource.yaml#/UDPSourceReport" $ref: "/doc/swagger/include/UDPSource.yaml#/UDPSourceReport"
UDPSrcReport: UDPSinkReport:
$ref: "/doc/swagger/include/UDPSrc.yaml#/UDPSrcReport" $ref: "/doc/swagger/include/UDPSink.yaml#/UDPSinkReport"
WFMDemodReport: WFMDemodReport:
$ref: "/doc/swagger/include/WFMDemod.yaml#/WFMDemodReport" $ref: "/doc/swagger/include/WFMDemod.yaml#/WFMDemodReport"
WFMModReport: WFMModReport:

View File

@ -2222,14 +2222,14 @@ bool WebAPIRequestMapper::validateChannelSettings(
return false; return false;
} }
} }
else if (*channelType == "UDPSrc") else if (*channelType == "UDPSink")
{ {
if (channelSettings.getTx() == 0) if (channelSettings.getTx() == 0)
{ {
QJsonObject udpSrcSettingsJsonObject = jsonObject["UDPSrcSettings"].toObject(); QJsonObject udpSinkSettingsJsonObject = jsonObject["UDPSinkSettings"].toObject();
channelSettingsKeys = udpSrcSettingsJsonObject.keys(); channelSettingsKeys = udpSinkSettingsJsonObject.keys();
channelSettings.setUdpSrcSettings(new SWGSDRangel::SWGUDPSrcSettings()); channelSettings.setUdpSinkSettings(new SWGSDRangel::SWGUDPSinkSettings());
channelSettings.getUdpSrcSettings()->fromJsonObject(udpSrcSettingsJsonObject); channelSettings.getUdpSinkSettings()->fromJsonObject(udpSinkSettingsJsonObject);
return true; return true;
} }
else { else {
@ -2416,7 +2416,7 @@ void WebAPIRequestMapper::resetChannelSettings(SWGSDRangel::SWGChannelSettings&
channelSettings.setSsbDemodSettings(0); channelSettings.setSsbDemodSettings(0);
channelSettings.setSsbModSettings(0); channelSettings.setSsbModSettings(0);
channelSettings.setUdpSourceSettings(0); channelSettings.setUdpSourceSettings(0);
channelSettings.setUdpSrcSettings(0); channelSettings.setUdpSinkSettings(0);
channelSettings.setWfmDemodSettings(0); channelSettings.setWfmDemodSettings(0);
channelSettings.setWfmModSettings(0); channelSettings.setWfmModSettings(0);
} }
@ -2436,7 +2436,7 @@ void WebAPIRequestMapper::resetChannelReport(SWGSDRangel::SWGChannelReport& chan
channelReport.setSsbDemodReport(0); channelReport.setSsbDemodReport(0);
channelReport.setSsbModReport(0); channelReport.setSsbModReport(0);
channelReport.setUdpSourceReport(0); channelReport.setUdpSourceReport(0);
channelReport.setUdpSrcReport(0); channelReport.setUdpSinkReport(0);
channelReport.setWfmDemodReport(0); channelReport.setWfmDemodReport(0);
channelReport.setWfmModReport(0); channelReport.setWfmModReport(0);
} }

View File

@ -1,5 +1,5 @@
UDPSrcSettings: UDPSinkSettings:
description: UDPSrc description: UDPSink
properties: properties:
outputSampleRate: outputSampleRate:
type: number type: number
@ -56,7 +56,7 @@ UDPSrcSettings:
title: title:
type: string type: string
UDPSrcReport: UDPSinkReport:
description: UDPSink description: UDPSink
properties: properties:
outputPowerDB: outputPowerDB:

View File

@ -1874,8 +1874,8 @@ definitions:
$ref: "http://localhost:8081/api/swagger/include/SSBDemod.yaml#/SSBDemodSettings" $ref: "http://localhost:8081/api/swagger/include/SSBDemod.yaml#/SSBDemodSettings"
UDPSourceSettings: UDPSourceSettings:
$ref: "http://localhost:8081/api/swagger/include/UDPSource.yaml#/UDPSourceSettings" $ref: "http://localhost:8081/api/swagger/include/UDPSource.yaml#/UDPSourceSettings"
UDPSrcSettings: UDPSinkSettings:
$ref: "http://localhost:8081/api/swagger/include/UDPSrc.yaml#/UDPSrcSettings" $ref: "http://localhost:8081/api/swagger/include/UDPSink.yaml#/UDPSinkSettings"
WFMDemodSettings: WFMDemodSettings:
$ref: "http://localhost:8081/api/swagger/include/WFMDemod.yaml#/WFMDemodSettings" $ref: "http://localhost:8081/api/swagger/include/WFMDemod.yaml#/WFMDemodSettings"
WFMModSettings: WFMModSettings:
@ -1913,8 +1913,8 @@ definitions:
$ref: "http://localhost:8081/api/swagger/include/SSBMod.yaml#/SSBModReport" $ref: "http://localhost:8081/api/swagger/include/SSBMod.yaml#/SSBModReport"
UDPSourceReport: UDPSourceReport:
$ref: "http://localhost:8081/api/swagger/include/UDPSource.yaml#/UDPSourceReport" $ref: "http://localhost:8081/api/swagger/include/UDPSource.yaml#/UDPSourceReport"
UDPSrcReport: UDPSinkReport:
$ref: "http://localhost:8081/api/swagger/include/UDPSrc.yaml#/UDPSrcReport" $ref: "http://localhost:8081/api/swagger/include/UDPSink.yaml#/UDPSinkReport"
WFMDemodReport: WFMDemodReport:
$ref: "http://localhost:8081/api/swagger/include/WFMDemod.yaml#/WFMDemodReport" $ref: "http://localhost:8081/api/swagger/include/WFMDemod.yaml#/WFMDemodReport"
WFMModReport: WFMModReport:

View File

@ -1425,8 +1425,8 @@ margin-bottom: 20px;
"UDPSourceReport" : { "UDPSourceReport" : {
"$ref" : "#/definitions/UDPSourceReport" "$ref" : "#/definitions/UDPSourceReport"
}, },
"UDPSrcReport" : { "UDPSinkReport" : {
"$ref" : "#/definitions/UDPSrcReport" "$ref" : "#/definitions/UDPSinkReport"
}, },
"WFMDemodReport" : { "WFMDemodReport" : {
"$ref" : "#/definitions/WFMDemodReport" "$ref" : "#/definitions/WFMDemodReport"
@ -1485,8 +1485,8 @@ margin-bottom: 20px;
"UDPSourceSettings" : { "UDPSourceSettings" : {
"$ref" : "#/definitions/UDPSourceSettings" "$ref" : "#/definitions/UDPSourceSettings"
}, },
"UDPSrcSettings" : { "UDPSinkSettings" : {
"$ref" : "#/definitions/UDPSrcSettings" "$ref" : "#/definitions/UDPSinkSettings"
}, },
"WFMDemodSettings" : { "WFMDemodSettings" : {
"$ref" : "#/definitions/WFMDemodSettings" "$ref" : "#/definitions/WFMDemodSettings"
@ -3712,6 +3712,106 @@ margin-bottom: 20px;
} }
}, },
"description" : "TestSource" "description" : "TestSource"
};
defs.UDPSinkReport = {
"properties" : {
"outputPowerDB" : {
"type" : "number",
"format" : "float",
"description" : "power transmitted in channel (dB)"
},
"channelPowerDB" : {
"type" : "number",
"format" : "float",
"description" : "power received in channel (dB)"
},
"squelch" : {
"type" : "integer",
"description" : "squelch status (1 if open else 0)"
},
"inputSampleRate" : {
"type" : "integer"
}
},
"description" : "UDPSink"
};
defs.UDPSinkSettings = {
"properties" : {
"outputSampleRate" : {
"type" : "number",
"format" : "float"
},
"sampleFormat" : {
"type" : "integer"
},
"inputFrequencyOffset" : {
"type" : "integer",
"format" : "int64"
},
"rfBandwidth" : {
"type" : "number",
"format" : "float"
},
"fmDeviation" : {
"type" : "integer"
},
"channelMute" : {
"type" : "integer",
"description" : "channel mute (1 if muted else 0)"
},
"gain" : {
"type" : "number",
"format" : "float"
},
"squelchDB" : {
"type" : "integer",
"description" : "power dB"
},
"squelchGate" : {
"type" : "integer",
"description" : "100ths seconds"
},
"squelchEnabled" : {
"type" : "integer",
"description" : "squelch enable (1 if enabled else 0)"
},
"agc" : {
"type" : "integer",
"description" : "AGC enable (1 if enabled else 0)"
},
"audioActive" : {
"type" : "integer",
"description" : "Audio return enable (1 if enabled else 0)"
},
"audioStereo" : {
"type" : "integer",
"description" : "Audio return stereo (1 if stereo else 0)"
},
"volume" : {
"type" : "integer"
},
"udpAddress" : {
"type" : "string",
"description" : "destination UDP address (remote)"
},
"udpPort" : {
"type" : "integer",
"format" : "uint16",
"description" : "destination UDP port (remote)"
},
"audioPort" : {
"type" : "integer",
"format" : "uint16",
"description" : "audio return UDP port (local)"
},
"rgbColor" : {
"type" : "integer"
},
"title" : {
"type" : "string"
}
},
"description" : "UDPSink"
}; };
defs.UDPSourceReport = { defs.UDPSourceReport = {
"properties" : { "properties" : {
@ -3810,106 +3910,6 @@ margin-bottom: 20px;
} }
}, },
"description" : "UDPSource" "description" : "UDPSource"
};
defs.UDPSrcReport = {
"properties" : {
"outputPowerDB" : {
"type" : "number",
"format" : "float",
"description" : "power transmitted in channel (dB)"
},
"channelPowerDB" : {
"type" : "number",
"format" : "float",
"description" : "power received in channel (dB)"
},
"squelch" : {
"type" : "integer",
"description" : "squelch status (1 if open else 0)"
},
"inputSampleRate" : {
"type" : "integer"
}
},
"description" : "UDPSink"
};
defs.UDPSrcSettings = {
"properties" : {
"outputSampleRate" : {
"type" : "number",
"format" : "float"
},
"sampleFormat" : {
"type" : "integer"
},
"inputFrequencyOffset" : {
"type" : "integer",
"format" : "int64"
},
"rfBandwidth" : {
"type" : "number",
"format" : "float"
},
"fmDeviation" : {
"type" : "integer"
},
"channelMute" : {
"type" : "integer",
"description" : "channel mute (1 if muted else 0)"
},
"gain" : {
"type" : "number",
"format" : "float"
},
"squelchDB" : {
"type" : "integer",
"description" : "power dB"
},
"squelchGate" : {
"type" : "integer",
"description" : "100ths seconds"
},
"squelchEnabled" : {
"type" : "integer",
"description" : "squelch enable (1 if enabled else 0)"
},
"agc" : {
"type" : "integer",
"description" : "AGC enable (1 if enabled else 0)"
},
"audioActive" : {
"type" : "integer",
"description" : "Audio return enable (1 if enabled else 0)"
},
"audioStereo" : {
"type" : "integer",
"description" : "Audio return stereo (1 if stereo else 0)"
},
"volume" : {
"type" : "integer"
},
"udpAddress" : {
"type" : "string",
"description" : "destination UDP address (remote)"
},
"udpPort" : {
"type" : "integer",
"format" : "uint16",
"description" : "destination UDP port (remote)"
},
"audioPort" : {
"type" : "integer",
"format" : "uint16",
"description" : "audio return UDP port (local)"
},
"rgbColor" : {
"type" : "integer"
},
"title" : {
"type" : "string"
}
},
"description" : "UDPSrc"
}; };
defs.WFMDemodReport = { defs.WFMDemodReport = {
"properties" : { "properties" : {
@ -23066,7 +23066,7 @@ except ApiException as e:
</div> </div>
<div id="generator"> <div id="generator">
<div class="content"> <div class="content">
Generated 2018-09-11T22:44:27.082+02:00 Generated 2018-09-12T00:14:34.357+02:00
</div> </div>
</div> </div>
</div> </div>

View File

@ -54,8 +54,8 @@ SWGChannelReport::SWGChannelReport() {
m_ssb_mod_report_isSet = false; m_ssb_mod_report_isSet = false;
udp_source_report = nullptr; udp_source_report = nullptr;
m_udp_source_report_isSet = false; m_udp_source_report_isSet = false;
udp_src_report = nullptr; udp_sink_report = nullptr;
m_udp_src_report_isSet = false; m_udp_sink_report_isSet = false;
wfm_demod_report = nullptr; wfm_demod_report = nullptr;
m_wfm_demod_report_isSet = false; m_wfm_demod_report_isSet = false;
wfm_mod_report = nullptr; wfm_mod_report = nullptr;
@ -94,8 +94,8 @@ SWGChannelReport::init() {
m_ssb_mod_report_isSet = false; m_ssb_mod_report_isSet = false;
udp_source_report = new SWGUDPSourceReport(); udp_source_report = new SWGUDPSourceReport();
m_udp_source_report_isSet = false; m_udp_source_report_isSet = false;
udp_src_report = new SWGUDPSrcReport(); udp_sink_report = new SWGUDPSinkReport();
m_udp_src_report_isSet = false; m_udp_sink_report_isSet = false;
wfm_demod_report = new SWGWFMDemodReport(); wfm_demod_report = new SWGWFMDemodReport();
m_wfm_demod_report_isSet = false; m_wfm_demod_report_isSet = false;
wfm_mod_report = new SWGWFMModReport(); wfm_mod_report = new SWGWFMModReport();
@ -141,8 +141,8 @@ SWGChannelReport::cleanup() {
if(udp_source_report != nullptr) { if(udp_source_report != nullptr) {
delete udp_source_report; delete udp_source_report;
} }
if(udp_src_report != nullptr) { if(udp_sink_report != nullptr) {
delete udp_src_report; delete udp_sink_report;
} }
if(wfm_demod_report != nullptr) { if(wfm_demod_report != nullptr) {
delete wfm_demod_report; delete wfm_demod_report;
@ -189,7 +189,7 @@ SWGChannelReport::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&udp_source_report, pJson["UDPSourceReport"], "SWGUDPSourceReport", "SWGUDPSourceReport"); ::SWGSDRangel::setValue(&udp_source_report, pJson["UDPSourceReport"], "SWGUDPSourceReport", "SWGUDPSourceReport");
::SWGSDRangel::setValue(&udp_src_report, pJson["UDPSrcReport"], "SWGUDPSrcReport", "SWGUDPSrcReport"); ::SWGSDRangel::setValue(&udp_sink_report, pJson["UDPSinkReport"], "SWGUDPSinkReport", "SWGUDPSinkReport");
::SWGSDRangel::setValue(&wfm_demod_report, pJson["WFMDemodReport"], "SWGWFMDemodReport", "SWGWFMDemodReport"); ::SWGSDRangel::setValue(&wfm_demod_report, pJson["WFMDemodReport"], "SWGWFMDemodReport", "SWGWFMDemodReport");
@ -250,8 +250,8 @@ SWGChannelReport::asJsonObject() {
if((udp_source_report != nullptr) && (udp_source_report->isSet())){ if((udp_source_report != nullptr) && (udp_source_report->isSet())){
toJsonValue(QString("UDPSourceReport"), udp_source_report, obj, QString("SWGUDPSourceReport")); toJsonValue(QString("UDPSourceReport"), udp_source_report, obj, QString("SWGUDPSourceReport"));
} }
if((udp_src_report != nullptr) && (udp_src_report->isSet())){ if((udp_sink_report != nullptr) && (udp_sink_report->isSet())){
toJsonValue(QString("UDPSrcReport"), udp_src_report, obj, QString("SWGUDPSrcReport")); toJsonValue(QString("UDPSinkReport"), udp_sink_report, obj, QString("SWGUDPSinkReport"));
} }
if((wfm_demod_report != nullptr) && (wfm_demod_report->isSet())){ if((wfm_demod_report != nullptr) && (wfm_demod_report->isSet())){
toJsonValue(QString("WFMDemodReport"), wfm_demod_report, obj, QString("SWGWFMDemodReport")); toJsonValue(QString("WFMDemodReport"), wfm_demod_report, obj, QString("SWGWFMDemodReport"));
@ -393,14 +393,14 @@ SWGChannelReport::setUdpSourceReport(SWGUDPSourceReport* udp_source_report) {
this->m_udp_source_report_isSet = true; this->m_udp_source_report_isSet = true;
} }
SWGUDPSrcReport* SWGUDPSinkReport*
SWGChannelReport::getUdpSrcReport() { SWGChannelReport::getUdpSinkReport() {
return udp_src_report; return udp_sink_report;
} }
void void
SWGChannelReport::setUdpSrcReport(SWGUDPSrcReport* udp_src_report) { SWGChannelReport::setUdpSinkReport(SWGUDPSinkReport* udp_sink_report) {
this->udp_src_report = udp_src_report; this->udp_sink_report = udp_sink_report;
this->m_udp_src_report_isSet = true; this->m_udp_sink_report_isSet = true;
} }
SWGWFMDemodReport* SWGWFMDemodReport*
@ -441,7 +441,7 @@ SWGChannelReport::isSet(){
if(daemon_source_report != nullptr && daemon_source_report->isSet()){ isObjectUpdated = true; break;} if(daemon_source_report != nullptr && daemon_source_report->isSet()){ isObjectUpdated = true; break;}
if(ssb_mod_report != nullptr && ssb_mod_report->isSet()){ isObjectUpdated = true; break;} if(ssb_mod_report != nullptr && ssb_mod_report->isSet()){ isObjectUpdated = true; break;}
if(udp_source_report != nullptr && udp_source_report->isSet()){ isObjectUpdated = true; break;} if(udp_source_report != nullptr && udp_source_report->isSet()){ isObjectUpdated = true; break;}
if(udp_src_report != nullptr && udp_src_report->isSet()){ isObjectUpdated = true; break;} if(udp_sink_report != nullptr && udp_sink_report->isSet()){ isObjectUpdated = true; break;}
if(wfm_demod_report != nullptr && wfm_demod_report->isSet()){ isObjectUpdated = true; break;} if(wfm_demod_report != nullptr && wfm_demod_report->isSet()){ isObjectUpdated = true; break;}
if(wfm_mod_report != nullptr && wfm_mod_report->isSet()){ isObjectUpdated = true; break;} if(wfm_mod_report != nullptr && wfm_mod_report->isSet()){ isObjectUpdated = true; break;}
}while(false); }while(false);

View File

@ -32,8 +32,8 @@
#include "SWGNFMModReport.h" #include "SWGNFMModReport.h"
#include "SWGSSBDemodReport.h" #include "SWGSSBDemodReport.h"
#include "SWGSSBModReport.h" #include "SWGSSBModReport.h"
#include "SWGUDPSinkReport.h"
#include "SWGUDPSourceReport.h" #include "SWGUDPSourceReport.h"
#include "SWGUDPSrcReport.h"
#include "SWGWFMDemodReport.h" #include "SWGWFMDemodReport.h"
#include "SWGWFMModReport.h" #include "SWGWFMModReport.h"
#include <QString> #include <QString>
@ -95,8 +95,8 @@ public:
SWGUDPSourceReport* getUdpSourceReport(); SWGUDPSourceReport* getUdpSourceReport();
void setUdpSourceReport(SWGUDPSourceReport* udp_source_report); void setUdpSourceReport(SWGUDPSourceReport* udp_source_report);
SWGUDPSrcReport* getUdpSrcReport(); SWGUDPSinkReport* getUdpSinkReport();
void setUdpSrcReport(SWGUDPSrcReport* udp_src_report); void setUdpSinkReport(SWGUDPSinkReport* udp_sink_report);
SWGWFMDemodReport* getWfmDemodReport(); SWGWFMDemodReport* getWfmDemodReport();
void setWfmDemodReport(SWGWFMDemodReport* wfm_demod_report); void setWfmDemodReport(SWGWFMDemodReport* wfm_demod_report);
@ -147,8 +147,8 @@ private:
SWGUDPSourceReport* udp_source_report; SWGUDPSourceReport* udp_source_report;
bool m_udp_source_report_isSet; bool m_udp_source_report_isSet;
SWGUDPSrcReport* udp_src_report; SWGUDPSinkReport* udp_sink_report;
bool m_udp_src_report_isSet; bool m_udp_sink_report_isSet;
SWGWFMDemodReport* wfm_demod_report; SWGWFMDemodReport* wfm_demod_report;
bool m_wfm_demod_report_isSet; bool m_wfm_demod_report_isSet;

View File

@ -56,8 +56,8 @@ SWGChannelSettings::SWGChannelSettings() {
m_ssb_demod_settings_isSet = false; m_ssb_demod_settings_isSet = false;
udp_source_settings = nullptr; udp_source_settings = nullptr;
m_udp_source_settings_isSet = false; m_udp_source_settings_isSet = false;
udp_src_settings = nullptr; udp_sink_settings = nullptr;
m_udp_src_settings_isSet = false; m_udp_sink_settings_isSet = false;
wfm_demod_settings = nullptr; wfm_demod_settings = nullptr;
m_wfm_demod_settings_isSet = false; m_wfm_demod_settings_isSet = false;
wfm_mod_settings = nullptr; wfm_mod_settings = nullptr;
@ -98,8 +98,8 @@ SWGChannelSettings::init() {
m_ssb_demod_settings_isSet = false; m_ssb_demod_settings_isSet = false;
udp_source_settings = new SWGUDPSourceSettings(); udp_source_settings = new SWGUDPSourceSettings();
m_udp_source_settings_isSet = false; m_udp_source_settings_isSet = false;
udp_src_settings = new SWGUDPSrcSettings(); udp_sink_settings = new SWGUDPSinkSettings();
m_udp_src_settings_isSet = false; m_udp_sink_settings_isSet = false;
wfm_demod_settings = new SWGWFMDemodSettings(); wfm_demod_settings = new SWGWFMDemodSettings();
m_wfm_demod_settings_isSet = false; m_wfm_demod_settings_isSet = false;
wfm_mod_settings = new SWGWFMModSettings(); wfm_mod_settings = new SWGWFMModSettings();
@ -148,8 +148,8 @@ SWGChannelSettings::cleanup() {
if(udp_source_settings != nullptr) { if(udp_source_settings != nullptr) {
delete udp_source_settings; delete udp_source_settings;
} }
if(udp_src_settings != nullptr) { if(udp_sink_settings != nullptr) {
delete udp_src_settings; delete udp_sink_settings;
} }
if(wfm_demod_settings != nullptr) { if(wfm_demod_settings != nullptr) {
delete wfm_demod_settings; delete wfm_demod_settings;
@ -198,7 +198,7 @@ SWGChannelSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&udp_source_settings, pJson["UDPSourceSettings"], "SWGUDPSourceSettings", "SWGUDPSourceSettings"); ::SWGSDRangel::setValue(&udp_source_settings, pJson["UDPSourceSettings"], "SWGUDPSourceSettings", "SWGUDPSourceSettings");
::SWGSDRangel::setValue(&udp_src_settings, pJson["UDPSrcSettings"], "SWGUDPSrcSettings", "SWGUDPSrcSettings"); ::SWGSDRangel::setValue(&udp_sink_settings, pJson["UDPSinkSettings"], "SWGUDPSinkSettings", "SWGUDPSinkSettings");
::SWGSDRangel::setValue(&wfm_demod_settings, pJson["WFMDemodSettings"], "SWGWFMDemodSettings", "SWGWFMDemodSettings"); ::SWGSDRangel::setValue(&wfm_demod_settings, pJson["WFMDemodSettings"], "SWGWFMDemodSettings", "SWGWFMDemodSettings");
@ -262,8 +262,8 @@ SWGChannelSettings::asJsonObject() {
if((udp_source_settings != nullptr) && (udp_source_settings->isSet())){ if((udp_source_settings != nullptr) && (udp_source_settings->isSet())){
toJsonValue(QString("UDPSourceSettings"), udp_source_settings, obj, QString("SWGUDPSourceSettings")); toJsonValue(QString("UDPSourceSettings"), udp_source_settings, obj, QString("SWGUDPSourceSettings"));
} }
if((udp_src_settings != nullptr) && (udp_src_settings->isSet())){ if((udp_sink_settings != nullptr) && (udp_sink_settings->isSet())){
toJsonValue(QString("UDPSrcSettings"), udp_src_settings, obj, QString("SWGUDPSrcSettings")); toJsonValue(QString("UDPSinkSettings"), udp_sink_settings, obj, QString("SWGUDPSinkSettings"));
} }
if((wfm_demod_settings != nullptr) && (wfm_demod_settings->isSet())){ if((wfm_demod_settings != nullptr) && (wfm_demod_settings->isSet())){
toJsonValue(QString("WFMDemodSettings"), wfm_demod_settings, obj, QString("SWGWFMDemodSettings")); toJsonValue(QString("WFMDemodSettings"), wfm_demod_settings, obj, QString("SWGWFMDemodSettings"));
@ -415,14 +415,14 @@ SWGChannelSettings::setUdpSourceSettings(SWGUDPSourceSettings* udp_source_settin
this->m_udp_source_settings_isSet = true; this->m_udp_source_settings_isSet = true;
} }
SWGUDPSrcSettings* SWGUDPSinkSettings*
SWGChannelSettings::getUdpSrcSettings() { SWGChannelSettings::getUdpSinkSettings() {
return udp_src_settings; return udp_sink_settings;
} }
void void
SWGChannelSettings::setUdpSrcSettings(SWGUDPSrcSettings* udp_src_settings) { SWGChannelSettings::setUdpSinkSettings(SWGUDPSinkSettings* udp_sink_settings) {
this->udp_src_settings = udp_src_settings; this->udp_sink_settings = udp_sink_settings;
this->m_udp_src_settings_isSet = true; this->m_udp_sink_settings_isSet = true;
} }
SWGWFMDemodSettings* SWGWFMDemodSettings*
@ -464,7 +464,7 @@ SWGChannelSettings::isSet(){
if(ssb_mod_settings != nullptr && ssb_mod_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(ssb_demod_settings != nullptr && ssb_demod_settings->isSet()){ isObjectUpdated = true; break;}
if(udp_source_settings != nullptr && udp_source_settings->isSet()){ isObjectUpdated = true; break;} if(udp_source_settings != nullptr && udp_source_settings->isSet()){ isObjectUpdated = true; break;}
if(udp_src_settings != nullptr && udp_src_settings->isSet()){ isObjectUpdated = true; break;} if(udp_sink_settings != nullptr && udp_sink_settings->isSet()){ isObjectUpdated = true; break;}
if(wfm_demod_settings != nullptr && wfm_demod_settings->isSet()){ isObjectUpdated = true; break;} if(wfm_demod_settings != nullptr && wfm_demod_settings->isSet()){ isObjectUpdated = true; break;}
if(wfm_mod_settings != nullptr && wfm_mod_settings->isSet()){ isObjectUpdated = true; break;} if(wfm_mod_settings != nullptr && wfm_mod_settings->isSet()){ isObjectUpdated = true; break;}
}while(false); }while(false);

View File

@ -33,8 +33,8 @@
#include "SWGNFMModSettings.h" #include "SWGNFMModSettings.h"
#include "SWGSSBDemodSettings.h" #include "SWGSSBDemodSettings.h"
#include "SWGSSBModSettings.h" #include "SWGSSBModSettings.h"
#include "SWGUDPSinkSettings.h"
#include "SWGUDPSourceSettings.h" #include "SWGUDPSourceSettings.h"
#include "SWGUDPSrcSettings.h"
#include "SWGWFMDemodSettings.h" #include "SWGWFMDemodSettings.h"
#include "SWGWFMModSettings.h" #include "SWGWFMModSettings.h"
#include <QString> #include <QString>
@ -99,8 +99,8 @@ public:
SWGUDPSourceSettings* getUdpSourceSettings(); SWGUDPSourceSettings* getUdpSourceSettings();
void setUdpSourceSettings(SWGUDPSourceSettings* udp_source_settings); void setUdpSourceSettings(SWGUDPSourceSettings* udp_source_settings);
SWGUDPSrcSettings* getUdpSrcSettings(); SWGUDPSinkSettings* getUdpSinkSettings();
void setUdpSrcSettings(SWGUDPSrcSettings* udp_src_settings); void setUdpSinkSettings(SWGUDPSinkSettings* udp_sink_settings);
SWGWFMDemodSettings* getWfmDemodSettings(); SWGWFMDemodSettings* getWfmDemodSettings();
void setWfmDemodSettings(SWGWFMDemodSettings* wfm_demod_settings); void setWfmDemodSettings(SWGWFMDemodSettings* wfm_demod_settings);
@ -154,8 +154,8 @@ private:
SWGUDPSourceSettings* udp_source_settings; SWGUDPSourceSettings* udp_source_settings;
bool m_udp_source_settings_isSet; bool m_udp_source_settings_isSet;
SWGUDPSrcSettings* udp_src_settings; SWGUDPSinkSettings* udp_sink_settings;
bool m_udp_src_settings_isSet; bool m_udp_sink_settings_isSet;
SWGWFMDemodSettings* wfm_demod_settings; SWGWFMDemodSettings* wfm_demod_settings;
bool m_wfm_demod_settings_isSet; bool m_wfm_demod_settings_isSet;

View File

@ -105,10 +105,10 @@
#include "SWGSamplingDevice.h" #include "SWGSamplingDevice.h"
#include "SWGSuccessResponse.h" #include "SWGSuccessResponse.h"
#include "SWGTestSourceSettings.h" #include "SWGTestSourceSettings.h"
#include "SWGUDPSinkReport.h"
#include "SWGUDPSinkSettings.h"
#include "SWGUDPSourceReport.h" #include "SWGUDPSourceReport.h"
#include "SWGUDPSourceSettings.h" #include "SWGUDPSourceSettings.h"
#include "SWGUDPSrcReport.h"
#include "SWGUDPSrcSettings.h"
#include "SWGWFMDemodReport.h" #include "SWGWFMDemodReport.h"
#include "SWGWFMDemodSettings.h" #include "SWGWFMDemodSettings.h"
#include "SWGWFMModReport.h" #include "SWGWFMModReport.h"
@ -390,18 +390,18 @@ namespace SWGSDRangel {
if(QString("SWGTestSourceSettings").compare(type) == 0) { if(QString("SWGTestSourceSettings").compare(type) == 0) {
return new SWGTestSourceSettings(); return new SWGTestSourceSettings();
} }
if(QString("SWGUDPSinkReport").compare(type) == 0) {
return new SWGUDPSinkReport();
}
if(QString("SWGUDPSinkSettings").compare(type) == 0) {
return new SWGUDPSinkSettings();
}
if(QString("SWGUDPSourceReport").compare(type) == 0) { if(QString("SWGUDPSourceReport").compare(type) == 0) {
return new SWGUDPSourceReport(); return new SWGUDPSourceReport();
} }
if(QString("SWGUDPSourceSettings").compare(type) == 0) { if(QString("SWGUDPSourceSettings").compare(type) == 0) {
return new SWGUDPSourceSettings(); return new SWGUDPSourceSettings();
} }
if(QString("SWGUDPSrcReport").compare(type) == 0) {
return new SWGUDPSrcReport();
}
if(QString("SWGUDPSrcSettings").compare(type) == 0) {
return new SWGUDPSrcSettings();
}
if(QString("SWGWFMDemodReport").compare(type) == 0) { if(QString("SWGWFMDemodReport").compare(type) == 0) {
return new SWGWFMDemodReport(); return new SWGWFMDemodReport();
} }

View File

@ -11,7 +11,7 @@
*/ */
#include "SWGUDPSrcReport.h" #include "SWGUDPSinkReport.h"
#include "SWGHelpers.h" #include "SWGHelpers.h"
@ -22,12 +22,12 @@
namespace SWGSDRangel { namespace SWGSDRangel {
SWGUDPSrcReport::SWGUDPSrcReport(QString* json) { SWGUDPSinkReport::SWGUDPSinkReport(QString* json) {
init(); init();
this->fromJson(*json); this->fromJson(*json);
} }
SWGUDPSrcReport::SWGUDPSrcReport() { SWGUDPSinkReport::SWGUDPSinkReport() {
output_power_db = 0.0f; output_power_db = 0.0f;
m_output_power_db_isSet = false; m_output_power_db_isSet = false;
channel_power_db = 0.0f; channel_power_db = 0.0f;
@ -38,12 +38,12 @@ SWGUDPSrcReport::SWGUDPSrcReport() {
m_input_sample_rate_isSet = false; m_input_sample_rate_isSet = false;
} }
SWGUDPSrcReport::~SWGUDPSrcReport() { SWGUDPSinkReport::~SWGUDPSinkReport() {
this->cleanup(); this->cleanup();
} }
void void
SWGUDPSrcReport::init() { SWGUDPSinkReport::init() {
output_power_db = 0.0f; output_power_db = 0.0f;
m_output_power_db_isSet = false; m_output_power_db_isSet = false;
channel_power_db = 0.0f; channel_power_db = 0.0f;
@ -55,15 +55,15 @@ SWGUDPSrcReport::init() {
} }
void void
SWGUDPSrcReport::cleanup() { SWGUDPSinkReport::cleanup() {
} }
SWGUDPSrcReport* SWGUDPSinkReport*
SWGUDPSrcReport::fromJson(QString &json) { SWGUDPSinkReport::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str()); QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array); QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object(); QJsonObject jsonObject = doc.object();
@ -72,7 +72,7 @@ SWGUDPSrcReport::fromJson(QString &json) {
} }
void void
SWGUDPSrcReport::fromJsonObject(QJsonObject &pJson) { SWGUDPSinkReport::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&output_power_db, pJson["outputPowerDB"], "float", ""); ::SWGSDRangel::setValue(&output_power_db, pJson["outputPowerDB"], "float", "");
::SWGSDRangel::setValue(&channel_power_db, pJson["channelPowerDB"], "float", ""); ::SWGSDRangel::setValue(&channel_power_db, pJson["channelPowerDB"], "float", "");
@ -84,7 +84,7 @@ SWGUDPSrcReport::fromJsonObject(QJsonObject &pJson) {
} }
QString QString
SWGUDPSrcReport::asJson () SWGUDPSinkReport::asJson ()
{ {
QJsonObject* obj = this->asJsonObject(); QJsonObject* obj = this->asJsonObject();
@ -95,7 +95,7 @@ SWGUDPSrcReport::asJson ()
} }
QJsonObject* QJsonObject*
SWGUDPSrcReport::asJsonObject() { SWGUDPSinkReport::asJsonObject() {
QJsonObject* obj = new QJsonObject(); QJsonObject* obj = new QJsonObject();
if(m_output_power_db_isSet){ if(m_output_power_db_isSet){
obj->insert("outputPowerDB", QJsonValue(output_power_db)); obj->insert("outputPowerDB", QJsonValue(output_power_db));
@ -114,48 +114,48 @@ SWGUDPSrcReport::asJsonObject() {
} }
float float
SWGUDPSrcReport::getOutputPowerDb() { SWGUDPSinkReport::getOutputPowerDb() {
return output_power_db; return output_power_db;
} }
void void
SWGUDPSrcReport::setOutputPowerDb(float output_power_db) { SWGUDPSinkReport::setOutputPowerDb(float output_power_db) {
this->output_power_db = output_power_db; this->output_power_db = output_power_db;
this->m_output_power_db_isSet = true; this->m_output_power_db_isSet = true;
} }
float float
SWGUDPSrcReport::getChannelPowerDb() { SWGUDPSinkReport::getChannelPowerDb() {
return channel_power_db; return channel_power_db;
} }
void void
SWGUDPSrcReport::setChannelPowerDb(float channel_power_db) { SWGUDPSinkReport::setChannelPowerDb(float channel_power_db) {
this->channel_power_db = channel_power_db; this->channel_power_db = channel_power_db;
this->m_channel_power_db_isSet = true; this->m_channel_power_db_isSet = true;
} }
qint32 qint32
SWGUDPSrcReport::getSquelch() { SWGUDPSinkReport::getSquelch() {
return squelch; return squelch;
} }
void void
SWGUDPSrcReport::setSquelch(qint32 squelch) { SWGUDPSinkReport::setSquelch(qint32 squelch) {
this->squelch = squelch; this->squelch = squelch;
this->m_squelch_isSet = true; this->m_squelch_isSet = true;
} }
qint32 qint32
SWGUDPSrcReport::getInputSampleRate() { SWGUDPSinkReport::getInputSampleRate() {
return input_sample_rate; return input_sample_rate;
} }
void void
SWGUDPSrcReport::setInputSampleRate(qint32 input_sample_rate) { SWGUDPSinkReport::setInputSampleRate(qint32 input_sample_rate) {
this->input_sample_rate = input_sample_rate; this->input_sample_rate = input_sample_rate;
this->m_input_sample_rate_isSet = true; this->m_input_sample_rate_isSet = true;
} }
bool bool
SWGUDPSrcReport::isSet(){ SWGUDPSinkReport::isSet(){
bool isObjectUpdated = false; bool isObjectUpdated = false;
do{ do{
if(m_output_power_db_isSet){ isObjectUpdated = true; break;} if(m_output_power_db_isSet){ isObjectUpdated = true; break;}

View File

@ -11,13 +11,13 @@
*/ */
/* /*
* SWGUDPSrcReport.h * SWGUDPSinkReport.h
* *
* UDPSink * UDPSink
*/ */
#ifndef SWGUDPSrcReport_H_ #ifndef SWGUDPSinkReport_H_
#define SWGUDPSrcReport_H_ #define SWGUDPSinkReport_H_
#include <QJsonObject> #include <QJsonObject>
@ -28,18 +28,18 @@
namespace SWGSDRangel { namespace SWGSDRangel {
class SWG_API SWGUDPSrcReport: public SWGObject { class SWG_API SWGUDPSinkReport: public SWGObject {
public: public:
SWGUDPSrcReport(); SWGUDPSinkReport();
SWGUDPSrcReport(QString* json); SWGUDPSinkReport(QString* json);
virtual ~SWGUDPSrcReport(); virtual ~SWGUDPSinkReport();
void init(); void init();
void cleanup(); void cleanup();
virtual QString asJson () override; virtual QString asJson () override;
virtual QJsonObject* asJsonObject() override; virtual QJsonObject* asJsonObject() override;
virtual void fromJsonObject(QJsonObject &json) override; virtual void fromJsonObject(QJsonObject &json) override;
virtual SWGUDPSrcReport* fromJson(QString &jsonString) override; virtual SWGUDPSinkReport* fromJson(QString &jsonString) override;
float getOutputPowerDb(); float getOutputPowerDb();
void setOutputPowerDb(float output_power_db); void setOutputPowerDb(float output_power_db);
@ -73,4 +73,4 @@ private:
} }
#endif /* SWGUDPSrcReport_H_ */ #endif /* SWGUDPSinkReport_H_ */

View File

@ -11,7 +11,7 @@
*/ */
#include "SWGUDPSrcSettings.h" #include "SWGUDPSinkSettings.h"
#include "SWGHelpers.h" #include "SWGHelpers.h"
@ -22,12 +22,12 @@
namespace SWGSDRangel { namespace SWGSDRangel {
SWGUDPSrcSettings::SWGUDPSrcSettings(QString* json) { SWGUDPSinkSettings::SWGUDPSinkSettings(QString* json) {
init(); init();
this->fromJson(*json); this->fromJson(*json);
} }
SWGUDPSrcSettings::SWGUDPSrcSettings() { SWGUDPSinkSettings::SWGUDPSinkSettings() {
output_sample_rate = 0.0f; output_sample_rate = 0.0f;
m_output_sample_rate_isSet = false; m_output_sample_rate_isSet = false;
sample_format = 0; sample_format = 0;
@ -68,12 +68,12 @@ SWGUDPSrcSettings::SWGUDPSrcSettings() {
m_title_isSet = false; m_title_isSet = false;
} }
SWGUDPSrcSettings::~SWGUDPSrcSettings() { SWGUDPSinkSettings::~SWGUDPSinkSettings() {
this->cleanup(); this->cleanup();
} }
void void
SWGUDPSrcSettings::init() { SWGUDPSinkSettings::init() {
output_sample_rate = 0.0f; output_sample_rate = 0.0f;
m_output_sample_rate_isSet = false; m_output_sample_rate_isSet = false;
sample_format = 0; sample_format = 0;
@ -115,7 +115,7 @@ SWGUDPSrcSettings::init() {
} }
void void
SWGUDPSrcSettings::cleanup() { SWGUDPSinkSettings::cleanup() {
@ -141,8 +141,8 @@ SWGUDPSrcSettings::cleanup() {
} }
} }
SWGUDPSrcSettings* SWGUDPSinkSettings*
SWGUDPSrcSettings::fromJson(QString &json) { SWGUDPSinkSettings::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str()); QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array); QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object(); QJsonObject jsonObject = doc.object();
@ -151,7 +151,7 @@ SWGUDPSrcSettings::fromJson(QString &json) {
} }
void void
SWGUDPSrcSettings::fromJsonObject(QJsonObject &pJson) { SWGUDPSinkSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&output_sample_rate, pJson["outputSampleRate"], "float", ""); ::SWGSDRangel::setValue(&output_sample_rate, pJson["outputSampleRate"], "float", "");
::SWGSDRangel::setValue(&sample_format, pJson["sampleFormat"], "qint32", ""); ::SWGSDRangel::setValue(&sample_format, pJson["sampleFormat"], "qint32", "");
@ -193,7 +193,7 @@ SWGUDPSrcSettings::fromJsonObject(QJsonObject &pJson) {
} }
QString QString
SWGUDPSrcSettings::asJson () SWGUDPSinkSettings::asJson ()
{ {
QJsonObject* obj = this->asJsonObject(); QJsonObject* obj = this->asJsonObject();
@ -204,7 +204,7 @@ SWGUDPSrcSettings::asJson ()
} }
QJsonObject* QJsonObject*
SWGUDPSrcSettings::asJsonObject() { SWGUDPSinkSettings::asJsonObject() {
QJsonObject* obj = new QJsonObject(); QJsonObject* obj = new QJsonObject();
if(m_output_sample_rate_isSet){ if(m_output_sample_rate_isSet){
obj->insert("outputSampleRate", QJsonValue(output_sample_rate)); obj->insert("outputSampleRate", QJsonValue(output_sample_rate));
@ -268,198 +268,198 @@ SWGUDPSrcSettings::asJsonObject() {
} }
float float
SWGUDPSrcSettings::getOutputSampleRate() { SWGUDPSinkSettings::getOutputSampleRate() {
return output_sample_rate; return output_sample_rate;
} }
void void
SWGUDPSrcSettings::setOutputSampleRate(float output_sample_rate) { SWGUDPSinkSettings::setOutputSampleRate(float output_sample_rate) {
this->output_sample_rate = output_sample_rate; this->output_sample_rate = output_sample_rate;
this->m_output_sample_rate_isSet = true; this->m_output_sample_rate_isSet = true;
} }
qint32 qint32
SWGUDPSrcSettings::getSampleFormat() { SWGUDPSinkSettings::getSampleFormat() {
return sample_format; return sample_format;
} }
void void
SWGUDPSrcSettings::setSampleFormat(qint32 sample_format) { SWGUDPSinkSettings::setSampleFormat(qint32 sample_format) {
this->sample_format = sample_format; this->sample_format = sample_format;
this->m_sample_format_isSet = true; this->m_sample_format_isSet = true;
} }
qint64 qint64
SWGUDPSrcSettings::getInputFrequencyOffset() { SWGUDPSinkSettings::getInputFrequencyOffset() {
return input_frequency_offset; return input_frequency_offset;
} }
void void
SWGUDPSrcSettings::setInputFrequencyOffset(qint64 input_frequency_offset) { SWGUDPSinkSettings::setInputFrequencyOffset(qint64 input_frequency_offset) {
this->input_frequency_offset = input_frequency_offset; this->input_frequency_offset = input_frequency_offset;
this->m_input_frequency_offset_isSet = true; this->m_input_frequency_offset_isSet = true;
} }
float float
SWGUDPSrcSettings::getRfBandwidth() { SWGUDPSinkSettings::getRfBandwidth() {
return rf_bandwidth; return rf_bandwidth;
} }
void void
SWGUDPSrcSettings::setRfBandwidth(float rf_bandwidth) { SWGUDPSinkSettings::setRfBandwidth(float rf_bandwidth) {
this->rf_bandwidth = rf_bandwidth; this->rf_bandwidth = rf_bandwidth;
this->m_rf_bandwidth_isSet = true; this->m_rf_bandwidth_isSet = true;
} }
qint32 qint32
SWGUDPSrcSettings::getFmDeviation() { SWGUDPSinkSettings::getFmDeviation() {
return fm_deviation; return fm_deviation;
} }
void void
SWGUDPSrcSettings::setFmDeviation(qint32 fm_deviation) { SWGUDPSinkSettings::setFmDeviation(qint32 fm_deviation) {
this->fm_deviation = fm_deviation; this->fm_deviation = fm_deviation;
this->m_fm_deviation_isSet = true; this->m_fm_deviation_isSet = true;
} }
qint32 qint32
SWGUDPSrcSettings::getChannelMute() { SWGUDPSinkSettings::getChannelMute() {
return channel_mute; return channel_mute;
} }
void void
SWGUDPSrcSettings::setChannelMute(qint32 channel_mute) { SWGUDPSinkSettings::setChannelMute(qint32 channel_mute) {
this->channel_mute = channel_mute; this->channel_mute = channel_mute;
this->m_channel_mute_isSet = true; this->m_channel_mute_isSet = true;
} }
float float
SWGUDPSrcSettings::getGain() { SWGUDPSinkSettings::getGain() {
return gain; return gain;
} }
void void
SWGUDPSrcSettings::setGain(float gain) { SWGUDPSinkSettings::setGain(float gain) {
this->gain = gain; this->gain = gain;
this->m_gain_isSet = true; this->m_gain_isSet = true;
} }
qint32 qint32
SWGUDPSrcSettings::getSquelchDb() { SWGUDPSinkSettings::getSquelchDb() {
return squelch_db; return squelch_db;
} }
void void
SWGUDPSrcSettings::setSquelchDb(qint32 squelch_db) { SWGUDPSinkSettings::setSquelchDb(qint32 squelch_db) {
this->squelch_db = squelch_db; this->squelch_db = squelch_db;
this->m_squelch_db_isSet = true; this->m_squelch_db_isSet = true;
} }
qint32 qint32
SWGUDPSrcSettings::getSquelchGate() { SWGUDPSinkSettings::getSquelchGate() {
return squelch_gate; return squelch_gate;
} }
void void
SWGUDPSrcSettings::setSquelchGate(qint32 squelch_gate) { SWGUDPSinkSettings::setSquelchGate(qint32 squelch_gate) {
this->squelch_gate = squelch_gate; this->squelch_gate = squelch_gate;
this->m_squelch_gate_isSet = true; this->m_squelch_gate_isSet = true;
} }
qint32 qint32
SWGUDPSrcSettings::getSquelchEnabled() { SWGUDPSinkSettings::getSquelchEnabled() {
return squelch_enabled; return squelch_enabled;
} }
void void
SWGUDPSrcSettings::setSquelchEnabled(qint32 squelch_enabled) { SWGUDPSinkSettings::setSquelchEnabled(qint32 squelch_enabled) {
this->squelch_enabled = squelch_enabled; this->squelch_enabled = squelch_enabled;
this->m_squelch_enabled_isSet = true; this->m_squelch_enabled_isSet = true;
} }
qint32 qint32
SWGUDPSrcSettings::getAgc() { SWGUDPSinkSettings::getAgc() {
return agc; return agc;
} }
void void
SWGUDPSrcSettings::setAgc(qint32 agc) { SWGUDPSinkSettings::setAgc(qint32 agc) {
this->agc = agc; this->agc = agc;
this->m_agc_isSet = true; this->m_agc_isSet = true;
} }
qint32 qint32
SWGUDPSrcSettings::getAudioActive() { SWGUDPSinkSettings::getAudioActive() {
return audio_active; return audio_active;
} }
void void
SWGUDPSrcSettings::setAudioActive(qint32 audio_active) { SWGUDPSinkSettings::setAudioActive(qint32 audio_active) {
this->audio_active = audio_active; this->audio_active = audio_active;
this->m_audio_active_isSet = true; this->m_audio_active_isSet = true;
} }
qint32 qint32
SWGUDPSrcSettings::getAudioStereo() { SWGUDPSinkSettings::getAudioStereo() {
return audio_stereo; return audio_stereo;
} }
void void
SWGUDPSrcSettings::setAudioStereo(qint32 audio_stereo) { SWGUDPSinkSettings::setAudioStereo(qint32 audio_stereo) {
this->audio_stereo = audio_stereo; this->audio_stereo = audio_stereo;
this->m_audio_stereo_isSet = true; this->m_audio_stereo_isSet = true;
} }
qint32 qint32
SWGUDPSrcSettings::getVolume() { SWGUDPSinkSettings::getVolume() {
return volume; return volume;
} }
void void
SWGUDPSrcSettings::setVolume(qint32 volume) { SWGUDPSinkSettings::setVolume(qint32 volume) {
this->volume = volume; this->volume = volume;
this->m_volume_isSet = true; this->m_volume_isSet = true;
} }
QString* QString*
SWGUDPSrcSettings::getUdpAddress() { SWGUDPSinkSettings::getUdpAddress() {
return udp_address; return udp_address;
} }
void void
SWGUDPSrcSettings::setUdpAddress(QString* udp_address) { SWGUDPSinkSettings::setUdpAddress(QString* udp_address) {
this->udp_address = udp_address; this->udp_address = udp_address;
this->m_udp_address_isSet = true; this->m_udp_address_isSet = true;
} }
qint32 qint32
SWGUDPSrcSettings::getUdpPort() { SWGUDPSinkSettings::getUdpPort() {
return udp_port; return udp_port;
} }
void void
SWGUDPSrcSettings::setUdpPort(qint32 udp_port) { SWGUDPSinkSettings::setUdpPort(qint32 udp_port) {
this->udp_port = udp_port; this->udp_port = udp_port;
this->m_udp_port_isSet = true; this->m_udp_port_isSet = true;
} }
qint32 qint32
SWGUDPSrcSettings::getAudioPort() { SWGUDPSinkSettings::getAudioPort() {
return audio_port; return audio_port;
} }
void void
SWGUDPSrcSettings::setAudioPort(qint32 audio_port) { SWGUDPSinkSettings::setAudioPort(qint32 audio_port) {
this->audio_port = audio_port; this->audio_port = audio_port;
this->m_audio_port_isSet = true; this->m_audio_port_isSet = true;
} }
qint32 qint32
SWGUDPSrcSettings::getRgbColor() { SWGUDPSinkSettings::getRgbColor() {
return rgb_color; return rgb_color;
} }
void void
SWGUDPSrcSettings::setRgbColor(qint32 rgb_color) { SWGUDPSinkSettings::setRgbColor(qint32 rgb_color) {
this->rgb_color = rgb_color; this->rgb_color = rgb_color;
this->m_rgb_color_isSet = true; this->m_rgb_color_isSet = true;
} }
QString* QString*
SWGUDPSrcSettings::getTitle() { SWGUDPSinkSettings::getTitle() {
return title; return title;
} }
void void
SWGUDPSrcSettings::setTitle(QString* title) { SWGUDPSinkSettings::setTitle(QString* title) {
this->title = title; this->title = title;
this->m_title_isSet = true; this->m_title_isSet = true;
} }
bool bool
SWGUDPSrcSettings::isSet(){ SWGUDPSinkSettings::isSet(){
bool isObjectUpdated = false; bool isObjectUpdated = false;
do{ do{
if(m_output_sample_rate_isSet){ isObjectUpdated = true; break;} if(m_output_sample_rate_isSet){ isObjectUpdated = true; break;}

View File

@ -11,13 +11,13 @@
*/ */
/* /*
* SWGUDPSrcSettings.h * SWGUDPSinkSettings.h
* *
* UDPSrc * UDPSink
*/ */
#ifndef SWGUDPSrcSettings_H_ #ifndef SWGUDPSinkSettings_H_
#define SWGUDPSrcSettings_H_ #define SWGUDPSinkSettings_H_
#include <QJsonObject> #include <QJsonObject>
@ -29,18 +29,18 @@
namespace SWGSDRangel { namespace SWGSDRangel {
class SWG_API SWGUDPSrcSettings: public SWGObject { class SWG_API SWGUDPSinkSettings: public SWGObject {
public: public:
SWGUDPSrcSettings(); SWGUDPSinkSettings();
SWGUDPSrcSettings(QString* json); SWGUDPSinkSettings(QString* json);
virtual ~SWGUDPSrcSettings(); virtual ~SWGUDPSinkSettings();
void init(); void init();
void cleanup(); void cleanup();
virtual QString asJson () override; virtual QString asJson () override;
virtual QJsonObject* asJsonObject() override; virtual QJsonObject* asJsonObject() override;
virtual void fromJsonObject(QJsonObject &json) override; virtual void fromJsonObject(QJsonObject &json) override;
virtual SWGUDPSrcSettings* fromJson(QString &jsonString) override; virtual SWGUDPSinkSettings* fromJson(QString &jsonString) override;
float getOutputSampleRate(); float getOutputSampleRate();
void setOutputSampleRate(float output_sample_rate); void setOutputSampleRate(float output_sample_rate);
@ -164,4 +164,4 @@ private:
} }
#endif /* SWGUDPSrcSettings_H_ */ #endif /* SWGUDPSinkSettings_H_ */

View File

@ -305,13 +305,13 @@ def setupChannel(deviceset_url, options):
settings["DSDDemodSettings"]["enableCosineFiltering"] = 1 settings["DSDDemodSettings"]["enableCosineFiltering"] = 1
settings["DSDDemodSettings"]["pllLock"] = 1 settings["DSDDemodSettings"]["pllLock"] = 1
settings["DSDDemodSettings"]["title"] = "Channel %d" % i settings["DSDDemodSettings"]["title"] = "Channel %d" % i
elif options.channel_id == "UDPSrc": elif options.channel_id == "UDPSink":
settings["UDPSrcSettings"]["inputFrequencyOffset"] = options.channel_freq settings["UDPSinkSettings"]["inputFrequencyOffset"] = options.channel_freq
settings["UDPSrcSettings"]["rfBandwidth"] = options.rf_bw settings["UDPSinkSettings"]["rfBandwidth"] = options.rf_bw
settings["UDPSrcSettings"]["volume"] = options.volume settings["UDPSinkSettings"]["volume"] = options.volume
settings["UDPSrcSettings"]["squelchDB"] = options.squelch_db settings["UDPSinkSettings"]["squelchDB"] = options.squelch_db
settings["UDPSrcSettings"]["channelMute"] = 0 settings["UDPSinkSettings"]["channelMute"] = 0
settings["UDPSrcSettings"]["title"] = "Channel %d" % i settings["UDPSinkSettings"]["title"] = "Channel %d" % i
elif options.channel_id == "DaemonSink": elif options.channel_id == "DaemonSink":
settings["DaemonSinkSettings"]["title"] = "Channel %d" % i settings["DaemonSinkSettings"]["title"] = "Channel %d" % i
if options.daemon_address: if options.daemon_address: