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

#include <udpsinkgui.h>

+ Inheritance diagram for UDPSinkGUI:
+ Collaboration diagram for UDPSinkGUI:

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

Private Slots

void handleSourceMessages ()
 
void on_deltaFrequency_changed (qint64 value)
 
void on_sampleFormat_currentIndexChanged (int index)
 
void on_outputUDPAddress_editingFinished ()
 
void on_outputUDPPort_editingFinished ()
 
void on_inputUDPAudioPort_editingFinished ()
 
void on_sampleRate_textEdited (const QString &arg1)
 
void on_rfBandwidth_textEdited (const QString &arg1)
 
void on_fmDeviation_textEdited (const QString &arg1)
 
void on_audioActive_toggled (bool active)
 
void on_audioStereo_toggled (bool stereo)
 
void on_applyBtn_clicked ()
 
void onWidgetRolled (QWidget *widget, bool rollDown)
 
void onMenuDialogCalled (const QPoint &p)
 
void on_gain_valueChanged (int value)
 
void on_volume_valueChanged (int value)
 
void on_squelch_valueChanged (int value)
 
void on_squelchGate_valueChanged (int value)
 
void on_agc_toggled (bool agc)
 
void tick ()
 

Private Member Functions

 UDPSinkGUI (PluginAPI *pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget *parent=0)
 
virtual ~UDPSinkGUI ()
 
void blockApplySettings (bool block)
 
void applySettings (bool force=false)
 
void applySettingsImmediate (bool force=false)
 
void displaySettings ()
 
void setSampleFormat (int index)
 
void setSampleFormatIndex (const UDPSinkSettings::SampleFormat &sampleFormat)
 
void leaveEvent (QEvent *)
 
void enterEvent (QEvent *)
 

Private Attributes

Ui::UDPSinkGUI * ui
 
PluginAPIm_pluginAPI
 
DeviceUISetm_deviceUISet
 
UDPSinkm_udpSink
 
UDPSinkSettings m_settings
 
ChannelMarker m_channelMarker
 
MovingAverage< double > m_channelPowerAvg
 
MovingAverage< double > m_inPowerAvg
 
uint32_t m_tickCount
 
bool m_doApplySettings
 
bool m_rfBandwidthChanged
 
MessageQueue m_inputMessageQueue
 
SpectrumVism_spectrumVis
 

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 41 of file udpsinkgui.h.

Constructor & Destructor Documentation

◆ UDPSinkGUI()

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

Definition at line 155 of file udpsinkgui.cpp.

References DeviceUISet::addChannelMarker(), DeviceUISet::addRollupWidget(), applySettings(), applySettingsImmediate(), arg(), FFTWindow::BlackmanHarris, channelMarkerChangedByCursor(), channelMarkerHighlightedByCursor(), SpectrumVis::configure(), displaySettings(), ChannelMarker::getColor(), getInputMessageQueue(), BasebandSampleSink::getInputMessageQueue(), MainWindow::getInstance(), ColorMapper::GrayGold, handleSourceMessages(), UDPSink::m_channelIdURI, m_channelMarker, m_deviceUISet, UDPSinkSettings::m_rgbColor, m_settings, m_spectrumVis, m_udpSink, onMenuDialogCalled(), onWidgetRolled(), DeviceUISet::registerRxChannelInstance(), SDR_RX_SCALEF, ChannelMarker::setBandwidth(), ChannelMarker::setCenterFrequency(), UDPSinkSettings::setChannelMarker(), ChannelMarker::setColor(), BasebandSampleSink::setMessageQueueToGUI(), UDPSink::setSpectrum(), UDPSinkSettings::setSpectrumGUI(), ChannelMarker::setTitle(), RollupWidget::setTitleColor(), ChannelMarker::setVisible(), tick(), ui, and RollupWidget::widgetRolled().

Referenced by create().

155  :
156  RollupWidget(parent),
157  ui(new Ui::UDPSinkGUI),
158  m_pluginAPI(pluginAPI),
159  m_deviceUISet(deviceUISet),
160  m_udpSink(0),
161  m_channelMarker(this),
162  m_channelPowerAvg(4, 1e-10),
163  m_inPowerAvg(4, 1e-10),
164  m_tickCount(0),
165  m_doApplySettings(true),
166  m_rfBandwidthChanged(false)
167 {
168  ui->setupUi(this);
169  connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
170  connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
171  setAttribute(Qt::WA_DeleteOnClose, true);
172 
173  m_spectrumVis = new SpectrumVis(SDR_RX_SCALEF, ui->glSpectrum);
174  m_udpSink = (UDPSink*) rxChannel; //new UDPSrc(m_deviceUISet->m_deviceSourceAPI);
177 
178  ui->fmDeviation->setEnabled(false);
179 
180  ui->deltaFrequencyLabel->setText(QString("%1f").arg(QChar(0x94, 0x03)));
181  ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
182  ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999);
183  ui->squelchLabel->setStyleSheet("QLabel { background:rgb(79,79,79); }");
184 
185  ui->glSpectrum->setCenterFrequency(0);
186  ui->glSpectrum->setSampleRate(ui->sampleRate->text().toInt());
187  ui->glSpectrum->setDisplayWaterfall(true);
188  ui->glSpectrum->setDisplayMaxHold(true);
190  64, // FFT size
191  10, // overlapping %
192  0, // number of averaging samples
193  0, // no averaging
195  false); // logarithmic scale
196 
197  ui->glSpectrum->connectTimer(MainWindow::getInstance()->getMasterTimer());
198  connect(&MainWindow::getInstance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick()));
199 
200  m_channelMarker.blockSignals(true);
203  m_channelMarker.setTitle("UDP Sample Source");
205  m_channelMarker.blockSignals(false);
206  m_channelMarker.setVisible(true); // activate signal on the last setting only
207 
209 
211  m_settings.setSpectrumGUI(ui->spectrumGUI);
212 
216 
217  connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor()));
218  connect(&m_channelMarker, SIGNAL(highlightedByCursor()), this, SLOT(channelMarkerHighlightedByCursor()));
219  connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages()));
220 
221  ui->spectrumGUI->setBuddies(m_spectrumVis->getInputMessageQueue(), m_spectrumVis, ui->glSpectrum);
222 
223  displaySettings();
225  applySettings(true);
226 }
Ui::UDPSinkGUI * ui
Definition: udpsinkgui.h:64
static MainWindow * getInstance()
Definition: mainwindow.h:73
void handleSourceMessages()
Definition: udpsinkgui.cpp:108
void onWidgetRolled(QWidget *widget, bool rollDown)
Definition: udpsinkgui.cpp:607
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
void displaySettings()
Definition: udpsinkgui.cpp:241
bool m_rfBandwidthChanged
Definition: udpsinkgui.h:76
bool m_doApplySettings
Definition: udpsinkgui.h:75
void addChannelMarker(ChannelMarker *channelMarker)
Add channel marker to spectrum.
Definition: deviceuiset.cpp:72
void setSpectrum(BasebandSampleSink *spectrum)
Definition: udpsink.h:102
void applySettingsImmediate(bool force=false)
Definition: udpsinkgui.cpp:390
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 tick()
Definition: udpsinkgui.cpp:133
ChannelMarker m_channelMarker
Definition: udpsinkgui.h:69
virtual void setMessageQueueToGUI(MessageQueue *queue)
void setTitleColor(const QColor &c)
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
DeviceUISet * m_deviceUISet
Definition: udpsinkgui.h:66
void setSpectrumGUI(Serializable *spectrumGUI)
void applySettings(bool force=false)
Definition: udpsinkgui.cpp:399
void setColor(const QColor &color)
MovingAverage< double > m_inPowerAvg
Definition: udpsinkgui.h:71
void setVisible(bool visible)
void channelMarkerHighlightedByCursor()
Definition: udpsinkgui.cpp:128
uint32_t m_tickCount
Definition: udpsinkgui.h:72
void configure(MessageQueue *msgQueue, int fftSize, int overlapPercent, unsigned int averagingNb, int averagingMode, FFTWindow::Function window, bool m_linear)
Definition: spectrumvis.cpp:44
void setBandwidth(int bandwidth)
void onMenuDialogCalled(const QPoint &p)
Definition: udpsinkgui.cpp:615
const QColor & getColor() const
Definition: channelmarker.h:64
void setTitle(const QString &title)
void channelMarkerChangedByCursor()
Definition: udpsinkgui.cpp:121
void setCenterFrequency(int centerFrequency)
UDPSink * m_udpSink
Definition: udpsinkgui.h:67
virtual MessageQueue * getInputMessageQueue()
Definition: udpsinkgui.h:56
static const QString m_channelIdURI
Definition: udpsink.h:145
MovingAverage< double > m_channelPowerAvg
Definition: udpsinkgui.h:70
void widgetRolled(QWidget *widget, bool rollDown)
PluginAPI * m_pluginAPI
Definition: udpsinkgui.h:65
UDPSinkSettings m_settings
Definition: udpsinkgui.h:68
void setChannelMarker(Serializable *channelMarker)
SpectrumVis * m_spectrumVis
Definition: udpsinkgui.h:80
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~UDPSinkGUI()

UDPSinkGUI::~UDPSinkGUI ( )
privatevirtual

Definition at line 228 of file udpsinkgui.cpp.

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

229 {
231  delete m_udpSink; // TODO: check this: when the GUI closes it has to delete the demodulator
232  delete m_spectrumVis;
233  delete ui;
234 }
Ui::UDPSinkGUI * ui
Definition: udpsinkgui.h:64
void removeRxChannelInstance(PluginInstanceGUI *pluginGUI)
Definition: deviceuiset.cpp:94
DeviceUISet * m_deviceUISet
Definition: udpsinkgui.h:66
UDPSink * m_udpSink
Definition: udpsinkgui.h:67
SpectrumVis * m_spectrumVis
Definition: udpsinkgui.h:80
+ Here is the call graph for this function:

Member Function Documentation

◆ applySettings()

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

Definition at line 399 of file udpsinkgui.cpp.

References UDPSink::MsgConfigureUDPSource::create(), UDPSink::MsgConfigureChannelizer::create(), ChannelMarker::getCenterFrequency(), BasebandSampleSink::getInputMessageQueue(), m_channelMarker, m_doApplySettings, UDPSinkSettings::m_outputSampleRate, m_settings, m_udpSink, MessageQueue::push(), and ui.

Referenced by deserialize(), on_applyBtn_clicked(), on_deltaFrequency_changed(), resetToDefaults(), setCenterFrequency(), and UDPSinkGUI().

400 {
401  if (m_doApplySettings)
402  {
405  m_udpSink->getInputMessageQueue()->push(channelConfigMsg);
406 
408  m_udpSink->getInputMessageQueue()->push(message);
409 
410  ui->applyBtn->setEnabled(false);
411  ui->applyBtn->setStyleSheet("QPushButton { background:rgb(79,79,79); }");
412  }
413 }
static MsgConfigureChannelizer * create(int sampleRate, int centerFrequency)
Definition: udpsink.h:83
Ui::UDPSinkGUI * ui
Definition: udpsinkgui.h:64
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: udpsinkgui.h:75
ChannelMarker m_channelMarker
Definition: udpsinkgui.h:69
UDPSink * m_udpSink
Definition: udpsinkgui.h:67
static MsgConfigureUDPSource * create(const UDPSinkSettings &settings, bool force)
Definition: udpsink.h:59
UDPSinkSettings m_settings
Definition: udpsinkgui.h:68
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applySettingsImmediate()

void UDPSinkGUI::applySettingsImmediate ( bool  force = false)
private

Definition at line 390 of file udpsinkgui.cpp.

References UDPSink::MsgConfigureUDPSource::create(), BasebandSampleSink::getInputMessageQueue(), m_doApplySettings, m_settings, m_udpSink, and MessageQueue::push().

Referenced by channelMarkerChangedByCursor(), deserialize(), on_agc_toggled(), on_audioActive_toggled(), on_audioStereo_toggled(), on_gain_valueChanged(), on_squelch_valueChanged(), on_squelchGate_valueChanged(), on_volume_valueChanged(), onMenuDialogCalled(), resetToDefaults(), and UDPSinkGUI().

391 {
392  if (m_doApplySettings)
393  {
395  m_udpSink->getInputMessageQueue()->push(message);
396  }
397 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
bool m_doApplySettings
Definition: udpsinkgui.h:75
UDPSink * m_udpSink
Definition: udpsinkgui.h:67
static MsgConfigureUDPSource * create(const UDPSinkSettings &settings, bool force)
Definition: udpsink.h:59
UDPSinkSettings m_settings
Definition: udpsinkgui.h:68
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ blockApplySettings()

void UDPSinkGUI::blockApplySettings ( bool  block)
private

Definition at line 236 of file udpsinkgui.cpp.

References m_doApplySettings.

Referenced by displaySettings(), and handleMessage().

237 {
238  m_doApplySettings = !block;
239 }
bool m_doApplySettings
Definition: udpsinkgui.h:75
+ Here is the caller graph for this function:

◆ channelMarkerChangedByCursor

void UDPSinkGUI::channelMarkerChangedByCursor ( )
slot

Definition at line 121 of file udpsinkgui.cpp.

References applySettingsImmediate(), ChannelMarker::getCenterFrequency(), m_channelMarker, UDPSinkSettings::m_inputFrequencyOffset, m_settings, and ui.

Referenced by UDPSinkGUI().

122 {
123  ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
126 }
Ui::UDPSinkGUI * ui
Definition: udpsinkgui.h:64
int getCenterFrequency() const
Definition: channelmarker.h:42
void applySettingsImmediate(bool force=false)
Definition: udpsinkgui.cpp:390
ChannelMarker m_channelMarker
Definition: udpsinkgui.h:69
int64_t m_inputFrequencyOffset
UDPSinkSettings m_settings
Definition: udpsinkgui.h:68
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ channelMarkerHighlightedByCursor

void UDPSinkGUI::channelMarkerHighlightedByCursor ( )
slot

Definition at line 128 of file udpsinkgui.cpp.

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

Referenced by UDPSinkGUI().

129 {
131 }
ChannelMarker m_channelMarker
Definition: udpsinkgui.h:69
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()

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

Definition at line 32 of file udpsinkgui.cpp.

References UDPSinkGUI().

Referenced by UDPSinkPlugin::createRxChannelGUI().

33 {
34  UDPSinkGUI* gui = new UDPSinkGUI(pluginAPI, deviceUISet, rxChannel);
35  return gui;
36 }
UDPSinkGUI(PluginAPI *pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget *parent=0)
Definition: udpsinkgui.cpp:155
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deserialize()

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

Implements PluginInstanceGUI.

Definition at line 77 of file udpsinkgui.cpp.

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

78 {
79  if(m_settings.deserialize(data))
80  {
83  applySettings(true);
84  return true;
85  } else {
87  return false;
88  }
89 }
bool deserialize(const QByteArray &data)
void displaySettings()
Definition: udpsinkgui.cpp:241
void applySettingsImmediate(bool force=false)
Definition: udpsinkgui.cpp:390
void applySettings(bool force=false)
Definition: udpsinkgui.cpp:399
void resetToDefaults()
Definition: udpsinkgui.cpp:64
UDPSinkSettings m_settings
Definition: udpsinkgui.h:68
+ Here is the call graph for this function:

◆ destroy()

void UDPSinkGUI::destroy ( )
virtual

Implements PluginInstanceGUI.

Definition at line 38 of file udpsinkgui.cpp.

39 {
40  delete this;
41 }

◆ displaySettings()

void UDPSinkGUI::displaySettings ( )
private

Definition at line 241 of file udpsinkgui.cpp.

References arg(), blockApplySettings(), ChannelMarker::getCenterFrequency(), ChannelMarker::getTitle(), UDPSinkSettings::m_agc, UDPSinkSettings::m_audioActive, UDPSinkSettings::m_audioPort, UDPSinkSettings::m_audioStereo, m_channelMarker, UDPSinkSettings::m_fmDeviation, UDPSinkSettings::m_gain, UDPSinkSettings::m_inputFrequencyOffset, UDPSinkSettings::m_outputSampleRate, UDPSinkSettings::m_rfBandwidth, UDPSinkSettings::m_rgbColor, UDPSinkSettings::m_sampleFormat, m_settings, UDPSinkSettings::m_squelchdB, UDPSinkSettings::m_squelchGate, UDPSinkSettings::m_title, UDPSinkSettings::m_udpAddress, UDPSinkSettings::m_udpPort, UDPSinkSettings::m_volume, ChannelMarker::setBandwidth(), ChannelMarker::setCenterFrequency(), ChannelMarker::setColor(), setSampleFormatIndex(), ChannelMarker::setTitle(), RollupWidget::setTitleColor(), and ui.

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

242 {
243  m_channelMarker.blockSignals(true);
247  m_channelMarker.blockSignals(false);
248  m_channelMarker.setColor(m_settings.m_rgbColor); // activate signal on the last setting only
249 
251  setWindowTitle(m_channelMarker.getTitle());
252 
253  blockApplySettings(true);
254 
255  ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
256 
257  ui->sampleRate->setText(QString("%1").arg(m_settings.m_outputSampleRate, 0));
259 
260  ui->outputUDPAddress->setText(m_settings.m_udpAddress);
261  ui->outputUDPPort->setText(tr("%1").arg(m_settings.m_udpPort));
262  ui->inputUDPAudioPort->setText(tr("%1").arg(m_settings.m_audioPort));
263 
264  ui->squelch->setValue(m_settings.m_squelchdB);
265  ui->squelchText->setText(tr("%1").arg(ui->squelch->value()*1.0, 0, 'f', 0));
266 
267  qDebug("UDPSinkGUI::deserialize: m_squelchGate: %d", m_settings.m_squelchGate);
268  ui->squelchGate->setValue(m_settings.m_squelchGate);
269  ui->squelchGateText->setText(tr("%1").arg(m_settings.m_squelchGate*10.0, 0, 'f', 0));
270 
271  ui->rfBandwidth->setText(QString("%1").arg(m_settings.m_rfBandwidth, 0));
272  ui->fmDeviation->setText(QString("%1").arg(m_settings.m_fmDeviation, 0));
273 
274  ui->agc->setChecked(m_settings.m_agc);
275  ui->audioActive->setChecked(m_settings.m_audioActive);
276  ui->audioStereo->setChecked(m_settings.m_audioStereo);
277 
278  ui->volume->setValue(m_settings.m_volume);
279  ui->volumeText->setText(QString("%1").arg(ui->volume->value()));
280 
281  ui->gain->setValue(m_settings.m_gain*10.0);
282  ui->gainText->setText(tr("%1").arg(ui->gain->value()/10.0, 0, 'f', 1));
283 
284  ui->applyBtn->setEnabled(false);
285  ui->applyBtn->setStyleSheet("QPushButton { background:rgb(79,79,79); }");
286 
287  blockApplySettings(false);
288 
289  ui->glSpectrum->setSampleRate(m_settings.m_outputSampleRate);
290 }
Ui::UDPSinkGUI * ui
Definition: udpsinkgui.h:64
int m_squelchdB
power dB
int getCenterFrequency() const
Definition: channelmarker.h:42
int m_squelchGate
100ths seconds
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
ChannelMarker m_channelMarker
Definition: udpsinkgui.h:69
void blockApplySettings(bool block)
Definition: udpsinkgui.cpp:236
void setTitleColor(const QColor &c)
const QString & getTitle() const
Definition: channelmarker.h:38
SampleFormat m_sampleFormat
void setColor(const QColor &color)
void setBandwidth(int bandwidth)
void setTitle(const QString &title)
uint16_t m_audioPort
int64_t m_inputFrequencyOffset
void setCenterFrequency(int centerFrequency)
UDPSinkSettings m_settings
Definition: udpsinkgui.h:68
void setSampleFormatIndex(const UDPSinkSettings::SampleFormat &sampleFormat)
Definition: udpsinkgui.cpp:292
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ enterEvent()

void UDPSinkGUI::enterEvent ( QEvent *  )
private

Definition at line 652 of file udpsinkgui.cpp.

References m_channelMarker, and ChannelMarker::setHighlighted().

653 {
655 }
ChannelMarker m_channelMarker
Definition: udpsinkgui.h:69
void setHighlighted(bool highlighted)
+ Here is the call graph for this function:

◆ getCenterFrequency()

qint64 UDPSinkGUI::getCenterFrequency ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 48 of file udpsinkgui.cpp.

References ChannelMarker::getCenterFrequency(), and m_channelMarker.

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

◆ getInputMessageQueue()

virtual MessageQueue* UDPSinkGUI::getInputMessageQueue ( )
inlinevirtual

Implements PluginInstanceGUI.

Definition at line 56 of file udpsinkgui.h.

Referenced by handleSourceMessages(), and UDPSinkGUI().

56 { return &m_inputMessageQueue; }
MessageQueue m_inputMessageQueue
Definition: udpsinkgui.h:77
+ Here is the caller graph for this function:

◆ getName()

QString UDPSinkGUI::getName ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 59 of file udpsinkgui.cpp.

60 {
61  return objectName();
62 }

◆ handleMessage()

bool UDPSinkGUI::handleMessage ( const Message message)
virtual

Implements PluginInstanceGUI.

Definition at line 91 of file udpsinkgui.cpp.

References blockApplySettings(), displaySettings(), UDPSink::MsgConfigureUDPSource::getSettings(), m_settings, and Message::match().

Referenced by handleSourceMessages().

92 {
94  {
96  m_settings = cfg.getSettings();
97  blockApplySettings(true);
99  blockApplySettings(false);
100  return true;
101  }
102  else
103  {
104  return false;
105  }
106 }
const UDPSinkSettings & getSettings() const
Definition: udpsink.h:56
void displaySettings()
Definition: udpsinkgui.cpp:241
void blockApplySettings(bool block)
Definition: udpsinkgui.cpp:236
static bool match(const Message *message)
Definition: message.cpp:45
UDPSinkSettings m_settings
Definition: udpsinkgui.h:68
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleSourceMessages

void UDPSinkGUI::handleSourceMessages ( )
privateslot

Definition at line 108 of file udpsinkgui.cpp.

References getInputMessageQueue(), and handleMessage().

Referenced by UDPSinkGUI().

109 {
110  Message* message;
111 
112  while ((message = getInputMessageQueue()->pop()) != 0)
113  {
114  if (handleMessage(*message))
115  {
116  delete message;
117  }
118  }
119 }
virtual MessageQueue * getInputMessageQueue()
Definition: udpsinkgui.h:56
virtual bool handleMessage(const Message &message)
Definition: udpsinkgui.cpp:91
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ leaveEvent()

void UDPSinkGUI::leaveEvent ( QEvent *  )
private

Definition at line 647 of file udpsinkgui.cpp.

References m_channelMarker, and ChannelMarker::setHighlighted().

648 {
650 }
ChannelMarker m_channelMarker
Definition: udpsinkgui.h:69
void setHighlighted(bool highlighted)
+ Here is the call graph for this function:

◆ on_agc_toggled

void UDPSinkGUI::on_agc_toggled ( bool  agc)
privateslot

Definition at line 562 of file udpsinkgui.cpp.

References applySettingsImmediate(), UDPSinkSettings::m_agc, and m_settings.

563 {
564  m_settings.m_agc = agc;
566 }
void applySettingsImmediate(bool force=false)
Definition: udpsinkgui.cpp:390
UDPSinkSettings m_settings
Definition: udpsinkgui.h:68
+ Here is the call graph for this function:

◆ on_applyBtn_clicked

void UDPSinkGUI::on_applyBtn_clicked ( )
privateslot

Definition at line 537 of file udpsinkgui.cpp.

References applySettings(), m_channelMarker, UDPSinkSettings::m_outputSampleRate, UDPSinkSettings::m_rfBandwidth, m_rfBandwidthChanged, m_settings, ChannelMarker::setBandwidth(), and ui.

538 {
540  {
542  m_rfBandwidthChanged = false;
543  }
544 
545  ui->glSpectrum->setSampleRate(m_settings.m_outputSampleRate);
546 
547  applySettings();
548 }
Ui::UDPSinkGUI * ui
Definition: udpsinkgui.h:64
bool m_rfBandwidthChanged
Definition: udpsinkgui.h:76
ChannelMarker m_channelMarker
Definition: udpsinkgui.h:69
void applySettings(bool force=false)
Definition: udpsinkgui.cpp:399
void setBandwidth(int bandwidth)
UDPSinkSettings m_settings
Definition: udpsinkgui.h:68
+ Here is the call graph for this function:

◆ on_audioActive_toggled

void UDPSinkGUI::on_audioActive_toggled ( bool  active)
privateslot

Definition at line 550 of file udpsinkgui.cpp.

References applySettingsImmediate(), UDPSinkSettings::m_audioActive, and m_settings.

551 {
552  m_settings.m_audioActive = active;
554 }
void applySettingsImmediate(bool force=false)
Definition: udpsinkgui.cpp:390
UDPSinkSettings m_settings
Definition: udpsinkgui.h:68
+ Here is the call graph for this function:

◆ on_audioStereo_toggled

void UDPSinkGUI::on_audioStereo_toggled ( bool  stereo)
privateslot

Definition at line 556 of file udpsinkgui.cpp.

References applySettingsImmediate(), UDPSinkSettings::m_audioStereo, and m_settings.

557 {
558  m_settings.m_audioStereo = stereo;
560 }
void applySettingsImmediate(bool force=false)
Definition: udpsinkgui.cpp:390
UDPSinkSettings m_settings
Definition: udpsinkgui.h:68
+ Here is the call graph for this function:

◆ on_deltaFrequency_changed

void UDPSinkGUI::on_deltaFrequency_changed ( qint64  value)
privateslot

Definition at line 415 of file udpsinkgui.cpp.

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

416 {
419  applySettings();
420 }
int getCenterFrequency() const
Definition: channelmarker.h:42
ChannelMarker m_channelMarker
Definition: udpsinkgui.h:69
void applySettings(bool force=false)
Definition: udpsinkgui.cpp:399
int64_t m_inputFrequencyOffset
void setCenterFrequency(int centerFrequency)
UDPSinkSettings m_settings
Definition: udpsinkgui.h:68
+ Here is the call graph for this function:

◆ on_fmDeviation_textEdited

void UDPSinkGUI::on_fmDeviation_textEdited ( const QString &  arg1)
privateslot

Definition at line 517 of file udpsinkgui.cpp.

References arg(), UDPSinkSettings::m_fmDeviation, m_settings, and ui.

518 {
519  (void) arg1;
520  bool ok;
521  int fmDeviation = ui->fmDeviation->text().toInt(&ok);
522 
523  if ((!ok) || (fmDeviation < 1))
524  {
525  m_settings.m_fmDeviation = 2500;
526  ui->fmDeviation->setText(QString("%1").arg(m_settings.m_fmDeviation));
527  }
528  else
529  {
530  m_settings.m_fmDeviation = fmDeviation;
531  }
532 
533  ui->applyBtn->setEnabled(true);
534  ui->applyBtn->setStyleSheet("QPushButton { background-color : green; }");
535 }
Ui::UDPSinkGUI * ui
Definition: udpsinkgui.h:64
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
UDPSinkSettings m_settings
Definition: udpsinkgui.h:68
+ Here is the call graph for this function:

◆ on_gain_valueChanged

void UDPSinkGUI::on_gain_valueChanged ( int  value)
privateslot

Definition at line 568 of file udpsinkgui.cpp.

References applySettingsImmediate(), arg(), UDPSinkSettings::m_gain, m_settings, and ui.

569 {
570  m_settings.m_gain = value / 10.0;
571  ui->gainText->setText(tr("%1").arg(value/10.0, 0, 'f', 1));
573 }
Ui::UDPSinkGUI * ui
Definition: udpsinkgui.h:64
void applySettingsImmediate(bool force=false)
Definition: udpsinkgui.cpp:390
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
UDPSinkSettings m_settings
Definition: udpsinkgui.h:68
+ Here is the call graph for this function:

◆ on_inputUDPAudioPort_editingFinished

void UDPSinkGUI::on_inputUDPAudioPort_editingFinished ( )
privateslot

Definition at line 459 of file udpsinkgui.cpp.

References arg(), UDPSinkSettings::m_audioPort, m_settings, and ui.

460 {
461  bool ok;
462  quint16 udpPort = ui->inputUDPAudioPort->text().toInt(&ok);
463 
464  if((!ok) || (udpPort < 1024)) {
465  udpPort = 9997;
466  }
467 
468  m_settings.m_audioPort = udpPort;
469  ui->inputUDPAudioPort->setText(tr("%1").arg(m_settings.m_audioPort));
470 
471  ui->applyBtn->setEnabled(true);
472  ui->applyBtn->setStyleSheet("QPushButton { background-color : green; }");
473 }
Ui::UDPSinkGUI * ui
Definition: udpsinkgui.h:64
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
uint16_t m_audioPort
UDPSinkSettings m_settings
Definition: udpsinkgui.h:68
+ Here is the call graph for this function:

◆ on_outputUDPAddress_editingFinished

void UDPSinkGUI::on_outputUDPAddress_editingFinished ( )
privateslot

Definition at line 436 of file udpsinkgui.cpp.

References m_settings, UDPSinkSettings::m_udpAddress, and ui.

437 {
438  m_settings.m_udpAddress = ui->outputUDPAddress->text();
439  ui->applyBtn->setEnabled(true);
440  ui->applyBtn->setStyleSheet("QPushButton { background-color : green; }");
441 }
Ui::UDPSinkGUI * ui
Definition: udpsinkgui.h:64
UDPSinkSettings m_settings
Definition: udpsinkgui.h:68

◆ on_outputUDPPort_editingFinished

void UDPSinkGUI::on_outputUDPPort_editingFinished ( )
privateslot

Definition at line 443 of file udpsinkgui.cpp.

References arg(), m_settings, UDPSinkSettings::m_udpPort, and ui.

444 {
445  bool ok;
446  quint16 udpPort = ui->outputUDPPort->text().toInt(&ok);
447 
448  if((!ok) || (udpPort < 1024)) {
449  udpPort = 9998;
450  }
451 
452  m_settings.m_udpPort = udpPort;
453  ui->outputUDPPort->setText(tr("%1").arg(m_settings.m_udpPort));
454 
455  ui->applyBtn->setEnabled(true);
456  ui->applyBtn->setStyleSheet("QPushButton { background-color : green; }");
457 }
Ui::UDPSinkGUI * ui
Definition: udpsinkgui.h:64
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
UDPSinkSettings m_settings
Definition: udpsinkgui.h:68
+ Here is the call graph for this function:

◆ on_rfBandwidth_textEdited

void UDPSinkGUI::on_rfBandwidth_textEdited ( const QString &  arg1)
privateslot

Definition at line 495 of file udpsinkgui.cpp.

References arg(), UDPSinkSettings::m_outputSampleRate, UDPSinkSettings::m_rfBandwidth, m_rfBandwidthChanged, m_settings, and ui.

496 {
497  (void) arg1;
498  bool ok;
499  Real rfBandwidth = ui->rfBandwidth->text().toDouble(&ok);
500 
501  if ((!ok) || (rfBandwidth > m_settings.m_outputSampleRate))
502  {
504  ui->rfBandwidth->setText(QString("%1").arg(m_settings.m_rfBandwidth, 0));
505  }
506  else
507  {
508  m_settings.m_rfBandwidth = rfBandwidth;
509  }
510 
511  m_rfBandwidthChanged = true;
512 
513  ui->applyBtn->setEnabled(true);
514  ui->applyBtn->setStyleSheet("QPushButton { background-color : green; }");
515 }
Ui::UDPSinkGUI * ui
Definition: udpsinkgui.h:64
bool m_rfBandwidthChanged
Definition: udpsinkgui.h:76
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
float Real
Definition: dsptypes.h:42
UDPSinkSettings m_settings
Definition: udpsinkgui.h:68
+ Here is the call graph for this function:

◆ on_sampleFormat_currentIndexChanged

void UDPSinkGUI::on_sampleFormat_currentIndexChanged ( int  index)
privateslot

Definition at line 422 of file udpsinkgui.cpp.

References setSampleFormat(), and ui.

423 {
424  if ((index == 1) || (index == 2)) {
425  ui->fmDeviation->setEnabled(true);
426  } else {
427  ui->fmDeviation->setEnabled(false);
428  }
429 
430  setSampleFormat(index);
431 
432  ui->applyBtn->setEnabled(true);
433  ui->applyBtn->setStyleSheet("QPushButton { background-color : green; }");
434 }
Ui::UDPSinkGUI * ui
Definition: udpsinkgui.h:64
void setSampleFormat(int index)
Definition: udpsinkgui.cpp:335
+ Here is the call graph for this function:

◆ on_sampleRate_textEdited

void UDPSinkGUI::on_sampleRate_textEdited ( const QString &  arg1)
privateslot

Definition at line 475 of file udpsinkgui.cpp.

References arg(), UDPSinkSettings::m_outputSampleRate, m_settings, and ui.

476 {
477  (void) arg1;
478  bool ok;
479  Real outputSampleRate = ui->sampleRate->text().toDouble(&ok);
480 
481  if((!ok) || (outputSampleRate < 1000))
482  {
484  ui->sampleRate->setText(QString("%1").arg(outputSampleRate, 0));
485  }
486  else
487  {
488  m_settings.m_outputSampleRate = outputSampleRate;
489  }
490 
491  ui->applyBtn->setEnabled(true);
492  ui->applyBtn->setStyleSheet("QPushButton { background-color : green; }");
493 }
Ui::UDPSinkGUI * ui
Definition: udpsinkgui.h:64
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
float Real
Definition: dsptypes.h:42
UDPSinkSettings m_settings
Definition: udpsinkgui.h:68
+ Here is the call graph for this function:

◆ on_squelch_valueChanged

void UDPSinkGUI::on_squelch_valueChanged ( int  value)
privateslot

Definition at line 582 of file udpsinkgui.cpp.

References applySettingsImmediate(), arg(), m_settings, UDPSinkSettings::m_squelchdB, UDPSinkSettings::m_squelchEnabled, and ui.

583 {
584  m_settings.m_squelchdB = value;
585 
586  if (value == -100) // means disabled
587  {
588  ui->squelchText->setText("---");
590  }
591  else
592  {
593  ui->squelchText->setText(tr("%1").arg(value*1.0, 0, 'f', 0));
595  }
596 
598 }
Ui::UDPSinkGUI * ui
Definition: udpsinkgui.h:64
int m_squelchdB
power dB
void applySettingsImmediate(bool force=false)
Definition: udpsinkgui.cpp:390
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
UDPSinkSettings m_settings
Definition: udpsinkgui.h:68
+ Here is the call graph for this function:

◆ on_squelchGate_valueChanged

void UDPSinkGUI::on_squelchGate_valueChanged ( int  value)
privateslot

Definition at line 600 of file udpsinkgui.cpp.

References applySettingsImmediate(), arg(), m_settings, UDPSinkSettings::m_squelchGate, and ui.

601 {
602  m_settings.m_squelchGate = value;
603  ui->squelchGateText->setText(tr("%1").arg(value*10.0, 0, 'f', 0));
605 }
Ui::UDPSinkGUI * ui
Definition: udpsinkgui.h:64
void applySettingsImmediate(bool force=false)
Definition: udpsinkgui.cpp:390
int m_squelchGate
100ths seconds
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
UDPSinkSettings m_settings
Definition: udpsinkgui.h:68
+ Here is the call graph for this function:

◆ on_volume_valueChanged

void UDPSinkGUI::on_volume_valueChanged ( int  value)
privateslot

Definition at line 575 of file udpsinkgui.cpp.

References applySettingsImmediate(), arg(), m_settings, UDPSinkSettings::m_volume, and ui.

576 {
577  m_settings.m_volume = value;
578  ui->volumeText->setText(QString("%1").arg(value));
580 }
Ui::UDPSinkGUI * ui
Definition: udpsinkgui.h:64
void applySettingsImmediate(bool force=false)
Definition: udpsinkgui.cpp:390
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
UDPSinkSettings m_settings
Definition: udpsinkgui.h:68
+ Here is the call graph for this function:

◆ onMenuDialogCalled

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

Definition at line 615 of file udpsinkgui.cpp.

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

Referenced by UDPSinkGUI().

616 {
618  {
620  dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
621  dialog.setReverseAPIAddress(m_settings.m_reverseAPIAddress);
622  dialog.setReverseAPIPort(m_settings.m_reverseAPIPort);
623  dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex);
624  dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex);
625 
626  dialog.move(p);
627  dialog.exec();
628 
632  m_settings.m_useReverseAPI = dialog.useReverseAPI();
633  m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress();
634  m_settings.m_reverseAPIPort = dialog.getReverseAPIPort();
635  m_settings.m_reverseAPIDeviceIndex = dialog.getReverseAPIDeviceIndex();
636  m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex();
637 
638  setWindowTitle(m_settings.m_title);
640 
642  }
643 
645 }
int getCenterFrequency() const
Definition: channelmarker.h:42
uint16_t m_reverseAPIPort
void resetContextMenuType()
Definition: rollupwidget.h:50
void applySettingsImmediate(bool force=false)
Definition: udpsinkgui.cpp:390
ContextMenuType m_contextMenuType
Definition: rollupwidget.h:33
ChannelMarker m_channelMarker
Definition: udpsinkgui.h:69
uint16_t m_reverseAPIDeviceIndex
void setTitleColor(const QColor &c)
const QString & getTitle() const
Definition: channelmarker.h:38
uint16_t m_reverseAPIChannelIndex
const QColor & getColor() const
Definition: channelmarker.h:64
int64_t m_inputFrequencyOffset
UDPSinkSettings m_settings
Definition: udpsinkgui.h:68
QString m_reverseAPIAddress
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ onWidgetRolled

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

Definition at line 607 of file udpsinkgui.cpp.

References BasebandSampleSink::getInputMessageQueue(), m_udpSink, UDPSink::setSpectrum(), and ui.

Referenced by UDPSinkGUI().

608 {
609  if ((widget == ui->spectrumBox) && (m_udpSink != 0))
610  {
612  }
613 }
Ui::UDPSinkGUI * ui
Definition: udpsinkgui.h:64
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
void setSpectrum(BasebandSampleSink *spectrum)
Definition: udpsink.h:102
UDPSink * m_udpSink
Definition: udpsinkgui.h:67
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetToDefaults()

void UDPSinkGUI::resetToDefaults ( )
virtual

Implements PluginInstanceGUI.

Definition at line 64 of file udpsinkgui.cpp.

References applySettings(), applySettingsImmediate(), displaySettings(), m_settings, and UDPSinkSettings::resetToDefaults().

Referenced by deserialize().

65 {
69  applySettings(true);
70 }
void displaySettings()
Definition: udpsinkgui.cpp:241
void applySettingsImmediate(bool force=false)
Definition: udpsinkgui.cpp:390
void applySettings(bool force=false)
Definition: udpsinkgui.cpp:399
UDPSinkSettings m_settings
Definition: udpsinkgui.h:68
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize()

QByteArray UDPSinkGUI::serialize ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 72 of file udpsinkgui.cpp.

References m_settings, and UDPSinkSettings::serialize().

73 {
74  return m_settings.serialize();
75 }
QByteArray serialize() const
UDPSinkSettings m_settings
Definition: udpsinkgui.h:68
+ Here is the call graph for this function:

◆ setCenterFrequency()

void UDPSinkGUI::setCenterFrequency ( qint64  centerFrequency)
virtual

Implements PluginInstanceGUI.

Definition at line 53 of file udpsinkgui.cpp.

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

54 {
55  m_channelMarker.setCenterFrequency(centerFrequency);
56  applySettings();
57 }
ChannelMarker m_channelMarker
Definition: udpsinkgui.h:69
void applySettings(bool force=false)
Definition: udpsinkgui.cpp:399
void setCenterFrequency(int centerFrequency)
+ Here is the call graph for this function:

◆ setName()

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

Implements PluginInstanceGUI.

Definition at line 43 of file udpsinkgui.cpp.

44 {
45  setObjectName(name);
46 }

◆ setSampleFormat()

void UDPSinkGUI::setSampleFormat ( int  index)
private

Definition at line 335 of file udpsinkgui.cpp.

References UDPSinkSettings::FormatAMBPFMono, UDPSinkSettings::FormatAMMono, UDPSinkSettings::FormatAMNoDCMono, UDPSinkSettings::FormatIQ16, UDPSinkSettings::FormatIQ24, UDPSinkSettings::FormatLSB, UDPSinkSettings::FormatLSBMono, UDPSinkSettings::FormatNFM, UDPSinkSettings::FormatNFMMono, UDPSinkSettings::FormatUSB, UDPSinkSettings::FormatUSBMono, UDPSinkSettings::m_sampleFormat, m_settings, and ui.

Referenced by on_sampleFormat_currentIndexChanged().

336 {
337  switch(index)
338  {
339  case 0:
341  ui->fmDeviation->setEnabled(false);
342  break;
343  case 1:
345  ui->fmDeviation->setEnabled(false);
346  break;
347  case 2:
349  ui->fmDeviation->setEnabled(true);
350  break;
351  case 3:
353  ui->fmDeviation->setEnabled(true);
354  break;
355  case 4:
357  ui->fmDeviation->setEnabled(false);
358  break;
359  case 5:
361  ui->fmDeviation->setEnabled(false);
362  break;
363  case 6:
365  ui->fmDeviation->setEnabled(false);
366  break;
367  case 7:
369  ui->fmDeviation->setEnabled(false);
370  break;
371  case 8:
373  ui->fmDeviation->setEnabled(false);
374  break;
375  case 9:
377  ui->fmDeviation->setEnabled(false);
378  break;
379  case 10:
381  ui->fmDeviation->setEnabled(false);
382  break;
383  default:
385  ui->fmDeviation->setEnabled(false);
386  break;
387  }
388 }
Ui::UDPSinkGUI * ui
Definition: udpsinkgui.h:64
SampleFormat m_sampleFormat
UDPSinkSettings m_settings
Definition: udpsinkgui.h:68
+ Here is the caller graph for this function:

◆ setSampleFormatIndex()

void UDPSinkGUI::setSampleFormatIndex ( const UDPSinkSettings::SampleFormat sampleFormat)
private

Definition at line 292 of file udpsinkgui.cpp.

References UDPSinkSettings::FormatAMBPFMono, UDPSinkSettings::FormatAMMono, UDPSinkSettings::FormatAMNoDCMono, UDPSinkSettings::FormatIQ16, UDPSinkSettings::FormatIQ24, UDPSinkSettings::FormatLSB, UDPSinkSettings::FormatLSBMono, UDPSinkSettings::FormatNFM, UDPSinkSettings::FormatNFMMono, UDPSinkSettings::FormatUSB, UDPSinkSettings::FormatUSBMono, and ui.

Referenced by displaySettings().

293 {
294  switch(sampleFormat)
295  {
297  ui->sampleFormat->setCurrentIndex(0);
298  break;
300  ui->sampleFormat->setCurrentIndex(1);
301  break;
303  ui->sampleFormat->setCurrentIndex(2);
304  break;
306  ui->sampleFormat->setCurrentIndex(3);
307  break;
309  ui->sampleFormat->setCurrentIndex(4);
310  break;
312  ui->sampleFormat->setCurrentIndex(5);
313  break;
315  ui->sampleFormat->setCurrentIndex(6);
316  break;
318  ui->sampleFormat->setCurrentIndex(7);
319  break;
321  ui->sampleFormat->setCurrentIndex(8);
322  break;
324  ui->sampleFormat->setCurrentIndex(9);
325  break;
327  ui->sampleFormat->setCurrentIndex(10);
328  break;
329  default:
330  ui->sampleFormat->setCurrentIndex(0);
331  break;
332  }
333 }
Ui::UDPSinkGUI * ui
Definition: udpsinkgui.h:64
+ Here is the caller graph for this function:

◆ tick

void UDPSinkGUI::tick ( )
privateslot

Definition at line 133 of file udpsinkgui.cpp.

References MovingAverage< Type >::average(), CalcDb::dbPower(), MovingAverage< Type >::feed(), UDPSink::getInMagSq(), UDPSink::getMagSq(), UDPSink::getSquelchOpen(), m_inPowerAvg, m_tickCount, m_udpSink, and ui.

Referenced by UDPSinkGUI().

134 {
135  if (m_tickCount % 4 == 0)
136  {
137 // m_channelPowerAvg.feed(m_udpSrc->getMagSq());
138 // double powDb = CalcDb::dbPower(m_channelPowerAvg.average());
139  double powDb = CalcDb::dbPower(m_udpSink->getMagSq());
140  ui->channelPower->setText(QString::number(powDb, 'f', 1));
142  double inPowDb = CalcDb::dbPower(m_inPowerAvg.average());
143  ui->inputPower->setText(QString::number(inPowDb, 'f', 1));
144  }
145 
146  if (m_udpSink->getSquelchOpen()) {
147  ui->squelchLabel->setStyleSheet("QLabel { background-color : green; }");
148  } else {
149  ui->squelchLabel->setStyleSheet("QLabel { background:rgb(79,79,79); }");
150  }
151 
152  m_tickCount++;
153 }
Ui::UDPSinkGUI * ui
Definition: udpsinkgui.h:64
void feed(Type value)
Definition: movingaverage.h:24
static double dbPower(double magsq, double floor=1e-12)
Definition: db.cpp:22
bool getSquelchOpen() const
Definition: udpsink.h:107
Type average() const
Definition: movingaverage.h:43
double getInMagSq() const
Definition: udpsink.h:106
double getMagSq() const
Definition: udpsink.h:105
MovingAverage< double > m_inPowerAvg
Definition: udpsinkgui.h:71
uint32_t m_tickCount
Definition: udpsinkgui.h:72
UDPSink * m_udpSink
Definition: udpsinkgui.h:67
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_channelMarker

ChannelMarker UDPSinkGUI::m_channelMarker
private

◆ m_channelPowerAvg

MovingAverage<double> UDPSinkGUI::m_channelPowerAvg
private

Definition at line 70 of file udpsinkgui.h.

◆ m_deviceUISet

DeviceUISet* UDPSinkGUI::m_deviceUISet
private

Definition at line 66 of file udpsinkgui.h.

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

◆ m_doApplySettings

bool UDPSinkGUI::m_doApplySettings
private

Definition at line 75 of file udpsinkgui.h.

Referenced by applySettings(), applySettingsImmediate(), and blockApplySettings().

◆ m_inPowerAvg

MovingAverage<double> UDPSinkGUI::m_inPowerAvg
private

Definition at line 71 of file udpsinkgui.h.

Referenced by tick().

◆ m_inputMessageQueue

MessageQueue UDPSinkGUI::m_inputMessageQueue
private

Definition at line 77 of file udpsinkgui.h.

◆ m_pluginAPI

PluginAPI* UDPSinkGUI::m_pluginAPI
private

Definition at line 65 of file udpsinkgui.h.

◆ m_rfBandwidthChanged

bool UDPSinkGUI::m_rfBandwidthChanged
private

Definition at line 76 of file udpsinkgui.h.

Referenced by on_applyBtn_clicked(), and on_rfBandwidth_textEdited().

◆ m_settings

UDPSinkSettings UDPSinkGUI::m_settings
private

◆ m_spectrumVis

SpectrumVis* UDPSinkGUI::m_spectrumVis
private

Definition at line 80 of file udpsinkgui.h.

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

◆ m_tickCount

uint32_t UDPSinkGUI::m_tickCount
private

Definition at line 72 of file udpsinkgui.h.

Referenced by tick().

◆ m_udpSink

UDPSink* UDPSinkGUI::m_udpSink
private

◆ ui

Ui::UDPSinkGUI* UDPSinkGUI::ui
private

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