SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
Public Slots | Public Member Functions | Static Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
FreeDVDemodGUI Class Reference

#include <freedvdemodgui.h>

+ Inheritance diagram for FreeDVDemodGUI:
+ Collaboration diagram for FreeDVDemodGUI:

Public Slots

void channelMarkerChangedByCursor ()
 
void channelMarkerHighlightedByCursor ()
 

Public Member Functions

virtual void destroy ()
 
void setName (const QString &name)
 
QString getName () const
 
virtual qint64 getCenterFrequency () const
 
virtual void setCenterFrequency (qint64 centerFrequency)
 
void resetToDefaults ()
 
QByteArray serialize () const
 
bool deserialize (const QByteArray &data)
 
virtual MessageQueuegetInputMessageQueue ()
 
virtual bool handleMessage (const Message &message)
 
- Public Member Functions inherited from RollupWidget
 RollupWidget (QWidget *parent=NULL)
 
void setTitleColor (const QColor &c)
 
void setHighlighted (bool highlighted)
 
- Public Member Functions inherited from PluginInstanceGUI
 PluginInstanceGUI ()
 
virtual ~PluginInstanceGUI ()
 

Static Public Member Functions

static FreeDVDemodGUIcreate (PluginAPI *pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel)
 

Private Slots

void on_deltaFrequency_changed (qint64 value)
 
void on_reSync_clicked (bool checked)
 
void on_freeDVMode_currentIndexChanged (int index)
 
void on_volume_valueChanged (int value)
 
void on_volumeIn_valueChanged (int value)
 
void on_agc_toggled (bool checked)
 
void on_audioMute_toggled (bool checked)
 
void on_spanLog2_valueChanged (int value)
 
void onWidgetRolled (QWidget *widget, bool rollDown)
 
void onMenuDialogCalled (const QPoint &p)
 
void handleInputMessages ()
 
void audioSelect ()
 
void tick ()
 

Private Member Functions

 FreeDVDemodGUI (PluginAPI *pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget *parent=0)
 
virtual ~FreeDVDemodGUI ()
 
bool blockApplySettings (bool block)
 
void applySettings (bool force=false)
 
void applyBandwidths (int spanLog2, bool force=false)
 
void displayBandwidths (int spanLog2)
 
void displaySettings ()
 
void leaveEvent (QEvent *)
 
void enterEvent (QEvent *)
 

Private Attributes

Ui::FreeDVDemodGUI * ui
 
PluginAPIm_pluginAPI
 
DeviceUISetm_deviceUISet
 
ChannelMarker m_channelMarker
 
FreeDVDemodSettings m_settings
 
bool m_doApplySettings
 
int m_spectrumRate
 
bool m_audioBinaural
 
bool m_audioFlipChannels
 
bool m_audioMute
 
bool m_squelchOpen
 
uint32_t m_tickCount
 
FreeDVDemodm_freeDVDemod
 
SpectrumVism_spectrumVis
 
MessageQueue m_inputMessageQueue
 
QIcon m_iconDSBUSB
 
QIcon m_iconDSBLSB
 

Additional Inherited Members

- Signals inherited from RollupWidget
void widgetRolled (QWidget *widget, bool rollDown)
 
- Protected Types inherited from RollupWidget
enum  { VersionMarker = 0xff }
 
enum  ContextMenuType { ContextMenuNone, ContextMenuChannelSettings, ContextMenuStreamSettings }
 
- Protected Member Functions inherited from RollupWidget
int arrangeRollups ()
 
QByteArray saveState (int version=0) const
 
bool restoreState (const QByteArray &state, int version=0)
 
void paintEvent (QPaintEvent *)
 
int paintRollup (QWidget *rollup, int pos, QPainter *p, bool last, const QColor &frame)
 
void resizeEvent (QResizeEvent *size)
 
void mousePressEvent (QMouseEvent *event)
 
bool event (QEvent *event)
 
bool eventFilter (QObject *object, QEvent *event)
 
void resetContextMenuType ()
 
void setStreamIndicator (const QString &indicator)
 
- Protected Attributes inherited from RollupWidget
QColor m_titleColor
 
QColor m_titleTextColor
 
bool m_highlighted
 
ContextMenuType m_contextMenuType
 
QString m_streamIndicator
 

Detailed Description

Definition at line 42 of file freedvdemodgui.h.

Constructor & Destructor Documentation

◆ FreeDVDemodGUI()

FreeDVDemodGUI::FreeDVDemodGUI ( PluginAPI pluginAPI,
DeviceUISet deviceUISet,
BasebandSampleSink rxChannel,
QWidget *  parent = 0 
)
explicitprivate

Definition at line 245 of file freedvdemodgui.cpp.

References DeviceUISet::addChannelMarker(), DeviceUISet::addRollupWidget(), applyBandwidths(), arg(), audioSelect(), channelMarkerChangedByCursor(), channelMarkerHighlightedByCursor(), LevelMeterSignalDB::ColorCyanAndBlue, LevelMeterSignalDB::ColorGreenAndBlue, displaySettings(), getInputMessageQueue(), BasebandSampleSink::getInputMessageQueue(), MainWindow::getInstance(), ColorMapper::GrayGold, handleInputMessages(), FreeDVDemod::m_channelIdURI, m_channelMarker, m_deviceUISet, m_freeDVDemod, m_iconDSBLSB, m_iconDSBUSB, m_settings, m_spectrumRate, m_spectrumVis, onMenuDialogCalled(), onWidgetRolled(), DeviceUISet::registerRxChannelInstance(), resetToDefaults(), SDR_RX_SCALEF, FreeDVDemodSettings::setChannelMarker(), BasebandSampleSink::setMessageQueueToGUI(), FreeDVDemod::setSampleSink(), FreeDVDemodSettings::setSpectrumGUI(), ChannelMarker::setVisible(), tick(), ui, and RollupWidget::widgetRolled().

Referenced by create().

245  :
246  RollupWidget(parent),
247  ui(new Ui::FreeDVDemodGUI),
248  m_pluginAPI(pluginAPI),
249  m_deviceUISet(deviceUISet),
250  m_channelMarker(this),
251  m_doApplySettings(true),
252  m_spectrumRate(6000),
253  m_audioBinaural(false),
254  m_audioFlipChannels(false),
255  m_audioMute(false),
256  m_squelchOpen(false)
257 {
258  ui->setupUi(this);
259  setAttribute(Qt::WA_DeleteOnClose, true);
260  connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
261  connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
262 
263  m_spectrumVis = new SpectrumVis(SDR_RX_SCALEF, ui->glSpectrum);
264  m_freeDVDemod = (FreeDVDemod*) rxChannel;
267 
268  resetToDefaults();
269 
270  ui->glSpectrum->setCenterFrequency(m_spectrumRate/2);
271  ui->glSpectrum->setSampleRate(m_spectrumRate);
272  ui->glSpectrum->setDisplayWaterfall(true);
273  ui->glSpectrum->setDisplayMaxHold(true);
274  ui->glSpectrum->setSsbSpectrum(true);
275  ui->glSpectrum->connectTimer(MainWindow::getInstance()->getMasterTimer());
276 
277  connect(&MainWindow::getInstance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick()));
278 
279  CRightClickEnabler *audioMuteRightClickEnabler = new CRightClickEnabler(ui->audioMute);
280  connect(audioMuteRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(audioSelect()));
281 
282  ui->deltaFrequencyLabel->setText(QString("%1f").arg(QChar(0x94, 0x03)));
283  ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
284  ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999);
285  ui->channelPowerMeter->setColorTheme(LevelMeterSignalDB::ColorGreenAndBlue);
286  ui->snrMeter->setColorTheme(LevelMeterSignalDB::ColorCyanAndBlue);
287  ui->snrMeter->setRange(-10, 30);
288  ui->snrMeter->setAverageSmoothing(2);
289 
290  m_channelMarker.setVisible(true); // activate signal on the last setting only
291 
293  m_settings.setSpectrumGUI(ui->spectrumGUI);
294 
298 
299  connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor()));
300  connect(&m_channelMarker, SIGNAL(highlightedByCursor()), this, SLOT(channelMarkerHighlightedByCursor()));
301  connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
302  connect(m_freeDVDemod, SIGNAL(levelInChanged(qreal, qreal, int)), ui->volumeInMeter, SLOT(levelChanged(qreal, qreal, int)));
303 
304  ui->spectrumGUI->setBuddies(m_spectrumVis->getInputMessageQueue(), m_spectrumVis, ui->glSpectrum);
305 
306  m_iconDSBUSB.addPixmap(QPixmap("://dsb.png"), QIcon::Normal, QIcon::On);
307  m_iconDSBUSB.addPixmap(QPixmap("://usb.png"), QIcon::Normal, QIcon::Off);
308  m_iconDSBLSB.addPixmap(QPixmap("://dsb.png"), QIcon::Normal, QIcon::On);
309  m_iconDSBLSB.addPixmap(QPixmap("://lsb.png"), QIcon::Normal, QIcon::Off);
310 
311  displaySettings();
312  applyBandwidths(5 - ui->spanLog2->value(), true); // does applySettings(true)
313 }
void setChannelMarker(Serializable *channelMarker)
static MainWindow * getInstance()
Definition: mainwindow.h:73
bool m_audioFlipChannels
Ui::FreeDVDemodGUI * ui
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
SpectrumVis * m_spectrumVis
DeviceUISet * m_deviceUISet
virtual MessageQueue * getInputMessageQueue()
static const QString m_channelIdURI
Definition: freedvdemod.h:196
void applyBandwidths(int spanLog2, bool force=false)
void addChannelMarker(ChannelMarker *channelMarker)
Add channel marker to spectrum.
Definition: deviceuiset.cpp:72
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void onMenuDialogCalled(const QPoint &p)
#define SDR_RX_SCALEF
Definition: dsptypes.h:33
RollupWidget(QWidget *parent=NULL)
Definition: rollupwidget.cpp:7
void setSpectrumGUI(Serializable *spectrumGUI)
virtual void setMessageQueueToGUI(MessageQueue *queue)
void registerRxChannelInstance(const QString &channelName, PluginInstanceGUI *pluginGUI)
Definition: deviceuiset.cpp:82
void channelMarkerHighlightedByCursor()
void addRollupWidget(QWidget *widget)
Add rollup widget to channel window.
Definition: deviceuiset.cpp:77
PluginAPI * m_pluginAPI
void setSampleSink(BasebandSampleSink *sampleSink)
Definition: freedvdemod.h:115
void handleInputMessages()
void onWidgetRolled(QWidget *widget, bool rollDown)
FreeDVDemodSettings m_settings
void setVisible(bool visible)
ChannelMarker m_channelMarker
void channelMarkerChangedByCursor()
FreeDVDemod * m_freeDVDemod
void widgetRolled(QWidget *widget, bool rollDown)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~FreeDVDemodGUI()

FreeDVDemodGUI::~FreeDVDemodGUI ( )
privatevirtual

Definition at line 315 of file freedvdemodgui.cpp.

References m_deviceUISet, m_freeDVDemod, m_spectrumVis, DeviceUISet::removeRxChannelInstance(), and ui.

316 {
318  delete m_freeDVDemod; // TODO: check this: when the GUI closes it has to delete the demodulator
319  delete m_spectrumVis;
320  delete ui;
321 }
Ui::FreeDVDemodGUI * ui
SpectrumVis * m_spectrumVis
DeviceUISet * m_deviceUISet
void removeRxChannelInstance(PluginInstanceGUI *pluginGUI)
Definition: deviceuiset.cpp:94
FreeDVDemod * m_freeDVDemod
+ Here is the call graph for this function:

Member Function Documentation

◆ applyBandwidths()

void FreeDVDemodGUI::applyBandwidths ( int  spanLog2,
bool  force = false 
)
private

Definition at line 343 of file freedvdemodgui.cpp.

References applySettings(), displayBandwidths(), m_settings, and FreeDVDemodSettings::m_spanLog2.

Referenced by deserialize(), FreeDVDemodGUI(), handleMessage(), and on_spanLog2_valueChanged().

344 {
346  m_settings.m_spanLog2 = spanLog2;
347  applySettings(force);
348 }
void displayBandwidths(int spanLog2)
void applySettings(bool force=false)
FreeDVDemodSettings m_settings
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applySettings()

void FreeDVDemodGUI::applySettings ( bool  force = false)
private

Definition at line 330 of file freedvdemodgui.cpp.

References FreeDVDemod::MsgConfigureFreeDVDemod::create(), FreeDVDemod::MsgConfigureChannelizer::create(), FreeDVDemod::getAudioSampleRate(), ChannelMarker::getCenterFrequency(), BasebandSampleSink::getInputMessageQueue(), m_channelMarker, m_doApplySettings, m_freeDVDemod, m_settings, and MessageQueue::push().

Referenced by applyBandwidths(), audioSelect(), channelMarkerChangedByCursor(), on_agc_toggled(), on_audioMute_toggled(), on_deltaFrequency_changed(), on_freeDVMode_currentIndexChanged(), on_volume_valueChanged(), on_volumeIn_valueChanged(), onMenuDialogCalled(), and setCenterFrequency().

331 {
332  if (m_doApplySettings)
333  {
336  m_freeDVDemod->getInputMessageQueue()->push(channelConfigMsg);
337 
340  }
341 }
int getCenterFrequency() const
Definition: channelmarker.h:42
void push(Message *message, bool emitSignal=true)
Push message onto queue.
static MsgConfigureFreeDVDemod * create(const FreeDVDemodSettings &settings, bool force)
Definition: freedvdemod.h:60
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
static MsgConfigureChannelizer * create(int sampleRate, int centerFrequency)
Definition: freedvdemod.h:96
uint32_t getAudioSampleRate() const
Definition: freedvdemod.h:154
FreeDVDemodSettings m_settings
ChannelMarker m_channelMarker
FreeDVDemod * m_freeDVDemod
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ audioSelect

void FreeDVDemodGUI::audioSelect ( )
privateslot

Definition at line 415 of file freedvdemodgui.cpp.

References applySettings(), DSPEngine::instance(), AudioSelectDialog::m_audioDeviceName, FreeDVDemodSettings::m_audioDeviceName, AudioSelectDialog::m_selected, and m_settings.

Referenced by FreeDVDemodGUI().

416 {
417  qDebug("FreeDVDemodGUI::audioSelect");
419  audioSelect.exec();
420 
421  if (audioSelect.m_selected)
422  {
423  m_settings.m_audioDeviceName = audioSelect.m_audioDeviceName;
424  applySettings();
425  }
426 }
static DSPEngine * instance()
Definition: dspengine.cpp:51
void applySettings(bool force=false)
FreeDVDemodSettings m_settings
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ blockApplySettings()

bool FreeDVDemodGUI::blockApplySettings ( bool  block)
private

Definition at line 323 of file freedvdemodgui.cpp.

References m_doApplySettings.

Referenced by displaySettings(), and handleMessage().

324 {
325  bool ret = !m_doApplySettings;
326  m_doApplySettings = !block;
327  return ret;
328 }
+ Here is the caller graph for this function:

◆ channelMarkerChangedByCursor

void FreeDVDemodGUI::channelMarkerChangedByCursor ( )
slot

Definition at line 136 of file freedvdemodgui.cpp.

References applySettings(), ChannelMarker::getCenterFrequency(), m_channelMarker, FreeDVDemodSettings::m_inputFrequencyOffset, m_settings, and ui.

Referenced by FreeDVDemodGUI().

137 {
138  ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
140  applySettings();
141 }
int getCenterFrequency() const
Definition: channelmarker.h:42
Ui::FreeDVDemodGUI * ui
void applySettings(bool force=false)
FreeDVDemodSettings m_settings
ChannelMarker m_channelMarker
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ channelMarkerHighlightedByCursor

void FreeDVDemodGUI::channelMarkerHighlightedByCursor ( )
slot

Definition at line 143 of file freedvdemodgui.cpp.

References ChannelMarker::getHighlighted(), m_channelMarker, and RollupWidget::setHighlighted().

Referenced by FreeDVDemodGUI().

144 {
146 }
bool getHighlighted() const
Definition: channelmarker.h:61
void setHighlighted(bool highlighted)
ChannelMarker m_channelMarker
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

FreeDVDemodGUI * FreeDVDemodGUI::create ( PluginAPI pluginAPI,
DeviceUISet deviceUISet,
BasebandSampleSink rxChannel 
)
static

Definition at line 39 of file freedvdemodgui.cpp.

References FreeDVDemodGUI().

Referenced by FreeDVPlugin::createRxChannelGUI().

40 {
41  FreeDVDemodGUI* gui = new FreeDVDemodGUI(pluginAPI, deviceUISet, rxChannel);
42  return gui;
43 }
FreeDVDemodGUI(PluginAPI *pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget *parent=0)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deserialize()

bool FreeDVDemodGUI::deserialize ( const QByteArray &  data)
virtual

Implements PluginInstanceGUI.

Definition at line 82 of file freedvdemodgui.cpp.

References applyBandwidths(), FreeDVDemodSettings::deserialize(), displaySettings(), m_settings, FreeDVDemodSettings::resetToDefaults(), and ui.

83 {
84  if(m_settings.deserialize(data))
85  {
87  applyBandwidths(5 - ui->spanLog2->value(), true); // does applySettings(true)
88  return true;
89  }
90  else
91  {
94  applyBandwidths(5 - ui->spanLog2->value(), true); // does applySettings(true)
95  return false;
96  }
97 }
Ui::FreeDVDemodGUI * ui
void applyBandwidths(int spanLog2, bool force=false)
bool deserialize(const QByteArray &data)
FreeDVDemodSettings m_settings
+ Here is the call graph for this function:

◆ destroy()

void FreeDVDemodGUI::destroy ( )
virtual

Implements PluginInstanceGUI.

Definition at line 45 of file freedvdemodgui.cpp.

46 {
47  delete this;
48 }

◆ displayBandwidths()

void FreeDVDemodGUI::displayBandwidths ( int  spanLog2)
private

Definition at line 350 of file freedvdemodgui.cpp.

References arg(), FreeDVDemod::getModemSampleRate(), m_freeDVDemod, m_spectrumRate, and ui.

Referenced by applyBandwidths(), and displaySettings().

351 {
352  m_spectrumRate = m_freeDVDemod->getModemSampleRate() / (1<<spanLog2);
353  int bwMax = m_freeDVDemod->getModemSampleRate() / (100*(1<<spanLog2));
354 
355  qDebug() << "FreeDVDemodGUI::displayBandwidths:"
356  << " spanLog2: " << spanLog2
357  << " m_spectrumRate: " << m_spectrumRate
358  << " bwMax: " << bwMax;
359 
360  QString spanStr = QString::number(bwMax/10.0, 'f', 1);
361 
362  ui->spanText->setText(tr("%1k").arg(spanStr));
363  ui->glSpectrum->setCenterFrequency(m_spectrumRate/2);
364  ui->glSpectrum->setSampleRate(m_spectrumRate);
365  ui->glSpectrum->setSsbSpectrum(true);
366  ui->glSpectrum->setLsbDisplay(false);
367 }
Ui::FreeDVDemodGUI * ui
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
uint32_t getModemSampleRate() const
Definition: freedvdemod.h:155
FreeDVDemod * m_freeDVDemod
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ displaySettings()

void FreeDVDemodGUI::displaySettings ( )
private

Definition at line 369 of file freedvdemodgui.cpp.

References arg(), blockApplySettings(), displayBandwidths(), ChannelMarker::getCenterFrequency(), FreeDVDemodSettings::getHiCutoff(), FreeDVDemodSettings::getLowCutoff(), ChannelMarker::getTitle(), FreeDVDemodSettings::m_agc, FreeDVDemodSettings::m_audioMute, m_channelMarker, FreeDVDemodSettings::m_freeDVMode, FreeDVDemodSettings::m_inputFrequencyOffset, FreeDVDemodSettings::m_rgbColor, m_settings, FreeDVDemodSettings::m_spanLog2, FreeDVDemodSettings::m_title, FreeDVDemodSettings::m_volume, FreeDVDemodSettings::m_volumeIn, ChannelMarker::setBandwidth(), ChannelMarker::setCenterFrequency(), ChannelMarker::setColor(), ChannelMarker::setLowCutoff(), ChannelMarker::setSidebands(), ChannelMarker::setTitle(), RollupWidget::setTitleColor(), ui, and ChannelMarker::usb.

Referenced by deserialize(), FreeDVDemodGUI(), and handleMessage().

370 {
371  m_channelMarker.blockSignals(true);
377  m_channelMarker.blockSignals(false);
378  m_channelMarker.setColor(m_settings.m_rgbColor); // activate signal on the last setting only
379 
381  setWindowTitle(m_channelMarker.getTitle());
382 
383  blockApplySettings(true);
384 
385  ui->freeDVMode->setCurrentIndex((int) m_settings.m_freeDVMode);
386  ui->agc->setChecked(m_settings.m_agc);
387  ui->audioMute->setChecked(m_settings.m_audioMute);
388  ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
389 
390  // Prevent uncontrolled triggering of applyBandwidths
391  ui->spanLog2->blockSignals(true);
392  ui->spanLog2->setValue(5 - m_settings.m_spanLog2);
394  ui->spanLog2->blockSignals(false);
395 
396  ui->volume->setValue(m_settings.m_volume * 10.0);
397  ui->volumeText->setText(QString("%1").arg(m_settings.m_volume, 0, 'f', 1));
398 
399  ui->volumeIn->setValue(m_settings.m_volumeIn * 10.0);
400  ui->volumeInText->setText(QString("%1").arg(m_settings.m_volumeIn, 0, 'f', 1));
401 
402  blockApplySettings(false);
403 }
int getCenterFrequency() const
Definition: channelmarker.h:42
void setLowCutoff(int lowCutoff)
Ui::FreeDVDemodGUI * ui
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
bool blockApplySettings(bool block)
void displayBandwidths(int spanLog2)
void setTitleColor(const QColor &c)
const QString & getTitle() const
Definition: channelmarker.h:38
FreeDVDemodSettings m_settings
void setColor(const QColor &color)
void setBandwidth(int bandwidth)
void setTitle(const QString &title)
ChannelMarker m_channelMarker
void setCenterFrequency(int centerFrequency)
void setSidebands(sidebands_t sidebands)
static int getHiCutoff(FreeDVMode freeDVMode)
static int getLowCutoff(FreeDVMode freeDVMode)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ enterEvent()

void FreeDVDemodGUI::enterEvent ( QEvent *  )
private

Definition at line 410 of file freedvdemodgui.cpp.

References m_channelMarker, and ChannelMarker::setHighlighted().

411 {
413 }
void setHighlighted(bool highlighted)
ChannelMarker m_channelMarker
+ Here is the call graph for this function:

◆ getCenterFrequency()

qint64 FreeDVDemodGUI::getCenterFrequency ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 60 of file freedvdemodgui.cpp.

References ChannelMarker::getCenterFrequency(), and m_channelMarker.

61 {
63 }
int getCenterFrequency() const
Definition: channelmarker.h:42
ChannelMarker m_channelMarker
+ Here is the call graph for this function:

◆ getInputMessageQueue()

virtual MessageQueue* FreeDVDemodGUI::getInputMessageQueue ( )
inlinevirtual

Implements PluginInstanceGUI.

Definition at line 57 of file freedvdemodgui.h.

Referenced by FreeDVDemodGUI(), and handleInputMessages().

57 { return &m_inputMessageQueue; }
MessageQueue m_inputMessageQueue
+ Here is the caller graph for this function:

◆ getName()

QString FreeDVDemodGUI::getName ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 55 of file freedvdemodgui.cpp.

56 {
57  return objectName();
58 }

◆ handleInputMessages

void FreeDVDemodGUI::handleInputMessages ( )
privateslot

Definition at line 123 of file freedvdemodgui.cpp.

References getInputMessageQueue(), and handleMessage().

Referenced by FreeDVDemodGUI().

124 {
125  Message* message;
126 
127  while ((message = getInputMessageQueue()->pop()) != 0)
128  {
129  if (handleMessage(*message))
130  {
131  delete message;
132  }
133  }
134 }
virtual MessageQueue * getInputMessageQueue()
virtual bool handleMessage(const Message &message)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleMessage()

bool FreeDVDemodGUI::handleMessage ( const Message message)
virtual

Implements PluginInstanceGUI.

Definition at line 99 of file freedvdemodgui.cpp.

References applyBandwidths(), blockApplySettings(), displaySettings(), FreeDVDemod::getAudioSampleRate(), FreeDVDemod::MsgConfigureFreeDVDemod::getSettings(), m_freeDVDemod, m_settings, Message::match(), and ui.

Referenced by handleInputMessages().

100 {
102  {
103  qDebug("FreeDVDemodGUI::handleMessage: FreeDVDemodGUI::MsgConfigureFreeDVDemod");
105  m_settings = cfg.getSettings();
106  blockApplySettings(true);
107  displaySettings();
108  blockApplySettings(false);
109  return true;
110  }
111  else if (DSPConfigureAudio::match(message))
112  {
113  qDebug("FreeDVDemodGUI::handleMessage: DSPConfigureAudio: %d", m_freeDVDemod->getAudioSampleRate());
114  applyBandwidths(5 - ui->spanLog2->value()); // will update spectrum details with new sample rate
115  return true;
116  }
117  else
118  {
119  return false;
120  }
121 }
Ui::FreeDVDemodGUI * ui
void applyBandwidths(int spanLog2, bool force=false)
bool blockApplySettings(bool block)
const FreeDVDemodSettings & getSettings() const
Definition: freedvdemod.h:57
static bool match(const Message *message)
Definition: message.cpp:45
uint32_t getAudioSampleRate() const
Definition: freedvdemod.h:154
FreeDVDemodSettings m_settings
FreeDVDemod * m_freeDVDemod
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ leaveEvent()

void FreeDVDemodGUI::leaveEvent ( QEvent *  )
private

Definition at line 405 of file freedvdemodgui.cpp.

References m_channelMarker, and ChannelMarker::setHighlighted().

406 {
408 }
void setHighlighted(bool highlighted)
ChannelMarker m_channelMarker
+ Here is the call graph for this function:

◆ on_agc_toggled

void FreeDVDemodGUI::on_agc_toggled ( bool  checked)
privateslot

Definition at line 185 of file freedvdemodgui.cpp.

References applySettings(), FreeDVDemodSettings::m_agc, and m_settings.

186 {
187  m_settings.m_agc = checked;
188  applySettings();
189 }
void applySettings(bool force=false)
FreeDVDemodSettings m_settings
+ Here is the call graph for this function:

◆ on_audioMute_toggled

void FreeDVDemodGUI::on_audioMute_toggled ( bool  checked)
privateslot

Definition at line 191 of file freedvdemodgui.cpp.

References applySettings(), FreeDVDemodSettings::m_audioMute, m_audioMute, and m_settings.

192 {
193  m_audioMute = checked;
194  m_settings.m_audioMute = checked;
195  applySettings();
196 }
void applySettings(bool force=false)
FreeDVDemodSettings m_settings
+ Here is the call graph for this function:

◆ on_deltaFrequency_changed

void FreeDVDemodGUI::on_deltaFrequency_changed ( qint64  value)
privateslot

Definition at line 148 of file freedvdemodgui.cpp.

References applySettings(), ChannelMarker::getCenterFrequency(), m_channelMarker, FreeDVDemodSettings::m_inputFrequencyOffset, m_settings, and ChannelMarker::setCenterFrequency().

149 {
152  applySettings();
153 }
int getCenterFrequency() const
Definition: channelmarker.h:42
void applySettings(bool force=false)
FreeDVDemodSettings m_settings
ChannelMarker m_channelMarker
void setCenterFrequency(int centerFrequency)
+ Here is the call graph for this function:

◆ on_freeDVMode_currentIndexChanged

void FreeDVDemodGUI::on_freeDVMode_currentIndexChanged ( int  index)
privateslot

Definition at line 162 of file freedvdemodgui.cpp.

References applySettings(), FreeDVDemodSettings::getHiCutoff(), FreeDVDemodSettings::getLowCutoff(), m_channelMarker, FreeDVDemodSettings::m_freeDVMode, m_settings, ChannelMarker::setBandwidth(), ChannelMarker::setLowCutoff(), ChannelMarker::setSidebands(), and ChannelMarker::usb.

163 {
168  applySettings();
169 }
void setLowCutoff(int lowCutoff)
void applySettings(bool force=false)
FreeDVDemodSettings m_settings
void setBandwidth(int bandwidth)
ChannelMarker m_channelMarker
void setSidebands(sidebands_t sidebands)
static int getHiCutoff(FreeDVMode freeDVMode)
static int getLowCutoff(FreeDVMode freeDVMode)
+ Here is the call graph for this function:

◆ on_reSync_clicked

void FreeDVDemodGUI::on_reSync_clicked ( bool  checked)
privateslot

Definition at line 155 of file freedvdemodgui.cpp.

References FreeDVDemod::MsgResyncFreeDVDemod::create(), BasebandSampleSink::getInputMessageQueue(), m_freeDVDemod, and MessageQueue::push().

156 {
157  (void) checked;
160 }
static MsgResyncFreeDVDemod * create()
Definition: freedvdemod.h:80
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
FreeDVDemod * m_freeDVDemod
+ Here is the call graph for this function:

◆ on_spanLog2_valueChanged

void FreeDVDemodGUI::on_spanLog2_valueChanged ( int  value)
privateslot

Definition at line 198 of file freedvdemodgui.cpp.

References applyBandwidths(), and ui.

199 {
200  if ((value < 0) || (value > 4)) {
201  return;
202  }
203 
204  applyBandwidths(5 - ui->spanLog2->value());
205 }
Ui::FreeDVDemodGUI * ui
void applyBandwidths(int spanLog2, bool force=false)
+ Here is the call graph for this function:

◆ on_volume_valueChanged

void FreeDVDemodGUI::on_volume_valueChanged ( int  value)
privateslot

Definition at line 171 of file freedvdemodgui.cpp.

References applySettings(), arg(), m_settings, FreeDVDemodSettings::m_volume, and ui.

172 {
173  ui->volumeText->setText(QString("%1").arg(value / 10.0, 0, 'f', 1));
174  m_settings.m_volume = value / 10.0;
175  applySettings();
176 }
Ui::FreeDVDemodGUI * ui
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void applySettings(bool force=false)
FreeDVDemodSettings m_settings
+ Here is the call graph for this function:

◆ on_volumeIn_valueChanged

void FreeDVDemodGUI::on_volumeIn_valueChanged ( int  value)
privateslot

Definition at line 178 of file freedvdemodgui.cpp.

References applySettings(), arg(), m_settings, FreeDVDemodSettings::m_volumeIn, and ui.

179 {
180  ui->volumeInText->setText(QString("%1").arg(value / 10.0, 0, 'f', 1));
181  m_settings.m_volumeIn = value / 10.0;
182  applySettings();
183 }
Ui::FreeDVDemodGUI * ui
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void applySettings(bool force=false)
FreeDVDemodSettings m_settings
+ Here is the call graph for this function:

◆ onMenuDialogCalled

void FreeDVDemodGUI::onMenuDialogCalled ( const QPoint &  p)
privateslot

Definition at line 207 of file freedvdemodgui.cpp.

References applySettings(), RollupWidget::ContextMenuChannelSettings, ChannelMarker::getCenterFrequency(), ChannelMarker::getColor(), BasicChannelSettingsDialog::getReverseAPIAddress(), BasicChannelSettingsDialog::getReverseAPIChannelIndex(), BasicChannelSettingsDialog::getReverseAPIDeviceIndex(), BasicChannelSettingsDialog::getReverseAPIPort(), ChannelMarker::getTitle(), m_channelMarker, RollupWidget::m_contextMenuType, FreeDVDemodSettings::m_inputFrequencyOffset, FreeDVDemodSettings::m_reverseAPIAddress, FreeDVDemodSettings::m_reverseAPIChannelIndex, FreeDVDemodSettings::m_reverseAPIDeviceIndex, FreeDVDemodSettings::m_reverseAPIPort, FreeDVDemodSettings::m_rgbColor, m_settings, FreeDVDemodSettings::m_title, FreeDVDemodSettings::m_useReverseAPI, RollupWidget::resetContextMenuType(), BasicChannelSettingsDialog::setReverseAPIAddress(), BasicChannelSettingsDialog::setReverseAPIChannelIndex(), BasicChannelSettingsDialog::setReverseAPIDeviceIndex(), BasicChannelSettingsDialog::setReverseAPIPort(), RollupWidget::setTitleColor(), BasicChannelSettingsDialog::setUseReverseAPI(), and BasicChannelSettingsDialog::useReverseAPI().

Referenced by FreeDVDemodGUI().

208 {
210  {
212  dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
213  dialog.setReverseAPIAddress(m_settings.m_reverseAPIAddress);
214  dialog.setReverseAPIPort(m_settings.m_reverseAPIPort);
215  dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex);
216  dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex);
217 
218  dialog.move(p);
219  dialog.exec();
220 
224  m_settings.m_useReverseAPI = dialog.useReverseAPI();
225  m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress();
226  m_settings.m_reverseAPIPort = dialog.getReverseAPIPort();
227  m_settings.m_reverseAPIDeviceIndex = dialog.getReverseAPIDeviceIndex();
228  m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex();
229 
230  setWindowTitle(m_settings.m_title);
232 
233  applySettings();
234  }
235 
237 }
int getCenterFrequency() const
Definition: channelmarker.h:42
void resetContextMenuType()
Definition: rollupwidget.h:50
ContextMenuType m_contextMenuType
Definition: rollupwidget.h:33
void setTitleColor(const QColor &c)
const QString & getTitle() const
Definition: channelmarker.h:38
void applySettings(bool force=false)
FreeDVDemodSettings m_settings
const QColor & getColor() const
Definition: channelmarker.h:64
ChannelMarker m_channelMarker
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ onWidgetRolled

void FreeDVDemodGUI::onWidgetRolled ( QWidget *  widget,
bool  rollDown 
)
privateslot

Definition at line 239 of file freedvdemodgui.cpp.

Referenced by FreeDVDemodGUI().

240 {
241  (void) widget;
242  (void) rollDown;
243 }
+ Here is the caller graph for this function:

◆ resetToDefaults()

void FreeDVDemodGUI::resetToDefaults ( )
virtual

Implements PluginInstanceGUI.

Definition at line 72 of file freedvdemodgui.cpp.

References m_settings, and FreeDVDemodSettings::resetToDefaults().

Referenced by FreeDVDemodGUI().

73 {
75 }
FreeDVDemodSettings m_settings
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize()

QByteArray FreeDVDemodGUI::serialize ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 77 of file freedvdemodgui.cpp.

References m_settings, and FreeDVDemodSettings::serialize().

78 {
79  return m_settings.serialize();
80 }
FreeDVDemodSettings m_settings
QByteArray serialize() const
+ Here is the call graph for this function:

◆ setCenterFrequency()

void FreeDVDemodGUI::setCenterFrequency ( qint64  centerFrequency)
virtual

Implements PluginInstanceGUI.

Definition at line 65 of file freedvdemodgui.cpp.

References applySettings(), ChannelMarker::getCenterFrequency(), m_channelMarker, FreeDVDemodSettings::m_inputFrequencyOffset, m_settings, and ChannelMarker::setCenterFrequency().

66 {
67  m_channelMarker.setCenterFrequency(centerFrequency);
69  applySettings();
70 }
int getCenterFrequency() const
Definition: channelmarker.h:42
void applySettings(bool force=false)
FreeDVDemodSettings m_settings
ChannelMarker m_channelMarker
void setCenterFrequency(int centerFrequency)
+ Here is the call graph for this function:

◆ setName()

void FreeDVDemodGUI::setName ( const QString &  name)
virtual

Implements PluginInstanceGUI.

Definition at line 50 of file freedvdemodgui.cpp.

51 {
52  setObjectName(name);
53 }

◆ tick

void FreeDVDemodGUI::tick ( )
privateslot

Definition at line 428 of file freedvdemodgui.cpp.

References arg(), CalcDb::dbPower(), FreeDVDemod::getAudioActive(), FreeDVDemod::getBER(), FreeDVDemod::getFrequencyOffset(), FreeDVDemod::getMagSqLevels(), FreeDVDemod::getSNRLevels(), FreeDVDemod::isSync(), m_freeDVDemod, FreeDVDemodSettings::m_mminPowerThresholdDBf, m_squelchOpen, m_tickCount, and ui.

Referenced by FreeDVDemodGUI().

429 {
430  double magsqAvg, magsqPeak;
431  int nbMagsqSamples;
432  m_freeDVDemod->getMagSqLevels(magsqAvg, magsqPeak, nbMagsqSamples);
433  double powDbAvg = CalcDb::dbPower(magsqAvg);
434  double powDbPeak = CalcDb::dbPower(magsqPeak);
435 
436  ui->channelPowerMeter->levelChanged(
439  nbMagsqSamples);
440 
441  double snrAvg, snrPeak;
442  int nbSNRSamples;
443  m_freeDVDemod->getSNRLevels(snrAvg, snrPeak, nbSNRSamples);
444 
445  ui->snrMeter->levelChanged(
446  (10.0f + snrAvg) / 40.0f,
447  (10.0f + snrPeak) / 40.0f,
448  nbSNRSamples
449  );
450 
451  ui->berText->setText(tr("%1").arg(m_freeDVDemod->getBER()));
452  float freqOffset = m_freeDVDemod->getFrequencyOffset();
453  int freqOffsetInt = freqOffset < -999 ? -999 : freqOffset > 999 ? 999 : freqOffset;
454  ui->freqOffset->setText(tr("%1Hz").arg(freqOffsetInt));
455 
456  if (m_freeDVDemod->isSync()) {
457  ui->syncLabel->setStyleSheet("QLabel { background-color : green; }");
458  } else {
459  ui->syncLabel->setStyleSheet("QLabel { background:rgb(79,79,79); }");
460  }
461 
462  if (m_tickCount % 4 == 0) {
463  ui->channelPower->setText(tr("%1 dB").arg(powDbAvg, 0, 'f', 1));
464  ui->snrText->setText(tr("%1 dB").arg(snrAvg < -90 ? -90 : snrAvg > 90 ? 90 : snrAvg, 0, 'f', 1));
465  }
466 
467  bool squelchOpen = m_freeDVDemod->getAudioActive();
468 
469  if (squelchOpen != m_squelchOpen)
470  {
471  if (squelchOpen) {
472  ui->audioMute->setStyleSheet("QToolButton { background-color : green; }");
473  } else {
474  ui->audioMute->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
475  }
476 
477  m_squelchOpen = squelchOpen;
478  }
479 
480  m_tickCount++;
481 }
void getSNRLevels(double &avg, double &peak, int &nbSamples)
float getFrequencyOffset() const
Definition: freedvdemod.h:179
Ui::FreeDVDemodGUI * ui
static double dbPower(double magsq, double floor=1e-12)
Definition: db.cpp:22
bool getAudioActive() const
Definition: freedvdemod.h:157
int getBER() const
Definition: freedvdemod.h:178
void getMagSqLevels(double &avg, double &peak, int &nbSamples)
Definition: freedvdemod.h:159
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
uint32_t m_tickCount
static const float m_mminPowerThresholdDBf
bool isSync() const
Definition: freedvdemod.h:180
FreeDVDemod * m_freeDVDemod
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_audioBinaural

bool FreeDVDemodGUI::m_audioBinaural
private

Definition at line 72 of file freedvdemodgui.h.

◆ m_audioFlipChannels

bool FreeDVDemodGUI::m_audioFlipChannels
private

Definition at line 73 of file freedvdemodgui.h.

◆ m_audioMute

bool FreeDVDemodGUI::m_audioMute
private

Definition at line 74 of file freedvdemodgui.h.

Referenced by on_audioMute_toggled().

◆ m_channelMarker

ChannelMarker FreeDVDemodGUI::m_channelMarker
private

◆ m_deviceUISet

DeviceUISet* FreeDVDemodGUI::m_deviceUISet
private

Definition at line 67 of file freedvdemodgui.h.

Referenced by FreeDVDemodGUI(), and ~FreeDVDemodGUI().

◆ m_doApplySettings

bool FreeDVDemodGUI::m_doApplySettings
private

Definition at line 70 of file freedvdemodgui.h.

Referenced by applySettings(), and blockApplySettings().

◆ m_freeDVDemod

FreeDVDemod* FreeDVDemodGUI::m_freeDVDemod
private

◆ m_iconDSBLSB

QIcon FreeDVDemodGUI::m_iconDSBLSB
private

Definition at line 83 of file freedvdemodgui.h.

Referenced by FreeDVDemodGUI().

◆ m_iconDSBUSB

QIcon FreeDVDemodGUI::m_iconDSBUSB
private

Definition at line 82 of file freedvdemodgui.h.

Referenced by FreeDVDemodGUI().

◆ m_inputMessageQueue

MessageQueue FreeDVDemodGUI::m_inputMessageQueue
private

Definition at line 80 of file freedvdemodgui.h.

◆ m_pluginAPI

PluginAPI* FreeDVDemodGUI::m_pluginAPI
private

Definition at line 66 of file freedvdemodgui.h.

◆ m_settings

FreeDVDemodSettings FreeDVDemodGUI::m_settings
private

◆ m_spectrumRate

int FreeDVDemodGUI::m_spectrumRate
private

Definition at line 71 of file freedvdemodgui.h.

Referenced by displayBandwidths(), and FreeDVDemodGUI().

◆ m_spectrumVis

SpectrumVis* FreeDVDemodGUI::m_spectrumVis
private

Definition at line 79 of file freedvdemodgui.h.

Referenced by FreeDVDemodGUI(), and ~FreeDVDemodGUI().

◆ m_squelchOpen

bool FreeDVDemodGUI::m_squelchOpen
private

Definition at line 75 of file freedvdemodgui.h.

Referenced by tick().

◆ m_tickCount

uint32_t FreeDVDemodGUI::m_tickCount
private

Definition at line 76 of file freedvdemodgui.h.

Referenced by tick().

◆ ui

Ui::FreeDVDemodGUI* FreeDVDemodGUI::ui
private

The documentation for this class was generated from the following files: