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

#include <localsinkgui.h>

+ Inheritance diagram for LocalSinkGUI:
+ Collaboration diagram for LocalSinkGUI:

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

Private Slots

void handleSourceMessages ()
 
void on_decimationFactor_currentIndexChanged (int index)
 
void on_position_valueChanged (int value)
 
void on_localDevice_currentIndexChanged (int index)
 
void on_localDevicesRefresh_clicked (bool checked)
 
void onWidgetRolled (QWidget *widget, bool rollDown)
 
void onMenuDialogCalled (const QPoint &p)
 
void tick ()
 

Private Member Functions

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

Private Attributes

Ui::LocalSinkGUI * ui
 
PluginAPIm_pluginAPI
 
DeviceUISetm_deviceUISet
 
ChannelMarker m_channelMarker
 
LocalSinkSettings m_settings
 
int m_sampleRate
 
quint64 m_deviceCenterFrequency
 Center frequency in device. More...
 
double m_shiftFrequencyFactor
 Channel frequency shift factor. More...
 
bool m_doApplySettings
 
LocalSinkm_localSink
 
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 localsinkgui.h.

Constructor & Destructor Documentation

◆ LocalSinkGUI()

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

Definition at line 108 of file localsinkgui.cpp.

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

Referenced by create().

108  :
109  RollupWidget(parent),
110  ui(new Ui::LocalSinkGUI),
111  m_pluginAPI(pluginAPI),
112  m_deviceUISet(deviceUISet),
113  m_sampleRate(0),
114  m_tickCount(0)
115 {
116  ui->setupUi(this);
117  setAttribute(Qt::WA_DeleteOnClose, true);
118  connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
119  connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
120 
121  m_localSink = (LocalSink*) channelrx;
123 
124  m_channelMarker.blockSignals(true);
127  m_channelMarker.setTitle("Local Sink");
128  m_channelMarker.blockSignals(false);
129  m_channelMarker.setVisible(true); // activate signal on the last setting only
130 
132 
136 
137  connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages()));
138  //connect(&(m_deviceUISet->m_deviceSourceAPI->getMasterTimer()), SIGNAL(timeout()), this, SLOT(tick()));
139 
140  m_time.start();
141 
143  displaySettings();
144  applySettings(true);
145 }
void displaySettings()
Ui::LocalSinkGUI * ui
Definition: localsinkgui.h:60
LocalSink * m_localSink
Definition: localsinkgui.h:70
void setChannelMarker(Serializable *channelMarker)
virtual MessageQueue * getInputMessageQueue()
Definition: localsinkgui.h:56
void addChannelMarker(ChannelMarker *channelMarker)
Add channel marker to spectrum.
Definition: deviceuiset.cpp:72
RollupWidget(QWidget *parent=NULL)
Definition: rollupwidget.cpp:7
void updateLocalDevices()
PluginAPI * m_pluginAPI
Definition: localsinkgui.h:61
virtual void setMessageQueueToGUI(MessageQueue *queue)
void onMenuDialogCalled(const QPoint &p)
ChannelMarker m_channelMarker
Definition: localsinkgui.h:63
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: localsinkgui.h:62
void applySettings(bool force=false)
void onWidgetRolled(QWidget *widget, bool rollDown)
LocalSinkSettings m_settings
Definition: localsinkgui.h:64
void setColor(const QColor &color)
void setVisible(bool visible)
void setTitle(const QString &title)
void setCenterFrequency(int centerFrequency)
uint32_t m_tickCount
Definition: localsinkgui.h:74
static const QString m_channelIdURI
Definition: localsink.h:150
void widgetRolled(QWidget *widget, bool rollDown)
void handleSourceMessages()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~LocalSinkGUI()

LocalSinkGUI::~LocalSinkGUI ( )
privatevirtual

Definition at line 147 of file localsinkgui.cpp.

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

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

Member Function Documentation

◆ applyChannelSettings()

void LocalSinkGUI::applyChannelSettings ( )
private

Definition at line 170 of file localsinkgui.cpp.

References LocalSink::MsgConfigureChannelizer::create(), BasebandSampleSink::getInputMessageQueue(), m_doApplySettings, LocalSinkSettings::m_filterChainHash, m_localSink, LocalSinkSettings::m_log2Decim, 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.
LocalSink * m_localSink
Definition: localsinkgui.h:70
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
LocalSinkSettings m_settings
Definition: localsinkgui.h:64
static MsgConfigureChannelizer * create(unsigned int log2Decim, unsigned int filterChainHash)
Definition: localsink.h:90
bool m_doApplySettings
Definition: localsinkgui.h:68
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applyDecimation()

void LocalSinkGUI::applyDecimation ( )
private

Definition at line 307 of file localsinkgui.cpp.

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

Referenced by displaySettings(), and on_decimationFactor_currentIndexChanged().

308 {
309  uint32_t maxHash = 1;
310 
311  for (uint32_t i = 0; i < m_settings.m_log2Decim; i++) {
312  maxHash *= 3;
313  }
314 
315  ui->position->setMaximum(maxHash-1);
316  ui->position->setValue(m_settings.m_filterChainHash);
317  m_settings.m_filterChainHash = ui->position->value();
318  applyPosition();
319 }
Ui::LocalSinkGUI * ui
Definition: localsinkgui.h:60
void applyPosition()
unsigned int uint32_t
Definition: rtptypes_win.h:46
int32_t i
Definition: decimators.h:244
LocalSinkSettings m_settings
Definition: localsinkgui.h:64
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applyPosition()

void LocalSinkGUI::applyPosition ( )
private

Definition at line 321 of file localsinkgui.cpp.

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

Referenced by applyDecimation(), and on_position_valueChanged().

322 {
323  ui->filterChainIndex->setText(tr("%1").arg(m_settings.m_filterChainHash));
324  QString s;
326  ui->filterChainText->setText(s);
327 
330 }
Ui::LocalSinkGUI * ui
Definition: localsinkgui.h:60
void applyChannelSettings()
double m_shiftFrequencyFactor
Channel frequency shift factor.
Definition: localsinkgui.h:67
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)
void displayRateAndShift()
LocalSinkSettings m_settings
Definition: localsinkgui.h:64
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applySettings()

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

Definition at line 159 of file localsinkgui.cpp.

References LocalSink::MsgConfigureLocalSink::create(), ChannelMarker::getColor(), BasebandSampleSink::getInputMessageQueue(), m_channelMarker, m_doApplySettings, m_localSink, m_settings, MessageQueue::push(), and RollupWidget::setTitleColor().

Referenced by deserialize(), LocalSinkGUI(), on_localDevice_currentIndexChanged(), onMenuDialogCalled(), and resetToDefaults().

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

◆ blockApplySettings()

void LocalSinkGUI::blockApplySettings ( bool  block)
private

Definition at line 154 of file localsinkgui.cpp.

References m_doApplySettings.

Referenced by displaySettings(), and handleMessage().

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

◆ create()

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

Definition at line 29 of file localsinkgui.cpp.

References LocalSinkGUI().

Referenced by LocalSinkPlugin::createRxChannelGUI().

30 {
31  LocalSinkGUI* gui = new LocalSinkGUI(pluginAPI, deviceUISet, channelRx);
32  return gui;
33 }
LocalSinkGUI(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 LocalSinkGUI::deserialize ( const QByteArray &  data)
virtual

Implements PluginInstanceGUI.

Definition at line 71 of file localsinkgui.cpp.

References applySettings(), LocalSinkSettings::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 }
void displaySettings()
void resetToDefaults()
bool deserialize(const QByteArray &data)
void applySettings(bool force=false)
LocalSinkSettings m_settings
Definition: localsinkgui.h:64
+ Here is the call graph for this function:

◆ destroy()

void LocalSinkGUI::destroy ( )
virtual

Implements PluginInstanceGUI.

Definition at line 35 of file localsinkgui.cpp.

36 {
37  delete this;
38 }

◆ displayRateAndShift()

void LocalSinkGUI::displayRateAndShift ( )
private

Definition at line 200 of file localsinkgui.cpp.

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

Referenced by applyPosition(), and handleMessage().

201 {
202  int shift = m_shiftFrequencyFactor * m_sampleRate;
203  double channelSampleRate = ((double) m_sampleRate) / (1<<m_settings.m_log2Decim);
204  QLocale loc;
205  ui->offsetFrequencyText->setText(tr("%1 Hz").arg(loc.toString(shift)));
206  ui->channelRateText->setText(tr("%1k").arg(QString::number(channelSampleRate / 1000.0, 'g', 5)));
208  m_channelMarker.setBandwidth(channelSampleRate);
209 }
Ui::LocalSinkGUI * ui
Definition: localsinkgui.h:60
double m_shiftFrequencyFactor
Channel frequency shift factor.
Definition: localsinkgui.h:67
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
ChannelMarker m_channelMarker
Definition: localsinkgui.h:63
LocalSinkSettings m_settings
Definition: localsinkgui.h:64
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 LocalSinkGUI::displaySettings ( )
private

Definition at line 181 of file localsinkgui.cpp.

References applyDecimation(), blockApplySettings(), ChannelMarker::getTitle(), m_channelMarker, LocalSinkSettings::m_log2Decim, LocalSinkSettings::m_rgbColor, m_sampleRate, m_settings, LocalSinkSettings::m_title, ChannelMarker::setBandwidth(), ChannelMarker::setCenterFrequency(), ChannelMarker::setColor(), ChannelMarker::setMovable(), ChannelMarker::setTitle(), RollupWidget::setTitleColor(), and ui.

Referenced by deserialize(), handleMessage(), LocalSinkGUI(), 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  applyDecimation();
197  blockApplySettings(false);
198 }
Ui::LocalSinkGUI * ui
Definition: localsinkgui.h:60
void applyDecimation()
void blockApplySettings(bool block)
void setMovable(bool movable)
Definition: channelmarker.h:66
ChannelMarker m_channelMarker
Definition: localsinkgui.h:63
void setTitleColor(const QColor &c)
const QString & getTitle() const
Definition: channelmarker.h:38
LocalSinkSettings m_settings
Definition: localsinkgui.h:64
void setColor(const QColor &color)
void setBandwidth(int bandwidth)
void setTitle(const QString &title)
void setCenterFrequency(int centerFrequency)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ enterEvent()

void LocalSinkGUI::enterEvent ( QEvent *  )
private

Definition at line 228 of file localsinkgui.cpp.

References m_channelMarker, and ChannelMarker::setHighlighted().

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

◆ getCenterFrequency()

qint64 LocalSinkGUI::getCenterFrequency ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 50 of file localsinkgui.cpp.

50  {
51  return 0;
52 }

◆ getInputMessageQueue()

virtual MessageQueue* LocalSinkGUI::getInputMessageQueue ( )
inlinevirtual

Implements PluginInstanceGUI.

Definition at line 56 of file localsinkgui.h.

Referenced by handleSourceMessages(), and LocalSinkGUI().

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

◆ getName()

QString LocalSinkGUI::getName ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 45 of file localsinkgui.cpp.

46 {
47  return objectName();
48 }

◆ handleMessage()

bool LocalSinkGUI::handleMessage ( const Message message)
virtual

Implements PluginInstanceGUI.

Definition at line 83 of file localsinkgui.cpp.

References blockApplySettings(), displayRateAndShift(), displaySettings(), LocalSink::MsgSampleRateNotification::getSampleRate(), LocalSink::MsgConfigureLocalSink::getSettings(), m_sampleRate, m_settings, and Message::match().

Referenced by handleSourceMessages().

84 {
86  {
88  //m_channelMarker.setBandwidth(notif.getSampleRate());
89  m_sampleRate = notif.getSampleRate();
91  return true;
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 }
void displaySettings()
const LocalSinkSettings & getSettings() const
Definition: localsink.h:44
void blockApplySettings(bool block)
static bool match(const Message *message)
Definition: message.cpp:45
void displayRateAndShift()
LocalSinkSettings m_settings
Definition: localsinkgui.h:64
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleSourceMessages

void LocalSinkGUI::handleSourceMessages ( )
privateslot

Definition at line 233 of file localsinkgui.cpp.

References getInputMessageQueue(), and handleMessage().

Referenced by LocalSinkGUI().

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

◆ leaveEvent()

void LocalSinkGUI::leaveEvent ( QEvent *  )
private

Definition at line 223 of file localsinkgui.cpp.

References m_channelMarker, and ChannelMarker::setHighlighted().

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

◆ on_decimationFactor_currentIndexChanged

void LocalSinkGUI::on_decimationFactor_currentIndexChanged ( int  index)
privateslot

Definition at line 283 of file localsinkgui.cpp.

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

284 {
285  m_settings.m_log2Decim = index;
286  applyDecimation();
287 }
void applyDecimation()
LocalSinkSettings m_settings
Definition: localsinkgui.h:64
+ Here is the call graph for this function:

◆ on_localDevice_currentIndexChanged

void LocalSinkGUI::on_localDevice_currentIndexChanged ( int  index)
privateslot

Definition at line 295 of file localsinkgui.cpp.

References applySettings(), LocalSinkSettings::m_localDeviceIndex, m_settings, and ui.

296 {
297  m_settings.m_localDeviceIndex = ui->localDevice->itemData(index).toInt();
298  applySettings();
299 }
Ui::LocalSinkGUI * ui
Definition: localsinkgui.h:60
void applySettings(bool force=false)
LocalSinkSettings m_settings
Definition: localsinkgui.h:64
+ Here is the call graph for this function:

◆ on_localDevicesRefresh_clicked

void LocalSinkGUI::on_localDevicesRefresh_clicked ( bool  checked)
privateslot

Definition at line 301 of file localsinkgui.cpp.

References updateLocalDevices().

302 {
303  (void) checked;
305 }
void updateLocalDevices()
+ Here is the call graph for this function:

◆ on_position_valueChanged

void LocalSinkGUI::on_position_valueChanged ( int  value)
privateslot

Definition at line 289 of file localsinkgui.cpp.

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

290 {
292  applyPosition();
293 }
void applyPosition()
LocalSinkSettings m_settings
Definition: localsinkgui.h:64
+ Here is the call graph for this function:

◆ onMenuDialogCalled

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

Definition at line 252 of file localsinkgui.cpp.

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

Referenced by LocalSinkGUI().

253 {
255  {
257  dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
258  dialog.setReverseAPIAddress(m_settings.m_reverseAPIAddress);
259  dialog.setReverseAPIPort(m_settings.m_reverseAPIPort);
260  dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex);
261  dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex);
262 
263  dialog.move(p);
264  dialog.exec();
265 
268  m_settings.m_useReverseAPI = dialog.useReverseAPI();
269  m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress();
270  m_settings.m_reverseAPIPort = dialog.getReverseAPIPort();
271  m_settings.m_reverseAPIDeviceIndex = dialog.getReverseAPIDeviceIndex();
272  m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex();
273 
274  setWindowTitle(m_settings.m_title);
276 
277  applySettings();
278  }
279 
281 }
void resetContextMenuType()
Definition: rollupwidget.h:50
ContextMenuType m_contextMenuType
Definition: rollupwidget.h:33
uint16_t m_reverseAPIChannelIndex
ChannelMarker m_channelMarker
Definition: localsinkgui.h:63
void setTitleColor(const QColor &c)
const QString & getTitle() const
Definition: channelmarker.h:38
uint16_t m_reverseAPIDeviceIndex
void applySettings(bool force=false)
LocalSinkSettings m_settings
Definition: localsinkgui.h:64
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 LocalSinkGUI::onWidgetRolled ( QWidget *  widget,
bool  rollDown 
)
privateslot

Definition at line 246 of file localsinkgui.cpp.

Referenced by LocalSinkGUI().

247 {
248  (void) widget;
249  (void) rollDown;
250 }
+ Here is the caller graph for this function:

◆ resetToDefaults()

void LocalSinkGUI::resetToDefaults ( )
virtual

Implements PluginInstanceGUI.

Definition at line 59 of file localsinkgui.cpp.

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

Referenced by deserialize().

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

◆ serialize()

QByteArray LocalSinkGUI::serialize ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 66 of file localsinkgui.cpp.

References m_settings, and LocalSinkSettings::serialize().

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

◆ setCenterFrequency()

void LocalSinkGUI::setCenterFrequency ( qint64  centerFrequency)
virtual

Implements PluginInstanceGUI.

Definition at line 54 of file localsinkgui.cpp.

55 {
56  (void) centerFrequency;
57 }

◆ setName()

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

Implements PluginInstanceGUI.

Definition at line 40 of file localsinkgui.cpp.

41 {
42  setObjectName(name);
43 }

◆ tick

void LocalSinkGUI::tick ( )
privateslot

Definition at line 332 of file localsinkgui.cpp.

References m_tickCount.

333 {
334  if (++m_tickCount == 20) { // once per second
335  m_tickCount = 0;
336  }
337 }
uint32_t m_tickCount
Definition: localsinkgui.h:74

◆ updateLocalDevices()

void LocalSinkGUI::updateLocalDevices ( )
private

Definition at line 211 of file localsinkgui.cpp.

References arg(), LocalSink::getLocalDevices(), m_localSink, and ui.

Referenced by LocalSinkGUI(), and on_localDevicesRefresh_clicked().

212 {
213  std::vector<uint32_t> localDevicesIndexes;
214  m_localSink->getLocalDevices(localDevicesIndexes);
215  ui->localDevice->clear();
216  std::vector<uint32_t>::const_iterator it = localDevicesIndexes.begin();
217 
218  for (; it != localDevicesIndexes.end(); ++it) {
219  ui->localDevice->addItem(tr("%1").arg(*it), QVariant(*it));
220  }
221 }
Ui::LocalSinkGUI * ui
Definition: localsinkgui.h:60
LocalSink * m_localSink
Definition: localsinkgui.h:70
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void getLocalDevices(std::vector< uint32_t > &indexes)
Definition: localsink.cpp:223
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_channelMarker

ChannelMarker LocalSinkGUI::m_channelMarker
private

◆ m_deviceCenterFrequency

quint64 LocalSinkGUI::m_deviceCenterFrequency
private

Center frequency in device.

Definition at line 66 of file localsinkgui.h.

◆ m_deviceUISet

DeviceUISet* LocalSinkGUI::m_deviceUISet
private

Definition at line 62 of file localsinkgui.h.

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

◆ m_doApplySettings

bool LocalSinkGUI::m_doApplySettings
private

Definition at line 68 of file localsinkgui.h.

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

◆ m_inputMessageQueue

MessageQueue LocalSinkGUI::m_inputMessageQueue
private

Definition at line 71 of file localsinkgui.h.

◆ m_localSink

LocalSink* LocalSinkGUI::m_localSink
private

◆ m_pluginAPI

PluginAPI* LocalSinkGUI::m_pluginAPI
private

Definition at line 61 of file localsinkgui.h.

◆ m_sampleRate

int LocalSinkGUI::m_sampleRate
private

Definition at line 65 of file localsinkgui.h.

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

◆ m_settings

LocalSinkSettings LocalSinkGUI::m_settings
private

◆ m_shiftFrequencyFactor

double LocalSinkGUI::m_shiftFrequencyFactor
private

Channel frequency shift factor.

Definition at line 67 of file localsinkgui.h.

Referenced by applyPosition(), and displayRateAndShift().

◆ m_tickCount

uint32_t LocalSinkGUI::m_tickCount
private

Definition at line 74 of file localsinkgui.h.

Referenced by tick().

◆ m_time

QTime LocalSinkGUI::m_time
private

Definition at line 73 of file localsinkgui.h.

Referenced by LocalSinkGUI().

◆ ui

Ui::LocalSinkGUI* LocalSinkGUI::ui
private

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