1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-15 12:51:49 -05:00

Migration of DaemonSink channel to RemoteSink

This commit is contained in:
f4exb 2019-01-22 23:39:12 +01:00
parent e5b23e9864
commit 5b04cf4b5a
34 changed files with 581 additions and 568 deletions

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -27,10 +27,10 @@ endif()
find_package(CM256cc) find_package(CM256cc)
if(CM256CC_FOUND) if(CM256CC_FOUND)
add_subdirectory(daemonsink) add_subdirectory(remotesink)
endif(CM256CC_FOUND) endif(CM256CC_FOUND)
if (BUILD_DEBIAN) if (BUILD_DEBIAN)
add_subdirectory(demoddsd) add_subdirectory(demoddsd)
add_subdirectory(daemonsink) add_subdirectory(remotesink)
endif (BUILD_DEBIAN) endif (BUILD_DEBIAN)

View File

@ -1,83 +0,0 @@
project(daemonsink)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
if (HAS_SSSE3)
message(STATUS "DaemonSink: use SSSE3 SIMD" )
elseif (HAS_NEON)
message(STATUS "DaemonSink: use Neon SIMD" )
else()
message(STATUS "DaemonSink: Unsupported architecture")
return()
endif()
set(daemonsink_SOURCES
daemonsink.cpp
daemonsinkgui.cpp
daemonsinksettings.cpp
daemonsinkthread.cpp
daemonsinkplugin.cpp
)
set(daemonsink_HEADERS
daemonsink.h
daemonsinkgui.h
daemonsinksettings.h
daemonsinkthread.h
daemonsinkplugin.h
)
set(daemonsink_FORMS
daemonsinkgui.ui
)
#include(${QT_USE_FILE})
add_definitions(${QT_DEFINITIONS})
add_definitions(-DQT_PLUGIN)
add_definitions(-DQT_SHARED)
qt5_wrap_ui(daemonsink_FORMS_HEADERS ${daemonsink_FORMS})
add_library(daemonsink SHARED
${daemonsink_SOURCES}
${daemonsink_HEADERS_MOC}
${daemonsink_FORMS_HEADERS}
)
if (BUILD_DEBIAN)
target_include_directories(daemonsink PUBLIC
.
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
${LIBCM256CCSRC}
)
else (BUILD_DEBIAN)
target_include_directories(daemonsink PUBLIC
.
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
${CM256CC_INCLUDE_DIR}
)
endif (BUILD_DEBIAN)
if (BUILD_DEBIAN)
target_link_libraries(daemonsink
${QT_LIBRARIES}
cm256cc
sdrbase
sdrgui
swagger
)
else (BUILD_DEBIAN)
target_link_libraries(daemonsink
${QT_LIBRARIES}
${CM256CC_LIBRARIES}
sdrbase
sdrgui
swagger
)
endif (BUILD_DEBIAN)
target_link_libraries(daemonsink Qt5::Core Qt5::Widgets)
install(TARGETS daemonsink DESTINATION lib/plugins/channelrx)

View File

@ -0,0 +1,83 @@
project(remotesink)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
if (HAS_SSSE3)
message(STATUS "RemoteSink: use SSSE3 SIMD" )
elseif (HAS_NEON)
message(STATUS "RemoteSink: use Neon SIMD" )
else()
message(STATUS "RemoteSink: Unsupported architecture")
return()
endif()
set(remotesink_SOURCES
remotesink.cpp
remotesinkgui.cpp
remotesinksettings.cpp
remotesinkthread.cpp
remotesinkplugin.cpp
)
set(remotesink_HEADERS
remotesink.h
remotesinkgui.h
remotesinksettings.h
remotesinkthread.h
remotesinkplugin.h
)
set(remotesink_FORMS
remotesinkgui.ui
)
#include(${QT_USE_FILE})
add_definitions(${QT_DEFINITIONS})
add_definitions(-DQT_PLUGIN)
add_definitions(-DQT_SHARED)
qt5_wrap_ui(remotesink_FORMS_HEADERS ${remotesink_FORMS})
add_library(remotesink SHARED
${remotesink_SOURCES}
${remotesink_HEADERS_MOC}
${remotesink_FORMS_HEADERS}
)
if (BUILD_DEBIAN)
target_include_directories(remotesink PUBLIC
.
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
${LIBCM256CCSRC}
)
else (BUILD_DEBIAN)
target_include_directories(remotesink PUBLIC
.
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
${CM256CC_INCLUDE_DIR}
)
endif (BUILD_DEBIAN)
if (BUILD_DEBIAN)
target_link_libraries(remotesink
${QT_LIBRARIES}
cm256cc
sdrbase
sdrgui
swagger
)
else (BUILD_DEBIAN)
target_link_libraries(remotesink
${QT_LIBRARIES}
${CM256CC_LIBRARIES}
sdrbase
sdrgui
swagger
)
endif (BUILD_DEBIAN)
target_link_libraries(remotesink Qt5::Core Qt5::Widgets)
install(TARGETS remotesink DESTINATION lib/plugins/channelrx)

View File

@ -1,4 +1,4 @@
<h1>Daemon sink channel plugin</h1> <h1>Remote sink channel plugin</h1>
<h2>Introduction</h2> <h2>Introduction</h2>
@ -12,7 +12,7 @@ The plugin will be built only if the [CM256cc library](https://github.com/f4exb/
<h2>Interface</h2> <h2>Interface</h2>
![Daemon sink channel plugin GUI](../../../doc/img/DaemonSink.png) ![Remote sink channel plugin GUI](../../../doc/img/RemoteSink.png)
<h3>1: Distant address</h2> <h3>1: Distant address</h2>

View File

@ -1,11 +1,11 @@
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2018 Edouard Griffiths, F4EXB. // // Copyright (C) 2018 Edouard Griffiths, F4EXB. //
// // // //
// SDRdaemon sink channel (Rx) // // Remote sink channel (Rx) UDP sender thread //
// // // //
// SDRdaemon is a detached SDR front end that handles the interface with a // // SDRangel can work as a detached SDR front end. With this plugin it can //
// physical device and sends or receives the I/Q samples stream to or from a // // sends the I/Q samples stream to another SDRangel instance via UDP. //
// SDRangel instance via UDP. It is controlled via a Web REST API. // // It is controlled via a Web REST API. //
// // // //
// This program is free software; you can redistribute it and/or modify // // This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by // // it under the terms of the GNU General Public License as published by //
@ -20,6 +20,8 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // // along with this program. If not, see <http://www.gnu.org/licenses/>. //
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
#include "remotesink.h"
#include <sys/time.h> #include <sys/time.h>
#include <unistd.h> #include <unistd.h>
#include <boost/crc.hpp> #include <boost/crc.hpp>
@ -36,16 +38,16 @@
#include "dsp/downchannelizer.h" #include "dsp/downchannelizer.h"
#include "dsp/dspcommands.h" #include "dsp/dspcommands.h"
#include "device/devicesourceapi.h" #include "device/devicesourceapi.h"
#include "daemonsinkthread.h"
#include "daemonsink.h"
MESSAGE_CLASS_DEFINITION(DaemonSink::MsgConfigureDaemonSink, Message) #include "../remotesink/remotesinkthread.h"
MESSAGE_CLASS_DEFINITION(DaemonSink::MsgSampleRateNotification, Message)
const QString DaemonSink::m_channelIdURI = "sdrangel.channel.daemonsink"; MESSAGE_CLASS_DEFINITION(RemoteSink::MsgConfigureRemoteSink, Message)
const QString DaemonSink::m_channelId = "DaemonSink"; MESSAGE_CLASS_DEFINITION(RemoteSink::MsgSampleRateNotification, Message)
DaemonSink::DaemonSink(DeviceSourceAPI *deviceAPI) : const QString RemoteSink::m_channelIdURI = "sdrangel.channel.remotesink";
const QString RemoteSink::m_channelId = "RemoteSink";
RemoteSink::RemoteSink(DeviceSourceAPI *deviceAPI) :
ChannelSinkAPI(m_channelIdURI), ChannelSinkAPI(m_channelIdURI),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_running(false), m_running(false),
@ -72,7 +74,7 @@ DaemonSink::DaemonSink(DeviceSourceAPI *deviceAPI) :
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
} }
DaemonSink::~DaemonSink() RemoteSink::~RemoteSink()
{ {
disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
delete m_networkManager; delete m_networkManager;
@ -89,26 +91,26 @@ DaemonSink::~DaemonSink()
delete m_channelizer; delete m_channelizer;
} }
void DaemonSink::setTxDelay(int txDelay, int nbBlocksFEC) void RemoteSink::setTxDelay(int txDelay, int nbBlocksFEC)
{ {
double txDelayRatio = txDelay / 100.0; double txDelayRatio = txDelay / 100.0;
int samplesPerBlock = SDRDaemonNbBytesPerBlock / sizeof(Sample); int samplesPerBlock = SDRDaemonNbBytesPerBlock / sizeof(Sample);
double delay = m_sampleRate == 0 ? 1.0 : (127*samplesPerBlock*txDelayRatio) / m_sampleRate; double delay = m_sampleRate == 0 ? 1.0 : (127*samplesPerBlock*txDelayRatio) / m_sampleRate;
delay /= 128 + nbBlocksFEC; delay /= 128 + nbBlocksFEC;
m_txDelay = roundf(delay*1e6); // microseconds m_txDelay = roundf(delay*1e6); // microseconds
qDebug() << "DaemonSink::setTxDelay:" qDebug() << "RemoteSink::setTxDelay:"
<< " " << txDelay << " " << txDelay
<< "% m_txDelay: " << m_txDelay << "us" << "% m_txDelay: " << m_txDelay << "us"
<< " m_sampleRate: " << m_sampleRate << "S/s"; << " m_sampleRate: " << m_sampleRate << "S/s";
} }
void DaemonSink::setNbBlocksFEC(int nbBlocksFEC) void RemoteSink::setNbBlocksFEC(int nbBlocksFEC)
{ {
qDebug() << "DaemonSink::setNbBlocksFEC: nbBlocksFEC: " << nbBlocksFEC; qDebug() << "RemoteSink::setNbBlocksFEC: nbBlocksFEC: " << nbBlocksFEC;
m_nbBlocksFEC = nbBlocksFEC; m_nbBlocksFEC = nbBlocksFEC;
} }
void DaemonSink::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool firstOfBurst) void RemoteSink::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool firstOfBurst)
{ {
(void) firstOfBurst; (void) firstOfBurst;
SampleVector::const_iterator it = begin; SampleVector::const_iterator it = begin;
@ -153,7 +155,7 @@ void DaemonSink::feed(const SampleVector::const_iterator& begin, const SampleVec
if (!(metaData == m_currentMetaFEC)) if (!(metaData == m_currentMetaFEC))
{ {
qDebug() << "SDRDaemonChannelSink::feed: meta: " qDebug() << "RemoteSink::feed: meta: "
<< "|" << metaData.m_centerFrequency << "|" << metaData.m_centerFrequency
<< ":" << metaData.m_sampleRate << ":" << metaData.m_sampleRate
<< ":" << (int) (metaData.m_sampleBytes & 0xF) << ":" << (int) (metaData.m_sampleBytes & 0xF)
@ -219,9 +221,9 @@ void DaemonSink::feed(const SampleVector::const_iterator& begin, const SampleVec
} }
} }
void DaemonSink::start() void RemoteSink::start()
{ {
qDebug("DaemonSink::start"); qDebug("RemoteSink::start");
memset((void *) &m_currentMetaFEC, 0, sizeof(SDRDaemonMetaDataFEC)); memset((void *) &m_currentMetaFEC, 0, sizeof(SDRDaemonMetaDataFEC));
@ -229,7 +231,7 @@ void DaemonSink::start()
stop(); stop();
} }
m_sinkThread = new DaemonSinkThread(); m_sinkThread = new RemoteSinkThread();
connect(this, connect(this,
SIGNAL(dataBlockAvailable(SDRDaemonDataBlock *)), SIGNAL(dataBlockAvailable(SDRDaemonDataBlock *)),
m_sinkThread, m_sinkThread,
@ -239,9 +241,9 @@ void DaemonSink::start()
m_running = true; m_running = true;
} }
void DaemonSink::stop() void RemoteSink::stop()
{ {
qDebug("DaemonSink::stop"); qDebug("RemoteSink::stop");
if (m_sinkThread != 0) if (m_sinkThread != 0)
{ {
@ -253,14 +255,14 @@ void DaemonSink::stop()
m_running = false; m_running = false;
} }
bool DaemonSink::handleMessage(const Message& cmd) bool RemoteSink::handleMessage(const Message& cmd)
{ {
(void) cmd; (void) cmd;
if (DownChannelizer::MsgChannelizerNotification::match(cmd)) if (DownChannelizer::MsgChannelizerNotification::match(cmd))
{ {
DownChannelizer::MsgChannelizerNotification& notif = (DownChannelizer::MsgChannelizerNotification&) cmd; DownChannelizer::MsgChannelizerNotification& notif = (DownChannelizer::MsgChannelizerNotification&) cmd;
qDebug() << "DaemonSink::handleMessage: MsgChannelizerNotification:" qDebug() << "RemoteSink::handleMessage: MsgChannelizerNotification:"
<< " channelSampleRate: " << notif.getSampleRate() << " channelSampleRate: " << notif.getSampleRate()
<< " offsetFrequency: " << notif.getFrequencyOffset(); << " offsetFrequency: " << notif.getFrequencyOffset();
@ -282,7 +284,7 @@ bool DaemonSink::handleMessage(const Message& cmd)
{ {
DSPSignalNotification& notif = (DSPSignalNotification&) cmd; DSPSignalNotification& notif = (DSPSignalNotification&) cmd;
qDebug() << "DaemonSink::handleMessage: DSPSignalNotification:" qDebug() << "RemoteSink::handleMessage: DSPSignalNotification:"
<< " inputSampleRate: " << notif.getSampleRate() << " inputSampleRate: " << notif.getSampleRate()
<< " centerFrequency: " << notif.getCenterFrequency(); << " centerFrequency: " << notif.getCenterFrequency();
@ -290,10 +292,10 @@ bool DaemonSink::handleMessage(const Message& cmd)
return true; return true;
} }
else if (MsgConfigureDaemonSink::match(cmd)) else if (MsgConfigureRemoteSink::match(cmd))
{ {
MsgConfigureDaemonSink& cfg = (MsgConfigureDaemonSink&) cmd; MsgConfigureRemoteSink& cfg = (MsgConfigureRemoteSink&) cmd;
qDebug() << "DaemonSink::handleMessage: MsgConfigureDaemonSink"; qDebug() << "RemoteSink::handleMessage: MsgConfigureRemoteSink";
applySettings(cfg.getSettings(), cfg.getForce()); applySettings(cfg.getSettings(), cfg.getForce());
return true; return true;
@ -304,32 +306,32 @@ bool DaemonSink::handleMessage(const Message& cmd)
} }
} }
QByteArray DaemonSink::serialize() const QByteArray RemoteSink::serialize() const
{ {
return m_settings.serialize(); return m_settings.serialize();
} }
bool DaemonSink::deserialize(const QByteArray& data) bool RemoteSink::deserialize(const QByteArray& data)
{ {
(void) data; (void) data;
if (m_settings.deserialize(data)) if (m_settings.deserialize(data))
{ {
MsgConfigureDaemonSink *msg = MsgConfigureDaemonSink::create(m_settings, true); MsgConfigureRemoteSink *msg = MsgConfigureRemoteSink::create(m_settings, true);
m_inputMessageQueue.push(msg); m_inputMessageQueue.push(msg);
return true; return true;
} }
else else
{ {
m_settings.resetToDefaults(); m_settings.resetToDefaults();
MsgConfigureDaemonSink *msg = MsgConfigureDaemonSink::create(m_settings, true); MsgConfigureRemoteSink *msg = MsgConfigureRemoteSink::create(m_settings, true);
m_inputMessageQueue.push(msg); m_inputMessageQueue.push(msg);
return false; return false;
} }
} }
void DaemonSink::applySettings(const DaemonSinkSettings& settings, bool force) void RemoteSink::applySettings(const RemoteSinkSettings& settings, bool force)
{ {
qDebug() << "DaemonSink::applySettings:" qDebug() << "RemoteSink::applySettings:"
<< " m_nbFECBlocks: " << settings.m_nbFECBlocks << " m_nbFECBlocks: " << settings.m_nbFECBlocks
<< " m_txDelay: " << settings.m_txDelay << " m_txDelay: " << settings.m_txDelay
<< " m_dataAddress: " << settings.m_dataAddress << " m_dataAddress: " << settings.m_dataAddress
@ -376,40 +378,40 @@ void DaemonSink::applySettings(const DaemonSinkSettings& settings, bool force)
m_settings = settings; m_settings = settings;
} }
int DaemonSink::webapiSettingsGet( int RemoteSink::webapiSettingsGet(
SWGSDRangel::SWGChannelSettings& response, SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage) QString& errorMessage)
{ {
(void) errorMessage; (void) errorMessage;
response.setDaemonSinkSettings(new SWGSDRangel::SWGDaemonSinkSettings()); response.setRemoteSinkSettings(new SWGSDRangel::SWGRemoteSinkSettings());
response.getDaemonSinkSettings()->init(); response.getRemoteSinkSettings()->init();
webapiFormatChannelSettings(response, m_settings); webapiFormatChannelSettings(response, m_settings);
return 200; return 200;
} }
int DaemonSink::webapiSettingsPutPatch( int RemoteSink::webapiSettingsPutPatch(
bool force, bool force,
const QStringList& channelSettingsKeys, const QStringList& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings& response, SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage) QString& errorMessage)
{ {
(void) errorMessage; (void) errorMessage;
DaemonSinkSettings settings = m_settings; RemoteSinkSettings settings = m_settings;
if (channelSettingsKeys.contains("nbFECBlocks")) if (channelSettingsKeys.contains("nbFECBlocks"))
{ {
int nbFECBlocks = response.getDaemonSinkSettings()->getNbFecBlocks(); int nbFECBlocks = response.getRemoteSinkSettings()->getNbFecBlocks();
if ((nbFECBlocks < 0) || (nbFECBlocks > 127)) { if ((nbFECBlocks < 0) || (nbFECBlocks > 127)) {
settings.m_nbFECBlocks = 8; settings.m_nbFECBlocks = 8;
} else { } else {
settings.m_nbFECBlocks = response.getDaemonSinkSettings()->getNbFecBlocks(); settings.m_nbFECBlocks = response.getRemoteSinkSettings()->getNbFecBlocks();
} }
} }
if (channelSettingsKeys.contains("txDelay")) if (channelSettingsKeys.contains("txDelay"))
{ {
int txDelay = response.getDaemonSinkSettings()->getTxDelay(); int txDelay = response.getRemoteSinkSettings()->getTxDelay();
if (txDelay < 0) { if (txDelay < 0) {
settings.m_txDelay = 35; settings.m_txDelay = 35;
@ -419,12 +421,12 @@ int DaemonSink::webapiSettingsPutPatch(
} }
if (channelSettingsKeys.contains("dataAddress")) { if (channelSettingsKeys.contains("dataAddress")) {
settings.m_dataAddress = *response.getDaemonSinkSettings()->getDataAddress(); settings.m_dataAddress = *response.getRemoteSinkSettings()->getDataAddress();
} }
if (channelSettingsKeys.contains("dataPort")) if (channelSettingsKeys.contains("dataPort"))
{ {
int dataPort = response.getDaemonSinkSettings()->getDataPort(); int dataPort = response.getRemoteSinkSettings()->getDataPort();
if ((dataPort < 1024) || (dataPort > 65535)) { if ((dataPort < 1024) || (dataPort > 65535)) {
settings.m_dataPort = 9090; settings.m_dataPort = 9090;
@ -434,34 +436,34 @@ int DaemonSink::webapiSettingsPutPatch(
} }
if (channelSettingsKeys.contains("rgbColor")) { if (channelSettingsKeys.contains("rgbColor")) {
settings.m_rgbColor = response.getDaemonSinkSettings()->getRgbColor(); settings.m_rgbColor = response.getRemoteSinkSettings()->getRgbColor();
} }
if (channelSettingsKeys.contains("title")) { if (channelSettingsKeys.contains("title")) {
settings.m_title = *response.getDaemonSinkSettings()->getTitle(); settings.m_title = *response.getRemoteSinkSettings()->getTitle();
} }
if (channelSettingsKeys.contains("useReverseAPI")) { if (channelSettingsKeys.contains("useReverseAPI")) {
settings.m_useReverseAPI = response.getDaemonSinkSettings()->getUseReverseApi() != 0; settings.m_useReverseAPI = response.getRemoteSinkSettings()->getUseReverseApi() != 0;
} }
if (channelSettingsKeys.contains("reverseAPIAddress")) { if (channelSettingsKeys.contains("reverseAPIAddress")) {
settings.m_reverseAPIAddress = *response.getDaemonSinkSettings()->getReverseApiAddress(); settings.m_reverseAPIAddress = *response.getRemoteSinkSettings()->getReverseApiAddress();
} }
if (channelSettingsKeys.contains("reverseAPIPort")) { if (channelSettingsKeys.contains("reverseAPIPort")) {
settings.m_reverseAPIPort = response.getDaemonSinkSettings()->getReverseApiPort(); settings.m_reverseAPIPort = response.getRemoteSinkSettings()->getReverseApiPort();
} }
if (channelSettingsKeys.contains("reverseAPIDeviceIndex")) { if (channelSettingsKeys.contains("reverseAPIDeviceIndex")) {
settings.m_reverseAPIDeviceIndex = response.getDaemonSinkSettings()->getReverseApiDeviceIndex(); settings.m_reverseAPIDeviceIndex = response.getRemoteSinkSettings()->getReverseApiDeviceIndex();
} }
if (channelSettingsKeys.contains("reverseAPIChannelIndex")) { if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
settings.m_reverseAPIChannelIndex = response.getDaemonSinkSettings()->getReverseApiChannelIndex(); settings.m_reverseAPIChannelIndex = response.getRemoteSinkSettings()->getReverseApiChannelIndex();
} }
MsgConfigureDaemonSink *msg = MsgConfigureDaemonSink::create(settings, force); MsgConfigureRemoteSink *msg = MsgConfigureRemoteSink::create(settings, force);
m_inputMessageQueue.push(msg); m_inputMessageQueue.push(msg);
qDebug("DaemonSink::webapiSettingsPutPatch: forward to GUI: %p", m_guiMessageQueue); qDebug("RemoteSink::webapiSettingsPutPatch: forward to GUI: %p", m_guiMessageQueue);
if (m_guiMessageQueue) // forward to GUI if any if (m_guiMessageQueue) // forward to GUI if any
{ {
MsgConfigureDaemonSink *msgToGUI = MsgConfigureDaemonSink::create(settings, force); MsgConfigureRemoteSink *msgToGUI = MsgConfigureRemoteSink::create(settings, force);
m_guiMessageQueue->push(msgToGUI); m_guiMessageQueue->push(msgToGUI);
} }
@ -470,67 +472,67 @@ int DaemonSink::webapiSettingsPutPatch(
return 200; return 200;
} }
void DaemonSink::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const DaemonSinkSettings& settings) void RemoteSink::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const RemoteSinkSettings& settings)
{ {
response.getDaemonSinkSettings()->setNbFecBlocks(settings.m_nbFECBlocks); response.getRemoteSinkSettings()->setNbFecBlocks(settings.m_nbFECBlocks);
response.getDaemonSinkSettings()->setTxDelay(settings.m_txDelay); response.getRemoteSinkSettings()->setTxDelay(settings.m_txDelay);
if (response.getDaemonSinkSettings()->getDataAddress()) { if (response.getRemoteSinkSettings()->getDataAddress()) {
*response.getDaemonSinkSettings()->getDataAddress() = settings.m_dataAddress; *response.getRemoteSinkSettings()->getDataAddress() = settings.m_dataAddress;
} else { } else {
response.getDaemonSinkSettings()->setDataAddress(new QString(settings.m_dataAddress)); response.getRemoteSinkSettings()->setDataAddress(new QString(settings.m_dataAddress));
} }
response.getDaemonSinkSettings()->setDataPort(settings.m_dataPort); response.getRemoteSinkSettings()->setDataPort(settings.m_dataPort);
response.getDaemonSinkSettings()->setRgbColor(settings.m_rgbColor); response.getRemoteSinkSettings()->setRgbColor(settings.m_rgbColor);
if (response.getDaemonSinkSettings()->getTitle()) { if (response.getRemoteSinkSettings()->getTitle()) {
*response.getDaemonSinkSettings()->getTitle() = settings.m_title; *response.getRemoteSinkSettings()->getTitle() = settings.m_title;
} else { } else {
response.getDaemonSinkSettings()->setTitle(new QString(settings.m_title)); response.getRemoteSinkSettings()->setTitle(new QString(settings.m_title));
} }
response.getDaemonSinkSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0); response.getRemoteSinkSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
if (response.getDaemonSinkSettings()->getReverseApiAddress()) { if (response.getRemoteSinkSettings()->getReverseApiAddress()) {
*response.getDaemonSinkSettings()->getReverseApiAddress() = settings.m_reverseAPIAddress; *response.getRemoteSinkSettings()->getReverseApiAddress() = settings.m_reverseAPIAddress;
} else { } else {
response.getDaemonSinkSettings()->setReverseApiAddress(new QString(settings.m_reverseAPIAddress)); response.getRemoteSinkSettings()->setReverseApiAddress(new QString(settings.m_reverseAPIAddress));
} }
response.getDaemonSinkSettings()->setReverseApiPort(settings.m_reverseAPIPort); response.getRemoteSinkSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getDaemonSinkSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex); response.getRemoteSinkSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
response.getDaemonSinkSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex); response.getRemoteSinkSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex);
} }
void DaemonSink::webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const DaemonSinkSettings& settings, bool force) void RemoteSink::webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const RemoteSinkSettings& settings, bool force)
{ {
SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings();
swgChannelSettings->setTx(0); swgChannelSettings->setTx(0);
swgChannelSettings->setChannelType(new QString("DaemonSink")); swgChannelSettings->setChannelType(new QString("RemoteSink"));
swgChannelSettings->setDaemonSinkSettings(new SWGSDRangel::SWGDaemonSinkSettings()); swgChannelSettings->setRemoteSinkSettings(new SWGSDRangel::SWGRemoteSinkSettings());
SWGSDRangel::SWGDaemonSinkSettings *swgDaemonSinkSettings = swgChannelSettings->getDaemonSinkSettings(); SWGSDRangel::SWGRemoteSinkSettings *swgRemoteSinkSettings = swgChannelSettings->getRemoteSinkSettings();
// transfer data that has been modified. When force is on transfer all data except reverse API data // transfer data that has been modified. When force is on transfer all data except reverse API data
if (channelSettingsKeys.contains("nbFECBlocks") || force) { if (channelSettingsKeys.contains("nbFECBlocks") || force) {
swgDaemonSinkSettings->setNbFecBlocks(settings.m_nbFECBlocks); swgRemoteSinkSettings->setNbFecBlocks(settings.m_nbFECBlocks);
} }
if (channelSettingsKeys.contains("txDelay") || force) if (channelSettingsKeys.contains("txDelay") || force)
{ {
swgDaemonSinkSettings->setTxDelay(settings.m_txDelay); swgRemoteSinkSettings->setTxDelay(settings.m_txDelay);
} }
if (channelSettingsKeys.contains("dataAddress") || force) { if (channelSettingsKeys.contains("dataAddress") || force) {
swgDaemonSinkSettings->setDataAddress(new QString(settings.m_dataAddress)); swgRemoteSinkSettings->setDataAddress(new QString(settings.m_dataAddress));
} }
if (channelSettingsKeys.contains("dataPort") || force) { if (channelSettingsKeys.contains("dataPort") || force) {
swgDaemonSinkSettings->setDataPort(settings.m_dataPort); swgRemoteSinkSettings->setDataPort(settings.m_dataPort);
} }
if (channelSettingsKeys.contains("rgbColor") || force) { if (channelSettingsKeys.contains("rgbColor") || force) {
swgDaemonSinkSettings->setRgbColor(settings.m_rgbColor); swgRemoteSinkSettings->setRgbColor(settings.m_rgbColor);
} }
if (channelSettingsKeys.contains("title") || force) { if (channelSettingsKeys.contains("title") || force) {
swgDaemonSinkSettings->setTitle(new QString(settings.m_title)); swgRemoteSinkSettings->setTitle(new QString(settings.m_title));
} }
QString channelSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/channel/%4/settings") QString channelSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/channel/%4/settings")
@ -552,13 +554,13 @@ void DaemonSink::webapiReverseSendSettings(QList<QString>& channelSettingsKeys,
delete swgChannelSettings; delete swgChannelSettings;
} }
void DaemonSink::networkManagerFinished(QNetworkReply *reply) void RemoteSink::networkManagerFinished(QNetworkReply *reply)
{ {
QNetworkReply::NetworkError replyError = reply->error(); QNetworkReply::NetworkError replyError = reply->error();
if (replyError) if (replyError)
{ {
qWarning() << "DaemonSink::networkManagerFinished:" qWarning() << "RemoteSink::networkManagerFinished:"
<< " error(" << (int) replyError << " error(" << (int) replyError
<< "): " << replyError << "): " << replyError
<< ": " << reply->errorString(); << ": " << reply->errorString();
@ -567,5 +569,5 @@ void DaemonSink::networkManagerFinished(QNetworkReply *reply)
QString answer = reply->readAll(); QString answer = reply->readAll();
answer.chop(1); // remove last \n answer.chop(1); // remove last \n
qDebug("DaemonSink::networkManagerFinished: reply:\n%s", answer.toStdString().c_str()); qDebug("RemoteSink::networkManagerFinished: reply:\n%s", answer.toStdString().c_str());
} }

View File

@ -1,11 +1,11 @@
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2018 Edouard Griffiths, F4EXB. // // Copyright (C) 2018 Edouard Griffiths, F4EXB. //
// // // //
// SDRdaemon sink channel (Rx) // // Remote sink channel (Rx) UDP sender thread //
// // // //
// SDRdaemon is a detached SDR front end that handles the interface with a // // SDRangel can work as a detached SDR front end. With this plugin it can //
// physical device and sends or receives the I/Q samples stream to or from a // // sends the I/Q samples stream to another SDRangel instance via UDP. //
// SDRangel instance via UDP. It is controlled via a Web REST API. // // It is controlled via a Web REST API. //
// // // //
// This program is free software; you can redistribute it and/or modify // // This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by // // it under the terms of the GNU General Public License as published by //
@ -20,8 +20,8 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // // along with this program. If not, see <http://www.gnu.org/licenses/>. //
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
#ifndef INCLUDE_DAEMONSINK_H_ #ifndef INCLUDE_REMOTESINK_H_
#define INCLUDE_DAEMONSINK_H_ #define INCLUDE_REMOTESINK_H_
#include <QObject> #include <QObject>
#include <QMutex> #include <QMutex>
@ -30,35 +30,36 @@
#include "dsp/basebandsamplesink.h" #include "dsp/basebandsamplesink.h"
#include "channel/channelsinkapi.h" #include "channel/channelsinkapi.h"
#include "channel/sdrdaemondatablock.h" #include "channel/sdrdaemondatablock.h"
#include "daemonsinksettings.h"
#include "../remotesink/remotesinksettings.h"
class QNetworkAccessManager; class QNetworkAccessManager;
class QNetworkReply; class QNetworkReply;
class DeviceSourceAPI; class DeviceSourceAPI;
class ThreadedBasebandSampleSink; class ThreadedBasebandSampleSink;
class DownChannelizer; class DownChannelizer;
class DaemonSinkThread; class RemoteSinkThread;
class DaemonSink : public BasebandSampleSink, public ChannelSinkAPI { class RemoteSink : public BasebandSampleSink, public ChannelSinkAPI {
Q_OBJECT Q_OBJECT
public: public:
class MsgConfigureDaemonSink : public Message { class MsgConfigureRemoteSink : public Message {
MESSAGE_CLASS_DECLARATION MESSAGE_CLASS_DECLARATION
public: public:
const DaemonSinkSettings& getSettings() const { return m_settings; } const RemoteSinkSettings& getSettings() const { return m_settings; }
bool getForce() const { return m_force; } bool getForce() const { return m_force; }
static MsgConfigureDaemonSink* create(const DaemonSinkSettings& settings, bool force) static MsgConfigureRemoteSink* create(const RemoteSinkSettings& settings, bool force)
{ {
return new MsgConfigureDaemonSink(settings, force); return new MsgConfigureRemoteSink(settings, force);
} }
private: private:
DaemonSinkSettings m_settings; RemoteSinkSettings m_settings;
bool m_force; bool m_force;
MsgConfigureDaemonSink(const DaemonSinkSettings& settings, bool force) : MsgConfigureRemoteSink(const RemoteSinkSettings& settings, bool force) :
Message(), Message(),
m_settings(settings), m_settings(settings),
m_force(force) m_force(force)
@ -85,8 +86,8 @@ public:
int m_sampleRate; int m_sampleRate;
}; };
DaemonSink(DeviceSourceAPI *deviceAPI); RemoteSink(DeviceSourceAPI *deviceAPI);
virtual ~DaemonSink(); virtual ~RemoteSink();
virtual void destroy() { delete this; } virtual void destroy() { delete this; }
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po); virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po);
@ -95,7 +96,7 @@ public:
virtual bool handleMessage(const Message& cmd); virtual bool handleMessage(const Message& cmd);
virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = "SDRDaemon Sink"; } virtual void getTitle(QString& title) { title = "Remote Sink"; }
virtual qint64 getCenterFrequency() const { return 0; } virtual qint64 getCenterFrequency() const { return 0; }
virtual QByteArray serialize() const; virtual QByteArray serialize() const;
@ -134,8 +135,8 @@ private:
DownChannelizer* m_channelizer; DownChannelizer* m_channelizer;
bool m_running; bool m_running;
DaemonSinkSettings m_settings; RemoteSinkSettings m_settings;
DaemonSinkThread *m_sinkThread; RemoteSinkThread *m_sinkThread;
int m_txBlockIndex; //!< Current index in blocks to transmit in the Tx row int m_txBlockIndex; //!< Current index in blocks to transmit in the Tx row
uint16_t m_frameCount; //!< transmission frame count uint16_t m_frameCount; //!< transmission frame count
@ -154,12 +155,12 @@ private:
QNetworkAccessManager *m_networkManager; QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest; QNetworkRequest m_networkRequest;
void applySettings(const DaemonSinkSettings& settings, bool force = false); void applySettings(const RemoteSinkSettings& settings, bool force = false);
void webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const DaemonSinkSettings& settings); void webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const RemoteSinkSettings& settings);
void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const DaemonSinkSettings& settings, bool force); void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const RemoteSinkSettings& settings, bool force);
private slots: private slots:
void networkManagerFinished(QNetworkReply *reply); void networkManagerFinished(QNetworkReply *reply);
}; };
#endif /* INCLUDE_DAEMONSINK_H_ */ #endif /* INCLUDE_REMOTESINK_H_ */

View File

@ -9,7 +9,7 @@ CONFIG += plugin
QT += core gui widgets multimedia network opengl QT += core gui widgets multimedia network opengl
TARGET = daemonsink TARGET = remotesink
CONFIG(MINGW32):LIBCM256CCSRC = "C:\softs\cm256cc" CONFIG(MINGW32):LIBCM256CCSRC = "C:\softs\cm256cc"
CONFIG(MSVC):LIBCM256CCSRC = "C:\softs\cm256cc" CONFIG(MSVC):LIBCM256CCSRC = "C:\softs\cm256cc"
@ -38,19 +38,19 @@ CONFIG(MINGW32):INCLUDEPATH += "C:\softs\boost_1_66_0"
CONFIG(MSVC):INCLUDEPATH += "C:\softs\boost_1_66_0" CONFIG(MSVC):INCLUDEPATH += "C:\softs\boost_1_66_0"
CONFIG(macx):INCLUDEPATH += "../../../boost_1_69_0" CONFIG(macx):INCLUDEPATH += "../../../boost_1_69_0"
SOURCES += daemonsink.cpp\ SOURCES += remotesink.cpp\
daemonsinkgui.cpp\ remotesinkgui.cpp\
daemonsinksettings.cpp\ remotesinksettings.cpp\
daemonsinkplugin.cpp\ remotesinkplugin.cpp\
daemonsinkthread.cpp remotesinkthread.cpp
HEADERS += daemonsink.h\ HEADERS += remotesink.h\
daemonsinkgui.h\ remotesinkgui.h\
daemonsinksettings.h\ remotesinksettings.h\
daemonsinkplugin.h\ remotesinkplugin.h\
daemonsinkthread.h remotesinkthread.h
FORMS += daemonsinkgui.ui FORMS += remotesinkgui.ui
LIBS += -L../../../sdrbase/$${build_subdir} -lsdrbase LIBS += -L../../../sdrbase/$${build_subdir} -lsdrbase
LIBS += -L../../../sdrgui/$${build_subdir} -lsdrgui LIBS += -L../../../sdrgui/$${build_subdir} -lsdrgui

View File

@ -14,58 +14,59 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // // along with this program. If not, see <http://www.gnu.org/licenses/>. //
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
#include "remotesinkgui.h"
#include "device/devicesourceapi.h" #include "device/devicesourceapi.h"
#include "device/deviceuiset.h" #include "device/deviceuiset.h"
#include "gui/basicchannelsettingsdialog.h" #include "gui/basicchannelsettingsdialog.h"
#include "mainwindow.h" #include "mainwindow.h"
#include "daemonsink.h" #include "remotesink.h"
#include "ui_daemonsinkgui.h" #include "ui_remotesinkgui.h"
#include "daemonsinkgui.h"
DaemonSinkGUI* DaemonSinkGUI::create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *channelRx) RemoteSinkGUI* RemoteSinkGUI::create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *channelRx)
{ {
DaemonSinkGUI* gui = new DaemonSinkGUI(pluginAPI, deviceUISet, channelRx); RemoteSinkGUI* gui = new RemoteSinkGUI(pluginAPI, deviceUISet, channelRx);
return gui; return gui;
} }
void DaemonSinkGUI::destroy() void RemoteSinkGUI::destroy()
{ {
delete this; delete this;
} }
void DaemonSinkGUI::setName(const QString& name) void RemoteSinkGUI::setName(const QString& name)
{ {
setObjectName(name); setObjectName(name);
} }
QString DaemonSinkGUI::getName() const QString RemoteSinkGUI::getName() const
{ {
return objectName(); return objectName();
} }
qint64 DaemonSinkGUI::getCenterFrequency() const { qint64 RemoteSinkGUI::getCenterFrequency() const {
return 0; return 0;
} }
void DaemonSinkGUI::setCenterFrequency(qint64 centerFrequency) void RemoteSinkGUI::setCenterFrequency(qint64 centerFrequency)
{ {
(void) centerFrequency; (void) centerFrequency;
} }
void DaemonSinkGUI::resetToDefaults() void RemoteSinkGUI::resetToDefaults()
{ {
m_settings.resetToDefaults(); m_settings.resetToDefaults();
displaySettings(); displaySettings();
applySettings(true); applySettings(true);
} }
QByteArray DaemonSinkGUI::serialize() const QByteArray RemoteSinkGUI::serialize() const
{ {
return m_settings.serialize(); return m_settings.serialize();
} }
bool DaemonSinkGUI::deserialize(const QByteArray& data) bool RemoteSinkGUI::deserialize(const QByteArray& data)
{ {
if(m_settings.deserialize(data)) { if(m_settings.deserialize(data)) {
displaySettings(); displaySettings();
@ -77,19 +78,19 @@ bool DaemonSinkGUI::deserialize(const QByteArray& data)
} }
} }
bool DaemonSinkGUI::handleMessage(const Message& message) bool RemoteSinkGUI::handleMessage(const Message& message)
{ {
if (DaemonSink::MsgSampleRateNotification::match(message)) if (RemoteSink::MsgSampleRateNotification::match(message))
{ {
DaemonSink::MsgSampleRateNotification& notif = (DaemonSink::MsgSampleRateNotification&) message; RemoteSink::MsgSampleRateNotification& notif = (RemoteSink::MsgSampleRateNotification&) message;
m_channelMarker.setBandwidth(notif.getSampleRate()); m_channelMarker.setBandwidth(notif.getSampleRate());
m_sampleRate = notif.getSampleRate(); m_sampleRate = notif.getSampleRate();
updateTxDelayTime(); updateTxDelayTime();
return true; return true;
} }
else if (DaemonSink::MsgConfigureDaemonSink::match(message)) else if (RemoteSink::MsgConfigureRemoteSink::match(message))
{ {
const DaemonSink::MsgConfigureDaemonSink& cfg = (DaemonSink::MsgConfigureDaemonSink&) message; const RemoteSink::MsgConfigureRemoteSink& cfg = (RemoteSink::MsgConfigureRemoteSink&) message;
m_settings = cfg.getSettings(); m_settings = cfg.getSettings();
blockApplySettings(true); blockApplySettings(true);
displaySettings(); displaySettings();
@ -102,9 +103,9 @@ bool DaemonSinkGUI::handleMessage(const Message& message)
} }
} }
DaemonSinkGUI::DaemonSinkGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *channelrx, QWidget* parent) : RemoteSinkGUI::RemoteSinkGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *channelrx, QWidget* parent) :
RollupWidget(parent), RollupWidget(parent),
ui(new Ui::DaemonSinkGUI), ui(new Ui::RemoteSinkGUI),
m_pluginAPI(pluginAPI), m_pluginAPI(pluginAPI),
m_deviceUISet(deviceUISet), m_deviceUISet(deviceUISet),
m_sampleRate(0), m_sampleRate(0),
@ -115,19 +116,19 @@ DaemonSinkGUI::DaemonSinkGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Bas
connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &))); connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
m_daemonSink = (DaemonSink*) channelrx; m_remoteSink = (RemoteSink*) channelrx;
m_daemonSink->setMessageQueueToGUI(getInputMessageQueue()); m_remoteSink->setMessageQueueToGUI(getInputMessageQueue());
m_channelMarker.blockSignals(true); m_channelMarker.blockSignals(true);
m_channelMarker.setColor(m_settings.m_rgbColor); m_channelMarker.setColor(m_settings.m_rgbColor);
m_channelMarker.setCenterFrequency(0); m_channelMarker.setCenterFrequency(0);
m_channelMarker.setTitle("Daemon source"); m_channelMarker.setTitle("Remote source");
m_channelMarker.blockSignals(false); m_channelMarker.blockSignals(false);
m_channelMarker.setVisible(true); // activate signal on the last setting only m_channelMarker.setVisible(true); // activate signal on the last setting only
m_settings.setChannelMarker(&m_channelMarker); m_settings.setChannelMarker(&m_channelMarker);
m_deviceUISet->registerRxChannelInstance(DaemonSink::m_channelIdURI, this); m_deviceUISet->registerRxChannelInstance(RemoteSink::m_channelIdURI, this);
m_deviceUISet->addChannelMarker(&m_channelMarker); m_deviceUISet->addChannelMarker(&m_channelMarker);
m_deviceUISet->addRollupWidget(this); m_deviceUISet->addRollupWidget(this);
@ -140,29 +141,29 @@ DaemonSinkGUI::DaemonSinkGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Bas
applySettings(true); applySettings(true);
} }
DaemonSinkGUI::~DaemonSinkGUI() RemoteSinkGUI::~RemoteSinkGUI()
{ {
m_deviceUISet->removeRxChannelInstance(this); m_deviceUISet->removeRxChannelInstance(this);
delete ui; delete ui;
} }
void DaemonSinkGUI::blockApplySettings(bool block) void RemoteSinkGUI::blockApplySettings(bool block)
{ {
m_doApplySettings = !block; m_doApplySettings = !block;
} }
void DaemonSinkGUI::applySettings(bool force) void RemoteSinkGUI::applySettings(bool force)
{ {
if (m_doApplySettings) if (m_doApplySettings)
{ {
setTitleColor(m_channelMarker.getColor()); setTitleColor(m_channelMarker.getColor());
DaemonSink::MsgConfigureDaemonSink* message = DaemonSink::MsgConfigureDaemonSink::create(m_settings, force); RemoteSink::MsgConfigureRemoteSink* message = RemoteSink::MsgConfigureRemoteSink::create(m_settings, force);
m_daemonSink->getInputMessageQueue()->push(message); m_remoteSink->getInputMessageQueue()->push(message);
} }
} }
void DaemonSinkGUI::displaySettings() void RemoteSinkGUI::displaySettings()
{ {
m_channelMarker.blockSignals(true); m_channelMarker.blockSignals(true);
m_channelMarker.setCenterFrequency(0); m_channelMarker.setCenterFrequency(0);
@ -186,17 +187,17 @@ void DaemonSinkGUI::displaySettings()
blockApplySettings(false); blockApplySettings(false);
} }
void DaemonSinkGUI::leaveEvent(QEvent*) void RemoteSinkGUI::leaveEvent(QEvent*)
{ {
m_channelMarker.setHighlighted(false); m_channelMarker.setHighlighted(false);
} }
void DaemonSinkGUI::enterEvent(QEvent*) void RemoteSinkGUI::enterEvent(QEvent*)
{ {
m_channelMarker.setHighlighted(true); m_channelMarker.setHighlighted(true);
} }
void DaemonSinkGUI::handleSourceMessages() void RemoteSinkGUI::handleSourceMessages()
{ {
Message* message; Message* message;
@ -209,13 +210,13 @@ void DaemonSinkGUI::handleSourceMessages()
} }
} }
void DaemonSinkGUI::onWidgetRolled(QWidget* widget, bool rollDown) void RemoteSinkGUI::onWidgetRolled(QWidget* widget, bool rollDown)
{ {
(void) widget; (void) widget;
(void) rollDown; (void) rollDown;
} }
void DaemonSinkGUI::onMenuDialogCalled(const QPoint &p) void RemoteSinkGUI::onMenuDialogCalled(const QPoint &p)
{ {
BasicChannelSettingsDialog dialog(&m_channelMarker, this); BasicChannelSettingsDialog dialog(&m_channelMarker, this);
dialog.setUseReverseAPI(m_settings.m_useReverseAPI); dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
@ -241,13 +242,13 @@ void DaemonSinkGUI::onMenuDialogCalled(const QPoint &p)
applySettings(); applySettings();
} }
void DaemonSinkGUI::on_dataAddress_returnPressed() void RemoteSinkGUI::on_dataAddress_returnPressed()
{ {
m_settings.m_dataAddress = ui->dataAddress->text(); m_settings.m_dataAddress = ui->dataAddress->text();
applySettings(); applySettings();
} }
void DaemonSinkGUI::on_dataPort_returnPressed() void RemoteSinkGUI::on_dataPort_returnPressed()
{ {
bool dataOk; bool dataOk;
int dataPort = ui->dataPort->text().toInt(&dataOk); int dataPort = ui->dataPort->text().toInt(&dataOk);
@ -264,7 +265,7 @@ void DaemonSinkGUI::on_dataPort_returnPressed()
applySettings(); applySettings();
} }
void DaemonSinkGUI::on_dataApplyButton_clicked(bool checked) void RemoteSinkGUI::on_dataApplyButton_clicked(bool checked)
{ {
(void) checked; (void) checked;
m_settings.m_dataAddress = ui->dataAddress->text(); m_settings.m_dataAddress = ui->dataAddress->text();
@ -280,7 +281,7 @@ void DaemonSinkGUI::on_dataApplyButton_clicked(bool checked)
applySettings(); applySettings();
} }
void DaemonSinkGUI::on_txDelay_valueChanged(int value) void RemoteSinkGUI::on_txDelay_valueChanged(int value)
{ {
m_settings.m_txDelay = value; // percentage m_settings.m_txDelay = value; // percentage
ui->txDelayText->setText(tr("%1%").arg(value)); ui->txDelayText->setText(tr("%1%").arg(value));
@ -288,7 +289,7 @@ void DaemonSinkGUI::on_txDelay_valueChanged(int value)
applySettings(); applySettings();
} }
void DaemonSinkGUI::on_nbFECBlocks_valueChanged(int value) void RemoteSinkGUI::on_nbFECBlocks_valueChanged(int value)
{ {
m_settings.m_nbFECBlocks = value; m_settings.m_nbFECBlocks = value;
int nbOriginalBlocks = 128; int nbOriginalBlocks = 128;
@ -300,7 +301,7 @@ void DaemonSinkGUI::on_nbFECBlocks_valueChanged(int value)
applySettings(); applySettings();
} }
void DaemonSinkGUI::updateTxDelayTime() void RemoteSinkGUI::updateTxDelayTime()
{ {
double txDelayRatio = m_settings.m_txDelay / 100.0; double txDelayRatio = m_settings.m_txDelay / 100.0;
int samplesPerBlock = SDRDaemonNbBytesPerBlock / sizeof(Sample); int samplesPerBlock = SDRDaemonNbBytesPerBlock / sizeof(Sample);
@ -309,7 +310,7 @@ void DaemonSinkGUI::updateTxDelayTime()
ui->txDelayTime->setText(tr("%1µs").arg(QString::number(delay*1e6, 'f', 0))); ui->txDelayTime->setText(tr("%1µs").arg(QString::number(delay*1e6, 'f', 0)));
} }
void DaemonSinkGUI::tick() void RemoteSinkGUI::tick()
{ {
if (++m_tickCount == 20) { // once per second if (++m_tickCount == 20) { // once per second
m_tickCount = 0; m_tickCount = 0;

View File

@ -14,8 +14,8 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // // along with this program. If not, see <http://www.gnu.org/licenses/>. //
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
#ifndef PLUGINS_CHANNELRX_DAEMONSINK_DAEMONSINKGUI_H_ #ifndef PLUGINS_CHANNELRX_REMOTESINK_REMOTESINKGUI_H_
#define PLUGINS_CHANNELRX_DAEMONSINK_DAEMONSINKGUI_H_ #define PLUGINS_CHANNELRX_REMOTESINK_REMOTESINKGUI_H_
#include <stdint.h> #include <stdint.h>
@ -27,21 +27,21 @@
#include "gui/rollupwidget.h" #include "gui/rollupwidget.h"
#include "util/messagequeue.h" #include "util/messagequeue.h"
#include "daemonsinksettings.h" #include "remotesinksettings.h"
class PluginAPI; class PluginAPI;
class DeviceUISet; class DeviceUISet;
class DaemonSink; class RemoteSink;
class BasebandSampleSink; class BasebandSampleSink;
namespace Ui { namespace Ui {
class DaemonSinkGUI; class RemoteSinkGUI;
} }
class DaemonSinkGUI : public RollupWidget, public PluginInstanceGUI { class RemoteSinkGUI : public RollupWidget, public PluginInstanceGUI {
Q_OBJECT Q_OBJECT
public: public:
static DaemonSinkGUI* create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel); static RemoteSinkGUI* create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
virtual void destroy(); virtual void destroy();
void setName(const QString& name); void setName(const QString& name);
@ -56,23 +56,23 @@ public:
virtual bool handleMessage(const Message& message); virtual bool handleMessage(const Message& message);
private: private:
Ui::DaemonSinkGUI* ui; Ui::RemoteSinkGUI* ui;
PluginAPI* m_pluginAPI; PluginAPI* m_pluginAPI;
DeviceUISet* m_deviceUISet; DeviceUISet* m_deviceUISet;
ChannelMarker m_channelMarker; ChannelMarker m_channelMarker;
DaemonSinkSettings m_settings; RemoteSinkSettings m_settings;
int m_sampleRate; int m_sampleRate;
quint64 m_deviceCenterFrequency; //!< Center frequency in device quint64 m_deviceCenterFrequency; //!< Center frequency in device
bool m_doApplySettings; bool m_doApplySettings;
DaemonSink* m_daemonSink; RemoteSink* m_remoteSink;
MessageQueue m_inputMessageQueue; MessageQueue m_inputMessageQueue;
QTime m_time; QTime m_time;
uint32_t m_tickCount; uint32_t m_tickCount;
explicit DaemonSinkGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent = 0); explicit RemoteSinkGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent = 0);
virtual ~DaemonSinkGUI(); virtual ~RemoteSinkGUI();
void blockApplySettings(bool block); void blockApplySettings(bool block);
void applySettings(bool force = false); void applySettings(bool force = false);
@ -96,4 +96,4 @@ private slots:
#endif /* PLUGINS_CHANNELRX_DAEMONSINK_DAEMONSINKGUI_H_ */ #endif /* PLUGINS_CHANNELRX_REMOTESINK_REMOTESINKGUI_H_ */

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>DaemonSinkGUI</class> <class>RemoteSinkGUI</class>
<widget class="RollupWidget" name="DaemonSinkGUI"> <widget class="RollupWidget" name="RemoteSinkGUI">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
@ -35,7 +35,7 @@
</font> </font>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Daemon sink</string> <string>Remote sink</string>
</property> </property>
<widget class="QWidget" name="settingsContainer" native="true"> <widget class="QWidget" name="settingsContainer" native="true">
<property name="geometry"> <property name="geometry">

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2016 Edouard Griffiths, F4EXB // // Copyright (C) 2016-2019 Edouard Griffiths, F4EXB //
// // // //
// This program is free software; you can redistribute it and/or modify // // This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by // // it under the terms of the GNU General Public License as published by //
@ -14,66 +14,66 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // // along with this program. If not, see <http://www.gnu.org/licenses/>. //
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
#include "daemonsinkplugin.h" #include "remotesinkplugin.h"
#include <QtPlugin> #include <QtPlugin>
#include "plugin/pluginapi.h" #include "plugin/pluginapi.h"
#ifndef SERVER_MODE #ifndef SERVER_MODE
#include "daemonsinkgui.h" #include "remotesinkgui.h"
#endif #endif
#include "daemonsink.h" #include "remotesink.h"
const PluginDescriptor DaemonSinkPlugin::m_pluginDescriptor = { const PluginDescriptor RemoteSinkPlugin::m_pluginDescriptor = {
QString("Daemon channel Sink"), QString("Remote channel Sink"),
QString("4.3.2"), QString("4.4.2"),
QString("(c) Edouard Griffiths, F4EXB"), QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"), QString("https://github.com/f4exb/sdrangel"),
true, true,
QString("https://github.com/f4exb/sdrangel") QString("https://github.com/f4exb/sdrangel")
}; };
DaemonSinkPlugin::DaemonSinkPlugin(QObject* parent) : RemoteSinkPlugin::RemoteSinkPlugin(QObject* parent) :
QObject(parent), QObject(parent),
m_pluginAPI(0) m_pluginAPI(0)
{ {
} }
const PluginDescriptor& DaemonSinkPlugin::getPluginDescriptor() const const PluginDescriptor& RemoteSinkPlugin::getPluginDescriptor() const
{ {
return m_pluginDescriptor; return m_pluginDescriptor;
} }
void DaemonSinkPlugin::initPlugin(PluginAPI* pluginAPI) void RemoteSinkPlugin::initPlugin(PluginAPI* pluginAPI)
{ {
m_pluginAPI = pluginAPI; m_pluginAPI = pluginAPI;
// register channel Source // register channel Source
m_pluginAPI->registerRxChannel(DaemonSink::m_channelIdURI, DaemonSink::m_channelId, this); m_pluginAPI->registerRxChannel(RemoteSink::m_channelIdURI, RemoteSink::m_channelId, this);
} }
#ifdef SERVER_MODE #ifdef SERVER_MODE
PluginInstanceGUI* DaemonSinkPlugin::createRxChannelGUI( PluginInstanceGUI* RemoteSinkPlugin::createRxChannelGUI(
DeviceUISet *deviceUISet __attribute__((unused)), DeviceUISet *deviceUISet __attribute__((unused)),
BasebandSampleSink *rxChannel __attribute__((unused))) BasebandSampleSink *rxChannel __attribute__((unused)))
{ {
return 0; return 0;
} }
#else #else
PluginInstanceGUI* DaemonSinkPlugin::createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) PluginInstanceGUI* RemoteSinkPlugin::createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel)
{ {
return DaemonSinkGUI::create(m_pluginAPI, deviceUISet, rxChannel); return RemoteSinkGUI::create(m_pluginAPI, deviceUISet, rxChannel);
} }
#endif #endif
BasebandSampleSink* DaemonSinkPlugin::createRxChannelBS(DeviceSourceAPI *deviceAPI) BasebandSampleSink* RemoteSinkPlugin::createRxChannelBS(DeviceSourceAPI *deviceAPI)
{ {
return new DaemonSink(deviceAPI); return new RemoteSink(deviceAPI);
} }
ChannelSinkAPI* DaemonSinkPlugin::createRxChannelCS(DeviceSourceAPI *deviceAPI) ChannelSinkAPI* RemoteSinkPlugin::createRxChannelCS(DeviceSourceAPI *deviceAPI)
{ {
return new DaemonSink(deviceAPI); return new RemoteSink(deviceAPI);
} }

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2016 Edouard Griffiths, F4EXB // // Copyright (C) 2016-2019 Edouard Griffiths, F4EXB //
// // // //
// This program is free software; you can redistribute it and/or modify // // This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by // // it under the terms of the GNU General Public License as published by //
@ -14,8 +14,8 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // // along with this program. If not, see <http://www.gnu.org/licenses/>. //
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
#ifndef PLUGINS_CHANNELRX_DAEMONSINK_DAEMONSINKPLUGIN_H_ #ifndef PLUGINS_CHANNELRX_REMOTESINK_REMOTESINKPLUGIN_H_
#define PLUGINS_CHANNELRX_DAEMONSINK_DAEMONSINKPLUGIN_H_ #define PLUGINS_CHANNELRX_REMOTESINK_REMOTESINKPLUGIN_H_
#include <QObject> #include <QObject>
@ -24,13 +24,13 @@
class DeviceUISet; class DeviceUISet;
class BasebandSampleSink; class BasebandSampleSink;
class DaemonSinkPlugin : public QObject, PluginInterface { class RemoteSinkPlugin : public QObject, PluginInterface {
Q_OBJECT Q_OBJECT
Q_INTERFACES(PluginInterface) Q_INTERFACES(PluginInterface)
Q_PLUGIN_METADATA(IID "sdrangel.demod.daemonsink") Q_PLUGIN_METADATA(IID "sdrangel.demod.remotesink")
public: public:
explicit DaemonSinkPlugin(QObject* parent = 0); explicit RemoteSinkPlugin(QObject* parent = 0);
const PluginDescriptor& getPluginDescriptor() const; const PluginDescriptor& getPluginDescriptor() const;
void initPlugin(PluginAPI* pluginAPI); void initPlugin(PluginAPI* pluginAPI);
@ -45,4 +45,4 @@ private:
PluginAPI* m_pluginAPI; PluginAPI* m_pluginAPI;
}; };
#endif /* PLUGINS_CHANNELRX_DAEMONSINK_DAEMONSINKPLUGIN_H_ */ #endif /* PLUGINS_CHANNELRX_REMOTESINK_REMOTESINKPLUGIN_H_ */

View File

@ -1,11 +1,11 @@
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2018 Edouard Griffiths, F4EXB. // // Copyright (C) 2018 Edouard Griffiths, F4EXB. //
// // // //
// SDRdaemon sink channel (Rx) main settings // // Remote sink channel (Rx) UDP sender thread //
// // // //
// SDRdaemon is a detached SDR front end that handles the interface with a // // SDRangel can work as a detached SDR front end. With this plugin it can //
// physical device and sends or receives the I/Q samples stream to or from a // // sends the I/Q samples stream to another SDRangel instance via UDP. //
// SDRangel instance via UDP. It is controlled via a Web REST API. // // It is controlled via a Web REST API. //
// // // //
// This program is free software; you can redistribute it and/or modify // // This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by // // it under the terms of the GNU General Public License as published by //
@ -20,25 +20,27 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // // along with this program. If not, see <http://www.gnu.org/licenses/>. //
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
#include "remotesinksettings.h"
#include <QColor> #include <QColor>
#include "util/simpleserializer.h" #include "util/simpleserializer.h"
#include "settings/serializable.h" #include "settings/serializable.h"
#include "daemonsinksettings.h"
DaemonSinkSettings::DaemonSinkSettings()
RemoteSinkSettings::RemoteSinkSettings()
{ {
resetToDefaults(); resetToDefaults();
} }
void DaemonSinkSettings::resetToDefaults() void RemoteSinkSettings::resetToDefaults()
{ {
m_nbFECBlocks = 0; m_nbFECBlocks = 0;
m_txDelay = 35; m_txDelay = 35;
m_dataAddress = "127.0.0.1"; m_dataAddress = "127.0.0.1";
m_dataPort = 9090; m_dataPort = 9090;
m_rgbColor = QColor(140, 4, 4).rgb(); m_rgbColor = QColor(140, 4, 4).rgb();
m_title = "Daemon sink"; m_title = "Remote sink";
m_channelMarker = nullptr; m_channelMarker = nullptr;
m_useReverseAPI = false; m_useReverseAPI = false;
m_reverseAPIAddress = "127.0.0.1"; m_reverseAPIAddress = "127.0.0.1";
@ -47,7 +49,7 @@ void DaemonSinkSettings::resetToDefaults()
m_reverseAPIChannelIndex = 0; m_reverseAPIChannelIndex = 0;
} }
QByteArray DaemonSinkSettings::serialize() const QByteArray RemoteSinkSettings::serialize() const
{ {
SimpleSerializer s(1); SimpleSerializer s(1);
s.writeU32(1, m_nbFECBlocks); s.writeU32(1, m_nbFECBlocks);
@ -65,7 +67,7 @@ QByteArray DaemonSinkSettings::serialize() const
return s.final(); return s.final();
} }
bool DaemonSinkSettings::deserialize(const QByteArray& data) bool RemoteSinkSettings::deserialize(const QByteArray& data)
{ {
SimpleDeserializer d(data); SimpleDeserializer d(data);
@ -99,7 +101,7 @@ bool DaemonSinkSettings::deserialize(const QByteArray& data)
} }
d.readU32(5, &m_rgbColor, QColor(0, 255, 255).rgb()); d.readU32(5, &m_rgbColor, QColor(0, 255, 255).rgb());
d.readString(6, &m_title, "Daemon sink"); d.readString(6, &m_title, "Remote sink");
d.readBool(7, &m_useReverseAPI, false); d.readBool(7, &m_useReverseAPI, false);
d.readString(8, &m_reverseAPIAddress, "127.0.0.1"); d.readString(8, &m_reverseAPIAddress, "127.0.0.1");
d.readU32(9, &tmp, 0); d.readU32(9, &tmp, 0);

View File

@ -1,11 +1,11 @@
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2018 Edouard Griffiths, F4EXB. // // Copyright (C) 2018-2019 Edouard Griffiths, F4EXB. //
// // // //
// SDRdaemon sink channel (Rx) main settings // // Remote sink channel (Rx) UDP sender thread //
// // // //
// SDRdaemon is a detached SDR front end that handles the interface with a // // SDRangel can work as a detached SDR front end. With this plugin it can //
// physical device and sends or receives the I/Q samples stream to or from a // // sends the I/Q samples stream to another SDRangel instance via UDP. //
// SDRangel instance via UDP. It is controlled via a Web REST API. // // It is controlled via a Web REST API. //
// // // //
// This program is free software; you can redistribute it and/or modify // // This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by // // it under the terms of the GNU General Public License as published by //
@ -20,14 +20,15 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // // along with this program. If not, see <http://www.gnu.org/licenses/>. //
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
#ifndef INCLUDE_SDRDAEMONCHANNELSINKSETTINGS_H_ #ifndef INCLUDE_REMOTECHANNELSINKSETTINGS_H_
#define INCLUDE_SDRDAEMONCHANNELSINKSETTINGS_H_ #define INCLUDE_REMOTECHANNELSINKSETTINGS_H_
#include <QByteArray> #include <QByteArray>
#include <QString>
class Serializable; class Serializable;
struct DaemonSinkSettings struct RemoteSinkSettings
{ {
uint16_t m_nbFECBlocks; uint16_t m_nbFECBlocks;
uint32_t m_txDelay; uint32_t m_txDelay;
@ -43,11 +44,11 @@ struct DaemonSinkSettings
Serializable *m_channelMarker; Serializable *m_channelMarker;
DaemonSinkSettings(); RemoteSinkSettings();
void resetToDefaults(); void resetToDefaults();
void setChannelMarker(Serializable *channelMarker) { m_channelMarker = channelMarker; } void setChannelMarker(Serializable *channelMarker) { m_channelMarker = channelMarker; }
QByteArray serialize() const; QByteArray serialize() const;
bool deserialize(const QByteArray& data); bool deserialize(const QByteArray& data);
}; };
#endif /* INCLUDE_SDRDAEMONCHANNELSINKSETTINGS_H_ */ #endif /* INCLUDE_REMOTECHANNELSINKSETTINGS_H_ */

View File

@ -1,11 +1,11 @@
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2018 Edouard Griffiths, F4EXB. // // Copyright (C) 2018-2019 Edouard Griffiths, F4EXB. //
// // // //
// SDRdaemon sink channel (Rx) UDP sender thread // // Remote sink channel (Rx) UDP sender thread //
// // // //
// SDRdaemon is a detached SDR front end that handles the interface with a // // SDRangel can work as a detached SDR front end. With this plugin it can //
// physical device and sends or receives the I/Q samples stream to or from a // // sends the I/Q samples stream to another SDRangel instance via UDP. //
// SDRangel instance via UDP. It is controlled via a Web REST API. // // It is controlled via a Web REST API. //
// // // //
// This program is free software; you can redistribute it and/or modify // // This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by // // it under the terms of the GNU General Public License as published by //
@ -20,16 +20,16 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // // along with this program. If not, see <http://www.gnu.org/licenses/>. //
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
#include "remotesinkthread.h"
#include <QUdpSocket> #include <QUdpSocket>
#include "channel/sdrdaemondatablock.h" #include "channel/sdrdaemondatablock.h"
#include "daemonsinkthread.h"
#include "cm256.h" #include "cm256.h"
MESSAGE_CLASS_DEFINITION(DaemonSinkThread::MsgStartStop, Message) MESSAGE_CLASS_DEFINITION(RemoteSinkThread::MsgStartStop, Message)
DaemonSinkThread::DaemonSinkThread(QObject* parent) : RemoteSinkThread::RemoteSinkThread(QObject* parent) :
QThread(parent), QThread(parent),
m_running(false), m_running(false),
m_address(QHostAddress::LocalHost), m_address(QHostAddress::LocalHost),
@ -40,20 +40,20 @@ DaemonSinkThread::DaemonSinkThread(QObject* parent) :
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection); connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection);
} }
DaemonSinkThread::~DaemonSinkThread() RemoteSinkThread::~RemoteSinkThread()
{ {
qDebug("DaemonSinkThread::~DaemonSinkThread"); qDebug("RemoteSinkThread::~RemoteSinkThread");
} }
void DaemonSinkThread::startStop(bool start) void RemoteSinkThread::startStop(bool start)
{ {
MsgStartStop *msg = MsgStartStop::create(start); MsgStartStop *msg = MsgStartStop::create(start);
m_inputMessageQueue.push(msg); m_inputMessageQueue.push(msg);
} }
void DaemonSinkThread::startWork() void RemoteSinkThread::startWork()
{ {
qDebug("DaemonSinkThread::startWork"); qDebug("RemoteSinkThread::startWork");
m_startWaitMutex.lock(); m_startWaitMutex.lock();
m_socket = new QUdpSocket(this); m_socket = new QUdpSocket(this);
start(); start();
@ -62,18 +62,18 @@ void DaemonSinkThread::startWork()
m_startWaitMutex.unlock(); m_startWaitMutex.unlock();
} }
void DaemonSinkThread::stopWork() void RemoteSinkThread::stopWork()
{ {
qDebug("DaemonSinkThread::stopWork"); qDebug("RemoteSinkThread::stopWork");
delete m_socket; delete m_socket;
m_socket = 0; m_socket = 0;
m_running = false; m_running = false;
wait(); wait();
} }
void DaemonSinkThread::run() void RemoteSinkThread::run()
{ {
qDebug("DaemonSinkThread::run: begin"); qDebug("RemoteSinkThread::run: begin");
m_running = true; m_running = true;
m_startWaiter.wakeAll(); m_startWaiter.wakeAll();
@ -83,16 +83,16 @@ void DaemonSinkThread::run()
} }
m_running = false; m_running = false;
qDebug("DaemonSinkThread::run: end"); qDebug("RemoteSinkThread::run: end");
} }
void DaemonSinkThread::processDataBlock(SDRDaemonDataBlock *dataBlock) void RemoteSinkThread::processDataBlock(SDRDaemonDataBlock *dataBlock)
{ {
handleDataBlock(*dataBlock); handleDataBlock(*dataBlock);
delete dataBlock; delete dataBlock;
} }
void DaemonSinkThread::handleDataBlock(SDRDaemonDataBlock& dataBlock) void RemoteSinkThread::handleDataBlock(SDRDaemonDataBlock& dataBlock)
{ {
CM256::cm256_encoder_params cm256Params; //!< Main interface with CM256 encoder CM256::cm256_encoder_params cm256Params; //!< Main interface with CM256 encoder
CM256::cm256_block descriptorBlocks[256]; //!< Pointers to data for CM256 encoder CM256::cm256_block descriptorBlocks[256]; //!< Pointers to data for CM256 encoder
@ -141,7 +141,7 @@ void DaemonSinkThread::handleDataBlock(SDRDaemonDataBlock& dataBlock)
// Encode FEC blocks // Encode FEC blocks
if (m_cm256p->cm256_encode(cm256Params, descriptorBlocks, fecBlocks)) if (m_cm256p->cm256_encode(cm256Params, descriptorBlocks, fecBlocks))
{ {
qWarning("SDRDaemonChannelSinkThread::handleDataBlock: CM256 encode failed. No transmission."); qWarning("RemoteSinkThread::handleDataBlock: CM256 encode failed. No transmission.");
// TODO: send without FEC changing meta data to set indication of no FEC // TODO: send without FEC changing meta data to set indication of no FEC
} }
@ -166,7 +166,7 @@ void DaemonSinkThread::handleDataBlock(SDRDaemonDataBlock& dataBlock)
dataBlock.m_txControlBlock.m_processed = true; dataBlock.m_txControlBlock.m_processed = true;
} }
void DaemonSinkThread::handleInputMessages() void RemoteSinkThread::handleInputMessages()
{ {
Message* message; Message* message;
@ -175,7 +175,7 @@ void DaemonSinkThread::handleInputMessages()
if (MsgStartStop::match(*message)) if (MsgStartStop::match(*message))
{ {
MsgStartStop* notif = (MsgStartStop*) message; MsgStartStop* notif = (MsgStartStop*) message;
qDebug("DaemonSinkThread::handleInputMessages: MsgStartStop: %s", notif->getStartStop() ? "start" : "stop"); qDebug("RemoteSinkThread::handleInputMessages: MsgStartStop: %s", notif->getStartStop() ? "start" : "stop");
if (notif->getStartStop()) { if (notif->getStartStop()) {
startWork(); startWork();

View File

@ -1,11 +1,11 @@
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2018 Edouard Griffiths, F4EXB. // // Copyright (C) 2018-2019 Edouard Griffiths, F4EXB. //
// // // //
// SDRdaemon sink channel (Rx) UDP sender thread // // Remote sink channel (Rx) UDP sender thread //
// // // //
// SDRdaemon is a detached SDR front end that handles the interface with a // // SDRangel can work as a detached SDR front end. With this plugin it can //
// physical device and sends or receives the I/Q samples stream to or from a // // sends the I/Q samples stream to another SDRangel instance via UDP. //
// SDRangel instance via UDP. It is controlled via a Web REST API. // // It is controlled via a Web REST API. //
// // // //
// This program is free software; you can redistribute it and/or modify // // This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by // // it under the terms of the GNU General Public License as published by //
@ -20,6 +20,9 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // // along with this program. If not, see <http://www.gnu.org/licenses/>. //
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
#ifndef PLUGINS_CHANNELRX_REMOTESINK_REMOTESINKTHREAD_H_
#define PLUGINS_CHANNELRX_REMOTESINK_REMOTESINKTHREAD_H_
#include <QThread> #include <QThread>
#include <QMutex> #include <QMutex>
#include <QWaitCondition> #include <QWaitCondition>
@ -34,7 +37,7 @@ class SDRDaemonDataBlock;
class CM256; class CM256;
class QUdpSocket; class QUdpSocket;
class DaemonSinkThread : public QThread { class RemoteSinkThread : public QThread {
Q_OBJECT Q_OBJECT
public: public:
@ -57,8 +60,8 @@ public:
{ } { }
}; };
DaemonSinkThread(QObject* parent = 0); RemoteSinkThread(QObject* parent = 0);
~DaemonSinkThread(); ~RemoteSinkThread();
void startStop(bool start); void startStop(bool start);
@ -87,3 +90,6 @@ private:
private slots: private slots:
void handleInputMessages(); void handleInputMessages();
}; };
#endif // PLUGINS_CHANNELRX_REMOTESINK_REMOTESINKTHREAD_H_

View File

@ -9,7 +9,7 @@ endif()
find_package(CM256cc) find_package(CM256cc)
if(CM256CC_FOUND) if(CM256CC_FOUND)
add_subdirectory(daemonsink) add_subdirectory(remotesink)
endif(CM256CC_FOUND) endif(CM256CC_FOUND)
add_subdirectory(demodnfm) add_subdirectory(demodnfm)

View File

@ -1,46 +0,0 @@
project(daemonsink)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(PLUGIN_PREFIX "../../../plugins/channelrx/daemonsink")
set(daemonsink_SOURCES
${PLUGIN_PREFIX}/daemonsink.cpp
${PLUGIN_PREFIX}/daemonsinksettings.cpp
${PLUGIN_PREFIX}/daemonsinkthread.cpp
${PLUGIN_PREFIX}/daemonsinkplugin.cpp
)
set(daemonsink_HEADERS
${PLUGIN_PREFIX}/daemonsink.h
${PLUGIN_PREFIX}/daemonsinksettings.h
${PLUGIN_PREFIX}/daemonsinkthread.h
${PLUGIN_PREFIX}/daemonsinkplugin.h
)
include_directories(
.
${CMAKE_CURRENT_BINARY_DIR}
${CM256CC_INCLUDE_DIR}
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
)
#include(${QT_USE_FILE})
add_definitions(${QT_DEFINITIONS})
add_definitions(-DQT_PLUGIN)
add_definitions(-DQT_SHARED)
add_library(daemonsinksrv SHARED
${daemonsink_SOURCES}
${daemonsink_HEADERS_MOC}
)
target_link_libraries(daemonsinksrv
${QT_LIBRARIES}
${CM256CC_LIBRARIES}
sdrbase
swagger
)
target_link_libraries(daemonsinksrv Qt5::Core)
install(TARGETS daemonsinksrv DESTINATION lib/pluginssrv/channelrx)

View File

@ -0,0 +1,46 @@
project(remotesink)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(PLUGIN_PREFIX "../../../plugins/channelrx/remotesink")
set(remotesink_SOURCES
${PLUGIN_PREFIX}/remotesink.cpp
${PLUGIN_PREFIX}/remotesinksettings.cpp
${PLUGIN_PREFIX}/remotesinkthread.cpp
${PLUGIN_PREFIX}/remotesinkplugin.cpp
)
set(remotesink_HEADERS
${PLUGIN_PREFIX}/remotesink.h
${PLUGIN_PREFIX}/remotesinksettings.h
${PLUGIN_PREFIX}/remotesinkthread.h
${PLUGIN_PREFIX}/remotesinkplugin.h
)
include_directories(
.
${CMAKE_CURRENT_BINARY_DIR}
${CM256CC_INCLUDE_DIR}
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
)
#include(${QT_USE_FILE})
add_definitions(${QT_DEFINITIONS})
add_definitions(-DQT_PLUGIN)
add_definitions(-DQT_SHARED)
add_library(remotesinksrv SHARED
${remotesink_SOURCES}
${remotesink_HEADERS_MOC}
)
target_link_libraries(remotesinksrv
${QT_LIBRARIES}
${CM256CC_LIBRARIES}
sdrbase
swagger
)
target_link_libraries(remotesinksrv Qt5::Core)
install(TARGETS remotesinksrv DESTINATION lib/pluginssrv/channelrx)

View File

@ -22,7 +22,7 @@
<file>webapi/doc/swagger/include/Perseus.yaml</file> <file>webapi/doc/swagger/include/Perseus.yaml</file>
<file>webapi/doc/swagger/include/PlutoSdr.yaml</file> <file>webapi/doc/swagger/include/PlutoSdr.yaml</file>
<file>webapi/doc/swagger/include/RtlSdr.yaml</file> <file>webapi/doc/swagger/include/RtlSdr.yaml</file>
<file>webapi/doc/swagger/include/DaemonSink.yaml</file> <file>webapi/doc/swagger/include/RemoteSink.yaml</file>
<file>webapi/doc/swagger/include/DaemonSource.yaml</file> <file>webapi/doc/swagger/include/DaemonSource.yaml</file>
<file>webapi/doc/swagger/include/SDRDaemonSource.yaml</file> <file>webapi/doc/swagger/include/SDRDaemonSource.yaml</file>
<file>webapi/doc/swagger/include/SDRDaemonSink.yaml</file> <file>webapi/doc/swagger/include/SDRDaemonSink.yaml</file>

View File

@ -1813,8 +1813,8 @@ margin-bottom: 20px;
"NFMModSettings" : { "NFMModSettings" : {
"$ref" : "#/definitions/NFMModSettings" "$ref" : "#/definitions/NFMModSettings"
}, },
"DaemonSinkSettings" : { "RemoteSinkSettings" : {
"$ref" : "#/definitions/DaemonSinkSettings" "$ref" : "#/definitions/RemoteSinkSettings"
}, },
"DaemonSourceSettings" : { "DaemonSourceSettings" : {
"$ref" : "#/definitions/DaemonSourceSettings" "$ref" : "#/definitions/DaemonSourceSettings"
@ -2047,49 +2047,6 @@ margin-bottom: 20px;
} }
}, },
"description" : "DV serial device details" "description" : "DV serial device details"
};
defs.DaemonSinkSettings = {
"properties" : {
"nbFECBlocks" : {
"type" : "integer",
"description" : "Number of FEC blocks per frame"
},
"dataAddress" : {
"type" : "string",
"description" : "Receiving USB data address"
},
"dataPort" : {
"type" : "integer",
"description" : "Receiving USB data port"
},
"txDelay" : {
"type" : "integer",
"description" : "Minimum delay in ms between consecutive USB blocks transmissions"
},
"rgbColor" : {
"type" : "integer"
},
"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" : "Daemon channel sink settings"
}; };
defs.DaemonSourceReport = { defs.DaemonSourceReport = {
"properties" : { "properties" : {
@ -3844,6 +3801,49 @@ margin-bottom: 20px;
} }
}, },
"description" : "An arbitrary range of floating point values" "description" : "An arbitrary range of floating point values"
};
defs.RemoteSinkSettings = {
"properties" : {
"nbFECBlocks" : {
"type" : "integer",
"description" : "Number of FEC blocks per frame"
},
"dataAddress" : {
"type" : "string",
"description" : "Receiving USB data address"
},
"dataPort" : {
"type" : "integer",
"description" : "Receiving USB data port"
},
"txDelay" : {
"type" : "integer",
"description" : "Minimum delay in ms between consecutive USB blocks transmissions"
},
"rgbColor" : {
"type" : "integer"
},
"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" : "Remote channel sink settings"
}; };
defs.RtlSdrReport = { defs.RtlSdrReport = {
"properties" : { "properties" : {
@ -24373,7 +24373,7 @@ except ApiException as e:
</div> </div>
<div id="generator"> <div id="generator">
<div class="content"> <div class="content">
Generated 2019-01-14T08:33:10.665+01:00 Generated 2019-01-22T23:24:38.456+01:00
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,5 +1,5 @@
DaemonSinkSettings: RemoteSinkSettings:
description: "Daemon channel sink settings" description: "Remote channel sink settings"
properties: properties:
nbFECBlocks: nbFECBlocks:
description: "Number of FEC blocks per frame" description: "Number of FEC blocks per frame"

View File

@ -1888,8 +1888,8 @@ definitions:
$ref: "/doc/swagger/include/NFMDemod.yaml#/NFMDemodSettings" $ref: "/doc/swagger/include/NFMDemod.yaml#/NFMDemodSettings"
NFMModSettings: NFMModSettings:
$ref: "/doc/swagger/include/NFMMod.yaml#/NFMModSettings" $ref: "/doc/swagger/include/NFMMod.yaml#/NFMModSettings"
DaemonSinkSettings: RemoteSinkSettings:
$ref: "/doc/swagger/include/DaemonSink.yaml#/DaemonSinkSettings" $ref: "/doc/swagger/include/RemoteSink.yaml#/RemoteSinkSettings"
DaemonSourceSettings: DaemonSourceSettings:
$ref: "/doc/swagger/include/DaemonSource.yaml#/DaemonSourceSettings" $ref: "/doc/swagger/include/DaemonSource.yaml#/DaemonSourceSettings"
SSBModSettings: SSBModSettings:

View File

@ -2252,14 +2252,14 @@ bool WebAPIRequestMapper::validateChannelSettings(
return false; return false;
} }
} }
else if (*channelType == "DaemonSink") else if (*channelType == "RemoteSink")
{ {
if (channelSettings.getTx() == 0) if (channelSettings.getTx() == 0)
{ {
QJsonObject daemonChannelSinkSettingsJsonObject = jsonObject["DaemonSinkSettings"].toObject(); QJsonObject remoteChannelSinkSettingsJsonObject = jsonObject["RemoteSinkSettings"].toObject();
channelSettingsKeys = daemonChannelSinkSettingsJsonObject.keys(); channelSettingsKeys = remoteChannelSinkSettingsJsonObject.keys();
channelSettings.setDaemonSinkSettings(new SWGSDRangel::SWGDaemonSinkSettings()); channelSettings.setRemoteSinkSettings(new SWGSDRangel::SWGRemoteSinkSettings());
channelSettings.getDaemonSinkSettings()->fromJsonObject(daemonChannelSinkSettingsJsonObject); channelSettings.getRemoteSinkSettings()->fromJsonObject(remoteChannelSinkSettingsJsonObject);
return true; return true;
} }
else { else {
@ -2518,7 +2518,7 @@ void WebAPIRequestMapper::resetChannelSettings(SWGSDRangel::SWGChannelSettings&
channelSettings.setDsdDemodSettings(0); channelSettings.setDsdDemodSettings(0);
channelSettings.setNfmDemodSettings(0); channelSettings.setNfmDemodSettings(0);
channelSettings.setNfmModSettings(0); channelSettings.setNfmModSettings(0);
channelSettings.setDaemonSinkSettings(0); channelSettings.setRemoteSinkSettings(0);
channelSettings.setDaemonSourceSettings(0); channelSettings.setDaemonSourceSettings(0);
channelSettings.setSsbDemodSettings(0); channelSettings.setSsbDemodSettings(0);
channelSettings.setSsbModSettings(0); channelSettings.setSsbModSettings(0);

View File

@ -1,5 +1,5 @@
DaemonSinkSettings: RemoteSinkSettings:
description: "Daemon channel sink settings" description: "Remote channel sink settings"
properties: properties:
nbFECBlocks: nbFECBlocks:
description: "Number of FEC blocks per frame" description: "Number of FEC blocks per frame"

View File

@ -1888,8 +1888,8 @@ definitions:
$ref: "http://localhost:8081/api/swagger/include/NFMDemod.yaml#/NFMDemodSettings" $ref: "http://localhost:8081/api/swagger/include/NFMDemod.yaml#/NFMDemodSettings"
NFMModSettings: NFMModSettings:
$ref: "http://localhost:8081/api/swagger/include/NFMMod.yaml#/NFMModSettings" $ref: "http://localhost:8081/api/swagger/include/NFMMod.yaml#/NFMModSettings"
DaemonSinkSettings: RemoteSinkSettings:
$ref: "http://localhost:8081/api/swagger/include/DaemonSink.yaml#/DaemonSinkSettings" $ref: "http://localhost:8081/api/swagger/include/RemoteSink.yaml#/RemoteSinkSettings"
DaemonSourceSettings: DaemonSourceSettings:
$ref: "http://localhost:8081/api/swagger/include/DaemonSource.yaml#/DaemonSourceSettings" $ref: "http://localhost:8081/api/swagger/include/DaemonSource.yaml#/DaemonSourceSettings"
SSBModSettings: SSBModSettings:

View File

@ -1813,8 +1813,8 @@ margin-bottom: 20px;
"NFMModSettings" : { "NFMModSettings" : {
"$ref" : "#/definitions/NFMModSettings" "$ref" : "#/definitions/NFMModSettings"
}, },
"DaemonSinkSettings" : { "RemoteSinkSettings" : {
"$ref" : "#/definitions/DaemonSinkSettings" "$ref" : "#/definitions/RemoteSinkSettings"
}, },
"DaemonSourceSettings" : { "DaemonSourceSettings" : {
"$ref" : "#/definitions/DaemonSourceSettings" "$ref" : "#/definitions/DaemonSourceSettings"
@ -2047,49 +2047,6 @@ margin-bottom: 20px;
} }
}, },
"description" : "DV serial device details" "description" : "DV serial device details"
};
defs.DaemonSinkSettings = {
"properties" : {
"nbFECBlocks" : {
"type" : "integer",
"description" : "Number of FEC blocks per frame"
},
"dataAddress" : {
"type" : "string",
"description" : "Receiving USB data address"
},
"dataPort" : {
"type" : "integer",
"description" : "Receiving USB data port"
},
"txDelay" : {
"type" : "integer",
"description" : "Minimum delay in ms between consecutive USB blocks transmissions"
},
"rgbColor" : {
"type" : "integer"
},
"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" : "Daemon channel sink settings"
}; };
defs.DaemonSourceReport = { defs.DaemonSourceReport = {
"properties" : { "properties" : {
@ -3844,6 +3801,49 @@ margin-bottom: 20px;
} }
}, },
"description" : "An arbitrary range of floating point values" "description" : "An arbitrary range of floating point values"
};
defs.RemoteSinkSettings = {
"properties" : {
"nbFECBlocks" : {
"type" : "integer",
"description" : "Number of FEC blocks per frame"
},
"dataAddress" : {
"type" : "string",
"description" : "Receiving USB data address"
},
"dataPort" : {
"type" : "integer",
"description" : "Receiving USB data port"
},
"txDelay" : {
"type" : "integer",
"description" : "Minimum delay in ms between consecutive USB blocks transmissions"
},
"rgbColor" : {
"type" : "integer"
},
"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" : "Remote channel sink settings"
}; };
defs.RtlSdrReport = { defs.RtlSdrReport = {
"properties" : { "properties" : {
@ -24373,7 +24373,7 @@ except ApiException as e:
</div> </div>
<div id="generator"> <div id="generator">
<div class="content"> <div class="content">
Generated 2019-01-14T08:33:10.665+01:00 Generated 2019-01-22T23:24:38.456+01:00
</div> </div>
</div> </div>
</div> </div>

View File

@ -46,8 +46,8 @@ SWGChannelSettings::SWGChannelSettings() {
m_nfm_demod_settings_isSet = false; m_nfm_demod_settings_isSet = false;
nfm_mod_settings = nullptr; nfm_mod_settings = nullptr;
m_nfm_mod_settings_isSet = false; m_nfm_mod_settings_isSet = false;
daemon_sink_settings = nullptr; remote_sink_settings = nullptr;
m_daemon_sink_settings_isSet = false; m_remote_sink_settings_isSet = false;
daemon_source_settings = nullptr; daemon_source_settings = nullptr;
m_daemon_source_settings_isSet = false; m_daemon_source_settings_isSet = false;
ssb_mod_settings = nullptr; ssb_mod_settings = nullptr;
@ -88,8 +88,8 @@ SWGChannelSettings::init() {
m_nfm_demod_settings_isSet = false; m_nfm_demod_settings_isSet = false;
nfm_mod_settings = new SWGNFMModSettings(); nfm_mod_settings = new SWGNFMModSettings();
m_nfm_mod_settings_isSet = false; m_nfm_mod_settings_isSet = false;
daemon_sink_settings = new SWGDaemonSinkSettings(); remote_sink_settings = new SWGRemoteSinkSettings();
m_daemon_sink_settings_isSet = false; m_remote_sink_settings_isSet = false;
daemon_source_settings = new SWGDaemonSourceSettings(); daemon_source_settings = new SWGDaemonSourceSettings();
m_daemon_source_settings_isSet = false; m_daemon_source_settings_isSet = false;
ssb_mod_settings = new SWGSSBModSettings(); ssb_mod_settings = new SWGSSBModSettings();
@ -133,8 +133,8 @@ SWGChannelSettings::cleanup() {
if(nfm_mod_settings != nullptr) { if(nfm_mod_settings != nullptr) {
delete nfm_mod_settings; delete nfm_mod_settings;
} }
if(daemon_sink_settings != nullptr) { if(remote_sink_settings != nullptr) {
delete daemon_sink_settings; delete remote_sink_settings;
} }
if(daemon_source_settings != nullptr) { if(daemon_source_settings != nullptr) {
delete daemon_source_settings; delete daemon_source_settings;
@ -188,7 +188,7 @@ SWGChannelSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&nfm_mod_settings, pJson["NFMModSettings"], "SWGNFMModSettings", "SWGNFMModSettings"); ::SWGSDRangel::setValue(&nfm_mod_settings, pJson["NFMModSettings"], "SWGNFMModSettings", "SWGNFMModSettings");
::SWGSDRangel::setValue(&daemon_sink_settings, pJson["DaemonSinkSettings"], "SWGDaemonSinkSettings", "SWGDaemonSinkSettings"); ::SWGSDRangel::setValue(&remote_sink_settings, pJson["RemoteSinkSettings"], "SWGRemoteSinkSettings", "SWGRemoteSinkSettings");
::SWGSDRangel::setValue(&daemon_source_settings, pJson["DaemonSourceSettings"], "SWGDaemonSourceSettings", "SWGDaemonSourceSettings"); ::SWGSDRangel::setValue(&daemon_source_settings, pJson["DaemonSourceSettings"], "SWGDaemonSourceSettings", "SWGDaemonSourceSettings");
@ -247,8 +247,8 @@ SWGChannelSettings::asJsonObject() {
if((nfm_mod_settings != nullptr) && (nfm_mod_settings->isSet())){ if((nfm_mod_settings != nullptr) && (nfm_mod_settings->isSet())){
toJsonValue(QString("NFMModSettings"), nfm_mod_settings, obj, QString("SWGNFMModSettings")); toJsonValue(QString("NFMModSettings"), nfm_mod_settings, obj, QString("SWGNFMModSettings"));
} }
if((daemon_sink_settings != nullptr) && (daemon_sink_settings->isSet())){ if((remote_sink_settings != nullptr) && (remote_sink_settings->isSet())){
toJsonValue(QString("DaemonSinkSettings"), daemon_sink_settings, obj, QString("SWGDaemonSinkSettings")); toJsonValue(QString("RemoteSinkSettings"), remote_sink_settings, obj, QString("SWGRemoteSinkSettings"));
} }
if((daemon_source_settings != nullptr) && (daemon_source_settings->isSet())){ if((daemon_source_settings != nullptr) && (daemon_source_settings->isSet())){
toJsonValue(QString("DaemonSourceSettings"), daemon_source_settings, obj, QString("SWGDaemonSourceSettings")); toJsonValue(QString("DaemonSourceSettings"), daemon_source_settings, obj, QString("SWGDaemonSourceSettings"));
@ -365,14 +365,14 @@ SWGChannelSettings::setNfmModSettings(SWGNFMModSettings* nfm_mod_settings) {
this->m_nfm_mod_settings_isSet = true; this->m_nfm_mod_settings_isSet = true;
} }
SWGDaemonSinkSettings* SWGRemoteSinkSettings*
SWGChannelSettings::getDaemonSinkSettings() { SWGChannelSettings::getRemoteSinkSettings() {
return daemon_sink_settings; return remote_sink_settings;
} }
void void
SWGChannelSettings::setDaemonSinkSettings(SWGDaemonSinkSettings* daemon_sink_settings) { SWGChannelSettings::setRemoteSinkSettings(SWGRemoteSinkSettings* remote_sink_settings) {
this->daemon_sink_settings = daemon_sink_settings; this->remote_sink_settings = remote_sink_settings;
this->m_daemon_sink_settings_isSet = true; this->m_remote_sink_settings_isSet = true;
} }
SWGDaemonSourceSettings* SWGDaemonSourceSettings*
@ -459,7 +459,7 @@ SWGChannelSettings::isSet(){
if(dsd_demod_settings != nullptr && dsd_demod_settings->isSet()){ isObjectUpdated = true; break;} if(dsd_demod_settings != nullptr && dsd_demod_settings->isSet()){ isObjectUpdated = true; break;}
if(nfm_demod_settings != nullptr && nfm_demod_settings->isSet()){ isObjectUpdated = true; break;} if(nfm_demod_settings != nullptr && nfm_demod_settings->isSet()){ isObjectUpdated = true; break;}
if(nfm_mod_settings != nullptr && nfm_mod_settings->isSet()){ isObjectUpdated = true; break;} if(nfm_mod_settings != nullptr && nfm_mod_settings->isSet()){ isObjectUpdated = true; break;}
if(daemon_sink_settings != nullptr && daemon_sink_settings->isSet()){ isObjectUpdated = true; break;} if(remote_sink_settings != nullptr && remote_sink_settings->isSet()){ isObjectUpdated = true; break;}
if(daemon_source_settings != nullptr && daemon_source_settings->isSet()){ isObjectUpdated = true; break;} if(daemon_source_settings != nullptr && daemon_source_settings->isSet()){ isObjectUpdated = true; break;}
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;}

View File

@ -27,10 +27,10 @@
#include "SWGATVModSettings.h" #include "SWGATVModSettings.h"
#include "SWGBFMDemodSettings.h" #include "SWGBFMDemodSettings.h"
#include "SWGDSDDemodSettings.h" #include "SWGDSDDemodSettings.h"
#include "SWGDaemonSinkSettings.h"
#include "SWGDaemonSourceSettings.h" #include "SWGDaemonSourceSettings.h"
#include "SWGNFMDemodSettings.h" #include "SWGNFMDemodSettings.h"
#include "SWGNFMModSettings.h" #include "SWGNFMModSettings.h"
#include "SWGRemoteSinkSettings.h"
#include "SWGSSBDemodSettings.h" #include "SWGSSBDemodSettings.h"
#include "SWGSSBModSettings.h" #include "SWGSSBModSettings.h"
#include "SWGUDPSinkSettings.h" #include "SWGUDPSinkSettings.h"
@ -84,8 +84,8 @@ public:
SWGNFMModSettings* getNfmModSettings(); SWGNFMModSettings* getNfmModSettings();
void setNfmModSettings(SWGNFMModSettings* nfm_mod_settings); void setNfmModSettings(SWGNFMModSettings* nfm_mod_settings);
SWGDaemonSinkSettings* getDaemonSinkSettings(); SWGRemoteSinkSettings* getRemoteSinkSettings();
void setDaemonSinkSettings(SWGDaemonSinkSettings* daemon_sink_settings); void setRemoteSinkSettings(SWGRemoteSinkSettings* remote_sink_settings);
SWGDaemonSourceSettings* getDaemonSourceSettings(); SWGDaemonSourceSettings* getDaemonSourceSettings();
void setDaemonSourceSettings(SWGDaemonSourceSettings* daemon_source_settings); void setDaemonSourceSettings(SWGDaemonSourceSettings* daemon_source_settings);
@ -139,8 +139,8 @@ private:
SWGNFMModSettings* nfm_mod_settings; SWGNFMModSettings* nfm_mod_settings;
bool m_nfm_mod_settings_isSet; bool m_nfm_mod_settings_isSet;
SWGDaemonSinkSettings* daemon_sink_settings; SWGRemoteSinkSettings* remote_sink_settings;
bool m_daemon_sink_settings_isSet; bool m_remote_sink_settings_isSet;
SWGDaemonSourceSettings* daemon_source_settings; SWGDaemonSourceSettings* daemon_source_settings;
bool m_daemon_source_settings_isSet; bool m_daemon_source_settings_isSet;

View File

@ -49,7 +49,6 @@
#include "SWGDSDDemodSettings.h" #include "SWGDSDDemodSettings.h"
#include "SWGDVSeralDevices.h" #include "SWGDVSeralDevices.h"
#include "SWGDVSerialDevice.h" #include "SWGDVSerialDevice.h"
#include "SWGDaemonSinkSettings.h"
#include "SWGDaemonSourceReport.h" #include "SWGDaemonSourceReport.h"
#include "SWGDaemonSourceSettings.h" #include "SWGDaemonSourceSettings.h"
#include "SWGDeviceListItem.h" #include "SWGDeviceListItem.h"
@ -100,6 +99,7 @@
#include "SWGRDSReport_altFrequencies.h" #include "SWGRDSReport_altFrequencies.h"
#include "SWGRange.h" #include "SWGRange.h"
#include "SWGRangeFloat.h" #include "SWGRangeFloat.h"
#include "SWGRemoteSinkSettings.h"
#include "SWGRtlSdrReport.h" #include "SWGRtlSdrReport.h"
#include "SWGRtlSdrSettings.h" #include "SWGRtlSdrSettings.h"
#include "SWGSDRPlayReport.h" #include "SWGSDRPlayReport.h"
@ -242,9 +242,6 @@ namespace SWGSDRangel {
if(QString("SWGDVSerialDevice").compare(type) == 0) { if(QString("SWGDVSerialDevice").compare(type) == 0) {
return new SWGDVSerialDevice(); return new SWGDVSerialDevice();
} }
if(QString("SWGDaemonSinkSettings").compare(type) == 0) {
return new SWGDaemonSinkSettings();
}
if(QString("SWGDaemonSourceReport").compare(type) == 0) { if(QString("SWGDaemonSourceReport").compare(type) == 0) {
return new SWGDaemonSourceReport(); return new SWGDaemonSourceReport();
} }
@ -395,6 +392,9 @@ namespace SWGSDRangel {
if(QString("SWGRangeFloat").compare(type) == 0) { if(QString("SWGRangeFloat").compare(type) == 0) {
return new SWGRangeFloat(); return new SWGRangeFloat();
} }
if(QString("SWGRemoteSinkSettings").compare(type) == 0) {
return new SWGRemoteSinkSettings();
}
if(QString("SWGRtlSdrReport").compare(type) == 0) { if(QString("SWGRtlSdrReport").compare(type) == 0) {
return new SWGRtlSdrReport(); return new SWGRtlSdrReport();
} }

View File

@ -11,7 +11,7 @@
*/ */
#include "SWGDaemonSinkSettings.h" #include "SWGRemoteSinkSettings.h"
#include "SWGHelpers.h" #include "SWGHelpers.h"
@ -22,12 +22,12 @@
namespace SWGSDRangel { namespace SWGSDRangel {
SWGDaemonSinkSettings::SWGDaemonSinkSettings(QString* json) { SWGRemoteSinkSettings::SWGRemoteSinkSettings(QString* json) {
init(); init();
this->fromJson(*json); this->fromJson(*json);
} }
SWGDaemonSinkSettings::SWGDaemonSinkSettings() { SWGRemoteSinkSettings::SWGRemoteSinkSettings() {
nb_fec_blocks = 0; nb_fec_blocks = 0;
m_nb_fec_blocks_isSet = false; m_nb_fec_blocks_isSet = false;
data_address = nullptr; data_address = nullptr;
@ -52,12 +52,12 @@ SWGDaemonSinkSettings::SWGDaemonSinkSettings() {
m_reverse_api_channel_index_isSet = false; m_reverse_api_channel_index_isSet = false;
} }
SWGDaemonSinkSettings::~SWGDaemonSinkSettings() { SWGRemoteSinkSettings::~SWGRemoteSinkSettings() {
this->cleanup(); this->cleanup();
} }
void void
SWGDaemonSinkSettings::init() { SWGRemoteSinkSettings::init() {
nb_fec_blocks = 0; nb_fec_blocks = 0;
m_nb_fec_blocks_isSet = false; m_nb_fec_blocks_isSet = false;
data_address = new QString(""); data_address = new QString("");
@ -83,7 +83,7 @@ SWGDaemonSinkSettings::init() {
} }
void void
SWGDaemonSinkSettings::cleanup() { SWGRemoteSinkSettings::cleanup() {
if(data_address != nullptr) { if(data_address != nullptr) {
delete data_address; delete data_address;
@ -103,8 +103,8 @@ SWGDaemonSinkSettings::cleanup() {
} }
SWGDaemonSinkSettings* SWGRemoteSinkSettings*
SWGDaemonSinkSettings::fromJson(QString &json) { SWGRemoteSinkSettings::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();
@ -113,7 +113,7 @@ SWGDaemonSinkSettings::fromJson(QString &json) {
} }
void void
SWGDaemonSinkSettings::fromJsonObject(QJsonObject &pJson) { SWGRemoteSinkSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&nb_fec_blocks, pJson["nbFECBlocks"], "qint32", ""); ::SWGSDRangel::setValue(&nb_fec_blocks, pJson["nbFECBlocks"], "qint32", "");
::SWGSDRangel::setValue(&data_address, pJson["dataAddress"], "QString", "QString"); ::SWGSDRangel::setValue(&data_address, pJson["dataAddress"], "QString", "QString");
@ -139,7 +139,7 @@ SWGDaemonSinkSettings::fromJsonObject(QJsonObject &pJson) {
} }
QString QString
SWGDaemonSinkSettings::asJson () SWGRemoteSinkSettings::asJson ()
{ {
QJsonObject* obj = this->asJsonObject(); QJsonObject* obj = this->asJsonObject();
@ -150,7 +150,7 @@ SWGDaemonSinkSettings::asJson ()
} }
QJsonObject* QJsonObject*
SWGDaemonSinkSettings::asJsonObject() { SWGRemoteSinkSettings::asJsonObject() {
QJsonObject* obj = new QJsonObject(); QJsonObject* obj = new QJsonObject();
if(m_nb_fec_blocks_isSet){ if(m_nb_fec_blocks_isSet){
obj->insert("nbFECBlocks", QJsonValue(nb_fec_blocks)); obj->insert("nbFECBlocks", QJsonValue(nb_fec_blocks));
@ -190,118 +190,118 @@ SWGDaemonSinkSettings::asJsonObject() {
} }
qint32 qint32
SWGDaemonSinkSettings::getNbFecBlocks() { SWGRemoteSinkSettings::getNbFecBlocks() {
return nb_fec_blocks; return nb_fec_blocks;
} }
void void
SWGDaemonSinkSettings::setNbFecBlocks(qint32 nb_fec_blocks) { SWGRemoteSinkSettings::setNbFecBlocks(qint32 nb_fec_blocks) {
this->nb_fec_blocks = nb_fec_blocks; this->nb_fec_blocks = nb_fec_blocks;
this->m_nb_fec_blocks_isSet = true; this->m_nb_fec_blocks_isSet = true;
} }
QString* QString*
SWGDaemonSinkSettings::getDataAddress() { SWGRemoteSinkSettings::getDataAddress() {
return data_address; return data_address;
} }
void void
SWGDaemonSinkSettings::setDataAddress(QString* data_address) { SWGRemoteSinkSettings::setDataAddress(QString* data_address) {
this->data_address = data_address; this->data_address = data_address;
this->m_data_address_isSet = true; this->m_data_address_isSet = true;
} }
qint32 qint32
SWGDaemonSinkSettings::getDataPort() { SWGRemoteSinkSettings::getDataPort() {
return data_port; return data_port;
} }
void void
SWGDaemonSinkSettings::setDataPort(qint32 data_port) { SWGRemoteSinkSettings::setDataPort(qint32 data_port) {
this->data_port = data_port; this->data_port = data_port;
this->m_data_port_isSet = true; this->m_data_port_isSet = true;
} }
qint32 qint32
SWGDaemonSinkSettings::getTxDelay() { SWGRemoteSinkSettings::getTxDelay() {
return tx_delay; return tx_delay;
} }
void void
SWGDaemonSinkSettings::setTxDelay(qint32 tx_delay) { SWGRemoteSinkSettings::setTxDelay(qint32 tx_delay) {
this->tx_delay = tx_delay; this->tx_delay = tx_delay;
this->m_tx_delay_isSet = true; this->m_tx_delay_isSet = true;
} }
qint32 qint32
SWGDaemonSinkSettings::getRgbColor() { SWGRemoteSinkSettings::getRgbColor() {
return rgb_color; return rgb_color;
} }
void void
SWGDaemonSinkSettings::setRgbColor(qint32 rgb_color) { SWGRemoteSinkSettings::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*
SWGDaemonSinkSettings::getTitle() { SWGRemoteSinkSettings::getTitle() {
return title; return title;
} }
void void
SWGDaemonSinkSettings::setTitle(QString* title) { SWGRemoteSinkSettings::setTitle(QString* title) {
this->title = title; this->title = title;
this->m_title_isSet = true; this->m_title_isSet = true;
} }
qint32 qint32
SWGDaemonSinkSettings::getUseReverseApi() { SWGRemoteSinkSettings::getUseReverseApi() {
return use_reverse_api; return use_reverse_api;
} }
void void
SWGDaemonSinkSettings::setUseReverseApi(qint32 use_reverse_api) { SWGRemoteSinkSettings::setUseReverseApi(qint32 use_reverse_api) {
this->use_reverse_api = use_reverse_api; this->use_reverse_api = use_reverse_api;
this->m_use_reverse_api_isSet = true; this->m_use_reverse_api_isSet = true;
} }
QString* QString*
SWGDaemonSinkSettings::getReverseApiAddress() { SWGRemoteSinkSettings::getReverseApiAddress() {
return reverse_api_address; return reverse_api_address;
} }
void void
SWGDaemonSinkSettings::setReverseApiAddress(QString* reverse_api_address) { SWGRemoteSinkSettings::setReverseApiAddress(QString* reverse_api_address) {
this->reverse_api_address = reverse_api_address; this->reverse_api_address = reverse_api_address;
this->m_reverse_api_address_isSet = true; this->m_reverse_api_address_isSet = true;
} }
qint32 qint32
SWGDaemonSinkSettings::getReverseApiPort() { SWGRemoteSinkSettings::getReverseApiPort() {
return reverse_api_port; return reverse_api_port;
} }
void void
SWGDaemonSinkSettings::setReverseApiPort(qint32 reverse_api_port) { SWGRemoteSinkSettings::setReverseApiPort(qint32 reverse_api_port) {
this->reverse_api_port = reverse_api_port; this->reverse_api_port = reverse_api_port;
this->m_reverse_api_port_isSet = true; this->m_reverse_api_port_isSet = true;
} }
qint32 qint32
SWGDaemonSinkSettings::getReverseApiDeviceIndex() { SWGRemoteSinkSettings::getReverseApiDeviceIndex() {
return reverse_api_device_index; return reverse_api_device_index;
} }
void void
SWGDaemonSinkSettings::setReverseApiDeviceIndex(qint32 reverse_api_device_index) { SWGRemoteSinkSettings::setReverseApiDeviceIndex(qint32 reverse_api_device_index) {
this->reverse_api_device_index = reverse_api_device_index; this->reverse_api_device_index = reverse_api_device_index;
this->m_reverse_api_device_index_isSet = true; this->m_reverse_api_device_index_isSet = true;
} }
qint32 qint32
SWGDaemonSinkSettings::getReverseApiChannelIndex() { SWGRemoteSinkSettings::getReverseApiChannelIndex() {
return reverse_api_channel_index; return reverse_api_channel_index;
} }
void void
SWGDaemonSinkSettings::setReverseApiChannelIndex(qint32 reverse_api_channel_index) { SWGRemoteSinkSettings::setReverseApiChannelIndex(qint32 reverse_api_channel_index) {
this->reverse_api_channel_index = reverse_api_channel_index; this->reverse_api_channel_index = reverse_api_channel_index;
this->m_reverse_api_channel_index_isSet = true; this->m_reverse_api_channel_index_isSet = true;
} }
bool bool
SWGDaemonSinkSettings::isSet(){ SWGRemoteSinkSettings::isSet(){
bool isObjectUpdated = false; bool isObjectUpdated = false;
do{ do{
if(m_nb_fec_blocks_isSet){ isObjectUpdated = true; break;} if(m_nb_fec_blocks_isSet){ isObjectUpdated = true; break;}

View File

@ -11,13 +11,13 @@
*/ */
/* /*
* SWGDaemonSinkSettings.h * SWGRemoteSinkSettings.h
* *
* Daemon channel sink settings * Remote channel sink settings
*/ */
#ifndef SWGDaemonSinkSettings_H_ #ifndef SWGRemoteSinkSettings_H_
#define SWGDaemonSinkSettings_H_ #define SWGRemoteSinkSettings_H_
#include <QJsonObject> #include <QJsonObject>
@ -29,18 +29,18 @@
namespace SWGSDRangel { namespace SWGSDRangel {
class SWG_API SWGDaemonSinkSettings: public SWGObject { class SWG_API SWGRemoteSinkSettings: public SWGObject {
public: public:
SWGDaemonSinkSettings(); SWGRemoteSinkSettings();
SWGDaemonSinkSettings(QString* json); SWGRemoteSinkSettings(QString* json);
virtual ~SWGDaemonSinkSettings(); virtual ~SWGRemoteSinkSettings();
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 SWGDaemonSinkSettings* fromJson(QString &jsonString) override; virtual SWGRemoteSinkSettings* fromJson(QString &jsonString) override;
qint32 getNbFecBlocks(); qint32 getNbFecBlocks();
void setNbFecBlocks(qint32 nb_fec_blocks); void setNbFecBlocks(qint32 nb_fec_blocks);
@ -116,4 +116,4 @@ private:
} }
#endif /* SWGDaemonSinkSettings_H_ */ #endif /* SWGRemoteSinkSettings_H_ */