Multi device support: add start/stop buttons to all source plugins GUIs

This commit is contained in:
f4exb 2016-05-11 20:02:45 +02:00
parent 6ef4653d35
commit 7992f3f428
10 changed files with 122 additions and 32 deletions

View File

@ -34,6 +34,18 @@
</property> </property>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_freq"> <layout class="QHBoxLayout" name="horizontalLayout_freq">
<item>
<widget class="ButtonSwitch" name="startStopButton">
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../sdrbase/resources/res.qrc">
<normaloff>:/play.png</normaloff>
<normalon>:/stop.png</normalon>:/play.png</iconset>
</property>
</widget>
</item>
<item> <item>
<spacer name="freqLeftSpacer"> <spacer name="freqLeftSpacer">
<property name="orientation"> <property name="orientation">
@ -557,6 +569,8 @@
<header>gui/buttonswitch.h</header> <header>gui/buttonswitch.h</header>
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<resources/> <resources>
<include location="../../../sdrbase/resources/res.qrc"/>
</resources>
<connections/> <connections/>
</ui> </ui>

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>300</width> <width>300</width>
<height>172</height> <height>175</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -34,6 +34,18 @@
</property> </property>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_freq"> <layout class="QHBoxLayout" name="horizontalLayout_freq">
<item>
<widget class="ButtonSwitch" name="startStopButton">
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../sdrbase/resources/res.qrc">
<normaloff>:/play.png</normaloff>
<normalon>:/stop.png</normalon>:/play.png</iconset>
</property>
</widget>
</item>
<item> <item>
<spacer name="freqLeftSpacer"> <spacer name="freqLeftSpacer">
<property name="orientation"> <property name="orientation">
@ -620,6 +632,8 @@
<header>gui/buttonswitch.h</header> <header>gui/buttonswitch.h</header>
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<resources/> <resources>
<include location="../../../sdrbase/resources/res.qrc"/>
</resources>
<connections/> <connections/>
</ui> </ui>

View File

@ -29,20 +29,23 @@
<property name="spacing"> <property name="spacing">
<number>3</number> <number>3</number>
</property> </property>
<property name="leftMargin"> <property name="margin">
<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>
<layout class="QHBoxLayout" name="layoutFrequency"> <layout class="QHBoxLayout" name="layoutFrequency">
<item>
<widget class="ButtonSwitch" name="startStopButton">
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../sdrbase/resources/res.qrc">
<normaloff>:/play.png</normaloff>
<normalon>:/stop.png</normalon>:/play.png</iconset>
</property>
</widget>
</item>
<item> <item>
<spacer name="horizontalSpacer"> <spacer name="horizontalSpacer">
<property name="orientation"> <property name="orientation">
@ -402,6 +405,8 @@
<header>gui/buttonswitch.h</header> <header>gui/buttonswitch.h</header>
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<resources/> <resources>
<include location="../../../sdrbase/resources/res.qrc"/>
</resources>
<connections/> <connections/>
</ui> </ui>

View File

@ -29,20 +29,23 @@
<property name="spacing"> <property name="spacing">
<number>3</number> <number>3</number>
</property> </property>
<property name="leftMargin"> <property name="margin">
<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>
<layout class="QHBoxLayout" name="horizontalLayout_3"> <layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="ButtonSwitch" name="startStopButton">
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../sdrbase/resources/res.qrc">
<normaloff>:/play.png</normaloff>
<normalon>:/stop.png</normalon>:/play.png</iconset>
</property>
</widget>
</item>
<item> <item>
<spacer name="horizontalSpacer"> <spacer name="horizontalSpacer">
<property name="orientation"> <property name="orientation">
@ -309,6 +312,8 @@
<header>gui/buttonswitch.h</header> <header>gui/buttonswitch.h</header>
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<resources/> <resources>
<include location="../../../sdrbase/resources/res.qrc"/>
</resources>
<connections/> <connections/>
</ui> </ui>

View File

@ -23,7 +23,7 @@
</font> </font>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>BladeRF</string> <string>FileSource</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing"> <property name="spacing">
@ -34,6 +34,18 @@
</property> </property>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_freq"> <layout class="QHBoxLayout" name="horizontalLayout_freq">
<item>
<widget class="ButtonSwitch" name="startStopButton">
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../sdrbase/resources/res.qrc">
<normaloff>:/play.png</normaloff>
<normalon>:/stop.png</normalon>:/play.png</iconset>
</property>
</widget>
</item>
<item> <item>
<spacer name="freqLeftSpacer"> <spacer name="freqLeftSpacer">
<property name="orientation"> <property name="orientation">

View File

@ -40,6 +40,18 @@
</property> </property>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_freq"> <layout class="QHBoxLayout" name="horizontalLayout_freq">
<item>
<widget class="ButtonSwitch" name="startStopButton">
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../sdrbase/resources/res.qrc">
<normaloff>:/play.png</normaloff>
<normalon>:/stop.png</normalon>:/play.png</iconset>
</property>
</widget>
</item>
<item> <item>
<spacer name="freqLeftSpacer"> <spacer name="freqLeftSpacer">
<property name="orientation"> <property name="orientation">
@ -528,6 +540,8 @@
<header>gui/buttonswitch.h</header> <header>gui/buttonswitch.h</header>
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<resources/> <resources>
<include location="../../../sdrbase/resources/res.qrc"/>
</resources>
<connections/> <connections/>
</ui> </ui>

View File

@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>287</width> <width>298</width>
<height>271</height> <height>271</height>
</rect> </rect>
</property> </property>
@ -34,6 +34,18 @@
</property> </property>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_freq"> <layout class="QHBoxLayout" name="horizontalLayout_freq">
<item>
<widget class="ButtonSwitch" name="startStopButton">
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../sdrbase/resources/res.qrc">
<normaloff>:/play.png</normaloff>
<normalon>:/stop.png</normalon>:/play.png</iconset>
</property>
</widget>
</item>
<item> <item>
<spacer name="horizontalSpacer"> <spacer name="horizontalSpacer">
<property name="orientation"> <property name="orientation">
@ -451,6 +463,8 @@
<header>gui/buttonswitch.h</header> <header>gui/buttonswitch.h</header>
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<resources/> <resources>
<include location="../../../sdrbase/resources/res.qrc"/>
</resources>
<connections/> <connections/>
</ui> </ui>

View File

@ -34,6 +34,18 @@
</property> </property>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_freq"> <layout class="QHBoxLayout" name="horizontalLayout_freq">
<item>
<widget class="ButtonSwitch" name="startStopButton">
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../sdrbase/resources/res.qrc">
<normaloff>:/play.png</normaloff>
<normalon>:/stop.png</normalon>:/play.png</iconset>
</property>
</widget>
</item>
<item> <item>
<spacer name="freqLeftSpacer"> <spacer name="freqLeftSpacer">
<property name="orientation"> <property name="orientation">

View File

@ -57,7 +57,6 @@ MainWindow::MainWindow(QWidget* parent) :
m_settings(), m_settings(),
m_dspEngine(DSPEngine::instance()), m_dspEngine(DSPEngine::instance()),
m_lastEngineState((DSPDeviceEngine::State)-1), m_lastEngineState((DSPDeviceEngine::State)-1),
m_startOsmoSDRUpdateAfterStop(false),
m_inputGUI(0), m_inputGUI(0),
m_sampleRate(0), m_sampleRate(0),
m_centerFrequency(0), m_centerFrequency(0),
@ -746,6 +745,7 @@ MainWindow::DeviceUISet::DeviceUISet(QTimer& timer)
m_spectrumGUI->setBuddies(m_spectrumVis->getInputMessageQueue(), m_spectrumVis, m_spectrum); m_spectrumGUI->setBuddies(m_spectrumVis->getInputMessageQueue(), m_spectrumVis, m_spectrum);
m_channelWindow = new ChannelWindow; m_channelWindow = new ChannelWindow;
m_sampleSource = new QComboBox; m_sampleSource = new QComboBox;
m_deviceEngine = 0;
// m_spectrum needs to have its font to be set since it cannot be inherited from the main window // m_spectrum needs to have its font to be set since it cannot be inherited from the main window
QFont font; QFont font;

View File

@ -31,6 +31,7 @@ class QComboBox;
class AudioDeviceInfo; class AudioDeviceInfo;
class DSPEngine; class DSPEngine;
class DSPDeviceEngine;
class Indicator; class Indicator;
class SpectrumVis; class SpectrumVis;
class GLSpectrum; class GLSpectrum;
@ -59,6 +60,7 @@ public:
GLSpectrumGUI *m_spectrumGUI; GLSpectrumGUI *m_spectrumGUI;
ChannelWindow *m_channelWindow; ChannelWindow *m_channelWindow;
QComboBox *m_sampleSource; QComboBox *m_sampleSource;
DSPDeviceEngine *m_deviceEngine;
DeviceUISet(QTimer& timer); DeviceUISet(QTimer& timer);
~DeviceUISet(); ~DeviceUISet();
@ -110,8 +112,6 @@ private:
Indicator* m_engineRunning; Indicator* m_engineRunning;
Indicator* m_engineError; Indicator* m_engineError;
bool m_startOsmoSDRUpdateAfterStop;
QWidget* m_inputGUI; QWidget* m_inputGUI;
int m_sampleRate; int m_sampleRate;