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

#include <hackrfinputgui.h>

+ Inheritance diagram for HackRFInputGui:
+ Collaboration diagram for HackRFInputGui:

Public Types

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

Public Member Functions

 HackRFInputGui (DeviceUISet *deviceUISet, QWidget *parent=0)
 
virtual ~HackRFInputGui ()
 
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_dcOffset_toggled (bool checked)
 
void on_iqImbalance_toggled (bool checked)
 
void on_biasT_stateChanged (int state)
 
void on_decim_currentIndexChanged (int index)
 
void on_fcPos_currentIndexChanged (int index)
 
void on_lnaExt_stateChanged (int state)
 
void on_lna_valueChanged (int value)
 
void on_bbFilter_currentIndexChanged (int index)
 
void on_vga_valueChanged (int value)
 
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 displayBandwidths ()
 
void sendSettings ()
 
void updateSampleRateAndFrequency ()
 
void blockApplySettings (bool block)
 

Private Attributes

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

Detailed Description

Definition at line 37 of file hackrfinputgui.h.

Member Enumeration Documentation

◆ HackRFImgRejValue

Enumerator
HACKRF_IMGREJ_BYPASS 
HACKRF_IMGREJ_LOWPASS 
HACKRF_IMGREJ_HIGHPASS 
HACKRF_IMGREJ_NB 

Definition at line 41 of file hackrfinputgui.h.

Constructor & Destructor Documentation

◆ HackRFInputGui()

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

Definition at line 37 of file hackrfinputgui.cpp.

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

37  :
38  QWidget(parent),
39  ui(new Ui::HackRFInputGui),
40  m_deviceUISet(deviceUISet),
41  m_settings(),
42  m_sampleRateMode(true),
43  m_forceSettings(true),
44  m_doApplySettings(true),
45  m_sampleSource(NULL),
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 
67  connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection);
69 
70  sendSettings();
71 }
DeviceUISet * m_deviceUISet
DeviceSampleSource * getSampleSource()
Return pointer to the device sample source (single Rx) or nullptr.
Definition: deviceapi.cpp:213
Ui::HackRFInputGui * ui
DeviceSampleSource * m_sampleSource
MessageQueue m_inputMessageQueue
engine is before initialization
Definition: deviceapi.h:53
QTimer m_statusTimer
DeviceAPI * m_deviceAPI
Definition: deviceuiset.h:48
bool m_sampleRateMode
true: device, false: base band sample rate update mode
HackRFInputSettings m_settings
void openDeviceSettingsDialog(const QPoint &p)
QTimer m_updateTimer
void handleInputMessages()
virtual void setMessageQueueToGUI(MessageQueue *queue)=0
+ Here is the call graph for this function:

◆ ~HackRFInputGui()

HackRFInputGui::~HackRFInputGui ( )
virtual

Definition at line 73 of file hackrfinputgui.cpp.

References ui.

74 {
75  delete ui;
76 }
Ui::HackRFInputGui * ui

Member Function Documentation

◆ blockApplySettings()

void HackRFInputGui::blockApplySettings ( bool  block)
private

Definition at line 441 of file hackrfinputgui.cpp.

References m_doApplySettings.

Referenced by displaySettings(), and handleMessage().

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

◆ deserialize()

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

Implements PluginInstanceGUI.

Definition at line 117 of file hackrfinputgui.cpp.

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

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

◆ destroy()

void HackRFInputGui::destroy ( )
virtual

Implements PluginInstanceGUI.

Definition at line 78 of file hackrfinputgui.cpp.

79 {
80  delete this;
81 }

◆ displayBandwidths()

void HackRFInputGui::displayBandwidths ( )
private

Definition at line 273 of file hackrfinputgui.cpp.

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

Referenced by HackRFInputGui().

274 {
275  unsigned int savedIndex = HackRFBandwidths::getBandwidthIndex(m_settings.m_bandwidth/1000);
276  ui->bbFilter->blockSignals(true);
277  ui->bbFilter->clear();
278 
279  for (unsigned int i = 0; i < HackRFBandwidths::m_nb_bw; i++)
280  {
281  ui->bbFilter->addItem(QString("%1M").arg(QString::number(HackRFBandwidths::m_bw_k[i]/1000.0, 'f', 2)));
282  }
283 
284  ui->bbFilter->blockSignals(false);
285 
286  if (savedIndex < HackRFBandwidths::m_nb_bw)
287  {
288  ui->bbFilter->setCurrentIndex(savedIndex);
289  }
290  else
291  {
292  ui->bbFilter->setCurrentIndex((int) HackRFBandwidths::m_nb_bw-1);
293  }
294 }
static const unsigned int m_nb_bw
static const unsigned int m_bw_k[]
Ui::HackRFInputGui * ui
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)
HackRFInputSettings m_settings
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ displayFcTooltip()

void HackRFInputGui::displayFcTooltip ( )
private

Definition at line 229 of file hackrfinputgui.cpp.

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

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

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

◆ displaySampleRate()

void HackRFInputGui::displaySampleRate ( )
private

Definition at line 199 of file hackrfinputgui.cpp.

References arg(), displayFcTooltip(), HackRFInputSettings::m_devSampleRate, HackRFInputSettings::m_log2Decim, m_sampleRateMode, m_settings, and ui.

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

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

◆ displaySettings()

void HackRFInputGui::displaySettings ( )
private

Definition at line 240 of file hackrfinputgui.cpp.

References arg(), blockApplySettings(), displaySampleRate(), HackRFBandwidths::getBandwidthIndex(), HackRFInputSettings::m_bandwidth, HackRFInputSettings::m_biasT, HackRFInputSettings::m_centerFrequency, HackRFInputSettings::m_dcBlock, HackRFInputSettings::m_fcPos, HackRFInputSettings::m_iqCorrection, HackRFInputSettings::m_lnaExt, HackRFInputSettings::m_lnaGain, HackRFInputSettings::m_log2Decim, HackRFInputSettings::m_LOppmTenths, m_settings, HackRFInputSettings::m_vgaGain, and ui.

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

241 {
242  blockApplySettings(true);
243 
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->dcOffset->setChecked(m_settings.m_dcBlock);
250  ui->iqImbalance->setChecked(m_settings.m_iqCorrection);
251 
253 
254  ui->biasT->setChecked(m_settings.m_biasT);
255 
256  ui->decim->setCurrentIndex(m_settings.m_log2Decim);
257 
258  ui->fcPos->setCurrentIndex((int) m_settings.m_fcPos);
259 
260  ui->lnaExt->setChecked(m_settings.m_lnaExt);
261  ui->lnaGainText->setText(tr("%1dB").arg(m_settings.m_lnaGain));
262  ui->lna->setValue(m_settings.m_lnaGain);
263 
264  unsigned int bandwidthIndex = HackRFBandwidths::getBandwidthIndex(m_settings.m_bandwidth/1000);
265  ui->bbFilter->setCurrentIndex(bandwidthIndex);
266 
267  ui->vgaText->setText(tr("%1dB").arg(m_settings.m_vgaGain));
268  ui->vga->setValue(m_settings.m_vgaGain);
269 
270  blockApplySettings(false);
271 }
Ui::HackRFInputGui * ui
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void blockApplySettings(bool block)
static unsigned int getBandwidthIndex(unsigned int bandwidth)
HackRFInputSettings m_settings
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCenterFrequency()

qint64 HackRFInputGui::getCenterFrequency ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 100 of file hackrfinputgui.cpp.

References HackRFInputSettings::m_centerFrequency, and m_settings.

101 {
103 }
HackRFInputSettings m_settings

◆ getInputMessageQueue()

virtual MessageQueue* HackRFInputGui::getInputMessageQueue ( )
inlinevirtual

Implements PluginInstanceGUI.

Definition at line 61 of file hackrfinputgui.h.

61 { return &m_inputMessageQueue; }
MessageQueue m_inputMessageQueue

◆ getName()

QString HackRFInputGui::getName ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 88 of file hackrfinputgui.cpp.

89 {
90  return objectName();
91 }

◆ handleInputMessages

void HackRFInputGui::handleInputMessages ( )
privateslot

Definition at line 164 of file hackrfinputgui.cpp.

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

Referenced by HackRFInputGui().

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

◆ handleMessage()

bool HackRFInputGui::handleMessage ( const Message message)
virtual

Implements PluginInstanceGUI.

Definition at line 133 of file hackrfinputgui.cpp.

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

Referenced by handleInputMessages().

134 {
136  {
138  m_settings = cfg.getSettings();
139  blockApplySettings(true);
140  displaySettings();
141  blockApplySettings(false);
142  return true;
143  }
144  else if (HackRFInput::MsgReportHackRF::match(message))
145  {
146  displaySettings();
147  return true;
148  }
149  else if (HackRFInput::MsgStartStop::match(message))
150  {
152  blockApplySettings(true);
153  ui->startStop->setChecked(notif.getStartStop());
154  blockApplySettings(false);
155 
156  return true;
157  }
158  else
159  {
160  return false;
161  }
162 }
const HackRFInputSettings & getSettings() const
Definition: hackrfinput.h:45
Ui::HackRFInputGui * ui
static bool match(const Message *message)
Definition: message.cpp:45
void blockApplySettings(bool block)
bool getStartStop() const
Definition: hackrfinput.h:85
HackRFInputSettings m_settings
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_bbFilter_currentIndexChanged

void HackRFInputGui::on_bbFilter_currentIndexChanged ( int  index)
privateslot

Definition at line 321 of file hackrfinputgui.cpp.

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

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

◆ on_biasT_stateChanged

void HackRFInputGui::on_biasT_stateChanged ( int  state)
privateslot

Definition at line 328 of file hackrfinputgui.cpp.

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

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

◆ on_centerFrequency_changed

void HackRFInputGui::on_centerFrequency_changed ( quint64  value)
privateslot

Definition at line 340 of file hackrfinputgui.cpp.

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

341 {
342  m_settings.m_centerFrequency = value * 1000;
343  sendSettings();
344 }
HackRFInputSettings m_settings
+ Here is the call graph for this function:

◆ on_dcOffset_toggled

void HackRFInputGui::on_dcOffset_toggled ( bool  checked)
privateslot

Definition at line 309 of file hackrfinputgui.cpp.

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

310 {
311  m_settings.m_dcBlock = checked;
312  sendSettings();
313 }
HackRFInputSettings m_settings
+ Here is the call graph for this function:

◆ on_decim_currentIndexChanged

void HackRFInputGui::on_decim_currentIndexChanged ( int  index)
privateslot

Definition at line 358 of file hackrfinputgui.cpp.

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

359 {
360  if ((index <0) || (index > 6)) {
361  return;
362  }
363 
364  m_settings.m_log2Decim = index;
366  m_settings.m_devSampleRate = ui->sampleRate->getValueNew();
367 
368  if (!m_sampleRateMode) {
370  }
371 
372  sendSettings();
373 }
Ui::HackRFInputGui * ui
bool m_sampleRateMode
true: device, false: base band sample rate update mode
HackRFInputSettings m_settings
+ Here is the call graph for this function:

◆ on_fcPos_currentIndexChanged

void HackRFInputGui::on_fcPos_currentIndexChanged ( int  index)
privateslot

Definition at line 375 of file hackrfinputgui.cpp.

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

376 {
377  m_settings.m_fcPos = (HackRFInputSettings::fcPos_t) (index < 0 ? 0 : index > 2 ? 2 : index);
379  sendSettings();
380 }
HackRFInputSettings m_settings
+ Here is the call graph for this function:

◆ on_iqImbalance_toggled

void HackRFInputGui::on_iqImbalance_toggled ( bool  checked)
privateslot

Definition at line 315 of file hackrfinputgui.cpp.

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

316 {
317  m_settings.m_iqCorrection = checked;
318  sendSettings();
319 }
HackRFInputSettings m_settings
+ Here is the call graph for this function:

◆ on_lna_valueChanged

void HackRFInputGui::on_lna_valueChanged ( int  value)
privateslot

Definition at line 382 of file hackrfinputgui.cpp.

References arg(), HackRFInputSettings::m_lnaGain, m_settings, sendSettings(), and ui.

383 {
384  if ((value < 0) || (value > 40))
385  return;
386 
387  ui->lnaGainText->setText(tr("%1dB").arg(value));
388  m_settings.m_lnaGain = value;
389  sendSettings();
390 }
Ui::HackRFInputGui * ui
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
HackRFInputSettings m_settings
+ Here is the call graph for this function:

◆ on_lnaExt_stateChanged

void HackRFInputGui::on_lnaExt_stateChanged ( int  state)
privateslot

Definition at line 334 of file hackrfinputgui.cpp.

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

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

◆ on_LOppm_valueChanged

void HackRFInputGui::on_LOppm_valueChanged ( int  value)
privateslot

Definition at line 302 of file hackrfinputgui.cpp.

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

303 {
304  m_settings.m_LOppmTenths = value;
305  ui->LOppmText->setText(QString("%1").arg(QString::number(m_settings.m_LOppmTenths/10.0, 'f', 1)));
306  sendSettings();
307 }
Ui::HackRFInputGui * ui
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
HackRFInputSettings m_settings
+ Here is the call graph for this function:

◆ on_record_toggled

void HackRFInputGui::on_record_toggled ( bool  checked)
privateslot

Definition at line 411 of file hackrfinputgui.cpp.

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

412 {
413  if (checked) {
414  ui->record->setStyleSheet("QToolButton { background-color : red; }");
415  } else {
416  ui->record->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
417  }
418 
421 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
Ui::HackRFInputGui * ui
MessageQueue * getInputMessageQueue()
DeviceSampleSource * m_sampleSource
static MsgFileRecord * create(bool startStop)
Definition: hackrfinput.h:106
+ Here is the call graph for this function:

◆ on_sampleRate_changed

void HackRFInputGui::on_sampleRate_changed ( quint64  value)
privateslot

Definition at line 346 of file hackrfinputgui.cpp.

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

347 {
348  m_settings.m_devSampleRate = value;
349 
350  if (!m_sampleRateMode) {
352  }
353 
355  sendSettings();
356 }
bool m_sampleRateMode
true: device, false: base band sample rate update mode
HackRFInputSettings m_settings
+ Here is the call graph for this function:

◆ on_sampleRateMode_toggled

void HackRFInputGui::on_sampleRateMode_toggled ( bool  checked)
privateslot

Definition at line 423 of file hackrfinputgui.cpp.

References displaySampleRate(), and m_sampleRateMode.

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

◆ on_startStop_toggled

void HackRFInputGui::on_startStop_toggled ( bool  checked)
privateslot

Definition at line 402 of file hackrfinputgui.cpp.

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

403 {
404  if (m_doApplySettings)
405  {
408  }
409 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
DeviceSampleSource * m_sampleSource
static MsgStartStop * create(bool startStop)
Definition: hackrfinput.h:87
+ Here is the call graph for this function:

◆ on_vga_valueChanged

void HackRFInputGui::on_vga_valueChanged ( int  value)
privateslot

Definition at line 392 of file hackrfinputgui.cpp.

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

393 {
394  if ((value < 0) || (value > 62))
395  return;
396 
397  ui->vgaText->setText(tr("%1dB").arg(value));
398  m_settings.m_vgaGain = value;
399  sendSettings();
400 }
Ui::HackRFInputGui * ui
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
HackRFInputSettings m_settings
+ Here is the call graph for this function:

◆ openDeviceSettingsDialog

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

Definition at line 476 of file hackrfinputgui.cpp.

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

Referenced by HackRFInputGui().

477 {
478  BasicDeviceSettingsDialog dialog(this);
479  dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
480  dialog.setReverseAPIAddress(m_settings.m_reverseAPIAddress);
481  dialog.setReverseAPIPort(m_settings.m_reverseAPIPort);
482  dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex);
483 
484  dialog.move(p);
485  dialog.exec();
486 
487  m_settings.m_useReverseAPI = dialog.useReverseAPI();
488  m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress();
489  m_settings.m_reverseAPIPort = dialog.getReverseAPIPort();
490  m_settings.m_reverseAPIDeviceIndex = dialog.getReverseAPIDeviceIndex();
491 
492  sendSettings();
493 }
HackRFInputSettings m_settings
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetToDefaults()

void HackRFInputGui::resetToDefaults ( )
virtual

Implements PluginInstanceGUI.

Definition at line 93 of file hackrfinputgui.cpp.

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

Referenced by deserialize().

94 {
97  sendSettings();
98 }
HackRFInputSettings m_settings
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendSettings()

void HackRFInputGui::sendSettings ( )
private

◆ serialize()

QByteArray HackRFInputGui::serialize ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 112 of file hackrfinputgui.cpp.

References m_settings, and HackRFInputSettings::serialize().

113 {
114  return m_settings.serialize();
115 }
QByteArray serialize() const
HackRFInputSettings m_settings
+ Here is the call graph for this function:

◆ setCenterFrequency()

void HackRFInputGui::setCenterFrequency ( qint64  centerFrequency)
virtual

Implements PluginInstanceGUI.

Definition at line 105 of file hackrfinputgui.cpp.

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

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

◆ setName()

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

Implements PluginInstanceGUI.

Definition at line 83 of file hackrfinputgui.cpp.

84 {
85  setObjectName(name);
86 }

◆ updateHardware

void HackRFInputGui::updateHardware ( )
privateslot

Definition at line 429 of file hackrfinputgui.cpp.

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

Referenced by HackRFInputGui().

430 {
431  if (m_doApplySettings)
432  {
433  qDebug() << "HackRFGui::updateHardware";
436  m_forceSettings = false;
437  m_updateTimer.stop();
438  }
439 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
static MsgConfigureHackRF * create(const HackRFInputSettings &settings, bool force=false)
Definition: hackrfinput.h:48
DeviceSampleSource * m_sampleSource
HackRFInputSettings m_settings
QTimer m_updateTimer
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateSampleRateAndFrequency()

void HackRFInputGui::updateSampleRateAndFrequency ( )
private

Definition at line 192 of file hackrfinputgui.cpp.

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

Referenced by handleInputMessages().

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

Definition at line 446 of file hackrfinputgui.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 HackRFInputGui().

447 {
448  int state = m_deviceUISet->m_deviceAPI->state();
449 
450  if(m_lastEngineState != state)
451  {
452  switch(state)
453  {
455  ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
456  break;
457  case DeviceAPI::StIdle:
458  ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
459  ui->startStop->setChecked(false);
460  break;
462  ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
463  break;
464  case DeviceAPI::StError:
465  ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
466  QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
467  break;
468  default:
469  break;
470  }
471 
472  m_lastEngineState = state;
473  }
474 }
DeviceUISet * m_deviceUISet
Ui::HackRFInputGui * ui
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 HackRFInputGui::m_deviceCenterFrequency
private

Center frequency in device.

Definition at line 76 of file hackrfinputgui.h.

Referenced by handleInputMessages(), and updateSampleRateAndFrequency().

◆ m_deviceUISet

DeviceUISet* HackRFInputGui::m_deviceUISet
private

Definition at line 67 of file hackrfinputgui.h.

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

◆ m_doApplySettings

bool HackRFInputGui::m_doApplySettings
private

Definition at line 71 of file hackrfinputgui.h.

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

◆ m_forceSettings

bool HackRFInputGui::m_forceSettings
private

Definition at line 70 of file hackrfinputgui.h.

Referenced by deserialize(), and updateHardware().

◆ m_inputMessageQueue

MessageQueue HackRFInputGui::m_inputMessageQueue
private

Definition at line 78 of file hackrfinputgui.h.

Referenced by HackRFInputGui(), and handleInputMessages().

◆ m_lastEngineState

int HackRFInputGui::m_lastEngineState
private

Definition at line 77 of file hackrfinputgui.h.

Referenced by updateStatus().

◆ m_sampleRate

int HackRFInputGui::m_sampleRate
private

Definition at line 75 of file hackrfinputgui.h.

Referenced by handleInputMessages(), and updateSampleRateAndFrequency().

◆ m_sampleRateMode

bool HackRFInputGui::m_sampleRateMode
private

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

Definition at line 69 of file hackrfinputgui.h.

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

◆ m_sampleSource

DeviceSampleSource* HackRFInputGui::m_sampleSource
private

◆ m_settings

HackRFInputSettings HackRFInputGui::m_settings
private

◆ m_statusTimer

QTimer HackRFInputGui::m_statusTimer
private

Definition at line 73 of file hackrfinputgui.h.

Referenced by HackRFInputGui().

◆ m_updateTimer

QTimer HackRFInputGui::m_updateTimer
private

Definition at line 72 of file hackrfinputgui.h.

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

◆ ui

Ui::HackRFInputGui* HackRFInputGui::ui
private

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