summaryrefslogtreecommitdiff
path: root/sdrgui
diff options
context:
space:
mode:
authorf4exb <f4exb06@gmail.com>2017-10-31 21:57:29 +0100
committerf4exb <f4exb06@gmail.com>2017-10-31 21:57:29 +0100
commitc0afeaefa3a18488556c1c73548bfc88a99c55f3 (patch)
treea0f429ad5a9f72aaf969d0dbb30fb7865bd9ef73 /sdrgui
parente30050f01866cfdec46fbbd1ec0ecf85a1b237ed (diff)
More cleanup on DeviceSourceAPI and PluginManager
Diffstat (limited to 'sdrgui')
-rw-r--r--sdrgui/device/devicesourceapi.cpp18
-rw-r--r--sdrgui/device/devicesourceapi.h13
-rw-r--r--sdrgui/mainwindow.cpp3
-rw-r--r--sdrgui/plugin/pluginmanager.cpp21
-rw-r--r--sdrgui/plugin/pluginmanager.h2
5 files changed, 3 insertions, 54 deletions
diff --git a/sdrgui/device/devicesourceapi.cpp b/sdrgui/device/devicesourceapi.cpp
index 513b7d0af..444c8ef97 100644
--- a/sdrgui/device/devicesourceapi.cpp
+++ b/sdrgui/device/devicesourceapi.cpp
@@ -20,20 +20,14 @@
#include "dsp/devicesamplesource.h"
#include "plugin/pluginapi.h"
#include "plugin/plugininterface.h"
-#include "gui/glspectrum.h"
-#include "gui/channelwindow.h"
#include "settings/preset.h"
#include "dsp/dspengine.h"
// TODO: extract GUI dependencies in a separate object
DeviceSourceAPI::DeviceSourceAPI(int deviceTabIndex,
- DSPDeviceSourceEngine *deviceSourceEngine,
- GLSpectrum *glSpectrum,
- ChannelWindow *channelWindow) :
+ DSPDeviceSourceEngine *deviceSourceEngine) :
m_deviceTabIndex(deviceTabIndex),
m_deviceSourceEngine(deviceSourceEngine),
- m_spectrum(glSpectrum),
- m_channelWindow(channelWindow),
m_sampleSourceSequence(0),
m_pluginInterface(0),
m_sampleSourcePluginInstanceUI(0),
@@ -128,16 +122,6 @@ void DeviceSourceAPI::configureCorrections(bool dcOffsetCorrection, bool iqImbal
m_deviceSourceEngine->configureCorrections(dcOffsetCorrection, iqImbalanceCorrection);
}
-void DeviceSourceAPI::addChannelMarker(ChannelMarker* channelMarker)
-{
- m_spectrum->addChannelMarker(channelMarker);
-}
-
-void DeviceSourceAPI::addRollupWidget(QWidget *widget)
-{
- m_channelWindow->addRollupWidget(widget);
-}
-
void DeviceSourceAPI::setHardwareId(const QString& id)
{
m_hardwareId = id;
diff --git a/sdrgui/device/devicesourceapi.h b/sdrgui/device/devicesourceapi.h
index 0946e5d7a..a090637fa 100644
--- a/sdrgui/device/devicesourceapi.h
+++ b/sdrgui/device/devicesourceapi.h
@@ -25,14 +25,11 @@
#include "util/export.h"
-class GLSpectrum;
-class ChannelWindow;
class BasebandSampleSink;
class ThreadedBasebandSampleSink;
class DeviceSampleSource;
class MessageQueue;
class ChannelMarker;
-class QWidget;
class PluginInstanceGUI;
class PluginAPI;
class PluginInterface;
@@ -44,9 +41,7 @@ class SDRANGEL_API DeviceSourceAPI : public QObject {
public:
DeviceSourceAPI(int deviceTabIndex,
- DSPDeviceSourceEngine *deviceSourceEngine,
- GLSpectrum *glSpectrum,
- ChannelWindow *channelWindow);
+ DSPDeviceSourceEngine *deviceSourceEngine);
~DeviceSourceAPI();
// Device engine stuff
@@ -67,10 +62,6 @@ public:
MessageQueue *getSampleSourceGUIMessageQueue();
void configureCorrections(bool dcOffsetCorrection, bool iqImbalanceCorrection); //!< Configure current device engine DSP corrections
- // device related stuff
- void addChannelMarker(ChannelMarker* channelMarker); //!< Add channel marker to spectrum
- void addRollupWidget(QWidget *widget); //!< Add rollup widget to channel window
-
void setHardwareId(const QString& id);
void setSampleSourceId(const QString& id);
void resetSampleSourceId();
@@ -110,8 +101,6 @@ public:
protected:
int m_deviceTabIndex;
DSPDeviceSourceEngine *m_deviceSourceEngine;
- GLSpectrum *m_spectrum;
- ChannelWindow *m_channelWindow;
QString m_hardwareId;
QString m_sampleSourceId;
diff --git a/sdrgui/mainwindow.cpp b/sdrgui/mainwindow.cpp
index 4512723b5..83e3ea0e9 100644
--- a/sdrgui/mainwindow.cpp
+++ b/sdrgui/mainwindow.cpp
@@ -211,7 +211,7 @@ void MainWindow::addSourceDevice()
char tabNameCStr[16];
sprintf(tabNameCStr, "R%d", deviceTabIndex);
- DeviceSourceAPI *deviceSourceAPI = new DeviceSourceAPI(deviceTabIndex, dspDeviceSourceEngine, m_deviceUIs.back()->m_spectrum, m_deviceUIs.back()->m_channelWindow);
+ DeviceSourceAPI *deviceSourceAPI = new DeviceSourceAPI(deviceTabIndex, dspDeviceSourceEngine);
m_deviceUIs.back()->m_deviceSourceAPI = deviceSourceAPI;
m_deviceUIs.back()->m_samplingDeviceControl->setDeviceAPI(deviceSourceAPI);
@@ -1024,7 +1024,6 @@ void MainWindow::on_channel_addClicked(bool checked __attribute__((unused)))
if (deviceUI->m_deviceSourceEngine) // source device => Rx channels
{
- qDebug("MainWindow::on_channel_addClicked: channel name: %s", qPrintable(m_pluginManager->getRxChannelInstanceName(deviceUI->m_samplingDeviceControl->getChannelSelector()->currentIndex())));
m_pluginManager->createRxChannelInstance(deviceUI->m_samplingDeviceControl->getChannelSelector()->currentIndex(), deviceUI);
}
else if (deviceUI->m_deviceSinkEngine) // sink device => Tx channels
diff --git a/sdrgui/plugin/pluginmanager.cpp b/sdrgui/plugin/pluginmanager.cpp
index fa37b408a..6892e4ea1 100644
--- a/sdrgui/plugin/pluginmanager.cpp
+++ b/sdrgui/plugin/pluginmanager.cpp
@@ -618,15 +618,6 @@ void PluginManager::populateTxChannelComboBox(QComboBox *channels)
}
}
-void PluginManager::createRxChannelInstance(int channelPluginIndex, DeviceSourceAPI *deviceAPI)
-{
- if (channelPluginIndex < m_rxChannelRegistrations.size())
- {
- PluginInterface *pluginInterface = m_rxChannelRegistrations[channelPluginIndex].m_plugin;
- pluginInterface->createRxChannel(m_rxChannelRegistrations[channelPluginIndex].m_channelName, deviceAPI);
- }
-}
-
void PluginManager::createRxChannelInstance(int channelPluginIndex, DeviceUISet *deviceUISet)
{
if (channelPluginIndex < m_rxChannelRegistrations.size())
@@ -636,18 +627,6 @@ void PluginManager::createRxChannelInstance(int channelPluginIndex, DeviceUISet
}
}
-QString PluginManager::getRxChannelInstanceName(int channelPluginIndex)
-{
- if (channelPluginIndex < m_rxChannelRegistrations.size())
- {
- return m_rxChannelRegistrations[channelPluginIndex].m_channelName;
- }
- else
- {
- return "";
- }
-}
-
void PluginManager::createTxChannelInstance(int channelPluginIndex, DeviceSinkAPI *deviceAPI)
{
if (channelPluginIndex < m_txChannelRegistrations.size())
diff --git a/sdrgui/plugin/pluginmanager.h b/sdrgui/plugin/pluginmanager.h
index 13425a676..eef75d9f0 100644
--- a/sdrgui/plugin/pluginmanager.h
+++ b/sdrgui/plugin/pluginmanager.h
@@ -71,9 +71,7 @@ public:
PluginInterface* getPluginInterfaceAt(int index);
void populateRxChannelComboBox(QComboBox *channels);
- void createRxChannelInstance(int channelPluginIndex, DeviceSourceAPI *deviceAPI);
void createRxChannelInstance(int channelPluginIndex, DeviceUISet *deviceUISet);
- QString getRxChannelInstanceName(int channelPluginIndex);
void populateTxChannelComboBox(QComboBox *channels);
void createTxChannelInstance(int channelPluginIndex, DeviceSinkAPI *deviceAPI);