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

#include <xtrxinputgui.h>

+ Inheritance diagram for XTRXInputGUI:
+ Collaboration diagram for XTRXInputGUI:

Public Member Functions

 XTRXInputGUI (DeviceUISet *deviceUISet, QWidget *parent=0)
 
virtual ~XTRXInputGUI ()
 
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_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_pwrmode_currentIndexChanged (int index)
 
void on_sampleRateMode_toggled (bool checked)
 
void updateHardware ()
 
void updateStatus ()
 
void openDeviceSettingsDialog (const QPoint &p)
 

Private Member Functions

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

Private Attributes

Ui::XTRXInputGUI * ui
 
DeviceUISetm_deviceUISet
 
XTRXInputm_XTRXInput
 Same object as above but gives easy access to XTRXInput methods and attributes that are used intensively. More...
 
XTRXInputSettings 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 36 of file xtrxinputgui.h.

Constructor & Destructor Documentation

◆ XTRXInputGUI()

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

Definition at line 36 of file xtrxinputgui.cpp.

References arg(), displaySettings(), XTRXInput::getChannelIndex(), XTRXInput::getLORange(), XTRXInput::getLPRange(), DeviceAPI::getSampleSource(), XTRXInput::getSRRange(), ColorMapper::GrayGold, ColorMapper::GrayGreenYellow, ColorMapper::GrayYellow, handleInputMessages(), DeviceUISet::m_deviceAPI, m_deviceUISet, m_inputMessageQueue, m_statusTimer, m_updateTimer, m_XTRXInput, openDeviceSettingsDialog(), ui, updateHardware(), and updateStatus().

36  :
37  QWidget(parent),
38  ui(new Ui::XTRXInputGUI),
39  m_deviceUISet(deviceUISet),
40  m_settings(),
41  m_sampleRateMode(true),
42  m_sampleRate(0),
44  m_doApplySettings(true),
45  m_forceSettings(true),
46  m_statusCounter(0),
48 {
50 
51  ui->setupUi(this);
52 
53  float minF, maxF, stepF;
54 
55  m_XTRXInput->getLORange(minF, maxF, stepF);
56  ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
57  ui->centerFrequency->setValueRange(7, ((uint32_t) minF)/1000, ((uint32_t) maxF)/1000); // frequency dial is in kHz
58 
59  m_XTRXInput->getSRRange(minF, maxF, stepF);
60  ui->sampleRate->setColorMapper(ColorMapper(ColorMapper::GrayGreenYellow));
61  ui->sampleRate->setValueRange(8, (uint32_t) minF, (uint32_t) maxF);
62 
63  m_XTRXInput->getLPRange(minF, maxF, stepF);
64  ui->lpf->setColorMapper(ColorMapper(ColorMapper::GrayYellow));
65  ui->lpf->setValueRange(6, (minF/1000)+1, maxF/1000);
66 
67  ui->ncoFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
68 
69  ui->channelNumberText->setText(tr("#%1").arg(m_XTRXInput->getChannelIndex()));
70 
71  connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware()));
72  connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus()));
73  m_statusTimer.start(500);
74 
75  CRightClickEnabler *startStopRightClickEnabler = new CRightClickEnabler(ui->startStop);
76  connect(startStopRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(openDeviceSettingsDialog(const QPoint &)));
77 
79 
80  connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection);
81 }
QTimer m_statusTimer
Definition: xtrxinputgui.h:63
DeviceSampleSource * getSampleSource()
Return pointer to the device sample source (single Rx) or nullptr.
Definition: deviceapi.cpp:213
void getLORange(float &minF, float &maxF, float &stepF) const
Definition: xtrxinput.cpp:576
void handleInputMessages()
void getLPRange(float &minF, float &maxF, float &stepF) const
Definition: xtrxinput.cpp:594
MessageQueue m_inputMessageQueue
Definition: xtrxinputgui.h:71
QTimer m_updateTimer
Definition: xtrxinputgui.h:62
XTRXInput * m_XTRXInput
Same object as above but gives easy access to XTRXInput methods and attributes that are used intensiv...
Definition: xtrxinputgui.h:59
XTRXInputSettings m_settings
Definition: xtrxinputgui.h:60
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
bool m_doApplySettings
Definition: xtrxinputgui.h:67
DeviceUISet * m_deviceUISet
Definition: xtrxinputgui.h:58
bool m_forceSettings
Definition: xtrxinputgui.h:68
void updateHardware()
int m_lastEngineState
Definition: xtrxinputgui.h:66
void updateStatus()
void openDeviceSettingsDialog(const QPoint &p)
int m_statusCounter
Definition: xtrxinputgui.h:69
void displaySettings()
void getSRRange(float &minF, float &maxF, float &stepF) const
Definition: xtrxinput.cpp:585
std::size_t getChannelIndex()
Definition: xtrxinput.cpp:571
int m_deviceStatusCounter
Definition: xtrxinputgui.h:70
Ui::XTRXInputGUI * ui
Definition: xtrxinputgui.h:56
bool m_sampleRateMode
true: device, false: base band sample rate update mode
Definition: xtrxinputgui.h:61
+ Here is the call graph for this function:

◆ ~XTRXInputGUI()

XTRXInputGUI::~XTRXInputGUI ( )
virtual

Definition at line 83 of file xtrxinputgui.cpp.

References ui.

84 {
85  delete ui;
86 }
Ui::XTRXInputGUI * ui
Definition: xtrxinputgui.h:56

Member Function Documentation

◆ blockApplySettings()

void XTRXInputGUI::blockApplySettings ( bool  block)
private

Definition at line 480 of file xtrxinputgui.cpp.

References m_doApplySettings.

Referenced by handleMessage().

481 {
482  m_doApplySettings = !block;
483 }
bool m_doApplySettings
Definition: xtrxinputgui.h:67
+ Here is the caller graph for this function:

◆ deserialize()

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

Implements PluginInstanceGUI.

Definition at line 127 of file xtrxinputgui.cpp.

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

128 {
129  if (m_settings.deserialize(data))
130  {
131  displaySettings();
132  m_forceSettings = true;
133  sendSettings();
134  return true;
135  }
136  else
137  {
138  resetToDefaults();
139  return false;
140  }
141 }
void resetToDefaults()
bool deserialize(const QByteArray &data)
XTRXInputSettings m_settings
Definition: xtrxinputgui.h:60
bool m_forceSettings
Definition: xtrxinputgui.h:68
void sendSettings()
void displaySettings()
+ Here is the call graph for this function:

◆ destroy()

void XTRXInputGUI::destroy ( )
virtual

Implements PluginInstanceGUI.

Definition at line 88 of file xtrxinputgui.cpp.

89 {
90  delete this;
91 }

◆ displaySampleRate()

void XTRXInputGUI::displaySampleRate ( )
private

Definition at line 285 of file xtrxinputgui.cpp.

References arg(), XTRXInput::getSRRange(), XTRXInputSettings::m_devSampleRate, XTRXInputSettings::m_log2SoftDecim, m_sampleRateMode, m_settings, m_XTRXInput, and ui.

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

286 {
287  float minF, maxF, stepF;
288  m_XTRXInput->getSRRange(minF, maxF, stepF);
289 
290  ui->sampleRate->blockSignals(true);
291 
292  if (m_sampleRateMode)
293  {
294  ui->sampleRateMode->setStyleSheet("QToolButton { background:rgb(60,60,60); }");
295  ui->sampleRateMode->setText("SR");
296  ui->sampleRate->setValueRange(8, (uint32_t) minF, (uint32_t) maxF);
297  ui->sampleRate->setValue(m_settings.m_devSampleRate);
298  ui->sampleRate->setToolTip("Device to host sample rate (S/s)");
299  ui->deviceRateText->setToolTip("Baseband sample rate (S/s)");
301  ui->deviceRateText->setText(tr("%1k").arg(QString::number(basebandSampleRate / 1000.0f, 'g', 5)));
302  }
303  else
304  {
305  ui->sampleRateMode->setStyleSheet("QToolButton { background:rgb(50,50,50); }");
306  ui->sampleRateMode->setText("BB");
307  ui->sampleRate->setValueRange(8, (uint32_t) minF/(1<<m_settings.m_log2SoftDecim), (uint32_t) maxF/(1<<m_settings.m_log2SoftDecim));
308  ui->sampleRate->setValue(m_settings.m_devSampleRate/(1<<m_settings.m_log2SoftDecim));
309  ui->sampleRate->setToolTip("Baseband sample rate (S/s)");
310  ui->deviceRateText->setToolTip("Device to host sample rate (S/s)");
311  ui->deviceRateText->setText(tr("%1k").arg(QString::number(m_settings.m_devSampleRate / 1000.0f, 'g', 5)));
312  }
313 
314  ui->sampleRate->blockSignals(false);
315 }
XTRXInput * m_XTRXInput
Same object as above but gives easy access to XTRXInput methods and attributes that are used intensiv...
Definition: xtrxinputgui.h:59
XTRXInputSettings m_settings
Definition: xtrxinputgui.h:60
unsigned int uint32_t
Definition: rtptypes_win.h:46
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void getSRRange(float &minF, float &maxF, float &stepF) const
Definition: xtrxinput.cpp:585
Ui::XTRXInputGUI * ui
Definition: xtrxinputgui.h:56
bool m_sampleRateMode
true: device, false: base band sample rate update mode
Definition: xtrxinputgui.h:61
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ displaySettings()

void XTRXInputGUI::displaySettings ( )
private

Definition at line 317 of file xtrxinputgui.cpp.

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

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

318 {
319  ui->extClock->setExternalClockFrequency(m_settings.m_extClockFreq);
320  ui->extClock->setExternalClockActive(m_settings.m_extClock);
321 
324 
325  ui->dcOffset->setChecked(m_settings.m_dcBlock);
326  ui->iqImbalance->setChecked(m_settings.m_iqCorrection);
327 
328  ui->hwDecim->setCurrentIndex(m_settings.m_log2HardDecim);
329  ui->swDecim->setCurrentIndex(m_settings.m_log2SoftDecim);
330 
331  updateADCRate();
332 
333  ui->lpf->setValue(m_settings.m_lpfBW / 1000);
334  ui->pwrmode->setCurrentIndex(m_settings.m_pwrmode);
335 
336  ui->gain->setValue(m_settings.m_gain);
337  ui->gainText->setText(tr("%1").arg(m_settings.m_gain));
338 
339  ui->antenna->setCurrentIndex((int) m_settings.m_antennaPath);
340 
341  ui->gainMode->setCurrentIndex((int) m_settings.m_gainMode);
342  ui->lnaGain->setValue(m_settings.m_lnaGain);
343  ui->tiaGain->setCurrentIndex(m_settings.m_tiaGain - 1);
344  ui->pgaGain->setValue(m_settings.m_pgaGain);
345 
347  {
348  ui->gain->setEnabled(true);
349  ui->lnaGain->setEnabled(false);
350  ui->tiaGain->setEnabled(false);
351  ui->pgaGain->setEnabled(false);
352  }
353  else
354  {
355  ui->gain->setEnabled(false);
356  ui->lnaGain->setEnabled(true);
357  ui->tiaGain->setEnabled(true);
358  ui->pgaGain->setEnabled(true);
359  }
360 
361  setNCODisplay();
362 
363  ui->ncoEnable->setChecked(m_settings.m_ncoEnable);
364 }
bool m_extClock
True if external clock source.
bool m_ncoEnable
Enable TSP NCO and mixing.
void updateADCRate()
void setNCODisplay()
XTRXInputSettings m_settings
Definition: xtrxinputgui.h:60
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
GainMode m_gainMode
Gain mode: auto or manual.
float m_lpfBW
LMS analog lowpass filter bandwidth (Hz)
uint32_t m_gain
Optimally distributed gain (dB)
uint32_t m_extClockFreq
Frequency (Hz) of external clock source.
uint32_t m_tiaGain
Manual TIA gain.
uint32_t m_lnaGain
Manual LNA gain.
Ui::XTRXInputGUI * ui
Definition: xtrxinputgui.h:56
void displaySampleRate()
xtrx_antenna_t m_antennaPath
uint32_t m_pgaGain
Manual PGA gain.
void setCenterFrequencyDisplay()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCenterFrequency()

qint64 XTRXInputGUI::getCenterFrequency ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 110 of file xtrxinputgui.cpp.

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

111 {
113 }
bool m_ncoEnable
Enable TSP NCO and mixing.
int m_ncoFrequency
Actual NCO frequency (the resulting frequency with mixing is displayed)
XTRXInputSettings m_settings
Definition: xtrxinputgui.h:60

◆ getInputMessageQueue()

virtual MessageQueue* XTRXInputGUI::getInputMessageQueue ( )
inlinevirtual

Implements PluginInstanceGUI.

Definition at line 52 of file xtrxinputgui.h.

52 { return &m_inputMessageQueue; }
MessageQueue m_inputMessageQueue
Definition: xtrxinputgui.h:71

◆ getName()

QString XTRXInputGUI::getName ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 98 of file xtrxinputgui.cpp.

99 {
100  return objectName();
101 }

◆ handleInputMessages

void XTRXInputGUI::handleInputMessages ( )
privateslot

Definition at line 233 of file xtrxinputgui.cpp.

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

Referenced by XTRXInputGUI().

234 {
235  Message* message;
236 
237  while ((message = m_inputMessageQueue.pop()) != 0)
238  {
239  if (DSPSignalNotification::match(*message))
240  {
241  DSPSignalNotification* notif = (DSPSignalNotification*) message;
242  m_sampleRate = notif->getSampleRate();
244  qDebug("XTRXInputGUI::handleInputMessages: DSPSignalNotification: SampleRate: %d, CenterFrequency: %llu", notif->getSampleRate(), notif->getCenterFrequency());
246 
247  delete message;
248  }
249  else if (XTRXInput::MsgConfigureXTRX::match(*message))
250  {
251  qDebug("XTRXInputGUI::handleInputMessages: MsgConfigureXTRX");
253  m_settings = cfg.getSettings();
254  displaySettings();
255 
256  delete message;
257  }
258  else
259  {
260  if (handleMessage(*message)) {
261  delete message;
262  }
263  }
264  }
265 }
Message * pop()
Pop message from queue.
void updateSampleRateAndFrequency()
MessageQueue m_inputMessageQueue
Definition: xtrxinputgui.h:71
XTRXInputSettings m_settings
Definition: xtrxinputgui.h:60
qint64 getCenterFrequency() const
Definition: dspcommands.h:329
static bool match(const Message *message)
Definition: message.cpp:45
const XTRXInputSettings & getSettings() const
Definition: xtrxinput.h:46
quint64 m_deviceCenterFrequency
Center frequency in device.
Definition: xtrxinputgui.h:65
void displaySettings()
int getSampleRate() const
Definition: dspcommands.h:328
virtual bool handleMessage(const Message &message)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleMessage()

bool XTRXInputGUI::handleMessage ( const Message message)
virtual

Implements PluginInstanceGUI.

Definition at line 143 of file xtrxinputgui.cpp.

References arg(), blockApplySettings(), displaySettings(), XTRXInput::MsgReportStreamInfo::getActive(), DeviceXTRXShared::MsgReportBuddyChange::getCenterFrequency(), DeviceXTRXShared::MsgReportBuddyChange::getDevSampleRate(), XTRXInput::getDevSampleRate(), DeviceXTRXShared::MsgReportClockSourceChange::getExtClock(), DeviceXTRXShared::MsgReportClockSourceChange::getExtClockFeq(), XTRXInput::MsgReportStreamInfo::getFifoFilledCount(), XTRXInput::MsgReportStreamInfo::getFifoSize(), DeviceXTRXShared::MsgReportDeviceInfo::getGPSLocked(), DeviceXTRXShared::MsgReportBuddyChange::getLog2HardDecimInterp(), DeviceXTRXShared::MsgReportBuddyChange::getRxElseTx(), XTRXInput::MsgStartStop::getStartStop(), XTRXInput::MsgReportStreamInfo::getSuccess(), DeviceXTRXShared::MsgReportDeviceInfo::getTemperature(), XTRXInputSettings::m_centerFrequency, XTRXInputSettings::m_devSampleRate, XTRXInputSettings::m_extClock, XTRXInputSettings::m_extClockFreq, XTRXInputSettings::m_log2HardDecim, m_settings, m_XTRXInput, Message::match(), and ui.

Referenced by handleInputMessages().

144 {
145 
147  {
151 
152  if (report.getRxElseTx()) {
154  }
155 
156  blockApplySettings(true);
157  displaySettings();
158  blockApplySettings(false);
159 
160  return true;
161  }
163  {
166  m_settings.m_extClock = report.getExtClock();
167 
168  blockApplySettings(true);
169  ui->extClock->setExternalClockFrequency(m_settings.m_extClockFreq);
170  ui->extClock->setExternalClockActive(m_settings.m_extClock);
171  blockApplySettings(false);
172 
173  return true;
174  }
176  {
178 
179  blockApplySettings(true);
180  displaySettings();
181  blockApplySettings(false);
182 
183  return true;
184  }
185  else if (XTRXInput::MsgReportStreamInfo::match(message))
186  {
188 
189  if (report.getSuccess())
190  {
191  if (report.getActive()) {
192  ui->streamStatusLabel->setStyleSheet("QLabel { background-color : green; }");
193  } else {
194  ui->streamStatusLabel->setStyleSheet("QLabel { background-color : blue; }");
195  }
196 
197  ui->fifoBar->setMaximum(report.getFifoSize());
198  ui->fifoBar->setValue(report.getFifoFilledCount());
199  ui->fifoBar->setToolTip(tr("FIFO fill %1/%2 samples").arg(QString::number(report.getFifoFilledCount())).arg(QString::number(report.getFifoSize())));
200  }
201  else
202  {
203  ui->streamStatusLabel->setStyleSheet("QLabel { background:rgb(79,79,79); }");
204  }
205 
206  return true;
207  }
209  {
211  ui->temperatureText->setText(tr("%1C").arg(QString::number(report.getTemperature(), 'f', 0)));
212 
213  if (report.getGPSLocked()) {
214  ui->gpsStatusLabel->setStyleSheet("QLabel { background-color : green; }");
215  } else {
216  ui->gpsStatusLabel->setStyleSheet("QLabel { background:rgb(48,48,48); }");
217  }
218 
219  return true;
220  }
221  else if (XTRXInput::MsgStartStop::match(message))
222  {
224  blockApplySettings(true);
225  ui->startStop->setChecked(notif.getStartStop());
226  blockApplySettings(false);
227 
228  return true;
229  }
230  return false;
231 }
bool m_extClock
True if external clock source.
bool getStartStop() const
Definition: xtrxinput.h:159
XTRXInput * m_XTRXInput
Same object as above but gives easy access to XTRXInput methods and attributes that are used intensiv...
Definition: xtrxinputgui.h:59
XTRXInputSettings m_settings
Definition: xtrxinputgui.h:60
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
uint32_t getFifoSize() const
Definition: xtrxinput.h:117
uint32_t m_extClockFreq
Frequency (Hz) of external clock source.
static bool match(const Message *message)
Definition: message.cpp:45
void blockApplySettings(bool block)
void displaySettings()
Ui::XTRXInputGUI * ui
Definition: xtrxinputgui.h:56
uint32_t getDevSampleRate() const
Definition: xtrxinput.cpp:520
uint32_t getFifoFilledCount() const
Definition: xtrxinput.h:116
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_antenna_currentIndexChanged

void XTRXInputGUI::on_antenna_currentIndexChanged ( int  index)
privateslot

Definition at line 633 of file xtrxinputgui.cpp.

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

634 {
635  m_settings.m_antennaPath = (xtrx_antenna_t) index;
636  sendSettings();
637 }
XTRXInputSettings m_settings
Definition: xtrxinputgui.h:60
void sendSettings()
xtrx_antenna_t m_antennaPath
+ Here is the call graph for this function:

◆ on_centerFrequency_changed

void XTRXInputGUI::on_centerFrequency_changed ( quint64  value)
privateslot

Definition at line 506 of file xtrxinputgui.cpp.

References sendSettings(), and setCenterFrequencySetting().

507 {
509  sendSettings();
510 }
void setCenterFrequencySetting(uint64_t kHzValue)
void sendSettings()
+ Here is the call graph for this function:

◆ on_dcOffset_toggled

void XTRXInputGUI::on_dcOffset_toggled ( bool  checked)
privateslot

Definition at line 526 of file xtrxinputgui.cpp.

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

527 {
528  m_settings.m_dcBlock = checked;
529  sendSettings();
530 }
XTRXInputSettings m_settings
Definition: xtrxinputgui.h:60
void sendSettings()
+ Here is the call graph for this function:

◆ on_extClock_clicked

void XTRXInputGUI::on_extClock_clicked ( )
privateslot

Definition at line 639 of file xtrxinputgui.cpp.

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

640 {
641  m_settings.m_extClock = ui->extClock->getExternalClockActive();
642  m_settings.m_extClockFreq = ui->extClock->getExternalClockFrequency();
643  qDebug("XTRXInputGUI::on_extClock_clicked: %u Hz %s", m_settings.m_extClockFreq, m_settings.m_extClock ? "on" : "off");
644  sendSettings();
645 }
bool m_extClock
True if external clock source.
XTRXInputSettings m_settings
Definition: xtrxinputgui.h:60
uint32_t m_extClockFreq
Frequency (Hz) of external clock source.
void sendSettings()
Ui::XTRXInputGUI * ui
Definition: xtrxinputgui.h:56
+ Here is the call graph for this function:

◆ on_gain_valueChanged

void XTRXInputGUI::on_gain_valueChanged ( int  value)
privateslot

Definition at line 606 of file xtrxinputgui.cpp.

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

607 {
608  m_settings.m_gain = value;
609  ui->gainText->setText(tr("%1").arg(m_settings.m_gain));
610  sendSettings();
611 }
XTRXInputSettings m_settings
Definition: xtrxinputgui.h:60
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
uint32_t m_gain
Optimally distributed gain (dB)
void sendSettings()
Ui::XTRXInputGUI * ui
Definition: xtrxinputgui.h:56
+ Here is the call graph for this function:

◆ on_gainMode_currentIndexChanged

void XTRXInputGUI::on_gainMode_currentIndexChanged ( int  index)
privateslot

Definition at line 584 of file xtrxinputgui.cpp.

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

585 {
587 
588  if (index == 0)
589  {
590  ui->gain->setEnabled(true);
591  ui->lnaGain->setEnabled(false);
592  ui->tiaGain->setEnabled(false);
593  ui->pgaGain->setEnabled(false);
594  }
595  else
596  {
597  ui->gain->setEnabled(false);
598  ui->lnaGain->setEnabled(true);
599  ui->tiaGain->setEnabled(true);
600  ui->pgaGain->setEnabled(true);
601  }
602 
603  sendSettings();
604 }
XTRXInputSettings m_settings
Definition: xtrxinputgui.h:60
GainMode m_gainMode
Gain mode: auto or manual.
void sendSettings()
Ui::XTRXInputGUI * ui
Definition: xtrxinputgui.h:56
+ Here is the call graph for this function:

◆ on_hwDecim_currentIndexChanged

void XTRXInputGUI::on_hwDecim_currentIndexChanged ( int  index)
privateslot

Definition at line 550 of file xtrxinputgui.cpp.

References displaySampleRate(), XTRXInputSettings::m_devSampleRate, XTRXInputSettings::m_log2HardDecim, XTRXInputSettings::m_log2SoftDecim, m_sampleRateMode, m_settings, sendSettings(), setNCODisplay(), ui, and updateADCRate().

551 {
552  if ((index <0) || (index > 5))
553  return;
554  m_settings.m_log2HardDecim = index;
556 
557  if (m_sampleRateMode) {
558  m_settings.m_devSampleRate = ui->sampleRate->getValueNew();
559  } else {
560  m_settings.m_devSampleRate = ui->sampleRate->getValueNew() * (1 << m_settings.m_log2SoftDecim);
561  }
562 
563  updateADCRate();
564  setNCODisplay();
565  sendSettings();
566 }
void updateADCRate()
void setNCODisplay()
XTRXInputSettings m_settings
Definition: xtrxinputgui.h:60
void sendSettings()
Ui::XTRXInputGUI * ui
Definition: xtrxinputgui.h:56
void displaySampleRate()
bool m_sampleRateMode
true: device, false: base band sample rate update mode
Definition: xtrxinputgui.h:61
+ Here is the call graph for this function:

◆ on_iqImbalance_toggled

void XTRXInputGUI::on_iqImbalance_toggled ( bool  checked)
privateslot

Definition at line 532 of file xtrxinputgui.cpp.

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

533 {
534  m_settings.m_iqCorrection = checked;
535  sendSettings();
536 }
XTRXInputSettings m_settings
Definition: xtrxinputgui.h:60
void sendSettings()
+ Here is the call graph for this function:

◆ on_lnaGain_valueChanged

void XTRXInputGUI::on_lnaGain_valueChanged ( int  value)
privateslot

Definition at line 613 of file xtrxinputgui.cpp.

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

614 {
615  m_settings.m_lnaGain = value;
616  ui->lnaGainText->setText(tr("%1").arg(m_settings.m_lnaGain));
617  sendSettings();
618 }
XTRXInputSettings m_settings
Definition: xtrxinputgui.h:60
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void sendSettings()
uint32_t m_lnaGain
Manual LNA gain.
Ui::XTRXInputGUI * ui
Definition: xtrxinputgui.h:56
+ Here is the call graph for this function:

◆ on_lpf_changed

void XTRXInputGUI::on_lpf_changed ( quint64  value)
privateslot

Definition at line 578 of file xtrxinputgui.cpp.

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

579 {
580  m_settings.m_lpfBW = value * 1000;
581  sendSettings();
582 }
XTRXInputSettings m_settings
Definition: xtrxinputgui.h:60
float m_lpfBW
LMS analog lowpass filter bandwidth (Hz)
void sendSettings()
+ Here is the call graph for this function:

◆ on_ncoEnable_toggled

void XTRXInputGUI::on_ncoEnable_toggled ( bool  checked)
privateslot

Definition at line 519 of file xtrxinputgui.cpp.

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

520 {
521  m_settings.m_ncoEnable = checked;
523  sendSettings();
524 }
bool m_ncoEnable
Enable TSP NCO and mixing.
XTRXInputSettings m_settings
Definition: xtrxinputgui.h:60
void sendSettings()
void setCenterFrequencyDisplay()
+ Here is the call graph for this function:

◆ on_ncoFrequency_changed

void XTRXInputGUI::on_ncoFrequency_changed ( qint64  value)
privateslot

Definition at line 512 of file xtrxinputgui.cpp.

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

513 {
514  m_settings.m_ncoFrequency = value;
516  sendSettings();
517 }
int m_ncoFrequency
Actual NCO frequency (the resulting frequency with mixing is displayed)
XTRXInputSettings m_settings
Definition: xtrxinputgui.h:60
void sendSettings()
void setCenterFrequencyDisplay()
+ Here is the call graph for this function:

◆ on_pgaGain_valueChanged

void XTRXInputGUI::on_pgaGain_valueChanged ( int  value)
privateslot

Definition at line 626 of file xtrxinputgui.cpp.

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

627 {
628  m_settings.m_pgaGain = value;
629  ui->pgaGainText->setText(tr("%1").arg(m_settings.m_pgaGain));
630  sendSettings();
631 }
XTRXInputSettings m_settings
Definition: xtrxinputgui.h:60
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void sendSettings()
Ui::XTRXInputGUI * ui
Definition: xtrxinputgui.h:56
uint32_t m_pgaGain
Manual PGA gain.
+ Here is the call graph for this function:

◆ on_pwrmode_currentIndexChanged

void XTRXInputGUI::on_pwrmode_currentIndexChanged ( int  index)
privateslot

Definition at line 647 of file xtrxinputgui.cpp.

References XTRXInputSettings::m_pwrmode, m_settings, and sendSettings().

648 {
649  m_settings.m_pwrmode = index;
650  sendSettings();
651 }
XTRXInputSettings m_settings
Definition: xtrxinputgui.h:60
void sendSettings()
+ Here is the call graph for this function:

◆ on_record_toggled

void XTRXInputGUI::on_record_toggled ( bool  checked)
privateslot

Definition at line 494 of file xtrxinputgui.cpp.

References XTRXInput::MsgFileRecord::create(), DeviceSampleSource::getInputMessageQueue(), m_XTRXInput, MessageQueue::push(), and ui.

495 {
496  if (checked) {
497  ui->record->setStyleSheet("QToolButton { background-color : red; }");
498  } else {
499  ui->record->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
500  }
501 
504 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
XTRXInput * m_XTRXInput
Same object as above but gives easy access to XTRXInput methods and attributes that are used intensiv...
Definition: xtrxinputgui.h:59
static MsgFileRecord * create(bool startStop)
Definition: xtrxinput.h:180
Ui::XTRXInputGUI * ui
Definition: xtrxinputgui.h:56
+ Here is the call graph for this function:

◆ on_sampleRate_changed

void XTRXInputGUI::on_sampleRate_changed ( quint64  value)
privateslot

Definition at line 538 of file xtrxinputgui.cpp.

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

539 {
540  if (m_sampleRateMode) {
541  m_settings.m_devSampleRate = value;
542  } else {
544  }
545 
546  updateADCRate();
547  setNCODisplay();
548  sendSettings();}
void updateADCRate()
void setNCODisplay()
XTRXInputSettings m_settings
Definition: xtrxinputgui.h:60
void sendSettings()
bool m_sampleRateMode
true: device, false: base band sample rate update mode
Definition: xtrxinputgui.h:61
+ Here is the call graph for this function:

◆ on_sampleRateMode_toggled

void XTRXInputGUI::on_sampleRateMode_toggled ( bool  checked)
privateslot

Definition at line 653 of file xtrxinputgui.cpp.

References displaySampleRate(), and m_sampleRateMode.

654 {
655  m_sampleRateMode = checked;
657 }
void displaySampleRate()
bool m_sampleRateMode
true: device, false: base band sample rate update mode
Definition: xtrxinputgui.h:61
+ Here is the call graph for this function:

◆ on_startStop_toggled

void XTRXInputGUI::on_startStop_toggled ( bool  checked)
privateslot

Definition at line 485 of file xtrxinputgui.cpp.

References XTRXInput::MsgStartStop::create(), DeviceSampleSource::getInputMessageQueue(), m_doApplySettings, m_XTRXInput, and MessageQueue::push().

486 {
487  if (m_doApplySettings)
488  {
491  }
492 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
XTRXInput * m_XTRXInput
Same object as above but gives easy access to XTRXInput methods and attributes that are used intensiv...
Definition: xtrxinputgui.h:59
bool m_doApplySettings
Definition: xtrxinputgui.h:67
static MsgStartStop * create(bool startStop)
Definition: xtrxinput.h:161
+ Here is the call graph for this function:

◆ on_swDecim_currentIndexChanged

void XTRXInputGUI::on_swDecim_currentIndexChanged ( int  index)
privateslot

Definition at line 568 of file xtrxinputgui.cpp.

References XTRXInputSettings::m_log2SoftDecim, m_settings, and sendSettings().

569 {
570  if ((index <0) || (index > 6)) {
571  return;
572  }
573 
574  m_settings.m_log2SoftDecim = index;
575  sendSettings();
576 }
XTRXInputSettings m_settings
Definition: xtrxinputgui.h:60
void sendSettings()
+ Here is the call graph for this function:

◆ on_tiaGain_currentIndexChanged

void XTRXInputGUI::on_tiaGain_currentIndexChanged ( int  index)
privateslot

Definition at line 620 of file xtrxinputgui.cpp.

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

621 {
622  m_settings.m_tiaGain = index + 1;
623  sendSettings();
624 }
XTRXInputSettings m_settings
Definition: xtrxinputgui.h:60
uint32_t m_tiaGain
Manual TIA gain.
void sendSettings()
+ Here is the call graph for this function:

◆ openDeviceSettingsDialog

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

Definition at line 659 of file xtrxinputgui.cpp.

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

Referenced by XTRXInputGUI().

660 {
661  BasicDeviceSettingsDialog dialog(this);
662  dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
663  dialog.setReverseAPIAddress(m_settings.m_reverseAPIAddress);
664  dialog.setReverseAPIPort(m_settings.m_reverseAPIPort);
665  dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex);
666 
667  dialog.move(p);
668  dialog.exec();
669 
670  m_settings.m_useReverseAPI = dialog.useReverseAPI();
671  m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress();
672  m_settings.m_reverseAPIPort = dialog.getReverseAPIPort();
673  m_settings.m_reverseAPIDeviceIndex = dialog.getReverseAPIDeviceIndex();
674 
675  sendSettings();
676 }
XTRXInputSettings m_settings
Definition: xtrxinputgui.h:60
uint16_t m_reverseAPIDeviceIndex
void sendSettings()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetToDefaults()

void XTRXInputGUI::resetToDefaults ( )
virtual

Implements PluginInstanceGUI.

Definition at line 103 of file xtrxinputgui.cpp.

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

Referenced by deserialize().

104 {
106  displaySettings();
107  sendSettings();
108 }
XTRXInputSettings m_settings
Definition: xtrxinputgui.h:60
void sendSettings()
void displaySettings()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendSettings()

void XTRXInputGUI::sendSettings ( )
private

◆ serialize()

QByteArray XTRXInputGUI::serialize ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 122 of file xtrxinputgui.cpp.

References m_settings, and XTRXInputSettings::serialize().

123 {
124  return m_settings.serialize();
125 }
XTRXInputSettings m_settings
Definition: xtrxinputgui.h:60
QByteArray serialize() const
+ Here is the call graph for this function:

◆ setCenterFrequency()

void XTRXInputGUI::setCenterFrequency ( qint64  centerFrequency)
virtual

Implements PluginInstanceGUI.

Definition at line 115 of file xtrxinputgui.cpp.

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

116 {
118  displaySettings();
119  sendSettings();
120 }
bool m_ncoEnable
Enable TSP NCO and mixing.
int m_ncoFrequency
Actual NCO frequency (the resulting frequency with mixing is displayed)
XTRXInputSettings m_settings
Definition: xtrxinputgui.h:60
void sendSettings()
void displaySettings()
+ Here is the call graph for this function:

◆ setCenterFrequencyDisplay()

void XTRXInputGUI::setCenterFrequencyDisplay ( )
private

Definition at line 381 of file xtrxinputgui.cpp.

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

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

382 {
383  int64_t centerFrequency = m_settings.m_centerFrequency;
384  ui->centerFrequency->setToolTip(QString("Main center frequency in kHz (LO: %1 kHz)").arg(centerFrequency/1000));
385 
386  if (m_settings.m_ncoEnable) {
387  centerFrequency += m_settings.m_ncoFrequency;
388  }
389 
390  ui->centerFrequency->blockSignals(true);
391  ui->centerFrequency->setValue(centerFrequency < 0 ? 0 : (uint64_t) centerFrequency/1000); // kHz
392  ui->centerFrequency->blockSignals(false);
393 }
bool m_ncoEnable
Enable TSP NCO and mixing.
int m_ncoFrequency
Actual NCO frequency (the resulting frequency with mixing is displayed)
__int64 int64_t
Definition: rtptypes_win.h:47
XTRXInputSettings m_settings
Definition: xtrxinputgui.h:60
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Ui::XTRXInputGUI * ui
Definition: xtrxinputgui.h:56
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 XTRXInputGUI::setCenterFrequencySetting ( uint64_t  kHzValue)
private

Definition at line 395 of file xtrxinputgui.cpp.

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

Referenced by on_centerFrequency_changed().

396 {
397  int64_t centerFrequency = kHzValue*1000;
398 
399  if (m_settings.m_ncoEnable) {
400  centerFrequency -= m_settings.m_ncoFrequency;
401  }
402 
403  m_settings.m_centerFrequency = centerFrequency < 0 ? 0 : (uint64_t) centerFrequency;
404  ui->centerFrequency->setToolTip(QString("Main center frequency in kHz (LO: %1 kHz)").arg(centerFrequency/1000));
405 }
bool m_ncoEnable
Enable TSP NCO and mixing.
int m_ncoFrequency
Actual NCO frequency (the resulting frequency with mixing is displayed)
__int64 int64_t
Definition: rtptypes_win.h:47
XTRXInputSettings m_settings
Definition: xtrxinputgui.h:60
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Ui::XTRXInputGUI * ui
Definition: xtrxinputgui.h:56
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 XTRXInputGUI::setName ( const QString &  name)
virtual

Implements PluginInstanceGUI.

Definition at line 93 of file xtrxinputgui.cpp.

94 {
95  setObjectName(name);
96 }

◆ setNCODisplay()

void XTRXInputGUI::setNCODisplay ( )
private

Definition at line 366 of file xtrxinputgui.cpp.

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

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

367 {
368  int ncoHalfRange = (m_settings.m_devSampleRate * (1<<(m_settings.m_log2HardDecim)))/2;
369  ui->ncoFrequency->setValueRange(
370  false,
371  8,
372  -ncoHalfRange,
373  ncoHalfRange);
374 
375  ui->ncoFrequency->blockSignals(true);
376  ui->ncoFrequency->setToolTip(QString("NCO frequency shift in Hz (Range: +/- %1 kHz)").arg(ncoHalfRange/1000));
377  ui->ncoFrequency->setValue(m_settings.m_ncoFrequency);
378  ui->ncoFrequency->blockSignals(false);
379 }
int m_ncoFrequency
Actual NCO frequency (the resulting frequency with mixing is displayed)
XTRXInputSettings m_settings
Definition: xtrxinputgui.h:60
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Ui::XTRXInputGUI * ui
Definition: xtrxinputgui.h:56
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateADCRate()

void XTRXInputGUI::updateADCRate ( )
private

Definition at line 267 of file xtrxinputgui.cpp.

References arg(), XTRXInput::getClockGen(), m_XTRXInput, and ui.

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

268 {
269  uint32_t adcRate = m_XTRXInput->getClockGen() / 4;
270 
271  if (adcRate < 100000000) {
272  ui->adcRateLabel->setText(tr("%1k").arg(QString::number(adcRate / 1000.0f, 'g', 5)));
273  } else {
274  ui->adcRateLabel->setText(tr("%1M").arg(QString::number(adcRate / 1000000.0f, 'g', 5)));
275  }
276 }
double getClockGen() const
Definition: xtrxinput.cpp:542
XTRXInput * m_XTRXInput
Same object as above but gives easy access to XTRXInput methods and attributes that are used intensiv...
Definition: xtrxinputgui.h:59
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::XTRXInputGUI * ui
Definition: xtrxinputgui.h:56
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateHardware

void XTRXInputGUI::updateHardware ( )
privateslot

Definition at line 413 of file xtrxinputgui.cpp.

References XTRXInput::MsgConfigureXTRX::create(), DeviceSampleSource::getInputMessageQueue(), m_doApplySettings, m_forceSettings, m_settings, m_updateTimer, m_XTRXInput, and MessageQueue::push().

Referenced by XTRXInputGUI().

414 {
415  if (m_doApplySettings)
416  {
417  qDebug() << "XTRXInputGUI::updateHardware";
420  m_forceSettings = false;
421  m_updateTimer.stop();
422  }
423 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
static MsgConfigureXTRX * create(const XTRXInputSettings &settings, bool force)
Definition: xtrxinput.h:49
QTimer m_updateTimer
Definition: xtrxinputgui.h:62
XTRXInput * m_XTRXInput
Same object as above but gives easy access to XTRXInput methods and attributes that are used intensiv...
Definition: xtrxinputgui.h:59
XTRXInputSettings m_settings
Definition: xtrxinputgui.h:60
bool m_doApplySettings
Definition: xtrxinputgui.h:67
bool m_forceSettings
Definition: xtrxinputgui.h:68
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateSampleRateAndFrequency()

void XTRXInputGUI::updateSampleRateAndFrequency ( )
private

Definition at line 278 of file xtrxinputgui.cpp.

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

Referenced by handleInputMessages().

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

◆ updateStatus

void XTRXInputGUI::updateStatus ( )
privateslot

Definition at line 425 of file xtrxinputgui.cpp.

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

Referenced by XTRXInputGUI().

426 {
427  int state = m_deviceUISet->m_deviceAPI->state();
428 
429  if(m_lastEngineState != state)
430  {
431  switch(state)
432  {
434  ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
435  break;
436  case DeviceAPI::StIdle:
437  ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
438  break;
440  ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
441  break;
442  case DeviceAPI::StError:
443  ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
444  QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
445  break;
446  default:
447  break;
448  }
449 
450  m_lastEngineState = state;
451  }
452 
453  if (m_statusCounter < 1)
454  {
455  m_statusCounter++;
456  }
457  else
458  {
461  m_statusCounter = 0;
462  }
463 
464  if (m_deviceStatusCounter < 10)
465  {
467  }
468  else
469  {
471  {
474  }
475 
477  }
478 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
bool isBuddyLeader() const
Definition: deviceapi.h:163
MessageQueue * getInputMessageQueue()
static MsgGetStreamInfo * create()
Definition: xtrxinput.h:69
QString errorMessage()
Last error message from the device engine.
Definition: deviceapi.cpp:290
XTRXInput * m_XTRXInput
Same object as above but gives easy access to XTRXInput methods and attributes that are used intensiv...
Definition: xtrxinputgui.h:59
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
Definition: xtrxinputgui.h:58
int m_lastEngineState
Definition: xtrxinputgui.h:66
static MsgGetDeviceInfo * create()
Definition: xtrxinput.h:84
int m_statusCounter
Definition: xtrxinputgui.h:69
engine is running
Definition: deviceapi.h:56
int m_deviceStatusCounter
Definition: xtrxinputgui.h:70
Ui::XTRXInputGUI * ui
Definition: xtrxinputgui.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 XTRXInputGUI::m_deviceCenterFrequency
private

Center frequency in device.

Definition at line 65 of file xtrxinputgui.h.

Referenced by handleInputMessages(), and updateSampleRateAndFrequency().

◆ m_deviceStatusCounter

int XTRXInputGUI::m_deviceStatusCounter
private

Definition at line 70 of file xtrxinputgui.h.

Referenced by updateStatus().

◆ m_deviceUISet

DeviceUISet* XTRXInputGUI::m_deviceUISet
private

Definition at line 58 of file xtrxinputgui.h.

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

◆ m_doApplySettings

bool XTRXInputGUI::m_doApplySettings
private

Definition at line 67 of file xtrxinputgui.h.

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

◆ m_forceSettings

bool XTRXInputGUI::m_forceSettings
private

Definition at line 68 of file xtrxinputgui.h.

Referenced by deserialize(), and updateHardware().

◆ m_inputMessageQueue

MessageQueue XTRXInputGUI::m_inputMessageQueue
private

Definition at line 71 of file xtrxinputgui.h.

Referenced by handleInputMessages(), and XTRXInputGUI().

◆ m_lastEngineState

int XTRXInputGUI::m_lastEngineState
private

Definition at line 66 of file xtrxinputgui.h.

Referenced by updateStatus().

◆ m_sampleRate

int XTRXInputGUI::m_sampleRate
private

Definition at line 64 of file xtrxinputgui.h.

Referenced by handleInputMessages(), and updateSampleRateAndFrequency().

◆ m_sampleRateMode

bool XTRXInputGUI::m_sampleRateMode
private

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

Definition at line 61 of file xtrxinputgui.h.

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

◆ m_settings

XTRXInputSettings XTRXInputGUI::m_settings
private

◆ m_statusCounter

int XTRXInputGUI::m_statusCounter
private

Definition at line 69 of file xtrxinputgui.h.

Referenced by updateStatus().

◆ m_statusTimer

QTimer XTRXInputGUI::m_statusTimer
private

Definition at line 63 of file xtrxinputgui.h.

Referenced by XTRXInputGUI().

◆ m_updateTimer

QTimer XTRXInputGUI::m_updateTimer
private

Definition at line 62 of file xtrxinputgui.h.

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

◆ m_XTRXInput

XTRXInput* XTRXInputGUI::m_XTRXInput
private

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

Definition at line 59 of file xtrxinputgui.h.

Referenced by displaySampleRate(), handleMessage(), on_record_toggled(), on_startStop_toggled(), updateADCRate(), updateHardware(), updateStatus(), and XTRXInputGUI().

◆ ui

Ui::XTRXInputGUI* XTRXInputGUI::ui
private

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