From a1afc0ebe6fe12144f85ccb7bce0407a2ac5bbc8 Mon Sep 17 00:00:00 2001 From: f4exb Date: Wed, 4 Oct 2017 22:05:38 +0200 Subject: [PATCH] UDP source: refactor constructor --- debian/changelog | 6 ++++++ plugins/channelrx/udpsrc/udpsrc.cpp | 7 +++---- plugins/channelrx/udpsrc/udpsrc.h | 9 +++++---- plugins/channelrx/udpsrc/udpsrcgui.cpp | 3 ++- sdrbase/gui/aboutdialog.ui | 2 +- sdrbase/mainwindow.cpp | 4 ++-- 6 files changed, 19 insertions(+), 12 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1d9b44c88..1a6a6ecb2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +sdrangel (3.7.4-1) unstable; urgency=medium + + * GUI and demod separation step 1 full + + -- Edouard Griffiths, F4EXB Sun, 08 Oct 2017 23:14:18 +0200 + sdrangel (3.7.3-1) unstable; urgency=medium * For Airspy, Funcube Pro and Pro+, PlutoSDR Rx and Tx, RTLSDR: diff --git a/plugins/channelrx/udpsrc/udpsrc.cpp b/plugins/channelrx/udpsrc/udpsrc.cpp index 3954b6582..7d697f14e 100644 --- a/plugins/channelrx/udpsrc/udpsrc.cpp +++ b/plugins/channelrx/udpsrc/udpsrc.cpp @@ -31,11 +31,13 @@ MESSAGE_CLASS_DEFINITION(UDPSrc::MsgUDPSrcConfigure, Message) MESSAGE_CLASS_DEFINITION(UDPSrc::MsgUDPSrcConfigureImmediate, Message) MESSAGE_CLASS_DEFINITION(UDPSrc::MsgUDPSrcSpectrum, Message) -UDPSrc::UDPSrc(MessageQueue* uiMessageQueue, UDPSrcGUI* udpSrcGUI, BasebandSampleSink* spectrum) : +UDPSrc::UDPSrc(DeviceSourceAPI *deviceAPI) : + m_deviceAPI(deviceAPI), m_outMovingAverage(480, 1e-10), m_inMovingAverage(480, 1e-10), m_amMovingAverage(1200, 1e-10), m_audioFifo(24000), + m_spectrum(0), m_squelchOpen(false), m_squelchOpenCount(0), m_squelchCloseCount(0), @@ -57,9 +59,6 @@ UDPSrc::UDPSrc(MessageQueue* uiMessageQueue, UDPSrcGUI* udpSrcGUI, BasebandSampl m_nco.setFreq(0, m_config.m_inputSampleRate); m_interpolator.create(16, m_config.m_inputSampleRate, m_config.m_rfBandwidth / 2.0); m_sampleDistanceRemain = m_config.m_inputSampleRate / m_config.m_outputSampleRate; - m_uiMessageQueue = uiMessageQueue; - m_udpSrcGUI = udpSrcGUI; - m_spectrum = spectrum; m_spectrumEnabled = false; m_nextSSBId = 0; m_nextS16leId = 0; diff --git a/plugins/channelrx/udpsrc/udpsrc.h b/plugins/channelrx/udpsrc/udpsrc.h index 54855a7ae..aec5b9ff8 100644 --- a/plugins/channelrx/udpsrc/udpsrc.h +++ b/plugins/channelrx/udpsrc/udpsrc.h @@ -34,7 +34,7 @@ class QUdpSocket; -class UDPSrcGUI; +class DeviceSourceAPI; class UDPSrc : public BasebandSampleSink { Q_OBJECT @@ -54,8 +54,9 @@ public: FormatNone }; - UDPSrc(MessageQueue* uiMessageQueue, UDPSrcGUI* udpSrcGUI, BasebandSampleSink* spectrum); + UDPSrc(DeviceSourceAPI *deviceAPI); virtual ~UDPSrc(); + void setSpectrum(BasebandSampleSink* spectrum) { m_spectrum = spectrum; } void configure(MessageQueue* messageQueue, SampleFormat sampleFormat, @@ -292,8 +293,8 @@ protected: Config m_config; Config m_running; - MessageQueue* m_uiMessageQueue; - UDPSrcGUI* m_udpSrcGUI; + DeviceSourceAPI *m_deviceAPI; + QUdpSocket *m_audioSocket; double m_magsq; diff --git a/plugins/channelrx/udpsrc/udpsrcgui.cpp b/plugins/channelrx/udpsrc/udpsrcgui.cpp index fe5fe8eab..9d9a53c45 100644 --- a/plugins/channelrx/udpsrc/udpsrcgui.cpp +++ b/plugins/channelrx/udpsrc/udpsrcgui.cpp @@ -271,7 +271,8 @@ UDPSrcGUI::UDPSrcGUI(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI, QWidget* setAttribute(Qt::WA_DeleteOnClose, true); m_spectrumVis = new SpectrumVis(ui->glSpectrum); - m_udpSrc = new UDPSrc(m_pluginAPI->getMainWindowMessageQueue(), this, m_spectrumVis); + m_udpSrc = new UDPSrc(m_deviceAPI); + m_udpSrc->setSpectrum(m_spectrumVis); m_channelizer = new DownChannelizer(m_udpSrc); m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this); m_deviceAPI->addThreadedSink(m_threadedChannelizer); diff --git a/sdrbase/gui/aboutdialog.ui b/sdrbase/gui/aboutdialog.ui index d713dea7f..62c113b22 100644 --- a/sdrbase/gui/aboutdialog.ui +++ b/sdrbase/gui/aboutdialog.ui @@ -84,7 +84,7 @@ - <html><head/><body><p>Version 3.7.3 - Copyright (C) 2015-2017 Edouard Griffiths, F4EXB. </p><p>Code at <a href="https://github.com/f4exb/sdrangel"><span style=" text-decoration: underline; color:#0000ff;">https://github.com/f4exb/sdrangel</span></a></p><p>Many thanks to the original developers:</p><p>The osmocom developer team - especially horizon, Hoernchen &amp; tnt.</p><p>Christian Daniel from maintech GmbH.</p><p>John Greb (hexameron) for the contributions in <a href="https://github.com/hexameron/rtl-sdrangelove"><span style=" text-decoration: underline; color:#0000ff;">RTL-SDRangelove</span></a></p><p>The following rules apply to the SDRangel main application and libsdrbase:<br/>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 the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. You should have received a copy of the GNU General Public License along with this program. If not, see <a href="http://www.gnu.org/licenses/"><span style=" text-decoration: underline; color:#0000ff;">http://www.gnu.org/licenses/</span></a>.</p><p>For the license of installed plugins, look into the plugin list.</p></body></html> + <html><head/><body><p>Version 3.7.4 - Copyright (C) 2015-2017 Edouard Griffiths, F4EXB. </p><p>Code at <a href="https://github.com/f4exb/sdrangel"><span style=" text-decoration: underline; color:#0000ff;">https://github.com/f4exb/sdrangel</span></a></p><p>Many thanks to the original developers:</p><p>The osmocom developer team - especially horizon, Hoernchen &amp; tnt.</p><p>Christian Daniel from maintech GmbH.</p><p>John Greb (hexameron) for the contributions in <a href="https://github.com/hexameron/rtl-sdrangelove"><span style=" text-decoration: underline; color:#0000ff;">RTL-SDRangelove</span></a></p><p>The following rules apply to the SDRangel main application and libsdrbase:<br/>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 the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. You should have received a copy of the GNU General Public License along with this program. If not, see <a href="http://www.gnu.org/licenses/"><span style=" text-decoration: underline; color:#0000ff;">http://www.gnu.org/licenses/</span></a>.</p><p>For the license of installed plugins, look into the plugin list.</p></body></html> true diff --git a/sdrbase/mainwindow.cpp b/sdrbase/mainwindow.cpp index ec2896270..bc02e5c72 100644 --- a/sdrbase/mainwindow.cpp +++ b/sdrbase/mainwindow.cpp @@ -501,9 +501,9 @@ void MainWindow::createStatusBar() { QString qtVersionStr = QString("Qt %1 ").arg(QT_VERSION_STR); #if QT_VERSION >= 0x050400 - m_showSystemWidget = new QLabel("SDRangel v3.7.3 " + qtVersionStr + QSysInfo::prettyProductName(), this); + m_showSystemWidget = new QLabel("SDRangel v3.7.4 " + qtVersionStr + QSysInfo::prettyProductName(), this); #else - m_showSystemWidget = new QLabel("SDRangel v3.7.3 " + qtVersionStr, this); + m_showSystemWidget = new QLabel("SDRangel v3.7.4 " + qtVersionStr, this); #endif statusBar()->addPermanentWidget(m_showSystemWidget);