summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt6
-rw-r--r--include-gpl/gui/glspectrumgui.h14
-rw-r--r--include-gpl/gui/glspectrumguismall.h63
-rw-r--r--include/gui/basicchannelsettingswidget.h21
-rw-r--r--include/gui/rollupwidget.h2
-rw-r--r--plugins/channel/tcpsrc/tcpsrcgui.ui14
-rw-r--r--sdrbase/gui/basicchannelsettingswidget.cpp14
-rw-r--r--sdrbase/gui/basicchannelsettingswidget.ui86
-rw-r--r--sdrbase/gui/glspectrumgui.cpp103
-rw-r--r--sdrbase/gui/glspectrumgui.ui607
-rw-r--r--sdrbase/gui/glspectrumguismall.cpp197
-rw-r--r--sdrbase/gui/glspectrumguismall.ui439
-rw-r--r--sdrbase/gui/rollupwidget.cpp11
-rw-r--r--sdrbase/mainwindow.ui10
-rw-r--r--sdrbase/resources/invertspectrum.pngbin0 -> 1272 bytes
-rw-r--r--sdrbase/resources/res.qrc1
16 files changed, 563 insertions, 1025 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c388954..ab899f2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -63,12 +63,12 @@ set(sdrbase_SOURCES
sdrbase/gui/aboutdialog.cpp
sdrbase/gui/addpresetdialog.cpp
+ sdrbase/gui/basicchannelsettingswidget.cpp
sdrbase/gui/buttonswitch.cpp
sdrbase/gui/channelwindow.cpp
sdrbase/gui/glscope.cpp
sdrbase/gui/glspectrum.cpp
sdrbase/gui/glspectrumgui.cpp
- sdrbase/gui/glspectrumguismall.cpp
sdrbase/gui/indicator.cpp
sdrbase/gui/pluginsdialog.cpp
sdrbase/gui/preferencesdialog.cpp
@@ -128,12 +128,12 @@ set(sdrbase_HEADERS
include-gpl/gui/aboutdialog.h
include-gpl/gui/addpresetdialog.h
+ include/gui/basicchannelsettingswidget.h
include-gpl/gui/buttonswitch.h
include-gpl/gui/channelwindow.h
include-gpl/gui/glscope.h
include-gpl/gui/glspectrum.h
include-gpl/gui/glspectrumgui.h
- include-gpl/gui/glspectrumguismall.h
include-gpl/gui/indicator.h
include-gpl/gui/physicalunit.h
include-gpl/gui/pluginsdialog.h
@@ -174,8 +174,8 @@ set(sdrbase_FORMS
sdrbase/gui/aboutdialog.ui
sdrbase/gui/addpresetdialog.ui
+ sdrbase/gui/basicchannelsettingswidget.ui
sdrbase/gui/glspectrumgui.ui
- sdrbase/gui/glspectrumguismall.ui
sdrbase/gui/pluginsdialog.ui
sdrbase/gui/preferencesdialog.ui
sdrbase/gui/scopewindow.ui
diff --git a/include-gpl/gui/glspectrumgui.h b/include-gpl/gui/glspectrumgui.h
index 3fccab0..b515aed 100644
--- a/include-gpl/gui/glspectrumgui.h
+++ b/include-gpl/gui/glspectrumgui.h
@@ -38,22 +38,28 @@ private:
qint32 m_fftWindow;
Real m_refLevel;
Real m_powerRange;
+ int m_decay;
bool m_displayWaterfall;
bool m_invertedWaterfall;
bool m_displayMaxHold;
bool m_displayHistogram;
+ bool m_displayGrid;
+ bool m_invert;
void applySettings();
private slots:
- void on_fftSize_valueChanged(int value);
void on_fftWindow_currentIndexChanged(int index);
- void on_refLevel_valueChanged(int value);
- void on_levelRange_valueChanged(int value);
- void on_decay_valueChanged(int value);
+ void on_fftSize_currentIndexChanged(int index);
+ void on_refLevel_currentIndexChanged(int index);
+ void on_levelRange_currentIndexChanged(int index);
+ void on_decay_currentIndexChanged(int index);
+
void on_waterfall_toggled(bool checked);
void on_histogram_toggled(bool checked);
void on_maxHold_toggled(bool checked);
+ void on_invert_toggled(bool checked);
+ void on_grid_toggled(bool checked);
};
#endif // INCLUDE_GLSPECTRUMGUI_H
diff --git a/include-gpl/gui/glspectrumguismall.h b/include-gpl/gui/glspectrumguismall.h
deleted file mode 100644
index 67cad73..0000000
--- a/include-gpl/gui/glspectrumguismall.h
+++ /dev/null
@@ -1,63 +0,0 @@
-#ifndef INCLUDE_GLSPECTRUMGUISMALL_H
-#define INCLUDE_GLSPECTRUMGUISMALL_H
-
-#include <QWidget>
-#include "dsp/dsptypes.h"
-#include "util/export.h"
-
-namespace Ui {
- class GLSpectrumGUISmall;
-}
-
-class MessageQueue;
-class SpectrumVis;
-class GLSpectrum;
-
-class SDRANGELOVE_API GLSpectrumGUISmall : public QWidget {
- Q_OBJECT
-
-public:
- explicit GLSpectrumGUISmall(QWidget* parent = NULL);
- ~GLSpectrumGUISmall();
-
- void setBuddies(MessageQueue* messageQueue, SpectrumVis* spectrumVis, GLSpectrum* glSpectrum);
-
- void resetToDefaults();
- QByteArray serialize() const;
- bool deserialize(const QByteArray& data);
-
-private:
- Ui::GLSpectrumGUISmall* ui;
-
- MessageQueue* m_messageQueue;
- SpectrumVis* m_spectrumVis;
- GLSpectrum* m_glSpectrum;
-
- qint32 m_fftSize;
- qint32 m_fftOverlap;
- qint32 m_fftWindow;
- Real m_refLevel;
- Real m_powerRange;
- int m_decay;
- bool m_displayWaterfall;
- bool m_invertedWaterfall;
- bool m_displayMaxHold;
- bool m_displayHistogram;
- bool m_displayGrid;
-
- void applySettings();
-
-private slots:
- void on_fftWindow_currentIndexChanged(int index);
- void on_fftSize_currentIndexChanged(int index);
- void on_refLevel_currentIndexChanged(int index);
- void on_levelRange_currentIndexChanged(int index);
- void on_decay_currentIndexChanged(int index);
-
- void on_waterfall_toggled(bool checked);
- void on_histogram_toggled(bool checked);
- void on_maxHold_toggled(bool checked);
- void on_grid_toggled(bool checked);
-};
-
-#endif // INCLUDE_GLSPECTRUMGUISMALL_H
diff --git a/include/gui/basicchannelsettingswidget.h b/include/gui/basicchannelsettingswidget.h
new file mode 100644
index 0000000..003b923
--- /dev/null
+++ b/include/gui/basicchannelsettingswidget.h
@@ -0,0 +1,21 @@
+#ifndef INCLUDE_BASICCHANNELSETTINGSWIDGET_H
+#define INCLUDE_BASICCHANNELSETTINGSWIDGET_H
+
+#include <QWidget>
+
+namespace Ui {
+ class BasicChannelSettingsWidget;
+}
+
+class BasicChannelSettingsWidget : public QWidget {
+ Q_OBJECT
+
+public:
+ explicit BasicChannelSettingsWidget(QWidget* parent = NULL);
+ ~BasicChannelSettingsWidget();
+
+private:
+ Ui::BasicChannelSettingsWidget* ui;
+};
+
+#endif // INCLUDE_BASICCHANNELSETTINGSWIDGET_H
diff --git a/include/gui/rollupwidget.h b/include/gui/rollupwidget.h
index ddebe6a..60966ac 100644
--- a/include/gui/rollupwidget.h
+++ b/include/gui/rollupwidget.h
@@ -15,6 +15,7 @@ public:
signals:
void widgetRolled(QWidget* widget, bool rollDown);
+ void menuDoubleClickEvent(const QPoint& position);
protected:
enum {
@@ -28,6 +29,7 @@ protected:
void resizeEvent(QResizeEvent* size);
void mousePressEvent(QMouseEvent* event);
+ void mouseDoubleClickEvent(QMouseEvent* event);
bool event(QEvent* event);
bool eventFilter(QObject* object, QEvent* event);
diff --git a/plugins/channel/tcpsrc/tcpsrcgui.ui b/plugins/channel/tcpsrc/tcpsrcgui.ui
index 7d577f1..72d2ea6 100644
--- a/plugins/channel/tcpsrc/tcpsrcgui.ui
+++ b/plugins/channel/tcpsrc/tcpsrcgui.ui
@@ -130,7 +130,7 @@
<widget class="GLSpectrum" name="glSpectrum" native="true"/>
</item>
<item>
- <widget class="GLSpectrumGUISmall" name="spectrumGUI" native="true"/>
+ <widget class="GLSpectrumGUI" name="spectrumGUI" native="true"/>
</item>
</layout>
</widget>
@@ -182,21 +182,21 @@
</widget>
<customwidgets>
<customwidget>
- <class>RollupWidget</class>
+ <class>GLSpectrum</class>
<extends>QWidget</extends>
- <header>gui/rollupwidget.h</header>
+ <header>gui/glspectrum.h</header>
<container>1</container>
</customwidget>
<customwidget>
- <class>GLSpectrum</class>
+ <class>GLSpectrumGUI</class>
<extends>QWidget</extends>
- <header>gui/glspectrum.h</header>
+ <header>gui/glspectrumgui.h</header>
<container>1</container>
</customwidget>
<customwidget>
- <class>GLSpectrumGUISmall</class>
+ <class>RollupWidget</class>
<extends>QWidget</extends>
- <header>gui/glspectrumguismall.h</header>
+ <header>gui/rollupwidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>
diff --git a/sdrbase/gui/basicchannelsettingswidget.cpp b/sdrbase/gui/basicchannelsettingswidget.cpp
new file mode 100644
index 0000000..3103a25
--- /dev/null
+++ b/sdrbase/gui/basicchannelsettingswidget.cpp
@@ -0,0 +1,14 @@
+#include "gui/basicchannelsettingswidget.h"
+#include "ui_basicchannelsettingswidget.h"
+
+BasicChannelSettingsWidget::BasicChannelSettingsWidget(QWidget* parent) :
+ QWidget(parent),
+ ui(new Ui::BasicChannelSettingsWidget)
+{
+ ui->setupUi(this);
+}
+
+BasicChannelSettingsWidget::~BasicChannelSettingsWidget()
+{
+ delete ui;
+}
diff --git a/sdrbase/gui/basicchannelsettingswidget.ui b/sdrbase/gui/basicchannelsettingswidget.ui
new file mode 100644
index 0000000..25d72e2
--- /dev/null
+++ b/sdrbase/gui/basicchannelsettingswidget.ui
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>BasicChannelSettingsWidget</class>
+ <widget class="QWidget" name="BasicChannelSettingsWidget">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>149</width>
+ <height>116</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>3</number>
+ </property>
+ <item row="0" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Title</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" colspan="2">
+ <widget class="QLineEdit" name="title"/>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>Color</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QToolButton" name="colorBtn">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2">
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string>#ff0000</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" colspan="2">
+ <widget class="QSlider" name="red">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" colspan="2">
+ <widget class="QSlider" name="green">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1" colspan="2">
+ <widget class="QSlider" name="blue">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <tabstops>
+ <tabstop>title</tabstop>
+ <tabstop>colorBtn</tabstop>
+ <tabstop>red</tabstop>
+ <tabstop>green</tabstop>
+ <tabstop>blue</tabstop>
+ </tabstops>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/sdrbase/gui/glspectrumgui.cpp b/sdrbase/gui/glspectrumgui.cpp
index 52dd40d..1fbaaf2 100644
--- a/sdrbase/gui/glspectrumgui.cpp
+++ b/sdrbase/gui/glspectrumgui.cpp
@@ -16,12 +16,19 @@ GLSpectrumGUI::GLSpectrumGUI(QWidget* parent) :
m_fftWindow(FFTWindow::Hamming),
m_refLevel(0),
m_powerRange(100),
- m_displayWaterfall(true),
+ m_decay(0),
+ m_displayWaterfall(false),
m_invertedWaterfall(false),
- m_displayMaxHold(false),
- m_displayHistogram(true)
+ m_displayMaxHold(true),
+ m_displayHistogram(true),
+ m_displayGrid(true),
+ m_invert(false)
{
ui->setupUi(this);
+ for(int ref = 0; ref >= -95; ref -= 5)
+ ui->refLevel->addItem(QString("%1").arg(ref));
+ for(int range = 100; range >= 5; range -= 5)
+ ui->levelRange->addItem(QString("%1").arg(range));
}
GLSpectrumGUI::~GLSpectrumGUI()
@@ -44,10 +51,13 @@ void GLSpectrumGUI::resetToDefaults()
m_fftWindow = FFTWindow::Hamming;
m_refLevel = 0;
m_powerRange = 100;
- m_displayWaterfall = true;
+ m_decay = 0;
+ m_displayWaterfall = false;
m_invertedWaterfall = false;
- m_displayMaxHold = false;
+ m_displayMaxHold = true;
m_displayHistogram = true;
+ m_displayGrid = true;
+ m_invert = false;
applySettings();
}
@@ -63,6 +73,9 @@ QByteArray GLSpectrumGUI::serialize() const
s.writeBool(7, m_invertedWaterfall);
s.writeBool(8, m_displayMaxHold);
s.writeBool(9, m_displayHistogram);
+ s.writeS32(10, m_decay);
+ s.writeBool(11, m_displayGrid);
+ s.writeBool(12, m_invert);
return s.final();
}
@@ -85,6 +98,9 @@ bool GLSpectrumGUI::deserialize(const QByteArray& data)
d.readBool(7, &m_invertedWaterfall, false);
d.readBool(8, &m_displayMaxHold, false);
d.readBool(9, &m_displayHistogram, true);
+ d.readS32(10, &m_decay, 0);
+ d.readBool(11, &m_displayGrid, true);
+ d.readBool(12, &m_invert, false);
applySettings();
return true;
} else {
@@ -95,71 +111,100 @@ bool GLSpectrumGUI::deserialize(const QByteArray& data)
void GLSpectrumGUI::applySettings()
{
+ ui->fftWindow->setCurrentIndex(m_fftWindow);
for(int i = 0; i < 6; i++) {
if(m_fftSize == (1 << (i + 7))) {
- ui->fftSize->setValue(i);
+ ui->fftSize->setCurrentIndex(i);
break;
}
}
- ui->fftWindow->setCurrentIndex(m_fftWindow);
+ ui->refLevel->setCurrentIndex(-m_refLevel / 5);
+ ui->levelRange->setCurrentIndex((100 - m_powerRange) / 5);
+ ui->decay->setCurrentIndex(m_decay + 2);
ui->waterfall->setChecked(m_displayWaterfall);
+ ui->maxHold->setChecked(m_displayMaxHold);
+ ui->histogram->setChecked(m_displayHistogram);
+ ui->invert->setChecked(m_invert);
+ ui->grid->setChecked(m_displayGrid);
+
m_glSpectrum->setDisplayWaterfall(m_displayWaterfall);
m_glSpectrum->setInvertedWaterfall(m_invertedWaterfall);
- ui->maxHold->setChecked(m_displayMaxHold);
m_glSpectrum->setDisplayMaxHold(m_displayMaxHold);
- ui->histogram->setChecked(m_displayHistogram);
m_glSpectrum->setDisplayHistogram(m_displayHistogram);
- ui->refLevel->setValue((int)(m_refLevel / 10.0));
- ui->levelRange->setValue((int)(m_powerRange / 10.0));
+ m_glSpectrum->setDecay(m_decay);
+ m_glSpectrum->setInvertedWaterfall(m_invert);
+ m_glSpectrum->setDisplayGrid(m_displayGrid);
m_spectrumVis->configure(m_messageQueue, m_fftSize, m_fftOverlap, (FFTWindow::Function)m_fftWindow);
}
-void GLSpectrumGUI::on_fftSize_valueChanged(int value)
+void GLSpectrumGUI::on_fftWindow_currentIndexChanged(int index)
{
- m_fftSize = 1 << (7 + value);
- ui->fftSizeDisplay->setText(tr("%1").arg(m_fftSize));
+ m_fftWindow = index;
+ if(m_spectrumVis == NULL)
+ return;
m_spectrumVis->configure(m_messageQueue, m_fftSize, m_fftOverlap, (FFTWindow::Function)m_fftWindow);
}
-void GLSpectrumGUI::on_fftWindow_currentIndexChanged(int index)
+void GLSpectrumGUI::on_fftSize_currentIndexChanged(int index)
{
- m_fftWindow = index;
- m_spectrumVis->configure(m_messageQueue, m_fftSize, m_fftOverlap, (FFTWindow::Function)m_fftWindow);
+ m_fftSize = 1 << (7 + index);
+ if(m_spectrumVis != NULL)
+ m_spectrumVis->configure(m_messageQueue, m_fftSize, m_fftOverlap, (FFTWindow::Function)m_fftWindow);
}
-void GLSpectrumGUI::on_refLevel_valueChanged(int value)
+void GLSpectrumGUI::on_refLevel_currentIndexChanged(int index)
{
- m_refLevel = value * 10;
- m_glSpectrum->setReferenceLevel(m_refLevel);
- ui->refLevelDisplay->setText(tr("%1").arg(m_refLevel));
+ m_refLevel = 0 - index * 5;
+ if(m_glSpectrum != NULL)
+ m_glSpectrum->setReferenceLevel(m_refLevel);
}
-void GLSpectrumGUI::on_levelRange_valueChanged(int value)
+void GLSpectrumGUI::on_levelRange_currentIndexChanged(int index)
{
- m_powerRange = value * 10;
- m_glSpectrum->setPowerRange(m_powerRange);
- ui->levelRangeDisplay->setText(tr("%1").arg(m_powerRange));
+ m_powerRange = 100 - index * 5;
+ if(m_glSpectrum != NULL)
+ m_glSpectrum->setPowerRange(m_powerRange);
}
-void GLSpectrumGUI::on_decay_valueChanged(int value)
+void GLSpectrumGUI::on_decay_currentIndexChanged(int index)
{
+ m_decay = index - 2;
+ if(m_glSpectrum != NULL)
+ m_glSpectrum->setDecay(m_decay);
}
void GLSpectrumGUI::on_waterfall_toggled(bool checked)
{
m_displayWaterfall = checked;
- m_glSpectrum->setDisplayWaterfall(m_displayWaterfall);
+ if(m_glSpectrum != NULL)
+ m_glSpectrum->setDisplayWaterfall(m_displayWaterfall);
}
void GLSpectrumGUI::on_histogram_toggled(bool checked)
{
m_displayHistogram = checked;
- m_glSpectrum->setDisplayHistogram(m_displayHistogram);
+ if(m_glSpectrum != NULL)
+ m_glSpectrum->setDisplayHistogram(m_displayHistogram);
}
void GLSpectrumGUI::on_maxHold_toggled(bool checked)
{
m_displayMaxHold = checked;
- m_glSpectrum->setDisplayMaxHold(m_displayMaxHold);
+ if(m_glSpectrum != NULL)
+ m_glSpectrum->setDisplayMaxHold(m_displayMaxHold);
+}
+
+void GLSpectrumGUI::on_invert_toggled(bool checked)
+{
+ m_invert = checked;
+ if(m_glSpectrum != NULL)
+ m_glSpectrum->setInvertedWaterfall(m_invert);
+}
+
+void GLSpectrumGUI::on_grid_toggled(bool checked)
+{
+ m_displayGrid = checked;
+ if(m_glSpectrum != NULL)
+ m_glSpectrum->setDisplayGrid(m_displayGrid);
}
diff --git a/sdrbase/gui/glspectrumgui.ui b/sdrbase/gui/glspectrumgui.ui
index 048b3f6..2a9babe 100644
--- a/sdrbase/gui/glspectrumgui.ui
+++ b/sdrbase/gui/glspectrumgui.ui
@@ -6,394 +6,443 @@
<rect>
<x>0</x>
<y>0</y>
- <width>203</width>
- <height>137</height>
+ <width>215</width>
+ <height>94</height>
</rect>
</property>
<property name="windowTitle">
<string>Oscilloscope</string>
</property>
- <layout class="QGridLayout" name="gridLayout_2">
+ <layout class="QGridLayout" name="gridLayout" columnstretch="1,1,1,1">
<property name="margin">
<number>2</number>
</property>
<property name="spacing">
<number>3</number>
</property>
- <item row="1" column="0">
- <widget class="QLabel" name="label_5">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_17">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="text">
- <string>Reference</string>
+ <string>Window</string>
</property>
</widget>
</item>
- <item row="1" column="1">
- <widget class="QSlider" name="refLevel">
- <property name="toolTip">
- <string>Spectrum reference level</string>
- </property>
- <property name="minimum">
- <number>-9</number>
- </property>
- <property name="maximum">
- <number>0</number>
- </property>
- <property name="singleStep">
- <number>1</number>
- </property>
- <property name="pageStep">
- <number>1</number>
- </property>
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="tickPosition">
- <enum>QSlider::TicksBelow</enum>
+ <item row="0" column="1">
+ <widget class="QLabel" name="label_18">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
</property>
- <property name="tickInterval">
- <number>1</number>
+ <property name="text">
+ <string>FFT Size</string>
</property>
</widget>
</item>
- <item row="1" column="2">
- <widget class="QLabel" name="refLevelDisplay">
+ <item row="0" column="2">
+ <widget class="QLabel" name="label_19">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="minimumSize">
- <size>
- <width>25</width>
- <height>0</height>
- </size>
- </property>
<property name="text">
- <string>0</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ <string>Ref (dB)</string>
</property>
</widget>
</item>
- <item row="1" column="3" rowspan="3">
- <widget class="Line" name="line_2">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- </widget>
- </item>
- <item row="1" column="4">
- <widget class="ButtonSwitch" name="waterfall">
- <property name="minimumSize">
- <size>
- <width>24</width>
- <height>24</height>
- </size>
- </property>
- <property name="toolTip">
- <string>Display waterfall</string>
+ <item row="0" column="3">
+ <widget class="QLabel" name="label_20">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
</property>
<property name="text">
- <string>Waterfall</string>
- </property>
- <property name="icon">
- <iconset resource="../resources/res.qrc">
- <normaloff>:/waterfall.png</normaloff>:/waterfall.png</iconset>
- </property>
- <property name="iconSize">
- <size>
- <width>16</width>
- <height>16</height>
- </size>
- </property>
- <property name="checkable">
- <bool>true</bool>
+ <string>Range (dB)</string>
</property>
</widget>
</item>
- <item row="2" column="0">
- <widget class="QLabel" name="label_6">
- <property name="text">
- <string>Range</string>
+ <item row="1" column="0">
+ <widget class="QComboBox" name="fftWindow">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Ignored" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
</property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="QSlider" name="levelRange">
<property name="toolTip">
- <string>Spectrum range</string>
- </property>
- <property name="minimum">
- <number>1</number>
- </property>
- <property name="maximum">
- <number>10</number>
+ <string>FFT window function</string>
</property>
- <property name="singleStep">
- <number>1</number>
- </property>
- <property name="pageStep">
- <number>1</number>
- </property>
- <property name="value">
- <number>10</number>
- </property>
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="tickPosition">
- <enum>QSlider::TicksBelow</enum>
- </property>
- <property name="tickInterval">
- <number>1</number>
+ <property name="sizeAdjustPolicy">
+ <enum>QComboBox::AdjustToContents</enum>
</property>
+ <item>
+ <property name="text">
+ <string>Bartlett</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Blackman-Harris</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Flat Top</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Hamming</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Hanning</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Rectangle</string>
+ </property>
+ </item>
</widget>
</item>
- <item row="2" column="2">
- <widget class="QLabel" name="levelRangeDisplay">
+ <item row="1" column="1">
+ <widget class="QComboBox" name="fftSize">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+ <sizepolicy hsizetype="Ignored" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="minimumSize">
- <size>
- <width>25</width>
- <height>0</height>
- </size>
- </property>
- <property name="text">
- <string>100</string>
+ <property name="toolTip">
+ <string>FFT window function</string>
</property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ <property name="sizeAdjustPolicy">
+ <enum>QComboBox::AdjustToContents</enum>
</property>
+ <item>
+ <property name="text">
+ <string>128</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>256</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>512</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>1024</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>2048</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>4096</string>
+ </property>
+ </item>
</widget>
</item>
- <item row="2" column="4">
- <widget class="ButtonSwitch" name="histogram">
- <property name="minimumSize">
- <size>
- <width>24</width>
- <height>24</height>
- </size>
+ <item row="1" column="2">
+ <widget class="QComboBox" name="refLevel">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Ignored" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
</property>
<property name="toolTip">
- <string>Display phosphor effect spectrum</string>
- </property>
- <property name="text">
- <string>Histogram</string>
- </property>
- <property name="icon">
- <iconset resource="../resources/res.qrc">
- <normaloff>:/histogram.png</normaloff>:/histogram.png</iconset>
- </property>
- <property name="iconSize">
- <size>
- <width>16</width>
- <height>16</height>
- </size>
+ <string>FFT window function</string>
</property>
- <property name="checkable">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="3" column="0">
- <widget class="QLabel" name="label_7">
- <property name="text">
- <string>Decay</string>
+ <property name="sizeAdjustPolicy">
+ <enum>QComboBox::AdjustToContents</enum>
</property>
</widget>
</item>
- <item row="3" column="1">
- <widget class="QSlider" name="decay">
- <property name="enabled">
- <bool>false</bool>
+ <item row="1" column="3">
+ <widget class="QComboBox" name="levelRange">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Ignored" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
</property>
<property name="toolTip">
- <string>Digital phosphor effect decay time</string>
- </property>
- <property name="maximum">
- <number>100</number>
- </property>
- <property name="singleStep">
- <number>10</number>
+ <string>FFT window function</string>
</property>
- <property name="pageStep">
- <number>10</number>
- </property>
- <property name="value">
- <number>100</number>
- </property>
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="tickPosition">
- <enum>QSlider::TicksBelow</enum>
- </property>
- <property name="tickInterval">
- <number>10</number>
+ <property name="sizeAdjustPolicy">
+ <enum>QComboBox::AdjustToContents</enum>
</property>
</widget>
</item>
- <item row="3" column="2">
- <widget class="QLabel" name="levelRangeDisplay_2">
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_8">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="minimumSize">
- <size>
- <width>25</width>
- <height>0</height>
- </size>
- </property>
<property name="text">
- <string>100</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ <string>Decay</string>
</property>
</widget>
</item>
- <item row="3" column="4">
- <widget class="ButtonSwitch" name="maxHold">
- <property name="minimumSize">
- <size>
- <width>24</width>
- <height>24</height>
- </size>
+ <item row="3" column="0">
+ <widget class="QComboBox" name="decay">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Ignored" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
</property>
<property name="toolTip">
- <string>Display live spectrum</string>
+ <string>FFT window function</string>
</property>
- <property name="text">
- <string>Live Spectrum</string>
- </property>
- <property name="icon">
- <iconset resource="../resources/res.qrc">
- <normaloff>:/maxhold.png</normaloff>:/maxhold.png</iconset>
- </property>
- <property name="iconSize">
- <size>
- <width>16</width>
- <height>16</height>
- </size>
+ <property name="currentIndex">
+ <number>0</number>
</property>
- <property name="checkable">
- <bool>true</bool>
+ <property name="sizeAdjustPolicy">
+ <enum>QComboBox::AdjustToContents</enum>
</property>
+ <item>
+ <property name="text">
+ <string>-2</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>-1</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>normal</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>+1</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>+2</string>
+ </property>
+ </item>
</widget>
</item>
- <item row="0" column="0" colspan="5">
- <layout class="QGridLayout" name="gridLayout">
- <property name="margin">
- <number>2</number>
- </property>
+ <item row="3" column="1" colspan="3">
+ <layout class="QHBoxLayout" name="controlBtns">
<property name="spacing">
<number>3</number>
</property>
- <item row="0" column="0">
- <widget class="QLabel" name="label_15">
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="ButtonSwitch" name="waterfall">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>24</width>
+ <height>24</height>
+ </size>
+ </property>
+ <property name="toolTip">
+ <string>Display waterfall</string>
+ </property>
<property name="text">
- <string>FFT Size</string>
+ <string>Waterfall</string>
+ </property>
+ <property name="icon">
+ <iconset resource="../resources/res.qrc">
+ <normaloff>:/waterfall.png</normaloff>:/waterfall.png</iconset>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
</property>
</widget>
</item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_17">
+ <item>
+ <widget class="ButtonSwitch" name="histogram">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>24</width>
+ <height>24</height>
+ </size>
+ </property>
+ <property name="toolTip">
+ <string>Display phosphor effect spectrum</string>
+ </property>
<property name="text">
- <string>Window</string>
+ <string>Histogram</string>
+ </property>
+ <property name="icon">
+ <iconset resource="../resources/res.qrc">
+ <normaloff>:/histogram.png</normaloff>:/histogram.png</iconset>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
</property>
</widget>
</item>
- <item row="1" column="1" colspan="2">
- <widget class="QComboBox" name="fftWindow">
+ <item>
+ <widget class="ButtonSwitch" name="maxHold">
<property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>24</width>
+ <height>24</height>
+ </size>
+ </property>
<property name="toolTip">
- <string>FFT window function</string>
- </property>
- <property name="sizeAdjustPolicy">
- <enum>QComboBox::AdjustToContents</enum>
- </property>
- <item>
- <property name="text">
- <string>Bartlett</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Blackman-Harris</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Flat Top</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Hamming</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Hanning</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Rectangle</string>
- </property>
- </item>
+ <string>Display live spectrum</string>
+ </property>
+ <property name="text">
+ <string>Max Hold</string>
+ </property>
+ <property name="icon">
+ <iconset resource="../resources/res.qrc">
+ <normaloff>:/maxhold.png</normaloff>:/maxhold.png</iconset>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
</widget>
</item>
- <item row="0" column="2">
- <widget class="QLabel" name="fftSizeDisplay">
+ <item>
+ <widget class="ButtonSwitch" name="invert">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="minimumSize">
<size>
- <width>40</width>
- <height>0</height>
+ <width>24</width>
+ <height>24</height>
</size>
</property>
+ <property name="toolTip">
+ <string>Exchange waterfall and histogram</string>
+ </property>
<property name="text">
- <string>128</string>
+ <string>Inv</string>
+ </property>
+ <property name="icon">
+ <iconset resource="../resources/res.qrc">
+ <normaloff>:/invertspectrum.png</normaloff>:/invertspectrum.png</iconset>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
</property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ <property name="checkable">
+ <bool>true</bool>
</property>
</widget>
</item>
- <item row="0" column="1">
- <widget class="QSlider" name="fftSize">
- <property name="toolTip">
- <string>FFT calculation block size</string>
+ <item>
+ <widget class="ButtonSwitch" name="grid">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
</property>
- <property name="maximum">
- <number>5</number>
+ <property name="minimumSize">
+ <size>
+ <width>24</width>
+ <height>24</height>
+ </size>
</property>
- <property name="pageStep">
- <number>1</number>
+ <property name="toolTip">
+ <string>Toggle the scale grid</string>
</property>
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
+ <property name="text">
+ <string>Grid</string>
+ </property>
+ <property name="icon">
+ <iconset resource="../resources/res.qrc">
+ <normaloff>:/grid.png</normaloff>:/grid.png</iconset>
</property>
- <property name="tickPosition">
- <enum>QSlider::TicksBelow</enum>
+ <property name="iconSize">
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
</property>
- <property name="tickInterval">
- <number>1</number>
+ <property name="checkable">
+ <bool>true</bool>
</property>
</widget>
</item>
@@ -409,14 +458,16 @@
</customwidget>
</customwidgets>
<tabstops>
- <tabstop>fftSize</tabstop>
<tabstop>fftWindow</tabstop>
+ <tabstop>fftSize</tabstop>
<tabstop>refLevel</tabstop>
<tabstop>levelRange</tabstop>
<tabstop>decay</tabstop>
<tabstop>waterfall</tabstop>
<tabstop>histogram</tabstop>
<tabstop>maxHold</tabstop>
+ <tabstop>invert</tabstop>
+ <tabstop>grid</tabstop>
</tabstops>
<resources>
<include location="../resources/res.qrc"/>
diff --git a/sdrbase/gui/glspectrumguismall.cpp b/sdrbase/gui/glspectrumguismall.cpp
deleted file mode 100644
index 9c02782..0000000
--- a/sdrbase/gui/glspectrumguismall.cpp
+++ /dev/null
@@ -1,197 +0,0 @@
-#include "gui/glspectrumguismall.h"
-#include "dsp/fftwindow.h"
-#include "dsp/spectrumvis.h"
-#include "gui/glspectrum.h"
-#include "util/simpleserializer.h"
-#include "ui_glspectrumguismall.h"
-
-GLSpectrumGUISmall::GLSpectrumGUISmall(QWidget* parent) :
- QWidget(parent),
- ui(new Ui::GLSpectrumGUISmall),
- m_messageQueue(NULL),
- m_spectrumVis(NULL),
- m_glSpectrum(NULL),
- m_fftSize(1024),
- m_fftOverlap(10),
- m_fftWindow(FFTWindow::Hamming),
- m_refLevel(0),
- m_powerRange(100),
- m_decay(0),
- m_displayWaterfall(false),
- m_invertedWaterfall(false),
- m_displayMaxHold(true),
- m_displayHistogram(true),
- m_displayGrid(true)
-{
- ui->setupUi(this);
- for(int ref = 0; ref >= -95; ref -= 5)
- ui->refLevel->addItem(QString("%1").arg(ref));
- for(int range = 100; range >= 5; range -= 5)
- ui->levelRange->addItem(QString("%1").arg(range));
-}
-
-GLSpectrumGUISmall::~GLSpectrumGUISmall()
-{
- delete ui;
-}
-
-void GLSpectrumGUISmall::setBuddies(MessageQueue* messageQueue, SpectrumVis* spectrumVis, GLSpectrum* glSpectrum)
-{
- m_messageQueue = messageQueue;
- m_spectrumVis = spectrumVis;
- m_glSpectrum = glSpectrum;
- applySettings();
-}
-
-void GLSpectrumGUISmall::resetToDefaults()
-{
- m_fftSize = 1024;
- m_fftOverlap = 10;
- m_fftWindow = FFTWindow::Hamming;
- m_refLevel = 0;
- m_powerRange = 100;
- m_decay = 0;
- m_displayWaterfall = false;
- m_invertedWaterfall = false;
- m_displayMaxHold = true;
- m_displayHistogram = true;
- m_displayGrid = true;
- applySettings();
-}
-
-QByteArray GLSpectrumGUISmall::serialize() const
-{
- SimpleSerializer s(1);
- s.writeS32(1, m_fftSize);
- s.writeS32(2, m_fftOverlap);
- s.writeS32(3, m_fftWindow);
- s.writeReal(4, m_refLevel);
- s.writeReal(5, m_powerRange);
- s.writeBool(6, m_displayWaterfall);
- s.writeBool(7, m_invertedWaterfall);
- s.writeBool(8, m_displayMaxHold);
- s.writeBool(9, m_displayHistogram);
- s.writeS32(10, m_decay);
- s.writeBool(11, m_displayGrid);
- return s.final();
-}
-
-bool GLSpectrumGUISmall::deserialize(const QByteArray& data)
-{
- SimpleDeserializer d(data);
-
- if(!d.isValid()) {
- resetToDefaults();
- return false;
- }
-
- if(d.getVersion() == 1) {
- d.readS32(1, &m_fftSize, 1024);
- d.readS32(2, &m_fftOverlap, 10);
- d.readS32(3, &m_fftWindow, FFTWindow::Hamming);
- d.readReal(4, &m_refLevel, 0);
- d.readReal(5, &m_powerRange, 100);
- d.readBool(6, &m_displayWaterfall, true);
- d.readBool(7, &m_invertedWaterfall, false);
- d.readBool(8, &m_displayMaxHold, false);
- d.readBool(9, &m_displayHistogram, true);
- d.readS32(10, &m_decay, 0);
- d.readBool(11, &m_displayGrid, true);
- applySettings();
- return true;
- } else {
- resetToDefaults();
- return false;
- }
-}
-
-void GLSpectrumGUISmall::applySettings()
-{
- ui->fftWindow->setCurrentIndex(m_fftWindow);
- for(int i = 0; i < 6; i++) {
- if(m_fftSize == (1 << (i + 7))) {
- ui->fftSize->setCurrentIndex(i);
- break;
- }
- }
- ui->refLevel->setCurrentIndex(-m_refLevel / 5);
- ui->levelRange->setCurrentIndex((100 - m_powerRange) / 5);
- ui->decay->setCurrentIndex(m_decay + 2);
- ui->waterfall->setChecked(m_displayWaterfall);
- ui->maxHold->setChecked(m_displayMaxHold);
- ui->histogram->setChecked(m_displayHistogram);
- ui->grid->setChecked(m_displayGrid);
-
- m_glSpectrum->setDisplayWaterfall(m_displayWaterfall);
- m_glSpectrum->setInvertedWaterfall(m_invertedWaterfall);
- m_glSpectrum->setDisplayMaxHold(m_displayMaxHold);
- m_glSpectrum->setDisplayHistogram(m_displayHistogram);
- m_glSpectrum->setDecay(m_decay);
- m_glSpectrum->setDisplayGrid(m_displayGrid);
-
- m_spectrumVis->configure(m_messageQueue, m_fftSize, m_fftOverlap, (FFTWindow::Function)m_fftWindow);
-}
-
-void GLSpectrumGUISmall::on_fftWindow_currentIndexChanged(int index)
-{
- m_fftWindow = index;
- if(m_spectrumVis == NULL)
- return;
- m_spectrumVis->configure(m_messageQueue, m_fftSize, m_fftOverlap, (FFTWindow::Function)m_fftWindow);
-}
-
-void GLSpectrumGUISmall::on_fftSize_currentIndexChanged(int index)
-{
- m_fftSize = 1 << (7 + index);
- if(m_spectrumVis != NULL)
- m_spectrumVis->configure(m_messageQueue, m_fftSize, m_fftOverlap, (FFTWindow::Function)m_fftWindow);
-}
-
-void GLSpectrumGUISmall::on_refLevel_currentIndexChanged(int index)
-{
- m_refLevel = 0 - index * 5;
- if(m_glSpectrum != NULL)
- m_glSpectrum->setReferenceLevel(m_refLevel);
-}
-
-void GLSpectrumGUISmall::on_levelRange_currentIndexChanged(int index)
-{
- m_powerRange = 100 - index * 5;
- if(m_glSpectrum != NULL)
- m_glSpectrum->setPowerRange(m_powerRange);
-}
-
-void GLSpectrumGUISmall::on_decay_currentIndexChanged(int index)
-{
- m_decay = index - 2;
- if(m_glSpectrum != NULL)
- m_glSpectrum->setDecay(m_decay);
-}
-
-void GLSpectrumGUISmall::on_waterfall_toggled(bool checked)
-{
- m_displayWaterfall = checked;
- if(m_glSpectrum != NULL)
- m_glSpectrum->setDisplayWaterfall(m_displayWaterfall);
-}
-
-void GLSpectrumGUISmall::on_histogram_toggled(bool checked)
-{
- m_displayHistogram = checked;
- if(m_glSpectrum != NULL)
- m_glSpectrum->setDisplayHistogram(m_displayHistogram);
-}
-
-void GLSpectrumGUISmall::on_maxHold_toggled(bool checked)
-{
- m_displayMaxHold = checked;
- if(m_glSpectrum != NULL)
- m_glSpectrum->setDisplayMaxHold(m_displayMaxHold);
-}
-
-void GLSpectrumGUISmall::on_grid_toggled(bool checked)
-{
- m_displayGrid = checked;
- if(m_glSpectrum != NULL)
- m_glSpectrum->setDisplayGrid(m_displayGrid);
-}
diff --git a/sdrbase/gui/glspectrumguismall.ui b/sdrbase/gui/glspectrumguismall.ui
deleted file mode 100644
index 2981ffe..0000000
--- a/sdrbase/gui/glspectrumguismall.ui
+++ /dev/null
@@ -1,439 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>GLSpectrumGUISmall</class>
- <widget class="QWidget" name="GLSpectrumGUISmall">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>214</width>
- <height>94</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>Oscilloscope</string>
- </property>
- <layout class="QGridLayout" name="gridLayout" columnstretch="1,1,1,1">
- <property name="margin">
- <number>2</number>
- </property>
- <property name="spacing">
- <number>3</number>
- </property>
- <item row="0" column="0">
- <widget class="QLabel" name="label_17">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Window</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QLabel" name="label_18">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>FFT Size</string>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QLabel" name="label_19">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Ref (dB)</string>
- </property>
- </widget>
- </item>
- <item row="0" column="3">
- <widget class="QLabel" name="label_20">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Range (dB)</string>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QComboBox" name="fftWindow">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Ignored" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="toolTip">
- <string>FFT window function</string>
- </property>
- <property name="sizeAdjustPolicy">
- <enum>QComboBox::AdjustToContents</enum>
- </property>
- <item>
- <property name="text">
- <string>Bartlett</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Blackman-Harris</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Flat Top</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Hamming</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Hanning</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Rectangle</string>
- </property>
- </item>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QComboBox" name="fftSize">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Ignored" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="toolTip">
- <string>FFT window function</string>
- </property>
- <property name="sizeAdjustPolicy">
- <enum>QComboBox::AdjustToContents</enum>
- </property>
- <item>
- <property name="text">
- <string>128</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>256</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>512</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>1024</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>2048</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>4096</string>
- </property>
- </item>
- </widget>
- </item>
- <item row="1" column="2">
- <widget class="QComboBox" name="refLevel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Ignored" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="toolTip">
- <string>FFT window function</string>
- </property>
- <property name="sizeAdjustPolicy">
- <enum>QComboBox::AdjustToContents</enum>
- </property>
- </widget>
- </item>
- <item row="1" column="3">
- <widget class="QComboBox" name="levelRange">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Ignored" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="toolTip">
- <string>FFT window function</string>
- </property>
- <property name="sizeAdjustPolicy">
- <enum>QComboBox::AdjustToContents</enum>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="label_8">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Decay</string>
- </property>
- </widget>
- </item>
- <item row="3" column="0">
- <widget class="QComboBox" name="decay">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Ignored" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="toolTip">
- <string>FFT window function</string>
- </property>
- <property name="currentIndex">
- <number>0</number>
- </property>
- <property name="sizeAdjustPolicy">
- <enum>QComboBox::AdjustToContents</enum>
- </property>
- <item>
- <property name="text">
- <string>-2</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>-1</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>normal</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>+1</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>+2</string>
- </property>
- </item>
- </widget>
- </item>
- <item row="3" column="1" colspan="3">
- <layout class="QHBoxLayout" name="controlBtns">
- <property name="spacing">
- <number>3</number>
- </property>
- <item>
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>0</width>
- <height>0</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="ButtonSwitch" name="waterfall">
- <property name="sizePolicy">
- <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>24</width>
- <height>24</height>
- </size>
- </property>
- <property name="toolTip">
- <string>Display waterfall</string>
- </property>
- <property name="text">
- <string>Waterfall</string>
- </property>
- <property name="icon">
- <iconset resource="../resources/res.qrc">
- <normaloff>:/waterfall.png</normaloff>:/waterfall.png</iconset>
- </property>
- <property name="iconSize">
- <size>
- <width>16</width>
- <height>16</height>
- </size>
- </property>
- <property name="checkable">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="ButtonSwitch" name="histogram">
- <property name="sizePolicy">
- <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>24</width>
- <height>24</height>
- </size>
- </property>
- <property name="toolTip">
- <string>Display phosphor effect spectrum</string>
- </property>
- <property name="text">
- <string>Histogram</string>
- </property>
- <property name="icon">
- <iconset resource="../resources/res.qrc">
- <normaloff>:/histogram.png</normaloff>:/histogram.png</iconset>
- </property>
- <property name="iconSize">
- <size>
- <width>16</width>
- <height>16</height>
- </size>
- </property>
- <property name="checkable">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="ButtonSwitch" name="maxHold">
- <property name="sizePolicy">
- <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>24</width>
- <height>24</height>
- </size>
- </property>
- <property name="toolTip">
- <string>Display live spectrum</string>
- </property>
- <property name="text">
- <string>Live Spectrum</string>
- </property>
- <property name="icon">
- <iconset resource="../resources/res.qrc">
- <normaloff>:/maxhold.png</normaloff>:/maxhold.png</iconset>
- </property>
- <property name="iconSize">
- <size>
- <width>16</width>
- <height>16</height>
- </size>
- </property>
- <property name="checkable">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="ButtonSwitch" name="grid">
- <property name="sizePolicy">
- <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>24</width>
- <height>24</height>
- </size>
- </property>
- <property name="toolTip">
- <string>Toggle the scale grid</string>
- </property>
- <property name="text">
- <string>Grid</string>
- </property>
- <property name="icon">
- <iconset resource="../resources/res.qrc">
- <normaloff>:/grid.png</normaloff>:/grid.png</iconset>
- </property>
- <property name="iconSize">
- <size>
- <width>16</width>
- <height>16</height>
- </size>
- </property>
- <property name="checkable">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- <customwidgets>
- <customwidget>
- <class>ButtonSwitch</class>
- <extends>QToolButton</extends>
- <header>gui/buttonswitch.h</header>
- </customwidget>
- </customwidgets>
- <tabstops>
- <tabstop>fftWindow</tabstop>
- <tabstop>fftSize</tabstop>
- <tabstop>refLevel</tabstop>
- <tabstop>levelRange</tabstop>
- <tabstop>decay</tabstop>
- <tabstop>waterfall</tabstop>
- <tabstop>histogram</tabstop>
- <tabstop>maxHold</tabstop>
- </tabstops>
- <resources>
- <include location="../resources/res.qrc"/>
- </resources>
- <connections/>
-</ui>
diff --git a/sdrbase/gui/rollupwidget.cpp b/sdrbase/gui/rollupwidget.cpp
index db735c2..61532b4 100644
--- a/sdrbase/gui/rollupwidget.cpp
+++ b/sdrbase/gui/rollupwidget.cpp
@@ -297,6 +297,17 @@ void RollupWidget::mousePressEvent(QMouseEvent* event)
}
}
+void RollupWidget::mouseDoubleClickEvent(QMouseEvent* event)
+{
+ QFontMetrics fm(font());
+
+ // menu box left
+ if(QRectF(3.5, 3.5, fm.ascent(), fm.ascent()).contains(event->pos())) {
+ emit menuDoubleClickEvent(event->pos());
+ return;
+ }
+}
+
bool RollupWidget::event(QEvent* event)
{
if(event->type() == QEvent::ChildAdded) {
diff --git a/sdrbase/mainwindow.ui b/sdrbase/mainwindow.ui
index d9299de..60e2c43 100644
--- a/sdrbase/mainwindow.ui
+++ b/sdrbase/mainwindow.ui
@@ -428,6 +428,11 @@
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
<customwidget>
+ <class>ButtonSwitch</class>
+ <extends>QToolButton</extends>
+ <header>gui/buttonswitch.h</header>
+ </customwidget>
+ <customwidget>
<class>GLSpectrum</class>
<extends>QWidget</extends>
<header>gui/glspectrum.h</header>
@@ -440,11 +445,6 @@
<container>1</container>
</customwidget>
<customwidget>
- <class>ButtonSwitch</class>
- <extends>QToolButton</extends>
- <header>gui/buttonswitch.h</header>
- </customwidget>
- <customwidget>
<class>ChannelWindow</class>
<extends>QWidget</extends>
<header>gui/channelwindow.h</header>
diff --git a/sdrbase/resources/invertspectrum.png b/sdrbase/resources/invertspectrum.png
new file mode 100644
index 0000000..cd8e61c
--- /dev/null
+++ b/sdrbase/resources/invertspectrum.png
Binary files differ
diff --git a/sdrbase/resources/res.qrc b/sdrbase/resources/res.qrc
index 6130fc0..12a209a 100644
--- a/sdrbase/resources/res.qrc
+++ b/sdrbase/resources/res.qrc
@@ -11,5 +11,6 @@
<file>logo.png</file>
<file>maxhold.png</file>
<file>grid.png</file>
+ <file>invertspectrum.png</file>
</qresource>
</RCC>