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
SSBDemodGUI Class Reference

#include <ssbdemodgui.h>

+ Inheritance diagram for SSBDemodGUI:
+ Collaboration diagram for SSBDemodGUI:

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 SSBDemodGUIcreate (PluginAPI *pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel)
 

Private Slots

void on_deltaFrequency_changed (qint64 value)
 
void on_audioBinaural_toggled (bool binaural)
 
void on_audioFlipChannels_toggled (bool flip)
 
void on_dsb_toggled (bool dsb)
 
void on_BW_valueChanged (int value)
 
void on_lowCut_valueChanged (int value)
 
void on_volume_valueChanged (int value)
 
void on_agc_toggled (bool checked)
 
void on_agcClamping_toggled (bool checked)
 
void on_agcTimeLog2_valueChanged (int value)
 
void on_agcPowerThreshold_valueChanged (int value)
 
void on_agcThresholdGate_valueChanged (int value)
 
void on_audioMute_toggled (bool checked)
 
void on_spanLog2_valueChanged (int value)
 
void on_flipSidebands_clicked (bool checked)
 
void onWidgetRolled (QWidget *widget, bool rollDown)
 
void onMenuDialogCalled (const QPoint &p)
 
void handleInputMessages ()
 
void audioSelect ()
 
void tick ()
 

Private Member Functions

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

Private Attributes

Ui::SSBDemodGUI * ui
 
PluginAPIm_pluginAPI
 
DeviceUISetm_deviceUISet
 
ChannelMarker m_channelMarker
 
SSBDemodSettings m_settings
 
bool m_doApplySettings
 
int m_spectrumRate
 
bool m_audioBinaural
 
bool m_audioFlipChannels
 
bool m_audioMute
 
bool m_squelchOpen
 
uint32_t m_tickCount
 
SSBDemodm_ssbDemod
 
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 25 of file ssbdemodgui.h.

Constructor & Destructor Documentation

◆ SSBDemodGUI()

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

Definition at line 275 of file ssbdemodgui.cpp.

References DeviceUISet::addChannelMarker(), DeviceUISet::addRollupWidget(), applyBandwidths(), arg(), audioSelect(), channelMarkerChangedByCursor(), channelMarkerHighlightedByCursor(), LevelMeterSignalDB::ColorGreenAndBlue, displaySettings(), ChannelMarker::getColor(), getInputMessageQueue(), BasebandSampleSink::getInputMessageQueue(), MainWindow::getInstance(), ColorMapper::GrayGold, handleInputMessages(), SSBDemod::m_channelIdURI, m_channelMarker, m_deviceUISet, m_iconDSBLSB, m_iconDSBUSB, m_settings, SSBDemodSettings::m_spanLog2, m_spectrumRate, m_spectrumVis, m_ssbDemod, onMenuDialogCalled(), onWidgetRolled(), DeviceUISet::registerRxChannelInstance(), SDR_RX_SCALEF, ChannelMarker::setBandwidth(), ChannelMarker::setCenterFrequency(), SSBDemodSettings::setChannelMarker(), ChannelMarker::setColor(), BasebandSampleSink::setMessageQueueToGUI(), SSBDemod::setSampleSink(), SSBDemodSettings::setSpectrumGUI(), ChannelMarker::setTitle(), RollupWidget::setTitleColor(), ChannelMarker::setVisible(), tick(), ui, and RollupWidget::widgetRolled().

Referenced by create().

275  :
276  RollupWidget(parent),
277  ui(new Ui::SSBDemodGUI),
278  m_pluginAPI(pluginAPI),
279  m_deviceUISet(deviceUISet),
280  m_channelMarker(this),
281  m_doApplySettings(true),
282  m_spectrumRate(6000),
283  m_audioBinaural(false),
284  m_audioFlipChannels(false),
285  m_audioMute(false),
286  m_squelchOpen(false)
287 {
288  ui->setupUi(this);
289  setAttribute(Qt::WA_DeleteOnClose, true);
290  connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
291  connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
292 
293  m_spectrumVis = new SpectrumVis(SDR_RX_SCALEF, ui->glSpectrum);
294  m_ssbDemod = (SSBDemod*) rxChannel; //new SSBDemod(m_deviceUISet->m_deviceSourceAPI);
297 
298  CRightClickEnabler *audioMuteRightClickEnabler = new CRightClickEnabler(ui->audioMute);
299  connect(audioMuteRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(audioSelect()));
300 
301  ui->deltaFrequencyLabel->setText(QString("%1f").arg(QChar(0x94, 0x03)));
302  ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
303  ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999);
304  ui->channelPowerMeter->setColorTheme(LevelMeterSignalDB::ColorGreenAndBlue);
305 
306  ui->glSpectrum->setCenterFrequency(m_spectrumRate/2);
307  ui->glSpectrum->setSampleRate(m_spectrumRate);
308  ui->glSpectrum->setDisplayWaterfall(true);
309  ui->glSpectrum->setDisplayMaxHold(true);
310  ui->glSpectrum->setSsbSpectrum(true);
311  ui->glSpectrum->connectTimer(MainWindow::getInstance()->getMasterTimer());
312 
313  connect(&MainWindow::getInstance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick()));
314 
315  m_channelMarker.blockSignals(true);
316  m_channelMarker.setColor(Qt::green);
319  m_channelMarker.setTitle("SSB Demodulator");
320  m_channelMarker.blockSignals(false);
321  m_channelMarker.setVisible(true); // activate signal on the last setting only
322 
324 
326  m_settings.setSpectrumGUI(ui->spectrumGUI);
327 
331 
332  connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor()));
333  connect(&m_channelMarker, SIGNAL(highlightedByCursor()), this, SLOT(channelMarkerHighlightedByCursor()));
334  connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
335 
336  ui->spectrumGUI->setBuddies(m_spectrumVis->getInputMessageQueue(), m_spectrumVis, ui->glSpectrum);
337 
338  m_iconDSBUSB.addPixmap(QPixmap("://dsb.png"), QIcon::Normal, QIcon::On);
339  m_iconDSBUSB.addPixmap(QPixmap("://usb.png"), QIcon::Normal, QIcon::Off);
340  m_iconDSBLSB.addPixmap(QPixmap("://dsb.png"), QIcon::Normal, QIcon::On);
341  m_iconDSBLSB.addPixmap(QPixmap("://lsb.png"), QIcon::Normal, QIcon::Off);
342 
343  displaySettings();
344  applyBandwidths(m_settings.m_spanLog2, true); // does applySettings(true)
345 }
static MainWindow * getInstance()
Definition: mainwindow.h:73
void channelMarkerChangedByCursor()
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
PluginAPI * m_pluginAPI
Definition: ssbdemodgui.h:49
bool m_squelchOpen
Definition: ssbdemodgui.h:58
SpectrumVis * m_spectrumVis
Definition: ssbdemodgui.h:62
static const QString m_channelIdURI
Definition: ssbdemod.h:176
int m_spectrumRate
Definition: ssbdemodgui.h:54
void addChannelMarker(ChannelMarker *channelMarker)
Add channel marker to spectrum.
Definition: deviceuiset.cpp:72
bool m_doApplySettings
Definition: ssbdemodgui.h:53
ChannelMarker m_channelMarker
Definition: ssbdemodgui.h:51
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
#define SDR_RX_SCALEF
Definition: dsptypes.h:33
RollupWidget(QWidget *parent=NULL)
Definition: rollupwidget.cpp:7
void setSampleSink(BasebandSampleSink *sampleSink)
Definition: ssbdemod.h:100
SSBDemodSettings m_settings
Definition: ssbdemodgui.h:52
virtual void setMessageQueueToGUI(MessageQueue *queue)
void setTitleColor(const QColor &c)
void applyBandwidths(int spanLog2, bool force=false)
void handleInputMessages()
void registerRxChannelInstance(const QString &channelName, PluginInstanceGUI *pluginGUI)
Definition: deviceuiset.cpp:82
void addRollupWidget(QWidget *widget)
Add rollup widget to channel window.
Definition: deviceuiset.cpp:77
void setSpectrumGUI(Serializable *spectrumGUI)
void setColor(const QColor &color)
void displaySettings()
QIcon m_iconDSBLSB
Definition: ssbdemodgui.h:66
void setVisible(bool visible)
bool m_audioMute
Definition: ssbdemodgui.h:57
void setBandwidth(int bandwidth)
const QColor & getColor() const
Definition: channelmarker.h:64
void setTitle(const QString &title)
Ui::SSBDemodGUI * ui
Definition: ssbdemodgui.h:48
QIcon m_iconDSBUSB
Definition: ssbdemodgui.h:65
void channelMarkerHighlightedByCursor()
void setCenterFrequency(int centerFrequency)
SSBDemod * m_ssbDemod
Definition: ssbdemodgui.h:61
void onMenuDialogCalled(const QPoint &p)
void audioSelect()
void widgetRolled(QWidget *widget, bool rollDown)
bool m_audioFlipChannels
Definition: ssbdemodgui.h:56
bool m_audioBinaural
Definition: ssbdemodgui.h:55
void onWidgetRolled(QWidget *widget, bool rollDown)
DeviceUISet * m_deviceUISet
Definition: ssbdemodgui.h:50
void setChannelMarker(Serializable *channelMarker)
virtual MessageQueue * getInputMessageQueue()
Definition: ssbdemodgui.h:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~SSBDemodGUI()

SSBDemodGUI::~SSBDemodGUI ( )
privatevirtual

Definition at line 347 of file ssbdemodgui.cpp.

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

348 {
350  delete m_ssbDemod; // TODO: check this: when the GUI closes it has to delete the demodulator
351  delete m_spectrumVis;
352  delete ui;
353 }
SpectrumVis * m_spectrumVis
Definition: ssbdemodgui.h:62
void removeRxChannelInstance(PluginInstanceGUI *pluginGUI)
Definition: deviceuiset.cpp:94
Ui::SSBDemodGUI * ui
Definition: ssbdemodgui.h:48
SSBDemod * m_ssbDemod
Definition: ssbdemodgui.h:61
DeviceUISet * m_deviceUISet
Definition: ssbdemodgui.h:50
+ Here is the call graph for this function:

Member Function Documentation

◆ applyBandwidths()

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

Definition at line 384 of file ssbdemodgui.cpp.

References applySettings(), arg(), blockApplySettings(), ChannelMarker::dsb, SSBDemod::getAudioSampleRate(), SSBDemod::getInputSampleRate(), ChannelMarker::lsb, m_channelMarker, SSBDemodSettings::m_dsb, m_iconDSBLSB, m_iconDSBUSB, SSBDemodSettings::m_lowCutoff, SSBDemodSettings::m_minPowerThresholdDB, SSBDemodSettings::m_rfBandwidth, m_settings, SSBDemodSettings::m_spanLog2, m_spectrumRate, m_ssbDemod, leansdr::min(), ChannelMarker::setBandwidth(), ChannelMarker::setLowCutoff(), ChannelMarker::setSidebands(), spanLog2Limit(), ui, and ChannelMarker::usb.

Referenced by deserialize(), handleMessage(), on_BW_valueChanged(), on_dsb_toggled(), on_lowCut_valueChanged(), on_spanLog2_valueChanged(), and SSBDemodGUI().

385 {
386  spanLog2 = spanLog2Limit(spanLog2);
387  ui->spanLog2->setMaximum(5 - spanLog2Limit(1));
388  bool dsb = ui->dsb->isChecked();
389  //int spanLog2 = ui->spanLog2->value();
390  m_spectrumRate = m_ssbDemod->getAudioSampleRate() / (1<<spanLog2);
391  int bw = ui->BW->value();
392  int lw = ui->lowCut->value();
393  int bwMax = std::min(m_ssbDemod->getAudioSampleRate() / (100*(1<<spanLog2)), m_ssbDemod->getInputSampleRate()/100);
394  int tickInterval = m_spectrumRate / 1200;
395  tickInterval = tickInterval == 0 ? 1 : tickInterval;
396 
397  qDebug() << "SSBDemodGUI::applyBandwidths:"
398  << " dsb: " << dsb
399  << " spanLog2: " << spanLog2
400  << " m_spectrumRate: " << m_spectrumRate
401  << " bw: " << bw
402  << " lw: " << lw
403  << " bwMax: " << bwMax
404  << " tickInterval: " << tickInterval;
405 
406  ui->BW->setTickInterval(tickInterval);
407  ui->lowCut->setTickInterval(tickInterval);
408 
409  bw = bw < -bwMax ? -bwMax : bw > bwMax ? bwMax : bw;
410 
411  if (bw < 0) {
412  lw = lw < bw+1 ? bw+1 : lw < 0 ? lw : 0;
413  } else if (bw > 0) {
414  lw = lw > bw-1 ? bw-1 : lw < 0 ? 0 : lw;
415  } else {
416  lw = 0;
417  }
418 
419  if (dsb)
420  {
421  bw = bw < 0 ? -bw : bw;
422  lw = 0;
423  }
424 
425  QString spanStr = QString::number(bwMax/10.0, 'f', 1);
426  QString bwStr = QString::number(bw/10.0, 'f', 1);
427  QString lwStr = QString::number(lw/10.0, 'f', 1);
428 
429  if (dsb)
430  {
431  ui->BWText->setText(tr("%1%2k").arg(QChar(0xB1, 0x00)).arg(bwStr));
432  ui->spanText->setText(tr("%1%2k").arg(QChar(0xB1, 0x00)).arg(spanStr));
433  ui->scaleMinus->setText("0");
434  ui->scaleCenter->setText("");
435  ui->scalePlus->setText(tr("%1").arg(QChar(0xB1, 0x00)));
436  ui->lsbLabel->setText("");
437  ui->usbLabel->setText("");
438  ui->glSpectrum->setCenterFrequency(0);
439  ui->glSpectrum->setSampleRate(2*m_spectrumRate);
440  ui->glSpectrum->setSsbSpectrum(false);
441  ui->glSpectrum->setLsbDisplay(false);
442  }
443  else
444  {
445  ui->BWText->setText(tr("%1k").arg(bwStr));
446  ui->spanText->setText(tr("%1k").arg(spanStr));
447  ui->scaleMinus->setText("-");
448  ui->scaleCenter->setText("0");
449  ui->scalePlus->setText("+");
450  ui->lsbLabel->setText("LSB");
451  ui->usbLabel->setText("USB");
452  ui->glSpectrum->setCenterFrequency(m_spectrumRate/2);
453  ui->glSpectrum->setSampleRate(m_spectrumRate);
454  ui->glSpectrum->setSsbSpectrum(true);
455  ui->glSpectrum->setLsbDisplay(bw < 0);
456  }
457 
458  ui->lowCutText->setText(tr("%1k").arg(lwStr));
459 
460 
461  ui->BW->blockSignals(true);
462  ui->lowCut->blockSignals(true);
463 
464  ui->BW->setMaximum(bwMax);
465  ui->BW->setMinimum(dsb ? 0 : -bwMax);
466  ui->BW->setValue(bw);
467 
468  ui->lowCut->setMaximum(dsb ? 0 : bwMax);
469  ui->lowCut->setMinimum(dsb ? 0 : -bwMax);
470  ui->lowCut->setValue(lw);
471 
472  ui->lowCut->blockSignals(false);
473  ui->BW->blockSignals(false);
474 
475  ui->channelPowerMeter->setRange(SSBDemodSettings::m_minPowerThresholdDB, 0);
476 
477  m_settings.m_dsb = dsb;
478  m_settings.m_spanLog2 = spanLog2;
479  m_settings.m_rfBandwidth = bw * 100;
480  m_settings.m_lowCutoff = lw * 100;
481 
482  applySettings(force);
483 
484  bool wasBlocked = blockApplySettings(true);
485  m_channelMarker.setBandwidth(bw * 200);
487  ui->dsb->setIcon(bw < 0 ? m_iconDSBLSB: m_iconDSBUSB);
488  if (!dsb) { m_channelMarker.setLowCutoff(lw * 100); }
489  blockApplySettings(wasBlocked);
490 }
void setLowCutoff(int lowCutoff)
int spanLog2Limit(int spanLog2)
int m_spectrumRate
Definition: ssbdemodgui.h:54
static const int m_minPowerThresholdDB
void applySettings(bool force=false)
ChannelMarker m_channelMarker
Definition: ssbdemodgui.h:51
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
SSBDemodSettings m_settings
Definition: ssbdemodgui.h:52
bool blockApplySettings(bool block)
uint32_t getAudioSampleRate() const
Definition: ssbdemod.h:139
uint32_t getInputSampleRate() const
Definition: ssbdemod.h:140
QIcon m_iconDSBLSB
Definition: ssbdemodgui.h:66
void setBandwidth(int bandwidth)
Ui::SSBDemodGUI * ui
Definition: ssbdemodgui.h:48
QIcon m_iconDSBUSB
Definition: ssbdemodgui.h:65
void setSidebands(sidebands_t sidebands)
SSBDemod * m_ssbDemod
Definition: ssbdemodgui.h:61
T min(const T &x, const T &y)
Definition: framework.h:440
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applySettings()

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

Definition at line 362 of file ssbdemodgui.cpp.

References SSBDemod::MsgConfigureSSBDemod::create(), SSBDemod::MsgConfigureChannelizer::create(), SSBDemod::getAudioSampleRate(), ChannelMarker::getCenterFrequency(), BasebandSampleSink::getInputMessageQueue(), m_channelMarker, m_doApplySettings, m_settings, m_ssbDemod, and MessageQueue::push().

Referenced by applyBandwidths(), audioSelect(), channelMarkerChangedByCursor(), on_agc_toggled(), on_agcClamping_toggled(), on_agcPowerThreshold_valueChanged(), on_agcThresholdGate_valueChanged(), on_agcTimeLog2_valueChanged(), on_audioBinaural_toggled(), on_audioFlipChannels_toggled(), on_audioMute_toggled(), on_deltaFrequency_changed(), on_volume_valueChanged(), onMenuDialogCalled(), and setCenterFrequency().

363 {
364  if (m_doApplySettings)
365  {
368  m_ssbDemod->getInputMessageQueue()->push(channelConfigMsg);
369 
371  m_ssbDemod->getInputMessageQueue()->push(message);
372  }
373 }
int getCenterFrequency() const
Definition: channelmarker.h:42
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
static MsgConfigureChannelizer * create(int sampleRate, int centerFrequency)
Definition: ssbdemod.h:81
bool m_doApplySettings
Definition: ssbdemodgui.h:53
ChannelMarker m_channelMarker
Definition: ssbdemodgui.h:51
SSBDemodSettings m_settings
Definition: ssbdemodgui.h:52
uint32_t getAudioSampleRate() const
Definition: ssbdemod.h:139
static MsgConfigureSSBDemod * create(const SSBDemodSettings &settings, bool force)
Definition: ssbdemod.h:58
SSBDemod * m_ssbDemod
Definition: ssbdemodgui.h:61
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ audioSelect

void SSBDemodGUI::audioSelect ( )
privateslot

Definition at line 610 of file ssbdemodgui.cpp.

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

Referenced by SSBDemodGUI().

611 {
612  qDebug("SSBDemodGUI::audioSelect");
614  audioSelect.exec();
615 
616  if (audioSelect.m_selected)
617  {
618  m_settings.m_audioDeviceName = audioSelect.m_audioDeviceName;
619  applySettings();
620  }
621 }
void applySettings(bool force=false)
SSBDemodSettings m_settings
Definition: ssbdemodgui.h:52
static DSPEngine * instance()
Definition: dspengine.cpp:51
void audioSelect()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ blockApplySettings()

bool SSBDemodGUI::blockApplySettings ( bool  block)
private

Definition at line 355 of file ssbdemodgui.cpp.

References m_doApplySettings.

Referenced by applyBandwidths(), displaySettings(), and handleMessage().

356 {
357  bool ret = !m_doApplySettings;
358  m_doApplySettings = !block;
359  return ret;
360 }
bool m_doApplySettings
Definition: ssbdemodgui.h:53
+ Here is the caller graph for this function:

◆ channelMarkerChangedByCursor

void SSBDemodGUI::channelMarkerChangedByCursor ( )
slot

Definition at line 118 of file ssbdemodgui.cpp.

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

Referenced by SSBDemodGUI().

119 {
120  ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
122  applySettings();
123 }
int getCenterFrequency() const
Definition: channelmarker.h:42
void applySettings(bool force=false)
ChannelMarker m_channelMarker
Definition: ssbdemodgui.h:51
SSBDemodSettings m_settings
Definition: ssbdemodgui.h:52
qint32 m_inputFrequencyOffset
Ui::SSBDemodGUI * ui
Definition: ssbdemodgui.h:48
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ channelMarkerHighlightedByCursor

void SSBDemodGUI::channelMarkerHighlightedByCursor ( )
slot

Definition at line 125 of file ssbdemodgui.cpp.

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

Referenced by SSBDemodGUI().

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

◆ create()

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

Definition at line 21 of file ssbdemodgui.cpp.

References SSBDemodGUI().

Referenced by SSBPlugin::createRxChannelGUI().

22 {
23  SSBDemodGUI* gui = new SSBDemodGUI(pluginAPI, deviceUISet, rxChannel);
24  return gui;
25 }
SSBDemodGUI(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 SSBDemodGUI::deserialize ( const QByteArray &  data)
virtual

Implements PluginInstanceGUI.

Definition at line 64 of file ssbdemodgui.cpp.

References applyBandwidths(), SSBDemodSettings::deserialize(), displaySettings(), m_settings, SSBDemodSettings::m_spanLog2, and SSBDemodSettings::resetToDefaults().

65 {
66  if(m_settings.deserialize(data))
67  {
69  applyBandwidths(m_settings.m_spanLog2, true); // does applySettings(true)
70  return true;
71  }
72  else
73  {
76  applyBandwidths(m_settings.m_spanLog2, true); // does applySettings(true)
77  return false;
78  }
79 }
bool deserialize(const QByteArray &data)
SSBDemodSettings m_settings
Definition: ssbdemodgui.h:52
void applyBandwidths(int spanLog2, bool force=false)
void displaySettings()
+ Here is the call graph for this function:

◆ destroy()

void SSBDemodGUI::destroy ( )
virtual

Implements PluginInstanceGUI.

Definition at line 27 of file ssbdemodgui.cpp.

28 {
29  delete this;
30 }

◆ displayAGCPowerThreshold()

void SSBDemodGUI::displayAGCPowerThreshold ( int  value)
private

Definition at line 574 of file ssbdemodgui.cpp.

References SSBDemodSettings::m_minPowerThresholdDB, and ui.

Referenced by displaySettings(), and on_agcPowerThreshold_valueChanged().

575 {
577  {
578  ui->agcPowerThresholdText->setText("---");
579  }
580  else
581  {
582  QString s = QString::number(value, 'f', 0);
583  ui->agcPowerThresholdText->setText(s);
584  }
585 }
static const int m_minPowerThresholdDB
Ui::SSBDemodGUI * ui
Definition: ssbdemodgui.h:48
+ Here is the caller graph for this function:

◆ displayAGCThresholdGate()

void SSBDemodGUI::displayAGCThresholdGate ( int  value)
private

Definition at line 587 of file ssbdemodgui.cpp.

References ui.

Referenced by displaySettings().

588 {
589  QString s = QString::number(value, 'f', 0);
590  ui->agcThresholdGateText->setText(s);
591  int dialValue = value;
592 
593  if (value > 20) {
594  dialValue = ((value - 20) / 10) + 20;
595  }
596 
597  ui->agcThresholdGate->setValue(dialValue);
598 }
Ui::SSBDemodGUI * ui
Definition: ssbdemodgui.h:48
+ Here is the caller graph for this function:

◆ displaySettings()

void SSBDemodGUI::displaySettings ( )
private

Definition at line 492 of file ssbdemodgui.cpp.

References arg(), blockApplySettings(), displayAGCPowerThreshold(), displayAGCThresholdGate(), ChannelMarker::dsb, ChannelMarker::getCenterFrequency(), ChannelMarker::getTitle(), ChannelMarker::lsb, SSBDemodSettings::m_agc, SSBDemodSettings::m_agcClamping, SSBDemodSettings::m_agcPowerThreshold, SSBDemodSettings::m_agcThresholdGate, SSBDemodSettings::m_agcTimeLog2, SSBDemodSettings::m_audioBinaural, SSBDemodSettings::m_audioFlipChannels, SSBDemodSettings::m_audioMute, m_channelMarker, SSBDemodSettings::m_dsb, m_iconDSBLSB, m_iconDSBUSB, SSBDemodSettings::m_inputFrequencyOffset, SSBDemodSettings::m_lowCutoff, SSBDemodSettings::m_rfBandwidth, SSBDemodSettings::m_rgbColor, m_settings, SSBDemodSettings::m_spanLog2, SSBDemodSettings::m_title, SSBDemodSettings::m_volume, ChannelMarker::setBandwidth(), ChannelMarker::setCenterFrequency(), ChannelMarker::setColor(), ChannelMarker::setLowCutoff(), ChannelMarker::setSidebands(), ChannelMarker::setTitle(), RollupWidget::setTitleColor(), ui, and ChannelMarker::usb.

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

493 {
494  m_channelMarker.blockSignals(true);
499 
500  ui->flipSidebands->setEnabled(!m_settings.m_dsb);
501 
502  if (m_settings.m_dsb) {
504  } else {
505  if (m_settings.m_rfBandwidth < 0) {
507  ui->dsb->setIcon(m_iconDSBLSB);
508  } else {
510  ui->dsb->setIcon(m_iconDSBUSB);
511  }
512  }
513 
514  m_channelMarker.blockSignals(false);
515  m_channelMarker.setColor(m_settings.m_rgbColor); // activate signal on the last setting only
516 
518  setWindowTitle(m_channelMarker.getTitle());
519 
520  blockApplySettings(true);
521 
522  ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
523 
524  ui->agc->setChecked(m_settings.m_agc);
525  ui->agcClamping->setChecked(m_settings.m_agcClamping);
526  ui->audioBinaural->setChecked(m_settings.m_audioBinaural);
527  ui->audioFlipChannels->setChecked(m_settings.m_audioFlipChannels);
528  ui->audioMute->setChecked(m_settings.m_audioMute);
529  ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
530 
531  // Prevent uncontrolled triggering of applyBandwidths
532  ui->spanLog2->blockSignals(true);
533  ui->dsb->blockSignals(true);
534  ui->BW->blockSignals(true);
535 
536  ui->dsb->setChecked(m_settings.m_dsb);
537  ui->spanLog2->setValue(5 - m_settings.m_spanLog2);
538 
539  ui->BW->setValue(m_settings.m_rfBandwidth / 100.0);
540  QString s = QString::number(m_settings.m_rfBandwidth/1000.0, 'f', 1);
541 
542  if (m_settings.m_dsb)
543  {
544  ui->BWText->setText(tr("%1%2k").arg(QChar(0xB1, 0x00)).arg(s));
545  }
546  else
547  {
548  ui->BWText->setText(tr("%1k").arg(s));
549  }
550 
551  ui->spanLog2->blockSignals(false);
552  ui->dsb->blockSignals(false);
553  ui->BW->blockSignals(false);
554 
555  // The only one of the four signals triggering applyBandwidths will trigger it once only with all other values
556  // set correctly and therefore validate the settings and apply them to dependent widgets
557  ui->lowCut->setValue(m_settings.m_lowCutoff / 100.0);
558  ui->lowCutText->setText(tr("%1k").arg(m_settings.m_lowCutoff / 1000.0));
559 
560  ui->volume->setValue(m_settings.m_volume * 10.0);
561  ui->volumeText->setText(QString("%1").arg(m_settings.m_volume, 0, 'f', 1));
562 
563  ui->agcTimeLog2->setValue(m_settings.m_agcTimeLog2);
564  s = QString::number((1<<ui->agcTimeLog2->value()), 'f', 0);
565  ui->agcTimeText->setText(s);
566 
567  ui->agcPowerThreshold->setValue(m_settings.m_agcPowerThreshold);
568  displayAGCPowerThreshold(ui->agcPowerThreshold->value());
570 
571  blockApplySettings(false);
572 }
int getCenterFrequency() const
Definition: channelmarker.h:42
void setLowCutoff(int lowCutoff)
ChannelMarker m_channelMarker
Definition: ssbdemodgui.h:51
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void displayAGCPowerThreshold(int value)
SSBDemodSettings m_settings
Definition: ssbdemodgui.h:52
void setTitleColor(const QColor &c)
const QString & getTitle() const
Definition: channelmarker.h:38
bool blockApplySettings(bool block)
void displayAGCThresholdGate(int value)
qint32 m_inputFrequencyOffset
void setColor(const QColor &color)
QIcon m_iconDSBLSB
Definition: ssbdemodgui.h:66
void setBandwidth(int bandwidth)
void setTitle(const QString &title)
Ui::SSBDemodGUI * ui
Definition: ssbdemodgui.h:48
QIcon m_iconDSBUSB
Definition: ssbdemodgui.h:65
void setCenterFrequency(int centerFrequency)
void setSidebands(sidebands_t sidebands)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ enterEvent()

void SSBDemodGUI::enterEvent ( QEvent *  )
private

Definition at line 605 of file ssbdemodgui.cpp.

References m_channelMarker, and ChannelMarker::setHighlighted().

606 {
608 }
ChannelMarker m_channelMarker
Definition: ssbdemodgui.h:51
void setHighlighted(bool highlighted)
+ Here is the call graph for this function:

◆ getCenterFrequency()

qint64 SSBDemodGUI::getCenterFrequency ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 42 of file ssbdemodgui.cpp.

References ChannelMarker::getCenterFrequency(), and m_channelMarker.

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

◆ getInputMessageQueue()

virtual MessageQueue* SSBDemodGUI::getInputMessageQueue ( )
inlinevirtual

Implements PluginInstanceGUI.

Definition at line 40 of file ssbdemodgui.h.

Referenced by handleInputMessages(), and SSBDemodGUI().

40 { return &m_inputMessageQueue; }
MessageQueue m_inputMessageQueue
Definition: ssbdemodgui.h:63
+ Here is the caller graph for this function:

◆ getName()

QString SSBDemodGUI::getName ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 37 of file ssbdemodgui.cpp.

38 {
39  return objectName();
40 }

◆ handleInputMessages

void SSBDemodGUI::handleInputMessages ( )
privateslot

Definition at line 105 of file ssbdemodgui.cpp.

References getInputMessageQueue(), and handleMessage().

Referenced by SSBDemodGUI().

106 {
107  Message* message;
108 
109  while ((message = getInputMessageQueue()->pop()) != 0)
110  {
111  if (handleMessage(*message))
112  {
113  delete message;
114  }
115  }
116 }
virtual bool handleMessage(const Message &message)
Definition: ssbdemodgui.cpp:81
virtual MessageQueue * getInputMessageQueue()
Definition: ssbdemodgui.h:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleMessage()

bool SSBDemodGUI::handleMessage ( const Message message)
virtual

Implements PluginInstanceGUI.

Definition at line 81 of file ssbdemodgui.cpp.

References applyBandwidths(), blockApplySettings(), displaySettings(), SSBDemod::getAudioSampleRate(), SSBDemod::MsgConfigureSSBDemod::getSettings(), m_settings, m_ssbDemod, Message::match(), and ui.

Referenced by handleInputMessages().

82 {
84  {
85  qDebug("SSBDemodGUI::handleMessage: SSBDemod::MsgConfigureSSBDemod");
87  m_settings = cfg.getSettings();
88  blockApplySettings(true);
90  blockApplySettings(false);
91  return true;
92  }
93  else if (DSPConfigureAudio::match(message))
94  {
95  qDebug("SSBDemodGUI::handleMessage: DSPConfigureAudio: %d", m_ssbDemod->getAudioSampleRate());
96  applyBandwidths(5 - ui->spanLog2->value()); // will update spectrum details with new sample rate
97  return true;
98  }
99  else
100  {
101  return false;
102  }
103 }
SSBDemodSettings m_settings
Definition: ssbdemodgui.h:52
void applyBandwidths(int spanLog2, bool force=false)
const SSBDemodSettings & getSettings() const
Definition: ssbdemod.h:55
bool blockApplySettings(bool block)
static bool match(const Message *message)
Definition: message.cpp:45
uint32_t getAudioSampleRate() const
Definition: ssbdemod.h:139
void displaySettings()
Ui::SSBDemodGUI * ui
Definition: ssbdemodgui.h:48
SSBDemod * m_ssbDemod
Definition: ssbdemodgui.h:61
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ leaveEvent()

void SSBDemodGUI::leaveEvent ( QEvent *  )
private

Definition at line 600 of file ssbdemodgui.cpp.

References m_channelMarker, and ChannelMarker::setHighlighted().

601 {
603 }
ChannelMarker m_channelMarker
Definition: ssbdemodgui.h:51
void setHighlighted(bool highlighted)
+ Here is the call graph for this function:

◆ on_agc_toggled

void SSBDemodGUI::on_agc_toggled ( bool  checked)
privateslot

Definition at line 176 of file ssbdemodgui.cpp.

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

177 {
178  m_settings.m_agc = checked;
179  applySettings();
180 }
void applySettings(bool force=false)
SSBDemodSettings m_settings
Definition: ssbdemodgui.h:52
+ Here is the call graph for this function:

◆ on_agcClamping_toggled

void SSBDemodGUI::on_agcClamping_toggled ( bool  checked)
privateslot

Definition at line 182 of file ssbdemodgui.cpp.

References applySettings(), SSBDemodSettings::m_agcClamping, and m_settings.

183 {
184  m_settings.m_agcClamping = checked;
185  applySettings();
186 }
void applySettings(bool force=false)
SSBDemodSettings m_settings
Definition: ssbdemodgui.h:52
+ Here is the call graph for this function:

◆ on_agcPowerThreshold_valueChanged

void SSBDemodGUI::on_agcPowerThreshold_valueChanged ( int  value)
privateslot

Definition at line 196 of file ssbdemodgui.cpp.

References applySettings(), displayAGCPowerThreshold(), SSBDemodSettings::m_agcPowerThreshold, and m_settings.

197 {
200  applySettings();
201 }
void applySettings(bool force=false)
void displayAGCPowerThreshold(int value)
SSBDemodSettings m_settings
Definition: ssbdemodgui.h:52
+ Here is the call graph for this function:

◆ on_agcThresholdGate_valueChanged

void SSBDemodGUI::on_agcThresholdGate_valueChanged ( int  value)
privateslot

Definition at line 203 of file ssbdemodgui.cpp.

References applySettings(), SSBDemodSettings::m_agcThresholdGate, m_settings, and ui.

204 {
205  int agcThresholdGate = value < 20 ? value : ((value - 20) * 10) + 20;
206  QString s = QString::number(agcThresholdGate, 'f', 0);
207  ui->agcThresholdGateText->setText(s);
208  m_settings.m_agcThresholdGate = agcThresholdGate;
209  applySettings();
210 }
void applySettings(bool force=false)
SSBDemodSettings m_settings
Definition: ssbdemodgui.h:52
Ui::SSBDemodGUI * ui
Definition: ssbdemodgui.h:48
+ Here is the call graph for this function:

◆ on_agcTimeLog2_valueChanged

void SSBDemodGUI::on_agcTimeLog2_valueChanged ( int  value)
privateslot

Definition at line 188 of file ssbdemodgui.cpp.

References applySettings(), SSBDemodSettings::m_agcTimeLog2, m_settings, and ui.

189 {
190  QString s = QString::number((1<<value), 'f', 0);
191  ui->agcTimeText->setText(s);
192  m_settings.m_agcTimeLog2 = value;
193  applySettings();
194 }
void applySettings(bool force=false)
SSBDemodSettings m_settings
Definition: ssbdemodgui.h:52
Ui::SSBDemodGUI * ui
Definition: ssbdemodgui.h:48
+ Here is the call graph for this function:

◆ on_audioBinaural_toggled

void SSBDemodGUI::on_audioBinaural_toggled ( bool  binaural)
privateslot

Definition at line 130 of file ssbdemodgui.cpp.

References applySettings(), SSBDemodSettings::m_audioBinaural, m_audioBinaural, and m_settings.

131 {
132  m_audioBinaural = binaural;
133  m_settings.m_audioBinaural = binaural;
134  applySettings();
135 }
void applySettings(bool force=false)
SSBDemodSettings m_settings
Definition: ssbdemodgui.h:52
bool m_audioBinaural
Definition: ssbdemodgui.h:55
+ Here is the call graph for this function:

◆ on_audioFlipChannels_toggled

void SSBDemodGUI::on_audioFlipChannels_toggled ( bool  flip)
privateslot

Definition at line 137 of file ssbdemodgui.cpp.

References applySettings(), SSBDemodSettings::m_audioFlipChannels, m_audioFlipChannels, and m_settings.

138 {
139  m_audioFlipChannels = flip;
141  applySettings();
142 }
void applySettings(bool force=false)
SSBDemodSettings m_settings
Definition: ssbdemodgui.h:52
bool m_audioFlipChannels
Definition: ssbdemodgui.h:56
+ Here is the call graph for this function:

◆ on_audioMute_toggled

void SSBDemodGUI::on_audioMute_toggled ( bool  checked)
privateslot

Definition at line 212 of file ssbdemodgui.cpp.

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

213 {
214  m_audioMute = checked;
215  m_settings.m_audioMute = checked;
216  applySettings();
217 }
void applySettings(bool force=false)
SSBDemodSettings m_settings
Definition: ssbdemodgui.h:52
bool m_audioMute
Definition: ssbdemodgui.h:57
+ Here is the call graph for this function:

◆ on_BW_valueChanged

void SSBDemodGUI::on_BW_valueChanged ( int  value)
privateslot

Definition at line 157 of file ssbdemodgui.cpp.

References applyBandwidths(), and ui.

158 {
159  (void) value;
160  applyBandwidths(5 - ui->spanLog2->value());
161 }
void applyBandwidths(int spanLog2, bool force=false)
Ui::SSBDemodGUI * ui
Definition: ssbdemodgui.h:48
+ Here is the call graph for this function:

◆ on_deltaFrequency_changed

void SSBDemodGUI::on_deltaFrequency_changed ( qint64  value)
privateslot

Definition at line 150 of file ssbdemodgui.cpp.

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

151 {
154  applySettings();
155 }
int getCenterFrequency() const
Definition: channelmarker.h:42
void applySettings(bool force=false)
ChannelMarker m_channelMarker
Definition: ssbdemodgui.h:51
SSBDemodSettings m_settings
Definition: ssbdemodgui.h:52
qint32 m_inputFrequencyOffset
void setCenterFrequency(int centerFrequency)
+ Here is the call graph for this function:

◆ on_dsb_toggled

void SSBDemodGUI::on_dsb_toggled ( bool  dsb)
privateslot

Definition at line 144 of file ssbdemodgui.cpp.

References applyBandwidths(), and ui.

145 {
146  ui->flipSidebands->setEnabled(!dsb);
147  applyBandwidths(5 - ui->spanLog2->value());
148 }
void applyBandwidths(int spanLog2, bool force=false)
Ui::SSBDemodGUI * ui
Definition: ssbdemodgui.h:48
+ Here is the call graph for this function:

◆ on_flipSidebands_clicked

void SSBDemodGUI::on_flipSidebands_clicked ( bool  checked)
privateslot

Definition at line 228 of file ssbdemodgui.cpp.

References ui.

229 {
230  (void) checked;
231  int bwValue = ui->BW->value();
232  int lcValue = ui->lowCut->value();
233  ui->BW->setValue(-bwValue);
234  ui->lowCut->setValue(-lcValue);
235 }
Ui::SSBDemodGUI * ui
Definition: ssbdemodgui.h:48

◆ on_lowCut_valueChanged

void SSBDemodGUI::on_lowCut_valueChanged ( int  value)
privateslot

Definition at line 163 of file ssbdemodgui.cpp.

References applyBandwidths(), and ui.

164 {
165  (void) value;
166  applyBandwidths(5 - ui->spanLog2->value());
167 }
void applyBandwidths(int spanLog2, bool force=false)
Ui::SSBDemodGUI * ui
Definition: ssbdemodgui.h:48
+ Here is the call graph for this function:

◆ on_spanLog2_valueChanged

void SSBDemodGUI::on_spanLog2_valueChanged ( int  value)
privateslot

Definition at line 219 of file ssbdemodgui.cpp.

References applyBandwidths(), and ui.

220 {
221  if ((value < 0) || (value > 4)) {
222  return;
223  }
224 
225  applyBandwidths(5 - ui->spanLog2->value());
226 }
void applyBandwidths(int spanLog2, bool force=false)
Ui::SSBDemodGUI * ui
Definition: ssbdemodgui.h:48
+ Here is the call graph for this function:

◆ on_volume_valueChanged

void SSBDemodGUI::on_volume_valueChanged ( int  value)
privateslot

Definition at line 169 of file ssbdemodgui.cpp.

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

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

◆ onMenuDialogCalled

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

Definition at line 237 of file ssbdemodgui.cpp.

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

Referenced by SSBDemodGUI().

238 {
240  {
242  dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
243  dialog.setReverseAPIAddress(m_settings.m_reverseAPIAddress);
244  dialog.setReverseAPIPort(m_settings.m_reverseAPIPort);
245  dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex);
246  dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex);
247 
248  dialog.move(p);
249  dialog.exec();
250 
254  m_settings.m_useReverseAPI = dialog.useReverseAPI();
255  m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress();
256  m_settings.m_reverseAPIPort = dialog.getReverseAPIPort();
257  m_settings.m_reverseAPIDeviceIndex = dialog.getReverseAPIDeviceIndex();
258  m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex();
259 
260  setWindowTitle(m_settings.m_title);
262 
263  applySettings();
264  }
265 
267 }
int getCenterFrequency() const
Definition: channelmarker.h:42
uint16_t m_reverseAPIPort
void resetContextMenuType()
Definition: rollupwidget.h:50
void applySettings(bool force=false)
ChannelMarker m_channelMarker
Definition: ssbdemodgui.h:51
ContextMenuType m_contextMenuType
Definition: rollupwidget.h:33
SSBDemodSettings m_settings
Definition: ssbdemodgui.h:52
void setTitleColor(const QColor &c)
const QString & getTitle() const
Definition: channelmarker.h:38
uint16_t m_reverseAPIDeviceIndex
uint16_t m_reverseAPIChannelIndex
qint32 m_inputFrequencyOffset
QString m_reverseAPIAddress
const QColor & getColor() const
Definition: channelmarker.h:64
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ onWidgetRolled

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

Definition at line 269 of file ssbdemodgui.cpp.

Referenced by SSBDemodGUI().

270 {
271  (void) widget;
272  (void) rollDown;
273 }
+ Here is the caller graph for this function:

◆ resetToDefaults()

void SSBDemodGUI::resetToDefaults ( )
virtual

Implements PluginInstanceGUI.

Definition at line 54 of file ssbdemodgui.cpp.

References m_settings, and SSBDemodSettings::resetToDefaults().

55 {
57 }
SSBDemodSettings m_settings
Definition: ssbdemodgui.h:52
+ Here is the call graph for this function:

◆ serialize()

QByteArray SSBDemodGUI::serialize ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 59 of file ssbdemodgui.cpp.

References m_settings, and SSBDemodSettings::serialize().

60 {
61  return m_settings.serialize();
62 }
QByteArray serialize() const
SSBDemodSettings m_settings
Definition: ssbdemodgui.h:52
+ Here is the call graph for this function:

◆ setCenterFrequency()

void SSBDemodGUI::setCenterFrequency ( qint64  centerFrequency)
virtual

Implements PluginInstanceGUI.

Definition at line 47 of file ssbdemodgui.cpp.

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

48 {
49  m_channelMarker.setCenterFrequency(centerFrequency);
51  applySettings();
52 }
int getCenterFrequency() const
Definition: channelmarker.h:42
void applySettings(bool force=false)
ChannelMarker m_channelMarker
Definition: ssbdemodgui.h:51
SSBDemodSettings m_settings
Definition: ssbdemodgui.h:52
qint32 m_inputFrequencyOffset
void setCenterFrequency(int centerFrequency)
+ Here is the call graph for this function:

◆ setName()

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

Implements PluginInstanceGUI.

Definition at line 32 of file ssbdemodgui.cpp.

33 {
34  setObjectName(name);
35 }

◆ spanLog2Limit()

int SSBDemodGUI::spanLog2Limit ( int  spanLog2)
private

Definition at line 375 of file ssbdemodgui.cpp.

References SSBDemod::getAudioSampleRate(), SSBDemod::getInputSampleRate(), and m_ssbDemod.

Referenced by applyBandwidths().

376 {
377  while (((m_ssbDemod->getAudioSampleRate() / (1<<spanLog2)) > m_ssbDemod->getInputSampleRate()) && (spanLog2 < 4)) {
378  spanLog2++;
379  }
380 
381  return spanLog2;
382 }
uint32_t getAudioSampleRate() const
Definition: ssbdemod.h:139
uint32_t getInputSampleRate() const
Definition: ssbdemod.h:140
SSBDemod * m_ssbDemod
Definition: ssbdemodgui.h:61
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tick

void SSBDemodGUI::tick ( )
privateslot

Definition at line 623 of file ssbdemodgui.cpp.

References arg(), CalcDb::dbPower(), SSBDemod::getAudioActive(), SSBDemod::getMagSqLevels(), SSBDemodSettings::m_mminPowerThresholdDBf, m_squelchOpen, m_ssbDemod, m_tickCount, and ui.

Referenced by SSBDemodGUI().

624 {
625  double magsqAvg, magsqPeak;
626  int nbMagsqSamples;
627  m_ssbDemod->getMagSqLevels(magsqAvg, magsqPeak, nbMagsqSamples);
628  double powDbAvg = CalcDb::dbPower(magsqAvg);
629  double powDbPeak = CalcDb::dbPower(magsqPeak);
630 
631  ui->channelPowerMeter->levelChanged(
634  nbMagsqSamples);
635 
636  if (m_tickCount % 4 == 0) {
637  ui->channelPower->setText(tr("%1 dB").arg(powDbAvg, 0, 'f', 1));
638  }
639 
640  bool squelchOpen = m_ssbDemod->getAudioActive();
641 
642  if (squelchOpen != m_squelchOpen)
643  {
644  if (squelchOpen) {
645  ui->audioMute->setStyleSheet("QToolButton { background-color : green; }");
646  } else {
647  ui->audioMute->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
648  }
649 
650  m_squelchOpen = squelchOpen;
651  }
652 
653  m_tickCount++;
654 }
static double dbPower(double magsq, double floor=1e-12)
Definition: db.cpp:22
bool m_squelchOpen
Definition: ssbdemodgui.h:58
void getMagSqLevels(double &avg, double &peak, int &nbSamples)
Definition: ssbdemod.h:144
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
uint32_t m_tickCount
Definition: ssbdemodgui.h:59
bool getAudioActive() const
Definition: ssbdemod.h:142
Ui::SSBDemodGUI * ui
Definition: ssbdemodgui.h:48
static const float m_mminPowerThresholdDBf
SSBDemod * m_ssbDemod
Definition: ssbdemodgui.h:61
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_audioBinaural

bool SSBDemodGUI::m_audioBinaural
private

Definition at line 55 of file ssbdemodgui.h.

Referenced by on_audioBinaural_toggled().

◆ m_audioFlipChannels

bool SSBDemodGUI::m_audioFlipChannels
private

Definition at line 56 of file ssbdemodgui.h.

Referenced by on_audioFlipChannels_toggled().

◆ m_audioMute

bool SSBDemodGUI::m_audioMute
private

Definition at line 57 of file ssbdemodgui.h.

Referenced by on_audioMute_toggled().

◆ m_channelMarker

ChannelMarker SSBDemodGUI::m_channelMarker
private

◆ m_deviceUISet

DeviceUISet* SSBDemodGUI::m_deviceUISet
private

Definition at line 50 of file ssbdemodgui.h.

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

◆ m_doApplySettings

bool SSBDemodGUI::m_doApplySettings
private

Definition at line 53 of file ssbdemodgui.h.

Referenced by applySettings(), and blockApplySettings().

◆ m_iconDSBLSB

QIcon SSBDemodGUI::m_iconDSBLSB
private

Definition at line 66 of file ssbdemodgui.h.

Referenced by applyBandwidths(), displaySettings(), and SSBDemodGUI().

◆ m_iconDSBUSB

QIcon SSBDemodGUI::m_iconDSBUSB
private

Definition at line 65 of file ssbdemodgui.h.

Referenced by applyBandwidths(), displaySettings(), and SSBDemodGUI().

◆ m_inputMessageQueue

MessageQueue SSBDemodGUI::m_inputMessageQueue
private

Definition at line 63 of file ssbdemodgui.h.

◆ m_pluginAPI

PluginAPI* SSBDemodGUI::m_pluginAPI
private

Definition at line 49 of file ssbdemodgui.h.

◆ m_settings

SSBDemodSettings SSBDemodGUI::m_settings
private

◆ m_spectrumRate

int SSBDemodGUI::m_spectrumRate
private

Definition at line 54 of file ssbdemodgui.h.

Referenced by applyBandwidths(), and SSBDemodGUI().

◆ m_spectrumVis

SpectrumVis* SSBDemodGUI::m_spectrumVis
private

Definition at line 62 of file ssbdemodgui.h.

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

◆ m_squelchOpen

bool SSBDemodGUI::m_squelchOpen
private

Definition at line 58 of file ssbdemodgui.h.

Referenced by tick().

◆ m_ssbDemod

SSBDemod* SSBDemodGUI::m_ssbDemod
private

◆ m_tickCount

uint32_t SSBDemodGUI::m_tickCount
private

Definition at line 59 of file ssbdemodgui.h.

Referenced by tick().

◆ ui

Ui::SSBDemodGUI* SSBDemodGUI::ui
private

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