mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-26 09:48:45 -05:00
Deep redesign: WFM demod: allocalte channel marker on demod GUI object stack
This commit is contained in:
parent
a58deec1dc
commit
fb2e601a03
@ -50,7 +50,7 @@ QString WFMDemodGUI::getName() const
|
|||||||
|
|
||||||
qint64 WFMDemodGUI::getCenterFrequency() const
|
qint64 WFMDemodGUI::getCenterFrequency() const
|
||||||
{
|
{
|
||||||
return m_channelMarker->getCenterFrequency();
|
return m_channelMarker.getCenterFrequency();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WFMDemodGUI::resetToDefaults()
|
void WFMDemodGUI::resetToDefaults()
|
||||||
@ -70,12 +70,12 @@ void WFMDemodGUI::resetToDefaults()
|
|||||||
QByteArray WFMDemodGUI::serialize() const
|
QByteArray WFMDemodGUI::serialize() const
|
||||||
{
|
{
|
||||||
SimpleSerializer s(1);
|
SimpleSerializer s(1);
|
||||||
s.writeS32(1, m_channelMarker->getCenterFrequency());
|
s.writeS32(1, m_channelMarker.getCenterFrequency());
|
||||||
s.writeS32(2, ui->rfBW->value());
|
s.writeS32(2, ui->rfBW->value());
|
||||||
s.writeS32(3, ui->afBW->value());
|
s.writeS32(3, ui->afBW->value());
|
||||||
s.writeS32(4, ui->volume->value());
|
s.writeS32(4, ui->volume->value());
|
||||||
s.writeS32(5, ui->squelch->value());
|
s.writeS32(5, ui->squelch->value());
|
||||||
s.writeU32(7, m_channelMarker->getColor().rgb());
|
s.writeU32(7, m_channelMarker.getColor().rgb());
|
||||||
return s.final();
|
return s.final();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,10 +96,10 @@ bool WFMDemodGUI::deserialize(const QByteArray& data)
|
|||||||
qint32 tmp;
|
qint32 tmp;
|
||||||
|
|
||||||
blockApplySettings(true);
|
blockApplySettings(true);
|
||||||
m_channelMarker->blockSignals(true);
|
m_channelMarker.blockSignals(true);
|
||||||
|
|
||||||
d.readS32(1, &tmp, 0);
|
d.readS32(1, &tmp, 0);
|
||||||
m_channelMarker->setCenterFrequency(tmp);
|
m_channelMarker.setCenterFrequency(tmp);
|
||||||
d.readS32(2, &tmp, 4);
|
d.readS32(2, &tmp, 4);
|
||||||
ui->rfBW->setValue(tmp);
|
ui->rfBW->setValue(tmp);
|
||||||
d.readS32(3, &tmp, 3);
|
d.readS32(3, &tmp, 3);
|
||||||
@ -111,11 +111,11 @@ bool WFMDemodGUI::deserialize(const QByteArray& data)
|
|||||||
|
|
||||||
if(d.readU32(7, &u32tmp))
|
if(d.readU32(7, &u32tmp))
|
||||||
{
|
{
|
||||||
m_channelMarker->setColor(u32tmp);
|
m_channelMarker.setColor(u32tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
blockApplySettings(false);
|
blockApplySettings(false);
|
||||||
m_channelMarker->blockSignals(false);
|
m_channelMarker.blockSignals(false);
|
||||||
|
|
||||||
applySettings();
|
applySettings();
|
||||||
return true;
|
return true;
|
||||||
@ -139,12 +139,12 @@ void WFMDemodGUI::viewChanged()
|
|||||||
|
|
||||||
void WFMDemodGUI::on_deltaMinus_clicked(bool minus)
|
void WFMDemodGUI::on_deltaMinus_clicked(bool minus)
|
||||||
{
|
{
|
||||||
int deltaFrequency = m_channelMarker->getCenterFrequency();
|
int deltaFrequency = m_channelMarker.getCenterFrequency();
|
||||||
bool minusDelta = (deltaFrequency < 0);
|
bool minusDelta = (deltaFrequency < 0);
|
||||||
|
|
||||||
if (minus ^ minusDelta) // sign change
|
if (minus ^ minusDelta) // sign change
|
||||||
{
|
{
|
||||||
m_channelMarker->setCenterFrequency(-deltaFrequency);
|
m_channelMarker.setCenterFrequency(-deltaFrequency);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -152,18 +152,18 @@ void WFMDemodGUI::on_deltaFrequency_changed(quint64 value)
|
|||||||
{
|
{
|
||||||
if (ui->deltaMinus->isChecked())
|
if (ui->deltaMinus->isChecked())
|
||||||
{
|
{
|
||||||
m_channelMarker->setCenterFrequency(-value);
|
m_channelMarker.setCenterFrequency(-value);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_channelMarker->setCenterFrequency(value);
|
m_channelMarker.setCenterFrequency(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WFMDemodGUI::on_rfBW_valueChanged(int value)
|
void WFMDemodGUI::on_rfBW_valueChanged(int value)
|
||||||
{
|
{
|
||||||
ui->rfBWText->setText(QString("%1 kHz").arg(m_rfBW[value] / 1000.0));
|
ui->rfBWText->setText(QString("%1 kHz").arg(m_rfBW[value] / 1000.0));
|
||||||
m_channelMarker->setBandwidth(m_rfBW[value]);
|
m_channelMarker.setBandwidth(m_rfBW[value]);
|
||||||
applySettings();
|
applySettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -195,7 +195,7 @@ void WFMDemodGUI::onMenuDoubleClicked()
|
|||||||
if(!m_basicSettingsShown)
|
if(!m_basicSettingsShown)
|
||||||
{
|
{
|
||||||
m_basicSettingsShown = true;
|
m_basicSettingsShown = true;
|
||||||
BasicChannelSettingsWidget* bcsw = new BasicChannelSettingsWidget(m_channelMarker, this);
|
BasicChannelSettingsWidget* bcsw = new BasicChannelSettingsWidget(&m_channelMarker, this);
|
||||||
bcsw->show();
|
bcsw->show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -204,6 +204,7 @@ WFMDemodGUI::WFMDemodGUI(PluginAPI* pluginAPI, QWidget* parent) :
|
|||||||
RollupWidget(parent),
|
RollupWidget(parent),
|
||||||
ui(new Ui::WFMDemodGUI),
|
ui(new Ui::WFMDemodGUI),
|
||||||
m_pluginAPI(pluginAPI),
|
m_pluginAPI(pluginAPI),
|
||||||
|
m_channelMarker(this),
|
||||||
m_basicSettingsShown(false)
|
m_basicSettingsShown(false)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
@ -216,13 +217,13 @@ WFMDemodGUI::WFMDemodGUI(PluginAPI* pluginAPI, QWidget* parent) :
|
|||||||
m_threadedChannelizer = new ThreadedSampleSink(m_channelizer, this);
|
m_threadedChannelizer = new ThreadedSampleSink(m_channelizer, this);
|
||||||
DSPEngine::instance()->addThreadedSink(m_threadedChannelizer);
|
DSPEngine::instance()->addThreadedSink(m_threadedChannelizer);
|
||||||
|
|
||||||
m_channelMarker = new ChannelMarker(this);
|
//m_channelMarker = new ChannelMarker(this);
|
||||||
m_channelMarker->setColor(Qt::blue);
|
m_channelMarker.setColor(Qt::blue);
|
||||||
m_channelMarker->setBandwidth(12500);
|
m_channelMarker.setBandwidth(12500);
|
||||||
m_channelMarker->setCenterFrequency(0);
|
m_channelMarker.setCenterFrequency(0);
|
||||||
m_channelMarker->setVisible(true);
|
m_channelMarker.setVisible(true);
|
||||||
connect(m_channelMarker, SIGNAL(changed()), this, SLOT(viewChanged()));
|
connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(viewChanged()));
|
||||||
m_pluginAPI->addChannelMarker(m_channelMarker);
|
m_pluginAPI->addChannelMarker(&m_channelMarker);
|
||||||
|
|
||||||
applySettings();
|
applySettings();
|
||||||
}
|
}
|
||||||
@ -234,7 +235,7 @@ WFMDemodGUI::~WFMDemodGUI()
|
|||||||
delete m_threadedChannelizer;
|
delete m_threadedChannelizer;
|
||||||
delete m_channelizer;
|
delete m_channelizer;
|
||||||
delete m_wfmDemod;
|
delete m_wfmDemod;
|
||||||
delete m_channelMarker;
|
//delete m_channelMarker;
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -247,14 +248,14 @@ void WFMDemodGUI::applySettings()
|
|||||||
{
|
{
|
||||||
if (m_doApplySettings)
|
if (m_doApplySettings)
|
||||||
{
|
{
|
||||||
setTitleColor(m_channelMarker->getColor());
|
setTitleColor(m_channelMarker.getColor());
|
||||||
|
|
||||||
m_channelizer->configure(m_channelizer->getInputMessageQueue(),
|
m_channelizer->configure(m_channelizer->getInputMessageQueue(),
|
||||||
requiredBW(m_rfBW[ui->rfBW->value()]), // TODO: this is where requested sample rate is specified
|
requiredBW(m_rfBW[ui->rfBW->value()]), // TODO: this is where requested sample rate is specified
|
||||||
m_channelMarker->getCenterFrequency());
|
m_channelMarker.getCenterFrequency());
|
||||||
|
|
||||||
ui->deltaFrequency->setValue(abs(m_channelMarker->getCenterFrequency()));
|
ui->deltaFrequency->setValue(abs(m_channelMarker.getCenterFrequency()));
|
||||||
ui->deltaMinus->setChecked(m_channelMarker->getCenterFrequency() < 0);
|
ui->deltaMinus->setChecked(m_channelMarker.getCenterFrequency() < 0);
|
||||||
|
|
||||||
m_wfmDemod->configure(m_wfmDemod->getInputMessageQueue(),
|
m_wfmDemod->configure(m_wfmDemod->getInputMessageQueue(),
|
||||||
m_rfBW[ui->rfBW->value()],
|
m_rfBW[ui->rfBW->value()],
|
||||||
@ -267,14 +268,14 @@ void WFMDemodGUI::applySettings()
|
|||||||
void WFMDemodGUI::leaveEvent(QEvent*)
|
void WFMDemodGUI::leaveEvent(QEvent*)
|
||||||
{
|
{
|
||||||
blockApplySettings(true);
|
blockApplySettings(true);
|
||||||
m_channelMarker->setHighlighted(false);
|
m_channelMarker.setHighlighted(false);
|
||||||
blockApplySettings(false);
|
blockApplySettings(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WFMDemodGUI::enterEvent(QEvent*)
|
void WFMDemodGUI::enterEvent(QEvent*)
|
||||||
{
|
{
|
||||||
blockApplySettings(true);
|
blockApplySettings(true);
|
||||||
m_channelMarker->setHighlighted(true);
|
m_channelMarker.setHighlighted(true);
|
||||||
blockApplySettings(false);
|
blockApplySettings(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
|
|
||||||
#include "gui/rollupwidget.h"
|
#include "gui/rollupwidget.h"
|
||||||
#include "plugin/plugingui.h"
|
#include "plugin/plugingui.h"
|
||||||
|
#include "dsp/channelmarker.h"
|
||||||
|
|
||||||
class PluginAPI;
|
class PluginAPI;
|
||||||
class ChannelMarker;
|
|
||||||
|
|
||||||
class ThreadedSampleSink;
|
class ThreadedSampleSink;
|
||||||
class Channelizer;
|
class Channelizer;
|
||||||
@ -46,7 +46,7 @@ private slots:
|
|||||||
private:
|
private:
|
||||||
Ui::WFMDemodGUI* ui;
|
Ui::WFMDemodGUI* ui;
|
||||||
PluginAPI* m_pluginAPI;
|
PluginAPI* m_pluginAPI;
|
||||||
ChannelMarker* m_channelMarker;
|
ChannelMarker m_channelMarker;
|
||||||
bool m_basicSettingsShown;
|
bool m_basicSettingsShown;
|
||||||
bool m_doApplySettings;
|
bool m_doApplySettings;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user