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

#include <hackrfoutputgui.h>

+ Inheritance diagram for HackRFOutputGui:
+ Collaboration diagram for HackRFOutputGui:

Public Types

enum  HackRFImgRejValue { HACKRF_IMGREJ_BYPASS = 0, HACKRF_IMGREJ_LOWPASS, HACKRF_IMGREJ_HIGHPASS, HACKRF_IMGREJ_NB }
 

Public Member Functions

 HackRFOutputGui (DeviceUISet *deviceUISet, QWidget *parent=0)
 
virtual ~HackRFOutputGui ()
 
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_LOppm_valueChanged (int value)
 
void on_biasT_stateChanged (int state)
 
void on_interp_currentIndexChanged (int index)
 
void on_fcPos_currentIndexChanged (int index)
 
void on_lnaExt_stateChanged (int state)
 
void on_bbFilter_currentIndexChanged (int index)
 
void on_txvga_valueChanged (int value)
 
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 displaySettings ()
 
void displaySampleRate ()
 
void displayFcTooltip ()
 
void displayBandwidths ()
 
void sendSettings ()
 
void updateSampleRateAndFrequency ()
 
void blockApplySettings (bool block)
 

Private Attributes

Ui::HackRFOutputGui * ui
 
DeviceUISetm_deviceUISet
 
bool m_forceSettings
 
HackRFOutputSettings 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
 
bool m_doApplySettings
 

Detailed Description

Definition at line 38 of file hackrfoutputgui.h.

Member Enumeration Documentation

◆ HackRFImgRejValue

Constructor & Destructor Documentation

◆ HackRFOutputGui()

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

Definition at line 37 of file hackrfoutputgui.cpp.

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

37  :
38  QWidget(parent),
39  ui(new Ui::HackRFOutputGui),
40  m_deviceUISet(deviceUISet),
41  m_forceSettings(true),
42  m_settings(),
43  m_sampleRateMode(true),
46  m_doApplySettings(true)
47 {
49 
50  ui->setupUi(this);
51  ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
52  ui->centerFrequency->setValueRange(7, 0U, 7250000U);
53 
54  ui->sampleRate->setColorMapper(ColorMapper(ColorMapper::GrayGreenYellow));
55  ui->sampleRate->setValueRange(8, 1000000U, 20000000U);
56 
57  connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware()));
58  connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus()));
59  m_statusTimer.start(500);
60 
61  CRightClickEnabler *startStopRightClickEnabler = new CRightClickEnabler(ui->startStop);
62  connect(startStopRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(openDeviceSettingsDialog(const QPoint &)));
63 
66  sendSettings();
67 
68  connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection);
69 }
HackRFOutputSettings m_settings
bool m_sampleRateMode
true: device, false: base band sample rate update mode
DeviceSampleSink * getSampleSink()
Return pointer to the device sample sink (single Tx) or nullptr.
Definition: deviceapi.cpp:222
DeviceSampleSink * m_deviceSampleSink
engine is before initialization
Definition: deviceapi.h:53
DeviceAPI * m_deviceAPI
Definition: deviceuiset.h:48
void openDeviceSettingsDialog(const QPoint &p)
MessageQueue m_inputMessageQueue
DeviceUISet * m_deviceUISet
Ui::HackRFOutputGui * ui
+ Here is the call graph for this function:

◆ ~HackRFOutputGui()

HackRFOutputGui::~HackRFOutputGui ( )
virtual

Definition at line 71 of file hackrfoutputgui.cpp.

References ui.

72 {
73  delete ui;
74 }
Ui::HackRFOutputGui * ui

Member Function Documentation

◆ blockApplySettings()

void HackRFOutputGui::blockApplySettings ( bool  block)
private

Definition at line 131 of file hackrfoutputgui.cpp.

References m_doApplySettings.

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

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

◆ deserialize()

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

Implements PluginInstanceGUI.

Definition at line 115 of file hackrfoutputgui.cpp.

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

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

◆ destroy()

void HackRFOutputGui::destroy ( )
virtual

Implements PluginInstanceGUI.

Definition at line 76 of file hackrfoutputgui.cpp.

77 {
78  delete this;
79 }

◆ displayBandwidths()

void HackRFOutputGui::displayBandwidths ( )
private

Definition at line 265 of file hackrfoutputgui.cpp.

References arg(), blockApplySettings(), HackRFBandwidths::getBandwidthIndex(), i, HackRFOutputSettings::m_bandwidth, HackRFBandwidths::m_bw_k, HackRFBandwidths::m_nb_bw, m_settings, and ui.

Referenced by HackRFOutputGui().

266 {
267  blockApplySettings(true);
268  unsigned int savedIndex = HackRFBandwidths::getBandwidthIndex(m_settings.m_bandwidth/1000);
269  ui->bbFilter->blockSignals(true);
270  ui->bbFilter->clear();
271 
272  for (unsigned int i = 0; i < HackRFBandwidths::m_nb_bw; i++)
273  {
274  ui->bbFilter->addItem(QString("%1M").arg(QString::number(HackRFBandwidths::m_bw_k[i]/1000.0, 'f', 2)));
275  }
276 
277  ui->bbFilter->blockSignals(false);
278 
279  if (savedIndex < HackRFBandwidths::m_nb_bw)
280  {
281  ui->bbFilter->setCurrentIndex(savedIndex);
282  }
283  else
284  {
285  ui->bbFilter->setCurrentIndex((int) HackRFBandwidths::m_nb_bw-1);
286  }
287  blockApplySettings(false);
288 }
static const unsigned int m_nb_bw
static const unsigned int m_bw_k[]
void blockApplySettings(bool block)
HackRFOutputSettings m_settings
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
int32_t i
Definition: decimators.h:244
static unsigned int getBandwidthIndex(unsigned int bandwidth)
Ui::HackRFOutputGui * ui
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ displayFcTooltip()

void HackRFOutputGui::displayFcTooltip ( )
private

Definition at line 232 of file hackrfoutputgui.cpp.

References arg(), DeviceSampleSink::calculateFrequencyShift(), HackRFOutputSettings::m_devSampleRate, HackRFOutputSettings::m_fcPos, HackRFOutputSettings::m_log2Interp, m_settings, and ui.

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

233 {
238  ui->fcPos->setToolTip(tr("Relative position of device center frequency: %1 kHz").arg(QString::number(fShift / 1000.0f, 'g', 5)));
239 }
HackRFOutputSettings m_settings
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
int int32_t
Definition: rtptypes_win.h:45
Ui::HackRFOutputGui * ui
static qint32 calculateFrequencyShift(int log2Interp, fcPos_t fcPos, quint32 devSampleRate)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ displaySampleRate()

void HackRFOutputGui::displaySampleRate ( )
private

Definition at line 202 of file hackrfoutputgui.cpp.

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

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

203 {
204  ui->sampleRate->blockSignals(true);
206 
207  if (m_sampleRateMode)
208  {
209  ui->sampleRateMode->setStyleSheet("QToolButton { background:rgb(60,60,60); }");
210  ui->sampleRateMode->setText("SR");
211  ui->sampleRate->setValueRange(8, 1000000U, 20000000U);
212  ui->sampleRate->setValue(m_settings.m_devSampleRate);
213  ui->sampleRate->setToolTip("Host to device sample rate (S/s)");
214  ui->deviceRateText->setToolTip("Baseband sample rate (S/s)");
215  uint32_t basebandSampleRate = m_settings.m_devSampleRate/(1<<m_settings.m_log2Interp);
216  ui->deviceRateText->setText(tr("%1k").arg(QString::number(basebandSampleRate / 1000.0f, 'g', 5)));
217  }
218  else
219  {
220  ui->sampleRateMode->setStyleSheet("QToolButton { background:rgb(50,50,50); }");
221  ui->sampleRateMode->setText("BB");
222  ui->sampleRate->setValueRange(8, 1000000U/(1<<m_settings.m_log2Interp), 20000000U/(1<<m_settings.m_log2Interp));
223  ui->sampleRate->setValue(m_settings.m_devSampleRate/(1<<m_settings.m_log2Interp));
224  ui->sampleRate->setToolTip("Baseband sample rate (S/s)");
225  ui->deviceRateText->setToolTip("Host to device sample rate (S/s)");
226  ui->deviceRateText->setText(tr("%1k").arg(QString::number(m_settings.m_devSampleRate / 1000.0f, 'g', 5)));
227  }
228 
229  ui->sampleRate->blockSignals(false);
230 }
HackRFOutputSettings m_settings
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
Ui::HackRFOutputGui * ui
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ displaySettings()

void HackRFOutputGui::displaySettings ( )
private

Definition at line 241 of file hackrfoutputgui.cpp.

References arg(), blockApplySettings(), displaySampleRate(), HackRFBandwidths::getBandwidthIndex(), HackRFOutputSettings::m_bandwidth, HackRFOutputSettings::m_biasT, HackRFOutputSettings::m_centerFrequency, HackRFOutputSettings::m_fcPos, HackRFOutputSettings::m_lnaExt, HackRFOutputSettings::m_log2Interp, HackRFOutputSettings::m_LOppmTenths, m_settings, HackRFOutputSettings::m_vgaGain, and ui.

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

242 {
243  blockApplySettings(true);
244  ui->centerFrequency->setValue(m_settings.m_centerFrequency / 1000);
245 
246  ui->LOppm->setValue(m_settings.m_LOppmTenths);
247  ui->LOppmText->setText(QString("%1").arg(QString::number(m_settings.m_LOppmTenths/10.0, 'f', 1)));
248 
249  ui->biasT->setChecked(m_settings.m_biasT);
250 
252 
253  ui->interp->setCurrentIndex(m_settings.m_log2Interp);
254  ui->fcPos->setCurrentIndex((int) m_settings.m_fcPos);
255 
256  ui->lnaExt->setChecked(m_settings.m_lnaExt);
257  ui->txvgaGainText->setText(tr("%1dB").arg(m_settings.m_vgaGain));
258  ui->txvga->setValue(m_settings.m_vgaGain);
259 
260  unsigned int bandwidthIndex = HackRFBandwidths::getBandwidthIndex(m_settings.m_bandwidth/1000);
261  ui->bbFilter->setCurrentIndex(bandwidthIndex);
262  blockApplySettings(false);
263 }
void blockApplySettings(bool block)
HackRFOutputSettings m_settings
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
static unsigned int getBandwidthIndex(unsigned int bandwidth)
Ui::HackRFOutputGui * ui
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCenterFrequency()

qint64 HackRFOutputGui::getCenterFrequency ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 98 of file hackrfoutputgui.cpp.

References HackRFOutputSettings::m_centerFrequency, and m_settings.

99 {
101 }
HackRFOutputSettings m_settings

◆ getInputMessageQueue()

virtual MessageQueue* HackRFOutputGui::getInputMessageQueue ( )
inlinevirtual

Implements PluginInstanceGUI.

Definition at line 62 of file hackrfoutputgui.h.

62 { return &m_inputMessageQueue; }
MessageQueue m_inputMessageQueue

◆ getName()

QString HackRFOutputGui::getName ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 86 of file hackrfoutputgui.cpp.

87 {
88  return objectName();
89 }

◆ handleInputMessages

void HackRFOutputGui::handleInputMessages ( )
privateslot

Definition at line 167 of file hackrfoutputgui.cpp.

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

Referenced by HackRFOutputGui().

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

◆ handleMessage()

bool HackRFOutputGui::handleMessage ( const Message message)
virtual

Implements PluginInstanceGUI.

Definition at line 137 of file hackrfoutputgui.cpp.

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

Referenced by handleInputMessages().

138 {
140  {
142  m_settings = cfg.getSettings();
143  blockApplySettings(true);
144  displaySettings();
145  blockApplySettings(false);
146  return true;
147  }
148  else if (HackRFOutput::MsgReportHackRF::match(message))
149  {
150  displaySettings();
151  return true;
152  }
153  else if (HackRFOutput::MsgStartStop::match(message))
154  {
156  blockApplySettings(true);
157  ui->startStop->setChecked(notif.getStartStop());
158  blockApplySettings(false);
159  return true;
160  }
161  else
162  {
163  return false;
164  }
165 }
void blockApplySettings(bool block)
HackRFOutputSettings m_settings
static bool match(const Message *message)
Definition: message.cpp:45
Ui::HackRFOutputGui * ui
const HackRFOutputSettings & getSettings() const
Definition: hackrfoutput.h:43
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_bbFilter_currentIndexChanged

void HackRFOutputGui::on_bbFilter_currentIndexChanged ( int  index)
privateslot

Definition at line 321 of file hackrfoutputgui.cpp.

References HackRFBandwidths::getBandwidth(), HackRFOutputSettings::m_bandwidth, m_settings, and sendSettings().

322 {
323  int newBandwidth = HackRFBandwidths::getBandwidth(index);
324  m_settings.m_bandwidth = newBandwidth * 1000;
325  sendSettings();
326 }
HackRFOutputSettings m_settings
static unsigned int getBandwidth(unsigned int bandwidth_index)
+ Here is the call graph for this function:

◆ on_biasT_stateChanged

void HackRFOutputGui::on_biasT_stateChanged ( int  state)
privateslot

Definition at line 328 of file hackrfoutputgui.cpp.

References HackRFOutputSettings::m_biasT, m_settings, and sendSettings().

329 {
330  m_settings.m_biasT = (state == Qt::Checked);
331  sendSettings();
332 }
HackRFOutputSettings m_settings
+ Here is the call graph for this function:

◆ on_centerFrequency_changed

void HackRFOutputGui::on_centerFrequency_changed ( quint64  value)
privateslot

Definition at line 296 of file hackrfoutputgui.cpp.

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

297 {
298  m_settings.m_centerFrequency = value * 1000;
299  sendSettings();
300 }
HackRFOutputSettings m_settings
+ Here is the call graph for this function:

◆ on_fcPos_currentIndexChanged

void HackRFOutputGui::on_fcPos_currentIndexChanged ( int  index)
privateslot

Definition at line 357 of file hackrfoutputgui.cpp.

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

358 {
359  m_settings.m_fcPos = (HackRFOutputSettings::fcPos_t) (index < 0 ? 0 : index > 2 ? 2 : index);
361  sendSettings();
362 }
HackRFOutputSettings m_settings
+ Here is the call graph for this function:

◆ on_interp_currentIndexChanged

void HackRFOutputGui::on_interp_currentIndexChanged ( int  index)
privateslot

Definition at line 340 of file hackrfoutputgui.cpp.

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

341 {
342  if ((index <0) || (index > 6)) {
343  return;
344  }
345 
346  m_settings.m_log2Interp = index;
348  m_settings.m_devSampleRate = ui->sampleRate->getValueNew();
349 
350  if (!m_sampleRateMode) {
352  }
353 
354  sendSettings();
355 }
HackRFOutputSettings m_settings
bool m_sampleRateMode
true: device, false: base band sample rate update mode
Ui::HackRFOutputGui * ui
+ Here is the call graph for this function:

◆ on_lnaExt_stateChanged

void HackRFOutputGui::on_lnaExt_stateChanged ( int  state)
privateslot

Definition at line 334 of file hackrfoutputgui.cpp.

References HackRFOutputSettings::m_lnaExt, m_settings, and sendSettings().

335 {
336  m_settings.m_lnaExt = (state == Qt::Checked);
337  sendSettings();
338 }
HackRFOutputSettings m_settings
+ Here is the call graph for this function:

◆ on_LOppm_valueChanged

void HackRFOutputGui::on_LOppm_valueChanged ( int  value)
privateslot

Definition at line 314 of file hackrfoutputgui.cpp.

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

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

◆ on_sampleRate_changed

void HackRFOutputGui::on_sampleRate_changed ( quint64  value)
privateslot

Definition at line 302 of file hackrfoutputgui.cpp.

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

303 {
304  m_settings.m_devSampleRate = value;
305 
306  if (!m_sampleRateMode) {
308  }
309 
311  sendSettings();
312 }
HackRFOutputSettings 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 HackRFOutputGui::on_sampleRateMode_toggled ( bool  checked)
privateslot

Definition at line 383 of file hackrfoutputgui.cpp.

References displaySampleRate(), and m_sampleRateMode.

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

◆ on_startStop_toggled

void HackRFOutputGui::on_startStop_toggled ( bool  checked)
privateslot

Definition at line 374 of file hackrfoutputgui.cpp.

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

375 {
376  if (m_doApplySettings)
377  {
380  }
381 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
DeviceSampleSink * m_deviceSampleSink
MessageQueue * getInputMessageQueue()
static MsgStartStop * create(bool startStop)
Definition: hackrfoutput.h:68
+ Here is the call graph for this function:

◆ on_txvga_valueChanged

void HackRFOutputGui::on_txvga_valueChanged ( int  value)
privateslot

Definition at line 364 of file hackrfoutputgui.cpp.

References arg(), m_settings, HackRFOutputSettings::m_vgaGain, sendSettings(), and ui.

365 {
366  if ((value < 0) || (value > 47))
367  return;
368 
369  ui->txvgaGainText->setText(tr("%1dB").arg(value));
370  m_settings.m_vgaGain = value;
371  sendSettings();
372 }
HackRFOutputSettings m_settings
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Ui::HackRFOutputGui * ui
+ Here is the call graph for this function:

◆ openDeviceSettingsDialog

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

Definition at line 431 of file hackrfoutputgui.cpp.

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

Referenced by HackRFOutputGui().

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

◆ resetToDefaults()

void HackRFOutputGui::resetToDefaults ( )
virtual

Implements PluginInstanceGUI.

Definition at line 91 of file hackrfoutputgui.cpp.

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

Referenced by deserialize().

92 {
95  sendSettings();
96 }
HackRFOutputSettings m_settings
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendSettings()

void HackRFOutputGui::sendSettings ( )
private

◆ serialize()

QByteArray HackRFOutputGui::serialize ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 110 of file hackrfoutputgui.cpp.

References m_settings, and HackRFOutputSettings::serialize().

111 {
112  return m_settings.serialize();
113 }
HackRFOutputSettings m_settings
QByteArray serialize() const
+ Here is the call graph for this function:

◆ setCenterFrequency()

void HackRFOutputGui::setCenterFrequency ( qint64  centerFrequency)
virtual

Implements PluginInstanceGUI.

Definition at line 103 of file hackrfoutputgui.cpp.

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

104 {
105  m_settings.m_centerFrequency = centerFrequency;
106  displaySettings();
107  sendSettings();
108 }
HackRFOutputSettings m_settings
+ Here is the call graph for this function:

◆ setName()

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

Implements PluginInstanceGUI.

Definition at line 81 of file hackrfoutputgui.cpp.

82 {
83  setObjectName(name);
84 }

◆ updateHardware

void HackRFOutputGui::updateHardware ( )
privateslot

Definition at line 389 of file hackrfoutputgui.cpp.

References HackRFOutput::MsgConfigureHackRF::create(), DeviceSampleSink::getInputMessageQueue(), m_deviceSampleSink, m_doApplySettings, m_forceSettings, m_settings, m_updateTimer, and MessageQueue::push().

Referenced by HackRFOutputGui().

390 {
391  if (m_doApplySettings)
392  {
393  qDebug() << "HackRFOutputGui::updateHardware";
396  m_forceSettings = false;
397  m_updateTimer.stop();
398  }
399 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
static MsgConfigureHackRF * create(const HackRFOutputSettings &settings, bool force)
Definition: hackrfoutput.h:46
HackRFOutputSettings m_settings
DeviceSampleSink * m_deviceSampleSink
MessageQueue * getInputMessageQueue()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateSampleRateAndFrequency()

void HackRFOutputGui::updateSampleRateAndFrequency ( )
private

Definition at line 195 of file hackrfoutputgui.cpp.

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

Referenced by handleInputMessages().

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

◆ updateStatus

void HackRFOutputGui::updateStatus ( )
privateslot

Definition at line 401 of file hackrfoutputgui.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 HackRFOutputGui().

402 {
403  int state = m_deviceUISet->m_deviceAPI->state();
404 
405  if(m_lastEngineState != state)
406  {
407  switch(state)
408  {
410  ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
411  break;
412  case DeviceAPI::StIdle:
413  ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
414  ui->startStop->setChecked(false);
415  break;
417  ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
418  break;
419  case DeviceAPI::StError:
420  ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
421  QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
422  break;
423  default:
424  break;
425  }
426 
427  m_lastEngineState = state;
428  }
429 }
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::HackRFOutputGui * 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 HackRFOutputGui::m_deviceCenterFrequency
private

Center frequency in device.

Definition at line 76 of file hackrfoutputgui.h.

Referenced by handleInputMessages(), and updateSampleRateAndFrequency().

◆ m_deviceSampleSink

DeviceSampleSink* HackRFOutputGui::m_deviceSampleSink
private

Definition at line 74 of file hackrfoutputgui.h.

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

◆ m_deviceUISet

DeviceUISet* HackRFOutputGui::m_deviceUISet
private

Definition at line 68 of file hackrfoutputgui.h.

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

◆ m_doApplySettings

bool HackRFOutputGui::m_doApplySettings
private

Definition at line 79 of file hackrfoutputgui.h.

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

◆ m_forceSettings

bool HackRFOutputGui::m_forceSettings
private

Definition at line 69 of file hackrfoutputgui.h.

Referenced by deserialize(), and updateHardware().

◆ m_inputMessageQueue

MessageQueue HackRFOutputGui::m_inputMessageQueue
private

Definition at line 78 of file hackrfoutputgui.h.

Referenced by HackRFOutputGui(), and handleInputMessages().

◆ m_lastEngineState

int HackRFOutputGui::m_lastEngineState
private

Definition at line 77 of file hackrfoutputgui.h.

Referenced by updateStatus().

◆ m_sampleRate

int HackRFOutputGui::m_sampleRate
private

Definition at line 75 of file hackrfoutputgui.h.

Referenced by handleInputMessages(), and updateSampleRateAndFrequency().

◆ m_sampleRateMode

bool HackRFOutputGui::m_sampleRateMode
private

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

Definition at line 71 of file hackrfoutputgui.h.

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

◆ m_settings

HackRFOutputSettings HackRFOutputGui::m_settings
private

◆ m_statusTimer

QTimer HackRFOutputGui::m_statusTimer
private

Definition at line 73 of file hackrfoutputgui.h.

Referenced by HackRFOutputGui().

◆ m_updateTimer

QTimer HackRFOutputGui::m_updateTimer
private

Definition at line 72 of file hackrfoutputgui.h.

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

◆ ui

Ui::HackRFOutputGui* HackRFOutputGui::ui
private

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