Multi device support: add channels and channel markers to the tab associated to the device plugin

This commit is contained in:
f4exb 2016-05-15 11:26:48 +02:00
parent 8d480c899d
commit a26174eb8b
5 changed files with 33 additions and 26 deletions

View File

@ -244,11 +244,15 @@ void MainWindow::removeLastDevice()
m_deviceUIs.pop_back();
}
void MainWindow::addChannelRollup(QWidget* widget)
void MainWindow::addChannelRollup(int deviceTabIndex, QWidget* widget)
{
m_deviceUIs.back()->m_channelWindow->addRollupWidget(widget);
ui->channelDock->show();
ui->channelDock->raise();
if (deviceTabIndex < ui->tabInputsView->count())
{
DeviceUISet *deviceUI = m_deviceUIs[deviceTabIndex];
deviceUI->m_channelWindow->addRollupWidget(widget);
ui->channelDock->show();
ui->channelDock->raise();
}
}
void MainWindow::addViewAction(QAction* action)
@ -256,16 +260,6 @@ void MainWindow::addViewAction(QAction* action)
ui->menu_Window->addAction(action);
}
void MainWindow::addChannelMarker(ChannelMarker* channelMarker)
{
m_deviceUIs.back()->m_spectrum->addChannelMarker(channelMarker);
}
void MainWindow::removeChannelMarker(ChannelMarker* channelMarker)
{
m_deviceUIs.back()->m_spectrum->removeChannelMarker(channelMarker);
}
void MainWindow::setInputGUI(int deviceTabIndex, QWidget* gui, const QString& sourceDisplayName)
{
char tabNameCStr[16];

View File

@ -71,13 +71,11 @@ public:
MessageQueue* getInputMessageQueue() { return &m_inputMessageQueue; }
void addChannelRollup(QWidget* widget);
void addViewAction(QAction* action);
void addChannelMarker(ChannelMarker* channelMarker); // TODO: review this
void removeChannelMarker(ChannelMarker* channelMarker); // TODO: review this
void addChannelRollup(int deviceTabIndex, QWidget* widget);
void setInputGUI(int deviceTabIndex, QWidget* gui, const QString& sourceDisplayName);
const QTimer& getMasterTimer() const { return m_masterTimer; }
private:

View File

@ -46,12 +46,12 @@ void PluginAPI::removeChannelInstance(PluginGUI* pluginGUI)
void PluginAPI::addChannelMarker(ChannelMarker* channelMarker)
{
m_mainWindow->addChannelMarker(channelMarker); // TODO: suspect verify. No ref to main window expected.
m_pluginManager->addChannelMarker(channelMarker);
}
void PluginAPI::removeChannelMarker(ChannelMarker* channelMarker)
{
m_mainWindow->removeChannelMarker(channelMarker); // TODO: suspect verify. No ref to main window expected.
m_pluginManager->removeChannelMarker(channelMarker);
}
void PluginAPI::registerSampleSource(const QString& sourceName, PluginInterface* plugin)

View File

@ -9,6 +9,7 @@
#include "mainwindow.h"
#include "dsp/dspdeviceengine.h"
#include "dsp/samplesource.h"
#include "gui/glspectrum.h"
#include <QDebug>
@ -64,11 +65,6 @@ void PluginManager::registerChannelInstance(const QString& channelName, PluginGU
renameChannelInstances();
}
void PluginManager::addChannelRollup(QWidget* pluginGUI)
{
m_mainWindow->addChannelRollup(pluginGUI);
}
void PluginManager::removeChannelInstance(PluginGUI* pluginGUI)
{
for(ChannelInstanceRegistrations::iterator it = m_channelInstanceRegistrations.begin(); it != m_channelInstanceRegistrations.end(); ++it) {
@ -89,6 +85,21 @@ void PluginManager::registerSampleSource(const QString& sourceName, PluginInterf
m_sampleSourceRegistrations.append(SampleSourceRegistration(sourceName, plugin));
}
void PluginManager::addChannelRollup(QWidget* widget)
{
m_mainWindow->addChannelRollup(m_deviceTabIndex, widget);
}
void PluginManager::addChannelMarker(ChannelMarker* channelMarker)
{
m_spectrum->addChannelMarker(channelMarker);
}
void PluginManager::removeChannelMarker(ChannelMarker* channelMarker)
{
m_spectrum->removeChannelMarker(channelMarker);
}
void PluginManager::setInputGUI(QWidget* gui, const QString& sourceDisplayName)
{
//m_mainWindow->setInputGUI(gui);

View File

@ -19,6 +19,7 @@ class DSPDeviceEngine;
class GLSpectrum;
class SampleSink;
class ThreadedSampleSink;
class ChannelMarker;
class SDRANGEL_API PluginManager : public QObject {
Q_OBJECT
@ -48,10 +49,13 @@ public:
// Callbacks from the plugins
void registerChannel(const QString& channelName, PluginInterface* plugin);
void registerChannelInstance(const QString& channelName, PluginGUI* pluginGUI);
void addChannelRollup(QWidget* pluginGUI);
void removeChannelInstance(PluginGUI* pluginGUI);
void registerSampleSource(const QString& sourceName, PluginInterface* plugin);
void addChannelRollup(QWidget* widget);
void addChannelMarker(ChannelMarker* channelMarker);
void removeChannelMarker(ChannelMarker* channelMarker);
void setInputGUI(QWidget* gui, const QString& sourceDisplayName);
void addSink(SampleSink* sink);