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

#include <bladerf2inputgui.h>

+ Inheritance diagram for BladeRF2InputGui:
+ Collaboration diagram for BladeRF2InputGui:

Public Member Functions

 BladeRF2InputGui (DeviceUISet *deviceUISet, QWidget *parent=0)
 
virtual ~BladeRF2InputGui ()
 
virtual void destroy ()
 
void setName (const QString &name)
 
QString getName () const
 
virtual void resetToDefaults ()
 
virtual qint64 getCenterFrequency () const
 
virtual void setCenterFrequency (qint64 centerFrequency)
 
virtual QByteArray serialize () const
 
virtual 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_LOppm_valueChanged (int value)
 
void on_sampleRate_changed (quint64 value)
 
void on_dcOffset_toggled (bool checked)
 
void on_iqImbalance_toggled (bool checked)
 
void on_biasTee_toggled (bool checked)
 
void on_bandwidth_changed (quint64 value)
 
void on_decim_currentIndexChanged (int index)
 
void on_fcPos_currentIndexChanged (int index)
 
void on_gainMode_currentIndexChanged (int index)
 
void on_gain_valueChanged (int value)
 
void on_transverter_clicked ()
 
void on_startStop_toggled (bool checked)
 
void on_record_toggled (bool checked)
 
void on_sampleRateMode_toggled (bool checked)
 
void updateHardware ()
 
void updateStatus ()
 
void openDeviceSettingsDialog (const QPoint &p)
 

Private Member Functions

void displaySettings ()
 
void displaySampleRate ()
 
void displayFcTooltip ()
 
void sendSettings ()
 
void updateSampleRateAndFrequency ()
 
void updateFrequencyLimits ()
 
void setCenterFrequencySetting (uint64_t kHzValue)
 
void blockApplySettings (bool block)
 

Private Attributes

Ui::Bladerf2InputGui * ui
 
DeviceUISetm_deviceUISet
 
bool m_forceSettings
 
bool m_doApplySettings
 
BladeRF2InputSettings m_settings
 
bool m_sampleRateMode
 true: device, false: base band sample rate update mode More...
 
QTimer m_updateTimer
 
QTimer m_statusTimer
 
std::vector< int > m_gains
 
BladeRF2Inputm_sampleSource
 
int m_sampleRate
 
quint64 m_deviceCenterFrequency
 Center frequency in device. More...
 
int m_lastEngineState
 
MessageQueue m_inputMessageQueue
 

Detailed Description

Definition at line 35 of file bladerf2inputgui.h.

Constructor & Destructor Documentation

◆ BladeRF2InputGui()

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

Definition at line 35 of file bladerf2inputgui.cpp.

References displaySettings(), BladeRF2Input::getBandwidthRange(), BladeRF2Input::getFrequencyRange(), BladeRF2Input::getGainModes(), BladeRF2Input::getGlobalGainRange(), BladeRF2Input::getSampleRateRange(), DeviceAPI::getSampleSource(), ColorMapper::GrayGold, ColorMapper::GrayGreenYellow, ColorMapper::GrayYellow, handleInputMessages(), DeviceUISet::m_deviceAPI, m_deviceUISet, m_inputMessageQueue, m_sampleSource, m_statusTimer, m_updateTimer, leansdr::max(), leansdr::min(), openDeviceSettingsDialog(), sendSettings(), BladeRF2Input::setMessageQueueToGUI(), ui, updateHardware(), and updateStatus().

35  :
36  QWidget(parent),
37  ui(new Ui::Bladerf2InputGui),
38  m_deviceUISet(deviceUISet),
39  m_forceSettings(true),
40  m_doApplySettings(true),
41  m_settings(),
42  m_sampleRateMode(true),
43  m_sampleSource(0),
44  m_sampleRate(0),
46 {
48  int max, min, step;
49  uint64_t f_min, f_max;
50 
51  ui->setupUi(this);
52 
53  m_sampleSource->getFrequencyRange(f_min, f_max, step);
54  ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
55  ui->centerFrequency->setValueRange(7, f_min/1000, f_max/1000);
56 
57  m_sampleSource->getSampleRateRange(min, max, step);
58  ui->sampleRate->setColorMapper(ColorMapper(ColorMapper::GrayGreenYellow));
59  ui->sampleRate->setValueRange(8, min, max);
60 
61  m_sampleSource->getBandwidthRange(min, max, step);
62  ui->bandwidth->setColorMapper(ColorMapper(ColorMapper::GrayYellow));
63  ui->bandwidth->setValueRange(5, min/1000, max/1000);
64 
65  const std::vector<BladeRF2Input::GainMode>& modes = m_sampleSource->getGainModes();
66  std::vector<BladeRF2Input::GainMode>::const_iterator it = modes.begin();
67 
68  ui->gainMode->blockSignals(true);
69 
70  for (; it != modes.end(); ++it) {
71  ui->gainMode->addItem(it->m_name);
72  }
73 
74  ui->gainMode->blockSignals(false);
75 
76  m_sampleSource->getGlobalGainRange(min, max, step);
77  ui->gain->setMinimum(min);
78  ui->gain->setMaximum(max);
79  ui->gain->setPageStep(step);
80  ui->gain->setSingleStep(step);
81 
82  ui->label_decim->setText(QString::fromUtf8("D\u2193"));
83 
84  connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware()));
85  connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus()));
86  m_statusTimer.start(500);
87 
88  CRightClickEnabler *startStopRightClickEnabler = new CRightClickEnabler(ui->startStop);
89  connect(startStopRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(openDeviceSettingsDialog(const QPoint &)));
90 
92 
93  connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection);
95 
96  sendSettings();
97 }
virtual void setMessageQueueToGUI(MessageQueue *queue)
void openDeviceSettingsDialog(const QPoint &p)
DeviceSampleSource * getSampleSource()
Return pointer to the device sample source (single Rx) or nullptr.
Definition: deviceapi.cpp:213
Ui::Bladerf2InputGui * ui
const std::vector< GainMode > & getGainModes()
DeviceUISet * m_deviceUISet
void getFrequencyRange(uint64_t &min, uint64_t &max, int &step)
void getGlobalGainRange(int &min, int &max, int &step)
void getBandwidthRange(int &min, int &max, int &step)
engine is before initialization
Definition: deviceapi.h:53
DeviceAPI * m_deviceAPI
Definition: deviceuiset.h:48
BladeRF2InputSettings m_settings
void getSampleRateRange(int &min, int &max, int &step)
BladeRF2Input * m_sampleSource
T max(const T &x, const T &y)
Definition: framework.h:446
MessageQueue m_inputMessageQueue
T min(const T &x, const T &y)
Definition: framework.h:440
bool m_sampleRateMode
true: device, false: base band sample rate update mode
unsigned __int64 uint64_t
Definition: rtptypes_win.h:48
+ Here is the call graph for this function:

◆ ~BladeRF2InputGui()

BladeRF2InputGui::~BladeRF2InputGui ( )
virtual

Definition at line 99 of file bladerf2inputgui.cpp.

References ui.

100 {
101  delete ui;
102 }
Ui::Bladerf2InputGui * ui

Member Function Documentation

◆ blockApplySettings()

void BladeRF2InputGui::blockApplySettings ( bool  block)
private

Definition at line 500 of file bladerf2inputgui.cpp.

References m_doApplySettings.

Referenced by displaySettings(), and handleMessage().

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

◆ deserialize()

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

Implements PluginInstanceGUI.

Definition at line 143 of file bladerf2inputgui.cpp.

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

144 {
145  if(m_settings.deserialize(data)) {
146  displaySettings();
147  m_forceSettings = true;
148  sendSettings();
149  return true;
150  } else {
151  resetToDefaults();
152  return false;
153  }
154 }
BladeRF2InputSettings m_settings
virtual void resetToDefaults()
bool deserialize(const QByteArray &data)
+ Here is the call graph for this function:

◆ destroy()

void BladeRF2InputGui::destroy ( )
virtual

Implements PluginInstanceGUI.

Definition at line 104 of file bladerf2inputgui.cpp.

105 {
106  delete this;
107 }

◆ displayFcTooltip()

void BladeRF2InputGui::displayFcTooltip ( )
private

Definition at line 295 of file bladerf2inputgui.cpp.

References arg(), DeviceSampleSource::calculateFrequencyShift(), BladeRF2InputSettings::m_devSampleRate, BladeRF2InputSettings::m_fcPos, BladeRF2InputSettings::m_log2Decim, m_settings, and ui.

Referenced by displaySampleRate(), on_fcPos_currentIndexChanged(), and on_sampleRate_changed().

296 {
301  DeviceSampleSource::FrequencyShiftScheme::FSHIFT_STD
302  );
303  ui->fcPos->setToolTip(tr("Relative position of device center frequency: %1 kHz").arg(QString::number(fShift / 1000.0f, 'g', 5)));
304 }
static qint32 calculateFrequencyShift(int log2Decim, fcPos_t fcPos, quint32 devSampleRate, FrequencyShiftScheme frequencyShiftScheme)
Ui::Bladerf2InputGui * ui
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
BladeRF2InputSettings m_settings
int int32_t
Definition: rtptypes_win.h:45
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ displaySampleRate()

void BladeRF2InputGui::displaySampleRate ( )
private

Definition at line 260 of file bladerf2inputgui.cpp.

References arg(), displayFcTooltip(), BladeRF2Input::getSampleRateRange(), BladeRF2InputSettings::m_devSampleRate, BladeRF2InputSettings::m_log2Decim, m_sampleRateMode, m_sampleSource, m_settings, leansdr::max(), leansdr::min(), and ui.

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

261 {
262  int max, min, step;
263  m_sampleSource->getSampleRateRange(min, max, step);
264 
265  ui->sampleRate->blockSignals(true);
267 
268  if (m_sampleRateMode)
269  {
270  ui->sampleRateMode->setStyleSheet("QToolButton { background:rgb(60,60,60); }");
271  ui->sampleRateMode->setText("SR");
272  // BladeRF can go as low as 80 kS/s but because of buffering in practice experience is not good below 330 kS/s
273  ui->sampleRate->setValueRange(8, min, max);
274  ui->sampleRate->setValue(m_settings.m_devSampleRate);
275  ui->sampleRate->setToolTip("Device to host sample rate (S/s)");
276  ui->deviceRateText->setToolTip("Baseband sample rate (S/s)");
277  uint32_t basebandSampleRate = m_settings.m_devSampleRate/(1<<m_settings.m_log2Decim);
278  ui->deviceRateText->setText(tr("%1k").arg(QString::number(basebandSampleRate / 1000.0f, 'g', 5)));
279  }
280  else
281  {
282  ui->sampleRateMode->setStyleSheet("QToolButton { background:rgb(50,50,50); }");
283  ui->sampleRateMode->setText("BB");
284  // BladeRF can go as low as 80 kS/s but because of buffering in practice experience is not good below 330 kS/s
285  ui->sampleRate->setValueRange(8, min/(1<<m_settings.m_log2Decim), max/(1<<m_settings.m_log2Decim));
286  ui->sampleRate->setValue(m_settings.m_devSampleRate/(1<<m_settings.m_log2Decim));
287  ui->sampleRate->setToolTip("Baseband sample rate (S/s)");
288  ui->deviceRateText->setToolTip("Device to host sample rate (S/s)");
289  ui->deviceRateText->setText(tr("%1k").arg(QString::number(m_settings.m_devSampleRate / 1000.0f, 'g', 5)));
290  }
291 
292  ui->sampleRate->blockSignals(false);
293 }
Ui::Bladerf2InputGui * ui
unsigned int uint32_t
Definition: rtptypes_win.h:46
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
BladeRF2InputSettings m_settings
void getSampleRateRange(int &min, int &max, int &step)
BladeRF2Input * m_sampleSource
T max(const T &x, const T &y)
Definition: framework.h:446
T min(const T &x, const T &y)
Definition: framework.h:440
bool m_sampleRateMode
true: device, false: base band sample rate update mode
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ displaySettings()

void BladeRF2InputGui::displaySettings ( )
private

Definition at line 306 of file bladerf2inputgui.cpp.

References arg(), blockApplySettings(), displaySampleRate(), BladeRF2InputSettings::m_bandwidth, BladeRF2InputSettings::m_biasTee, BladeRF2InputSettings::m_centerFrequency, BladeRF2InputSettings::m_dcBlock, BladeRF2InputSettings::m_fcPos, BladeRF2InputSettings::m_gainMode, BladeRF2InputSettings::m_globalGain, BladeRF2InputSettings::m_iqCorrection, BladeRF2InputSettings::m_log2Decim, BladeRF2InputSettings::m_LOppmTenths, m_settings, BladeRF2InputSettings::m_transverterDeltaFrequency, BladeRF2InputSettings::m_transverterMode, and ui.

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

307 {
308  blockApplySettings(true);
309 
310  ui->transverter->setDeltaFrequency(m_settings.m_transverterDeltaFrequency);
311  ui->transverter->setDeltaFrequencyActive(m_settings.m_transverterMode);
312 
313  ui->centerFrequency->setValue(m_settings.m_centerFrequency / 1000);
314  ui->LOppm->setValue(m_settings.m_LOppmTenths);
315  ui->LOppmText->setText(QString("%1").arg(QString::number(m_settings.m_LOppmTenths/10.0, 'f', 1)));
317  ui->bandwidth->setValue(m_settings.m_bandwidth / 1000);
318 
319  ui->dcOffset->setChecked(m_settings.m_dcBlock);
320  ui->iqImbalance->setChecked(m_settings.m_iqCorrection);
321  ui->biasTee->setChecked(m_settings.m_biasTee);
322 
323  ui->decim->setCurrentIndex(m_settings.m_log2Decim);
324  ui->fcPos->setCurrentIndex((int) m_settings.m_fcPos);
325 
326  ui->gainMode->setCurrentIndex(m_settings.m_gainMode);
327  ui->gainText->setText(tr("%1 dB").arg(m_settings.m_globalGain));
328  ui->gain->setValue(m_settings.m_globalGain);
329 
330  if (m_settings.m_gainMode == BLADERF_GAIN_MANUAL) {
331  ui->gain->setEnabled(true);
332  } else {
333  ui->gain->setEnabled(false);
334  }
335 
336  blockApplySettings(false);
337 }
void blockApplySettings(bool block)
Ui::Bladerf2InputGui * ui
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
BladeRF2InputSettings m_settings
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCenterFrequency()

qint64 BladeRF2InputGui::getCenterFrequency ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 126 of file bladerf2inputgui.cpp.

References BladeRF2InputSettings::m_centerFrequency, and m_settings.

127 {
129 }
BladeRF2InputSettings m_settings

◆ getInputMessageQueue()

virtual MessageQueue* BladeRF2InputGui::getInputMessageQueue ( )
inlinevirtual

Implements PluginInstanceGUI.

Definition at line 51 of file bladerf2inputgui.h.

51 { return &m_inputMessageQueue; }
MessageQueue m_inputMessageQueue

◆ getName()

QString BladeRF2InputGui::getName ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 114 of file bladerf2inputgui.cpp.

115 {
116  return objectName();
117 }

◆ handleInputMessages

void BladeRF2InputGui::handleInputMessages ( )
privateslot

Definition at line 225 of file bladerf2inputgui.cpp.

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

Referenced by BladeRF2InputGui().

226 {
227  Message* message;
228 
229  while ((message = m_inputMessageQueue.pop()) != 0)
230  {
231  qDebug("BladeRF2InputGui::handleInputMessages: message: %s", message->getIdentifier());
232 
233  if (DSPSignalNotification::match(*message))
234  {
235  DSPSignalNotification* notif = (DSPSignalNotification*) message;
236  m_sampleRate = notif->getSampleRate();
238  qDebug("BladeRF2InputGui::handleInputMessages: DSPSignalNotification: SampleRate:%d, CenterFrequency:%llu", notif->getSampleRate(), notif->getCenterFrequency());
240 
241  delete message;
242  }
243  else
244  {
245  if (handleMessage(*message))
246  {
247  delete message;
248  }
249  }
250  }
251 }
Message * pop()
Pop message from queue.
void updateSampleRateAndFrequency()
qint64 getCenterFrequency() const
Definition: dspcommands.h:329
static bool match(const Message *message)
Definition: message.cpp:45
quint64 m_deviceCenterFrequency
Center frequency in device.
virtual bool handleMessage(const Message &message)
int getSampleRate() const
Definition: dspcommands.h:328
virtual const char * getIdentifier() const
Definition: message.cpp:35
MessageQueue m_inputMessageQueue
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleMessage()

bool BladeRF2InputGui::handleMessage ( const Message message)
virtual

Implements PluginInstanceGUI.

Definition at line 182 of file bladerf2inputgui.cpp.

References blockApplySettings(), displaySettings(), BladeRF2Input::getGlobalGainRange(), BladeRF2Input::MsgReportGainRange::getMax(), BladeRF2Input::MsgReportGainRange::getMin(), BladeRF2Input::MsgConfigureBladeRF2::getSettings(), BladeRF2Input::MsgStartStop::getStartStop(), BladeRF2Input::MsgReportGainRange::getStep(), m_sampleSource, m_settings, Message::match(), leansdr::max(), leansdr::min(), and ui.

Referenced by handleInputMessages().

183 {
185  {
187  m_settings = cfg.getSettings();
188  blockApplySettings(true);
189  int min, max, step;
190  m_sampleSource->getGlobalGainRange(min, max, step);
191  ui->gain->setMinimum(min);
192  ui->gain->setMaximum(max);
193  ui->gain->setPageStep(step);
194  ui->gain->setSingleStep(step);
195  displaySettings();
196  blockApplySettings(false);
197 
198  return true;
199  }
201  {
203  ui->gain->setMinimum(cfg.getMin());
204  ui->gain->setMaximum(cfg.getMax());
205  ui->gain->setSingleStep(cfg.getStep());
206  ui->gain->setPageStep(cfg.getStep());
207 
208  return true;
209  }
210  else if (BladeRF2Input::MsgStartStop::match(message))
211  {
213  blockApplySettings(true);
214  ui->startStop->setChecked(notif.getStartStop());
215  blockApplySettings(false);
216 
217  return true;
218  }
219  else
220  {
221  return false;
222  }
223 }
void blockApplySettings(bool block)
Ui::Bladerf2InputGui * ui
void getGlobalGainRange(int &min, int &max, int &step)
BladeRF2InputSettings m_settings
static bool match(const Message *message)
Definition: message.cpp:45
BladeRF2Input * m_sampleSource
const BladeRF2InputSettings & getSettings() const
Definition: bladerf2input.h:46
T max(const T &x, const T &y)
Definition: framework.h:446
T min(const T &x, const T &y)
Definition: framework.h:440
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_bandwidth_changed

void BladeRF2InputGui::on_bandwidth_changed ( quint64  value)
privateslot

Definition at line 388 of file bladerf2inputgui.cpp.

References BladeRF2InputSettings::m_bandwidth, m_settings, and sendSettings().

389 {
390  m_settings.m_bandwidth = value * 1000;
391  sendSettings();
392 }
BladeRF2InputSettings m_settings
+ Here is the call graph for this function:

◆ on_biasTee_toggled

void BladeRF2InputGui::on_biasTee_toggled ( bool  checked)
privateslot

Definition at line 382 of file bladerf2inputgui.cpp.

References BladeRF2InputSettings::m_biasTee, m_settings, and sendSettings().

383 {
384  m_settings.m_biasTee = checked;
385  sendSettings();
386 }
BladeRF2InputSettings m_settings
+ Here is the call graph for this function:

◆ on_centerFrequency_changed

void BladeRF2InputGui::on_centerFrequency_changed ( quint64  value)
privateslot

Definition at line 345 of file bladerf2inputgui.cpp.

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

346 {
347  m_settings.m_centerFrequency = value * 1000;
348  sendSettings();
349 }
BladeRF2InputSettings m_settings
+ Here is the call graph for this function:

◆ on_dcOffset_toggled

void BladeRF2InputGui::on_dcOffset_toggled ( bool  checked)
privateslot

Definition at line 370 of file bladerf2inputgui.cpp.

References BladeRF2InputSettings::m_dcBlock, m_settings, and sendSettings().

371 {
372  m_settings.m_dcBlock = checked;
373  sendSettings();
374 }
BladeRF2InputSettings m_settings
+ Here is the call graph for this function:

◆ on_decim_currentIndexChanged

void BladeRF2InputGui::on_decim_currentIndexChanged ( int  index)
privateslot

Definition at line 394 of file bladerf2inputgui.cpp.

References displaySampleRate(), BladeRF2InputSettings::m_devSampleRate, BladeRF2InputSettings::m_log2Decim, m_sampleRateMode, m_settings, sendSettings(), and ui.

395 {
396  if ((index <0) || (index > 6)) {
397  return;
398  }
399 
400  m_settings.m_log2Decim = index;
402 
403  if (m_sampleRateMode) {
404  m_settings.m_devSampleRate = ui->sampleRate->getValueNew();
405  } else {
406  m_settings.m_devSampleRate = ui->sampleRate->getValueNew() * (1 << m_settings.m_log2Decim);
407  }
408 
409  sendSettings();
410 }
Ui::Bladerf2InputGui * ui
BladeRF2InputSettings m_settings
bool m_sampleRateMode
true: device, false: base band sample rate update mode
+ Here is the call graph for this function:

◆ on_fcPos_currentIndexChanged

void BladeRF2InputGui::on_fcPos_currentIndexChanged ( int  index)
privateslot

Definition at line 412 of file bladerf2inputgui.cpp.

References displayFcTooltip(), BladeRF2InputSettings::m_fcPos, m_settings, and sendSettings().

413 {
414  m_settings.m_fcPos = (BladeRF2InputSettings::fcPos_t) (index < 0 ? 0 : index > 2 ? 2 : index);
416  sendSettings();
417 }
BladeRF2InputSettings m_settings
+ Here is the call graph for this function:

◆ on_gain_valueChanged

void BladeRF2InputGui::on_gain_valueChanged ( int  value)
privateslot

Definition at line 444 of file bladerf2inputgui.cpp.

References arg(), BladeRF2InputSettings::m_globalGain, m_settings, sendSettings(), and ui.

445 {
446  ui->gainText->setText(tr("%1 dB").arg(value));
447  m_settings.m_globalGain = value;
448  sendSettings();
449 }
Ui::Bladerf2InputGui * ui
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
BladeRF2InputSettings m_settings
+ Here is the call graph for this function:

◆ on_gainMode_currentIndexChanged

void BladeRF2InputGui::on_gainMode_currentIndexChanged ( int  index)
privateslot

Definition at line 419 of file bladerf2inputgui.cpp.

References BladeRF2Input::getGainModes(), BladeRF2InputSettings::m_gainMode, BladeRF2InputSettings::m_globalGain, m_sampleSource, m_settings, BladeRF2Input::GainMode::m_value, sendSettings(), and ui.

420 {
421  const std::vector<BladeRF2Input::GainMode>& modes = m_sampleSource->getGainModes();
422  unsigned int uindex = index < 0 ? 0 : (unsigned int) index;
423 
424  if (uindex < modes.size())
425  {
426  BladeRF2Input::GainMode mode = modes[index];
427 
428  if (m_settings.m_gainMode != mode.m_value)
429  {
430  if (mode.m_value == BLADERF_GAIN_MANUAL)
431  {
432  m_settings.m_globalGain = ui->gain->value();
433  ui->gain->setEnabled(true);
434  } else {
435  ui->gain->setEnabled(false);
436  }
437  }
438 
440  sendSettings();
441  }
442 }
Ui::Bladerf2InputGui * ui
const std::vector< GainMode > & getGainModes()
BladeRF2InputSettings m_settings
BladeRF2Input * m_sampleSource
+ Here is the call graph for this function:

◆ on_iqImbalance_toggled

void BladeRF2InputGui::on_iqImbalance_toggled ( bool  checked)
privateslot

Definition at line 376 of file bladerf2inputgui.cpp.

References BladeRF2InputSettings::m_iqCorrection, m_settings, and sendSettings().

377 {
378  m_settings.m_iqCorrection = checked;
379  sendSettings();
380 }
BladeRF2InputSettings m_settings
+ Here is the call graph for this function:

◆ on_LOppm_valueChanged

void BladeRF2InputGui::on_LOppm_valueChanged ( int  value)
privateslot

Definition at line 351 of file bladerf2inputgui.cpp.

References arg(), BladeRF2InputSettings::m_LOppmTenths, m_settings, sendSettings(), and ui.

352 {
353  ui->LOppmText->setText(QString("%1").arg(QString::number(value/10.0, 'f', 1)));
354  m_settings.m_LOppmTenths = value;
355  sendSettings();
356 }
Ui::Bladerf2InputGui * ui
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
BladeRF2InputSettings m_settings
+ Here is the call graph for this function:

◆ on_record_toggled

void BladeRF2InputGui::on_record_toggled ( bool  checked)
privateslot

Definition at line 470 of file bladerf2inputgui.cpp.

References BladeRF2Input::MsgFileRecord::create(), DeviceSampleSource::getInputMessageQueue(), m_sampleSource, MessageQueue::push(), and ui.

471 {
472  if (checked) {
473  ui->record->setStyleSheet("QToolButton { background-color : red; }");
474  } else {
475  ui->record->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
476  }
477 
480 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
Ui::Bladerf2InputGui * ui
MessageQueue * getInputMessageQueue()
static MsgFileRecord * create(bool startStop)
Definition: bladerf2input.h:71
BladeRF2Input * m_sampleSource
+ Here is the call graph for this function:

◆ on_sampleRate_changed

void BladeRF2InputGui::on_sampleRate_changed ( quint64  value)
privateslot

Definition at line 358 of file bladerf2inputgui.cpp.

References displayFcTooltip(), BladeRF2InputSettings::m_devSampleRate, BladeRF2InputSettings::m_log2Decim, m_sampleRateMode, m_settings, and sendSettings().

359 {
360  if (m_sampleRateMode) {
361  m_settings.m_devSampleRate = value;
362  } else {
364  }
365 
367  sendSettings();
368 }
BladeRF2InputSettings m_settings
bool m_sampleRateMode
true: device, false: base band sample rate update mode
+ Here is the call graph for this function:

◆ on_sampleRateMode_toggled

void BladeRF2InputGui::on_sampleRateMode_toggled ( bool  checked)
privateslot

Definition at line 482 of file bladerf2inputgui.cpp.

References displaySampleRate(), and m_sampleRateMode.

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

◆ on_startStop_toggled

void BladeRF2InputGui::on_startStop_toggled ( bool  checked)
privateslot

Definition at line 461 of file bladerf2inputgui.cpp.

References BladeRF2Input::MsgStartStop::create(), DeviceSampleSource::getInputMessageQueue(), m_doApplySettings, m_sampleSource, and MessageQueue::push().

462 {
463  if (m_doApplySettings)
464  {
467  }
468 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
static MsgStartStop * create(bool startStop)
Definition: bladerf2input.h:90
BladeRF2Input * m_sampleSource
+ Here is the call graph for this function:

◆ on_transverter_clicked

void BladeRF2InputGui::on_transverter_clicked ( )
privateslot

Definition at line 451 of file bladerf2inputgui.cpp.

References m_settings, BladeRF2InputSettings::m_transverterDeltaFrequency, BladeRF2InputSettings::m_transverterMode, sendSettings(), setCenterFrequencySetting(), ui, and updateFrequencyLimits().

452 {
453  m_settings.m_transverterMode = ui->transverter->getDeltaFrequencyAcive();
454  m_settings.m_transverterDeltaFrequency = ui->transverter->getDeltaFrequency();
455  qDebug("BladeRF2InputGui::on_transverter_clicked: %lld Hz %s", m_settings.m_transverterDeltaFrequency, m_settings.m_transverterMode ? "on" : "off");
457  setCenterFrequencySetting(ui->centerFrequency->getValueNew());
458  sendSettings();
459 }
Ui::Bladerf2InputGui * ui
void setCenterFrequencySetting(uint64_t kHzValue)
BladeRF2InputSettings m_settings
+ Here is the call graph for this function:

◆ openDeviceSettingsDialog

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

Definition at line 534 of file bladerf2inputgui.cpp.

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

Referenced by BladeRF2InputGui().

535 {
536  BasicDeviceSettingsDialog dialog(this);
537  dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
538  dialog.setReverseAPIAddress(m_settings.m_reverseAPIAddress);
539  dialog.setReverseAPIPort(m_settings.m_reverseAPIPort);
540  dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex);
541 
542  dialog.move(p);
543  dialog.exec();
544 
545  m_settings.m_useReverseAPI = dialog.useReverseAPI();
546  m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress();
547  m_settings.m_reverseAPIPort = dialog.getReverseAPIPort();
548  m_settings.m_reverseAPIDeviceIndex = dialog.getReverseAPIDeviceIndex();
549 
550  sendSettings();
551 }
BladeRF2InputSettings m_settings
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetToDefaults()

void BladeRF2InputGui::resetToDefaults ( )
virtual

Implements PluginInstanceGUI.

Definition at line 119 of file bladerf2inputgui.cpp.

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

Referenced by deserialize().

120 {
122  displaySettings();
123  sendSettings();
124 }
BladeRF2InputSettings m_settings
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendSettings()

void BladeRF2InputGui::sendSettings ( )
private

◆ serialize()

QByteArray BladeRF2InputGui::serialize ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 138 of file bladerf2inputgui.cpp.

References m_settings, and BladeRF2InputSettings::serialize().

139 {
140  return m_settings.serialize();
141 }
QByteArray serialize() const
BladeRF2InputSettings m_settings
+ Here is the call graph for this function:

◆ setCenterFrequency()

void BladeRF2InputGui::setCenterFrequency ( qint64  centerFrequency)
virtual

Implements PluginInstanceGUI.

Definition at line 131 of file bladerf2inputgui.cpp.

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

132 {
133  m_settings.m_centerFrequency = centerFrequency;
134  displaySettings();
135  sendSettings();
136 }
BladeRF2InputSettings m_settings
+ Here is the call graph for this function:

◆ setCenterFrequencySetting()

void BladeRF2InputGui::setCenterFrequencySetting ( uint64_t  kHzValue)
private

Definition at line 174 of file bladerf2inputgui.cpp.

References arg(), BladeRF2InputSettings::m_centerFrequency, m_settings, and ui.

Referenced by on_transverter_clicked().

175 {
176  int64_t centerFrequency = kHzValue*1000;
177 
178  m_settings.m_centerFrequency = centerFrequency < 0 ? 0 : (uint64_t) centerFrequency;
179  ui->centerFrequency->setToolTip(QString("Main center frequency in kHz (LO: %1 kHz)").arg(centerFrequency/1000));
180 }
Ui::Bladerf2InputGui * ui
__int64 int64_t
Definition: rtptypes_win.h:47
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
BladeRF2InputSettings m_settings
unsigned __int64 uint64_t
Definition: rtptypes_win.h:48
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setName()

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

Implements PluginInstanceGUI.

Definition at line 109 of file bladerf2inputgui.cpp.

110 {
111  setObjectName(name);
112 }

◆ updateFrequencyLimits()

void BladeRF2InputGui::updateFrequencyLimits ( )
private

Definition at line 156 of file bladerf2inputgui.cpp.

References BladeRF2Input::getFrequencyRange(), m_sampleSource, m_settings, BladeRF2InputSettings::m_transverterDeltaFrequency, BladeRF2InputSettings::m_transverterMode, and ui.

Referenced by on_transverter_clicked().

157 {
158  // values in kHz
159  uint64_t f_min, f_max;
160  int step;
161  qint64 deltaFrequency = m_settings.m_transverterMode ? m_settings.m_transverterDeltaFrequency/1000 : 0;
162  m_sampleSource->getFrequencyRange(f_min, f_max, step);
163  qint64 minLimit = f_min/1000 + deltaFrequency;
164  qint64 maxLimit = f_max/1000 + deltaFrequency;
165 
166  minLimit = minLimit < 0 ? 0 : minLimit > 9999999 ? 9999999 : minLimit;
167  maxLimit = maxLimit < 0 ? 0 : maxLimit > 9999999 ? 9999999 : maxLimit;
168 
169  qDebug("BladeRF2OutputGui::updateFrequencyLimits: delta: %lld min: %lld max: %lld", deltaFrequency, minLimit, maxLimit);
170 
171  ui->centerFrequency->setValueRange(7, minLimit, maxLimit);
172 }
Ui::Bladerf2InputGui * ui
void getFrequencyRange(uint64_t &min, uint64_t &max, int &step)
BladeRF2InputSettings m_settings
BladeRF2Input * m_sampleSource
unsigned __int64 uint64_t
Definition: rtptypes_win.h:48
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateHardware

void BladeRF2InputGui::updateHardware ( )
privateslot

Definition at line 488 of file bladerf2inputgui.cpp.

References BladeRF2Input::MsgConfigureBladeRF2::create(), DeviceSampleSource::getInputMessageQueue(), m_doApplySettings, m_forceSettings, m_sampleSource, m_settings, m_updateTimer, and MessageQueue::push().

Referenced by BladeRF2InputGui().

489 {
490  if (m_doApplySettings)
491  {
492  qDebug() << "BladeRF2InputGui::updateHardware";
495  m_forceSettings = false;
496  m_updateTimer.stop();
497  }
498 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
BladeRF2InputSettings m_settings
static MsgConfigureBladeRF2 * create(const BladeRF2InputSettings &settings, bool force)
Definition: bladerf2input.h:49
BladeRF2Input * m_sampleSource
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateSampleRateAndFrequency()

void BladeRF2InputGui::updateSampleRateAndFrequency ( )
private

Definition at line 253 of file bladerf2inputgui.cpp.

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

Referenced by handleInputMessages().

254 {
258 }
void setSampleRate(qint32 sampleRate)
Definition: glspectrum.cpp:211
DeviceUISet * m_deviceUISet
GLSpectrum * getSpectrum()
Direct spectrum getter.
Definition: deviceuiset.h:57
quint64 m_deviceCenterFrequency
Center frequency in device.
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 BladeRF2InputGui::updateStatus ( )
privateslot

Definition at line 505 of file bladerf2inputgui.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 BladeRF2InputGui().

506 {
507  int state = m_deviceUISet->m_deviceAPI->state();
508 
509  if(m_lastEngineState != state)
510  {
511  switch(state)
512  {
514  ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
515  break;
516  case DeviceAPI::StIdle:
517  ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
518  break;
520  ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
521  break;
522  case DeviceAPI::StError:
523  ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
524  QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
525  break;
526  default:
527  break;
528  }
529 
530  m_lastEngineState = state;
531  }
532 }
Ui::Bladerf2InputGui * ui
DeviceUISet * m_deviceUISet
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
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 BladeRF2InputGui::m_deviceCenterFrequency
private

Center frequency in device.

Definition at line 67 of file bladerf2inputgui.h.

Referenced by handleInputMessages(), and updateSampleRateAndFrequency().

◆ m_deviceUISet

DeviceUISet* BladeRF2InputGui::m_deviceUISet
private

Definition at line 57 of file bladerf2inputgui.h.

Referenced by BladeRF2InputGui(), updateSampleRateAndFrequency(), and updateStatus().

◆ m_doApplySettings

bool BladeRF2InputGui::m_doApplySettings
private

Definition at line 59 of file bladerf2inputgui.h.

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

◆ m_forceSettings

bool BladeRF2InputGui::m_forceSettings
private

Definition at line 58 of file bladerf2inputgui.h.

Referenced by deserialize(), and updateHardware().

◆ m_gains

std::vector<int> BladeRF2InputGui::m_gains
private

Definition at line 64 of file bladerf2inputgui.h.

◆ m_inputMessageQueue

MessageQueue BladeRF2InputGui::m_inputMessageQueue
private

Definition at line 69 of file bladerf2inputgui.h.

Referenced by BladeRF2InputGui(), and handleInputMessages().

◆ m_lastEngineState

int BladeRF2InputGui::m_lastEngineState
private

Definition at line 68 of file bladerf2inputgui.h.

Referenced by updateStatus().

◆ m_sampleRate

int BladeRF2InputGui::m_sampleRate
private

Definition at line 66 of file bladerf2inputgui.h.

Referenced by handleInputMessages(), and updateSampleRateAndFrequency().

◆ m_sampleRateMode

bool BladeRF2InputGui::m_sampleRateMode
private

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

Definition at line 61 of file bladerf2inputgui.h.

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

◆ m_sampleSource

BladeRF2Input* BladeRF2InputGui::m_sampleSource
private

◆ m_settings

BladeRF2InputSettings BladeRF2InputGui::m_settings
private

◆ m_statusTimer

QTimer BladeRF2InputGui::m_statusTimer
private

Definition at line 63 of file bladerf2inputgui.h.

Referenced by BladeRF2InputGui().

◆ m_updateTimer

QTimer BladeRF2InputGui::m_updateTimer
private

Definition at line 62 of file bladerf2inputgui.h.

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

◆ ui

Ui::Bladerf2InputGui* BladeRF2InputGui::ui
private

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