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 Member Functions | Static Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
RemoteSinkGUI Class Reference

#include <remotesinkgui.h>

+ Inheritance diagram for RemoteSinkGUI:
+ Collaboration diagram for RemoteSinkGUI:

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

Private Slots

void handleSourceMessages ()
 
void on_decimationFactor_currentIndexChanged (int index)
 
void on_position_valueChanged (int value)
 
void on_dataAddress_returnPressed ()
 
void on_dataPort_returnPressed ()
 
void on_dataApplyButton_clicked (bool checked)
 
void on_nbFECBlocks_valueChanged (int value)
 
void on_txDelay_valueChanged (int value)
 
void onWidgetRolled (QWidget *widget, bool rollDown)
 
void onMenuDialogCalled (const QPoint &p)
 
void tick ()
 

Private Member Functions

 RemoteSinkGUI (PluginAPI *pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget *parent=0)
 
virtual ~RemoteSinkGUI ()
 
void blockApplySettings (bool block)
 
void applySettings (bool force=false)
 
void applyChannelSettings ()
 
void displaySettings ()
 
void displayRateAndShift ()
 
void updateTxDelayTime ()
 
void leaveEvent (QEvent *)
 
void enterEvent (QEvent *)
 
void applyDecimation ()
 
void applyPosition ()
 

Private Attributes

Ui::RemoteSinkGUI * ui
 
PluginAPIm_pluginAPI
 
DeviceUISetm_deviceUISet
 
ChannelMarker m_channelMarker
 
RemoteSinkSettings m_settings
 
int m_sampleRate
 
quint64 m_deviceCenterFrequency
 Center frequency in device. More...
 
double m_shiftFrequencyFactor
 Channel frequency shift factor. More...
 
bool m_doApplySettings
 
RemoteSinkm_remoteSink
 
MessageQueue m_inputMessageQueue
 
QTime m_time
 
uint32_t m_tickCount
 

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 42 of file remotesinkgui.h.

Constructor & Destructor Documentation

◆ RemoteSinkGUI()

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

Definition at line 109 of file remotesinkgui.cpp.

References DeviceUISet::addChannelMarker(), DeviceUISet::addRollupWidget(), applySettings(), displaySettings(), getInputMessageQueue(), handleSourceMessages(), RemoteSink::m_channelIdURI, m_channelMarker, m_deviceUISet, m_remoteSink, RemoteSinkSettings::m_rgbColor, m_settings, m_time, onMenuDialogCalled(), onWidgetRolled(), DeviceUISet::registerRxChannelInstance(), ChannelMarker::setCenterFrequency(), RemoteSinkSettings::setChannelMarker(), ChannelMarker::setColor(), BasebandSampleSink::setMessageQueueToGUI(), ChannelMarker::setTitle(), ChannelMarker::setVisible(), ui, and RollupWidget::widgetRolled().

Referenced by create().

109  :
110  RollupWidget(parent),
111  ui(new Ui::RemoteSinkGUI),
112  m_pluginAPI(pluginAPI),
113  m_deviceUISet(deviceUISet),
114  m_sampleRate(0),
115  m_tickCount(0)
116 {
117  ui->setupUi(this);
118  setAttribute(Qt::WA_DeleteOnClose, true);
119  connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
120  connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
121 
122  m_remoteSink = (RemoteSink*) channelrx;
124 
125  m_channelMarker.blockSignals(true);
128  m_channelMarker.setTitle("Remote source");
129  m_channelMarker.blockSignals(false);
130  m_channelMarker.setVisible(true); // activate signal on the last setting only
131 
133 
137 
138  connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages()));
139  //connect(&(m_deviceUISet->m_deviceSourceAPI->getMasterTimer()), SIGNAL(timeout()), this, SLOT(tick()));
140 
141  m_time.start();
142 
143  displaySettings();
144  applySettings(true);
145 }
uint32_t m_tickCount
Definition: remotesinkgui.h:74
void handleSourceMessages()
virtual MessageQueue * getInputMessageQueue()
Definition: remotesinkgui.h:56
RemoteSinkSettings m_settings
Definition: remotesinkgui.h:64
void applySettings(bool force=false)
void addChannelMarker(ChannelMarker *channelMarker)
Add channel marker to spectrum.
Definition: deviceuiset.cpp:72
ChannelMarker m_channelMarker
Definition: remotesinkgui.h:63
void displaySettings()
DeviceUISet * m_deviceUISet
Definition: remotesinkgui.h:62
void onMenuDialogCalled(const QPoint &p)
RemoteSink * m_remoteSink
Definition: remotesinkgui.h:70
RollupWidget(QWidget *parent=NULL)
Definition: rollupwidget.cpp:7
static const QString m_channelIdURI
Definition: remotesink.h:160
virtual void setMessageQueueToGUI(MessageQueue *queue)
Ui::RemoteSinkGUI * ui
Definition: remotesinkgui.h:60
void registerRxChannelInstance(const QString &channelName, PluginInstanceGUI *pluginGUI)
Definition: deviceuiset.cpp:82
void addRollupWidget(QWidget *widget)
Add rollup widget to channel window.
Definition: deviceuiset.cpp:77
void setColor(const QColor &color)
void onWidgetRolled(QWidget *widget, bool rollDown)
void setVisible(bool visible)
PluginAPI * m_pluginAPI
Definition: remotesinkgui.h:61
void setTitle(const QString &title)
void setCenterFrequency(int centerFrequency)
void setChannelMarker(Serializable *channelMarker)
void widgetRolled(QWidget *widget, bool rollDown)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~RemoteSinkGUI()

RemoteSinkGUI::~RemoteSinkGUI ( )
privatevirtual

Definition at line 147 of file remotesinkgui.cpp.

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

148 {
150  delete m_remoteSink; // TODO: check this: when the GUI closes it has to delete the demodulator
151  delete ui;
152 }
DeviceUISet * m_deviceUISet
Definition: remotesinkgui.h:62
RemoteSink * m_remoteSink
Definition: remotesinkgui.h:70
Ui::RemoteSinkGUI * ui
Definition: remotesinkgui.h:60
void removeRxChannelInstance(PluginInstanceGUI *pluginGUI)
Definition: deviceuiset.cpp:94
+ Here is the call graph for this function:

Member Function Documentation

◆ applyChannelSettings()

void RemoteSinkGUI::applyChannelSettings ( )
private

Definition at line 170 of file remotesinkgui.cpp.

References RemoteSink::MsgConfigureChannelizer::create(), BasebandSampleSink::getInputMessageQueue(), m_doApplySettings, RemoteSinkSettings::m_filterChainHash, RemoteSinkSettings::m_log2Decim, m_remoteSink, m_settings, and MessageQueue::push().

Referenced by applyPosition().

171 {
172  if (m_doApplySettings)
173  {
178  }
179 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
RemoteSinkSettings m_settings
Definition: remotesinkgui.h:64
static MsgConfigureChannelizer * create(int sampleRate, int centerFrequency)
Definition: remotesink.h:96
RemoteSink * m_remoteSink
Definition: remotesinkgui.h:70
bool m_doApplySettings
Definition: remotesinkgui.h:68
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applyDecimation()

void RemoteSinkGUI::applyDecimation ( )
private

Definition at line 359 of file remotesinkgui.cpp.

References applyPosition(), i, RemoteSinkSettings::m_filterChainHash, RemoteSinkSettings::m_log2Decim, m_settings, and ui.

Referenced by displaySettings(), and on_decimationFactor_currentIndexChanged().

360 {
361  uint32_t maxHash = 1;
362 
363  for (uint32_t i = 0; i < m_settings.m_log2Decim; i++) {
364  maxHash *= 3;
365  }
366 
367  ui->position->setMaximum(maxHash-1);
368  ui->position->setValue(m_settings.m_filterChainHash);
369  m_settings.m_filterChainHash = ui->position->value();
370  applyPosition();
371 }
RemoteSinkSettings m_settings
Definition: remotesinkgui.h:64
unsigned int uint32_t
Definition: rtptypes_win.h:46
Ui::RemoteSinkGUI * ui
Definition: remotesinkgui.h:60
int32_t i
Definition: decimators.h:244
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applyPosition()

void RemoteSinkGUI::applyPosition ( )
private

Definition at line 373 of file remotesinkgui.cpp.

References applyChannelSettings(), arg(), HBFilterChainConverter::convertToString(), displayRateAndShift(), RemoteSinkSettings::m_filterChainHash, RemoteSinkSettings::m_log2Decim, m_settings, m_shiftFrequencyFactor, and ui.

Referenced by applyDecimation(), and on_position_valueChanged().

374 {
375  ui->filterChainIndex->setText(tr("%1").arg(m_settings.m_filterChainHash));
376  QString s;
378  ui->filterChainText->setText(s);
379 
382 }
void applyChannelSettings()
RemoteSinkSettings m_settings
Definition: remotesinkgui.h:64
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
static double convertToString(unsigned int log2, unsigned int chainHash, QString &chainString)
double m_shiftFrequencyFactor
Channel frequency shift factor.
Definition: remotesinkgui.h:67
Ui::RemoteSinkGUI * ui
Definition: remotesinkgui.h:60
void displayRateAndShift()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applySettings()

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

Definition at line 159 of file remotesinkgui.cpp.

References RemoteSink::MsgConfigureRemoteSink::create(), ChannelMarker::getColor(), BasebandSampleSink::getInputMessageQueue(), m_channelMarker, m_doApplySettings, m_remoteSink, m_settings, MessageQueue::push(), and RollupWidget::setTitleColor().

Referenced by deserialize(), on_dataAddress_returnPressed(), on_dataApplyButton_clicked(), on_dataPort_returnPressed(), on_nbFECBlocks_valueChanged(), on_txDelay_valueChanged(), onMenuDialogCalled(), RemoteSinkGUI(), and resetToDefaults().

160 {
161  if (m_doApplySettings)
162  {
164 
167  }
168 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
RemoteSinkSettings m_settings
Definition: remotesinkgui.h:64
ChannelMarker m_channelMarker
Definition: remotesinkgui.h:63
RemoteSink * m_remoteSink
Definition: remotesinkgui.h:70
void setTitleColor(const QColor &c)
bool m_doApplySettings
Definition: remotesinkgui.h:68
static MsgConfigureRemoteSink * create(const RemoteSinkSettings &settings, bool force)
Definition: remotesink.h:53
const QColor & getColor() const
Definition: channelmarker.h:64
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ blockApplySettings()

void RemoteSinkGUI::blockApplySettings ( bool  block)
private

Definition at line 154 of file remotesinkgui.cpp.

References m_doApplySettings.

Referenced by displaySettings(), and handleMessage().

155 {
156  m_doApplySettings = !block;
157 }
bool m_doApplySettings
Definition: remotesinkgui.h:68
+ Here is the caller graph for this function:

◆ create()

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

Definition at line 29 of file remotesinkgui.cpp.

References RemoteSinkGUI().

Referenced by RemoteSinkPlugin::createRxChannelGUI().

30 {
31  RemoteSinkGUI* gui = new RemoteSinkGUI(pluginAPI, deviceUISet, channelRx);
32  return gui;
33 }
RemoteSinkGUI(PluginAPI *pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget *parent=0)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deserialize()

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

Implements PluginInstanceGUI.

Definition at line 71 of file remotesinkgui.cpp.

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

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

◆ destroy()

void RemoteSinkGUI::destroy ( )
virtual

Implements PluginInstanceGUI.

Definition at line 35 of file remotesinkgui.cpp.

36 {
37  delete this;
38 }

◆ displayRateAndShift()

void RemoteSinkGUI::displayRateAndShift ( )
private

Definition at line 208 of file remotesinkgui.cpp.

References arg(), m_channelMarker, RemoteSinkSettings::m_log2Decim, m_sampleRate, m_settings, m_shiftFrequencyFactor, ChannelMarker::setBandwidth(), ChannelMarker::setCenterFrequency(), and ui.

Referenced by applyPosition(), and handleMessage().

209 {
210  int shift = m_shiftFrequencyFactor * m_sampleRate;
211  double channelSampleRate = ((double) m_sampleRate) / (1<<m_settings.m_log2Decim);
212  QLocale loc;
213  ui->offsetFrequencyText->setText(tr("%1 Hz").arg(loc.toString(shift)));
214  ui->channelRateText->setText(tr("%1k").arg(QString::number(channelSampleRate / 1000.0, 'g', 5)));
216  m_channelMarker.setBandwidth(channelSampleRate);
217 }
RemoteSinkSettings m_settings
Definition: remotesinkgui.h:64
ChannelMarker m_channelMarker
Definition: remotesinkgui.h:63
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
double m_shiftFrequencyFactor
Channel frequency shift factor.
Definition: remotesinkgui.h:67
Ui::RemoteSinkGUI * ui
Definition: remotesinkgui.h:60
void setBandwidth(int bandwidth)
void setCenterFrequency(int centerFrequency)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ displaySettings()

void RemoteSinkGUI::displaySettings ( )
private

Definition at line 181 of file remotesinkgui.cpp.

References applyDecimation(), arg(), blockApplySettings(), ChannelMarker::getTitle(), m_channelMarker, RemoteSinkSettings::m_dataAddress, RemoteSinkSettings::m_dataPort, RemoteSinkSettings::m_log2Decim, RemoteSinkSettings::m_nbFECBlocks, RemoteSinkSettings::m_rgbColor, m_sampleRate, m_settings, RemoteSinkSettings::m_title, RemoteSinkSettings::m_txDelay, ChannelMarker::setBandwidth(), ChannelMarker::setCenterFrequency(), ChannelMarker::setColor(), ChannelMarker::setMovable(), ChannelMarker::setTitle(), RollupWidget::setTitleColor(), ui, and updateTxDelayTime().

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

182 {
183  m_channelMarker.blockSignals(true);
187  m_channelMarker.setMovable(false); // do not let user move the center arbitrarily
188  m_channelMarker.blockSignals(false);
189  m_channelMarker.setColor(m_settings.m_rgbColor); // activate signal on the last setting only
190 
192  setWindowTitle(m_channelMarker.getTitle());
193 
194  blockApplySettings(true);
195  ui->decimationFactor->setCurrentIndex(m_settings.m_log2Decim);
196  ui->dataAddress->setText(m_settings.m_dataAddress);
197  ui->dataPort->setText(tr("%1").arg(m_settings.m_dataPort));
198  QString s = QString::number(128 + m_settings.m_nbFECBlocks, 'f', 0);
199  QString s1 = QString::number(m_settings.m_nbFECBlocks, 'f', 0);
200  ui->nominalNbBlocksText->setText(tr("%1/%2").arg(s).arg(s1));
201  ui->txDelayText->setText(tr("%1%").arg(m_settings.m_txDelay));
202  ui->txDelay->setValue(m_settings.m_txDelay);
204  applyDecimation();
205  blockApplySettings(false);
206 }
void applyDecimation()
RemoteSinkSettings m_settings
Definition: remotesinkgui.h:64
ChannelMarker m_channelMarker
Definition: remotesinkgui.h:63
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Ui::RemoteSinkGUI * ui
Definition: remotesinkgui.h:60
void setMovable(bool movable)
Definition: channelmarker.h:66
void setTitleColor(const QColor &c)
const QString & getTitle() const
Definition: channelmarker.h:38
void setColor(const QColor &color)
void blockApplySettings(bool block)
void setBandwidth(int bandwidth)
void setTitle(const QString &title)
void setCenterFrequency(int centerFrequency)
void updateTxDelayTime()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ enterEvent()

void RemoteSinkGUI::enterEvent ( QEvent *  )
private

Definition at line 224 of file remotesinkgui.cpp.

References m_channelMarker, and ChannelMarker::setHighlighted().

225 {
227 }
ChannelMarker m_channelMarker
Definition: remotesinkgui.h:63
void setHighlighted(bool highlighted)
+ Here is the call graph for this function:

◆ getCenterFrequency()

qint64 RemoteSinkGUI::getCenterFrequency ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 50 of file remotesinkgui.cpp.

50  {
51  return 0;
52 }

◆ getInputMessageQueue()

virtual MessageQueue* RemoteSinkGUI::getInputMessageQueue ( )
inlinevirtual

Implements PluginInstanceGUI.

Definition at line 56 of file remotesinkgui.h.

Referenced by handleSourceMessages(), and RemoteSinkGUI().

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

◆ getName()

QString RemoteSinkGUI::getName ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 45 of file remotesinkgui.cpp.

46 {
47  return objectName();
48 }

◆ handleMessage()

bool RemoteSinkGUI::handleMessage ( const Message message)
virtual

Implements PluginInstanceGUI.

Definition at line 83 of file remotesinkgui.cpp.

References blockApplySettings(), displayRateAndShift(), displaySettings(), RemoteSink::MsgSampleRateNotification::getSampleRate(), RemoteSink::MsgConfigureRemoteSink::getSettings(), m_sampleRate, m_settings, Message::match(), and updateTxDelayTime().

Referenced by handleSourceMessages().

84 {
86  {
88  //m_channelMarker.setBandwidth(notif.getSampleRate());
89  m_sampleRate = notif.getSampleRate();
92  return true;
93  }
95  {
97  m_settings = cfg.getSettings();
98  blockApplySettings(true);
100  blockApplySettings(false);
101  return true;
102  }
103  else
104  {
105  return false;
106  }
107 }
RemoteSinkSettings m_settings
Definition: remotesinkgui.h:64
void displaySettings()
const RemoteSinkSettings & getSettings() const
Definition: remotesink.h:50
void displayRateAndShift()
static bool match(const Message *message)
Definition: message.cpp:45
void blockApplySettings(bool block)
void updateTxDelayTime()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleSourceMessages

void RemoteSinkGUI::handleSourceMessages ( )
privateslot

Definition at line 229 of file remotesinkgui.cpp.

References getInputMessageQueue(), and handleMessage().

Referenced by RemoteSinkGUI().

230 {
231  Message* message;
232 
233  while ((message = getInputMessageQueue()->pop()) != 0)
234  {
235  if (handleMessage(*message))
236  {
237  delete message;
238  }
239  }
240 }
virtual MessageQueue * getInputMessageQueue()
Definition: remotesinkgui.h:56
virtual bool handleMessage(const Message &message)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ leaveEvent()

void RemoteSinkGUI::leaveEvent ( QEvent *  )
private

Definition at line 219 of file remotesinkgui.cpp.

References m_channelMarker, and ChannelMarker::setHighlighted().

220 {
222 }
ChannelMarker m_channelMarker
Definition: remotesinkgui.h:63
void setHighlighted(bool highlighted)
+ Here is the call graph for this function:

◆ on_dataAddress_returnPressed

void RemoteSinkGUI::on_dataAddress_returnPressed ( )
privateslot

Definition at line 291 of file remotesinkgui.cpp.

References applySettings(), RemoteSinkSettings::m_dataAddress, m_settings, and ui.

292 {
293  m_settings.m_dataAddress = ui->dataAddress->text();
294  applySettings();
295 }
RemoteSinkSettings m_settings
Definition: remotesinkgui.h:64
void applySettings(bool force=false)
Ui::RemoteSinkGUI * ui
Definition: remotesinkgui.h:60
+ Here is the call graph for this function:

◆ on_dataApplyButton_clicked

void RemoteSinkGUI::on_dataApplyButton_clicked ( bool  checked)
privateslot

Definition at line 314 of file remotesinkgui.cpp.

References applySettings(), RemoteSinkSettings::m_dataAddress, RemoteSinkSettings::m_dataPort, m_settings, and ui.

315 {
316  (void) checked;
317  m_settings.m_dataAddress = ui->dataAddress->text();
318 
319  bool dataOk;
320  int udpDataPort = ui->dataPort->text().toInt(&dataOk);
321 
322  if((dataOk) && (udpDataPort >= 1024) && (udpDataPort < 65535))
323  {
324  m_settings.m_dataPort = udpDataPort;
325  }
326 
327  applySettings();
328 }
RemoteSinkSettings m_settings
Definition: remotesinkgui.h:64
void applySettings(bool force=false)
Ui::RemoteSinkGUI * ui
Definition: remotesinkgui.h:60
+ Here is the call graph for this function:

◆ on_dataPort_returnPressed

void RemoteSinkGUI::on_dataPort_returnPressed ( )
privateslot

Definition at line 297 of file remotesinkgui.cpp.

References applySettings(), RemoteSinkSettings::m_dataPort, m_settings, and ui.

298 {
299  bool dataOk;
300  int dataPort = ui->dataPort->text().toInt(&dataOk);
301 
302  if((!dataOk) || (dataPort < 1024) || (dataPort > 65535))
303  {
304  return;
305  }
306  else
307  {
308  m_settings.m_dataPort = dataPort;
309  }
310 
311  applySettings();
312 }
RemoteSinkSettings m_settings
Definition: remotesinkgui.h:64
void applySettings(bool force=false)
Ui::RemoteSinkGUI * ui
Definition: remotesinkgui.h:60
+ Here is the call graph for this function:

◆ on_decimationFactor_currentIndexChanged

void RemoteSinkGUI::on_decimationFactor_currentIndexChanged ( int  index)
privateslot

Definition at line 279 of file remotesinkgui.cpp.

References applyDecimation(), RemoteSinkSettings::m_log2Decim, and m_settings.

280 {
281  m_settings.m_log2Decim = index;
282  applyDecimation();
283 }
void applyDecimation()
RemoteSinkSettings m_settings
Definition: remotesinkgui.h:64
+ Here is the call graph for this function:

◆ on_nbFECBlocks_valueChanged

void RemoteSinkGUI::on_nbFECBlocks_valueChanged ( int  value)
privateslot

Definition at line 338 of file remotesinkgui.cpp.

References applySettings(), arg(), RemoteSinkSettings::m_nbFECBlocks, m_settings, ui, and updateTxDelayTime().

339 {
340  m_settings.m_nbFECBlocks = value;
341  int nbOriginalBlocks = 128;
342  int nbFECBlocks = value;
343  QString s = QString::number(nbOriginalBlocks + nbFECBlocks, 'f', 0);
344  QString s1 = QString::number(nbFECBlocks, 'f', 0);
345  ui->nominalNbBlocksText->setText(tr("%1/%2").arg(s).arg(s1));
347  applySettings();
348 }
RemoteSinkSettings m_settings
Definition: remotesinkgui.h:64
void applySettings(bool force=false)
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Ui::RemoteSinkGUI * ui
Definition: remotesinkgui.h:60
void updateTxDelayTime()
+ Here is the call graph for this function:

◆ on_position_valueChanged

void RemoteSinkGUI::on_position_valueChanged ( int  value)
privateslot

Definition at line 285 of file remotesinkgui.cpp.

References applyPosition(), RemoteSinkSettings::m_filterChainHash, and m_settings.

286 {
288  applyPosition();
289 }
RemoteSinkSettings m_settings
Definition: remotesinkgui.h:64
+ Here is the call graph for this function:

◆ on_txDelay_valueChanged

void RemoteSinkGUI::on_txDelay_valueChanged ( int  value)
privateslot

Definition at line 330 of file remotesinkgui.cpp.

References applySettings(), arg(), m_settings, RemoteSinkSettings::m_txDelay, ui, and updateTxDelayTime().

331 {
332  m_settings.m_txDelay = value; // percentage
333  ui->txDelayText->setText(tr("%1%").arg(value));
335  applySettings();
336 }
RemoteSinkSettings m_settings
Definition: remotesinkgui.h:64
void applySettings(bool force=false)
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Ui::RemoteSinkGUI * ui
Definition: remotesinkgui.h:60
void updateTxDelayTime()
+ Here is the call graph for this function:

◆ onMenuDialogCalled

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

Definition at line 248 of file remotesinkgui.cpp.

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

Referenced by RemoteSinkGUI().

249 {
251  {
253  dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
254  dialog.setReverseAPIAddress(m_settings.m_reverseAPIAddress);
255  dialog.setReverseAPIPort(m_settings.m_reverseAPIPort);
256  dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex);
257  dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex);
258 
259  dialog.move(p);
260  dialog.exec();
261 
264  m_settings.m_useReverseAPI = dialog.useReverseAPI();
265  m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress();
266  m_settings.m_reverseAPIPort = dialog.getReverseAPIPort();
267  m_settings.m_reverseAPIDeviceIndex = dialog.getReverseAPIDeviceIndex();
268  m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex();
269 
270  setWindowTitle(m_settings.m_title);
272 
273  applySettings();
274  }
275 
277 }
uint16_t m_reverseAPIDeviceIndex
RemoteSinkSettings m_settings
Definition: remotesinkgui.h:64
void applySettings(bool force=false)
void resetContextMenuType()
Definition: rollupwidget.h:50
ChannelMarker m_channelMarker
Definition: remotesinkgui.h:63
ContextMenuType m_contextMenuType
Definition: rollupwidget.h:33
uint16_t m_reverseAPIChannelIndex
void setTitleColor(const QColor &c)
const QString & getTitle() const
Definition: channelmarker.h:38
const QColor & getColor() const
Definition: channelmarker.h:64
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ onWidgetRolled

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

Definition at line 242 of file remotesinkgui.cpp.

Referenced by RemoteSinkGUI().

243 {
244  (void) widget;
245  (void) rollDown;
246 }
+ Here is the caller graph for this function:

◆ resetToDefaults()

void RemoteSinkGUI::resetToDefaults ( )
virtual

Implements PluginInstanceGUI.

Definition at line 59 of file remotesinkgui.cpp.

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

Referenced by deserialize().

60 {
63  applySettings(true);
64 }
RemoteSinkSettings m_settings
Definition: remotesinkgui.h:64
void applySettings(bool force=false)
void displaySettings()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize()

QByteArray RemoteSinkGUI::serialize ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 66 of file remotesinkgui.cpp.

References m_settings, and RemoteSinkSettings::serialize().

67 {
68  return m_settings.serialize();
69 }
RemoteSinkSettings m_settings
Definition: remotesinkgui.h:64
QByteArray serialize() const
+ Here is the call graph for this function:

◆ setCenterFrequency()

void RemoteSinkGUI::setCenterFrequency ( qint64  centerFrequency)
virtual

Implements PluginInstanceGUI.

Definition at line 54 of file remotesinkgui.cpp.

55 {
56  (void) centerFrequency;
57 }

◆ setName()

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

Implements PluginInstanceGUI.

Definition at line 40 of file remotesinkgui.cpp.

41 {
42  setObjectName(name);
43 }

◆ tick

void RemoteSinkGUI::tick ( )
privateslot

Definition at line 384 of file remotesinkgui.cpp.

References m_tickCount.

385 {
386  if (++m_tickCount == 20) { // once per second
387  m_tickCount = 0;
388  }
389 }
uint32_t m_tickCount
Definition: remotesinkgui.h:74

◆ updateTxDelayTime()

void RemoteSinkGUI::updateTxDelayTime ( )
private

Definition at line 350 of file remotesinkgui.cpp.

References m_settings, and RemoteSinkSettings::m_txDelay.

Referenced by displaySettings(), handleMessage(), on_nbFECBlocks_valueChanged(), and on_txDelay_valueChanged().

351 {
352  double txDelayRatio = m_settings.m_txDelay / 100.0;
353  int samplesPerBlock = RemoteNbBytesPerBlock / sizeof(Sample);
354  double delay = m_sampleRate == 0 ? 0.0 : (127*samplesPerBlock*txDelayRatio) / m_sampleRate;
355  delay /= 128 + m_settings.m_nbFECBlocks;
356  ui->txDelayTime->setText(tr("%1µs").arg(QString::number(delay*1e6, 'f', 0)));
357 }
RemoteSinkSettings m_settings
Definition: remotesinkgui.h:64
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Ui::RemoteSinkGUI * ui
Definition: remotesinkgui.h:60
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_channelMarker

ChannelMarker RemoteSinkGUI::m_channelMarker
private

◆ m_deviceCenterFrequency

quint64 RemoteSinkGUI::m_deviceCenterFrequency
private

Center frequency in device.

Definition at line 66 of file remotesinkgui.h.

◆ m_deviceUISet

DeviceUISet* RemoteSinkGUI::m_deviceUISet
private

Definition at line 62 of file remotesinkgui.h.

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

◆ m_doApplySettings

bool RemoteSinkGUI::m_doApplySettings
private

Definition at line 68 of file remotesinkgui.h.

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

◆ m_inputMessageQueue

MessageQueue RemoteSinkGUI::m_inputMessageQueue
private

Definition at line 71 of file remotesinkgui.h.

◆ m_pluginAPI

PluginAPI* RemoteSinkGUI::m_pluginAPI
private

Definition at line 61 of file remotesinkgui.h.

◆ m_remoteSink

RemoteSink* RemoteSinkGUI::m_remoteSink
private

Definition at line 70 of file remotesinkgui.h.

Referenced by applyChannelSettings(), applySettings(), RemoteSinkGUI(), and ~RemoteSinkGUI().

◆ m_sampleRate

int RemoteSinkGUI::m_sampleRate
private

Definition at line 65 of file remotesinkgui.h.

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

◆ m_settings

RemoteSinkSettings RemoteSinkGUI::m_settings
private

◆ m_shiftFrequencyFactor

double RemoteSinkGUI::m_shiftFrequencyFactor
private

Channel frequency shift factor.

Definition at line 67 of file remotesinkgui.h.

Referenced by applyPosition(), and displayRateAndShift().

◆ m_tickCount

uint32_t RemoteSinkGUI::m_tickCount
private

Definition at line 74 of file remotesinkgui.h.

Referenced by tick().

◆ m_time

QTime RemoteSinkGUI::m_time
private

Definition at line 73 of file remotesinkgui.h.

Referenced by RemoteSinkGUI().

◆ ui

Ui::RemoteSinkGUI* RemoteSinkGUI::ui
private

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