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

#include <wfmdemodgui.h>

+ Inheritance diagram for WFMDemodGUI:
+ Collaboration diagram for WFMDemodGUI:

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

Private Slots

void on_deltaFrequency_changed (qint64 value)
 
void on_rfBW_changed (quint64 value)
 
void on_afBW_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 tick ()
 

Private Member Functions

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

Private Attributes

Ui::WFMDemodGUI * ui
 
PluginAPIm_pluginAPI
 
DeviceUISetm_deviceUISet
 
ChannelMarker m_channelMarker
 
WFMDemodSettings m_settings
 
bool m_basicSettingsShown
 
bool m_doApplySettings
 
bool m_audioMute
 
bool m_squelchOpen
 
WFMDemodm_wfmDemod
 
MessageQueue m_inputMessageQueue
 

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 20 of file wfmdemodgui.h.

Constructor & Destructor Documentation

◆ WFMDemodGUI()

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

Definition at line 201 of file wfmdemodgui.cpp.

References DeviceUISet::addChannelMarker(), DeviceUISet::addRollupWidget(), applySettings(), arg(), audioSelect(), channelMarkerChangedByCursor(), channelMarkerHighlightedByCursor(), LevelMeterSignalDB::ColorGreenAndBlue, displaySettings(), ChannelMarker::getColor(), getInputMessageQueue(), MainWindow::getInstance(), ColorMapper::GrayGold, ColorMapper::GrayYellow, handleInputMessages(), WFMDemod::m_channelIdURI, m_channelMarker, m_deviceUISet, WFMDemodSettings::m_rfBandwidth, WFMDemodSettings::m_rfBWDigits, WFMDemodSettings::m_rfBWMax, WFMDemodSettings::m_rfBWMin, WFMDemodSettings::m_rgbColor, m_settings, m_wfmDemod, onMenuDialogCalled(), onWidgetRolled(), DeviceUISet::registerRxChannelInstance(), ChannelMarker::setBandwidth(), ChannelMarker::setCenterFrequency(), WFMDemodSettings::setChannelMarker(), ChannelMarker::setColor(), BasebandSampleSink::setMessageQueueToGUI(), ChannelMarker::setTitle(), RollupWidget::setTitleColor(), ChannelMarker::setVisible(), tick(), ui, and RollupWidget::widgetRolled().

Referenced by create().

201  :
202  RollupWidget(parent),
203  ui(new Ui::WFMDemodGUI),
204  m_pluginAPI(pluginAPI),
205  m_deviceUISet(deviceUISet),
206  m_channelMarker(this),
207  m_basicSettingsShown(false)
208 {
209  ui->setupUi(this);
210  setAttribute(Qt::WA_DeleteOnClose, true);
211  connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
212  connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
213  connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
214 
215  m_wfmDemod = (WFMDemod*) rxChannel; //new WFMDemod(m_deviceUISet->m_deviceSourceAPI);
217 
218  connect(&MainWindow::getInstance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick()));
219 
220  CRightClickEnabler *audioMuteRightClickEnabler = new CRightClickEnabler(ui->audioMute);
221  connect(audioMuteRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(audioSelect()));
222 
223  ui->deltaFrequencyLabel->setText(QString("%1f").arg(QChar(0x94, 0x03)));
224  ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
225  ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999);
226  ui->channelPowerMeter->setColorTheme(LevelMeterSignalDB::ColorGreenAndBlue);
227 
228  ui->rfBW->setColorMapper(ColorMapper(ColorMapper::GrayYellow));
230 
231  m_channelMarker.blockSignals(true);
234  m_channelMarker.setTitle("WFM Demodulator");
236  m_channelMarker.blockSignals(false);
237  m_channelMarker.setVisible(true); // activate signal on the last setting only
238 
241 
245 
246  connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor()));
247  connect(&m_channelMarker, SIGNAL(highlightedByCursor()), this, SLOT(channelMarkerHighlightedByCursor()));
248 
249  displaySettings();
250  applySettings(true);
251 }
static MainWindow * getInstance()
Definition: mainwindow.h:73
static const int m_rfBWDigits
bool m_basicSettingsShown
Definition: wfmdemodgui.h:48
WFMDemod * m_wfmDemod
Definition: wfmdemodgui.h:53
void onMenuDialogCalled(const QPoint &p)
Ui::WFMDemodGUI * ui
Definition: wfmdemodgui.h:43
static const int m_rfBWMin
void addChannelMarker(ChannelMarker *channelMarker)
Add channel marker to spectrum.
Definition: deviceuiset.cpp:72
void channelMarkerHighlightedByCursor()
void applySettings(bool force=false)
PluginAPI * m_pluginAPI
Definition: wfmdemodgui.h:44
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
RollupWidget(QWidget *parent=NULL)
Definition: rollupwidget.cpp:7
void channelMarkerChangedByCursor()
virtual void setMessageQueueToGUI(MessageQueue *queue)
void setTitleColor(const QColor &c)
void registerRxChannelInstance(const QString &channelName, PluginInstanceGUI *pluginGUI)
Definition: deviceuiset.cpp:82
void displaySettings()
void addRollupWidget(QWidget *widget)
Add rollup widget to channel window.
Definition: deviceuiset.cpp:77
void handleInputMessages()
Definition: wfmdemodgui.cpp:97
WFMDemodSettings m_settings
Definition: wfmdemodgui.h:47
DeviceUISet * m_deviceUISet
Definition: wfmdemodgui.h:45
static const QString m_channelIdURI
Definition: wfmdemod.h:167
void setColor(const QColor &color)
void setVisible(bool visible)
void setBandwidth(int bandwidth)
const QColor & getColor() const
Definition: channelmarker.h:64
void setTitle(const QString &title)
void setChannelMarker(Serializable *channelMarker)
void setCenterFrequency(int centerFrequency)
void onWidgetRolled(QWidget *widget, bool rollDown)
void widgetRolled(QWidget *widget, bool rollDown)
ChannelMarker m_channelMarker
Definition: wfmdemodgui.h:46
void audioSelect()
virtual MessageQueue * getInputMessageQueue()
Definition: wfmdemodgui.h:35
static const int m_rfBWMax
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~WFMDemodGUI()

WFMDemodGUI::~WFMDemodGUI ( )
privatevirtual

Definition at line 253 of file wfmdemodgui.cpp.

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

254 {
256  delete m_wfmDemod; // TODO: check this: when the GUI closes it has to delete the demodulator
257  //delete m_channelMarker;
258  delete ui;
259 }
WFMDemod * m_wfmDemod
Definition: wfmdemodgui.h:53
Ui::WFMDemodGUI * ui
Definition: wfmdemodgui.h:43
void removeRxChannelInstance(PluginInstanceGUI *pluginGUI)
Definition: deviceuiset.cpp:94
DeviceUISet * m_deviceUISet
Definition: wfmdemodgui.h:45
+ Here is the call graph for this function:

Member Function Documentation

◆ applySettings()

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

Definition at line 266 of file wfmdemodgui.cpp.

References WFMDemod::MsgConfigureWFMDemod::create(), WFMDemod::MsgConfigureChannelizer::create(), ChannelMarker::getCenterFrequency(), BasebandSampleSink::getInputMessageQueue(), m_channelMarker, m_doApplySettings, WFMDemodSettings::m_rfBandwidth, m_settings, m_wfmDemod, MessageQueue::push(), and WFMDemod::requiredBW().

Referenced by audioSelect(), channelMarkerChangedByCursor(), deserialize(), on_afBW_valueChanged(), on_audioMute_toggled(), on_deltaFrequency_changed(), on_rfBW_changed(), on_squelch_valueChanged(), on_volume_valueChanged(), onMenuDialogCalled(), resetToDefaults(), setCenterFrequency(), and WFMDemodGUI().

267 {
268  if (m_doApplySettings)
269  {
273  m_wfmDemod->getInputMessageQueue()->push(msgChan);
274 
276  m_wfmDemod->getInputMessageQueue()->push(msgConfig);
277  }
278 }
WFMDemod * m_wfmDemod
Definition: wfmdemodgui.h:53
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.
bool m_doApplySettings
Definition: wfmdemodgui.h:49
static int requiredBW(int rfBW)
Definition: wfmdemod.h:158
WFMDemodSettings m_settings
Definition: wfmdemodgui.h:47
static MsgConfigureChannelizer * create(int sampleRate, int centerFrequency)
Definition: wfmdemod.h:81
static MsgConfigureWFMDemod * create(const WFMDemodSettings &settings, bool force)
Definition: wfmdemod.h:58
ChannelMarker m_channelMarker
Definition: wfmdemodgui.h:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ audioSelect

void WFMDemodGUI::audioSelect ( )
privateslot

Definition at line 317 of file wfmdemodgui.cpp.

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

Referenced by WFMDemodGUI().

318 {
319  qDebug("WFMDemodGUI::audioSelect");
321  audioSelect.exec();
322 
323  if (audioSelect.m_selected)
324  {
325  m_settings.m_audioDeviceName = audioSelect.m_audioDeviceName;
326  applySettings();
327  }
328 }
void applySettings(bool force=false)
static DSPEngine * instance()
Definition: dspengine.cpp:51
WFMDemodSettings m_settings
Definition: wfmdemodgui.h:47
void audioSelect()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ blockApplySettings()

void WFMDemodGUI::blockApplySettings ( bool  block)
private

Definition at line 261 of file wfmdemodgui.cpp.

References m_doApplySettings.

Referenced by displaySettings(), and handleMessage().

262 {
263  m_doApplySettings = !block;
264 }
bool m_doApplySettings
Definition: wfmdemodgui.h:49
+ Here is the caller graph for this function:

◆ channelMarkerChangedByCursor

void WFMDemodGUI::channelMarkerChangedByCursor ( )
slot

Definition at line 110 of file wfmdemodgui.cpp.

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

Referenced by WFMDemodGUI().

111 {
112  ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
114  applySettings();
115 }
qint64 m_inputFrequencyOffset
int getCenterFrequency() const
Definition: channelmarker.h:42
Ui::WFMDemodGUI * ui
Definition: wfmdemodgui.h:43
void applySettings(bool force=false)
WFMDemodSettings m_settings
Definition: wfmdemodgui.h:47
ChannelMarker m_channelMarker
Definition: wfmdemodgui.h:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ channelMarkerHighlightedByCursor

void WFMDemodGUI::channelMarkerHighlightedByCursor ( )
slot

Definition at line 117 of file wfmdemodgui.cpp.

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

Referenced by WFMDemodGUI().

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

◆ create()

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

Definition at line 22 of file wfmdemodgui.cpp.

References WFMDemodGUI().

Referenced by WFMPlugin::createRxChannelGUI().

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

Implements PluginInstanceGUI.

Definition at line 66 of file wfmdemodgui.cpp.

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

67 {
68  if(m_settings.deserialize(data)) {
70  applySettings(true);
71  return true;
72  } else {
74  return false;
75  }
76 }
void applySettings(bool force=false)
bool deserialize(const QByteArray &data)
void displaySettings()
WFMDemodSettings m_settings
Definition: wfmdemodgui.h:47
void resetToDefaults()
Definition: wfmdemodgui.cpp:54
+ Here is the call graph for this function:

◆ destroy()

void WFMDemodGUI::destroy ( )
virtual

Implements PluginInstanceGUI.

Definition at line 28 of file wfmdemodgui.cpp.

29 {
30  delete this;
31 }

◆ displaySettings()

void WFMDemodGUI::displaySettings ( )
private

Definition at line 280 of file wfmdemodgui.cpp.

References arg(), blockApplySettings(), ChannelMarker::getCenterFrequency(), ChannelMarker::getTitle(), WFMDemodSettings::m_afBandwidth, WFMDemodSettings::m_audioMute, m_channelMarker, WFMDemodSettings::m_inputFrequencyOffset, WFMDemodSettings::m_rfBandwidth, WFMDemodSettings::m_rgbColor, m_settings, WFMDemodSettings::m_squelch, WFMDemodSettings::m_title, WFMDemodSettings::m_volume, ChannelMarker::setBandwidth(), ChannelMarker::setCenterFrequency(), ChannelMarker::setColor(), ChannelMarker::setTitle(), RollupWidget::setTitleColor(), and ui.

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

281 {
282  m_channelMarker.blockSignals(true);
286  m_channelMarker.blockSignals(false);
287  m_channelMarker.setColor(m_settings.m_rgbColor); // activate signal on the last setting only
288 
290  setWindowTitle(m_channelMarker.getTitle());
291 
292  blockApplySettings(true);
293 
294  ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
295  ui->rfBW->setValue(m_settings.m_rfBandwidth);
296  ui->afBW->setValue(m_settings.m_afBandwidth/1000.0);
297  ui->afBWText->setText(QString("%1 kHz").arg(m_settings.m_afBandwidth/1000.0));
298  ui->volume->setValue(m_settings.m_volume * 10.0);
299  ui->volumeText->setText(QString("%1").arg(m_settings.m_volume, 0, 'f', 1));
300  ui->squelch->setValue(m_settings.m_squelch);
301  ui->squelchText->setText(QString("%1 dB").arg(m_settings.m_squelch));
302  ui->audioMute->setChecked(m_settings.m_audioMute);
303 
304  blockApplySettings(false);
305 }
qint64 m_inputFrequencyOffset
int getCenterFrequency() const
Definition: channelmarker.h:42
Ui::WFMDemodGUI * ui
Definition: wfmdemodgui.h:43
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void setTitleColor(const QColor &c)
const QString & getTitle() const
Definition: channelmarker.h:38
void blockApplySettings(bool block)
WFMDemodSettings m_settings
Definition: wfmdemodgui.h:47
void setColor(const QColor &color)
void setBandwidth(int bandwidth)
void setTitle(const QString &title)
void setCenterFrequency(int centerFrequency)
ChannelMarker m_channelMarker
Definition: wfmdemodgui.h:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ enterEvent()

void WFMDemodGUI::enterEvent ( QEvent *  )
private

Definition at line 312 of file wfmdemodgui.cpp.

References m_channelMarker, and ChannelMarker::setHighlighted().

313 {
315 }
void setHighlighted(bool highlighted)
ChannelMarker m_channelMarker
Definition: wfmdemodgui.h:46
+ Here is the call graph for this function:

◆ getCenterFrequency()

qint64 WFMDemodGUI::getCenterFrequency ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 43 of file wfmdemodgui.cpp.

References ChannelMarker::getCenterFrequency(), and m_channelMarker.

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

◆ getInputMessageQueue()

virtual MessageQueue* WFMDemodGUI::getInputMessageQueue ( )
inlinevirtual

Implements PluginInstanceGUI.

Definition at line 35 of file wfmdemodgui.h.

Referenced by handleInputMessages(), and WFMDemodGUI().

35 { return &m_inputMessageQueue; }
MessageQueue m_inputMessageQueue
Definition: wfmdemodgui.h:54
+ Here is the caller graph for this function:

◆ getName()

QString WFMDemodGUI::getName ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 38 of file wfmdemodgui.cpp.

39 {
40  return objectName();
41 }

◆ handleInputMessages

void WFMDemodGUI::handleInputMessages ( )
privateslot

Definition at line 97 of file wfmdemodgui.cpp.

References getInputMessageQueue(), and handleMessage().

Referenced by WFMDemodGUI().

98 {
99  Message* message;
100 
101  while ((message = getInputMessageQueue()->pop()) != 0)
102  {
103  if (handleMessage(*message))
104  {
105  delete message;
106  }
107  }
108 }
virtual bool handleMessage(const Message &message)
Definition: wfmdemodgui.cpp:78
virtual MessageQueue * getInputMessageQueue()
Definition: wfmdemodgui.h:35
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleMessage()

bool WFMDemodGUI::handleMessage ( const Message message)
virtual

Implements PluginInstanceGUI.

Definition at line 78 of file wfmdemodgui.cpp.

References blockApplySettings(), displaySettings(), WFMDemod::MsgConfigureWFMDemod::getSettings(), m_settings, and Message::match().

Referenced by handleInputMessages().

79 {
80  (void) message;
82  {
83  qDebug("WFMDemodGUI::handleMessage: WFMDemod::MsgConfigureWFMDemod");
85  m_settings = cfg.getSettings();
86  blockApplySettings(true);
88  blockApplySettings(false);
89  return true;
90  }
91  else
92  {
93  return false;
94  }
95 }
const WFMDemodSettings & getSettings() const
Definition: wfmdemod.h:55
void displaySettings()
void blockApplySettings(bool block)
static bool match(const Message *message)
Definition: message.cpp:45
WFMDemodSettings m_settings
Definition: wfmdemodgui.h:47
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ leaveEvent()

void WFMDemodGUI::leaveEvent ( QEvent *  )
private

Definition at line 307 of file wfmdemodgui.cpp.

References m_channelMarker, and ChannelMarker::setHighlighted().

308 {
310 }
void setHighlighted(bool highlighted)
ChannelMarker m_channelMarker
Definition: wfmdemodgui.h:46
+ Here is the call graph for this function:

◆ on_afBW_valueChanged

void WFMDemodGUI::on_afBW_valueChanged ( int  value)
privateslot

Definition at line 136 of file wfmdemodgui.cpp.

References applySettings(), arg(), WFMDemodSettings::m_afBandwidth, m_settings, and ui.

137 {
138  ui->afBWText->setText(QString("%1 kHz").arg(value));
139  m_settings.m_afBandwidth = value * 1000.0;
140  applySettings();
141 }
Ui::WFMDemodGUI * ui
Definition: wfmdemodgui.h:43
void applySettings(bool force=false)
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
WFMDemodSettings m_settings
Definition: wfmdemodgui.h:47
+ Here is the call graph for this function:

◆ on_audioMute_toggled

void WFMDemodGUI::on_audioMute_toggled ( bool  checked)
privateslot

Definition at line 157 of file wfmdemodgui.cpp.

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

158 {
159  m_settings.m_audioMute = checked;
160  applySettings();
161 }
void applySettings(bool force=false)
WFMDemodSettings m_settings
Definition: wfmdemodgui.h:47
+ Here is the call graph for this function:

◆ on_deltaFrequency_changed

void WFMDemodGUI::on_deltaFrequency_changed ( qint64  value)
privateslot

Definition at line 122 of file wfmdemodgui.cpp.

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

123 {
126  applySettings();
127 }
qint64 m_inputFrequencyOffset
int getCenterFrequency() const
Definition: channelmarker.h:42
void applySettings(bool force=false)
WFMDemodSettings m_settings
Definition: wfmdemodgui.h:47
void setCenterFrequency(int centerFrequency)
ChannelMarker m_channelMarker
Definition: wfmdemodgui.h:46
+ Here is the call graph for this function:

◆ on_rfBW_changed

void WFMDemodGUI::on_rfBW_changed ( quint64  value)
privateslot

Definition at line 129 of file wfmdemodgui.cpp.

References applySettings(), m_channelMarker, WFMDemodSettings::m_rfBandwidth, m_settings, and ChannelMarker::setBandwidth().

130 {
132  m_settings.m_rfBandwidth = value;
133  applySettings();
134 }
void applySettings(bool force=false)
WFMDemodSettings m_settings
Definition: wfmdemodgui.h:47
void setBandwidth(int bandwidth)
ChannelMarker m_channelMarker
Definition: wfmdemodgui.h:46
+ Here is the call graph for this function:

◆ on_squelch_valueChanged

void WFMDemodGUI::on_squelch_valueChanged ( int  value)
privateslot

Definition at line 150 of file wfmdemodgui.cpp.

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

151 {
152  ui->squelchText->setText(QString("%1 dB").arg(value));
153  m_settings.m_squelch = value;
154  applySettings();
155 }
Ui::WFMDemodGUI * ui
Definition: wfmdemodgui.h:43
void applySettings(bool force=false)
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
WFMDemodSettings m_settings
Definition: wfmdemodgui.h:47
+ Here is the call graph for this function:

◆ on_volume_valueChanged

void WFMDemodGUI::on_volume_valueChanged ( int  value)
privateslot

Definition at line 143 of file wfmdemodgui.cpp.

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

144 {
145  ui->volumeText->setText(QString("%1").arg(value / 10.0, 0, 'f', 1));
146  m_settings.m_volume = value / 10.0;
147  applySettings();
148 }
Ui::WFMDemodGUI * ui
Definition: wfmdemodgui.h:43
void applySettings(bool force=false)
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
WFMDemodSettings m_settings
Definition: wfmdemodgui.h:47
+ Here is the call graph for this function:

◆ onMenuDialogCalled

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

Definition at line 169 of file wfmdemodgui.cpp.

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

Referenced by WFMDemodGUI().

170 {
172  {
174  dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
175  dialog.setReverseAPIAddress(m_settings.m_reverseAPIAddress);
176  dialog.setReverseAPIPort(m_settings.m_reverseAPIPort);
177  dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex);
178  dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex);
179 
180  dialog.move(p);
181  dialog.exec();
182 
186  m_settings.m_useReverseAPI = dialog.useReverseAPI();
187  m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress();
188  m_settings.m_reverseAPIPort = dialog.getReverseAPIPort();
189  m_settings.m_reverseAPIDeviceIndex = dialog.getReverseAPIDeviceIndex();
190  m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex();
191 
192  setWindowTitle(m_settings.m_title);
194 
195  applySettings();
196  }
197 
199 }
qint64 m_inputFrequencyOffset
int getCenterFrequency() const
Definition: channelmarker.h:42
uint16_t m_reverseAPIPort
uint16_t m_reverseAPIChannelIndex
void resetContextMenuType()
Definition: rollupwidget.h:50
void applySettings(bool force=false)
ContextMenuType m_contextMenuType
Definition: rollupwidget.h:33
uint16_t m_reverseAPIDeviceIndex
QString m_reverseAPIAddress
void setTitleColor(const QColor &c)
const QString & getTitle() const
Definition: channelmarker.h:38
WFMDemodSettings m_settings
Definition: wfmdemodgui.h:47
const QColor & getColor() const
Definition: channelmarker.h:64
ChannelMarker m_channelMarker
Definition: wfmdemodgui.h:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ onWidgetRolled

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

Definition at line 163 of file wfmdemodgui.cpp.

Referenced by WFMDemodGUI().

164 {
165  (void) widget;
166  (void) rollDown;
167 }
+ Here is the caller graph for this function:

◆ resetToDefaults()

void WFMDemodGUI::resetToDefaults ( )
virtual

Implements PluginInstanceGUI.

Definition at line 54 of file wfmdemodgui.cpp.

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

Referenced by deserialize().

55 {
58  applySettings();
59 }
void applySettings(bool force=false)
void displaySettings()
WFMDemodSettings m_settings
Definition: wfmdemodgui.h:47
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize()

QByteArray WFMDemodGUI::serialize ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 61 of file wfmdemodgui.cpp.

References m_settings, and WFMDemodSettings::serialize().

62 {
63  return m_settings.serialize();
64 }
QByteArray serialize() const
WFMDemodSettings m_settings
Definition: wfmdemodgui.h:47
+ Here is the call graph for this function:

◆ setCenterFrequency()

void WFMDemodGUI::setCenterFrequency ( qint64  centerFrequency)
virtual

Implements PluginInstanceGUI.

Definition at line 48 of file wfmdemodgui.cpp.

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

49 {
50  m_channelMarker.setCenterFrequency(centerFrequency);
51  applySettings();
52 }
void applySettings(bool force=false)
void setCenterFrequency(int centerFrequency)
ChannelMarker m_channelMarker
Definition: wfmdemodgui.h:46
+ Here is the call graph for this function:

◆ setName()

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

Implements PluginInstanceGUI.

Definition at line 33 of file wfmdemodgui.cpp.

34 {
35  setObjectName(name);
36 }

◆ tick

void WFMDemodGUI::tick ( )
privateslot

Definition at line 330 of file wfmdemodgui.cpp.

References CalcDb::dbPower(), WFMDemod::getMagSqLevels(), WFMDemod::getSquelchOpen(), m_squelchOpen, m_wfmDemod, and ui.

Referenced by WFMDemodGUI().

331 {
332  double magsqAvg, magsqPeak;
333  int nbMagsqSamples;
334  m_wfmDemod->getMagSqLevels(magsqAvg, magsqPeak, nbMagsqSamples);
335  double powDbAvg = CalcDb::dbPower(magsqAvg);
336  double powDbPeak = CalcDb::dbPower(magsqPeak);
337 
338  ui->channelPower->setText(QString::number(powDbAvg, 'f', 1));
339  ui->channelPowerMeter->levelChanged(
340  (100.0f + powDbAvg) / 100.0f,
341  (100.0f + powDbPeak) / 100.0f,
342  nbMagsqSamples);
343 
344  bool squelchOpen = m_wfmDemod->getSquelchOpen();
345 
346  if (squelchOpen != m_squelchOpen)
347  {
348  if (squelchOpen) {
349  ui->audioMute->setStyleSheet("QToolButton { background-color : green; }");
350  } else {
351  ui->audioMute->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
352  }
353 
354  m_squelchOpen = squelchOpen;
355  }
356 }
WFMDemod * m_wfmDemod
Definition: wfmdemodgui.h:53
static double dbPower(double magsq, double floor=1e-12)
Definition: db.cpp:22
Ui::WFMDemodGUI * ui
Definition: wfmdemodgui.h:43
bool getSquelchOpen() const
Definition: wfmdemod.h:124
void getMagSqLevels(double &avg, double &peak, int &nbSamples)
Definition: wfmdemod.h:126
bool m_squelchOpen
Definition: wfmdemodgui.h:51
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_audioMute

bool WFMDemodGUI::m_audioMute
private

Definition at line 50 of file wfmdemodgui.h.

◆ m_basicSettingsShown

bool WFMDemodGUI::m_basicSettingsShown
private

Definition at line 48 of file wfmdemodgui.h.

◆ m_channelMarker

ChannelMarker WFMDemodGUI::m_channelMarker
private

◆ m_deviceUISet

DeviceUISet* WFMDemodGUI::m_deviceUISet
private

Definition at line 45 of file wfmdemodgui.h.

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

◆ m_doApplySettings

bool WFMDemodGUI::m_doApplySettings
private

Definition at line 49 of file wfmdemodgui.h.

Referenced by applySettings(), and blockApplySettings().

◆ m_inputMessageQueue

MessageQueue WFMDemodGUI::m_inputMessageQueue
private

Definition at line 54 of file wfmdemodgui.h.

◆ m_pluginAPI

PluginAPI* WFMDemodGUI::m_pluginAPI
private

Definition at line 44 of file wfmdemodgui.h.

◆ m_settings

WFMDemodSettings WFMDemodGUI::m_settings
private

◆ m_squelchOpen

bool WFMDemodGUI::m_squelchOpen
private

Definition at line 51 of file wfmdemodgui.h.

Referenced by tick().

◆ m_wfmDemod

WFMDemod* WFMDemodGUI::m_wfmDemod
private

Definition at line 53 of file wfmdemodgui.h.

Referenced by applySettings(), tick(), WFMDemodGUI(), and ~WFMDemodGUI().

◆ ui

Ui::WFMDemodGUI* WFMDemodGUI::ui
private

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