1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-09-04 06:07:49 -04:00

Spectrum markers: moved to sdrbase

This commit is contained in:
f4exb 2021-08-07 19:45:48 +02:00
parent 885bfb823f
commit ab314c814d
10 changed files with 16 additions and 11 deletions

View File

@ -149,6 +149,7 @@ set(sdrbase_SOURCES
dsp/devicesamplesink.cpp dsp/devicesamplesink.cpp
dsp/devicesamplemimo.cpp dsp/devicesamplemimo.cpp
dsp/devicesamplestatic.cpp dsp/devicesamplestatic.cpp
dsp/spectrummarkers.cpp
dsp/spectrumvis.cpp dsp/spectrumvis.cpp
dsp/wavfilerecord.cpp dsp/wavfilerecord.cpp
@ -299,6 +300,7 @@ set(sdrbase_HEADERS
dsp/gfft.h dsp/gfft.h
dsp/glscopesettings.h dsp/glscopesettings.h
dsp/glspectruminterface.h dsp/glspectruminterface.h
dsp/spectrummarkers.h
dsp/spectrumsettings.h dsp/spectrumsettings.h
dsp/goertzel.h dsp/goertzel.h
dsp/hbfilterchainconverter.h dsp/hbfilterchainconverter.h

View File

@ -48,8 +48,12 @@ bool SpectrumHistogramMarker::deserialize(const QByteArray& data)
if (d.getVersion() == 1) if (d.getVersion() == 1)
{ {
int tmp;
d.readFloat(1, &m_frequency, 0); d.readFloat(1, &m_frequency, 0);
d.readFloat(2, &m_power, 0); d.readFloat(2, &m_power, 0);
d.readS32(3, &tmp, 0);
m_markerType = (SpectrumMarkerType) tmp;
int r, g, b; int r, g, b;
d.readS32(4, &r, 255); d.readS32(4, &r, 255);
d.readS32(5, &g, 255); d.readS32(5, &g, 255);

View File

@ -27,7 +27,7 @@
#include "export.h" #include "export.h"
struct SDRGUI_API SpectrumHistogramMarker struct SDRBASE_API SpectrumHistogramMarker
{ {
enum SpectrumMarkerType enum SpectrumMarkerType
{ {
@ -104,7 +104,7 @@ struct SDRGUI_API SpectrumHistogramMarker
bool deserialize(const QByteArray& data); bool deserialize(const QByteArray& data);
}; };
struct SDRGUI_API SpectrumWaterfallMarker struct SDRBASE_API SpectrumWaterfallMarker
{ {
QPointF m_point; QPointF m_point;
float m_frequency; float m_frequency;

View File

@ -66,7 +66,6 @@ QByteArray SpectrumSettings::serialize() const
s.writeS32(3, (int) m_fftWindow); s.writeS32(3, (int) m_fftWindow);
s.writeReal(4, m_refLevel); s.writeReal(4, m_refLevel);
s.writeReal(5, m_powerRange); s.writeReal(5, m_powerRange);
s.writeS32(26, m_fpsPeriodMs);
s.writeBool(6, m_displayWaterfall); s.writeBool(6, m_displayWaterfall);
s.writeBool(7, m_invertedWaterfall); s.writeBool(7, m_invertedWaterfall);
s.writeBool(8, m_displayMaxHold); s.writeBool(8, m_displayMaxHold);
@ -86,6 +85,7 @@ QByteArray SpectrumSettings::serialize() const
s.writeU32(23, m_wsSpectrumPort); s.writeU32(23, m_wsSpectrumPort);
s.writeBool(24, m_ssb); s.writeBool(24, m_ssb);
s.writeBool(25, m_usb); s.writeBool(25, m_usb);
s.writeS32(26, m_fpsPeriodMs);
return s.final(); return s.final();
} }
@ -110,8 +110,6 @@ bool SpectrumSettings::deserialize(const QByteArray& data)
m_fftWindow = (FFTWindow::Function) tmp; m_fftWindow = (FFTWindow::Function) tmp;
d.readReal(4, &m_refLevel, 0); d.readReal(4, &m_refLevel, 0);
d.readReal(5, &m_powerRange, 100); d.readReal(5, &m_powerRange, 100);
d.readS32(26, &tmp, 50);
m_fpsPeriodMs = tmp < 5 ? 5 : tmp > 500 ? 500 : tmp;
d.readBool(6, &m_displayWaterfall, true); d.readBool(6, &m_displayWaterfall, true);
d.readBool(7, &m_invertedWaterfall, true); d.readBool(7, &m_invertedWaterfall, true);
d.readBool(8, &m_displayMaxHold, false); d.readBool(8, &m_displayMaxHold, false);
@ -135,6 +133,8 @@ bool SpectrumSettings::deserialize(const QByteArray& data)
m_wsSpectrumPort = utmp < 1024 ? 1024 : utmp > 65535 ? 65535 : utmp; m_wsSpectrumPort = utmp < 1024 ? 1024 : utmp > 65535 ? 65535 : utmp;
d.readBool(24, &m_ssb, false); d.readBool(24, &m_ssb, false);
d.readBool(25, &m_usb, true); d.readBool(25, &m_usb, true);
d.readS32(26, &tmp, 50);
m_fpsPeriodMs = tmp < 5 ? 5 : tmp > 500 ? 500 : tmp;
return true; return true;
} }

View File

@ -24,6 +24,7 @@
#include "export.h" #include "export.h"
#include "dsp/dsptypes.h" #include "dsp/dsptypes.h"
#include "dsp/fftwindow.h" #include "dsp/fftwindow.h"
#include "dsp/spectrummarkers.h"
#include "settings/serializable.h" #include "settings/serializable.h"
class SDRBASE_API SpectrumSettings : public Serializable class SDRBASE_API SpectrumSettings : public Serializable

View File

@ -59,7 +59,6 @@ set(sdrgui_SOURCES
gui/scaleengine.cpp gui/scaleengine.cpp
gui/scaledimage.cpp gui/scaledimage.cpp
gui/sdrangelsplash.cpp gui/sdrangelsplash.cpp
gui/spectrummarkers.cpp
gui/spectrummarkersdialog.cpp gui/spectrummarkersdialog.cpp
gui/tickedslider.cpp gui/tickedslider.cpp
gui/transverterbutton.cpp gui/transverterbutton.cpp
@ -149,7 +148,6 @@ set(sdrgui_HEADERS
gui/scaleengine.h gui/scaleengine.h
gui/scaledimage.h gui/scaledimage.h
gui/sdrangelsplash.h gui/sdrangelsplash.h
gui/spectrummarkers.h
gui/spectrummarkersdialog.h gui/spectrummarkersdialog.h
gui/tickedslider.h gui/tickedslider.h
gui/transverterbutton.h gui/transverterbutton.h

View File

@ -2090,6 +2090,7 @@ void GLSpectrum::updateHistogramMarkers()
m_histogramMarkers[i].m_fftBin = m_histogramMarkers[i].m_fftBin < 0 ? m_histogramMarkers[i].m_fftBin = m_histogramMarkers[i].m_fftBin < 0 ?
0 : m_histogramMarkers[i].m_fftBin > m_fftSize - 1 ? 0 : m_histogramMarkers[i].m_fftBin > m_fftSize - 1 ?
m_fftSize - 1 : m_histogramMarkers[i].m_fftBin; m_fftSize - 1 : m_histogramMarkers[i].m_fftBin;
qDebug("GLSpectrum::updateHistogramMarkers: %d: m_fftBin: %d", i, m_histogramMarkers[i].m_fftBin);
m_histogramMarkers[i].m_frequencyStr = displayScaled( m_histogramMarkers[i].m_frequencyStr = displayScaled(
m_histogramMarkers[i].m_frequency, m_histogramMarkers[i].m_frequency,
'f', 'f',

View File

@ -28,11 +28,11 @@
#include <QOpenGLVertexArrayObject> #include <QOpenGLVertexArrayObject>
#include <QMatrix4x4> #include <QMatrix4x4>
#include <QGLWidget> #include <QGLWidget>
#include "dsp/glspectruminterface.h"
#include "gui/scaleengine.h" #include "gui/scaleengine.h"
#include "gui/glshadersimple.h" #include "gui/glshadersimple.h"
#include "gui/glshadertextured.h" #include "gui/glshadertextured.h"
#include "gui/spectrummarkers.h" #include "dsp/glspectruminterface.h"
#include "dsp/spectrummarkers.h"
#include "dsp/channelmarker.h" #include "dsp/channelmarker.h"
#include "dsp/spectrumsettings.h" #include "dsp/spectrumsettings.h"
#include "export.h" #include "export.h"

View File

@ -92,7 +92,6 @@ void GLSpectrumGUI::resetToDefaults()
QByteArray GLSpectrumGUI::serialize() const QByteArray GLSpectrumGUI::serialize() const
{ {
qDebug("GLSpectrumGUI::serialize: %p", m_glSpectrum);
return m_settings.serialize(); return m_settings.serialize();
} }

View File

@ -23,7 +23,7 @@
#include <QList> #include <QList>
#include "dsp/spectrumsettings.h" #include "dsp/spectrumsettings.h"
#include "gui/spectrummarkers.h" #include "dsp/spectrummarkers.h"
#include "export.h" #include "export.h"
namespace Ui { namespace Ui {