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

#include <bladerf1outputgui.h>

+ Inheritance diagram for Bladerf1OutputGui:
+ Collaboration diagram for Bladerf1OutputGui:

Public Member Functions

 Bladerf1OutputGui (DeviceUISet *deviceUISet, QWidget *parent=0)
 
virtual ~Bladerf1OutputGui ()
 
virtual void destroy ()
 
void setName (const QString &name)
 
QString getName () const
 
void resetToDefaults ()
 
virtual qint64 getCenterFrequency () const
 
virtual void setCenterFrequency (qint64 centerFrequency)
 
QByteArray serialize () const
 
bool deserialize (const QByteArray &data)
 
virtual MessageQueuegetInputMessageQueue ()
 
virtual bool handleMessage (const Message &message)
 
- Public Member Functions inherited from PluginInstanceGUI
 PluginInstanceGUI ()
 
virtual ~PluginInstanceGUI ()
 

Private Slots

void handleInputMessages ()
 
void on_centerFrequency_changed (quint64 value)
 
void on_sampleRate_changed (quint64 value)
 
void on_bandwidth_currentIndexChanged (int index)
 
void on_interp_currentIndexChanged (int index)
 
void on_vga1_valueChanged (int value)
 
void on_vga2_valueChanged (int value)
 
void on_xb200_currentIndexChanged (int index)
 
void on_startStop_toggled (bool checked)
 
void on_sampleRateMode_toggled (bool checked)
 
void updateHardware ()
 
void updateStatus ()
 
void openDeviceSettingsDialog (const QPoint &p)
 

Private Member Functions

void blockApplySettings (bool block)
 
void displaySettings ()
 
void displaySampleRate ()
 
void sendSettings ()
 
unsigned int getXb200Index (bool xb_200, bladerf_xb200_path xb200Path, bladerf_xb200_filter xb200Filter)
 
void updateSampleRateAndFrequency ()
 

Private Attributes

Ui::Bladerf1OutputGui * ui
 
DeviceUISetm_deviceUISet
 
bool m_doApplySettings
 
bool m_forceSettings
 
BladeRF1OutputSettings m_settings
 
bool m_sampleRateMode
 true: device, false: base band sample rate update mode More...
 
QTimer m_updateTimer
 
QTimer m_statusTimer
 
DeviceSampleSinkm_deviceSampleSink
 
int m_sampleRate
 
quint64 m_deviceCenterFrequency
 Center frequency in device. More...
 
int m_lastEngineState
 
MessageQueue m_inputMessageQueue
 

Detailed Description

Definition at line 36 of file bladerf1outputgui.h.

Constructor & Destructor Documentation

◆ Bladerf1OutputGui()

Bladerf1OutputGui::Bladerf1OutputGui ( DeviceUISet deviceUISet,
QWidget *  parent = 0 
)
explicit

Definition at line 34 of file bladerf1outputgui.cpp.

References displaySettings(), BladerfBandwidths::getBandwidth(), BladerfBandwidths::getNbBandwidths(), DeviceAPI::getSampleSink(), ColorMapper::GrayGold, ColorMapper::GrayGreenYellow, handleInputMessages(), i, DeviceUISet::m_deviceAPI, m_deviceSampleSink, m_deviceUISet, m_inputMessageQueue, m_statusTimer, m_updateTimer, openDeviceSettingsDialog(), ui, updateHardware(), and updateStatus().

34  :
35  QWidget(parent),
36  ui(new Ui::Bladerf1OutputGui),
37  m_deviceUISet(deviceUISet),
38  m_doApplySettings(true),
39  m_forceSettings(true),
40  m_settings(),
41  m_sampleRateMode(true),
42  m_deviceSampleSink(nullptr),
43  m_sampleRate(0),
45 {
47 
48  ui->setupUi(this);
49  ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
50  ui->centerFrequency->setValueRange(7, BLADERF_FREQUENCY_MIN_XB200/1000, BLADERF_FREQUENCY_MAX/1000);
51 
52  ui->sampleRate->setColorMapper(ColorMapper(ColorMapper::GrayGreenYellow));
53  ui->sampleRate->setValueRange(8, BLADERF_SAMPLERATE_MIN, BLADERF_SAMPLERATE_REC_MAX);
54 
55  ui->bandwidth->clear();
56 
57  for (unsigned int i = 0; i < BladerfBandwidths::getNbBandwidths(); i++)
58  {
59  ui->bandwidth->addItem(QString::number(BladerfBandwidths::getBandwidth(i)));
60  }
61 
62  connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware()));
63  connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus()));
64  m_statusTimer.start(500);
65 
66  CRightClickEnabler *startStopRightClickEnabler = new CRightClickEnabler(ui->startStop);
67  connect(startStopRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(openDeviceSettingsDialog(const QPoint &)));
68 
70 
71  connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection);
72 }
void openDeviceSettingsDialog(const QPoint &p)
DeviceSampleSink * getSampleSink()
Return pointer to the device sample sink (single Tx) or nullptr.
Definition: deviceapi.cpp:222
bool m_sampleRateMode
true: device, false: base band sample rate update mode
static unsigned int getBandwidth(unsigned int bandwidth_index)
engine is before initialization
Definition: deviceapi.h:53
DeviceAPI * m_deviceAPI
Definition: deviceuiset.h:48
BladeRF1OutputSettings m_settings
int32_t i
Definition: decimators.h:244
DeviceUISet * m_deviceUISet
Ui::Bladerf1OutputGui * ui
static unsigned int getNbBandwidths()
DeviceSampleSink * m_deviceSampleSink
MessageQueue m_inputMessageQueue
+ Here is the call graph for this function:

◆ ~Bladerf1OutputGui()

Bladerf1OutputGui::~Bladerf1OutputGui ( )
virtual

Definition at line 74 of file bladerf1outputgui.cpp.

References ui.

75 {
76  delete ui;
77 }
Ui::Bladerf1OutputGui * ui

Member Function Documentation

◆ blockApplySettings()

void Bladerf1OutputGui::blockApplySettings ( bool  block)
inlineprivate

Definition at line 71 of file bladerf1outputgui.h.

Referenced by handleMessage().

71 { m_doApplySettings = !block; }
+ Here is the caller graph for this function:

◆ deserialize()

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

Implements PluginInstanceGUI.

Definition at line 118 of file bladerf1outputgui.cpp.

References BladeRF1OutputSettings::deserialize(), displaySettings(), m_forceSettings, m_settings, resetToDefaults(), and sendSettings().

119 {
120  if(m_settings.deserialize(data)) {
121  displaySettings();
122  m_forceSettings = true;
123  sendSettings();
124  return true;
125  } else {
126  resetToDefaults();
127  return false;
128  }
129 }
bool deserialize(const QByteArray &data)
BladeRF1OutputSettings m_settings
+ Here is the call graph for this function:

◆ destroy()

void Bladerf1OutputGui::destroy ( )
virtual

Implements PluginInstanceGUI.

Definition at line 79 of file bladerf1outputgui.cpp.

80 {
81  delete this;
82 }

◆ displaySampleRate()

void Bladerf1OutputGui::displaySampleRate ( )
private

Definition at line 196 of file bladerf1outputgui.cpp.

References arg(), BladeRF1OutputSettings::m_devSampleRate, BladeRF1OutputSettings::m_log2Interp, m_sampleRateMode, m_settings, and ui.

Referenced by displaySettings(), on_interp_currentIndexChanged(), on_sampleRateMode_toggled(), and updateSampleRateAndFrequency().

197 {
198  ui->sampleRate->blockSignals(true);
199 
200  if (m_sampleRateMode)
201  {
202  ui->sampleRateMode->setStyleSheet("QToolButton { background:rgb(60,60,60); }");
203  ui->sampleRateMode->setText("SR");
204  ui->sampleRate->setValueRange(8, BLADERF_SAMPLERATE_MIN, BLADERF_SAMPLERATE_REC_MAX);
205  ui->sampleRate->setValue(m_settings.m_devSampleRate);
206  ui->sampleRate->setToolTip("Host to device sample rate (S/s)");
207  ui->deviceRateText->setToolTip("Baseband sample rate (S/s)");
208  uint32_t basebandSampleRate = m_settings.m_devSampleRate/(1<<m_settings.m_log2Interp);
209  ui->deviceRateText->setText(tr("%1k").arg(QString::number(basebandSampleRate / 1000.0f, 'g', 5)));
210  }
211  else
212  {
213  ui->sampleRateMode->setStyleSheet("QToolButton { background:rgb(50,50,50); }");
214  ui->sampleRateMode->setText("BB");
215  ui->sampleRate->setValueRange(8, BLADERF_SAMPLERATE_MIN/(1<<m_settings.m_log2Interp), BLADERF_SAMPLERATE_REC_MAX/(1<<m_settings.m_log2Interp));
216  ui->sampleRate->setValue(m_settings.m_devSampleRate/(1<<m_settings.m_log2Interp));
217  ui->sampleRate->setToolTip("Baseband sample rate (S/s)");
218  ui->deviceRateText->setToolTip("Host to device sample rate (S/s)");
219  ui->deviceRateText->setText(tr("%1k").arg(QString::number(m_settings.m_devSampleRate / 1000.0f, 'g', 5)));
220  }
221 
222  ui->sampleRate->blockSignals(false);
223 }
bool m_sampleRateMode
true: device, false: base band sample rate update mode
unsigned int uint32_t
Definition: rtptypes_win.h:46
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
BladeRF1OutputSettings m_settings
Ui::Bladerf1OutputGui * ui
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ displaySettings()

void Bladerf1OutputGui::displaySettings ( )
private

Definition at line 225 of file bladerf1outputgui.cpp.

References arg(), displaySampleRate(), BladerfBandwidths::getBandwidthIndex(), getXb200Index(), BladeRF1OutputSettings::m_bandwidth, BladeRF1OutputSettings::m_centerFrequency, BladeRF1OutputSettings::m_log2Interp, m_settings, BladeRF1OutputSettings::m_vga1, BladeRF1OutputSettings::m_vga2, BladeRF1OutputSettings::m_xb200, BladeRF1OutputSettings::m_xb200Filter, BladeRF1OutputSettings::m_xb200Path, and ui.

Referenced by Bladerf1OutputGui(), deserialize(), handleMessage(), resetToDefaults(), and setCenterFrequency().

226 {
227  ui->centerFrequency->setValue(m_settings.m_centerFrequency / 1000);
229 
230  unsigned int bandwidthIndex = BladerfBandwidths::getBandwidthIndex(m_settings.m_bandwidth);
231  ui->bandwidth->setCurrentIndex(bandwidthIndex);
232 
233  ui->interp->setCurrentIndex(m_settings.m_log2Interp);
234 
235  ui->vga1Text->setText(tr("%1dB").arg(m_settings.m_vga1));
236  ui->vga1->setValue(m_settings.m_vga1);
237 
238  ui->vga2Text->setText(tr("%1dB").arg(m_settings.m_vga2));
239  ui->vga2->setValue(m_settings.m_vga2);
240 
242 }
bladerf_xb200_path m_xb200Path
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
BladeRF1OutputSettings m_settings
bladerf_xb200_filter m_xb200Filter
Ui::Bladerf1OutputGui * ui
static unsigned int getBandwidthIndex(unsigned int bandwidth)
unsigned int getXb200Index(bool xb_200, bladerf_xb200_path xb200Path, bladerf_xb200_filter xb200Filter)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCenterFrequency()

qint64 Bladerf1OutputGui::getCenterFrequency ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 101 of file bladerf1outputgui.cpp.

References BladeRF1OutputSettings::m_centerFrequency, and m_settings.

102 {
104 }
BladeRF1OutputSettings m_settings

◆ getInputMessageQueue()

virtual MessageQueue* Bladerf1OutputGui::getInputMessageQueue ( )
inlinevirtual

Implements PluginInstanceGUI.

Definition at line 52 of file bladerf1outputgui.h.

52 { return &m_inputMessageQueue; }
MessageQueue m_inputMessageQueue

◆ getName()

QString Bladerf1OutputGui::getName ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 89 of file bladerf1outputgui.cpp.

90 {
91  return objectName();
92 }

◆ getXb200Index()

unsigned int Bladerf1OutputGui::getXb200Index ( bool  xb_200,
bladerf_xb200_path  xb200Path,
bladerf_xb200_filter  xb200Filter 
)
private

Definition at line 425 of file bladerf1outputgui.cpp.

Referenced by displaySettings().

426 {
427  if (xb_200)
428  {
429  if (xb200Path == BLADERF_XB200_BYPASS)
430  {
431  return 1;
432  }
433  else
434  {
435  if (xb200Filter == BLADERF_XB200_AUTO_1DB)
436  {
437  return 2;
438  }
439  else if (xb200Filter == BLADERF_XB200_AUTO_3DB)
440  {
441  return 3;
442  }
443  else if (xb200Filter == BLADERF_XB200_CUSTOM)
444  {
445  return 4;
446  }
447  else if (xb200Filter == BLADERF_XB200_50M)
448  {
449  return 5;
450  }
451  else if (xb200Filter == BLADERF_XB200_144M)
452  {
453  return 6;
454  }
455  else // xb200Filter == BLADERF_XB200_222M
456  {
457  return 7;
458  }
459  }
460  }
461  else
462  {
463  return 0;
464  }
465 }
+ Here is the caller graph for this function:

◆ handleInputMessages

void Bladerf1OutputGui::handleInputMessages ( )
privateslot

Definition at line 161 of file bladerf1outputgui.cpp.

References DSPSignalNotification::getCenterFrequency(), Message::getIdentifier(), DSPSignalNotification::getSampleRate(), handleMessage(), m_deviceCenterFrequency, m_inputMessageQueue, m_sampleRate, Message::match(), MessageQueue::pop(), and updateSampleRateAndFrequency().

Referenced by Bladerf1OutputGui().

162 {
163  Message* message;
164 
165  while ((message = m_inputMessageQueue.pop()) != 0)
166  {
167  qDebug("BladerfOutputGui::handleInputMessages: message: %s", message->getIdentifier());
168 
169  if (DSPSignalNotification::match(*message))
170  {
171  DSPSignalNotification* notif = (DSPSignalNotification*) message;
172  m_sampleRate = notif->getSampleRate();
174  qDebug("BladerfOutputGui::handleInputMessages: DSPSignalNotification: SampleRate:%d, CenterFrequency:%llu", notif->getSampleRate(), notif->getCenterFrequency());
176 
177  delete message;
178  }
179  else
180  {
181  if (handleMessage(*message))
182  {
183  delete message;
184  }
185  }
186  }
187 }
Message * pop()
Pop message from queue.
qint64 getCenterFrequency() const
Definition: dspcommands.h:329
quint64 m_deviceCenterFrequency
Center frequency in device.
static bool match(const Message *message)
Definition: message.cpp:45
int getSampleRate() const
Definition: dspcommands.h:328
virtual const char * getIdentifier() const
Definition: message.cpp:35
virtual bool handleMessage(const Message &message)
MessageQueue m_inputMessageQueue
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleMessage()

bool Bladerf1OutputGui::handleMessage ( const Message message)
virtual

Implements PluginInstanceGUI.

Definition at line 131 of file bladerf1outputgui.cpp.

References blockApplySettings(), displaySettings(), Bladerf1Output::MsgConfigureBladerf1::getSettings(), Bladerf1Output::MsgStartStop::getStartStop(), m_settings, Message::match(), and ui.

Referenced by handleInputMessages().

132 {
134  {
136  m_settings = cfg.getSettings();
137  blockApplySettings(true);
138  displaySettings();
139  blockApplySettings(false);
140  return true;
141  }
143  {
144  displaySettings();
145  return true;
146  }
147  else if (Bladerf1Output::MsgStartStop::match(message))
148  {
150  blockApplySettings(true);
151  ui->startStop->setChecked(notif.getStartStop());
152  blockApplySettings(false);
153  return true;
154  }
155  else
156  {
157  return false;
158  }
159 }
const BladeRF1OutputSettings & getSettings() const
BladeRF1OutputSettings m_settings
static bool match(const Message *message)
Definition: message.cpp:45
void blockApplySettings(bool block)
Ui::Bladerf1OutputGui * ui
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_bandwidth_currentIndexChanged

void Bladerf1OutputGui::on_bandwidth_currentIndexChanged ( int  index)
privateslot

Definition at line 267 of file bladerf1outputgui.cpp.

References BladerfBandwidths::getBandwidth(), BladeRF1OutputSettings::m_bandwidth, m_settings, and sendSettings().

268 {
269  int newbw = BladerfBandwidths::getBandwidth(index);
270  m_settings.m_bandwidth = newbw * 1000;
271  sendSettings();
272 }
static unsigned int getBandwidth(unsigned int bandwidth_index)
BladeRF1OutputSettings m_settings
+ Here is the call graph for this function:

◆ on_centerFrequency_changed

void Bladerf1OutputGui::on_centerFrequency_changed ( quint64  value)
privateslot

Definition at line 250 of file bladerf1outputgui.cpp.

References BladeRF1OutputSettings::m_centerFrequency, m_settings, and sendSettings().

251 {
252  m_settings.m_centerFrequency = value * 1000;
253  sendSettings();
254 }
BladeRF1OutputSettings m_settings
+ Here is the call graph for this function:

◆ on_interp_currentIndexChanged

void Bladerf1OutputGui::on_interp_currentIndexChanged ( int  index)
privateslot

Definition at line 274 of file bladerf1outputgui.cpp.

References displaySampleRate(), BladeRF1OutputSettings::m_devSampleRate, BladeRF1OutputSettings::m_log2Interp, m_sampleRateMode, m_settings, sendSettings(), and ui.

275 {
276  if ((index <0) || (index > 6)) {
277  return;
278  }
279 
280  m_settings.m_log2Interp = index;
282 
283  if (m_sampleRateMode) {
284  m_settings.m_devSampleRate = ui->sampleRate->getValueNew();
285  } else {
286  m_settings.m_devSampleRate = ui->sampleRate->getValueNew() * (1 << m_settings.m_log2Interp);
287  }
288 
289  sendSettings();
290 }
bool m_sampleRateMode
true: device, false: base band sample rate update mode
BladeRF1OutputSettings m_settings
Ui::Bladerf1OutputGui * ui
+ Here is the call graph for this function:

◆ on_sampleRate_changed

void Bladerf1OutputGui::on_sampleRate_changed ( quint64  value)
privateslot

Definition at line 256 of file bladerf1outputgui.cpp.

References BladeRF1OutputSettings::m_devSampleRate, BladeRF1OutputSettings::m_log2Interp, m_sampleRateMode, m_settings, and sendSettings().

257 {
258  if (m_sampleRateMode) {
259  m_settings.m_devSampleRate = value;
260  } else {
262  }
263 
264  sendSettings();
265 }
bool m_sampleRateMode
true: device, false: base band sample rate update mode
BladeRF1OutputSettings m_settings
+ Here is the call graph for this function:

◆ on_sampleRateMode_toggled

void Bladerf1OutputGui::on_sampleRateMode_toggled ( bool  checked)
privateslot

Definition at line 381 of file bladerf1outputgui.cpp.

References displaySampleRate(), and m_sampleRateMode.

382 {
383  m_sampleRateMode = checked;
385 }
bool m_sampleRateMode
true: device, false: base band sample rate update mode
+ Here is the call graph for this function:

◆ on_startStop_toggled

void Bladerf1OutputGui::on_startStop_toggled ( bool  checked)
privateslot

Definition at line 372 of file bladerf1outputgui.cpp.

References Bladerf1Output::MsgStartStop::create(), DeviceSampleSink::getInputMessageQueue(), m_deviceSampleSink, m_doApplySettings, and MessageQueue::push().

373 {
374  if (m_doApplySettings)
375  {
378  }
379 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
DeviceSampleSink * m_deviceSampleSink
static MsgStartStop * create(bool startStop)
+ Here is the call graph for this function:

◆ on_vga1_valueChanged

void Bladerf1OutputGui::on_vga1_valueChanged ( int  value)
privateslot

Definition at line 292 of file bladerf1outputgui.cpp.

References arg(), m_settings, BladeRF1OutputSettings::m_vga1, sendSettings(), and ui.

293 {
294  if ((value < BLADERF_TXVGA1_GAIN_MIN) || (value > BLADERF_TXVGA1_GAIN_MAX))
295  return;
296 
297  ui->vga1Text->setText(tr("%1dB").arg(value));
298  m_settings.m_vga1 = value;
299  sendSettings();
300 }
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
BladeRF1OutputSettings m_settings
Ui::Bladerf1OutputGui * ui
+ Here is the call graph for this function:

◆ on_vga2_valueChanged

void Bladerf1OutputGui::on_vga2_valueChanged ( int  value)
privateslot

Definition at line 302 of file bladerf1outputgui.cpp.

References arg(), m_settings, BladeRF1OutputSettings::m_vga2, sendSettings(), and ui.

303 {
304  if ((value < BLADERF_TXVGA2_GAIN_MIN) || (value > BLADERF_TXVGA2_GAIN_MAX))
305  return;
306 
307  ui->vga2Text->setText(tr("%1dB").arg(value));
308  m_settings.m_vga2 = value;
309  sendSettings();
310 }
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
BladeRF1OutputSettings m_settings
Ui::Bladerf1OutputGui * ui
+ Here is the call graph for this function:

◆ on_xb200_currentIndexChanged

void Bladerf1OutputGui::on_xb200_currentIndexChanged ( int  index)
privateslot

Definition at line 312 of file bladerf1outputgui.cpp.

References m_settings, BladeRF1OutputSettings::m_xb200, BladeRF1OutputSettings::m_xb200Filter, BladeRF1OutputSettings::m_xb200Path, sendSettings(), and ui.

313 {
314  if (index == 1) // bypass
315  {
316  m_settings.m_xb200 = true;
317  m_settings.m_xb200Path = BLADERF_XB200_BYPASS;
318  }
319  else if (index == 2) // Auto 1dB
320  {
321  m_settings.m_xb200 = true;
322  m_settings.m_xb200Path = BLADERF_XB200_MIX;
323  m_settings.m_xb200Filter = BLADERF_XB200_AUTO_1DB;
324  }
325  else if (index == 3) // Auto 3dB
326  {
327  m_settings.m_xb200 = true;
328  m_settings.m_xb200Path = BLADERF_XB200_MIX;
329  m_settings.m_xb200Filter = BLADERF_XB200_AUTO_3DB;
330  }
331  else if (index == 4) // Custom
332  {
333  m_settings.m_xb200 = true;
334  m_settings.m_xb200Path = BLADERF_XB200_MIX;
335  m_settings.m_xb200Filter = BLADERF_XB200_CUSTOM;
336  }
337  else if (index == 5) // 50 MHz
338  {
339  m_settings.m_xb200 = true;
340  m_settings.m_xb200Path = BLADERF_XB200_MIX;
341  m_settings.m_xb200Filter = BLADERF_XB200_50M;
342  }
343  else if (index == 6) // 144 MHz
344  {
345  m_settings.m_xb200 = true;
346  m_settings.m_xb200Path = BLADERF_XB200_MIX;
347  m_settings.m_xb200Filter = BLADERF_XB200_144M;
348  }
349  else if (index == 7) // 222 MHz
350  {
351  m_settings.m_xb200 = true;
352  m_settings.m_xb200Path = BLADERF_XB200_MIX;
353  m_settings.m_xb200Filter = BLADERF_XB200_222M;
354  }
355  else // no xb200
356  {
357  m_settings.m_xb200 = false;
358  }
359 
360  if (m_settings.m_xb200)
361  {
362  ui->centerFrequency->setValueRange(7, BLADERF_FREQUENCY_MIN_XB200/1000, BLADERF_FREQUENCY_MAX/1000);
363  }
364  else
365  {
366  ui->centerFrequency->setValueRange(7, BLADERF_FREQUENCY_MIN/1000, BLADERF_FREQUENCY_MAX/1000);
367  }
368 
369  sendSettings();
370 }
bladerf_xb200_path m_xb200Path
BladeRF1OutputSettings m_settings
bladerf_xb200_filter m_xb200Filter
Ui::Bladerf1OutputGui * ui
+ Here is the call graph for this function:

◆ openDeviceSettingsDialog

void Bladerf1OutputGui::openDeviceSettingsDialog ( const QPoint &  p)
privateslot

Definition at line 467 of file bladerf1outputgui.cpp.

References BasicDeviceSettingsDialog::getReverseAPIAddress(), BasicDeviceSettingsDialog::getReverseAPIDeviceIndex(), BasicDeviceSettingsDialog::getReverseAPIPort(), BladeRF1OutputSettings::m_reverseAPIAddress, BladeRF1OutputSettings::m_reverseAPIDeviceIndex, BladeRF1OutputSettings::m_reverseAPIPort, m_settings, BladeRF1OutputSettings::m_useReverseAPI, sendSettings(), BasicDeviceSettingsDialog::setReverseAPIAddress(), BasicDeviceSettingsDialog::setReverseAPIDeviceIndex(), BasicDeviceSettingsDialog::setReverseAPIPort(), BasicDeviceSettingsDialog::setUseReverseAPI(), and BasicDeviceSettingsDialog::useReverseAPI().

Referenced by Bladerf1OutputGui().

468 {
469  BasicDeviceSettingsDialog dialog(this);
470  dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
471  dialog.setReverseAPIAddress(m_settings.m_reverseAPIAddress);
472  dialog.setReverseAPIPort(m_settings.m_reverseAPIPort);
473  dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex);
474 
475  dialog.move(p);
476  dialog.exec();
477 
478  m_settings.m_useReverseAPI = dialog.useReverseAPI();
479  m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress();
480  m_settings.m_reverseAPIPort = dialog.getReverseAPIPort();
481  m_settings.m_reverseAPIDeviceIndex = dialog.getReverseAPIDeviceIndex();
482 
483  sendSettings();
484 }
BladeRF1OutputSettings m_settings
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetToDefaults()

void Bladerf1OutputGui::resetToDefaults ( )
virtual

Implements PluginInstanceGUI.

Definition at line 94 of file bladerf1outputgui.cpp.

References displaySettings(), m_settings, BladeRF1OutputSettings::resetToDefaults(), and sendSettings().

Referenced by deserialize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendSettings()

void Bladerf1OutputGui::sendSettings ( )
private

◆ serialize()

QByteArray Bladerf1OutputGui::serialize ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 113 of file bladerf1outputgui.cpp.

References m_settings, and BladeRF1OutputSettings::serialize().

114 {
115  return m_settings.serialize();
116 }
BladeRF1OutputSettings m_settings
+ Here is the call graph for this function:

◆ setCenterFrequency()

void Bladerf1OutputGui::setCenterFrequency ( qint64  centerFrequency)
virtual

Implements PluginInstanceGUI.

Definition at line 106 of file bladerf1outputgui.cpp.

References displaySettings(), BladeRF1OutputSettings::m_centerFrequency, m_settings, and sendSettings().

107 {
108  m_settings.m_centerFrequency = centerFrequency;
109  displaySettings();
110  sendSettings();
111 }
BladeRF1OutputSettings m_settings
+ Here is the call graph for this function:

◆ setName()

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

Implements PluginInstanceGUI.

Definition at line 84 of file bladerf1outputgui.cpp.

85 {
86  setObjectName(name);
87 }

◆ updateHardware

void Bladerf1OutputGui::updateHardware ( )
privateslot

Definition at line 387 of file bladerf1outputgui.cpp.

References Bladerf1Output::MsgConfigureBladerf1::create(), DeviceSampleSink::getInputMessageQueue(), m_deviceSampleSink, m_forceSettings, m_settings, m_updateTimer, and MessageQueue::push().

Referenced by Bladerf1OutputGui().

388 {
389  qDebug() << "BladerfGui::updateHardware";
392  m_forceSettings = false;
393  m_updateTimer.stop();
394 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
BladeRF1OutputSettings m_settings
DeviceSampleSink * m_deviceSampleSink
static MsgConfigureBladerf1 * create(const BladeRF1OutputSettings &settings, bool force)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateSampleRateAndFrequency()

void Bladerf1OutputGui::updateSampleRateAndFrequency ( )
private

Definition at line 189 of file bladerf1outputgui.cpp.

References displaySampleRate(), DeviceUISet::getSpectrum(), m_deviceCenterFrequency, m_deviceUISet, m_sampleRate, GLSpectrum::setCenterFrequency(), and GLSpectrum::setSampleRate().

Referenced by handleInputMessages().

190 {
194 }
void setSampleRate(qint32 sampleRate)
Definition: glspectrum.cpp:211
GLSpectrum * getSpectrum()
Direct spectrum getter.
Definition: deviceuiset.h:57
quint64 m_deviceCenterFrequency
Center frequency in device.
DeviceUISet * m_deviceUISet
void setCenterFrequency(qint64 frequency)
Definition: glspectrum.cpp:175
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateStatus

void Bladerf1OutputGui::updateStatus ( )
privateslot

Definition at line 396 of file bladerf1outputgui.cpp.

References DeviceAPI::errorMessage(), DeviceUISet::m_deviceAPI, m_deviceUISet, m_lastEngineState, DeviceAPI::state(), DeviceAPI::StError, DeviceAPI::StIdle, DeviceAPI::StNotStarted, DeviceAPI::StRunning, and ui.

Referenced by Bladerf1OutputGui().

397 {
398  int state = m_deviceUISet->m_deviceAPI->state();
399 
400  if(m_lastEngineState != state)
401  {
402  switch(state)
403  {
405  ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
406  break;
407  case DeviceAPI::StIdle:
408  ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
409  break;
411  ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
412  break;
413  case DeviceAPI::StError:
414  ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
415  QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
416  break;
417  default:
418  break;
419  }
420 
421  m_lastEngineState = state;
422  }
423 }
QString errorMessage()
Last error message from the device engine.
Definition: deviceapi.cpp:290
engine is before initialization
Definition: deviceapi.h:53
EngineState state() const
Return the state of the device engine corresponding to the stream type.
Definition: deviceapi.cpp:277
DeviceAPI * m_deviceAPI
Definition: deviceuiset.h:48
engine is idle
Definition: deviceapi.h:54
DeviceUISet * m_deviceUISet
Ui::Bladerf1OutputGui * ui
engine is running
Definition: deviceapi.h:56
engine is in error
Definition: deviceapi.h:57
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_deviceCenterFrequency

quint64 Bladerf1OutputGui::m_deviceCenterFrequency
private

Center frequency in device.

Definition at line 67 of file bladerf1outputgui.h.

Referenced by handleInputMessages(), and updateSampleRateAndFrequency().

◆ m_deviceSampleSink

DeviceSampleSink* Bladerf1OutputGui::m_deviceSampleSink
private

Definition at line 65 of file bladerf1outputgui.h.

Referenced by Bladerf1OutputGui(), on_startStop_toggled(), and updateHardware().

◆ m_deviceUISet

DeviceUISet* Bladerf1OutputGui::m_deviceUISet
private

◆ m_doApplySettings

bool Bladerf1OutputGui::m_doApplySettings
private

Definition at line 59 of file bladerf1outputgui.h.

Referenced by on_startStop_toggled().

◆ m_forceSettings

bool Bladerf1OutputGui::m_forceSettings
private

Definition at line 60 of file bladerf1outputgui.h.

Referenced by deserialize(), and updateHardware().

◆ m_inputMessageQueue

MessageQueue Bladerf1OutputGui::m_inputMessageQueue
private

Definition at line 69 of file bladerf1outputgui.h.

Referenced by Bladerf1OutputGui(), and handleInputMessages().

◆ m_lastEngineState

int Bladerf1OutputGui::m_lastEngineState
private

Definition at line 68 of file bladerf1outputgui.h.

Referenced by updateStatus().

◆ m_sampleRate

int Bladerf1OutputGui::m_sampleRate
private

Definition at line 66 of file bladerf1outputgui.h.

Referenced by handleInputMessages(), and updateSampleRateAndFrequency().

◆ m_sampleRateMode

bool Bladerf1OutputGui::m_sampleRateMode
private

true: device, false: base band sample rate update mode

Definition at line 62 of file bladerf1outputgui.h.

Referenced by displaySampleRate(), on_interp_currentIndexChanged(), on_sampleRate_changed(), and on_sampleRateMode_toggled().

◆ m_settings

BladeRF1OutputSettings Bladerf1OutputGui::m_settings
private

◆ m_statusTimer

QTimer Bladerf1OutputGui::m_statusTimer
private

Definition at line 64 of file bladerf1outputgui.h.

Referenced by Bladerf1OutputGui().

◆ m_updateTimer

QTimer Bladerf1OutputGui::m_updateTimer
private

Definition at line 63 of file bladerf1outputgui.h.

Referenced by Bladerf1OutputGui(), sendSettings(), and updateHardware().

◆ ui

Ui::Bladerf1OutputGui* Bladerf1OutputGui::ui
private

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