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

#include <udpsourcegui.h>

+ Inheritance diagram for UDPSourceGUI:
+ Collaboration diagram for UDPSourceGUI:

Public Slots

void channelMarkerChangedByCursor ()
 

Public Member Functions

virtual void destroy ()
 
void setName (const QString &name)
 
QString getName () const
 
virtual qint64 getCenterFrequency () const
 
virtual void setCenterFrequency (qint64 centerFrequency)
 
virtual void resetToDefaults ()
 
virtual QByteArray serialize () const
 
virtual 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 UDPSourceGUIcreate (PluginAPI *pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSource *channelTx)
 

Private Slots

void handleSourceMessages ()
 
void on_deltaFrequency_changed (qint64 value)
 
void on_sampleFormat_currentIndexChanged (int index)
 
void on_localUDPAddress_editingFinished ()
 
void on_localUDPPort_editingFinished ()
 
void on_sampleRate_textEdited (const QString &arg1)
 
void on_rfBandwidth_textEdited (const QString &arg1)
 
void on_fmDeviation_textEdited (const QString &arg1)
 
void on_amModPercent_textEdited (const QString &arg1)
 
void on_applyBtn_clicked ()
 
void onWidgetRolled (QWidget *widget, bool rollDown)
 
void onMenuDialogCalled (const QPoint &p)
 
void on_gainIn_valueChanged (int value)
 
void on_gainOut_valueChanged (int value)
 
void on_squelch_valueChanged (int value)
 
void on_squelchGate_valueChanged (int value)
 
void on_channelMute_toggled (bool checked)
 
void on_resetUDPReadIndex_clicked ()
 
void on_autoRWBalance_toggled (bool checked)
 
void on_stereoInput_toggled (bool checked)
 
void tick ()
 

Private Member Functions

 UDPSourceGUI (PluginAPI *pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSource *channelTx, QWidget *parent=NULL)
 
virtual ~UDPSourceGUI ()
 
void blockApplySettings (bool block)
 
void applySettings (bool force=false)
 
void displaySettings ()
 
void setSampleFormat (int index)
 
void setSampleFormatIndex (const UDPSourceSettings::SampleFormat &sampleFormat)
 
void leaveEvent (QEvent *)
 
void enterEvent (QEvent *)
 

Private Attributes

Ui::UDPSourceGUI * ui
 
PluginAPIm_pluginAPI
 
DeviceUISetm_deviceUISet
 
SpectrumVism_spectrumVis
 
UDPSourcem_udpSource
 
MovingAverageUtil< double, double, 4 > m_channelPowerAvg
 
MovingAverageUtil< double, double, 4 > m_inPowerAvg
 
uint32_t m_tickCount
 
ChannelMarker m_channelMarker
 
UDPSourceSettings m_settings
 
bool m_rfBandwidthChanged
 
bool m_doApplySettings
 
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 41 of file udpsourcegui.h.

Constructor & Destructor Documentation

◆ UDPSourceGUI()

UDPSourceGUI::UDPSourceGUI ( PluginAPI pluginAPI,
DeviceUISet deviceUISet,
BasebandSampleSource channelTx,
QWidget *  parent = NULL 
)
explicitprivate

Definition at line 117 of file udpsourcegui.cpp.

References DeviceUISet::addChannelMarker(), DeviceUISet::addRollupWidget(), applySettings(), arg(), FFTWindow::BlackmanHarris, channelMarkerChangedByCursor(), SpectrumVis::configure(), displaySettings(), getInputMessageQueue(), BasebandSampleSink::getInputMessageQueue(), MainWindow::getInstance(), ColorMapper::GrayGold, handleSourceMessages(), UDPSource::m_channelIdURI, m_channelMarker, m_deviceUISet, UDPSourceSettings::m_rgbColor, m_settings, m_spectrumVis, m_udpSource, onMenuDialogCalled(), onWidgetRolled(), DeviceUISet::registerTxChannelInstance(), SDR_TX_SCALEF, ChannelMarker::setBandwidth(), ChannelMarker::setCenterFrequency(), ChannelMarker::setColor(), BasebandSampleSource::setMessageQueueToGUI(), ChannelMarker::setSourceOrSinkStream(), UDPSource::setSpectrumSink(), ChannelMarker::setTitle(), ChannelMarker::setVisible(), tick(), ui, and RollupWidget::widgetRolled().

Referenced by create().

117  :
118  RollupWidget(parent),
119  ui(new Ui::UDPSourceGUI),
120  m_pluginAPI(pluginAPI),
121  m_deviceUISet(deviceUISet),
122  m_tickCount(0),
123  m_channelMarker(this),
124  m_rfBandwidthChanged(false),
125  m_doApplySettings(true)
126 {
127  ui->setupUi(this);
128  connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
129  connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
130  setAttribute(Qt::WA_DeleteOnClose, true);
131 
132  m_spectrumVis = new SpectrumVis(SDR_TX_SCALEF, ui->glSpectrum);
133  m_udpSource = (UDPSource*) channelTx;
136 
137  ui->fmDeviation->setEnabled(false);
138  ui->deltaFrequencyLabel->setText(QString("%1f").arg(QChar(0x94, 0x03)));
139  ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
140  ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999);
141 
142  ui->glSpectrum->setCenterFrequency(0);
143  ui->glSpectrum->setSampleRate(ui->sampleRate->text().toInt());
144  ui->glSpectrum->setDisplayWaterfall(true);
145  ui->glSpectrum->setDisplayMaxHold(true);
147  64, // FFT size
148  10, // overlapping %
149  0, // number of averaging samples
150  0, // no averaging
152  false); // logarithmic scale
153 
154  ui->glSpectrum->connectTimer(MainWindow::getInstance()->getMasterTimer());
155  connect(&MainWindow::getInstance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick()));
156 
157  m_channelMarker.blockSignals(true);
161  m_channelMarker.setTitle("UDP Sample Sink");
163  m_channelMarker.blockSignals(false);
164  m_channelMarker.setVisible(true); // activate signal on the last setting only
165 
169 
170  connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor()));
171 
172  ui->spectrumGUI->setBuddies(m_spectrumVis->getInputMessageQueue(), m_spectrumVis, ui->glSpectrum);
173 
174  connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages()));
175  connect(m_udpSource, SIGNAL(levelChanged(qreal, qreal, int)), ui->volumeMeter, SLOT(levelChanged(qreal, qreal, int)));
176 
177  displaySettings();
178  applySettings(true);
179 }
static MainWindow * getInstance()
Definition: mainwindow.h:73
void registerTxChannelInstance(const QString &channelName, PluginInstanceGUI *pluginGUI)
Definition: deviceuiset.cpp:88
PluginAPI * m_pluginAPI
Definition: udpsourcegui.h:63
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
DeviceUISet * m_deviceUISet
Definition: udpsourcegui.h:64
static const QString m_channelIdURI
Definition: udpsource.h:143
void displaySettings()
void addChannelMarker(ChannelMarker *channelMarker)
Add channel marker to spectrum.
Definition: deviceuiset.cpp:72
virtual MessageQueue * getInputMessageQueue()
Definition: udpsourcegui.h:55
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
bool m_rfBandwidthChanged
Definition: udpsourcegui.h:74
Ui::UDPSourceGUI * ui
Definition: udpsourcegui.h:62
RollupWidget(QWidget *parent=NULL)
Definition: rollupwidget.cpp:7
#define SDR_TX_SCALEF
Definition: dsptypes.h:39
void setSourceOrSinkStream(bool sourceOrSinkStream)
Definition: channelmarker.h:75
void addRollupWidget(QWidget *widget)
Add rollup widget to channel window.
Definition: deviceuiset.cpp:77
virtual void setMessageQueueToGUI(MessageQueue *queue)
void handleSourceMessages()
void setSpectrumSink(BasebandSampleSink *spectrum)
Definition: udpsource.h:97
void onWidgetRolled(QWidget *widget, bool rollDown)
void setColor(const QColor &color)
SpectrumVis * m_spectrumVis
Definition: udpsourcegui.h:65
uint32_t m_tickCount
Definition: udpsourcegui.h:69
UDPSourceSettings m_settings
Definition: udpsourcegui.h:73
void setVisible(bool visible)
void onMenuDialogCalled(const QPoint &p)
ChannelMarker m_channelMarker
Definition: udpsourcegui.h:70
void configure(MessageQueue *msgQueue, int fftSize, int overlapPercent, unsigned int averagingNb, int averagingMode, FFTWindow::Function window, bool m_linear)
Definition: spectrumvis.cpp:44
void channelMarkerChangedByCursor()
void setBandwidth(int bandwidth)
void setTitle(const QString &title)
void setCenterFrequency(int centerFrequency)
UDPSource * m_udpSource
Definition: udpsourcegui.h:66
void widgetRolled(QWidget *widget, bool rollDown)
bool m_doApplySettings
Definition: udpsourcegui.h:75
void applySettings(bool force=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~UDPSourceGUI()

UDPSourceGUI::~UDPSourceGUI ( )
privatevirtual

Definition at line 181 of file udpsourcegui.cpp.

References m_deviceUISet, m_spectrumVis, m_udpSource, DeviceUISet::removeTxChannelInstance(), and ui.

182 {
184  delete m_udpSource; // TODO: check this: when the GUI closes it has to delete the modulator
185  delete m_spectrumVis;
186  delete ui;
187 }
void removeTxChannelInstance(PluginInstanceGUI *pluginGUI)
DeviceUISet * m_deviceUISet
Definition: udpsourcegui.h:64
Ui::UDPSourceGUI * ui
Definition: udpsourcegui.h:62
SpectrumVis * m_spectrumVis
Definition: udpsourcegui.h:65
UDPSource * m_udpSource
Definition: udpsourcegui.h:66
+ Here is the call graph for this function:

Member Function Documentation

◆ applySettings()

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

Definition at line 194 of file udpsourcegui.cpp.

References UDPSource::MsgConfigureUDPSource::create(), UDPSource::MsgConfigureChannelizer::create(), BasebandSampleSource::getInputMessageQueue(), m_doApplySettings, UDPSourceSettings::m_inputFrequencyOffset, UDPSourceSettings::m_inputSampleRate, m_settings, m_udpSource, MessageQueue::push(), and ui.

Referenced by channelMarkerChangedByCursor(), deserialize(), on_applyBtn_clicked(), on_autoRWBalance_toggled(), on_channelMute_toggled(), on_deltaFrequency_changed(), on_gainIn_valueChanged(), on_gainOut_valueChanged(), on_squelch_valueChanged(), on_squelchGate_valueChanged(), on_stereoInput_toggled(), onMenuDialogCalled(), resetToDefaults(), setCenterFrequency(), and UDPSourceGUI().

195 {
196  if (m_doApplySettings)
197  {
202 
205 
206  ui->applyBtn->setEnabled(false);
207  ui->applyBtn->setStyleSheet("QPushButton { background:rgb(79,79,79); }");
208  }
209 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
Ui::UDPSourceGUI * ui
Definition: udpsourcegui.h:62
UDPSourceSettings m_settings
Definition: udpsourcegui.h:73
UDPSource * m_udpSource
Definition: udpsourcegui.h:66
bool m_doApplySettings
Definition: udpsourcegui.h:75
static MsgConfigureUDPSource * create(const UDPSourceSettings &settings, bool force)
Definition: udpsource.h:53
static MsgConfigureChannelizer * create(int sampleRate, int centerFrequency)
Definition: udpsource.h:77
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ blockApplySettings()

void UDPSourceGUI::blockApplySettings ( bool  block)
private

Definition at line 189 of file udpsourcegui.cpp.

References m_doApplySettings.

Referenced by displaySettings(), and handleMessage().

190 {
191  m_doApplySettings = !block;
192 }
bool m_doApplySettings
Definition: udpsourcegui.h:75
+ Here is the caller graph for this function:

◆ channelMarkerChangedByCursor

void UDPSourceGUI::channelMarkerChangedByCursor ( )
slot

Definition at line 263 of file udpsourcegui.cpp.

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

Referenced by UDPSourceGUI().

264 {
265  ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
267  applySettings();
268 }
int getCenterFrequency() const
Definition: channelmarker.h:42
Ui::UDPSourceGUI * ui
Definition: udpsourcegui.h:62
UDPSourceSettings m_settings
Definition: udpsourcegui.h:73
ChannelMarker m_channelMarker
Definition: udpsourcegui.h:70
void applySettings(bool force=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

UDPSourceGUI * UDPSourceGUI::create ( PluginAPI pluginAPI,
DeviceUISet deviceUISet,
BasebandSampleSource channelTx 
)
static

Definition at line 31 of file udpsourcegui.cpp.

References UDPSourceGUI().

Referenced by UDPSourcePlugin::createTxChannelGUI().

32 {
33  UDPSourceGUI* gui = new UDPSourceGUI(pluginAPI, deviceUISet, channelTx);
34  return gui;
35 }
UDPSourceGUI(PluginAPI *pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSource *channelTx, QWidget *parent=NULL)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deserialize()

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

Implements PluginInstanceGUI.

Definition at line 74 of file udpsourcegui.cpp.

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

75 {
76  if(m_settings.deserialize(data))
77  {
79  applySettings(true);
80  return true;
81  } else {
83  return false;
84  }
85 }
virtual void resetToDefaults()
void displaySettings()
bool deserialize(const QByteArray &data)
UDPSourceSettings m_settings
Definition: udpsourcegui.h:73
void applySettings(bool force=false)
+ Here is the call graph for this function:

◆ destroy()

void UDPSourceGUI::destroy ( )
virtual

Implements PluginInstanceGUI.

Definition at line 37 of file udpsourcegui.cpp.

38 {
39  delete this;
40 }

◆ displaySettings()

void UDPSourceGUI::displaySettings ( )
private

Definition at line 211 of file udpsourcegui.cpp.

References arg(), blockApplySettings(), ChannelMarker::getTitle(), UDPSourceSettings::m_amModFactor, UDPSourceSettings::m_autoRWBalance, m_channelMarker, UDPSourceSettings::m_channelMute, UDPSourceSettings::m_fmDeviation, UDPSourceSettings::m_gainIn, UDPSourceSettings::m_gainOut, UDPSourceSettings::m_inputFrequencyOffset, UDPSourceSettings::m_inputSampleRate, UDPSourceSettings::m_rfBandwidth, UDPSourceSettings::m_rgbColor, UDPSourceSettings::m_sampleFormat, m_settings, UDPSourceSettings::m_squelch, UDPSourceSettings::m_squelchEnabled, UDPSourceSettings::m_squelchGate, UDPSourceSettings::m_stereoInput, UDPSourceSettings::m_udpAddress, UDPSourceSettings::m_udpPort, ChannelMarker::setBandwidth(), ChannelMarker::setCenterFrequency(), ChannelMarker::setColor(), setSampleFormatIndex(), RollupWidget::setTitleColor(), and ui.

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

212 {
213  m_channelMarker.blockSignals(true);
216  m_channelMarker.blockSignals(false);
218 
220  this->setWindowTitle(m_channelMarker.getTitle());
221 
222  blockApplySettings(true);
223 
224  ui->deltaFrequency->setValue(m_settings.m_inputFrequencyOffset);
225  ui->sampleRate->setText(QString("%1").arg(roundf(m_settings.m_inputSampleRate), 0));
226  ui->glSpectrum->setSampleRate(m_settings.m_inputSampleRate);
227  ui->rfBandwidth->setText(QString("%1").arg(roundf(m_settings.m_rfBandwidth), 0));
228  ui->fmDeviation->setText(QString("%1").arg(m_settings.m_fmDeviation, 0));
229  ui->amModPercent->setText(QString("%1").arg(roundf(m_settings.m_amModFactor * 100.0), 0));
230 
232 
233  ui->channelMute->setChecked(m_settings.m_channelMute);
234  ui->autoRWBalance->setChecked(m_settings.m_autoRWBalance);
235  ui->stereoInput->setChecked(m_settings.m_stereoInput);
236 
237  ui->gainInText->setText(tr("%1").arg(m_settings.m_gainIn, 0, 'f', 1));
238  ui->gainIn->setValue(roundf(m_settings.m_gainIn * 10.0));
239 
240  ui->gainOutText->setText(tr("%1").arg(m_settings.m_gainOut, 0, 'f', 1));
241  ui->gainOut->setValue(roundf(m_settings.m_gainOut * 10.0));
242 
244  ui->squelchText->setText(tr("%1").arg(m_settings.m_squelch, 0, 'f', 0));
245  } else {
246  ui->squelchText->setText("---");
247  }
248 
249  ui->squelch->setValue(roundf(m_settings.m_squelch));
250 
251  ui->squelchGateText->setText(tr("%1").arg(roundf(m_settings.m_squelchGate * 1000.0), 0, 'f', 0));
252  ui->squelchGate->setValue(roundf(m_settings.m_squelchGate * 100.0));
253 
254  ui->localUDPAddress->setText(m_settings.m_udpAddress);
255  ui->localUDPPort->setText(tr("%1").arg(m_settings.m_udpPort));
256 
257  ui->applyBtn->setEnabled(false);
258  ui->applyBtn->setStyleSheet("QPushButton { background:rgb(79,79,79); }");
259 
260  blockApplySettings(false);
261 }
void blockApplySettings(bool block)
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Real m_squelch
squared magnitude
Ui::UDPSourceGUI * ui
Definition: udpsourcegui.h:62
void setTitleColor(const QColor &c)
const QString & getTitle() const
Definition: channelmarker.h:38
void setSampleFormatIndex(const UDPSourceSettings::SampleFormat &sampleFormat)
void setColor(const QColor &color)
UDPSourceSettings m_settings
Definition: udpsourcegui.h:73
Real m_squelchGate
seconds
ChannelMarker m_channelMarker
Definition: udpsourcegui.h:70
SampleFormat m_sampleFormat
void setBandwidth(int bandwidth)
void setCenterFrequency(int centerFrequency)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ enterEvent()

void UDPSourceGUI::enterEvent ( QEvent *  )
private

Definition at line 509 of file udpsourcegui.cpp.

References m_channelMarker, and ChannelMarker::setHighlighted().

510 {
512 }
void setHighlighted(bool highlighted)
ChannelMarker m_channelMarker
Definition: udpsourcegui.h:70
+ Here is the call graph for this function:

◆ getCenterFrequency()

qint64 UDPSourceGUI::getCenterFrequency ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 52 of file udpsourcegui.cpp.

References ChannelMarker::getCenterFrequency(), and m_channelMarker.

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

◆ getInputMessageQueue()

virtual MessageQueue* UDPSourceGUI::getInputMessageQueue ( )
inlinevirtual

Implements PluginInstanceGUI.

Definition at line 55 of file udpsourcegui.h.

Referenced by handleSourceMessages(), and UDPSourceGUI().

55 { return &m_inputMessageQueue; }
MessageQueue m_inputMessageQueue
Definition: udpsourcegui.h:76
+ Here is the caller graph for this function:

◆ getName()

QString UDPSourceGUI::getName ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 47 of file udpsourcegui.cpp.

48 {
49  return objectName();
50 }

◆ handleMessage()

bool UDPSourceGUI::handleMessage ( const Message message)
virtual

Implements PluginInstanceGUI.

Definition at line 87 of file udpsourcegui.cpp.

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

Referenced by handleSourceMessages().

88 {
90  {
92  m_settings = cfg.getSettings();
93  blockApplySettings(true);
95  blockApplySettings(false);
96  return true;
97  }
98  else
99  {
100  return false;
101  }
102 }
void blockApplySettings(bool block)
const UDPSourceSettings & getSettings() const
Definition: udpsource.h:50
void displaySettings()
static bool match(const Message *message)
Definition: message.cpp:45
UDPSourceSettings m_settings
Definition: udpsourcegui.h:73
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleSourceMessages

void UDPSourceGUI::handleSourceMessages ( )
privateslot

Definition at line 104 of file udpsourcegui.cpp.

References getInputMessageQueue(), and handleMessage().

Referenced by UDPSourceGUI().

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

◆ leaveEvent()

void UDPSourceGUI::leaveEvent ( QEvent *  )
private

Definition at line 504 of file udpsourcegui.cpp.

References m_channelMarker, and ChannelMarker::setHighlighted().

505 {
507 }
void setHighlighted(bool highlighted)
ChannelMarker m_channelMarker
Definition: udpsourcegui.h:70
+ Here is the call graph for this function:

◆ on_amModPercent_textEdited

void UDPSourceGUI::on_amModPercent_textEdited ( const QString &  arg1)
privateslot

Definition at line 376 of file udpsourcegui.cpp.

References arg(), UDPSourceSettings::m_amModFactor, m_settings, and ui.

377 {
378  (void) arg1;
379  bool ok;
380  int amModPercent = ui->amModPercent->text().toInt(&ok);
381 
382  if ((!ok) || (amModPercent < 1) || (amModPercent > 100))
383  {
384  m_settings.m_amModFactor = 0.95;
385  ui->amModPercent->setText(QString("%1").arg(95));
386  } else {
387  m_settings.m_amModFactor = amModPercent / 100.0;
388  }
389 
390  ui->applyBtn->setEnabled(true);
391  ui->applyBtn->setStyleSheet("QPushButton { background-color : green; }");
392 }
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Ui::UDPSourceGUI * ui
Definition: udpsourcegui.h:62
UDPSourceSettings m_settings
Definition: udpsourcegui.h:73
+ Here is the call graph for this function:

◆ on_applyBtn_clicked

void UDPSourceGUI::on_applyBtn_clicked ( )
privateslot

Definition at line 435 of file udpsourcegui.cpp.

References applySettings(), m_channelMarker, UDPSourceSettings::m_inputSampleRate, UDPSourceSettings::m_rfBandwidth, m_rfBandwidthChanged, m_settings, ChannelMarker::setBandwidth(), and ui.

436 {
438  {
440  m_rfBandwidthChanged = false;
441  }
442 
443  ui->glSpectrum->setSampleRate(m_settings.m_inputSampleRate);
444 
445  applySettings();
446 }
bool m_rfBandwidthChanged
Definition: udpsourcegui.h:74
Ui::UDPSourceGUI * ui
Definition: udpsourcegui.h:62
UDPSourceSettings m_settings
Definition: udpsourcegui.h:73
ChannelMarker m_channelMarker
Definition: udpsourcegui.h:70
void setBandwidth(int bandwidth)
void applySettings(bool force=false)
+ Here is the call graph for this function:

◆ on_autoRWBalance_toggled

void UDPSourceGUI::on_autoRWBalance_toggled ( bool  checked)
privateslot

Definition at line 453 of file udpsourcegui.cpp.

References applySettings(), UDPSourceSettings::m_autoRWBalance, and m_settings.

454 {
455  m_settings.m_autoRWBalance = checked;
456  applySettings();
457 }
UDPSourceSettings m_settings
Definition: udpsourcegui.h:73
void applySettings(bool force=false)
+ Here is the call graph for this function:

◆ on_channelMute_toggled

void UDPSourceGUI::on_channelMute_toggled ( bool  checked)
privateslot

Definition at line 429 of file udpsourcegui.cpp.

References applySettings(), UDPSourceSettings::m_channelMute, and m_settings.

430 {
431  m_settings.m_channelMute = checked;
432  applySettings();
433 }
UDPSourceSettings m_settings
Definition: udpsourcegui.h:73
void applySettings(bool force=false)
+ Here is the call graph for this function:

◆ on_deltaFrequency_changed

void UDPSourceGUI::on_deltaFrequency_changed ( qint64  value)
privateslot

Definition at line 270 of file udpsourcegui.cpp.

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

271 {
274  applySettings();
275 }
UDPSourceSettings m_settings
Definition: udpsourcegui.h:73
ChannelMarker m_channelMarker
Definition: udpsourcegui.h:70
void setCenterFrequency(int centerFrequency)
void applySettings(bool force=false)
+ Here is the call graph for this function:

◆ on_fmDeviation_textEdited

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

Definition at line 359 of file udpsourcegui.cpp.

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

360 {
361  (void) arg1;
362  bool ok;
363  int fmDeviation = ui->fmDeviation->text().toInt(&ok);
364 
365  if ((!ok) || (fmDeviation < 1)) {
366  m_settings.m_fmDeviation = 2500;
367  ui->fmDeviation->setText(QString("%1").arg(m_settings.m_fmDeviation));
368  } else {
369  m_settings.m_fmDeviation = fmDeviation;
370  }
371 
372  ui->applyBtn->setEnabled(true);
373  ui->applyBtn->setStyleSheet("QPushButton { background-color : green; }");
374 }
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Ui::UDPSourceGUI * ui
Definition: udpsourcegui.h:62
UDPSourceSettings m_settings
Definition: udpsourcegui.h:73
+ Here is the call graph for this function:

◆ on_gainIn_valueChanged

void UDPSourceGUI::on_gainIn_valueChanged ( int  value)
privateslot

Definition at line 394 of file udpsourcegui.cpp.

References applySettings(), arg(), UDPSourceSettings::m_gainIn, m_settings, and ui.

395 {
396  m_settings.m_gainIn = value / 10.0;
397  ui->gainInText->setText(tr("%1").arg(m_settings.m_gainIn, 0, 'f', 1));
398  applySettings();
399 }
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Ui::UDPSourceGUI * ui
Definition: udpsourcegui.h:62
UDPSourceSettings m_settings
Definition: udpsourcegui.h:73
void applySettings(bool force=false)
+ Here is the call graph for this function:

◆ on_gainOut_valueChanged

void UDPSourceGUI::on_gainOut_valueChanged ( int  value)
privateslot

Definition at line 401 of file udpsourcegui.cpp.

References applySettings(), arg(), UDPSourceSettings::m_gainOut, m_settings, and ui.

402 {
403  m_settings.m_gainOut = value / 10.0;
404  ui->gainOutText->setText(tr("%1").arg(m_settings.m_gainOut, 0, 'f', 1));
405  applySettings();
406 }
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Ui::UDPSourceGUI * ui
Definition: udpsourcegui.h:62
UDPSourceSettings m_settings
Definition: udpsourcegui.h:73
void applySettings(bool force=false)
+ Here is the call graph for this function:

◆ on_localUDPAddress_editingFinished

void UDPSourceGUI::on_localUDPAddress_editingFinished ( )
privateslot

Definition at line 297 of file udpsourcegui.cpp.

References m_settings, UDPSourceSettings::m_udpAddress, and ui.

298 {
299  m_settings.m_udpAddress = ui->localUDPAddress->text();
300  ui->applyBtn->setEnabled(true);
301  ui->applyBtn->setStyleSheet("QPushButton { background-color : green; }");
302 }
Ui::UDPSourceGUI * ui
Definition: udpsourcegui.h:62
UDPSourceSettings m_settings
Definition: udpsourcegui.h:73

◆ on_localUDPPort_editingFinished

void UDPSourceGUI::on_localUDPPort_editingFinished ( )
privateslot

Definition at line 304 of file udpsourcegui.cpp.

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

305 {
306  bool ok;
307  quint16 udpPort = ui->localUDPPort->text().toInt(&ok);
308 
309  if((!ok) || (udpPort < 1024)) {
310  udpPort = 9998;
311  }
312 
313  m_settings.m_udpPort = udpPort;
314  ui->localUDPPort->setText(tr("%1").arg(m_settings.m_udpPort));
315 
316  ui->applyBtn->setEnabled(true);
317  ui->applyBtn->setStyleSheet("QPushButton { background-color : green; }");
318 }
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Ui::UDPSourceGUI * ui
Definition: udpsourcegui.h:62
UDPSourceSettings m_settings
Definition: udpsourcegui.h:73
+ Here is the call graph for this function:

◆ on_resetUDPReadIndex_clicked

void UDPSourceGUI::on_resetUDPReadIndex_clicked ( )
privateslot

Definition at line 448 of file udpsourcegui.cpp.

References m_udpSource, and UDPSource::resetReadIndex().

449 {
451 }
void resetReadIndex()
Definition: udpsource.cpp:456
UDPSource * m_udpSource
Definition: udpsourcegui.h:66
+ Here is the call graph for this function:

◆ on_rfBandwidth_textEdited

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

Definition at line 337 of file udpsourcegui.cpp.

References arg(), UDPSourceSettings::m_inputSampleRate, UDPSourceSettings::m_rfBandwidth, m_rfBandwidthChanged, m_settings, and ui.

338 {
339  (void) arg1;
340  bool ok;
341  Real rfBandwidth = ui->rfBandwidth->text().toDouble(&ok);
342 
343  if ((!ok) || (rfBandwidth > m_settings.m_inputSampleRate))
344  {
346  ui->rfBandwidth->setText(QString("%1").arg(m_settings.m_rfBandwidth, 0));
347  }
348  else
349  {
350  m_settings.m_rfBandwidth = rfBandwidth;
351  }
352 
353  m_rfBandwidthChanged = true;
354 
355  ui->applyBtn->setEnabled(true);
356  ui->applyBtn->setStyleSheet("QPushButton { background-color : green; }");
357 }
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
bool m_rfBandwidthChanged
Definition: udpsourcegui.h:74
Ui::UDPSourceGUI * ui
Definition: udpsourcegui.h:62
UDPSourceSettings m_settings
Definition: udpsourcegui.h:73
float Real
Definition: dsptypes.h:42
+ Here is the call graph for this function:

◆ on_sampleFormat_currentIndexChanged

void UDPSourceGUI::on_sampleFormat_currentIndexChanged ( int  index)
privateslot

Definition at line 277 of file udpsourcegui.cpp.

References UDPSourceSettings::FormatAM, UDPSourceSettings::FormatNFM, setSampleFormat(), and ui.

278 {
279  if (index == (int) UDPSourceSettings::FormatNFM) {
280  ui->fmDeviation->setEnabled(true);
281  } else {
282  ui->fmDeviation->setEnabled(false);
283  }
284 
285  if (index == (int) UDPSourceSettings::FormatAM) {
286  ui->amModPercent->setEnabled(true);
287  } else {
288  ui->amModPercent->setEnabled(false);
289  }
290 
291  setSampleFormat(index);
292 
293  ui->applyBtn->setEnabled(true);
294  ui->applyBtn->setStyleSheet("QPushButton { background-color : green; }");
295 }
Ui::UDPSourceGUI * ui
Definition: udpsourcegui.h:62
void setSampleFormat(int index)
+ Here is the call graph for this function:

◆ on_sampleRate_textEdited

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

Definition at line 320 of file udpsourcegui.cpp.

References arg(), UDPSourceSettings::m_inputSampleRate, m_settings, and ui.

321 {
322  (void) arg1;
323  bool ok;
324  Real inputSampleRate = ui->sampleRate->text().toDouble(&ok);
325 
326  if ((!ok) || (inputSampleRate < 1000)) {
328  ui->sampleRate->setText(QString("%1").arg(m_settings.m_inputSampleRate, 0));
329  } else {
330  m_settings.m_inputSampleRate = inputSampleRate;
331  }
332 
333  ui->applyBtn->setEnabled(true);
334  ui->applyBtn->setStyleSheet("QPushButton { background-color : green; }");
335 }
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Ui::UDPSourceGUI * ui
Definition: udpsourcegui.h:62
UDPSourceSettings m_settings
Definition: udpsourcegui.h:73
float Real
Definition: dsptypes.h:42
+ Here is the call graph for this function:

◆ on_squelch_valueChanged

void UDPSourceGUI::on_squelch_valueChanged ( int  value)
privateslot

Definition at line 408 of file udpsourcegui.cpp.

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

409 {
410  m_settings.m_squelchEnabled = (value != -100);
411  m_settings.m_squelch = value * 1.0;
412 
414  ui->squelchText->setText(tr("%1").arg(m_settings.m_squelch, 0, 'f', 0));
415  } else {
416  ui->squelchText->setText("---");
417  }
418 
419  applySettings();
420 }
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Real m_squelch
squared magnitude
Ui::UDPSourceGUI * ui
Definition: udpsourcegui.h:62
UDPSourceSettings m_settings
Definition: udpsourcegui.h:73
void applySettings(bool force=false)
+ Here is the call graph for this function:

◆ on_squelchGate_valueChanged

void UDPSourceGUI::on_squelchGate_valueChanged ( int  value)
privateslot

Definition at line 422 of file udpsourcegui.cpp.

References applySettings(), arg(), m_settings, UDPSourceSettings::m_squelchGate, and ui.

423 {
424  m_settings.m_squelchGate = value / 100.0;
425  ui->squelchGateText->setText(tr("%1").arg(roundf(value * 10.0), 0, 'f', 0));
426  applySettings();
427 }
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Ui::UDPSourceGUI * ui
Definition: udpsourcegui.h:62
UDPSourceSettings m_settings
Definition: udpsourcegui.h:73
Real m_squelchGate
seconds
void applySettings(bool force=false)
+ Here is the call graph for this function:

◆ on_stereoInput_toggled

void UDPSourceGUI::on_stereoInput_toggled ( bool  checked)
privateslot

Definition at line 459 of file udpsourcegui.cpp.

References applySettings(), m_settings, and UDPSourceSettings::m_stereoInput.

460 {
461  m_settings.m_stereoInput = checked;
462  applySettings();
463 }
UDPSourceSettings m_settings
Definition: udpsourcegui.h:73
void applySettings(bool force=false)
+ Here is the call graph for this function:

◆ onMenuDialogCalled

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

Definition at line 473 of file udpsourcegui.cpp.

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

Referenced by UDPSourceGUI().

474 {
476  {
478  dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
479  dialog.setReverseAPIAddress(m_settings.m_reverseAPIAddress);
480  dialog.setReverseAPIPort(m_settings.m_reverseAPIPort);
481  dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex);
482  dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex);
483 
484  dialog.move(p);
485  dialog.exec();
486 
489  m_settings.m_useReverseAPI = dialog.useReverseAPI();
490  m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress();
491  m_settings.m_reverseAPIPort = dialog.getReverseAPIPort();
492  m_settings.m_reverseAPIDeviceIndex = dialog.getReverseAPIDeviceIndex();
493  m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex();
494 
495  setWindowTitle(m_channelMarker.getTitle());
497 
498  applySettings();
499  }
500 
502 }
int getCenterFrequency() const
Definition: channelmarker.h:42
void resetContextMenuType()
Definition: rollupwidget.h:50
ContextMenuType m_contextMenuType
Definition: rollupwidget.h:33
void setTitleColor(const QColor &c)
const QString & getTitle() const
Definition: channelmarker.h:38
uint16_t m_reverseAPIDeviceIndex
uint16_t m_reverseAPIChannelIndex
UDPSourceSettings m_settings
Definition: udpsourcegui.h:73
ChannelMarker m_channelMarker
Definition: udpsourcegui.h:70
const QColor & getColor() const
Definition: channelmarker.h:64
void applySettings(bool force=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ onWidgetRolled

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

Definition at line 465 of file udpsourcegui.cpp.

References m_udpSource, UDPSource::setSpectrum(), and ui.

Referenced by UDPSourceGUI().

466 {
467  if ((widget == ui->spectrumBox) && (m_udpSource != 0))
468  {
469  m_udpSource->setSpectrum(rollDown);
470  }
471 }
void setSpectrum(bool enabled)
Definition: udpsource.cpp:450
Ui::UDPSourceGUI * ui
Definition: udpsourcegui.h:62
UDPSource * m_udpSource
Definition: udpsourcegui.h:66
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetToDefaults()

void UDPSourceGUI::resetToDefaults ( )
virtual

Implements PluginInstanceGUI.

Definition at line 62 of file udpsourcegui.cpp.

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

Referenced by deserialize().

63 {
66  applySettings(true);
67 }
void displaySettings()
UDPSourceSettings m_settings
Definition: udpsourcegui.h:73
void applySettings(bool force=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize()

QByteArray UDPSourceGUI::serialize ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 69 of file udpsourcegui.cpp.

References m_settings, and UDPSourceSettings::serialize().

70 {
71  return m_settings.serialize();
72 }
QByteArray serialize() const
UDPSourceSettings m_settings
Definition: udpsourcegui.h:73
+ Here is the call graph for this function:

◆ setCenterFrequency()

void UDPSourceGUI::setCenterFrequency ( qint64  centerFrequency)
virtual

Implements PluginInstanceGUI.

Definition at line 56 of file udpsourcegui.cpp.

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

57 {
58  m_channelMarker.setCenterFrequency(centerFrequency);
59  applySettings();
60 }
ChannelMarker m_channelMarker
Definition: udpsourcegui.h:70
void setCenterFrequency(int centerFrequency)
void applySettings(bool force=false)
+ Here is the call graph for this function:

◆ setName()

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

Implements PluginInstanceGUI.

Definition at line 42 of file udpsourcegui.cpp.

43 {
44  setObjectName(name);
45 }

◆ setSampleFormat()

void UDPSourceGUI::setSampleFormat ( int  index)
private

Definition at line 581 of file udpsourcegui.cpp.

References UDPSourceSettings::FormatAM, UDPSourceSettings::FormatLSB, UDPSourceSettings::FormatNFM, UDPSourceSettings::FormatSnLE, UDPSourceSettings::FormatUSB, UDPSourceSettings::m_sampleFormat, m_settings, and ui.

Referenced by on_sampleFormat_currentIndexChanged().

582 {
583  switch(index)
584  {
585  case 0:
587  ui->fmDeviation->setEnabled(false);
588  ui->stereoInput->setChecked(true);
589  ui->stereoInput->setEnabled(false);
590  break;
591  case 1:
593  ui->fmDeviation->setEnabled(true);
594  ui->stereoInput->setEnabled(true);
595  break;
596  case 2:
598  ui->fmDeviation->setEnabled(false);
599  ui->stereoInput->setEnabled(true);
600  break;
601  case 3:
603  ui->fmDeviation->setEnabled(false);
604  ui->stereoInput->setEnabled(true);
605  break;
606  case 4:
608  ui->fmDeviation->setEnabled(false);
609  ui->stereoInput->setEnabled(true);
610  break;
611  default:
613  ui->fmDeviation->setEnabled(false);
614  ui->stereoInput->setChecked(true);
615  ui->stereoInput->setEnabled(false);
616  break;
617  }
618 }
Ui::UDPSourceGUI * ui
Definition: udpsourcegui.h:62
UDPSourceSettings m_settings
Definition: udpsourcegui.h:73
SampleFormat m_sampleFormat
+ Here is the caller graph for this function:

◆ setSampleFormatIndex()

void UDPSourceGUI::setSampleFormatIndex ( const UDPSourceSettings::SampleFormat sampleFormat)
private

Definition at line 542 of file udpsourcegui.cpp.

References UDPSourceSettings::FormatAM, UDPSourceSettings::FormatLSB, UDPSourceSettings::FormatNFM, UDPSourceSettings::FormatSnLE, UDPSourceSettings::FormatUSB, and ui.

Referenced by displaySettings().

543 {
544  switch(sampleFormat)
545  {
547  ui->sampleFormat->setCurrentIndex(0);
548  ui->fmDeviation->setEnabled(false);
549  ui->stereoInput->setChecked(true);
550  ui->stereoInput->setEnabled(false);
551  break;
553  ui->sampleFormat->setCurrentIndex(1);
554  ui->fmDeviation->setEnabled(true);
555  ui->stereoInput->setEnabled(true);
556  break;
558  ui->sampleFormat->setCurrentIndex(2);
559  ui->fmDeviation->setEnabled(false);
560  ui->stereoInput->setEnabled(true);
561  break;
563  ui->sampleFormat->setCurrentIndex(3);
564  ui->fmDeviation->setEnabled(false);
565  ui->stereoInput->setEnabled(true);
566  break;
568  ui->sampleFormat->setCurrentIndex(4);
569  ui->fmDeviation->setEnabled(false);
570  ui->stereoInput->setEnabled(true);
571  break;
572  default:
573  ui->sampleFormat->setCurrentIndex(0);
574  ui->fmDeviation->setEnabled(false);
575  ui->stereoInput->setChecked(true);
576  ui->stereoInput->setEnabled(false);
577  break;
578  }
579 }
Ui::UDPSourceGUI * ui
Definition: udpsourcegui.h:62
+ Here is the caller graph for this function:

◆ tick

void UDPSourceGUI::tick ( )
privateslot

Definition at line 514 of file udpsourcegui.cpp.

References arg(), MovingAverageUtil< T, Total, N >::asDouble(), CalcDb::dbPower(), UDPSource::getBufferGauge(), UDPSource::getInMagSq(), UDPSource::getMagSq(), UDPSource::getSquelchOpen(), m_channelPowerAvg, m_inPowerAvg, m_tickCount, m_udpSource, and ui.

Referenced by UDPSourceGUI().

515 {
518 
519  if (m_tickCount % 4 == 0)
520  {
521  double powDb = CalcDb::dbPower(m_channelPowerAvg.asDouble());
522  ui->channelPower->setText(tr("%1 dB").arg(powDb, 0, 'f', 1));
523  double inPowDb = CalcDb::dbPower(m_inPowerAvg.asDouble());
524  ui->inputPower->setText(tr("%1").arg(inPowDb, 0, 'f', 1));
525  }
526 
527  int32_t bufferGauge = m_udpSource->getBufferGauge();
528  ui->bufferGaugeNegative->setValue((bufferGauge < 0 ? -bufferGauge : 0));
529  ui->bufferGaugePositive->setValue((bufferGauge < 0 ? 0 : bufferGauge));
530  QString s = QString::number(bufferGauge, 'f', 0);
531  ui->bufferRWBalanceText->setText(tr("%1").arg(s));
532 
533  if (m_udpSource->getSquelchOpen()) {
534  ui->channelMute->setStyleSheet("QToolButton { background-color : green; }");
535  } else {
536  ui->channelMute->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
537  }
538 
539  m_tickCount++;
540 }
double getInMagSq() const
Definition: udpsource.h:136
static double dbPower(double magsq, double floor=1e-12)
Definition: db.cpp:22
MovingAverageUtil< double, double, 4 > m_inPowerAvg
Definition: udpsourcegui.h:68
bool getSquelchOpen() const
Definition: udpsource.h:138
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Ui::UDPSourceGUI * ui
Definition: udpsourcegui.h:62
int32_t getBufferGauge() const
Definition: udpsource.h:137
int int32_t
Definition: rtptypes_win.h:45
MovingAverageUtil< double, double, 4 > m_channelPowerAvg
Definition: udpsourcegui.h:67
uint32_t m_tickCount
Definition: udpsourcegui.h:69
double getMagSq() const
Definition: udpsource.h:135
UDPSource * m_udpSource
Definition: udpsourcegui.h:66
double asDouble() const
Definition: movingaverage.h:57
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_channelMarker

ChannelMarker UDPSourceGUI::m_channelMarker
private

◆ m_channelPowerAvg

MovingAverageUtil<double, double, 4> UDPSourceGUI::m_channelPowerAvg
private

Definition at line 67 of file udpsourcegui.h.

Referenced by tick().

◆ m_deviceUISet

DeviceUISet* UDPSourceGUI::m_deviceUISet
private

Definition at line 64 of file udpsourcegui.h.

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

◆ m_doApplySettings

bool UDPSourceGUI::m_doApplySettings
private

Definition at line 75 of file udpsourcegui.h.

Referenced by applySettings(), and blockApplySettings().

◆ m_inPowerAvg

MovingAverageUtil<double, double, 4> UDPSourceGUI::m_inPowerAvg
private

Definition at line 68 of file udpsourcegui.h.

Referenced by tick().

◆ m_inputMessageQueue

MessageQueue UDPSourceGUI::m_inputMessageQueue
private

Definition at line 76 of file udpsourcegui.h.

◆ m_pluginAPI

PluginAPI* UDPSourceGUI::m_pluginAPI
private

Definition at line 63 of file udpsourcegui.h.

◆ m_rfBandwidthChanged

bool UDPSourceGUI::m_rfBandwidthChanged
private

Definition at line 74 of file udpsourcegui.h.

Referenced by on_applyBtn_clicked(), and on_rfBandwidth_textEdited().

◆ m_settings

UDPSourceSettings UDPSourceGUI::m_settings
private

◆ m_spectrumVis

SpectrumVis* UDPSourceGUI::m_spectrumVis
private

Definition at line 65 of file udpsourcegui.h.

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

◆ m_tickCount

uint32_t UDPSourceGUI::m_tickCount
private

Definition at line 69 of file udpsourcegui.h.

Referenced by tick().

◆ m_udpSource

UDPSource* UDPSourceGUI::m_udpSource
private

◆ ui

Ui::UDPSourceGUI* UDPSourceGUI::ui
private

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