mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-15 04:41:55 -05:00
GLScope redesign: ScopeVis is not created in the GUI anymore
This commit is contained in:
parent
5ab495a3fb
commit
3908599463
@ -43,7 +43,6 @@ Interferometer::Interferometer(DeviceAPI *deviceAPI) :
|
||||
ChannelAPI(m_channelIdURI, ChannelAPI::StreamMIMO),
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_spectrumVis(SDR_RX_SCALEF),
|
||||
m_scopeSink(nullptr),
|
||||
m_guiMessageQueue(nullptr),
|
||||
m_frequencyOffset(0),
|
||||
m_deviceSampleRate(48000)
|
||||
@ -73,12 +72,6 @@ Interferometer::~Interferometer()
|
||||
delete m_thread;
|
||||
}
|
||||
|
||||
void Interferometer::setScopeSink(ScopeVis *scopeSink)
|
||||
{
|
||||
m_scopeSink = scopeSink;
|
||||
m_basebandSink->setScopeSink(scopeSink);
|
||||
}
|
||||
|
||||
void Interferometer::startSinks()
|
||||
{
|
||||
if (m_deviceSampleRate != 0) {
|
||||
|
@ -23,6 +23,7 @@
|
||||
|
||||
#include "dsp/mimochannel.h"
|
||||
#include "dsp/spectrumvis.h"
|
||||
#include "dsp/scopevis.h"
|
||||
#include "channel/channelapi.h"
|
||||
#include "util/messagequeue.h"
|
||||
#include "util/message.h"
|
||||
@ -34,7 +35,6 @@ class DeviceAPI;
|
||||
class InterferometerBaseband;
|
||||
class QNetworkReply;
|
||||
class QNetworkAccessManager;
|
||||
class ScopeVis;
|
||||
|
||||
class Interferometer: public MIMOChannel, public ChannelAPI
|
||||
{
|
||||
@ -121,7 +121,7 @@ public:
|
||||
MessageQueue *getMessageQueueToGUI() { return m_guiMessageQueue; }
|
||||
|
||||
SpectrumVis *getSpectrumVis() { return &m_spectrumVis; }
|
||||
void setScopeSink(ScopeVis *scopeSink);
|
||||
ScopeVis *getScopeVis() { return &m_scopeSink; }
|
||||
void applyChannelSettings(uint32_t log2Decim, uint32_t filterChainHash);
|
||||
|
||||
virtual int webapiSettingsGet(
|
||||
@ -151,8 +151,8 @@ private:
|
||||
DeviceAPI *m_deviceAPI;
|
||||
QThread *m_thread;
|
||||
SpectrumVis m_spectrumVis;
|
||||
ScopeVis m_scopeSink;
|
||||
InterferometerBaseband* m_basebandSink;
|
||||
ScopeVis* m_scopeSink;
|
||||
InterferometerSettings m_settings;
|
||||
MessageQueue m_inputMessageQueue; //!< Queue for asynchronous inbound communication
|
||||
MessageQueue *m_guiMessageQueue; //!< Input message queue to the GUI
|
||||
|
@ -110,11 +110,11 @@ InterferometerGUI::InterferometerGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUI
|
||||
connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
|
||||
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
|
||||
|
||||
m_scopeVis = new ScopeVis(ui->glScope);
|
||||
|
||||
m_interferometer = (Interferometer*) channelMIMO;
|
||||
m_spectrumVis = m_interferometer->getSpectrumVis();
|
||||
m_interferometer->setScopeSink(m_scopeVis);
|
||||
m_spectrumVis->setGLSpectrum(ui->glSpectrum);
|
||||
m_scopeVis = m_interferometer->getScopeVis();
|
||||
m_scopeVis->setGLScope(ui->glScope);
|
||||
m_interferometer->setMessageQueueToGUI(getInputMessageQueue());
|
||||
m_sampleRate = m_interferometer->getDeviceSampleRate();
|
||||
|
||||
@ -159,7 +159,6 @@ InterferometerGUI::InterferometerGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUI
|
||||
|
||||
InterferometerGUI::~InterferometerGUI()
|
||||
{
|
||||
delete m_scopeVis;
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
@ -24,6 +24,7 @@
|
||||
|
||||
#include "dsp/basebandsamplesink.h"
|
||||
#include "dsp/spectrumvis.h"
|
||||
#include "dsp/scopevis.h"
|
||||
#include "channel/channelapi.h"
|
||||
#include "util/message.h"
|
||||
#include "util/movingaverage.h"
|
||||
@ -60,6 +61,7 @@ public:
|
||||
virtual ~ChannelAnalyzer();
|
||||
virtual void destroy() { delete this; }
|
||||
SpectrumVis *getSpectrumVis() { return &m_spectrumVis; }
|
||||
ScopeVis *getScopeVis() { return &m_scopeVis; }
|
||||
void setSampleSink(BasebandSampleSink *sink) { m_basebandSink->setSampleSink(sink); }
|
||||
|
||||
int getChannelSampleRate() const { return m_basebandSink->getChannelSampleRate(); }
|
||||
@ -103,6 +105,7 @@ private:
|
||||
ChannelAnalyzerBaseband *m_basebandSink;
|
||||
ChannelAnalyzerSettings m_settings;
|
||||
SpectrumVis m_spectrumVis;
|
||||
ScopeVis m_scopeVis;
|
||||
int m_basebandSampleRate; //!< stored from device message used when starting baseband sink
|
||||
qint64 m_centerFrequency; //!< stored from device message used when starting baseband sink
|
||||
|
||||
|
@ -467,13 +467,14 @@ ChannelAnalyzerGUI::ChannelAnalyzerGUI(PluginAPI* pluginAPI, DeviceUISet *device
|
||||
ui->setupUi(this);
|
||||
setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
|
||||
m_scopeVis = new ScopeVis(ui->glScope);
|
||||
|
||||
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
|
||||
|
||||
m_channelAnalyzer = (ChannelAnalyzer*) rxChannel;
|
||||
m_spectrumVis = m_channelAnalyzer->getSpectrumVis();
|
||||
m_spectrumVis->setGLSpectrum(ui->glSpectrum);
|
||||
m_scopeVis = m_channelAnalyzer->getScopeVis();
|
||||
m_scopeVis->setGLScope(ui->glScope);
|
||||
m_spectrumScopeComboVis = new SpectrumScopeComboVis(m_spectrumVis, m_scopeVis);
|
||||
m_basebandSampleRate = m_channelAnalyzer->getChannelSampleRate();
|
||||
m_channelAnalyzer->setSampleSink(m_spectrumScopeComboVis);
|
||||
@ -529,7 +530,6 @@ ChannelAnalyzerGUI::~ChannelAnalyzerGUI()
|
||||
ui->glScope->disconnectTimer();
|
||||
delete ui;
|
||||
delete m_spectrumScopeComboVis;
|
||||
delete m_scopeVis;
|
||||
qDebug("ChannelAnalyzerGUI::~ChannelAnalyzerGUI: done");
|
||||
}
|
||||
|
||||
|
@ -186,9 +186,9 @@ bool AISDemod::handleMessage(const Message& cmd)
|
||||
}
|
||||
}
|
||||
|
||||
void AISDemod::setScopeSink(ScopeVis* scopeSink)
|
||||
ScopeVis *AISDemod::getScopeSink()
|
||||
{
|
||||
m_basebandSink->setScopeSink(scopeSink);
|
||||
return m_basebandSink->getScopeSink();
|
||||
}
|
||||
|
||||
void AISDemod::applySettings(const AISDemodSettings& settings, bool force)
|
||||
|
@ -136,7 +136,7 @@ public:
|
||||
const QStringList& channelSettingsKeys,
|
||||
SWGSDRangel::SWGChannelSettings& response);
|
||||
|
||||
void setScopeSink(ScopeVis* scopeSink);
|
||||
ScopeVis *getScopeSink();
|
||||
double getMagSq() const { return m_basebandSink->getMagSq(); }
|
||||
|
||||
void getMagSqLevels(double& avg, double& peak, int& nbSamples) {
|
||||
|
@ -33,6 +33,7 @@ AISDemodBaseband::AISDemodBaseband(AISDemod *aisDemod) :
|
||||
{
|
||||
qDebug("AISDemodBaseband::AISDemodBaseband");
|
||||
|
||||
m_sink.setScopeSink(&m_scopeSink);
|
||||
m_sampleFifo.setSize(SampleSinkFifo::getSizePolicy(48000));
|
||||
m_channelizer = new DownChannelizer(&m_sink);
|
||||
}
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include <QMutex>
|
||||
|
||||
#include "dsp/samplesinkfifo.h"
|
||||
#include "dsp/scopevis.h"
|
||||
#include "util/message.h"
|
||||
#include "util/messagequeue.h"
|
||||
|
||||
@ -72,7 +73,7 @@ public:
|
||||
}
|
||||
void setMessageQueueToChannel(MessageQueue *messageQueue) { m_sink.setMessageQueueToChannel(messageQueue); }
|
||||
void setBasebandSampleRate(int sampleRate);
|
||||
void setScopeSink(ScopeVis* scopeSink) { m_sink.setScopeSink(scopeSink); }
|
||||
ScopeVis *getScopeSink() { return &m_scopeSink; }
|
||||
void setChannel(ChannelAPI *channel);
|
||||
double getMagSq() const { return m_sink.getMagSq(); }
|
||||
bool isRunning() const { return m_running; }
|
||||
@ -83,6 +84,7 @@ private:
|
||||
AISDemodSink m_sink;
|
||||
MessageQueue m_inputMessageQueue; //!< Queue for asynchronous inbound communication
|
||||
AISDemodSettings m_settings;
|
||||
ScopeVis m_scopeSink;
|
||||
bool m_running;
|
||||
QMutex m_mutex;
|
||||
|
||||
|
@ -415,8 +415,8 @@ AISDemodGUI::AISDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
|
||||
|
||||
connect(&MainCore::instance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); // 50 ms
|
||||
|
||||
m_scopeVis = new ScopeVis(ui->glScope);
|
||||
m_aisDemod->setScopeSink(m_scopeVis);
|
||||
m_scopeVis = m_aisDemod->getScopeSink();
|
||||
m_scopeVis->setGLScope(ui->glScope);
|
||||
ui->glScope->connectTimer(MainCore::instance()->getMasterTimer());
|
||||
ui->scopeGUI->setBuddies(m_scopeVis->getInputMessageQueue(), m_scopeVis, ui->glScope);
|
||||
|
||||
|
@ -88,7 +88,7 @@ public:
|
||||
return m_settings.m_inputFrequencyOffset;
|
||||
}
|
||||
|
||||
void setScopeSink(ScopeVis* scopeSink) { m_basebandSink->setScopeSink(scopeSink); }
|
||||
ScopeVis *getScopeSink() { return m_basebandSink->getScopeSink(); }
|
||||
void setTVScreen(TVScreenAnalog *tvScreen) { m_basebandSink->setTVScreen(tvScreen); }; //!< set by the GUI
|
||||
double getMagSq() const { return m_basebandSink->getMagSq(); } //!< Beware this is scaled to 2^30
|
||||
bool getBFOLocked() { return m_basebandSink->getBFOLocked(); }
|
||||
|
@ -30,6 +30,7 @@ ATVDemodBaseband::ATVDemodBaseband() :
|
||||
m_mutex(QMutex::Recursive)
|
||||
{
|
||||
qDebug("ATVDemodBaseband::ATVDemodBaseband");
|
||||
m_sink.setScopeSink(&m_scopeSink);
|
||||
m_sampleFifo.setSize(SampleSinkFifo::getSizePolicy(48000));
|
||||
m_channelizer = new DownChannelizer(&m_sink);
|
||||
}
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include <QMutex>
|
||||
|
||||
#include "dsp/samplesinkfifo.h"
|
||||
#include "dsp/scopevis.h"
|
||||
#include "util/message.h"
|
||||
#include "util/messagequeue.h"
|
||||
|
||||
@ -65,7 +66,7 @@ public:
|
||||
MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } //!< Get the queue for asynchronous inbound communication
|
||||
int getChannelSampleRate() const;
|
||||
double getMagSq() const { return m_sink.getMagSq(); }
|
||||
void setScopeSink(ScopeVis* scopeSink) { m_sink.setScopeSink(scopeSink); }
|
||||
ScopeVis *getScopeSink() { return &m_scopeSink; }
|
||||
void setTVScreen(TVScreenAnalog *tvScreen) { m_sink.setTVScreen(tvScreen); }
|
||||
bool getBFOLocked() { return m_sink.getBFOLocked(); }
|
||||
void setVideoTabIndex(int videoTabIndex) { m_sink.setVideoTabIndex(videoTabIndex); }
|
||||
@ -78,6 +79,7 @@ private:
|
||||
ATVDemodSink m_sink;
|
||||
MessageQueue m_inputMessageQueue; //!< Queue for asynchronous inbound communication
|
||||
ATVDemodSettings m_settings;
|
||||
ScopeVis m_scopeSink;
|
||||
bool m_running;
|
||||
QMutex m_mutex;
|
||||
|
||||
|
@ -222,10 +222,10 @@ ATVDemodGUI::ATVDemodGUI(PluginAPI* objPluginAPI, DeviceUISet *deviceUISet, Base
|
||||
setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
|
||||
|
||||
m_scopeVis = new ScopeVis(ui->glScope);
|
||||
m_atvDemod = (ATVDemod*) rxChannel;
|
||||
m_atvDemod->setMessageQueueToGUI(getInputMessageQueue());
|
||||
m_atvDemod->setScopeSink(m_scopeVis);
|
||||
m_scopeVis = m_atvDemod->getScopeSink();
|
||||
m_scopeVis->setGLScope(ui->glScope);
|
||||
m_atvDemod->setTVScreen(ui->screenTV);
|
||||
|
||||
ui->glScope->connectTimer(MainCore::instance()->getMasterTimer());
|
||||
@ -276,7 +276,6 @@ ATVDemodGUI::ATVDemodGUI(PluginAPI* objPluginAPI, DeviceUISet *deviceUISet, Base
|
||||
|
||||
ATVDemodGUI::~ATVDemodGUI()
|
||||
{
|
||||
delete m_scopeVis;
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,6 @@
|
||||
class PluginAPI;
|
||||
class DeviceUISet;
|
||||
class BasebandSampleSink;
|
||||
class ScopeVis;
|
||||
class ScopeVisXY;
|
||||
class DSDDemod;
|
||||
|
||||
|
@ -607,9 +607,9 @@ uint32_t IEEE_802_15_4_Mod::getNumberOfDeviceStreams() const
|
||||
return m_deviceAPI->getNbSinkStreams();
|
||||
}
|
||||
|
||||
void IEEE_802_15_4_Mod::setScopeSink(ScopeVis* scopeSink)
|
||||
ScopeVis *IEEE_802_15_4_Mod::getScopeSink()
|
||||
{
|
||||
m_basebandSource->setScopeSink(scopeSink);
|
||||
return m_basebandSource->getScopeSink();
|
||||
}
|
||||
|
||||
void IEEE_802_15_4_Mod::openUDP(const IEEE_802_15_4_ModSettings& settings)
|
||||
|
@ -144,7 +144,7 @@ public:
|
||||
SWGSDRangel::SWGChannelSettings& response);
|
||||
|
||||
SpectrumVis *getSpectrumVis() { return &m_spectrumVis; }
|
||||
void setScopeSink(ScopeVis* scopeSink);
|
||||
ScopeVis *getScopeSink();
|
||||
double getMagSq() const;
|
||||
void setLevelMeter(QObject *levelMeter);
|
||||
uint32_t getNumberOfDeviceStreams() const;
|
||||
|
@ -32,6 +32,7 @@ IEEE_802_15_4_ModBaseband::IEEE_802_15_4_ModBaseband() :
|
||||
{
|
||||
m_sampleFifo.resize(SampleSourceFifo::getSizePolicy(48000));
|
||||
m_channelizer = new UpChannelizer(&m_source);
|
||||
m_source.setScopeSink(&m_scopeSink);
|
||||
|
||||
qDebug("IEEE_802_15_4_ModBaseband::IEEE_802_15_4_ModBaseband");
|
||||
QObject::connect(
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include <QMutex>
|
||||
|
||||
#include "dsp/samplesourcefifo.h"
|
||||
#include "dsp/scopevis.h"
|
||||
#include "util/message.h"
|
||||
#include "util/messagequeue.h"
|
||||
|
||||
@ -66,7 +67,7 @@ public:
|
||||
double getMagSq() const { return m_source.getMagSq(); }
|
||||
int getChannelSampleRate() const;
|
||||
void setSpectrumSampleSink(BasebandSampleSink* sampleSink) { m_source.setSpectrumSink(sampleSink); }
|
||||
void setScopeSink(ScopeVis* scopeSink) { m_source.setScopeSink(scopeSink); }
|
||||
ScopeVis *getScopeSink() { return &m_scopeSink; }
|
||||
|
||||
|
||||
signals:
|
||||
@ -84,6 +85,7 @@ private:
|
||||
IEEE_802_15_4_ModSource m_source;
|
||||
MessageQueue m_inputMessageQueue; //!< Queue for asynchronous inbound communication
|
||||
IEEE_802_15_4_ModSettings m_settings;
|
||||
ScopeVis m_scopeSink;
|
||||
QMutex m_mutex;
|
||||
|
||||
void processFifo(SampleVector& data, unsigned int iBegin, unsigned int iEnd);
|
||||
|
@ -359,8 +359,8 @@ IEEE_802_15_4_ModGUI::IEEE_802_15_4_ModGUI(PluginAPI* pluginAPI, DeviceUISet *de
|
||||
|
||||
connect(&MainCore::instance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick()));
|
||||
|
||||
m_scopeVis = new ScopeVis(ui->glScope);
|
||||
m_IEEE_802_15_4_Mod->setScopeSink(m_scopeVis);
|
||||
m_scopeVis = m_IEEE_802_15_4_Mod->getScopeSink();
|
||||
m_scopeVis->setGLScope(ui->glScope);
|
||||
ui->glScope->connectTimer(MainCore::instance()->getMasterTimer());
|
||||
connect(&MainCore::instance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); // 50 ms
|
||||
ui->scopeGUI->setBuddies(m_scopeVis->getInputMessageQueue(), m_scopeVis, ui->glScope);
|
||||
@ -442,7 +442,6 @@ IEEE_802_15_4_ModGUI::IEEE_802_15_4_ModGUI(PluginAPI* pluginAPI, DeviceUISet *de
|
||||
|
||||
IEEE_802_15_4_ModGUI::~IEEE_802_15_4_ModGUI()
|
||||
{
|
||||
delete m_scopeVis;
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
@ -140,9 +140,9 @@ bool AISMod::handleMessage(const Message& cmd)
|
||||
}
|
||||
}
|
||||
|
||||
void AISMod::setScopeSink(ScopeVis* scopeSink)
|
||||
ScopeVis *AISMod::getScopeSink()
|
||||
{
|
||||
m_basebandSource->setScopeSink(scopeSink);
|
||||
return m_basebandSource->getScopeSink();
|
||||
}
|
||||
|
||||
void AISMod::applySettings(const AISModSettings& settings, bool force)
|
||||
|
@ -161,7 +161,7 @@ public:
|
||||
SWGSDRangel::SWGChannelSettings& response);
|
||||
|
||||
SpectrumVis *getSpectrumVis() { return &m_spectrumVis; }
|
||||
void setScopeSink(ScopeVis* scopeSink);
|
||||
ScopeVis *getScopeSink();
|
||||
double getMagSq() const;
|
||||
void setLevelMeter(QObject *levelMeter);
|
||||
uint32_t getNumberOfDeviceStreams() const;
|
||||
|
@ -32,6 +32,7 @@ AISModBaseband::AISModBaseband() :
|
||||
{
|
||||
m_sampleFifo.resize(SampleSourceFifo::getSizePolicy(48000));
|
||||
m_channelizer = new UpChannelizer(&m_source);
|
||||
m_source.setScopeSink(&m_scopeSink);
|
||||
|
||||
qDebug("AISModBaseband::AISModBaseband");
|
||||
QObject::connect(
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include <QMutex>
|
||||
|
||||
#include "dsp/samplesourcefifo.h"
|
||||
#include "dsp/scopevis.h"
|
||||
#include "util/message.h"
|
||||
#include "util/messagequeue.h"
|
||||
|
||||
@ -67,7 +68,7 @@ public:
|
||||
double getMagSq() const { return m_source.getMagSq(); }
|
||||
int getChannelSampleRate() const;
|
||||
void setSpectrumSampleSink(BasebandSampleSink* sampleSink) { m_source.setSpectrumSink(sampleSink); }
|
||||
void setScopeSink(ScopeVis* scopeSink) { m_source.setScopeSink(scopeSink); }
|
||||
ScopeVis *getScopeSink() { return &m_scopeSink; }
|
||||
void setChannel(ChannelAPI *channel);
|
||||
|
||||
signals:
|
||||
@ -85,6 +86,7 @@ private:
|
||||
AISModSource m_source;
|
||||
MessageQueue m_inputMessageQueue; //!< Queue for asynchronous inbound communication
|
||||
AISModSettings m_settings;
|
||||
ScopeVis m_scopeSink;
|
||||
QMutex m_mutex;
|
||||
|
||||
void processFifo(SampleVector& data, unsigned int iBegin, unsigned int iEnd);
|
||||
|
@ -490,8 +490,8 @@ AISModGUI::AISModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam
|
||||
|
||||
connect(&MainCore::instance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick()));
|
||||
|
||||
m_scopeVis = new ScopeVis(ui->glScope);
|
||||
m_aisMod->setScopeSink(m_scopeVis);
|
||||
m_scopeVis = m_aisMod->getScopeSink();
|
||||
m_scopeVis->setGLScope(ui->glScope);
|
||||
ui->glScope->connectTimer(MainCore::instance()->getMasterTimer());
|
||||
ui->scopeGUI->setBuddies(m_scopeVis->getInputMessageQueue(), m_scopeVis, ui->glScope);
|
||||
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "feature/feature.h"
|
||||
#include "util/message.h"
|
||||
#include "dsp/spectrumvis.h"
|
||||
#include "dsp/scopevis.h"
|
||||
|
||||
#include "demodanalyzersettings.h"
|
||||
|
||||
@ -156,6 +157,7 @@ public:
|
||||
virtual ~DemodAnalyzer();
|
||||
virtual void destroy() { delete this; }
|
||||
SpectrumVis *getSpectrumVis() { return &m_spectrumVis; }
|
||||
ScopeVis *getScopeVis() { return &m_scopeVis; }
|
||||
void setSampleSink(BasebandSampleSink *sink);
|
||||
double getMagSqAvg() const;
|
||||
virtual bool handleMessage(const Message& cmd);
|
||||
@ -197,6 +199,7 @@ private:
|
||||
DemodAnalyzerWorker *m_worker;
|
||||
DemodAnalyzerSettings m_settings;
|
||||
SpectrumVis m_spectrumVis;
|
||||
ScopeVis m_scopeVis;
|
||||
QHash<ChannelAPI*, DemodAnalyzerSettings::AvailableChannel> m_availableChannels;
|
||||
ChannelAPI *m_selectedChannel;
|
||||
DataFifo *m_dataFifo;
|
||||
|
@ -139,10 +139,11 @@ DemodAnalyzerGUI::DemodAnalyzerGUI(PluginAPI* pluginAPI, FeatureUISet *featureUI
|
||||
setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
setChannelWidget(false);
|
||||
connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
|
||||
m_scopeVis = new ScopeVis(ui->glScope);
|
||||
|
||||
m_demodAnalyzer = reinterpret_cast<DemodAnalyzer*>(feature);
|
||||
m_demodAnalyzer->setMessageQueueToGUI(&m_inputMessageQueue);
|
||||
m_scopeVis = m_demodAnalyzer->getScopeVis();
|
||||
m_scopeVis->setGLScope(ui->glScope);
|
||||
m_spectrumVis = m_demodAnalyzer->getSpectrumVis();
|
||||
m_spectrumVis->setGLSpectrum(ui->glSpectrum);
|
||||
m_spectrumScopeComboVis = new SpectrumScopeComboVis(m_spectrumVis, m_scopeVis);
|
||||
@ -180,7 +181,6 @@ DemodAnalyzerGUI::~DemodAnalyzerGUI()
|
||||
{
|
||||
delete ui;
|
||||
delete m_spectrumScopeComboVis;
|
||||
delete m_scopeVis;
|
||||
}
|
||||
|
||||
void DemodAnalyzerGUI::blockApplySettings(bool block)
|
||||
|
@ -1,38 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2021 Edouard Griffiths, F4EXB. //
|
||||
// //
|
||||
// This program is free software; you can redistribute it and/or modify //
|
||||
// it under the terms of the GNU General Public License as published by //
|
||||
// the Free Software Foundation as version 3 of the License, or //
|
||||
// (at your option) any later version. //
|
||||
// //
|
||||
// This program is distributed in the hope that it will be useful, //
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||
// GNU General Public License V3 for more details. //
|
||||
// //
|
||||
// You should have received a copy of the GNU General Public License //
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef SDRBASE_DSP_GLSCOPEINTERFACE_H_
|
||||
#define SDRBASE_DSP_GLSCOPEINTERFACE_H_
|
||||
|
||||
#include "dsptypes.h"
|
||||
#include "scopesettings.h"
|
||||
#include "physicalunit.h"
|
||||
|
||||
class GLScopeInterface
|
||||
{
|
||||
public:
|
||||
GLScopeInterface() {}
|
||||
virtual ~GLScopeInterface() {}
|
||||
virtual void setTracesData(std::vector<ScopeSettings::TraceData>* tracesData) = 0;
|
||||
virtual void setTraces(std::vector<std::vector<float>>* traces) = 0;
|
||||
virtual void newTraces(int traceIndex, int traceSize) = 0;
|
||||
virtual void setTimeScale(float min, float max) = 0; //!< Linear horizontal scales
|
||||
virtual void setXScale(Unit::Physical unit, float min, float max) = 0; //!< Set X Scale => X for polar, Y1 for linear
|
||||
virtual void setYScale(Unit::Physical unit, float min, float max) = 0; //!< Set Y Scale => Y for polar, Y2 for linear
|
||||
};
|
||||
|
||||
#endif // SDRBASE_DSP_GLSPECTRUMINTERFACE_H_
|
@ -39,8 +39,8 @@ MESSAGE_CLASS_DEFINITION(ScopeVis::MsgScopeVisNGOneShot, Message)
|
||||
MESSAGE_CLASS_DEFINITION(ScopeVis::MsgScopeVisNGMemoryTrace, Message)
|
||||
|
||||
|
||||
ScopeVis::ScopeVis(GLScopeInterface* glScope) :
|
||||
m_glScope(glScope),
|
||||
ScopeVis::ScopeVis() :
|
||||
m_glScope(nullptr),
|
||||
m_messageQueueToGUI(nullptr),
|
||||
m_preTriggerDelay(0),
|
||||
m_livePreTriggerDelay(0),
|
||||
@ -67,7 +67,6 @@ ScopeVis::ScopeVis(GLScopeInterface* glScope) :
|
||||
{
|
||||
setObjectName("ScopeVis");
|
||||
m_traceDiscreteMemory.resize(GLScopeSettings::m_traceChunkDefaultSize); // arbitrary
|
||||
m_glScope->setTraces(&m_traces.m_tracesData, &m_traces.m_traces[0]);
|
||||
for (int i = 0; i < (int) Projector::nbProjectionTypes; i++) {
|
||||
m_projectorCache[i] = 0.0;
|
||||
}
|
||||
@ -82,6 +81,12 @@ ScopeVis::~ScopeVis()
|
||||
}
|
||||
}
|
||||
|
||||
void ScopeVis::setGLScope(GLScopeInterface* glScope)
|
||||
{
|
||||
m_glScope = glScope;
|
||||
m_glScope->setTraces(&m_traces.m_tracesData, &m_traces.m_traces[0]);
|
||||
}
|
||||
|
||||
void ScopeVis::setLiveRate(int sampleRate)
|
||||
{
|
||||
m_liveSampleRate = sampleRate;
|
||||
@ -617,11 +622,11 @@ int ScopeVis::processTraces(const SampleVector::const_iterator& cbegin, const Sa
|
||||
|
||||
float traceTime = ((float) m_traceSize) / m_sampleRate;
|
||||
|
||||
if (traceTime >= 1.0f) { // display continuously if trace time is 1 second or more
|
||||
if (m_glScope && (traceTime >= 1.0f)) { // display continuously if trace time is 1 second or more
|
||||
m_glScope->newTraces(m_traces.m_traces, m_traces.currentBufferIndex(), &m_traces.m_projectionTypes);
|
||||
}
|
||||
|
||||
if (m_nbSamples == 0) // finished
|
||||
if (m_glScope && (m_nbSamples == 0)) // finished
|
||||
{
|
||||
// display only at trace end if trace time is less than 1 second
|
||||
if (traceTime < 1.0f)
|
||||
@ -756,7 +761,11 @@ bool ScopeVis::handleMessage(const Message& message)
|
||||
if (triggerIndex == m_focusedTriggerIndex)
|
||||
{
|
||||
computeDisplayTriggerLevels();
|
||||
m_glScope->setFocusedTriggerData(m_triggerConditions[m_focusedTriggerIndex]->m_triggerData);
|
||||
|
||||
if (m_glScope) {
|
||||
m_glScope->setFocusedTriggerData(m_triggerConditions[m_focusedTriggerIndex]->m_triggerData);
|
||||
}
|
||||
|
||||
updateGLScopeDisplay();
|
||||
}
|
||||
}
|
||||
@ -797,7 +806,11 @@ bool ScopeVis::handleMessage(const Message& message)
|
||||
m_triggerConditions[triggerIndex] = nextTrigger;
|
||||
|
||||
computeDisplayTriggerLevels();
|
||||
m_glScope->setFocusedTriggerData(m_triggerConditions[m_focusedTriggerIndex]->m_triggerData);
|
||||
|
||||
if (m_glScope) {
|
||||
m_glScope->setFocusedTriggerData(m_triggerConditions[m_focusedTriggerIndex]->m_triggerData);
|
||||
}
|
||||
|
||||
updateGLScopeDisplay();
|
||||
|
||||
return true;
|
||||
@ -812,7 +825,11 @@ bool ScopeVis::handleMessage(const Message& message)
|
||||
{
|
||||
m_focusedTriggerIndex = triggerIndex;
|
||||
computeDisplayTriggerLevels();
|
||||
m_glScope->setFocusedTriggerData(m_triggerConditions[m_focusedTriggerIndex]->m_triggerData);
|
||||
|
||||
if (m_glScope) {
|
||||
m_glScope->setFocusedTriggerData(m_triggerConditions[m_focusedTriggerIndex]->m_triggerData);
|
||||
}
|
||||
|
||||
updateGLScopeDisplay();
|
||||
}
|
||||
|
||||
@ -877,7 +894,11 @@ bool ScopeVis::handleMessage(const Message& message)
|
||||
{
|
||||
m_focusedTraceIndex = traceIndex;
|
||||
computeDisplayTriggerLevels();
|
||||
m_glScope->setFocusedTraceIndex(m_focusedTraceIndex);
|
||||
|
||||
if (m_glScope) {
|
||||
m_glScope->setFocusedTraceIndex(m_focusedTraceIndex);
|
||||
}
|
||||
|
||||
updateGLScopeDisplay();
|
||||
}
|
||||
|
||||
@ -1044,6 +1065,10 @@ void ScopeVis::computeDisplayTriggerLevels()
|
||||
|
||||
void ScopeVis::updateGLScopeDisplay()
|
||||
{
|
||||
if (!m_glScope) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_currentTraceMemoryIndex > 0)
|
||||
{
|
||||
m_glScope->setConfigChanged();
|
||||
|
@ -43,9 +43,10 @@ class GLScopeInterface;
|
||||
class SDRGUI_API ScopeVis : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
ScopeVis(GLScopeInterface* glScope = nullptr);
|
||||
ScopeVis();
|
||||
virtual ~ScopeVis();
|
||||
|
||||
void setGLScope(GLScopeInterface* glScope);
|
||||
void setMessageQueueToGUI(MessageQueue* messageQueue) { m_messageQueueToGUI = messageQueue; }
|
||||
MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } //!< Get the queue for asynchronous inbound communication
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user