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

#include <amdemodgui.h>

+ Inheritance diagram for AMDemodGUI:
+ Collaboration diagram for AMDemodGUI:

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

Private Slots

void on_deltaFrequency_changed (qint64 value)
 
void on_pll_toggled (bool checked)
 
void on_ssb_toggled (bool checked)
 
void on_bandpassEnable_toggled (bool checked)
 
void on_rfBW_valueChanged (int value)
 
void on_volume_valueChanged (int value)
 
void on_squelch_valueChanged (int value)
 
void on_audioMute_toggled (bool checked)
 
void onWidgetRolled (QWidget *widget, bool rollDown)
 
void onMenuDialogCalled (const QPoint &p)
 
void handleInputMessages ()
 
void audioSelect ()
 
void samSSBSelect ()
 
void tick ()
 

Private Member Functions

 AMDemodGUI (PluginAPI *pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget *parent=0)
 
virtual ~AMDemodGUI ()
 
void blockApplySettings (bool block)
 
void applySettings (bool force=false)
 
void displaySettings ()
 
void displayStreamIndex ()
 
void leaveEvent (QEvent *)
 
void enterEvent (QEvent *)
 

Private Attributes

Ui::AMDemodGUI * ui
 
PluginAPIm_pluginAPI
 
DeviceUISetm_deviceUISet
 
ChannelMarker m_channelMarker
 
AMDemodSettings m_settings
 
bool m_doApplySettings
 
AMDemodm_amDemod
 
bool m_squelchOpen
 
bool m_samUSB
 
uint32_t m_tickCount
 
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 23 of file amdemodgui.h.

Constructor & Destructor Documentation

◆ AMDemodGUI()

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

Definition at line 251 of file amdemodgui.cpp.

References DeviceUISet::addChannelMarker(), DeviceUISet::addRollupWidget(), applySettings(), arg(), audioSelect(), channelMarkerChangedByCursor(), channelMarkerHighlightedByCursor(), LevelMeterSignalDB::ColorGreenAndBlue, displaySettings(), ChannelMarker::getColor(), getInputMessageQueue(), MainWindow::getInstance(), ColorMapper::GrayGold, handleInputMessages(), m_amDemod, AMDemod::m_channelIdURI, m_channelMarker, m_deviceUISet, m_iconDSBLSB, m_iconDSBUSB, m_settings, onMenuDialogCalled(), onWidgetRolled(), DeviceUISet::registerRxChannelInstance(), samSSBSelect(), ChannelMarker::setBandwidth(), ChannelMarker::setCenterFrequency(), AMDemodSettings::setChannelMarker(), ChannelMarker::setColor(), BasebandSampleSink::setMessageQueueToGUI(), ChannelMarker::setTitle(), RollupWidget::setTitleColor(), ChannelMarker::setVisible(), tick(), ui, and RollupWidget::widgetRolled().

Referenced by create().

251  :
252  RollupWidget(parent),
253  ui(new Ui::AMDemodGUI),
254  m_pluginAPI(pluginAPI),
255  m_deviceUISet(deviceUISet),
256  m_channelMarker(this),
257  m_doApplySettings(true),
258  m_squelchOpen(false),
259  m_samUSB(true),
260  m_tickCount(0)
261 {
262  ui->setupUi(this);
263  setAttribute(Qt::WA_DeleteOnClose, true);
264  connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
265  connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
266 
267  m_amDemod = reinterpret_cast<AMDemod*>(rxChannel); //new AMDemod(m_deviceUISet->m_deviceSourceAPI);
269 
270  connect(&MainWindow::getInstance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); // 50 ms
271 
272  CRightClickEnabler *audioMuteRightClickEnabler = new CRightClickEnabler(ui->audioMute);
273  connect(audioMuteRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(audioSelect()));
274 
275  CRightClickEnabler *samSidebandRightClickEnabler = new CRightClickEnabler(ui->ssb);
276  connect(samSidebandRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(samSSBSelect()));
277 
278  ui->deltaFrequencyLabel->setText(QString("%1f").arg(QChar(0x94, 0x03)));
279  ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
280  ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999);
281  ui->channelPowerMeter->setColorTheme(LevelMeterSignalDB::ColorGreenAndBlue);
282 
283  m_channelMarker.blockSignals(true);
284  m_channelMarker.setColor(Qt::yellow);
287  m_channelMarker.setTitle("AM Demodulator");
288  m_channelMarker.blockSignals(false);
289  m_channelMarker.setVisible(true); // activate signal on the last setting only
290 
293 
297 
298  connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor()));
299  connect(&m_channelMarker, SIGNAL(highlightedByCursor()), this, SLOT(channelMarkerHighlightedByCursor()));
300  connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
301 
302  m_iconDSBUSB.addPixmap(QPixmap("://dsb.png"), QIcon::Normal, QIcon::Off);
303  m_iconDSBUSB.addPixmap(QPixmap("://usb.png"), QIcon::Normal, QIcon::On);
304  m_iconDSBLSB.addPixmap(QPixmap("://dsb.png"), QIcon::Normal, QIcon::Off);
305  m_iconDSBLSB.addPixmap(QPixmap("://lsb.png"), QIcon::Normal, QIcon::On);
306 
307  displaySettings();
308  applySettings(true);
309 }
AMDemodSettings m_settings
Definition: amdemodgui.h:50
static MainWindow * getInstance()
Definition: mainwindow.h:73
void samSSBSelect()
Definition: amdemodgui.cpp:433
void audioSelect()
Definition: amdemodgui.cpp:420
DeviceUISet * m_deviceUISet
Definition: amdemodgui.h:48
uint32_t m_tickCount
Definition: amdemodgui.h:56
void handleInputMessages()
Definition: amdemodgui.cpp:113
void addChannelMarker(ChannelMarker *channelMarker)
Add channel marker to spectrum.
Definition: deviceuiset.cpp:72
bool m_squelchOpen
Definition: amdemodgui.h:54
bool m_samUSB
Definition: amdemodgui.h:55
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
RollupWidget(QWidget *parent=NULL)
Definition: rollupwidget.cpp:7
AMDemod * m_amDemod
Definition: amdemodgui.h:53
void displaySettings()
Definition: amdemodgui.cpp:337
void onMenuDialogCalled(const QPoint &p)
Definition: amdemodgui.cpp:207
virtual void setMessageQueueToGUI(MessageQueue *queue)
void setTitleColor(const QColor &c)
void channelMarkerHighlightedByCursor()
Definition: amdemodgui.cpp:133
void registerRxChannelInstance(const QString &channelName, PluginInstanceGUI *pluginGUI)
Definition: deviceuiset.cpp:82
virtual MessageQueue * getInputMessageQueue()
Definition: amdemodgui.h:38
void addRollupWidget(QWidget *widget)
Add rollup widget to channel window.
Definition: deviceuiset.cpp:77
ChannelMarker m_channelMarker
Definition: amdemodgui.h:49
void setChannelMarker(Serializable *channelMarker)
void onWidgetRolled(QWidget *widget, bool rollDown)
Definition: amdemodgui.cpp:197
void setColor(const QColor &color)
PluginAPI * m_pluginAPI
Definition: amdemodgui.h:47
Ui::AMDemodGUI * ui
Definition: amdemodgui.h:46
bool m_doApplySettings
Definition: amdemodgui.h:51
void tick()
Definition: amdemodgui.cpp:453
void setVisible(bool visible)
void channelMarkerChangedByCursor()
Definition: amdemodgui.cpp:126
void setBandwidth(int bandwidth)
const QColor & getColor() const
Definition: channelmarker.h:64
void applySettings(bool force=false)
Definition: amdemodgui.cpp:323
void setTitle(const QString &title)
void setCenterFrequency(int centerFrequency)
static const QString m_channelIdURI
Definition: amdemod.h:163
QIcon m_iconDSBUSB
Definition: amdemodgui.h:59
void widgetRolled(QWidget *widget, bool rollDown)
QIcon m_iconDSBLSB
Definition: amdemodgui.h:60
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~AMDemodGUI()

AMDemodGUI::~AMDemodGUI ( )
privatevirtual

Definition at line 311 of file amdemodgui.cpp.

References m_amDemod, m_deviceUISet, DeviceUISet::removeRxChannelInstance(), and ui.

312 {
314  delete m_amDemod; // TODO: check this: when the GUI closes it has to delete the demodulator
315  delete ui;
316 }
DeviceUISet * m_deviceUISet
Definition: amdemodgui.h:48
AMDemod * m_amDemod
Definition: amdemodgui.h:53
void removeRxChannelInstance(PluginInstanceGUI *pluginGUI)
Definition: deviceuiset.cpp:94
Ui::AMDemodGUI * ui
Definition: amdemodgui.h:46
+ Here is the call graph for this function:

Member Function Documentation

◆ applySettings()

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

Definition at line 323 of file amdemodgui.cpp.

References AMDemod::MsgConfigureAMDemod::create(), AMDemod::MsgConfigureChannelizer::create(), AMDemod::getAudioSampleRate(), ChannelMarker::getCenterFrequency(), BasebandSampleSink::getInputMessageQueue(), m_amDemod, m_channelMarker, m_doApplySettings, m_settings, and MessageQueue::push().

Referenced by AMDemodGUI(), audioSelect(), channelMarkerChangedByCursor(), deserialize(), on_audioMute_toggled(), on_bandpassEnable_toggled(), on_deltaFrequency_changed(), on_pll_toggled(), on_rfBW_valueChanged(), on_squelch_valueChanged(), on_ssb_toggled(), on_volume_valueChanged(), onMenuDialogCalled(), resetToDefaults(), samSSBSelect(), and setCenterFrequency().

324 {
325  if (m_doApplySettings)
326  {
329  m_amDemod->getInputMessageQueue()->push(channelConfigMsg);
330 
331 
333  m_amDemod->getInputMessageQueue()->push(message);
334  }
335 }
AMDemodSettings m_settings
Definition: amdemodgui.h:50
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 MsgConfigureAMDemod * create(const AMDemodSettings &settings, bool force)
Definition: amdemod.h:58
AMDemod * m_amDemod
Definition: amdemodgui.h:53
ChannelMarker m_channelMarker
Definition: amdemodgui.h:49
static MsgConfigureChannelizer * create(int sampleRate, int centerFrequency)
Definition: amdemod.h:81
uint32_t getAudioSampleRate() const
Definition: amdemod.h:137
bool m_doApplySettings
Definition: amdemodgui.h:51
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ audioSelect

void AMDemodGUI::audioSelect ( )
privateslot

Definition at line 420 of file amdemodgui.cpp.

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

Referenced by AMDemodGUI().

421 {
422  qDebug("AMDemodGUI::audioSelect");
424  audioSelect.exec();
425 
426  if (audioSelect.m_selected)
427  {
428  m_settings.m_audioDeviceName = audioSelect.m_audioDeviceName;
429  applySettings();
430  }
431 }
AMDemodSettings m_settings
Definition: amdemodgui.h:50
void audioSelect()
Definition: amdemodgui.cpp:420
static DSPEngine * instance()
Definition: dspengine.cpp:51
QString m_audioDeviceName
void applySettings(bool force=false)
Definition: amdemodgui.cpp:323
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ blockApplySettings()

void AMDemodGUI::blockApplySettings ( bool  block)
private

Definition at line 318 of file amdemodgui.cpp.

References m_doApplySettings.

Referenced by displaySettings(), and handleMessage().

319 {
320  m_doApplySettings = !block;
321 }
bool m_doApplySettings
Definition: amdemodgui.h:51
+ Here is the caller graph for this function:

◆ channelMarkerChangedByCursor

void AMDemodGUI::channelMarkerChangedByCursor ( )
slot

Definition at line 126 of file amdemodgui.cpp.

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

Referenced by AMDemodGUI().

127 {
128  ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
130  applySettings();
131 }
AMDemodSettings m_settings
Definition: amdemodgui.h:50
int getCenterFrequency() const
Definition: channelmarker.h:42
ChannelMarker m_channelMarker
Definition: amdemodgui.h:49
Ui::AMDemodGUI * ui
Definition: amdemodgui.h:46
qint32 m_inputFrequencyOffset
void applySettings(bool force=false)
Definition: amdemodgui.cpp:323
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ channelMarkerHighlightedByCursor

void AMDemodGUI::channelMarkerHighlightedByCursor ( )
slot

Definition at line 133 of file amdemodgui.cpp.

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

Referenced by AMDemodGUI().

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

◆ create()

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

Definition at line 42 of file amdemodgui.cpp.

References AMDemodGUI().

Referenced by AMDemodPlugin::createRxChannelGUI().

43 {
44  AMDemodGUI* gui = new AMDemodGUI(pluginAPI, deviceUISet, rxChannel);
45  return gui;
46 }
AMDemodGUI(PluginAPI *pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget *parent=0)
Definition: amdemodgui.cpp:251
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deserialize()

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

Implements PluginInstanceGUI.

Definition at line 85 of file amdemodgui.cpp.

References applySettings(), AMDemodSettings::deserialize(), displaySettings(), m_settings, and resetToDefaults().

86 {
87  if(m_settings.deserialize(data)) {
89  applySettings(true);
90  return true;
91  } else {
93  return false;
94  }
95 }
AMDemodSettings m_settings
Definition: amdemodgui.h:50
void displaySettings()
Definition: amdemodgui.cpp:337
bool deserialize(const QByteArray &data)
void resetToDefaults()
Definition: amdemodgui.cpp:73
void applySettings(bool force=false)
Definition: amdemodgui.cpp:323
+ Here is the call graph for this function:

◆ destroy()

void AMDemodGUI::destroy ( )
virtual

Implements PluginInstanceGUI.

Definition at line 48 of file amdemodgui.cpp.

49 {
50  delete this;
51 }

◆ displaySettings()

void AMDemodGUI::displaySettings ( )
private

Definition at line 337 of file amdemodgui.cpp.

References arg(), blockApplySettings(), displayStreamIndex(), ChannelMarker::getCenterFrequency(), ChannelMarker::getTitle(), AMDemodSettings::m_audioMute, AMDemodSettings::m_bandpassEnable, m_channelMarker, m_iconDSBLSB, m_iconDSBUSB, AMDemodSettings::m_inputFrequencyOffset, AMDemodSettings::m_pll, AMDemodSettings::m_rfBandwidth, AMDemodSettings::m_rgbColor, m_samUSB, m_settings, AMDemodSettings::m_squelch, AMDemodSettings::m_syncAMOperation, AMDemodSettings::m_title, AMDemodSettings::m_volume, ChannelMarker::setBandwidth(), ChannelMarker::setCenterFrequency(), ChannelMarker::setColor(), ChannelMarker::setTitle(), RollupWidget::setTitleColor(), AMDemodSettings::SyncAMLSB, AMDemodSettings::SyncAMUSB, and ui.

Referenced by AMDemodGUI(), deserialize(), handleMessage(), and resetToDefaults().

338 {
339  m_channelMarker.blockSignals(true);
343  m_channelMarker.blockSignals(false);
344  m_channelMarker.setColor(m_settings.m_rgbColor); // activate signal on the last setting only
345 
347  setWindowTitle(m_channelMarker.getTitle());
348 
349  blockApplySettings(true);
350 
351  ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
352 
353  int displayValue = m_settings.m_rfBandwidth/100.0;
354  ui->rfBW->setValue(displayValue);
355  ui->rfBWText->setText(QString("%1 kHz").arg(displayValue / 10.0, 0, 'f', 1));
356 
357  ui->volume->setValue(m_settings.m_volume * 10.0);
358  ui->volumeText->setText(QString("%1").arg(m_settings.m_volume, 0, 'f', 1));
359 
360  ui->squelch->setValue(m_settings.m_squelch);
361  ui->squelchText->setText(QString("%1 dB").arg(m_settings.m_squelch));
362 
363  ui->audioMute->setChecked(m_settings.m_audioMute);
364  ui->bandpassEnable->setChecked(m_settings.m_bandpassEnable);
365  ui->pll->setChecked(m_settings.m_pll);
366 
367  qDebug() << "AMDemodGUI::displaySettings:"
368  << " m_pll: " << m_settings.m_pll
369  << " m_syncAMOperation: " << m_settings.m_syncAMOperation;
370 
371  if (m_settings.m_pll)
372  {
374  {
375  m_samUSB = false;
376  ui->ssb->setChecked(true);
377  ui->ssb->setIcon(m_iconDSBLSB);
378  }
380  {
381  m_samUSB = true;
382  ui->ssb->setChecked(true);
383  ui->ssb->setIcon(m_iconDSBUSB);
384  }
385  else
386  {
387  ui->ssb->setChecked(false);
388  }
389  }
390  else
391  {
392  ui->ssb->setChecked(false);
393  ui->ssb->setIcon(m_iconDSBUSB);
394  }
395 
397 
398  blockApplySettings(false);
399 }
AMDemodSettings m_settings
Definition: amdemodgui.h:50
int getCenterFrequency() const
Definition: channelmarker.h:42
void displayStreamIndex()
Definition: amdemodgui.cpp:401
bool m_samUSB
Definition: amdemodgui.h:55
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void setTitleColor(const QColor &c)
SyncAMOperation m_syncAMOperation
const QString & getTitle() const
Definition: channelmarker.h:38
ChannelMarker m_channelMarker
Definition: amdemodgui.h:49
void blockApplySettings(bool block)
Definition: amdemodgui.cpp:318
void setColor(const QColor &color)
Ui::AMDemodGUI * ui
Definition: amdemodgui.h:46
qint32 m_inputFrequencyOffset
void setBandwidth(int bandwidth)
void setTitle(const QString &title)
void setCenterFrequency(int centerFrequency)
QIcon m_iconDSBUSB
Definition: amdemodgui.h:59
QIcon m_iconDSBLSB
Definition: amdemodgui.h:60
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ displayStreamIndex()

void AMDemodGUI::displayStreamIndex ( )
private

Definition at line 401 of file amdemodgui.cpp.

References arg(), DeviceUISet::m_deviceMIMOEngine, m_deviceUISet, m_settings, AMDemodSettings::m_streamIndex, and RollupWidget::setStreamIndicator().

Referenced by displaySettings(), and onMenuDialogCalled().

402 {
405  } else {
406  setStreamIndicator("S"); // single channel indicator
407  }
408 }
AMDemodSettings m_settings
Definition: amdemodgui.h:50
DeviceUISet * m_deviceUISet
Definition: amdemodgui.h:48
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
int m_streamIndex
MIMO channel. Not relevant when connected to SI (single Rx).
void setStreamIndicator(const QString &indicator)
DSPDeviceMIMOEngine * m_deviceMIMOEngine
Definition: deviceuiset.h:51
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ enterEvent()

void AMDemodGUI::enterEvent ( QEvent *  )
private

Definition at line 415 of file amdemodgui.cpp.

References m_channelMarker, and ChannelMarker::setHighlighted().

416 {
418 }
void setHighlighted(bool highlighted)
ChannelMarker m_channelMarker
Definition: amdemodgui.h:49
+ Here is the call graph for this function:

◆ getCenterFrequency()

qint64 AMDemodGUI::getCenterFrequency ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 63 of file amdemodgui.cpp.

References ChannelMarker::getCenterFrequency(), and m_channelMarker.

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

◆ getInputMessageQueue()

virtual MessageQueue* AMDemodGUI::getInputMessageQueue ( )
inlinevirtual

Implements PluginInstanceGUI.

Definition at line 38 of file amdemodgui.h.

Referenced by AMDemodGUI(), and handleInputMessages().

38 { return &m_inputMessageQueue; }
MessageQueue m_inputMessageQueue
Definition: amdemodgui.h:57
+ Here is the caller graph for this function:

◆ getName()

QString AMDemodGUI::getName ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 58 of file amdemodgui.cpp.

59 {
60  return objectName();
61 }

◆ handleInputMessages

void AMDemodGUI::handleInputMessages ( )
privateslot

Definition at line 113 of file amdemodgui.cpp.

References getInputMessageQueue(), and handleMessage().

Referenced by AMDemodGUI().

114 {
115  Message* message;
116 
117  while ((message = getInputMessageQueue()->pop()) != 0)
118  {
119  if (handleMessage(*message))
120  {
121  delete message;
122  }
123  }
124 }
virtual MessageQueue * getInputMessageQueue()
Definition: amdemodgui.h:38
virtual bool handleMessage(const Message &message)
Definition: amdemodgui.cpp:97
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleMessage()

bool AMDemodGUI::handleMessage ( const Message message)
virtual

Implements PluginInstanceGUI.

Definition at line 97 of file amdemodgui.cpp.

References blockApplySettings(), displaySettings(), AMDemod::MsgConfigureAMDemod::getSettings(), m_settings, and Message::match().

Referenced by handleInputMessages().

98 {
100  {
101  qDebug("AMDemodGUI::handleMessage: AMDemod::MsgConfigureAMDemod");
103  m_settings = cfg.getSettings();
104  blockApplySettings(true);
105  displaySettings();
106  blockApplySettings(false);
107  return true;
108  }
109 
110  return false;
111 }
AMDemodSettings m_settings
Definition: amdemodgui.h:50
void displaySettings()
Definition: amdemodgui.cpp:337
const AMDemodSettings & getSettings() const
Definition: amdemod.h:55
static bool match(const Message *message)
Definition: message.cpp:45
void blockApplySettings(bool block)
Definition: amdemodgui.cpp:318
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ leaveEvent()

void AMDemodGUI::leaveEvent ( QEvent *  )
private

Definition at line 410 of file amdemodgui.cpp.

References m_channelMarker, and ChannelMarker::setHighlighted().

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

◆ on_audioMute_toggled

void AMDemodGUI::on_audioMute_toggled ( bool  checked)
privateslot

Definition at line 191 of file amdemodgui.cpp.

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

192 {
193  m_settings.m_audioMute = checked;
194  applySettings();
195 }
AMDemodSettings m_settings
Definition: amdemodgui.h:50
void applySettings(bool force=false)
Definition: amdemodgui.cpp:323
+ Here is the call graph for this function:

◆ on_bandpassEnable_toggled

void AMDemodGUI::on_bandpassEnable_toggled ( bool  checked)
privateslot

Definition at line 163 of file amdemodgui.cpp.

References applySettings(), AMDemodSettings::m_bandpassEnable, and m_settings.

164 {
165  m_settings.m_bandpassEnable = checked;
166  applySettings();
167 }
AMDemodSettings m_settings
Definition: amdemodgui.h:50
void applySettings(bool force=false)
Definition: amdemodgui.cpp:323
+ Here is the call graph for this function:

◆ on_deltaFrequency_changed

void AMDemodGUI::on_deltaFrequency_changed ( qint64  value)
privateslot

Definition at line 138 of file amdemodgui.cpp.

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

139 {
142  applySettings();
143 }
AMDemodSettings m_settings
Definition: amdemodgui.h:50
int getCenterFrequency() const
Definition: channelmarker.h:42
ChannelMarker m_channelMarker
Definition: amdemodgui.h:49
qint32 m_inputFrequencyOffset
void applySettings(bool force=false)
Definition: amdemodgui.cpp:323
void setCenterFrequency(int centerFrequency)
+ Here is the call graph for this function:

◆ on_pll_toggled

void AMDemodGUI::on_pll_toggled ( bool  checked)
privateslot

Definition at line 145 of file amdemodgui.cpp.

References applySettings(), AMDemodSettings::m_pll, m_settings, and ui.

146 {
147  if (!checked)
148  {
149  ui->pll->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
150  ui->pll->setToolTip(tr("PLL for synchronous AM"));
151  }
152 
153  m_settings.m_pll = checked;
154  applySettings();
155 }
AMDemodSettings m_settings
Definition: amdemodgui.h:50
Ui::AMDemodGUI * ui
Definition: amdemodgui.h:46
void applySettings(bool force=false)
Definition: amdemodgui.cpp:323
+ Here is the call graph for this function:

◆ on_rfBW_valueChanged

void AMDemodGUI::on_rfBW_valueChanged ( int  value)
privateslot

Definition at line 169 of file amdemodgui.cpp.

References applySettings(), arg(), m_channelMarker, AMDemodSettings::m_rfBandwidth, m_settings, ChannelMarker::setBandwidth(), and ui.

170 {
171  ui->rfBWText->setText(QString("%1 kHz").arg(value / 10.0, 0, 'f', 1));
172  m_channelMarker.setBandwidth(value * 100);
173  m_settings.m_rfBandwidth = value * 100;
174  applySettings();
175 }
AMDemodSettings m_settings
Definition: amdemodgui.h:50
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
ChannelMarker m_channelMarker
Definition: amdemodgui.h:49
Ui::AMDemodGUI * ui
Definition: amdemodgui.h:46
void setBandwidth(int bandwidth)
void applySettings(bool force=false)
Definition: amdemodgui.cpp:323
+ Here is the call graph for this function:

◆ on_squelch_valueChanged

void AMDemodGUI::on_squelch_valueChanged ( int  value)
privateslot

Definition at line 184 of file amdemodgui.cpp.

References applySettings(), arg(), m_settings, AMDemodSettings::m_squelch, and ui.

185 {
186  ui->squelchText->setText(QString("%1 dB").arg(value));
187  m_settings.m_squelch = value;
188  applySettings();
189 }
AMDemodSettings m_settings
Definition: amdemodgui.h:50
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Ui::AMDemodGUI * ui
Definition: amdemodgui.h:46
void applySettings(bool force=false)
Definition: amdemodgui.cpp:323
+ Here is the call graph for this function:

◆ on_ssb_toggled

void AMDemodGUI::on_ssb_toggled ( bool  checked)
privateslot

◆ on_volume_valueChanged

void AMDemodGUI::on_volume_valueChanged ( int  value)
privateslot

Definition at line 177 of file amdemodgui.cpp.

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

178 {
179  ui->volumeText->setText(QString("%1").arg(value / 10.0, 0, 'f', 1));
180  m_settings.m_volume = value / 10.0;
181  applySettings();
182 }
AMDemodSettings m_settings
Definition: amdemodgui.h:50
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Ui::AMDemodGUI * ui
Definition: amdemodgui.h:46
void applySettings(bool force=false)
Definition: amdemodgui.cpp:323
+ Here is the call graph for this function:

◆ onMenuDialogCalled

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

Definition at line 207 of file amdemodgui.cpp.

References applySettings(), RollupWidget::ContextMenuChannelSettings, RollupWidget::ContextMenuStreamSettings, displayStreamIndex(), ChannelMarker::getCenterFrequency(), ChannelMarker::getColor(), AMDemod::getNumberOfDeviceStreams(), BasicChannelSettingsDialog::getReverseAPIAddress(), BasicChannelSettingsDialog::getReverseAPIChannelIndex(), BasicChannelSettingsDialog::getReverseAPIDeviceIndex(), BasicChannelSettingsDialog::getReverseAPIPort(), DeviceStreamSelectionDialog::getSelectedStreamIndex(), ChannelMarker::getTitle(), m_amDemod, m_channelMarker, RollupWidget::m_contextMenuType, DeviceUISet::m_deviceMIMOEngine, m_deviceUISet, AMDemodSettings::m_inputFrequencyOffset, AMDemodSettings::m_reverseAPIAddress, AMDemodSettings::m_reverseAPIChannelIndex, AMDemodSettings::m_reverseAPIDeviceIndex, AMDemodSettings::m_reverseAPIPort, AMDemodSettings::m_rgbColor, m_settings, AMDemodSettings::m_streamIndex, AMDemodSettings::m_title, AMDemodSettings::m_useReverseAPI, RollupWidget::resetContextMenuType(), DeviceStreamSelectionDialog::setNumberOfStreams(), BasicChannelSettingsDialog::setReverseAPIAddress(), BasicChannelSettingsDialog::setReverseAPIChannelIndex(), BasicChannelSettingsDialog::setReverseAPIDeviceIndex(), BasicChannelSettingsDialog::setReverseAPIPort(), DeviceStreamSelectionDialog::setStreamIndex(), ChannelMarker::setStreamIndex(), RollupWidget::setTitleColor(), BasicChannelSettingsDialog::setUseReverseAPI(), and BasicChannelSettingsDialog::useReverseAPI().

Referenced by AMDemodGUI().

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  dialog.move(p);
218  dialog.exec();
219 
223  m_settings.m_useReverseAPI = dialog.useReverseAPI();
224  m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress();
225  m_settings.m_reverseAPIPort = dialog.getReverseAPIPort();
226  m_settings.m_reverseAPIDeviceIndex = dialog.getReverseAPIDeviceIndex();
227  m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex();
228 
229  setWindowTitle(m_settings.m_title);
231 
232  applySettings();
233  }
235  {
236  DeviceStreamSelectionDialog dialog(this);
237  dialog.setNumberOfStreams(m_amDemod->getNumberOfDeviceStreams());
238  dialog.setStreamIndex(m_settings.m_streamIndex);
239  dialog.move(p);
240  dialog.exec();
241 
242  m_settings.m_streamIndex = dialog.getSelectedStreamIndex();
245  applySettings();
246  }
247 
249 }
AMDemodSettings m_settings
Definition: amdemodgui.h:50
int getCenterFrequency() const
Definition: channelmarker.h:42
uint32_t getNumberOfDeviceStreams() const
Definition: amdemod.cpp:111
void displayStreamIndex()
Definition: amdemodgui.cpp:401
DeviceUISet * m_deviceUISet
Definition: amdemodgui.h:48
void resetContextMenuType()
Definition: rollupwidget.h:50
uint16_t m_reverseAPIChannelIndex
ContextMenuType m_contextMenuType
Definition: rollupwidget.h:33
int m_streamIndex
MIMO channel. Not relevant when connected to SI (single Rx).
AMDemod * m_amDemod
Definition: amdemodgui.h:53
void setStreamIndex(int streamIndex)
Definition: channelmarker.h:77
uint16_t m_reverseAPIDeviceIndex
void setTitleColor(const QColor &c)
const QString & getTitle() const
Definition: channelmarker.h:38
ChannelMarker m_channelMarker
Definition: amdemodgui.h:49
QString m_reverseAPIAddress
uint16_t m_reverseAPIPort
qint32 m_inputFrequencyOffset
const QColor & getColor() const
Definition: channelmarker.h:64
void applySettings(bool force=false)
Definition: amdemodgui.cpp:323
DSPDeviceMIMOEngine * m_deviceMIMOEngine
Definition: deviceuiset.h:51
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ onWidgetRolled

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

Definition at line 197 of file amdemodgui.cpp.

Referenced by AMDemodGUI().

198 {
199  (void) widget;
200  (void) rollDown;
201  /*
202  if((widget == ui->spectrumContainer) && (m_nfmDemod != NULL))
203  m_nfmDemod->setSpectrum(m_threadedSampleSink->getMessageQueue(), rollDown);
204  */
205 }
+ Here is the caller graph for this function:

◆ resetToDefaults()

void AMDemodGUI::resetToDefaults ( )
virtual

Implements PluginInstanceGUI.

Definition at line 73 of file amdemodgui.cpp.

References applySettings(), displaySettings(), m_settings, and AMDemodSettings::resetToDefaults().

Referenced by deserialize().

74 {
77  applySettings(true);
78 }
AMDemodSettings m_settings
Definition: amdemodgui.h:50
void displaySettings()
Definition: amdemodgui.cpp:337
void applySettings(bool force=false)
Definition: amdemodgui.cpp:323
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ samSSBSelect

void AMDemodGUI::samSSBSelect ( )
privateslot

Definition at line 433 of file amdemodgui.cpp.

References applySettings(), AMDemodSSBDialog::isUsb(), m_iconDSBLSB, m_iconDSBUSB, m_samUSB, m_settings, AMDemodSettings::m_syncAMOperation, AMDemodSettings::SyncAMDSB, AMDemodSettings::SyncAMLSB, AMDemodSettings::SyncAMUSB, and ui.

Referenced by AMDemodGUI().

434 {
435  AMDemodSSBDialog ssbSelect(m_samUSB);
436  ssbSelect.exec();
437 
438  ui->ssb->setIcon(ssbSelect.isUsb() ? m_iconDSBUSB : m_iconDSBLSB);
439 
440  if (ssbSelect.isUsb() != m_samUSB)
441  {
442  qDebug("AMDemodGUI::samSSBSelect: %s", ssbSelect.isUsb() ? "usb" : "lsb");
443  m_samUSB = ssbSelect.isUsb();
444 
446  {
448  applySettings();
449  }
450  }
451 }
AMDemodSettings m_settings
Definition: amdemodgui.h:50
bool m_samUSB
Definition: amdemodgui.h:55
SyncAMOperation m_syncAMOperation
Ui::AMDemodGUI * ui
Definition: amdemodgui.h:46
void applySettings(bool force=false)
Definition: amdemodgui.cpp:323
QIcon m_iconDSBUSB
Definition: amdemodgui.h:59
QIcon m_iconDSBLSB
Definition: amdemodgui.h:60
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize()

QByteArray AMDemodGUI::serialize ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 80 of file amdemodgui.cpp.

References m_settings, and AMDemodSettings::serialize().

81 {
82  return m_settings.serialize();
83 }
AMDemodSettings m_settings
Definition: amdemodgui.h:50
QByteArray serialize() const
+ Here is the call graph for this function:

◆ setCenterFrequency()

void AMDemodGUI::setCenterFrequency ( qint64  centerFrequency)
virtual

Implements PluginInstanceGUI.

Definition at line 67 of file amdemodgui.cpp.

References applySettings(), m_channelMarker, and ChannelMarker::setCenterFrequency().

68 {
69  m_channelMarker.setCenterFrequency(centerFrequency);
70  applySettings();
71 }
ChannelMarker m_channelMarker
Definition: amdemodgui.h:49
void applySettings(bool force=false)
Definition: amdemodgui.cpp:323
void setCenterFrequency(int centerFrequency)
+ Here is the call graph for this function:

◆ setName()

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

Implements PluginInstanceGUI.

Definition at line 53 of file amdemodgui.cpp.

54 {
55  setObjectName(name);
56 }

◆ tick

void AMDemodGUI::tick ( )
privateslot

Definition at line 453 of file amdemodgui.cpp.

References arg(), CalcDb::dbPower(), AMDemod::getAudioSampleRate(), AMDemod::getMagSqLevels(), AMDemod::getPllFrequency(), AMDemod::getPllLocked(), AMDemod::getSquelchOpen(), m_amDemod, M_PI, AMDemodSettings::m_pll, m_settings, m_squelchOpen, m_tickCount, and ui.

Referenced by AMDemodGUI().

454 {
455  double magsqAvg, magsqPeak;
456  int nbMagsqSamples;
457  m_amDemod->getMagSqLevels(magsqAvg, magsqPeak, nbMagsqSamples);
458  double powDbAvg = CalcDb::dbPower(magsqAvg);
459  double powDbPeak = CalcDb::dbPower(magsqPeak);
460 
461  ui->channelPowerMeter->levelChanged(
462  (100.0f + powDbAvg) / 100.0f,
463  (100.0f + powDbPeak) / 100.0f,
464  nbMagsqSamples);
465 
466  if (m_tickCount % 4 == 0) {
467  ui->channelPower->setText(QString::number(powDbAvg, 'f', 1));
468  }
469 
470  bool squelchOpen = m_amDemod->getSquelchOpen();
471 
472  if (squelchOpen != m_squelchOpen)
473  {
474  m_squelchOpen = squelchOpen;
475 
476  if (m_squelchOpen) {
477  ui->audioMute->setStyleSheet("QToolButton { background-color : green; }");
478  } else {
479  ui->audioMute->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
480  }
481  }
482 
483  if (m_settings.m_pll)
484  {
485  if (m_amDemod->getPllLocked()) {
486  ui->pll->setStyleSheet("QToolButton { background-color : green; }");
487  } else {
488  ui->pll->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
489  }
490 
491  int freq = (m_amDemod->getPllFrequency() * m_amDemod->getAudioSampleRate()) / (2.0*M_PI);
492  ui->pll->setToolTip(tr("PLL for synchronous AM. Freq = %1 Hz").arg(freq));
493  }
494 
495  m_tickCount++;
496 }
AMDemodSettings m_settings
Definition: amdemodgui.h:50
static double dbPower(double magsq, double floor=1e-12)
Definition: db.cpp:22
void getMagSqLevels(double &avg, double &peak, int &nbSamples)
Definition: amdemod.h:143
uint32_t m_tickCount
Definition: amdemodgui.h:56
#define M_PI
Definition: rdsdemod.cpp:27
bool m_squelchOpen
Definition: amdemodgui.h:54
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Real getPllFrequency() const
Definition: amdemod.h:141
AMDemod * m_amDemod
Definition: amdemodgui.h:53
uint32_t getAudioSampleRate() const
Definition: amdemod.h:137
Ui::AMDemodGUI * ui
Definition: amdemodgui.h:46
bool getSquelchOpen() const
Definition: amdemod.h:139
bool getPllLocked() const
Definition: amdemod.h:140
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_amDemod

AMDemod* AMDemodGUI::m_amDemod
private

Definition at line 53 of file amdemodgui.h.

Referenced by AMDemodGUI(), applySettings(), onMenuDialogCalled(), tick(), and ~AMDemodGUI().

◆ m_channelMarker

ChannelMarker AMDemodGUI::m_channelMarker
private

◆ m_deviceUISet

DeviceUISet* AMDemodGUI::m_deviceUISet
private

Definition at line 48 of file amdemodgui.h.

Referenced by AMDemodGUI(), displayStreamIndex(), onMenuDialogCalled(), and ~AMDemodGUI().

◆ m_doApplySettings

bool AMDemodGUI::m_doApplySettings
private

Definition at line 51 of file amdemodgui.h.

Referenced by applySettings(), and blockApplySettings().

◆ m_iconDSBLSB

QIcon AMDemodGUI::m_iconDSBLSB
private

Definition at line 60 of file amdemodgui.h.

Referenced by AMDemodGUI(), displaySettings(), and samSSBSelect().

◆ m_iconDSBUSB

QIcon AMDemodGUI::m_iconDSBUSB
private

Definition at line 59 of file amdemodgui.h.

Referenced by AMDemodGUI(), displaySettings(), and samSSBSelect().

◆ m_inputMessageQueue

MessageQueue AMDemodGUI::m_inputMessageQueue
private

Definition at line 57 of file amdemodgui.h.

◆ m_pluginAPI

PluginAPI* AMDemodGUI::m_pluginAPI
private

Definition at line 47 of file amdemodgui.h.

◆ m_samUSB

bool AMDemodGUI::m_samUSB
private

Definition at line 55 of file amdemodgui.h.

Referenced by displaySettings(), on_ssb_toggled(), and samSSBSelect().

◆ m_settings

AMDemodSettings AMDemodGUI::m_settings
private

◆ m_squelchOpen

bool AMDemodGUI::m_squelchOpen
private

Definition at line 54 of file amdemodgui.h.

Referenced by tick().

◆ m_tickCount

uint32_t AMDemodGUI::m_tickCount
private

Definition at line 56 of file amdemodgui.h.

Referenced by tick().

◆ ui

Ui::AMDemodGUI* AMDemodGUI::ui
private

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