1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-17 23:28:50 -05:00

Multi device support: implement input source details in device API

This commit is contained in:
f4exb 2016-05-16 16:37:07 +02:00
parent 500e809cba
commit bb8c3a305f
2 changed files with 49 additions and 1 deletions

View File

@ -15,6 +15,7 @@
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
#include "device/deviceapi.h" #include "device/deviceapi.h"
#include "plugin/plugingui.h"
#include "gui/glspectrum.h" #include "gui/glspectrum.h"
#include "gui/channelwindow.h" #include "gui/channelwindow.h"
#include "mainwindow.h" #include "mainwindow.h"
@ -28,7 +29,9 @@ DeviceAPI::DeviceAPI(MainWindow *mainWindow,
m_deviceTabIndex(deviceTabIndex), m_deviceTabIndex(deviceTabIndex),
m_deviceEngine(deviceEngine), m_deviceEngine(deviceEngine),
m_spectrum(glSpectrum), m_spectrum(glSpectrum),
m_channelWindow(channelWindow) m_channelWindow(channelWindow),
m_sampleSourceSequence(0),
m_sampleSourcePluginGUI(0)
{ {
} }
@ -135,3 +138,36 @@ void DeviceAPI::setInputGUI(QWidget* inputGUI, const QString& sourceDisplayName)
{ {
m_mainWindow->setInputGUI(m_deviceTabIndex, inputGUI, sourceDisplayName); m_mainWindow->setInputGUI(m_deviceTabIndex, inputGUI, sourceDisplayName);
} }
void DeviceAPI::setSampleSourceId(const QString& id)
{
m_sampleSourceId = id;
}
void DeviceAPI::setSampleSourceSerial(const QString& serial)
{
m_sampleSourceSerial = serial;
}
void DeviceAPI::setSampleSourceSequence(int sequence)
{
m_sampleSourceSequence = sequence;
}
void DeviceAPI::setSampleSourcePluginGUI(PluginGUI *gui)
{
m_sampleSourcePluginGUI = gui;
}
void DeviceAPI::freeAll()
{
m_deviceEngine->stopAcquistion();
if(m_sampleSourcePluginGUI != 0)
{
m_deviceEngine->setSource(0);
m_sampleSourcePluginGUI->destroy();
m_sampleSourcePluginGUI = 0;
m_sampleSourceId.clear();
}
}

View File

@ -65,6 +65,13 @@ public:
void addRollupWidget(QWidget *widget); //!< Add rollup widget to channel window void addRollupWidget(QWidget *widget); //!< Add rollup widget to channel window
void setInputGUI(QWidget* inputGUI, const QString& sourceDisplayName); void setInputGUI(QWidget* inputGUI, const QString& sourceDisplayName);
void setSampleSourceId(const QString& id);
void setSampleSourceSerial(const QString& serial);
void setSampleSourceSequence(int sequence);
void setSampleSourcePluginGUI(PluginGUI *gui);
void freeAll();
protected: protected:
DeviceAPI(MainWindow *mainWindow, DeviceAPI(MainWindow *mainWindow,
int deviceTabIndex, int deviceTabIndex,
@ -79,6 +86,11 @@ protected:
GLSpectrum *m_spectrum; GLSpectrum *m_spectrum;
ChannelWindow *m_channelWindow; ChannelWindow *m_channelWindow;
QString m_sampleSourceId;
QString m_sampleSourceSerial;
int m_sampleSourceSequence;
PluginGUI* m_sampleSourcePluginGUI;
friend class MainWindow; friend class MainWindow;
}; };