1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-04-03 10:08:30 -04:00

Websocket spectrum: adapted LoRa demod

This commit is contained in:
f4exb 2020-05-15 23:12:46 +02:00
parent 9945c6a8f8
commit 0d5ecaca9f
3 changed files with 8 additions and 5 deletions

View File

@ -35,12 +35,14 @@ const QString LoRaDemod::m_channelId = "LoRaDemod";
LoRaDemod::LoRaDemod(DeviceAPI* deviceAPI) :
ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSink),
m_deviceAPI(deviceAPI)
m_deviceAPI(deviceAPI),
m_spectrumVis(SDR_RX_SCALEF)
{
setObjectName(m_channelId);
m_thread = new QThread(this);
m_basebandSink = new LoRaDemodBaseband();
m_basebandSink->setSpectrumSink(&m_spectrumVis);
m_basebandSink->moveToThread(m_thread);
applySettings(m_settings, true);

View File

@ -22,6 +22,7 @@
#include <vector>
#include "dsp/basebandsamplesink.h"
#include "dsp/spectrumvis.h"
#include "channel/channelapi.h"
#include "util/message.h"
@ -58,7 +59,7 @@ public:
LoRaDemod(DeviceAPI* deviceAPI);
virtual ~LoRaDemod();
virtual void destroy() { delete this; }
void setSpectrumSink(BasebandSampleSink* sampleSink) { m_basebandSink->setSpectrumSink(sampleSink); }
SpectrumVis *getSpectrumVis() { return &m_spectrumVis; }
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool pO);
virtual void start();
@ -90,6 +91,7 @@ private:
QThread *m_thread;
LoRaDemodBaseband* m_basebandSink;
LoRaDemodSettings m_settings;
SpectrumVis m_spectrumVis;
int m_basebandSampleRate;
void applySettings(const LoRaDemodSettings& settings, bool force = false);

View File

@ -119,9 +119,9 @@ LoRaDemodGUI::LoRaDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb
setAttribute(Qt::WA_DeleteOnClose, true);
connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
m_spectrumVis = new SpectrumVis(SDR_RX_SCALEF, ui->glSpectrum);
m_LoRaDemod = (LoRaDemod*) rxChannel; //new LoRaDemod(m_deviceUISet->m_deviceSourceAPI);
m_LoRaDemod->setSpectrumSink(m_spectrumVis);
m_spectrumVis = m_LoRaDemod->getSpectrumVis();
m_spectrumVis->setGLSpectrum(ui->glSpectrum);
ui->glSpectrum->setCenterFrequency(16000);
ui->glSpectrum->setSampleRate(32000);
@ -150,7 +150,6 @@ LoRaDemodGUI::~LoRaDemodGUI()
{
m_deviceUISet->removeRxChannelInstance(this);
delete m_LoRaDemod; // TODO: check this: when the GUI closes it has to delete the demodulator
delete m_spectrumVis;
delete ui;
}