mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-09-27 15:26:33 -04:00
Added reload devices option
This commit is contained in:
parent
5c4078d672
commit
fb562f197c
@ -22,7 +22,6 @@
|
|||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
#include <QMessageBox>
|
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <QSysInfo>
|
#include <QSysInfo>
|
||||||
|
|
||||||
@ -278,7 +277,7 @@ void MainWindow::removeLastDevice()
|
|||||||
|
|
||||||
ui->tabInputsSelect->removeTab(ui->tabInputsSelect->count() - 1);
|
ui->tabInputsSelect->removeTab(ui->tabInputsSelect->count() - 1);
|
||||||
|
|
||||||
m_deviceWidgetTabs.removeLast();
|
m_deviceWidgetTabs.removeLast();m_pluginManager->loadPlugins();
|
||||||
ui->tabInputsView->clear();
|
ui->tabInputsView->clear();
|
||||||
|
|
||||||
for (int i = 0; i < m_deviceWidgetTabs.size(); i++)
|
for (int i = 0; i < m_deviceWidgetTabs.size(); i++)
|
||||||
@ -930,6 +929,61 @@ void MainWindow::on_action_removeLastDevice_triggered()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::on_action_reloadDevices_triggered()
|
||||||
|
{
|
||||||
|
// all devices must be stopped
|
||||||
|
std::vector<DeviceUISet*>::iterator it = m_deviceUIs.begin();
|
||||||
|
for (; it != m_deviceUIs.end(); ++it)
|
||||||
|
{
|
||||||
|
if ((*it)->m_deviceSourceEngine) // it is a source device
|
||||||
|
{
|
||||||
|
if ((*it)->m_deviceSourceEngine->state() == DSPDeviceSourceEngine::StRunning)
|
||||||
|
{
|
||||||
|
QMessageBox::information(this, tr("Message"), tr("Stop all devices for reload to take effect"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((*it)->m_deviceSinkEngine) // it is a sink device
|
||||||
|
{
|
||||||
|
if ((*it)->m_deviceSinkEngine->state() == DSPDeviceSinkEngine::StRunning)
|
||||||
|
{
|
||||||
|
QMessageBox::information(this, tr("Message"), tr("Stop all devices for reload to take effect"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// re-scan devices
|
||||||
|
m_pluginManager->updateSampleSourceDevices();
|
||||||
|
m_pluginManager->updateSampleSinkDevices();
|
||||||
|
|
||||||
|
// re-populate device selectors keeping the same selection
|
||||||
|
it = m_deviceUIs.begin();
|
||||||
|
for (; it != m_deviceUIs.end(); ++it)
|
||||||
|
{
|
||||||
|
if ((*it)->m_deviceSourceEngine) // it is a source device
|
||||||
|
{
|
||||||
|
QComboBox *deviceSelectorComboBox = (*it)->m_samplingDeviceControl->getDeviceSelector();
|
||||||
|
bool sampleSourceSignalsBlocked = deviceSelectorComboBox->blockSignals(true);
|
||||||
|
m_pluginManager->fillSampleSourceSelector(deviceSelectorComboBox, (*it)->m_deviceSourceEngine->getUID());
|
||||||
|
int newIndex = m_pluginManager->getSampleSourceSelectorIndex(deviceSelectorComboBox, (*it)->m_deviceSourceAPI);
|
||||||
|
deviceSelectorComboBox->setCurrentIndex(newIndex);
|
||||||
|
deviceSelectorComboBox->blockSignals(sampleSourceSignalsBlocked);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((*it)->m_deviceSinkEngine) // it is a sink device
|
||||||
|
{
|
||||||
|
QComboBox *deviceSelectorComboBox = (*it)->m_samplingDeviceControl->getDeviceSelector();
|
||||||
|
bool sampleSinkSignalsBlocked = deviceSelectorComboBox->blockSignals(true);
|
||||||
|
m_pluginManager->fillSampleSinkSelector(deviceSelectorComboBox, (*it)->m_deviceSinkEngine->getUID());
|
||||||
|
int newIndex = m_pluginManager->getSampleSourceSelectorIndex(deviceSelectorComboBox, (*it)->m_deviceSourceAPI);
|
||||||
|
deviceSelectorComboBox->setCurrentIndex(newIndex);
|
||||||
|
deviceSelectorComboBox->blockSignals(sampleSinkSignalsBlocked);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::on_action_Exit_triggered()
|
void MainWindow::on_action_Exit_triggered()
|
||||||
{
|
{
|
||||||
savePresetSettings(m_settings.getWorkingPreset(), 0);
|
savePresetSettings(m_settings.getWorkingPreset(), 0);
|
||||||
|
@ -162,6 +162,7 @@ private slots:
|
|||||||
void on_action_addSourceDevice_triggered();
|
void on_action_addSourceDevice_triggered();
|
||||||
void on_action_addSinkDevice_triggered();
|
void on_action_addSinkDevice_triggered();
|
||||||
void on_action_removeLastDevice_triggered();
|
void on_action_removeLastDevice_triggered();
|
||||||
|
void on_action_reloadDevices_triggered();
|
||||||
void on_action_Exit_triggered();
|
void on_action_Exit_triggered();
|
||||||
void tabInputViewIndexChanged();
|
void tabInputViewIndexChanged();
|
||||||
};
|
};
|
||||||
|
@ -33,7 +33,16 @@
|
|||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@ -94,6 +103,7 @@
|
|||||||
<addaction name="action_addSourceDevice"/>
|
<addaction name="action_addSourceDevice"/>
|
||||||
<addaction name="action_addSinkDevice"/>
|
<addaction name="action_addSinkDevice"/>
|
||||||
<addaction name="action_removeLastDevice"/>
|
<addaction name="action_removeLastDevice"/>
|
||||||
|
<addaction name="action_reloadDevices"/>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenu" name="menu_View">
|
<widget class="QMenu" name="menu_View">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
@ -164,7 +174,16 @@
|
|||||||
</attribute>
|
</attribute>
|
||||||
<widget class="QWidget" name="dockWidgetContents">
|
<widget class="QWidget" name="dockWidgetContents">
|
||||||
<layout class="QGridLayout" name="gridLayout_6">
|
<layout class="QGridLayout" name="gridLayout_6">
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
@ -392,7 +411,16 @@
|
|||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>3</number>
|
<number>3</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@ -423,7 +451,16 @@
|
|||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>3</number>
|
<number>3</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@ -460,7 +497,16 @@
|
|||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>3</number>
|
<number>3</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@ -488,7 +534,16 @@
|
|||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>3</number>
|
<number>3</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@ -625,6 +680,11 @@
|
|||||||
<string>Add sink device</string>
|
<string>Add sink device</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="action_reloadDevices">
|
||||||
|
<property name="text">
|
||||||
|
<string>Reload devices</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
<zorder>presetDock</zorder>
|
<zorder>presetDock</zorder>
|
||||||
<zorder>channelDock</zorder>
|
<zorder>channelDock</zorder>
|
||||||
</widget>
|
</widget>
|
||||||
|
@ -295,6 +295,23 @@ void PluginManager::fillSampleSourceSelector(QComboBox* comboBox, uint deviceUID
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int PluginManager::getSampleSourceSelectorIndex(QComboBox* comboBox, DeviceSourceAPI *deviceSourceAPI)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < comboBox->count(); i++)
|
||||||
|
{
|
||||||
|
SamplingDevice *samplingDevice = (SamplingDevice*) (comboBox->itemData(i)).value<void *>();
|
||||||
|
|
||||||
|
if ((samplingDevice->m_deviceId == deviceSourceAPI->getSampleSourceId()) &&
|
||||||
|
(samplingDevice->m_deviceSerial == deviceSourceAPI->getSampleSourceSerial()) &&
|
||||||
|
(samplingDevice->m_deviceSequence == deviceSourceAPI->getSampleSourceSequence()))
|
||||||
|
{
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0; // default to first item
|
||||||
|
}
|
||||||
|
|
||||||
void PluginManager::fillSampleSinkSelector(QComboBox* comboBox, uint deviceUID)
|
void PluginManager::fillSampleSinkSelector(QComboBox* comboBox, uint deviceUID)
|
||||||
{
|
{
|
||||||
comboBox->clear();
|
comboBox->clear();
|
||||||
@ -313,6 +330,23 @@ void PluginManager::fillSampleSinkSelector(QComboBox* comboBox, uint deviceUID)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int PluginManager::getSampleSinkSelectorIndex(QComboBox* comboBox, DeviceSinkAPI *deviceSinkAPI)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < comboBox->count(); i++)
|
||||||
|
{
|
||||||
|
SamplingDevice *samplingDevice = (SamplingDevice*) (comboBox->itemData(i)).value<void *>();
|
||||||
|
|
||||||
|
if ((samplingDevice->m_deviceId == deviceSinkAPI->getSampleSinkId()) &&
|
||||||
|
(samplingDevice->m_deviceSerial == deviceSinkAPI->getSampleSinkSerial()) &&
|
||||||
|
(samplingDevice->m_deviceSequence == deviceSinkAPI->getSampleSinkSequence()))
|
||||||
|
{
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0; // default to first item
|
||||||
|
}
|
||||||
|
|
||||||
int PluginManager::selectSampleSourceByIndex(int index, DeviceSourceAPI *deviceAPI)
|
int PluginManager::selectSampleSourceByIndex(int index, DeviceSourceAPI *deviceAPI)
|
||||||
{
|
{
|
||||||
qDebug("PluginManager::selectSampleSourceByIndex: index: %d", index);
|
qDebug("PluginManager::selectSampleSourceByIndex: index: %d", index);
|
||||||
|
@ -53,10 +53,12 @@ public:
|
|||||||
void updateSampleSourceDevices();
|
void updateSampleSourceDevices();
|
||||||
void duplicateLocalSampleSourceDevices(uint deviceUID);
|
void duplicateLocalSampleSourceDevices(uint deviceUID);
|
||||||
void fillSampleSourceSelector(QComboBox* comboBox, uint deviceUID);
|
void fillSampleSourceSelector(QComboBox* comboBox, uint deviceUID);
|
||||||
|
int getSampleSourceSelectorIndex(QComboBox* comboBox, DeviceSourceAPI *deviceSourceAPI);
|
||||||
|
|
||||||
void updateSampleSinkDevices();
|
void updateSampleSinkDevices();
|
||||||
void duplicateLocalSampleSinkDevices(uint deviceUID);
|
void duplicateLocalSampleSinkDevices(uint deviceUID);
|
||||||
void fillSampleSinkSelector(QComboBox* comboBox, uint deviceUID);
|
void fillSampleSinkSelector(QComboBox* comboBox, uint deviceUID);
|
||||||
|
int getSampleSinkSelectorIndex(QComboBox* comboBox, DeviceSinkAPI *deviceSinkAPI);
|
||||||
|
|
||||||
int selectSampleSourceByIndex(int index, DeviceSourceAPI *deviceAPI);
|
int selectSampleSourceByIndex(int index, DeviceSourceAPI *deviceAPI);
|
||||||
int selectFirstSampleSource(const QString& sourceId, DeviceSourceAPI *deviceAPI);
|
int selectFirstSampleSource(const QString& sourceId, DeviceSourceAPI *deviceAPI);
|
||||||
|
@ -29,26 +29,27 @@ In each slave tab group (2), (3), (4) and (5) an individual tab corresponding to
|
|||||||
The following items are presented hierarchically from left to right:
|
The following items are presented hierarchically from left to right:
|
||||||
|
|
||||||
- File:
|
- File:
|
||||||
- Exit (shortcut Ctl-Q): Exit the program
|
- _Exit_ (shortcut Ctl-Q): Exit the program
|
||||||
- View:
|
- View:
|
||||||
- Fullscreen (Shortcut F11): Toggle full screen mode
|
- _Fullscreen_ (Shortcut F11): Toggle full screen mode
|
||||||
- Devices:
|
- Devices:
|
||||||
- Add source device: adds a new source (receiver) device slot to the device stack (last position)
|
- _Add source device_: adds a new source (receiver) device slot to the device stack (last position)
|
||||||
- Add sink device: adds a new sink (transmitter) device slot to the device stack (last position)
|
- _Add sink device_: adds a new sink (transmitter) device slot to the device stack (last position)
|
||||||
- Remove device: removes the last device slot from thte device stack
|
- _Remove device_: removes the last device slot from thte device stack
|
||||||
|
- _Reload devices_: re-scan the system for devices. Devices selectors are updated with new devices and missing devices are removed. All devices must be stopped for this to take effect.
|
||||||
- Window: presents the list of dockable windows. Check to make it visible. Uncheck to hide. These windows are:
|
- Window: presents the list of dockable windows. Check to make it visible. Uncheck to hide. These windows are:
|
||||||
- Sampling devices control: control of which sampling devices is used and add channels
|
- _Sampling devices control_: control of which sampling devices is used and add channels
|
||||||
- Sampling devices: the sampling devices UIs
|
- _Sampling devices_: the sampling devices UIs
|
||||||
- Spectrum display: the main spectrum displays (output from the sampling devices)
|
- _Spectrum display_: the main spectrum displays (output from the sampling devices)
|
||||||
- Presets: the saved presets
|
- _Presets_: the saved presets
|
||||||
- Channels: the channels active for each device
|
- _Channels_: the channels active for each device
|
||||||
- Preferences:
|
- Preferences:
|
||||||
- Audio: opens a dialog to choose the audio output device (see 1.1 below for details)
|
- _Audio_: opens a dialog to choose the audio output device (see 1.1 below for details)
|
||||||
- DV Serial: if you have one or more AMBE3000 serial devices for AMBE digital voice check to connect them. If unchecked DV decoding will resort to mbelib if available else no audio will be produced for AMBE digital voice
|
- _DV Serial_: if you have one or more AMBE3000 serial devices for AMBE digital voice check to connect them. If unchecked DV decoding will resort to mbelib if available else no audio will be produced for AMBE digital voice
|
||||||
- My Position: opens a dialog to enter your station ("My Position") coordinates in decimal degrees with north latitudes positive and east longitudes positive. This is used whenever positional data is to be displayed (APRS, DPRS, ...). For it now only works with D-Star $$CRC frames. See [DSD demod plugin](../plugins/channel/demoddsd/readme.md) for details on how to decode Digital Voice modes.
|
- _My Position_: opens a dialog to enter your station ("My Position") coordinates in decimal degrees with north latitudes positive and east longitudes positive. This is used whenever positional data is to be displayed (APRS, DPRS, ...). For it now only works with D-Star $$CRC frames. See [DSD demod plugin](../plugins/channel/demoddsd/readme.md) for details on how to decode Digital Voice modes.
|
||||||
- Help:
|
- Help:
|
||||||
- Loaded Plugins: shows details about the loaded plugins (see 1.2 below for details)
|
- _Loaded Plugins_: shows details about the loaded plugins (see 1.2 below for details)
|
||||||
- About: current version and blah blah.
|
- _About_: current version and blah blah.
|
||||||
|
|
||||||
<h4>1.1. Preferences - Audio</h4>
|
<h4>1.1. Preferences - Audio</h4>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user