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

#include <limesdrinputgui.h>

+ Inheritance diagram for LimeSDRInputGUI:
+ Collaboration diagram for LimeSDRInputGUI:

Public Member Functions

 LimeSDRInputGUI (DeviceUISet *deviceUISet, QWidget *parent=0)
 
virtual ~LimeSDRInputGUI ()
 
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_startStop_toggled (bool checked)
 
void on_record_toggled (bool checked)
 
void on_centerFrequency_changed (quint64 value)
 
void on_ncoFrequency_changed (qint64 value)
 
void on_ncoEnable_toggled (bool checked)
 
void on_dcOffset_toggled (bool checked)
 
void on_iqImbalance_toggled (bool checked)
 
void on_sampleRate_changed (quint64 value)
 
void on_hwDecim_currentIndexChanged (int index)
 
void on_swDecim_currentIndexChanged (int index)
 
void on_lpf_changed (quint64 value)
 
void on_lpFIREnable_toggled (bool checked)
 
void on_lpFIR_changed (quint64 value)
 
void on_gainMode_currentIndexChanged (int index)
 
void on_gain_valueChanged (int value)
 
void on_lnaGain_valueChanged (int value)
 
void on_tiaGain_currentIndexChanged (int index)
 
void on_pgaGain_valueChanged (int value)
 
void on_antenna_currentIndexChanged (int index)
 
void on_extClock_clicked ()
 
void on_transverter_clicked ()
 
void on_sampleRateMode_toggled (bool checked)
 
void openDeviceSettingsDialog (const QPoint &p)
 
void updateHardware ()
 
void updateStatus ()
 

Private Member Functions

void displaySettings ()
 
void displaySampleRate ()
 
void setNCODisplay ()
 
void setCenterFrequencyDisplay ()
 
void setCenterFrequencySetting (uint64_t kHzValue)
 
void sendSettings ()
 
void updateSampleRateAndFrequency ()
 
void updateADCRate ()
 
void updateFrequencyLimits ()
 
void blockApplySettings (bool block)
 

Private Attributes

Ui::LimeSDRInputGUI * ui
 
DeviceUISetm_deviceUISet
 
LimeSDRInputm_limeSDRInput
 Same object as above but gives easy access to LimeSDRInput methods and attributes that are used intensively. More...
 
LimeSDRInputSettings m_settings
 
bool m_sampleRateMode
 true: device, false: base band sample rate update mode More...
 
QTimer m_updateTimer
 
QTimer m_statusTimer
 
int m_sampleRate
 
quint64 m_deviceCenterFrequency
 Center frequency in device. More...
 
int m_lastEngineState
 
bool m_doApplySettings
 
bool m_forceSettings
 
int m_statusCounter
 
int m_deviceStatusCounter
 
MessageQueue m_inputMessageQueue
 

Detailed Description

Definition at line 35 of file limesdrinputgui.h.

Constructor & Destructor Documentation

◆ LimeSDRInputGUI()

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

Definition at line 35 of file limesdrinputgui.cpp.

References arg(), displaySettings(), LimeSDRInput::getChannelIndex(), LimeSDRInput::getLimeType(), LimeSDRInput::getLORange(), LimeSDRInput::getLPRange(), DeviceAPI::getSampleSource(), LimeSDRInput::getSRRange(), ColorMapper::GrayGold, ColorMapper::GrayGreenYellow, ColorMapper::GrayYellow, handleInputMessages(), DeviceLimeSDRParams::LimeMini, DeviceUISet::m_deviceAPI, m_deviceUISet, m_inputMessageQueue, m_limeSDRInput, m_statusTimer, m_updateTimer, openDeviceSettingsDialog(), LimeSDRInput::setMessageQueueToGUI(), ui, updateHardware(), and updateStatus().

35  :
36  QWidget(parent),
37  ui(new Ui::LimeSDRInputGUI),
38  m_deviceUISet(deviceUISet),
39  m_settings(),
40  m_sampleRateMode(true),
41  m_sampleRate(0),
43  m_doApplySettings(true),
44  m_forceSettings(true),
45  m_statusCounter(0),
47 {
49 
50  ui->setupUi(this);
51 
52  float minF, maxF;
53 
54  m_limeSDRInput->getLORange(minF, maxF);
55  ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
56  ui->centerFrequency->setValueRange(7, ((uint32_t) minF)/1000, ((uint32_t) maxF)/1000); // frequency dial is in kHz
57 
58  m_limeSDRInput->getSRRange(minF, maxF);
59  ui->sampleRate->setColorMapper(ColorMapper(ColorMapper::GrayGreenYellow));
60  ui->sampleRate->setValueRange(8, (uint32_t) minF, (uint32_t) maxF);
61 
62  m_limeSDRInput->getLPRange(minF, maxF);
63  ui->lpf->setColorMapper(ColorMapper(ColorMapper::GrayYellow));
64  ui->lpf->setValueRange(6, (minF/1000)+1, maxF/1000);
65 
66  ui->lpFIR->setColorMapper(ColorMapper(ColorMapper::GrayYellow));
67  ui->lpFIR->setValueRange(5, 1U, 56000U);
68 
69  ui->ncoFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
70 
71  ui->channelNumberText->setText(tr("#%1").arg(m_limeSDRInput->getChannelIndex()));
72 
74  {
75  ui->antenna->setItemText(2, "NC");
76  ui->antenna->setItemText(3, "Lo");
77  }
78  else
79  {
80  ui->antenna->setItemText(2, "Lo");
81  ui->antenna->setItemText(3, "Wi");
82  }
83 
84  ui->hwDecimLabel->setText(QString::fromUtf8("H\u2193"));
85  ui->swDecimLabel->setText(QString::fromUtf8("S\u2193"));
86 
87  connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware()));
88  connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus()));
89  m_statusTimer.start(500);
90 
92 
93  connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection);
95 
96  CRightClickEnabler *startStopRightClickEnabler = new CRightClickEnabler(ui->startStop);
97  connect(startStopRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(openDeviceSettingsDialog(const QPoint &)));
98 }
LimeSDRInput * m_limeSDRInput
Same object as above but gives easy access to LimeSDRInput methods and attributes that are used inten...
DeviceSampleSource * getSampleSource()
Return pointer to the device sample source (single Rx) or nullptr.
Definition: deviceapi.cpp:213
DeviceLimeSDRParams::LimeType getLimeType() const
DeviceUISet * m_deviceUISet
bool m_sampleRateMode
true: device, false: base band sample rate update mode
void openDeviceSettingsDialog(const QPoint &p)
unsigned int uint32_t
Definition: rtptypes_win.h:46
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
engine is before initialization
Definition: deviceapi.h:53
DeviceAPI * m_deviceAPI
Definition: deviceuiset.h:48
Ui::LimeSDRInputGUI * ui
void getLORange(float &minF, float &maxF) const
virtual void setMessageQueueToGUI(MessageQueue *queue)
Definition: limesdrinput.h:218
LimeSDRInputSettings m_settings
std::size_t getChannelIndex()
MessageQueue m_inputMessageQueue
void getLPRange(float &minF, float &maxF) const
void getSRRange(float &minF, float &maxF) const
+ Here is the call graph for this function:

◆ ~LimeSDRInputGUI()

LimeSDRInputGUI::~LimeSDRInputGUI ( )
virtual

Definition at line 100 of file limesdrinputgui.cpp.

References ui.

101 {
102  delete ui;
103 }
Ui::LimeSDRInputGUI * ui

Member Function Documentation

◆ blockApplySettings()

void LimeSDRInputGUI::blockApplySettings ( bool  block)
private

Definition at line 534 of file limesdrinputgui.cpp.

References m_doApplySettings.

Referenced by handleMessage().

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

◆ deserialize()

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

Implements PluginInstanceGUI.

Definition at line 144 of file limesdrinputgui.cpp.

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

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

◆ destroy()

void LimeSDRInputGUI::destroy ( )
virtual

Implements PluginInstanceGUI.

Definition at line 105 of file limesdrinputgui.cpp.

106 {
107  delete this;
108 }

◆ displaySampleRate()

void LimeSDRInputGUI::displaySampleRate ( )
private

Definition at line 333 of file limesdrinputgui.cpp.

References arg(), LimeSDRInput::getSRRange(), LimeSDRInputSettings::m_devSampleRate, m_limeSDRInput, LimeSDRInputSettings::m_log2SoftDecim, m_sampleRateMode, m_settings, and ui.

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

334 {
335  float minF, maxF;
336  m_limeSDRInput->getSRRange(minF, maxF);
337 
338  ui->sampleRate->blockSignals(true);
339 
340  if (m_sampleRateMode)
341  {
342  ui->sampleRateMode->setStyleSheet("QToolButton { background:rgb(60,60,60); }");
343  ui->sampleRateMode->setText("SR");
344  ui->sampleRate->setValueRange(8, (uint32_t) minF, (uint32_t) maxF);
345  ui->sampleRate->setValue(m_settings.m_devSampleRate);
346  ui->sampleRate->setToolTip("Device to host sample rate (S/s)");
347  ui->deviceRateText->setToolTip("Baseband sample rate (S/s)");
349  ui->deviceRateText->setText(tr("%1k").arg(QString::number(basebandSampleRate / 1000.0f, 'g', 5)));
350  }
351  else
352  {
353  ui->sampleRateMode->setStyleSheet("QToolButton { background:rgb(50,50,50); }");
354  ui->sampleRateMode->setText("BB");
355  ui->sampleRate->setValueRange(8, (uint32_t) minF/(1<<m_settings.m_log2SoftDecim), (uint32_t) maxF/(1<<m_settings.m_log2SoftDecim));
356  ui->sampleRate->setValue(m_settings.m_devSampleRate/(1<<m_settings.m_log2SoftDecim));
357  ui->sampleRate->setToolTip("Baseband sample rate (S/s)");
358  ui->deviceRateText->setToolTip("Device to host sample rate (S/s)");
359  ui->deviceRateText->setText(tr("%1k").arg(QString::number(m_settings.m_devSampleRate / 1000.0f, 'g', 5)));
360  }
361 
362  ui->sampleRate->blockSignals(false);
363 }
LimeSDRInput * m_limeSDRInput
Same object as above but gives easy access to LimeSDRInput methods and attributes that are used inten...
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::LimeSDRInputGUI * ui
LimeSDRInputSettings m_settings
void getSRRange(float &minF, float &maxF) const
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ displaySettings()

void LimeSDRInputGUI::displaySettings ( )
private

Definition at line 366 of file limesdrinputgui.cpp.

References arg(), displaySampleRate(), LimeSDRInputSettings::GAIN_AUTO, LimeSDRInputSettings::m_antennaPath, LimeSDRInputSettings::m_dcBlock, LimeSDRInputSettings::m_extClock, LimeSDRInputSettings::m_extClockFreq, LimeSDRInputSettings::m_gain, LimeSDRInputSettings::m_gainMode, LimeSDRInputSettings::m_iqCorrection, LimeSDRInputSettings::m_lnaGain, LimeSDRInputSettings::m_log2HardDecim, LimeSDRInputSettings::m_log2SoftDecim, LimeSDRInputSettings::m_lpfBW, LimeSDRInputSettings::m_lpfFIRBW, LimeSDRInputSettings::m_lpfFIREnable, LimeSDRInputSettings::m_ncoEnable, LimeSDRInputSettings::m_pgaGain, m_settings, LimeSDRInputSettings::m_tiaGain, LimeSDRInputSettings::m_transverterDeltaFrequency, LimeSDRInputSettings::m_transverterMode, setCenterFrequencyDisplay(), setNCODisplay(), ui, and updateADCRate().

Referenced by deserialize(), handleInputMessages(), handleMessage(), LimeSDRInputGUI(), resetToDefaults(), and setCenterFrequency().

367 {
368  ui->transverter->setDeltaFrequency(m_settings.m_transverterDeltaFrequency);
369  ui->transverter->setDeltaFrequencyActive(m_settings.m_transverterMode);
370 
371  ui->extClock->setExternalClockFrequency(m_settings.m_extClockFreq);
372  ui->extClock->setExternalClockActive(m_settings.m_extClock);
373 
376 
377  ui->dcOffset->setChecked(m_settings.m_dcBlock);
378  ui->iqImbalance->setChecked(m_settings.m_iqCorrection);
379 
380  ui->hwDecim->setCurrentIndex(m_settings.m_log2HardDecim);
381  ui->swDecim->setCurrentIndex(m_settings.m_log2SoftDecim);
382 
383  updateADCRate();
384 
385  ui->lpf->setValue(m_settings.m_lpfBW / 1000);
386 
387  ui->lpFIREnable->setChecked(m_settings.m_lpfFIREnable);
388  ui->lpFIR->setValue(m_settings.m_lpfFIRBW / 1000);
389 
390  ui->gain->setValue(m_settings.m_gain);
391  ui->gainText->setText(tr("%1").arg(m_settings.m_gain));
392 
393  ui->antenna->setCurrentIndex((int) m_settings.m_antennaPath);
394 
395  ui->gainMode->setCurrentIndex((int) m_settings.m_gainMode);
396  ui->lnaGain->setValue(m_settings.m_lnaGain);
397  ui->tiaGain->setCurrentIndex(m_settings.m_tiaGain - 1);
398  ui->pgaGain->setValue(m_settings.m_pgaGain);
399 
401  {
402  ui->gain->setEnabled(true);
403  ui->lnaGain->setEnabled(false);
404  ui->tiaGain->setEnabled(false);
405  ui->pgaGain->setEnabled(false);
406  }
407  else
408  {
409  ui->gain->setEnabled(false);
410  ui->lnaGain->setEnabled(true);
411  ui->tiaGain->setEnabled(true);
412  ui->pgaGain->setEnabled(true);
413  }
414 
415  setNCODisplay();
416 
417  ui->ncoEnable->setChecked(m_settings.m_ncoEnable);
418 }
uint32_t m_tiaGain
Manual TIA gain.
bool m_lpfFIREnable
Enable LMS digital lowpass FIR filters.
bool m_extClock
True if external clock source.
uint32_t m_lnaGain
Manual LAN gain.
uint32_t m_gain
Optimally distributed gain (dB)
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
float m_lpfFIRBW
LMS digital lowpass FIR filters bandwidth (Hz)
Ui::LimeSDRInputGUI * ui
LimeSDRInputSettings m_settings
bool m_ncoEnable
Enable TSP NCO and mixing.
uint32_t m_pgaGain
Manual PGA gain.
float m_lpfBW
LMS amalog lowpass filter bandwidth (Hz)
GainMode m_gainMode
Gain mode: auto or manual.
void setCenterFrequencyDisplay()
uint32_t m_extClockFreq
Frequency (Hz) of external clock source.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCenterFrequency()

qint64 LimeSDRInputGUI::getCenterFrequency ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 127 of file limesdrinputgui.cpp.

References LimeSDRInputSettings::m_centerFrequency, LimeSDRInputSettings::m_ncoEnable, LimeSDRInputSettings::m_ncoFrequency, and m_settings.

128 {
130 }
int m_ncoFrequency
Actual NCO frequency (the resulting frequency with mixing is displayed)
LimeSDRInputSettings m_settings
bool m_ncoEnable
Enable TSP NCO and mixing.

◆ getInputMessageQueue()

virtual MessageQueue* LimeSDRInputGUI::getInputMessageQueue ( )
inlinevirtual

Implements PluginInstanceGUI.

Definition at line 51 of file limesdrinputgui.h.

51 { return &m_inputMessageQueue; }
MessageQueue m_inputMessageQueue

◆ getName()

QString LimeSDRInputGUI::getName ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 115 of file limesdrinputgui.cpp.

116 {
117  return objectName();
118 }

◆ handleInputMessages

void LimeSDRInputGUI::handleInputMessages ( )
privateslot

Definition at line 282 of file limesdrinputgui.cpp.

References displaySettings(), DSPSignalNotification::getCenterFrequency(), DSPSignalNotification::getSampleRate(), LimeSDRInput::MsgConfigureLimeSDR::getSettings(), handleMessage(), m_deviceCenterFrequency, m_inputMessageQueue, m_sampleRate, m_settings, Message::match(), MessageQueue::pop(), and updateSampleRateAndFrequency().

Referenced by LimeSDRInputGUI().

283 {
284  Message* message;
285 
286  while ((message = m_inputMessageQueue.pop()) != 0)
287  {
288  if (DSPSignalNotification::match(*message))
289  {
290  DSPSignalNotification* notif = (DSPSignalNotification*) message;
291  m_sampleRate = notif->getSampleRate();
293  qDebug("LimeSDRInputGUI::handleInputMessages: DSPSignalNotification: SampleRate: %d, CenterFrequency: %llu", notif->getSampleRate(), notif->getCenterFrequency());
295 
296  delete message;
297  }
298  else if (LimeSDRInput::MsgConfigureLimeSDR::match(*message))
299  {
301  m_settings = cfg.getSettings();
302  displaySettings();
303 
304  delete message;
305  }
306  else
307  {
308  if (handleMessage(*message)) {
309  delete message;
310  }
311  }
312  }
313 }
Message * pop()
Pop message from queue.
virtual bool handleMessage(const Message &message)
void updateSampleRateAndFrequency()
qint64 getCenterFrequency() const
Definition: dspcommands.h:329
const LimeSDRInputSettings & getSettings() const
Definition: limesdrinput.h:45
LimeSDRInputSettings m_settings
static bool match(const Message *message)
Definition: message.cpp:45
MessageQueue m_inputMessageQueue
int getSampleRate() const
Definition: dspcommands.h:328
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 LimeSDRInputGUI::handleMessage ( const Message message)
virtual

Implements PluginInstanceGUI.

Definition at line 160 of file limesdrinputgui.cpp.

References arg(), blockApplySettings(), displaySettings(), LimeSDRInput::MsgReportStreamInfo::getActive(), DeviceLimeSDRShared::MsgReportBuddyChange::getCenterFrequency(), DeviceLimeSDRShared::MsgReportBuddyChange::getDevSampleRate(), LimeSDRInput::MsgReportStreamInfo::getDroppedPackets(), DeviceLimeSDRShared::MsgReportClockSourceChange::getExtClock(), DeviceLimeSDRShared::MsgReportClockSourceChange::getExtClockFeq(), LimeSDRInput::MsgReportStreamInfo::getFifoFilledCount(), LimeSDRInput::MsgReportStreamInfo::getFifoSize(), DeviceLimeSDRShared::MsgReportDeviceInfo::getGPIOPins(), LimeSDRInput::MsgReportStreamInfo::getLinkRate(), DeviceLimeSDRShared::MsgReportBuddyChange::getLog2HardDecimInterp(), LimeSDRInput::MsgReportStreamInfo::getOverrun(), DeviceLimeSDRShared::MsgReportBuddyChange::getRxElseTx(), LimeSDRInput::MsgConfigureLimeSDR::getSettings(), LimeSDRInput::MsgStartStop::getStartStop(), LimeSDRInput::MsgReportStreamInfo::getSuccess(), DeviceLimeSDRShared::MsgReportDeviceInfo::getTemperature(), LimeSDRInput::MsgReportStreamInfo::getUnderrun(), LimeSDRInputSettings::m_centerFrequency, LimeSDRInputSettings::m_devSampleRate, LimeSDRInputSettings::m_extClock, LimeSDRInputSettings::m_extClockFreq, LimeSDRInputSettings::m_log2HardDecim, m_settings, Message::match(), and ui.

Referenced by handleInputMessages().

161 {
163  {
165  m_settings = cfg.getSettings();
166  blockApplySettings(true);
167  displaySettings();
168  blockApplySettings(false);
169  return true;
170  }
172  {
176 
177  if (report.getRxElseTx()) {
179  }
180 
181  blockApplySettings(true);
182  displaySettings();
183  blockApplySettings(false);
184 
185  return true;
186  }
188  {
191  m_settings.m_extClock = report.getExtClock();
192 
193  blockApplySettings(true);
194  ui->extClock->setExternalClockFrequency(m_settings.m_extClockFreq);
195  ui->extClock->setExternalClockActive(m_settings.m_extClock);
196  blockApplySettings(false);
197 
198  return true;
199  }
201  {
203 
204  if (report.getSuccess())
205  {
206  if (report.getActive()) {
207  ui->streamStatusLabel->setStyleSheet("QLabel { background-color : green; }");
208  } else {
209  ui->streamStatusLabel->setStyleSheet("QLabel { background-color : blue; }");
210  }
211 
212  ui->streamLinkRateText->setText(tr("%1 MB/s").arg(QString::number(report.getLinkRate() / 1000000.0f, 'f', 3)));
213 
214  if (report.getUnderrun() > 0) {
215  ui->underrunLabel->setStyleSheet("QLabel { background-color : red; }");
216  } else {
217  ui->underrunLabel->setStyleSheet("QLabel { background:rgb(79,79,79); }");
218  }
219 
220  if (report.getOverrun() > 0) {
221  ui->overrunLabel->setStyleSheet("QLabel { background-color : red; }");
222  } else {
223  ui->overrunLabel->setStyleSheet("QLabel { background:rgb(79,79,79); }");
224  }
225 
226  if (report.getDroppedPackets() > 0) {
227  ui->droppedLabel->setStyleSheet("QLabel { background-color : red; }");
228  } else {
229  ui->droppedLabel->setStyleSheet("QLabel { background:rgb(79,79,79); }");
230  }
231 
232  ui->fifoBar->setMaximum(report.getFifoSize());
233  ui->fifoBar->setValue(report.getFifoFilledCount());
234  ui->fifoBar->setToolTip(tr("FIFO fill %1/%2 samples").arg(QString::number(report.getFifoFilledCount())).arg(QString::number(report.getFifoSize())));
235  }
236  else
237  {
238  ui->streamStatusLabel->setStyleSheet("QLabel { background:rgb(79,79,79); }");
239  }
240 
241  return true;
242  }
244  {
246  ui->temperatureText->setText(tr("%1C").arg(QString::number(report.getTemperature(), 'f', 0)));
247  ui->gpioText->setText(tr("%1").arg(report.getGPIOPins(), 2, 16, QChar('0')).toUpper());
248  return true;
249  }
250  else if (LimeSDRInput::MsgStartStop::match(message))
251  {
253  blockApplySettings(true);
254  ui->startStop->setChecked(notif.getStartStop());
255  blockApplySettings(false);
256 
257  return true;
258  }
259  else
260  {
261  return false;
262  }
263 }
bool m_extClock
True if external clock source.
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Ui::LimeSDRInputGUI * ui
const LimeSDRInputSettings & getSettings() const
Definition: limesdrinput.h:45
LimeSDRInputSettings m_settings
static bool match(const Message *message)
Definition: message.cpp:45
void blockApplySettings(bool block)
uint32_t m_extClockFreq
Frequency (Hz) of external clock source.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_antenna_currentIndexChanged

void LimeSDRInputGUI::on_antenna_currentIndexChanged ( int  index)
privateslot

Definition at line 699 of file limesdrinputgui.cpp.

References LimeSDRInputSettings::m_antennaPath, m_settings, and sendSettings().

+ Here is the call graph for this function:

◆ on_centerFrequency_changed

void LimeSDRInputGUI::on_centerFrequency_changed ( quint64  value)
privateslot

Definition at line 560 of file limesdrinputgui.cpp.

References sendSettings(), and setCenterFrequencySetting().

561 {
563  sendSettings();
564 }
void setCenterFrequencySetting(uint64_t kHzValue)
+ Here is the call graph for this function:

◆ on_dcOffset_toggled

void LimeSDRInputGUI::on_dcOffset_toggled ( bool  checked)
privateslot

Definition at line 580 of file limesdrinputgui.cpp.

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

581 {
582  m_settings.m_dcBlock = checked;
583  sendSettings();
584 }
LimeSDRInputSettings m_settings
+ Here is the call graph for this function:

◆ on_extClock_clicked

void LimeSDRInputGUI::on_extClock_clicked ( )
privateslot

Definition at line 705 of file limesdrinputgui.cpp.

References LimeSDRInputSettings::m_extClock, LimeSDRInputSettings::m_extClockFreq, m_settings, sendSettings(), and ui.

706 {
707  m_settings.m_extClock = ui->extClock->getExternalClockActive();
708  m_settings.m_extClockFreq = ui->extClock->getExternalClockFrequency();
709  qDebug("LimeSDRInputGUI::on_extClock_clicked: %u Hz %s", m_settings.m_extClockFreq, m_settings.m_extClock ? "on" : "off");
710  sendSettings();
711 }
bool m_extClock
True if external clock source.
Ui::LimeSDRInputGUI * ui
LimeSDRInputSettings m_settings
uint32_t m_extClockFreq
Frequency (Hz) of external clock source.
+ Here is the call graph for this function:

◆ on_gain_valueChanged

void LimeSDRInputGUI::on_gain_valueChanged ( int  value)
privateslot

Definition at line 672 of file limesdrinputgui.cpp.

References arg(), LimeSDRInputSettings::m_gain, m_settings, sendSettings(), and ui.

673 {
674  m_settings.m_gain = value;
675  ui->gainText->setText(tr("%1").arg(m_settings.m_gain));
676  sendSettings();
677 }
uint32_t m_gain
Optimally distributed gain (dB)
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Ui::LimeSDRInputGUI * ui
LimeSDRInputSettings m_settings
+ Here is the call graph for this function:

◆ on_gainMode_currentIndexChanged

void LimeSDRInputGUI::on_gainMode_currentIndexChanged ( int  index)
privateslot

Definition at line 650 of file limesdrinputgui.cpp.

References LimeSDRInputSettings::m_gainMode, m_settings, sendSettings(), and ui.

651 {
653 
654  if (index == 0)
655  {
656  ui->gain->setEnabled(true);
657  ui->lnaGain->setEnabled(false);
658  ui->tiaGain->setEnabled(false);
659  ui->pgaGain->setEnabled(false);
660  }
661  else
662  {
663  ui->gain->setEnabled(false);
664  ui->lnaGain->setEnabled(true);
665  ui->tiaGain->setEnabled(true);
666  ui->pgaGain->setEnabled(true);
667  }
668 
669  sendSettings();
670 }
Ui::LimeSDRInputGUI * ui
LimeSDRInputSettings m_settings
GainMode m_gainMode
Gain mode: auto or manual.
+ Here is the call graph for this function:

◆ on_hwDecim_currentIndexChanged

void LimeSDRInputGUI::on_hwDecim_currentIndexChanged ( int  index)
privateslot

Definition at line 604 of file limesdrinputgui.cpp.

References LimeSDRInputSettings::m_log2HardDecim, m_settings, sendSettings(), setNCODisplay(), and updateADCRate().

605 {
606  if ((index <0) || (index > 5))
607  return;
608  m_settings.m_log2HardDecim = index;
609  updateADCRate();
610  setNCODisplay();
611  sendSettings();
612 }
LimeSDRInputSettings m_settings
+ Here is the call graph for this function:

◆ on_iqImbalance_toggled

void LimeSDRInputGUI::on_iqImbalance_toggled ( bool  checked)
privateslot

Definition at line 586 of file limesdrinputgui.cpp.

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

587 {
588  m_settings.m_iqCorrection = checked;
589  sendSettings();
590 }
LimeSDRInputSettings m_settings
+ Here is the call graph for this function:

◆ on_lnaGain_valueChanged

void LimeSDRInputGUI::on_lnaGain_valueChanged ( int  value)
privateslot

Definition at line 679 of file limesdrinputgui.cpp.

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

680 {
681  m_settings.m_lnaGain = value;
682  ui->lnaGainText->setText(tr("%1").arg(m_settings.m_lnaGain));
683  sendSettings();
684 }
uint32_t m_lnaGain
Manual LAN gain.
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Ui::LimeSDRInputGUI * ui
LimeSDRInputSettings m_settings
+ Here is the call graph for this function:

◆ on_lpf_changed

void LimeSDRInputGUI::on_lpf_changed ( quint64  value)
privateslot

Definition at line 632 of file limesdrinputgui.cpp.

References LimeSDRInputSettings::m_lpfBW, m_settings, and sendSettings().

633 {
634  m_settings.m_lpfBW = value * 1000;
635  sendSettings();
636 }
LimeSDRInputSettings m_settings
float m_lpfBW
LMS amalog lowpass filter bandwidth (Hz)
+ Here is the call graph for this function:

◆ on_lpFIR_changed

void LimeSDRInputGUI::on_lpFIR_changed ( quint64  value)
privateslot

Definition at line 644 of file limesdrinputgui.cpp.

References LimeSDRInputSettings::m_lpfFIRBW, m_settings, and sendSettings().

645 {
646  m_settings.m_lpfFIRBW = value * 1000;
647  sendSettings();
648 }
float m_lpfFIRBW
LMS digital lowpass FIR filters bandwidth (Hz)
LimeSDRInputSettings m_settings
+ Here is the call graph for this function:

◆ on_lpFIREnable_toggled

void LimeSDRInputGUI::on_lpFIREnable_toggled ( bool  checked)
privateslot

Definition at line 638 of file limesdrinputgui.cpp.

References LimeSDRInputSettings::m_lpfFIREnable, m_settings, and sendSettings().

639 {
640  m_settings.m_lpfFIREnable = checked;
641  sendSettings();
642 }
bool m_lpfFIREnable
Enable LMS digital lowpass FIR filters.
LimeSDRInputSettings m_settings
+ Here is the call graph for this function:

◆ on_ncoEnable_toggled

void LimeSDRInputGUI::on_ncoEnable_toggled ( bool  checked)
privateslot

Definition at line 573 of file limesdrinputgui.cpp.

References LimeSDRInputSettings::m_ncoEnable, m_settings, sendSettings(), and setCenterFrequencyDisplay().

574 {
575  m_settings.m_ncoEnable = checked;
577  sendSettings();
578 }
LimeSDRInputSettings m_settings
bool m_ncoEnable
Enable TSP NCO and mixing.
void setCenterFrequencyDisplay()
+ Here is the call graph for this function:

◆ on_ncoFrequency_changed

void LimeSDRInputGUI::on_ncoFrequency_changed ( qint64  value)
privateslot

Definition at line 566 of file limesdrinputgui.cpp.

References LimeSDRInputSettings::m_ncoFrequency, m_settings, sendSettings(), and setCenterFrequencyDisplay().

567 {
568  m_settings.m_ncoFrequency = value;
570  sendSettings();
571 }
int m_ncoFrequency
Actual NCO frequency (the resulting frequency with mixing is displayed)
LimeSDRInputSettings m_settings
void setCenterFrequencyDisplay()
+ Here is the call graph for this function:

◆ on_pgaGain_valueChanged

void LimeSDRInputGUI::on_pgaGain_valueChanged ( int  value)
privateslot

Definition at line 692 of file limesdrinputgui.cpp.

References arg(), LimeSDRInputSettings::m_pgaGain, m_settings, sendSettings(), and ui.

693 {
694  m_settings.m_pgaGain = value;
695  ui->pgaGainText->setText(tr("%1").arg(m_settings.m_pgaGain));
696  sendSettings();
697 }
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Ui::LimeSDRInputGUI * ui
LimeSDRInputSettings m_settings
uint32_t m_pgaGain
Manual PGA gain.
+ Here is the call graph for this function:

◆ on_record_toggled

void LimeSDRInputGUI::on_record_toggled ( bool  checked)
privateslot

Definition at line 548 of file limesdrinputgui.cpp.

References LimeSDRInput::MsgFileRecord::create(), DeviceSampleSource::getInputMessageQueue(), m_limeSDRInput, MessageQueue::push(), and ui.

549 {
550  if (checked) {
551  ui->record->setStyleSheet("QToolButton { background-color : red; }");
552  } else {
553  ui->record->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
554  }
555 
558 }
LimeSDRInput * m_limeSDRInput
Same object as above but gives easy access to LimeSDRInput methods and attributes that are used inten...
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
Ui::LimeSDRInputGUI * ui
static MsgFileRecord * create(bool startStop)
Definition: limesdrinput.h:175
+ Here is the call graph for this function:

◆ on_sampleRate_changed

void LimeSDRInputGUI::on_sampleRate_changed ( quint64  value)
privateslot

Definition at line 592 of file limesdrinputgui.cpp.

References LimeSDRInputSettings::m_devSampleRate, LimeSDRInputSettings::m_log2SoftDecim, m_sampleRateMode, m_settings, sendSettings(), setNCODisplay(), and updateADCRate().

593 {
594  if (m_sampleRateMode) {
595  m_settings.m_devSampleRate = value;
596  } else {
598  }
599 
600  updateADCRate();
601  setNCODisplay();
602  sendSettings();}
bool m_sampleRateMode
true: device, false: base band sample rate update mode
LimeSDRInputSettings m_settings
+ Here is the call graph for this function:

◆ on_sampleRateMode_toggled

void LimeSDRInputGUI::on_sampleRateMode_toggled ( bool  checked)
privateslot

Definition at line 723 of file limesdrinputgui.cpp.

References displaySampleRate(), and m_sampleRateMode.

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

◆ on_startStop_toggled

void LimeSDRInputGUI::on_startStop_toggled ( bool  checked)
privateslot

Definition at line 539 of file limesdrinputgui.cpp.

References LimeSDRInput::MsgStartStop::create(), DeviceSampleSource::getInputMessageQueue(), m_doApplySettings, m_limeSDRInput, and MessageQueue::push().

540 {
541  if (m_doApplySettings)
542  {
545  }
546 }
LimeSDRInput * m_limeSDRInput
Same object as above but gives easy access to LimeSDRInput methods and attributes that are used inten...
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
static MsgStartStop * create(bool startStop)
Definition: limesdrinput.h:194
+ Here is the call graph for this function:

◆ on_swDecim_currentIndexChanged

void LimeSDRInputGUI::on_swDecim_currentIndexChanged ( int  index)
privateslot

Definition at line 614 of file limesdrinputgui.cpp.

References displaySampleRate(), LimeSDRInputSettings::m_devSampleRate, LimeSDRInputSettings::m_log2SoftDecim, m_sampleRateMode, m_settings, sendSettings(), and ui.

615 {
616  if ((index <0) || (index > 6)) {
617  return;
618  }
619 
620  m_settings.m_log2SoftDecim = index;
622 
623  if (m_sampleRateMode) {
624  m_settings.m_devSampleRate = ui->sampleRate->getValueNew();
625  } else {
626  m_settings.m_devSampleRate = ui->sampleRate->getValueNew() * (1 << m_settings.m_log2SoftDecim);
627  }
628 
629  sendSettings();
630 }
bool m_sampleRateMode
true: device, false: base band sample rate update mode
Ui::LimeSDRInputGUI * ui
LimeSDRInputSettings m_settings
+ Here is the call graph for this function:

◆ on_tiaGain_currentIndexChanged

void LimeSDRInputGUI::on_tiaGain_currentIndexChanged ( int  index)
privateslot

Definition at line 686 of file limesdrinputgui.cpp.

References m_settings, LimeSDRInputSettings::m_tiaGain, and sendSettings().

687 {
688  m_settings.m_tiaGain = index + 1;
689  sendSettings();
690 }
uint32_t m_tiaGain
Manual TIA gain.
LimeSDRInputSettings m_settings
+ Here is the call graph for this function:

◆ on_transverter_clicked

void LimeSDRInputGUI::on_transverter_clicked ( )
privateslot

Definition at line 713 of file limesdrinputgui.cpp.

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

714 {
715  m_settings.m_transverterMode = ui->transverter->getDeltaFrequencyAcive();
716  m_settings.m_transverterDeltaFrequency = ui->transverter->getDeltaFrequency();
717  qDebug("LimeSDRInputGUI::on_transverter_clicked: %lld Hz %s", m_settings.m_transverterDeltaFrequency, m_settings.m_transverterMode ? "on" : "off");
719  setCenterFrequencySetting(ui->centerFrequency->getValueNew());
720  sendSettings();
721 }
void setCenterFrequencySetting(uint64_t kHzValue)
Ui::LimeSDRInputGUI * ui
LimeSDRInputSettings m_settings
+ Here is the call graph for this function:

◆ openDeviceSettingsDialog

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

Definition at line 729 of file limesdrinputgui.cpp.

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

Referenced by LimeSDRInputGUI().

730 {
731  BasicDeviceSettingsDialog dialog(this);
732  dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
733  dialog.setReverseAPIAddress(m_settings.m_reverseAPIAddress);
734  dialog.setReverseAPIPort(m_settings.m_reverseAPIPort);
735  dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex);
736 
737  dialog.move(p);
738  dialog.exec();
739 
740  m_settings.m_useReverseAPI = dialog.useReverseAPI();
741  m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress();
742  m_settings.m_reverseAPIPort = dialog.getReverseAPIPort();
743  m_settings.m_reverseAPIDeviceIndex = dialog.getReverseAPIDeviceIndex();
744 
745  sendSettings();
746 }
LimeSDRInputSettings m_settings
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetToDefaults()

void LimeSDRInputGUI::resetToDefaults ( )
virtual

Implements PluginInstanceGUI.

Definition at line 120 of file limesdrinputgui.cpp.

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

Referenced by deserialize().

121 {
123  displaySettings();
124  sendSettings();
125 }
LimeSDRInputSettings m_settings
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendSettings()

void LimeSDRInputGUI::sendSettings ( )
private

◆ serialize()

QByteArray LimeSDRInputGUI::serialize ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 139 of file limesdrinputgui.cpp.

References m_settings, and LimeSDRInputSettings::serialize().

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

◆ setCenterFrequency()

void LimeSDRInputGUI::setCenterFrequency ( qint64  centerFrequency)
virtual

Implements PluginInstanceGUI.

Definition at line 132 of file limesdrinputgui.cpp.

References displaySettings(), LimeSDRInputSettings::m_centerFrequency, LimeSDRInputSettings::m_ncoEnable, LimeSDRInputSettings::m_ncoFrequency, m_settings, and sendSettings().

133 {
135  displaySettings();
136  sendSettings();
137 }
int m_ncoFrequency
Actual NCO frequency (the resulting frequency with mixing is displayed)
LimeSDRInputSettings m_settings
bool m_ncoEnable
Enable TSP NCO and mixing.
+ Here is the call graph for this function:

◆ setCenterFrequencyDisplay()

void LimeSDRInputGUI::setCenterFrequencyDisplay ( )
private

Definition at line 435 of file limesdrinputgui.cpp.

References arg(), LimeSDRInputSettings::m_centerFrequency, LimeSDRInputSettings::m_ncoEnable, LimeSDRInputSettings::m_ncoFrequency, m_settings, and ui.

Referenced by displaySettings(), on_ncoEnable_toggled(), and on_ncoFrequency_changed().

436 {
437  int64_t centerFrequency = m_settings.m_centerFrequency;
438  ui->centerFrequency->setToolTip(QString("Main center frequency in kHz (LO: %1 kHz)").arg(centerFrequency/1000));
439 
440  if (m_settings.m_ncoEnable) {
441  centerFrequency += m_settings.m_ncoFrequency;
442  }
443 
444  ui->centerFrequency->blockSignals(true);
445  ui->centerFrequency->setValue(centerFrequency < 0 ? 0 : (uint64_t) centerFrequency/1000); // kHz
446  ui->centerFrequency->blockSignals(false);
447 }
int m_ncoFrequency
Actual NCO frequency (the resulting frequency with mixing is displayed)
__int64 int64_t
Definition: rtptypes_win.h:47
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Ui::LimeSDRInputGUI * ui
LimeSDRInputSettings m_settings
bool m_ncoEnable
Enable TSP NCO and mixing.
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:

◆ setCenterFrequencySetting()

void LimeSDRInputGUI::setCenterFrequencySetting ( uint64_t  kHzValue)
private

Definition at line 449 of file limesdrinputgui.cpp.

References arg(), LimeSDRInputSettings::m_centerFrequency, LimeSDRInputSettings::m_ncoEnable, LimeSDRInputSettings::m_ncoFrequency, m_settings, and ui.

Referenced by on_centerFrequency_changed(), and on_transverter_clicked().

450 {
451  int64_t centerFrequency = kHzValue*1000;
452 
453  if (m_settings.m_ncoEnable) {
454  centerFrequency -= m_settings.m_ncoFrequency;
455  }
456 
457  m_settings.m_centerFrequency = centerFrequency < 0 ? 0 : (uint64_t) centerFrequency;
458  ui->centerFrequency->setToolTip(QString("Main center frequency in kHz (LO: %1 kHz)").arg(centerFrequency/1000));
459 }
int m_ncoFrequency
Actual NCO frequency (the resulting frequency with mixing is displayed)
__int64 int64_t
Definition: rtptypes_win.h:47
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Ui::LimeSDRInputGUI * ui
LimeSDRInputSettings m_settings
bool m_ncoEnable
Enable TSP NCO and mixing.
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 LimeSDRInputGUI::setName ( const QString &  name)
virtual

Implements PluginInstanceGUI.

Definition at line 110 of file limesdrinputgui.cpp.

111 {
112  setObjectName(name);
113 }

◆ setNCODisplay()

void LimeSDRInputGUI::setNCODisplay ( )
private

Definition at line 420 of file limesdrinputgui.cpp.

References arg(), LimeSDRInputSettings::m_devSampleRate, LimeSDRInputSettings::m_log2HardDecim, LimeSDRInputSettings::m_ncoFrequency, m_settings, and ui.

Referenced by displaySettings(), on_hwDecim_currentIndexChanged(), and on_sampleRate_changed().

421 {
422  int ncoHalfRange = (m_settings.m_devSampleRate * (1<<(m_settings.m_log2HardDecim)))/2;
423  ui->ncoFrequency->setValueRange(
424  false,
425  8,
426  -ncoHalfRange,
427  ncoHalfRange);
428 
429  ui->ncoFrequency->blockSignals(true);
430  ui->ncoFrequency->setToolTip(QString("NCO frequency shift in Hz (Range: +/- %1 kHz)").arg(ncoHalfRange/1000));
431  ui->ncoFrequency->setValue(m_settings.m_ncoFrequency);
432  ui->ncoFrequency->blockSignals(false);
433 }
int m_ncoFrequency
Actual NCO frequency (the resulting frequency with mixing is displayed)
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Ui::LimeSDRInputGUI * ui
LimeSDRInputSettings m_settings
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateADCRate()

void LimeSDRInputGUI::updateADCRate ( )
private

Definition at line 315 of file limesdrinputgui.cpp.

References arg(), LimeSDRInputSettings::m_devSampleRate, LimeSDRInputSettings::m_log2HardDecim, m_settings, and ui.

Referenced by displaySettings(), on_hwDecim_currentIndexChanged(), and on_sampleRate_changed().

316 {
318 
319  if (adcRate < 100000000) {
320  ui->adcRateLabel->setText(tr("%1k").arg(QString::number(adcRate / 1000.0f, 'g', 5)));
321  } else {
322  ui->adcRateLabel->setText(tr("%1M").arg(QString::number(adcRate / 1000000.0f, 'g', 5)));
323  }
324 }
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::LimeSDRInputGUI * ui
LimeSDRInputSettings m_settings
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateFrequencyLimits()

void LimeSDRInputGUI::updateFrequencyLimits ( )
private

Definition at line 265 of file limesdrinputgui.cpp.

References LimeSDRInput::getLORange(), m_limeSDRInput, m_settings, LimeSDRInputSettings::m_transverterDeltaFrequency, LimeSDRInputSettings::m_transverterMode, and ui.

Referenced by on_transverter_clicked().

266 {
267  // values in kHz
268  float minF, maxF;
269  qint64 deltaFrequency = m_settings.m_transverterMode ? m_settings.m_transverterDeltaFrequency/1000 : 0;
270  m_limeSDRInput->getLORange(minF, maxF);
271  qint64 minLimit = minF/1000 + deltaFrequency;
272  qint64 maxLimit = maxF/1000 + deltaFrequency;
273 
274  minLimit = minLimit < 0 ? 0 : minLimit > 9999999 ? 9999999 : minLimit;
275  maxLimit = maxLimit < 0 ? 0 : maxLimit > 9999999 ? 9999999 : maxLimit;
276 
277  qDebug("LimeSDRInputGUI::updateFrequencyLimits: delta: %lld min: %lld max: %lld", deltaFrequency, minLimit, maxLimit);
278 
279  ui->centerFrequency->setValueRange(7, minLimit, maxLimit);
280 }
LimeSDRInput * m_limeSDRInput
Same object as above but gives easy access to LimeSDRInput methods and attributes that are used inten...
Ui::LimeSDRInputGUI * ui
void getLORange(float &minF, float &maxF) const
LimeSDRInputSettings m_settings
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateHardware

void LimeSDRInputGUI::updateHardware ( )
privateslot

Definition at line 467 of file limesdrinputgui.cpp.

References LimeSDRInput::MsgConfigureLimeSDR::create(), DeviceSampleSource::getInputMessageQueue(), m_doApplySettings, m_forceSettings, m_limeSDRInput, m_settings, m_updateTimer, and MessageQueue::push().

Referenced by LimeSDRInputGUI().

468 {
469  if (m_doApplySettings)
470  {
471  qDebug() << "LimeSDRInputGUI::updateHardware";
474  m_forceSettings = false;
475  m_updateTimer.stop();
476  }
477 }
LimeSDRInput * m_limeSDRInput
Same object as above but gives easy access to LimeSDRInput methods and attributes that are used inten...
static MsgConfigureLimeSDR * create(const LimeSDRInputSettings &settings, bool force)
Definition: limesdrinput.h:48
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
LimeSDRInputSettings m_settings
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateSampleRateAndFrequency()

void LimeSDRInputGUI::updateSampleRateAndFrequency ( )
private

Definition at line 326 of file limesdrinputgui.cpp.

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

Referenced by handleInputMessages().

327 {
331 }
void setSampleRate(qint32 sampleRate)
Definition: glspectrum.cpp:211
DeviceUISet * m_deviceUISet
GLSpectrum * getSpectrum()
Direct spectrum getter.
Definition: deviceuiset.h:57
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 LimeSDRInputGUI::updateStatus ( )
privateslot

Definition at line 479 of file limesdrinputgui.cpp.

References LimeSDRInput::MsgGetStreamInfo::create(), LimeSDRInput::MsgGetDeviceInfo::create(), DeviceAPI::errorMessage(), DeviceSampleSource::getInputMessageQueue(), DeviceAPI::isBuddyLeader(), DeviceUISet::m_deviceAPI, m_deviceStatusCounter, m_deviceUISet, m_lastEngineState, m_limeSDRInput, m_statusCounter, MessageQueue::push(), DeviceAPI::state(), DeviceAPI::StError, DeviceAPI::StIdle, DeviceAPI::StNotStarted, DeviceAPI::StRunning, and ui.

Referenced by LimeSDRInputGUI().

480 {
481  int state = m_deviceUISet->m_deviceAPI->state();
482 
483  if(m_lastEngineState != state)
484  {
485  switch(state)
486  {
488  ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
489  break;
490  case DeviceAPI::StIdle:
491  ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
492  break;
494  ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
495  break;
496  case DeviceAPI::StError:
497  ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
498  QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
499  break;
500  default:
501  break;
502  }
503 
504  m_lastEngineState = state;
505  }
506 
507  if (m_statusCounter < 1)
508  {
509  m_statusCounter++;
510  }
511  else
512  {
515  m_statusCounter = 0;
516  }
517 
518  if (m_deviceStatusCounter < 10)
519  {
521  }
522  else
523  {
525  {
528  }
529 
531  }
532 }
LimeSDRInput * m_limeSDRInput
Same object as above but gives easy access to LimeSDRInput methods and attributes that are used inten...
void push(Message *message, bool emitSignal=true)
Push message onto queue.
static MsgGetDeviceInfo * create()
Definition: limesdrinput.h:83
bool isBuddyLeader() const
Definition: deviceapi.h:163
DeviceUISet * m_deviceUISet
MessageQueue * getInputMessageQueue()
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
Ui::LimeSDRInputGUI * ui
engine is running
Definition: deviceapi.h:56
engine is in error
Definition: deviceapi.h:57
static MsgGetStreamInfo * create()
Definition: limesdrinput.h:68
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_deviceCenterFrequency

quint64 LimeSDRInputGUI::m_deviceCenterFrequency
private

Center frequency in device.

Definition at line 64 of file limesdrinputgui.h.

Referenced by handleInputMessages(), and updateSampleRateAndFrequency().

◆ m_deviceStatusCounter

int LimeSDRInputGUI::m_deviceStatusCounter
private

Definition at line 69 of file limesdrinputgui.h.

Referenced by updateStatus().

◆ m_deviceUISet

DeviceUISet* LimeSDRInputGUI::m_deviceUISet
private

Definition at line 57 of file limesdrinputgui.h.

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

◆ m_doApplySettings

bool LimeSDRInputGUI::m_doApplySettings
private

Definition at line 66 of file limesdrinputgui.h.

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

◆ m_forceSettings

bool LimeSDRInputGUI::m_forceSettings
private

Definition at line 67 of file limesdrinputgui.h.

Referenced by deserialize(), and updateHardware().

◆ m_inputMessageQueue

MessageQueue LimeSDRInputGUI::m_inputMessageQueue
private

Definition at line 70 of file limesdrinputgui.h.

Referenced by handleInputMessages(), and LimeSDRInputGUI().

◆ m_lastEngineState

int LimeSDRInputGUI::m_lastEngineState
private

Definition at line 65 of file limesdrinputgui.h.

Referenced by updateStatus().

◆ m_limeSDRInput

LimeSDRInput* LimeSDRInputGUI::m_limeSDRInput
private

Same object as above but gives easy access to LimeSDRInput methods and attributes that are used intensively.

Definition at line 58 of file limesdrinputgui.h.

Referenced by displaySampleRate(), LimeSDRInputGUI(), on_record_toggled(), on_startStop_toggled(), updateFrequencyLimits(), updateHardware(), and updateStatus().

◆ m_sampleRate

int LimeSDRInputGUI::m_sampleRate
private

Definition at line 63 of file limesdrinputgui.h.

Referenced by handleInputMessages(), and updateSampleRateAndFrequency().

◆ m_sampleRateMode

bool LimeSDRInputGUI::m_sampleRateMode
private

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

Definition at line 60 of file limesdrinputgui.h.

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

◆ m_settings

LimeSDRInputSettings LimeSDRInputGUI::m_settings
private

◆ m_statusCounter

int LimeSDRInputGUI::m_statusCounter
private

Definition at line 68 of file limesdrinputgui.h.

Referenced by updateStatus().

◆ m_statusTimer

QTimer LimeSDRInputGUI::m_statusTimer
private

Definition at line 62 of file limesdrinputgui.h.

Referenced by LimeSDRInputGUI().

◆ m_updateTimer

QTimer LimeSDRInputGUI::m_updateTimer
private

Definition at line 61 of file limesdrinputgui.h.

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

◆ ui

Ui::LimeSDRInputGUI* LimeSDRInputGUI::ui
private

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