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

#include <bladerf2outputgui.h>

+ Inheritance diagram for BladeRF2OutputGui:
+ Collaboration diagram for BladeRF2OutputGui:

Public Member Functions

 BladeRF2OutputGui (DeviceUISet *deviceUISet, QWidget *parent=0)
 
virtual ~BladeRF2OutputGui ()
 
virtual void destroy ()
 
void setName (const QString &name)
 
QString getName () const
 
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_biasTee_toggled (bool checked)
 
void on_sampleRate_changed (quint64 value)
 
void on_bandwidth_changed (quint64 value)
 
void on_interp_currentIndexChanged (int index)
 
void on_gain_valueChanged (int value)
 
void on_startStop_toggled (bool checked)
 
void on_transverter_clicked ()
 
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 ()
 
void updateSampleRateAndFrequency ()
 
void updateFrequencyLimits ()
 
void setCenterFrequencySetting (uint64_t kHzValue)
 

Private Attributes

Ui::BladeRF2OutputGui * ui
 
DeviceUISetm_deviceUISet
 
bool m_doApplySettings
 
bool m_forceSettings
 
BladeRF2OutputSettings m_settings
 
bool m_sampleRateMode
 true: device, false: base band sample rate update mode More...
 
QTimer m_updateTimer
 
QTimer m_statusTimer
 
BladeRF2Outputm_sampleSink
 
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 bladerf2outputgui.h.

Constructor & Destructor Documentation

◆ BladeRF2OutputGui()

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

Definition at line 35 of file bladerf2outputgui.cpp.

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

35  :
36  QWidget(parent),
37  ui(new Ui::BladeRF2OutputGui),
38  m_deviceUISet(deviceUISet),
39  m_doApplySettings(true),
40  m_forceSettings(true),
41  m_settings(),
42  m_sampleRateMode(true),
43  m_sampleRate(0),
45 {
47  int max, min, step;
48  uint64_t f_min, f_max;
49 
50  ui->setupUi(this);
51 
52  m_sampleSink->getFrequencyRange(f_min, f_max, step);
53  qDebug("BladeRF2OutputGui::BladeRF2OutputGui: getFrequencyRange: [%lu,%lu] step: %d", 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_sampleSink->getSampleRateRange(min, max, step);
58  qDebug("BladeRF2OutputGui::BladeRF2OutputGui: getSampleRateRange: [%d,%d] step: %d", min, max, step);
59  ui->sampleRate->setColorMapper(ColorMapper(ColorMapper::GrayGreenYellow));
60  ui->sampleRate->setValueRange(8, min, max);
61 
62  m_sampleSink->getBandwidthRange(min, max, step);
63  qDebug("BladeRF2OutputGui::BladeRF2OutputGui: getBandwidthRange: [%d,%d] step: %d", min, max, step);
64  ui->bandwidth->setColorMapper(ColorMapper(ColorMapper::GrayYellow));
65  ui->bandwidth->setValueRange(5, min/1000, max/1000);
66 
67  m_sampleSink->getGlobalGainRange(min, max, step);
68  qDebug("BladeRF2OutputGui::BladeRF2OutputGui: getGlobalGainRange: [%d,%d] step: %d", min, max, step);
69  ui->gain->setMinimum((min-max)/1000);
70  ui->gain->setMaximum(0);
71  ui->gain->setPageStep(1);
72  ui->gain->setSingleStep(1);
73 
74  connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware()));
75  connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus()));
76  m_statusTimer.start(500);
77 
78  CRightClickEnabler *startStopRightClickEnabler = new CRightClickEnabler(ui->startStop);
79  connect(startStopRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(openDeviceSettingsDialog(const QPoint &)));
80 
82 
83  connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection);
85 }
Ui::BladeRF2OutputGui * ui
DeviceUISet * m_deviceUISet
BladeRF2Output * m_sampleSink
DeviceSampleSink * getSampleSink()
Return pointer to the device sample sink (single Tx) or nullptr.
Definition: deviceapi.cpp:222
void getBandwidthRange(int &min, int &max, int &step)
engine is before initialization
Definition: deviceapi.h:53
void openDeviceSettingsDialog(const QPoint &p)
DeviceAPI * m_deviceAPI
Definition: deviceuiset.h:48
BladeRF2OutputSettings m_settings
bool m_sampleRateMode
true: device, false: base band sample rate update mode
virtual void setMessageQueueToGUI(MessageQueue *queue)
MessageQueue m_inputMessageQueue
void getGlobalGainRange(int &min, int &max, int &step)
void getFrequencyRange(uint64_t &min, uint64_t &max, int &step)
void getSampleRateRange(int &min, int &max, int &step)
T max(const T &x, const T &y)
Definition: framework.h:446
T min(const T &x, const T &y)
Definition: framework.h:440
unsigned __int64 uint64_t
Definition: rtptypes_win.h:48
+ Here is the call graph for this function:

◆ ~BladeRF2OutputGui()

BladeRF2OutputGui::~BladeRF2OutputGui ( )
virtual

Definition at line 87 of file bladerf2outputgui.cpp.

References ui.

88 {
89  delete ui;
90 }
Ui::BladeRF2OutputGui * ui

Member Function Documentation

◆ blockApplySettings()

void BladeRF2OutputGui::blockApplySettings ( bool  block)
inlineprivate

Definition at line 71 of file bladerf2outputgui.h.

Referenced by displaySettings(), and handleMessage().

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

◆ deserialize()

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

Implements PluginInstanceGUI.

Definition at line 131 of file bladerf2outputgui.cpp.

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

132 {
133  if(m_settings.deserialize(data)) {
134  displaySettings();
135  m_forceSettings = true;
136  sendSettings();
137  return true;
138  } else {
139  resetToDefaults();
140  return false;
141  }
142 }
BladeRF2OutputSettings m_settings
bool deserialize(const QByteArray &data)
+ Here is the call graph for this function:

◆ destroy()

void BladeRF2OutputGui::destroy ( )
virtual

Implements PluginInstanceGUI.

Definition at line 92 of file bladerf2outputgui.cpp.

93 {
94  delete this;
95 }

◆ displaySampleRate()

void BladeRF2OutputGui::displaySampleRate ( )
private

Definition at line 248 of file bladerf2outputgui.cpp.

References arg(), BladeRF2Output::getSampleRateRange(), BladeRF2OutputSettings::m_devSampleRate, BladeRF2OutputSettings::m_log2Interp, m_sampleRateMode, m_sampleSink, m_settings, leansdr::max(), leansdr::min(), and ui.

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

249 {
250  int max, min, step;
251  m_sampleSink->getSampleRateRange(min, max, step);
252 
253  ui->sampleRate->blockSignals(true);
254 
255  if (m_sampleRateMode)
256  {
257  ui->sampleRateMode->setStyleSheet("QToolButton { background:rgb(60,60,60); }");
258  ui->sampleRateMode->setText("SR");
259  ui->sampleRate->setValueRange(8, min, max);
260  ui->sampleRate->setValue(m_settings.m_devSampleRate);
261  ui->sampleRate->setToolTip("Host to device sample rate (S/s)");
262  ui->deviceRateText->setToolTip("Baseband sample rate (S/s)");
263  uint32_t basebandSampleRate = m_settings.m_devSampleRate/(1<<m_settings.m_log2Interp);
264  ui->deviceRateText->setText(tr("%1k").arg(QString::number(basebandSampleRate / 1000.0f, 'g', 5)));
265  }
266  else
267  {
268  ui->sampleRateMode->setStyleSheet("QToolButton { background:rgb(50,50,50); }");
269  ui->sampleRateMode->setText("BB");
270  ui->sampleRate->setValueRange(8, min/(1<<m_settings.m_log2Interp), max/(1<<m_settings.m_log2Interp));
271  ui->sampleRate->setValue(m_settings.m_devSampleRate/(1<<m_settings.m_log2Interp));
272  ui->sampleRate->setToolTip("Baseband sample rate (S/s)");
273  ui->deviceRateText->setToolTip("Host to device sample rate (S/s)");
274  ui->deviceRateText->setText(tr("%1k").arg(QString::number(m_settings.m_devSampleRate / 1000.0f, 'g', 5)));
275  }
276 
277  ui->sampleRate->blockSignals(false);
278 }
Ui::BladeRF2OutputGui * ui
BladeRF2Output * m_sampleSink
unsigned int uint32_t
Definition: rtptypes_win.h:46
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
BladeRF2OutputSettings m_settings
bool m_sampleRateMode
true: device, false: base band sample rate update mode
void getSampleRateRange(int &min, int &max, int &step)
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:

◆ displaySettings()

void BladeRF2OutputGui::displaySettings ( )
private

Definition at line 280 of file bladerf2outputgui.cpp.

References arg(), blockApplySettings(), displaySampleRate(), BladeRF2OutputSettings::m_bandwidth, BladeRF2OutputSettings::m_biasTee, BladeRF2OutputSettings::m_centerFrequency, BladeRF2OutputSettings::m_globalGain, BladeRF2OutputSettings::m_log2Interp, BladeRF2OutputSettings::m_LOppmTenths, m_settings, BladeRF2OutputSettings::m_transverterDeltaFrequency, BladeRF2OutputSettings::m_transverterMode, and ui.

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

281 {
282  blockApplySettings(true);
283 
284  ui->transverter->setDeltaFrequency(m_settings.m_transverterDeltaFrequency);
285  ui->transverter->setDeltaFrequencyActive(m_settings.m_transverterMode);
286 
287  ui->centerFrequency->setValue(m_settings.m_centerFrequency / 1000);
288  ui->LOppm->setValue(m_settings.m_LOppmTenths);
289  ui->LOppmText->setText(QString("%1").arg(QString::number(m_settings.m_LOppmTenths/10.0, 'f', 1)));
291  ui->bandwidth->setValue(m_settings.m_bandwidth / 1000);
292 
293  ui->interp->setCurrentIndex(m_settings.m_log2Interp);
294 
295  ui->gainText->setText(tr("%1 dB").arg(m_settings.m_globalGain));
296  ui->gain->setValue(m_settings.m_globalGain);
297  ui->biasTee->setChecked(m_settings.m_biasTee);
298 
299  blockApplySettings(false);
300 }
Ui::BladeRF2OutputGui * ui
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
BladeRF2OutputSettings m_settings
void blockApplySettings(bool block)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCenterFrequency()

qint64 BladeRF2OutputGui::getCenterFrequency ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 114 of file bladerf2outputgui.cpp.

References BladeRF2OutputSettings::m_centerFrequency, and m_settings.

115 {
117 }
BladeRF2OutputSettings m_settings

◆ getInputMessageQueue()

virtual MessageQueue* BladeRF2OutputGui::getInputMessageQueue ( )
inlinevirtual

Implements PluginInstanceGUI.

Definition at line 52 of file bladerf2outputgui.h.

52 { return &m_inputMessageQueue; }
MessageQueue m_inputMessageQueue

◆ getName()

QString BladeRF2OutputGui::getName ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 102 of file bladerf2outputgui.cpp.

103 {
104  return objectName();
105 }

◆ handleInputMessages

void BladeRF2OutputGui::handleInputMessages ( )
privateslot

Definition at line 213 of file bladerf2outputgui.cpp.

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

Referenced by BladeRF2OutputGui().

214 {
215  Message* message;
216 
217  while ((message = m_inputMessageQueue.pop()) != 0)
218  {
219  qDebug("BladeRF2OutputGui::handleInputMessages: message: %s", message->getIdentifier());
220 
221  if (DSPSignalNotification::match(*message))
222  {
223  DSPSignalNotification* notif = (DSPSignalNotification*) message;
224  m_sampleRate = notif->getSampleRate();
226  qDebug("BladeRF2OutputGui::handleInputMessages: DSPSignalNotification: SampleRate:%d, CenterFrequency:%llu", notif->getSampleRate(), notif->getCenterFrequency());
228 
229  delete message;
230  }
231  else
232  {
233  if (handleMessage(*message))
234  {
235  delete message;
236  }
237  }
238  }
239 }
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
virtual bool handleMessage(const Message &message)
MessageQueue m_inputMessageQueue
int getSampleRate() const
Definition: dspcommands.h:328
virtual const char * getIdentifier() const
Definition: message.cpp:35
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleMessage()

bool BladeRF2OutputGui::handleMessage ( const Message message)
virtual

Implements PluginInstanceGUI.

Definition at line 170 of file bladerf2outputgui.cpp.

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

Referenced by handleInputMessages().

171 {
173  {
175  m_settings = cfg.getSettings();
176  blockApplySettings(true);
177  int min, max, step;
178  m_sampleSink->getGlobalGainRange(min, max, step);
179  ui->gain->setMinimum((min-max)/1000);
180  ui->gain->setMaximum(0);
181  ui->gain->setPageStep(1);
182  ui->gain->setSingleStep(1);
183  displaySettings();
184  blockApplySettings(false);
185 
186  return true;
187  }
189  {
191  ui->gain->setMinimum((cfg.getMin()-cfg.getMax())/1000);
192  ui->gain->setMaximum(0);
193  ui->gain->setSingleStep(1);
194  ui->gain->setPageStep(1);
195 
196  return true;
197  }
198  else if (BladeRF2Output::MsgStartStop::match(message))
199  {
201  blockApplySettings(true);
202  ui->startStop->setChecked(notif.getStartStop());
203  blockApplySettings(false);
204 
205  return true;
206  }
207  else
208  {
209  return false;
210  }
211 }
const BladeRF2OutputSettings & getSettings() const
Ui::BladeRF2OutputGui * ui
BladeRF2Output * m_sampleSink
static bool match(const Message *message)
Definition: message.cpp:45
BladeRF2OutputSettings m_settings
void blockApplySettings(bool block)
void getGlobalGainRange(int &min, int &max, int &step)
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 BladeRF2OutputGui::on_bandwidth_changed ( quint64  value)
privateslot

Definition at line 338 of file bladerf2outputgui.cpp.

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

339 {
340  m_settings.m_bandwidth = value * 1000;
341  sendSettings();
342 }
BladeRF2OutputSettings m_settings
+ Here is the call graph for this function:

◆ on_biasTee_toggled

void BladeRF2OutputGui::on_biasTee_toggled ( bool  checked)
privateslot

Definition at line 332 of file bladerf2outputgui.cpp.

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

333 {
334  m_settings.m_biasTee = checked;
335  sendSettings();
336 }
BladeRF2OutputSettings m_settings
+ Here is the call graph for this function:

◆ on_centerFrequency_changed

void BladeRF2OutputGui::on_centerFrequency_changed ( quint64  value)
privateslot

Definition at line 308 of file bladerf2outputgui.cpp.

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

309 {
310  m_settings.m_centerFrequency = value * 1000;
311  sendSettings();
312 }
BladeRF2OutputSettings m_settings
+ Here is the call graph for this function:

◆ on_gain_valueChanged

void BladeRF2OutputGui::on_gain_valueChanged ( int  value)
privateslot

Definition at line 362 of file bladerf2outputgui.cpp.

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

363 {
364  ui->gainText->setText(tr("%1 dB").arg(value));
365  m_settings.m_globalGain = value;
366  sendSettings();
367 }
Ui::BladeRF2OutputGui * ui
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
BladeRF2OutputSettings m_settings
+ Here is the call graph for this function:

◆ on_interp_currentIndexChanged

void BladeRF2OutputGui::on_interp_currentIndexChanged ( int  index)
privateslot

Definition at line 344 of file bladerf2outputgui.cpp.

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

345 {
346  if ((index <0) || (index > 6)) {
347  return;
348  }
349 
350  m_settings.m_log2Interp = index;
352 
353  if (m_sampleRateMode) {
354  m_settings.m_devSampleRate = ui->sampleRate->getValueNew();
355  } else {
356  m_settings.m_devSampleRate = ui->sampleRate->getValueNew() * (1 << m_settings.m_log2Interp);
357  }
358 
359  sendSettings();
360 }
Ui::BladeRF2OutputGui * ui
BladeRF2OutputSettings m_settings
bool m_sampleRateMode
true: device, false: base band sample rate update mode
+ Here is the call graph for this function:

◆ on_LOppm_valueChanged

void BladeRF2OutputGui::on_LOppm_valueChanged ( int  value)
privateslot

Definition at line 314 of file bladerf2outputgui.cpp.

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

315 {
316  ui->LOppmText->setText(QString("%1").arg(QString::number(value/10.0, 'f', 1)));
317  m_settings.m_LOppmTenths = value;
318  sendSettings();
319 }
Ui::BladeRF2OutputGui * ui
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
BladeRF2OutputSettings m_settings
+ Here is the call graph for this function:

◆ on_sampleRate_changed

void BladeRF2OutputGui::on_sampleRate_changed ( quint64  value)
privateslot

Definition at line 321 of file bladerf2outputgui.cpp.

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

322 {
323  if (m_sampleRateMode) {
324  m_settings.m_devSampleRate = value;
325  } else {
327  }
328 
329  sendSettings();
330 }
BladeRF2OutputSettings 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 BladeRF2OutputGui::on_sampleRateMode_toggled ( bool  checked)
privateslot

Definition at line 388 of file bladerf2outputgui.cpp.

References displaySampleRate(), and m_sampleRateMode.

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

◆ on_startStop_toggled

void BladeRF2OutputGui::on_startStop_toggled ( bool  checked)
privateslot

Definition at line 379 of file bladerf2outputgui.cpp.

References BladeRF2Output::MsgStartStop::create(), DeviceSampleSink::getInputMessageQueue(), m_doApplySettings, m_sampleSink, and MessageQueue::push().

380 {
381  if (m_doApplySettings)
382  {
385  }
386 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
BladeRF2Output * m_sampleSink
MessageQueue * getInputMessageQueue()
static MsgStartStop * create(bool startStop)
+ Here is the call graph for this function:

◆ on_transverter_clicked

void BladeRF2OutputGui::on_transverter_clicked ( )
privateslot

Definition at line 369 of file bladerf2outputgui.cpp.

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

370 {
371  m_settings.m_transverterMode = ui->transverter->getDeltaFrequencyAcive();
372  m_settings.m_transverterDeltaFrequency = ui->transverter->getDeltaFrequency();
373  qDebug("LimeSDRInputGUI::on_transverter_clicked: %lld Hz %s", m_settings.m_transverterDeltaFrequency, m_settings.m_transverterMode ? "on" : "off");
375  setCenterFrequencySetting(ui->centerFrequency->getValueNew());
376  sendSettings();
377 }
Ui::BladeRF2OutputGui * ui
void setCenterFrequencySetting(uint64_t kHzValue)
BladeRF2OutputSettings m_settings
+ Here is the call graph for this function:

◆ openDeviceSettingsDialog

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

Definition at line 435 of file bladerf2outputgui.cpp.

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

Referenced by BladeRF2OutputGui().

436 {
437  BasicDeviceSettingsDialog dialog(this);
438  dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
439  dialog.setReverseAPIAddress(m_settings.m_reverseAPIAddress);
440  dialog.setReverseAPIPort(m_settings.m_reverseAPIPort);
441  dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex);
442 
443  dialog.move(p);
444  dialog.exec();
445 
446  m_settings.m_useReverseAPI = dialog.useReverseAPI();
447  m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress();
448  m_settings.m_reverseAPIPort = dialog.getReverseAPIPort();
449  m_settings.m_reverseAPIDeviceIndex = dialog.getReverseAPIDeviceIndex();
450 
451  sendSettings();
452 }
BladeRF2OutputSettings m_settings
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetToDefaults()

void BladeRF2OutputGui::resetToDefaults ( )
virtual

Implements PluginInstanceGUI.

Definition at line 107 of file bladerf2outputgui.cpp.

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

Referenced by deserialize().

108 {
110  displaySettings();
111  sendSettings();
112 }
BladeRF2OutputSettings m_settings
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendSettings()

void BladeRF2OutputGui::sendSettings ( )
private

◆ serialize()

QByteArray BladeRF2OutputGui::serialize ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 126 of file bladerf2outputgui.cpp.

References m_settings, and BladeRF2OutputSettings::serialize().

127 {
128  return m_settings.serialize();
129 }
BladeRF2OutputSettings m_settings
+ Here is the call graph for this function:

◆ setCenterFrequency()

void BladeRF2OutputGui::setCenterFrequency ( qint64  centerFrequency)
virtual

Implements PluginInstanceGUI.

Definition at line 119 of file bladerf2outputgui.cpp.

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

120 {
121  m_settings.m_centerFrequency = centerFrequency;
122  displaySettings();
123  sendSettings();
124 }
BladeRF2OutputSettings m_settings
+ Here is the call graph for this function:

◆ setCenterFrequencySetting()

void BladeRF2OutputGui::setCenterFrequencySetting ( uint64_t  kHzValue)
private

Definition at line 162 of file bladerf2outputgui.cpp.

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

Referenced by on_transverter_clicked().

163 {
164  int64_t centerFrequency = kHzValue*1000;
165 
166  m_settings.m_centerFrequency = centerFrequency < 0 ? 0 : (uint64_t) centerFrequency;
167  ui->centerFrequency->setToolTip(QString("Main center frequency in kHz (LO: %1 kHz)").arg(centerFrequency/1000));
168 }
Ui::BladeRF2OutputGui * ui
__int64 int64_t
Definition: rtptypes_win.h:47
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
BladeRF2OutputSettings 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 BladeRF2OutputGui::setName ( const QString &  name)
virtual

Implements PluginInstanceGUI.

Definition at line 97 of file bladerf2outputgui.cpp.

98 {
99  setObjectName(name);
100 }

◆ updateFrequencyLimits()

void BladeRF2OutputGui::updateFrequencyLimits ( )
private

Definition at line 144 of file bladerf2outputgui.cpp.

References BladeRF2Output::getFrequencyRange(), m_sampleSink, m_settings, BladeRF2OutputSettings::m_transverterDeltaFrequency, BladeRF2OutputSettings::m_transverterMode, and ui.

Referenced by on_transverter_clicked().

145 {
146  // values in kHz
147  uint64_t f_min, f_max;
148  int step;
149  qint64 deltaFrequency = m_settings.m_transverterMode ? m_settings.m_transverterDeltaFrequency/1000 : 0;
150  m_sampleSink->getFrequencyRange(f_min, f_max, step);
151  qint64 minLimit = f_min/1000 + deltaFrequency;
152  qint64 maxLimit = f_max/1000 + deltaFrequency;
153 
154  minLimit = minLimit < 0 ? 0 : minLimit > 9999999 ? 9999999 : minLimit;
155  maxLimit = maxLimit < 0 ? 0 : maxLimit > 9999999 ? 9999999 : maxLimit;
156 
157  qDebug("BladeRF2OutputGui::updateFrequencyLimits: delta: %lld min: %lld max: %lld", deltaFrequency, minLimit, maxLimit);
158 
159  ui->centerFrequency->setValueRange(7, minLimit, maxLimit);
160 }
Ui::BladeRF2OutputGui * ui
BladeRF2Output * m_sampleSink
BladeRF2OutputSettings m_settings
void getFrequencyRange(uint64_t &min, uint64_t &max, int &step)
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 BladeRF2OutputGui::updateHardware ( )
privateslot

Definition at line 394 of file bladerf2outputgui.cpp.

References BladeRF2Output::MsgConfigureBladeRF2::create(), DeviceSampleSink::getInputMessageQueue(), m_doApplySettings, m_forceSettings, m_sampleSink, m_settings, m_updateTimer, and MessageQueue::push().

Referenced by BladeRF2OutputGui().

395 {
396  if (m_doApplySettings)
397  {
398  qDebug() << "BladeRF2OutputGui::updateHardware";
401  m_forceSettings = false;
402  m_updateTimer.stop();
403  }
404 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
BladeRF2Output * m_sampleSink
MessageQueue * getInputMessageQueue()
BladeRF2OutputSettings m_settings
static MsgConfigureBladeRF2 * create(const BladeRF2OutputSettings &settings, bool force)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateSampleRateAndFrequency()

void BladeRF2OutputGui::updateSampleRateAndFrequency ( )
private

Definition at line 241 of file bladerf2outputgui.cpp.

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

Referenced by handleInputMessages().

242 {
246 }
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 BladeRF2OutputGui::updateStatus ( )
privateslot

Definition at line 406 of file bladerf2outputgui.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 BladeRF2OutputGui().

407 {
408  int state = m_deviceUISet->m_deviceAPI->state();
409 
410  if(m_lastEngineState != state)
411  {
412  switch(state)
413  {
415  ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
416  break;
417  case DeviceAPI::StIdle:
418  ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
419  break;
421  ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
422  break;
423  case DeviceAPI::StError:
424  ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
425  QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
426  break;
427  default:
428  break;
429  }
430 
431  m_lastEngineState = state;
432  }
433 }
Ui::BladeRF2OutputGui * 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 BladeRF2OutputGui::m_deviceCenterFrequency
private

Center frequency in device.

Definition at line 67 of file bladerf2outputgui.h.

Referenced by handleInputMessages(), and updateSampleRateAndFrequency().

◆ m_deviceUISet

DeviceUISet* BladeRF2OutputGui::m_deviceUISet
private

◆ m_doApplySettings

bool BladeRF2OutputGui::m_doApplySettings
private

Definition at line 59 of file bladerf2outputgui.h.

Referenced by on_startStop_toggled(), and updateHardware().

◆ m_forceSettings

bool BladeRF2OutputGui::m_forceSettings
private

Definition at line 60 of file bladerf2outputgui.h.

Referenced by deserialize(), and updateHardware().

◆ m_inputMessageQueue

MessageQueue BladeRF2OutputGui::m_inputMessageQueue
private

Definition at line 69 of file bladerf2outputgui.h.

Referenced by BladeRF2OutputGui(), and handleInputMessages().

◆ m_lastEngineState

int BladeRF2OutputGui::m_lastEngineState
private

Definition at line 68 of file bladerf2outputgui.h.

Referenced by updateStatus().

◆ m_sampleRate

int BladeRF2OutputGui::m_sampleRate
private

Definition at line 66 of file bladerf2outputgui.h.

Referenced by handleInputMessages(), and updateSampleRateAndFrequency().

◆ m_sampleRateMode

bool BladeRF2OutputGui::m_sampleRateMode
private

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

Definition at line 62 of file bladerf2outputgui.h.

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

◆ m_sampleSink

BladeRF2Output* BladeRF2OutputGui::m_sampleSink
private

◆ m_settings

BladeRF2OutputSettings BladeRF2OutputGui::m_settings
private

◆ m_statusTimer

QTimer BladeRF2OutputGui::m_statusTimer
private

Definition at line 64 of file bladerf2outputgui.h.

Referenced by BladeRF2OutputGui().

◆ m_updateTimer

QTimer BladeRF2OutputGui::m_updateTimer
private

Definition at line 63 of file bladerf2outputgui.h.

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

◆ ui

Ui::BladeRF2OutputGui* BladeRF2OutputGui::ui
private

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