mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-07-26 12:04:13 -04:00
Multi device support: Main window: created a method to add a new device and associated objects
This commit is contained in:
+42
-18
@@ -102,25 +102,25 @@ MainWindow::MainWindow(QWidget* parent) :
|
||||
|
||||
qDebug() << "MainWindow::MainWindow: m_pluginManager->loadPlugins ...";
|
||||
|
||||
// TODO: This will go in a create new device and device tab method:
|
||||
addDevice(); // add the first device
|
||||
|
||||
DSPDeviceEngine *dspDeviceEngine = m_dspEngine->getDeviceEngineByIndex(0);
|
||||
dspDeviceEngine->start();
|
||||
|
||||
m_deviceUIs.push_back(new DeviceUISet(m_masterTimer));
|
||||
|
||||
m_pluginManager = new PluginManager(this, dspDeviceEngine, m_deviceUIs.back()->m_spectrum);
|
||||
m_pluginManager->loadPlugins();
|
||||
|
||||
ui->tabSpectra->addTab(m_deviceUIs.back()->m_spectrum, "X0");
|
||||
ui->tabSpectraGUI->addTab(m_deviceUIs.back()->m_spectrumGUI, "X0");
|
||||
dspDeviceEngine->addSink(m_deviceUIs.back()->m_spectrumVis);
|
||||
ui->tabChannels->addTab(m_deviceUIs.back()->m_channelWindow, "X0");
|
||||
bool sampleSourceSignalsBlocked = m_deviceUIs.back()->m_sampleSource->blockSignals(true);
|
||||
m_pluginManager->fillSampleSourceSelector(m_deviceUIs.back()->m_sampleSource);
|
||||
connect(m_deviceUIs.back()->m_sampleSource, SIGNAL(currentIndexChanged(int)), this, SLOT(on_sampleSource_currentIndexChanged(int)));
|
||||
m_deviceUIs.back()->m_sampleSource->blockSignals(sampleSourceSignalsBlocked);
|
||||
ui->tabInputs->addTab(m_deviceUIs.back()->m_sampleSource, "X0");
|
||||
// DSPDeviceEngine *dspDeviceEngine = m_dspEngine->addDeviceEngine();
|
||||
// dspDeviceEngine->start();
|
||||
//
|
||||
// m_deviceUIs.push_back(new DeviceUISet(m_masterTimer));
|
||||
//
|
||||
// m_pluginManager = new PluginManager(this, dspDeviceEngine, m_deviceUIs.back()->m_spectrum);
|
||||
// m_pluginManager->loadPlugins();
|
||||
//
|
||||
// ui->tabSpectra->addTab(m_deviceUIs.back()->m_spectrum, "X0");
|
||||
// ui->tabSpectraGUI->addTab(m_deviceUIs.back()->m_spectrumGUI, "X0");
|
||||
// dspDeviceEngine->addSink(m_deviceUIs.back()->m_spectrumVis);
|
||||
// ui->tabChannels->addTab(m_deviceUIs.back()->m_channelWindow, "X0");
|
||||
// bool sampleSourceSignalsBlocked = m_deviceUIs.back()->m_sampleSource->blockSignals(true);
|
||||
// m_pluginManager->fillSampleSourceSelector(m_deviceUIs.back()->m_sampleSource);
|
||||
// connect(m_deviceUIs.back()->m_sampleSource, SIGNAL(currentIndexChanged(int)), this, SLOT(on_sampleSource_currentIndexChanged(int)));
|
||||
// m_deviceUIs.back()->m_sampleSource->blockSignals(sampleSourceSignalsBlocked);
|
||||
// ui->tabInputs->addTab(m_deviceUIs.back()->m_sampleSource, "X0");
|
||||
|
||||
qDebug() << "MainWindow::MainWindow: loadSettings...";
|
||||
|
||||
@@ -180,6 +180,30 @@ MainWindow::~MainWindow()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void MainWindow::addDevice()
|
||||
{
|
||||
DSPDeviceEngine *dspDeviceEngine = m_dspEngine->addDeviceEngine();
|
||||
dspDeviceEngine->start();
|
||||
|
||||
char tabNameCStr[16];
|
||||
sprintf(tabNameCStr, "R%d", dspDeviceEngine->getUID());
|
||||
|
||||
m_deviceUIs.push_back(new DeviceUISet(m_masterTimer));
|
||||
|
||||
m_pluginManager = new PluginManager(this, dspDeviceEngine, m_deviceUIs.back()->m_spectrum);
|
||||
m_pluginManager->loadPlugins();
|
||||
|
||||
ui->tabSpectra->addTab(m_deviceUIs.back()->m_spectrum, tabNameCStr);
|
||||
ui->tabSpectraGUI->addTab(m_deviceUIs.back()->m_spectrumGUI, tabNameCStr);
|
||||
dspDeviceEngine->addSink(m_deviceUIs.back()->m_spectrumVis);
|
||||
ui->tabChannels->addTab(m_deviceUIs.back()->m_channelWindow, tabNameCStr);
|
||||
bool sampleSourceSignalsBlocked = m_deviceUIs.back()->m_sampleSource->blockSignals(true);
|
||||
m_pluginManager->fillSampleSourceSelector(m_deviceUIs.back()->m_sampleSource);
|
||||
connect(m_deviceUIs.back()->m_sampleSource, SIGNAL(currentIndexChanged(int)), this, SLOT(on_sampleSource_currentIndexChanged(int)));
|
||||
m_deviceUIs.back()->m_sampleSource->blockSignals(sampleSourceSignalsBlocked);
|
||||
ui->tabInputs->addTab(m_deviceUIs.back()->m_sampleSource, tabNameCStr);
|
||||
}
|
||||
|
||||
void MainWindow::addChannelCreateAction(QAction* action)
|
||||
{
|
||||
ui->menu_Channels->addAction(action);
|
||||
|
||||
Reference in New Issue
Block a user