From 0c38888be15de023485b700713f7e957baf7a6a8 Mon Sep 17 00:00:00 2001 From: f4exb Date: Wed, 20 May 2020 11:26:30 +0200 Subject: [PATCH] Prevent use of not existent devices: removed default MIMO device setting --- sdrgui/mainwindow.cpp | 15 --------------- sdrsrv/maincore.cpp | 15 --------------- 2 files changed, 30 deletions(-) diff --git a/sdrgui/mainwindow.cpp b/sdrgui/mainwindow.cpp index 3a5ad63cf..b35d3aa68 100644 --- a/sdrgui/mainwindow.cpp +++ b/sdrgui/mainwindow.cpp @@ -1871,21 +1871,6 @@ void MainWindow::sampleMIMOChanged() deviceUI->m_deviceAPI->setSamplingDevicePluginInterface( DeviceEnumerator::instance()->getMIMOPluginInterface(deviceUI->m_samplingDeviceControl->getSelectedDeviceIndex())); - if (deviceUI->m_deviceAPI->getSamplingDeviceId().size() == 0) // non existent device => replace by default - { - qDebug("MainWindow::sampleMIMOChanged: non existent device replaced by Test MIMO"); - int testMIMODeviceIndex = DeviceEnumerator::instance()->getTestMIMODeviceIndex(); - const PluginInterface::SamplingDevice *samplingDevice = DeviceEnumerator::instance()->getMIMOSamplingDevice(testMIMODeviceIndex); - deviceUI->m_deviceAPI->setSamplingDeviceSequence(samplingDevice->sequence); - deviceUI->m_deviceAPI->setDeviceNbItems(samplingDevice->deviceNbItems); - deviceUI->m_deviceAPI->setDeviceItemIndex(samplingDevice->deviceItemIndex); - deviceUI->m_deviceAPI->setHardwareId(samplingDevice->hardwareId); - deviceUI->m_deviceAPI->setSamplingDeviceId(samplingDevice->id); - deviceUI->m_deviceAPI->setSamplingDeviceSerial(samplingDevice->serial); - deviceUI->m_deviceAPI->setSamplingDeviceDisplayName(samplingDevice->displayedName); - deviceUI->m_deviceAPI->setSamplingDevicePluginInterface(DeviceEnumerator::instance()->getMIMOPluginInterface(testMIMODeviceIndex)); - } - QString userArgs = m_settings.getDeviceUserArgs().findUserArgs(samplingDevice->hardwareId, samplingDevice->sequence); if (userArgs.size() > 0) { diff --git a/sdrsrv/maincore.cpp b/sdrsrv/maincore.cpp index 7dfe18017..efe4985b9 100644 --- a/sdrsrv/maincore.cpp +++ b/sdrsrv/maincore.cpp @@ -602,21 +602,6 @@ void MainCore::changeSampleMIMO(int deviceSetIndex, int selectedDeviceIndex) deviceSet->m_deviceAPI->setSamplingDeviceDisplayName(samplingDevice->displayedName); deviceSet->m_deviceAPI->setSamplingDevicePluginInterface(DeviceEnumerator::instance()->getMIMOPluginInterface(selectedDeviceIndex)); - if (deviceSet->m_deviceAPI->getSamplingDeviceId().size() == 0) // non existent device => replace by default - { - qDebug("MainCore::changeSampleMIMO: non existent device replaced by Test MIMO"); - int testMIMODeviceIndex = DeviceEnumerator::instance()->getTestMIMODeviceIndex(); - const PluginInterface::SamplingDevice *samplingDevice = DeviceEnumerator::instance()->getMIMOSamplingDevice(testMIMODeviceIndex); - deviceSet->m_deviceAPI->setSamplingDeviceSequence(samplingDevice->sequence); - deviceSet->m_deviceAPI->setDeviceNbItems(samplingDevice->deviceNbItems); - deviceSet->m_deviceAPI->setDeviceItemIndex(samplingDevice->deviceItemIndex); - deviceSet->m_deviceAPI->setHardwareId(samplingDevice->hardwareId); - deviceSet->m_deviceAPI->setSamplingDeviceId(samplingDevice->id); - deviceSet->m_deviceAPI->setSamplingDeviceSerial(samplingDevice->serial); - deviceSet->m_deviceAPI->setSamplingDeviceDisplayName(samplingDevice->displayedName); - deviceSet->m_deviceAPI->setSamplingDevicePluginInterface(DeviceEnumerator::instance()->getMIMOPluginInterface(testMIMODeviceIndex)); - } - QString userArgs = m_settings.getDeviceUserArgs().findUserArgs(samplingDevice->hardwareId, samplingDevice->sequence); if (userArgs.size() > 0) {