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

#include <plutosdroutputgui.h>

+ Inheritance diagram for PlutoSDROutputGUI:
+ Collaboration diagram for PlutoSDROutputGUI:

Public Member Functions

 PlutoSDROutputGUI (DeviceUISet *deviceUISet, QWidget *parent=0)
 
virtual ~PlutoSDROutputGUI ()
 
virtual void destroy ()
 
virtual void setName (const QString &name)
 
virtual QString getName () const
 
virtual void resetToDefaults ()
 
virtual qint64 getCenterFrequency () const
 
virtual void setCenterFrequency (qint64 centerFrequency)
 
virtual QByteArray serialize () const
 
virtual bool deserialize (const QByteArray &data)
 
virtual MessageQueuegetInputMessageQueue ()
 
virtual bool handleMessage (const Message &message)
 
- Public Member Functions inherited from PluginInstanceGUI
 PluginInstanceGUI ()
 
virtual ~PluginInstanceGUI ()
 

Private Slots

void on_startStop_toggled (bool checked)
 
void on_centerFrequency_changed (quint64 value)
 
void on_loPPM_valueChanged (int value)
 
void on_swInterp_currentIndexChanged (int index)
 
void on_sampleRate_changed (quint64 value)
 
void on_lpf_changed (quint64 value)
 
void on_lpFIREnable_toggled (bool checked)
 
void on_lpFIR_changed (quint64 value)
 
void on_lpFIRInterpolation_currentIndexChanged (int index)
 
void on_lpFIRGain_currentIndexChanged (int index)
 
void on_att_valueChanged (int value)
 
void on_antenna_currentIndexChanged (int index)
 
void on_transverter_clicked ()
 
void on_sampleRateMode_toggled (bool checked)
 
void updateHardware ()
 
void updateStatus ()
 
void handleInputMessages ()
 
void openDeviceSettingsDialog (const QPoint &p)
 

Private Member Functions

void displaySettings ()
 
void displaySampleRate ()
 
void sendSettings (bool forceSettings=false)
 
void blockApplySettings (bool block)
 
void updateSampleRateAndFrequency ()
 
void setFIRBWLimits ()
 
void setSampleRateLimits ()
 
void updateFrequencyLimits ()
 

Private Attributes

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

Detailed Description

Definition at line 38 of file plutosdroutputgui.h.

Constructor & Destructor Documentation

◆ PlutoSDROutputGUI()

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

Definition at line 34 of file plutosdroutputgui.cpp.

References blockApplySettings(), displaySettings(), DeviceAPI::getSampleSink(), ColorMapper::GrayGold, ColorMapper::GrayGreenYellow, ColorMapper::GrayYellow, handleInputMessages(), DeviceUISet::m_deviceAPI, m_deviceUISet, m_inputMessageQueue, m_sampleSink, m_statusTimer, m_updateTimer, openDeviceSettingsDialog(), DevicePlutoSDR::srHighLimitFreq, DevicePlutoSDR::srLowLimitFreq, ui, updateFrequencyLimits(), updateHardware(), and updateStatus().

34  :
35  QWidget(parent),
36  ui(new Ui::PlutoSDROutputGUI),
37  m_deviceUISet(deviceUISet),
38  m_settings(),
39  m_sampleRateMode(true),
40  m_forceSettings(true),
41  m_sampleSink(0),
42  m_sampleRate(0),
45  m_doApplySettings(true),
47 {
49 
50  ui->setupUi(this);
51  ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
53 
54  ui->sampleRate->setColorMapper(ColorMapper(ColorMapper::GrayGreenYellow));
56 
57  ui->lpf->setColorMapper(ColorMapper(ColorMapper::GrayYellow));
58 
59  quint32 minLimit, maxLimit;
60  ((PlutoSDROutput *) m_sampleSink)->getbbLPRange(minLimit, maxLimit);
61  ui->lpf->setValueRange(5, minLimit/1000, maxLimit/1000);
62 
63  ui->lpFIR->setColorMapper(ColorMapper(ColorMapper::GrayYellow));
64  ui->lpFIR->setValueRange(5, 1U, 56000U); // will be dynamically recalculated
65 
66  ui->swInterpLabel->setText(QString::fromUtf8("S\u2191"));
67  ui->lpFIRInterpolationLabel->setText(QString::fromUtf8("\u2191"));
68 
69  CRightClickEnabler *startStopRightClickEnabler = new CRightClickEnabler(ui->startStop);
70  connect(startStopRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(openDeviceSettingsDialog(const QPoint &)));
71 
72  blockApplySettings(true);
74  blockApplySettings(false);
75 
76  connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware()));
77  connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus()));
78  m_statusTimer.start(500);
79 
80  connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection);
81 }
DeviceUISet * m_deviceUISet
void openDeviceSettingsDialog(const QPoint &p)
static const uint32_t srHighLimitFreq
Device sample rate higher limit in S/s.
DeviceSampleSink * getSampleSink()
Return pointer to the device sample sink (single Tx) or nullptr.
Definition: deviceapi.cpp:222
static const uint32_t srLowLimitFreq
Device sample rate lower limit in S/s.
engine is before initialization
Definition: deviceapi.h:53
DeviceAPI * m_deviceAPI
Definition: deviceuiset.h:48
MessageQueue m_inputMessageQueue
Ui::PlutoSDROutputGUI * ui
PlutoSDROutputSettings m_settings
quint64 m_deviceCenterFrequency
Center frequency in device.
void blockApplySettings(bool block)
bool m_sampleRateMode
true: device, false: base band sample rate update mode
DeviceSampleSink * m_sampleSink
+ Here is the call graph for this function:

◆ ~PlutoSDROutputGUI()

PlutoSDROutputGUI::~PlutoSDROutputGUI ( )
virtual

Definition at line 83 of file plutosdroutputgui.cpp.

References ui.

84 {
85  delete ui;
86 }
Ui::PlutoSDROutputGUI * ui

Member Function Documentation

◆ blockApplySettings()

void PlutoSDROutputGUI::blockApplySettings ( bool  block)
private

Definition at line 368 of file plutosdroutputgui.cpp.

References m_doApplySettings.

Referenced by deserialize(), handleMessage(), and PlutoSDROutputGUI().

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

◆ deserialize()

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

Implements PluginInstanceGUI.

Definition at line 125 of file plutosdroutputgui.cpp.

References blockApplySettings(), PlutoSDROutputSettings::deserialize(), displaySettings(), m_settings, resetToDefaults(), and sendSettings().

126 {
127  if(m_settings.deserialize(data))
128  {
129  blockApplySettings(true);
130  displaySettings();
131  blockApplySettings(false);
132  sendSettings(true);
133  return true;
134  }
135  else
136  {
137  resetToDefaults();
138  return false;
139  }
140 }
void sendSettings(bool forceSettings=false)
bool deserialize(const QByteArray &data)
virtual void resetToDefaults()
PlutoSDROutputSettings m_settings
void blockApplySettings(bool block)
+ Here is the call graph for this function:

◆ destroy()

void PlutoSDROutputGUI::destroy ( )
virtual

Implements PluginInstanceGUI.

Definition at line 88 of file plutosdroutputgui.cpp.

89 {
90  delete this;
91 }

◆ displaySampleRate()

void PlutoSDROutputGUI::displaySampleRate ( )
private

Definition at line 290 of file plutosdroutputgui.cpp.

References arg(), PlutoSDROutputSettings::m_devSampleRate, PlutoSDROutputSettings::m_log2Interp, m_sampleRateMode, m_settings, DevicePlutoSDR::srHighLimitFreq, DevicePlutoSDR::srLowLimitFreq, and ui.

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

291 {
292  ui->sampleRate->blockSignals(true);
293 
294  if (m_sampleRateMode)
295  {
296  ui->sampleRateMode->setStyleSheet("QToolButton { background:rgb(60,60,60); }");
297  ui->sampleRateMode->setText("SR");
298  ui->sampleRate->setValueRange(8, DevicePlutoSDR::srLowLimitFreq, DevicePlutoSDR::srHighLimitFreq);
299  ui->sampleRate->setValue(m_settings.m_devSampleRate);
300  ui->sampleRate->setToolTip("Host to device sample rate (S/s)");
301  ui->deviceRateText->setToolTip("Baseband sample rate (S/s)");
302  uint32_t basebandSampleRate = m_settings.m_devSampleRate/(1<<m_settings.m_log2Interp);
303  ui->deviceRateText->setText(tr("%1k").arg(QString::number(basebandSampleRate / 1000.0f, 'g', 5)));
304  }
305  else
306  {
307  ui->sampleRateMode->setStyleSheet("QToolButton { background:rgb(50,50,50); }");
308  ui->sampleRateMode->setText("BB");
310  ui->sampleRate->setValue(m_settings.m_devSampleRate/(1<<m_settings.m_log2Interp));
311  ui->sampleRate->setToolTip("Baseband sample rate (S/s)");
312  ui->deviceRateText->setToolTip("Host to device sample rate (S/s)");
313  ui->deviceRateText->setText(tr("%1k").arg(QString::number(m_settings.m_devSampleRate / 1000.0f, 'g', 5)));
314  }
315 
316  ui->sampleRate->blockSignals(false);
317 }
static const uint32_t srHighLimitFreq
Device sample rate higher limit in S/s.
unsigned int uint32_t
Definition: rtptypes_win.h:46
static const uint32_t srLowLimitFreq
Device sample rate lower limit in S/s.
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Ui::PlutoSDROutputGUI * ui
quint64 m_devSampleRate
Host interface sample rate.
PlutoSDROutputSettings m_settings
bool m_sampleRateMode
true: device, false: base band sample rate update mode
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ displaySettings()

void PlutoSDROutputGUI::displaySettings ( )
private

Definition at line 319 of file plutosdroutputgui.cpp.

References arg(), displaySampleRate(), PlutoSDROutputSettings::m_antennaPath, PlutoSDROutputSettings::m_att, PlutoSDROutputSettings::m_centerFrequency, PlutoSDROutputSettings::m_log2Interp, PlutoSDROutputSettings::m_LOppmTenths, PlutoSDROutputSettings::m_lpfBW, PlutoSDROutputSettings::m_lpfFIRBW, PlutoSDROutputSettings::m_lpfFIREnable, PlutoSDROutputSettings::m_lpfFIRGain, PlutoSDROutputSettings::m_lpfFIRlog2Interp, m_settings, PlutoSDROutputSettings::m_transverterDeltaFrequency, PlutoSDROutputSettings::m_transverterMode, setFIRBWLimits(), setSampleRateLimits(), ui, and updateFrequencyLimits().

Referenced by deserialize(), handleMessage(), PlutoSDROutputGUI(), and setCenterFrequency().

320 {
321  ui->transverter->setDeltaFrequency(m_settings.m_transverterDeltaFrequency);
322  ui->transverter->setDeltaFrequencyActive(m_settings.m_transverterMode);
324  ui->centerFrequency->setValue(m_settings.m_centerFrequency / 1000);
326 
327  ui->loPPM->setValue(m_settings.m_LOppmTenths);
328  ui->loPPMText->setText(QString("%1").arg(QString::number(m_settings.m_LOppmTenths/10.0, 'f', 1)));
329 
330  ui->swInterp->setCurrentIndex(m_settings.m_log2Interp);
331 
332  ui->lpf->setValue(m_settings.m_lpfBW / 1000);
333 
334  ui->lpFIREnable->setChecked(m_settings.m_lpfFIREnable);
335  ui->lpFIR->setValue(m_settings.m_lpfFIRBW / 1000);
336  ui->lpFIRInterpolation->setCurrentIndex(m_settings.m_lpfFIRlog2Interp);
337  ui->lpFIRGain->setCurrentIndex((m_settings.m_lpfFIRGain + 6)/6);
338  ui->lpFIRInterpolation->setEnabled(m_settings.m_lpfFIREnable);
339  ui->lpFIRGain->setEnabled(m_settings.m_lpfFIREnable);
340 
341  ui->att->setValue(m_settings.m_att);
342  ui->attText->setText(QString("%1 dB").arg(QString::number(m_settings.m_att*0.25, 'f', 2)));
343 
344  ui->antenna->setCurrentIndex((int) m_settings.m_antennaPath);
345 
346  setFIRBWLimits();
348 }
qint32 m_LOppmTenths
XO correction.
qint32 m_att
"hardware" attenuation in dB fourths
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
quint32 m_lpfBW
analog lowpass filter bandwidth (Hz)
bool m_lpfFIREnable
enable digital lowpass FIR filter
quint32 m_lpfFIRlog2Interp
digital lowpass FIR filter log2 of interpolation factor (0..2)
Ui::PlutoSDROutputGUI * ui
PlutoSDROutputSettings m_settings
int m_lpfFIRGain
digital lowpass FIR filter gain (dB)
quint32 m_lpfFIRBW
digital lowpass FIR filter bandwidth (Hz)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCenterFrequency()

qint64 PlutoSDROutputGUI::getCenterFrequency ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 108 of file plutosdroutputgui.cpp.

References PlutoSDROutputSettings::m_centerFrequency, and m_settings.

109 {
111 }
PlutoSDROutputSettings m_settings

◆ getInputMessageQueue()

virtual MessageQueue* PlutoSDROutputGUI::getInputMessageQueue ( )
inlinevirtual

Implements PluginInstanceGUI.

Definition at line 53 of file plutosdroutputgui.h.

53 { return &m_inputMessageQueue; }
MessageQueue m_inputMessageQueue

◆ getName()

QString PlutoSDROutputGUI::getName ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 98 of file plutosdroutputgui.cpp.

99 {
100  return objectName();
101 }

◆ handleInputMessages

void PlutoSDROutputGUI::handleInputMessages ( )
privateslot

Definition at line 464 of file plutosdroutputgui.cpp.

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

Referenced by PlutoSDROutputGUI().

465 {
466  Message* message;
467 
468  while ((message = m_inputMessageQueue.pop()) != 0)
469  {
470  qDebug("PlutoSDROutputGUI::handleInputMessages: message: %s", message->getIdentifier());
471 
472  if (DSPSignalNotification::match(*message))
473  {
474  DSPSignalNotification* notif = (DSPSignalNotification*) message;
475  m_sampleRate = notif->getSampleRate();
477  qDebug("PlutoSDROutputGUI::handleInputMessages: DSPSignalNotification: SampleRate: %d, CenterFrequency: %llu", notif->getSampleRate(), notif->getCenterFrequency());
479  setFIRBWLimits();
480 
481  delete message;
482  }
483  else
484  {
485  if (handleMessage(*message))
486  {
487  delete message;
488  }
489  }
490  }
491 }
Message * pop()
Pop message from queue.
virtual bool handleMessage(const Message &message)
qint64 getCenterFrequency() const
Definition: dspcommands.h:329
MessageQueue m_inputMessageQueue
static bool match(const Message *message)
Definition: message.cpp:45
int getSampleRate() const
Definition: dspcommands.h:328
virtual const char * getIdentifier() const
Definition: message.cpp:35
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 PlutoSDROutputGUI::handleMessage ( const Message message)
virtual

Implements PluginInstanceGUI.

Definition at line 142 of file plutosdroutputgui.cpp.

References blockApplySettings(), displaySettings(), DevicePlutoSDRShared::MsgCrossReportToBuddy::getDevSampleRate(), DevicePlutoSDRShared::MsgCrossReportToBuddy::getLoPPMTenths(), DevicePlutoSDRShared::MsgCrossReportToBuddy::getLpfFirbw(), DevicePlutoSDRShared::MsgCrossReportToBuddy::getLpfFiRlog2IntDec(), PlutoSDROutput::MsgConfigurePlutoSDR::getSettings(), PlutoSDROutput::MsgStartStop::getStartStop(), DevicePlutoSDRShared::MsgCrossReportToBuddy::isLpfFirEnable(), PlutoSDROutputSettings::m_devSampleRate, PlutoSDROutputSettings::m_LOppmTenths, PlutoSDROutputSettings::m_lpfFIRBW, PlutoSDROutputSettings::m_lpfFIREnable, PlutoSDROutputSettings::m_lpfFIRlog2Interp, m_settings, Message::match(), and ui.

Referenced by handleInputMessages().

143 {
144  (void) message;
146  {
148  m_settings = cfg.getSettings();
149  blockApplySettings(true);
150  displaySettings();
151  blockApplySettings(false);
152  return true;
153  }
154  else if (DevicePlutoSDRShared::MsgCrossReportToBuddy::match(message)) // message from buddy
155  {
162  blockApplySettings(true);
163  displaySettings();
164  blockApplySettings(false);
165 
166  return true;
167  }
168  else if (PlutoSDROutput::MsgStartStop::match(message))
169  {
171  blockApplySettings(true);
172  ui->startStop->setChecked(notif.getStartStop());
173  blockApplySettings(false);
174  return true;
175  }
176  else
177  {
178  return false;
179  }
180 }
qint32 m_LOppmTenths
XO correction.
bool m_lpfFIREnable
enable digital lowpass FIR filter
static bool match(const Message *message)
Definition: message.cpp:45
const PlutoSDROutputSettings & getSettings() const
quint32 m_lpfFIRlog2Interp
digital lowpass FIR filter log2 of interpolation factor (0..2)
Ui::PlutoSDROutputGUI * ui
quint64 m_devSampleRate
Host interface sample rate.
PlutoSDROutputSettings m_settings
void blockApplySettings(bool block)
quint32 m_lpfFIRBW
digital lowpass FIR filter bandwidth (Hz)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_antenna_currentIndexChanged

void PlutoSDROutputGUI::on_antenna_currentIndexChanged ( int  index)
privateslot

◆ on_att_valueChanged

void PlutoSDROutputGUI::on_att_valueChanged ( int  value)
privateslot

Definition at line 261 of file plutosdroutputgui.cpp.

References arg(), PlutoSDROutputSettings::m_att, m_settings, sendSettings(), and ui.

262 {
263  ui->attText->setText(QString("%1 dB").arg(QString::number(value*0.25, 'f', 2)));
264  m_settings.m_att = value;
265  sendSettings();
266 }
qint32 m_att
"hardware" attenuation in dB fourths
void sendSettings(bool forceSettings=false)
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Ui::PlutoSDROutputGUI * ui
PlutoSDROutputSettings m_settings
+ Here is the call graph for this function:

◆ on_centerFrequency_changed

void PlutoSDROutputGUI::on_centerFrequency_changed ( quint64  value)
privateslot

Definition at line 191 of file plutosdroutputgui.cpp.

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

192 {
193  m_settings.m_centerFrequency = value * 1000;
194  sendSettings();
195 }
void sendSettings(bool forceSettings=false)
PlutoSDROutputSettings m_settings
+ Here is the call graph for this function:

◆ on_loPPM_valueChanged

void PlutoSDROutputGUI::on_loPPM_valueChanged ( int  value)
privateslot

Definition at line 197 of file plutosdroutputgui.cpp.

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

198 {
199  ui->loPPMText->setText(QString("%1").arg(QString::number(value/10.0, 'f', 1)));
200  m_settings.m_LOppmTenths = value;
201  sendSettings();
202 }
qint32 m_LOppmTenths
XO correction.
void sendSettings(bool forceSettings=false)
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Ui::PlutoSDROutputGUI * ui
PlutoSDROutputSettings m_settings
+ Here is the call graph for this function:

◆ on_lpf_changed

void PlutoSDROutputGUI::on_lpf_changed ( quint64  value)
privateslot

Definition at line 228 of file plutosdroutputgui.cpp.

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

229 {
230  m_settings.m_lpfBW = value * 1000;
231  sendSettings();
232 }
void sendSettings(bool forceSettings=false)
quint32 m_lpfBW
analog lowpass filter bandwidth (Hz)
PlutoSDROutputSettings m_settings
+ Here is the call graph for this function:

◆ on_lpFIR_changed

void PlutoSDROutputGUI::on_lpFIR_changed ( quint64  value)
privateslot

Definition at line 242 of file plutosdroutputgui.cpp.

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

243 {
244  m_settings.m_lpfFIRBW = value * 1000;
245  sendSettings();
246 }
void sendSettings(bool forceSettings=false)
PlutoSDROutputSettings m_settings
quint32 m_lpfFIRBW
digital lowpass FIR filter bandwidth (Hz)
+ Here is the call graph for this function:

◆ on_lpFIREnable_toggled

void PlutoSDROutputGUI::on_lpFIREnable_toggled ( bool  checked)
privateslot

Definition at line 234 of file plutosdroutputgui.cpp.

References PlutoSDROutputSettings::m_lpfFIREnable, m_settings, sendSettings(), and ui.

235 {
236  m_settings.m_lpfFIREnable = checked;
237  ui->lpFIRInterpolation->setEnabled(checked);
238  ui->lpFIRGain->setEnabled(checked);
239  sendSettings();
240 }
void sendSettings(bool forceSettings=false)
bool m_lpfFIREnable
enable digital lowpass FIR filter
Ui::PlutoSDROutputGUI * ui
PlutoSDROutputSettings m_settings
+ Here is the call graph for this function:

◆ on_lpFIRGain_currentIndexChanged

void PlutoSDROutputGUI::on_lpFIRGain_currentIndexChanged ( int  index)
privateslot

Definition at line 255 of file plutosdroutputgui.cpp.

References PlutoSDROutputSettings::m_lpfFIRGain, m_settings, and sendSettings().

256 {
257  m_settings.m_lpfFIRGain = 6*(index > 1 ? 1 : index) - 6;
258  sendSettings();
259 }
void sendSettings(bool forceSettings=false)
PlutoSDROutputSettings m_settings
int m_lpfFIRGain
digital lowpass FIR filter gain (dB)
+ Here is the call graph for this function:

◆ on_lpFIRInterpolation_currentIndexChanged

void PlutoSDROutputGUI::on_lpFIRInterpolation_currentIndexChanged ( int  index)
privateslot

Definition at line 248 of file plutosdroutputgui.cpp.

References PlutoSDROutputSettings::m_lpfFIRlog2Interp, m_settings, sendSettings(), and setSampleRateLimits().

249 {
250  m_settings.m_lpfFIRlog2Interp = index > 2 ? 2 : index;
252  sendSettings();
253 }
void sendSettings(bool forceSettings=false)
quint32 m_lpfFIRlog2Interp
digital lowpass FIR filter log2 of interpolation factor (0..2)
PlutoSDROutputSettings m_settings
+ Here is the call graph for this function:

◆ on_sampleRate_changed

void PlutoSDROutputGUI::on_sampleRate_changed ( quint64  value)
privateslot

Definition at line 217 of file plutosdroutputgui.cpp.

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

218 {
219  m_settings.m_devSampleRate = value;
220 
221  if (!m_sampleRateMode) {
223  }
224 
225  sendSettings();
226 }
void sendSettings(bool forceSettings=false)
quint64 m_devSampleRate
Host interface sample rate.
PlutoSDROutputSettings m_settings
bool m_sampleRateMode
true: device, false: base band sample rate update mode
+ Here is the call graph for this function:

◆ on_sampleRateMode_toggled

void PlutoSDROutputGUI::on_sampleRateMode_toggled ( bool  checked)
privateslot

Definition at line 284 of file plutosdroutputgui.cpp.

References displaySampleRate(), and m_sampleRateMode.

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

◆ on_startStop_toggled

void PlutoSDROutputGUI::on_startStop_toggled ( bool  checked)
privateslot

Definition at line 182 of file plutosdroutputgui.cpp.

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

183 {
184  if (m_doApplySettings)
185  {
188  }
189 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
static MsgStartStop * create(bool startStop)
DeviceSampleSink * m_sampleSink
+ Here is the call graph for this function:

◆ on_swInterp_currentIndexChanged

void PlutoSDROutputGUI::on_swInterp_currentIndexChanged ( int  index)
privateslot

Definition at line 204 of file plutosdroutputgui.cpp.

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

205 {
206  m_settings.m_log2Interp = index > 5 ? 5 : index;
208  m_settings.m_devSampleRate = ui->sampleRate->getValueNew();
209 
210  if (!m_sampleRateMode) {
212  }
213 
214  sendSettings();
215 }
void sendSettings(bool forceSettings=false)
Ui::PlutoSDROutputGUI * ui
quint64 m_devSampleRate
Host interface sample rate.
PlutoSDROutputSettings m_settings
bool m_sampleRateMode
true: device, false: base band sample rate update mode
+ Here is the call graph for this function:

◆ on_transverter_clicked

void PlutoSDROutputGUI::on_transverter_clicked ( )
privateslot

Definition at line 274 of file plutosdroutputgui.cpp.

References PlutoSDROutputSettings::m_centerFrequency, m_settings, PlutoSDROutputSettings::m_transverterDeltaFrequency, PlutoSDROutputSettings::m_transverterMode, sendSettings(), ui, and updateFrequencyLimits().

275 {
276  m_settings.m_transverterMode = ui->transverter->getDeltaFrequencyAcive();
277  m_settings.m_transverterDeltaFrequency = ui->transverter->getDeltaFrequency();
278  qDebug("PlutoSDROutputGUI::on_transverter_clicked: %lld Hz %s", m_settings.m_transverterDeltaFrequency, m_settings.m_transverterMode ? "on" : "off");
280  m_settings.m_centerFrequency = ui->centerFrequency->getValueNew()*1000;
281  sendSettings();
282 }
void sendSettings(bool forceSettings=false)
Ui::PlutoSDROutputGUI * ui
PlutoSDROutputSettings m_settings
+ Here is the call graph for this function:

◆ openDeviceSettingsDialog

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

Definition at line 500 of file plutosdroutputgui.cpp.

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

Referenced by PlutoSDROutputGUI().

501 {
502  BasicDeviceSettingsDialog dialog(this);
503  dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
504  dialog.setReverseAPIAddress(m_settings.m_reverseAPIAddress);
505  dialog.setReverseAPIPort(m_settings.m_reverseAPIPort);
506  dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex);
507 
508  dialog.move(p);
509  dialog.exec();
510 
511  m_settings.m_useReverseAPI = dialog.useReverseAPI();
512  m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress();
513  m_settings.m_reverseAPIPort = dialog.getReverseAPIPort();
514  m_settings.m_reverseAPIDeviceIndex = dialog.getReverseAPIDeviceIndex();
515 
516  sendSettings();
517 }
void sendSettings(bool forceSettings=false)
PlutoSDROutputSettings m_settings
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetToDefaults()

void PlutoSDROutputGUI::resetToDefaults ( )
virtual

Implements PluginInstanceGUI.

Definition at line 103 of file plutosdroutputgui.cpp.

Referenced by deserialize().

104 {
105 
106 }
+ Here is the caller graph for this function:

◆ sendSettings()

void PlutoSDROutputGUI::sendSettings ( bool  forceSettings = false)
private

◆ serialize()

QByteArray PlutoSDROutputGUI::serialize ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 120 of file plutosdroutputgui.cpp.

References m_settings, and PlutoSDROutputSettings::serialize().

121 {
122  return m_settings.serialize();
123 }
PlutoSDROutputSettings m_settings
+ Here is the call graph for this function:

◆ setCenterFrequency()

void PlutoSDROutputGUI::setCenterFrequency ( qint64  centerFrequency)
virtual

Implements PluginInstanceGUI.

Definition at line 113 of file plutosdroutputgui.cpp.

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

114 {
115  m_settings.m_centerFrequency = centerFrequency;
116  displaySettings();
117  sendSettings();
118 }
void sendSettings(bool forceSettings=false)
PlutoSDROutputSettings m_settings
+ Here is the call graph for this function:

◆ setFIRBWLimits()

void PlutoSDROutputGUI::setFIRBWLimits ( )
private

Definition at line 431 of file plutosdroutputgui.cpp.

References DevicePlutoSDR::firBWHighLimitFactor, DevicePlutoSDR::firBWLowLimitFactor, PlutoSDROutputSettings::m_lpfFIRBW, m_sampleSink, m_settings, and ui.

Referenced by displaySettings(), and handleInputMessages().

432 {
433  float high = DevicePlutoSDR::firBWHighLimitFactor * ((PlutoSDROutput *) m_sampleSink)->getFIRSampleRate();
434  float low = DevicePlutoSDR::firBWLowLimitFactor * ((PlutoSDROutput *) m_sampleSink)->getFIRSampleRate();
435  ui->lpFIR->setValueRange(5, (int(low)/1000)+1, (int(high)/1000)+1);
436  ui->lpFIR->setValue(m_settings.m_lpfFIRBW/1000);
437 }
static const float firBWHighLimitFactor
Factor by which the FIR working sample rate is multiplied to yield bandwidth higher limit...
Ui::PlutoSDROutputGUI * ui
static const float firBWLowLimitFactor
Factor by which the FIR working sample rate is multiplied to yield bandwidth lower limit...
PlutoSDROutputSettings m_settings
quint32 m_lpfFIRBW
digital lowpass FIR filter bandwidth (Hz)
DeviceSampleSink * m_sampleSink
+ Here is the caller graph for this function:

◆ setName()

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

Implements PluginInstanceGUI.

Definition at line 93 of file plutosdroutputgui.cpp.

94 {
95  setObjectName(name);
96 }

◆ setSampleRateLimits()

void PlutoSDROutputGUI::setSampleRateLimits ( )
private

Definition at line 439 of file plutosdroutputgui.cpp.

References PlutoSDROutputSettings::m_devSampleRate, m_settings, DevicePlutoSDR::srHighLimitFreq, DevicePlutoSDR::srLowLimitFreq, and ui.

Referenced by displaySettings(), and on_lpFIRInterpolation_currentIndexChanged().

440 {
441  uint32_t low = ui->lpFIREnable->isChecked() ? DevicePlutoSDR::srLowLimitFreq / (1<<ui->lpFIRInterpolation->currentIndex()) : DevicePlutoSDR::srLowLimitFreq;
442  ui->sampleRate->setValueRange(8, low, DevicePlutoSDR::srHighLimitFreq);
443  ui->sampleRate->setValue(m_settings.m_devSampleRate);
444 }
static const uint32_t srHighLimitFreq
Device sample rate higher limit in S/s.
unsigned int uint32_t
Definition: rtptypes_win.h:46
static const uint32_t srLowLimitFreq
Device sample rate lower limit in S/s.
Ui::PlutoSDROutputGUI * ui
quint64 m_devSampleRate
Host interface sample rate.
PlutoSDROutputSettings m_settings
+ Here is the caller graph for this function:

◆ updateFrequencyLimits()

void PlutoSDROutputGUI::updateFrequencyLimits ( )
private

Definition at line 446 of file plutosdroutputgui.cpp.

References m_sampleSink, m_settings, PlutoSDROutputSettings::m_transverterDeltaFrequency, PlutoSDROutputSettings::m_transverterMode, and ui.

Referenced by displaySettings(), on_transverter_clicked(), and PlutoSDROutputGUI().

447 {
448  qint64 minLimit, maxLimit;
449  // values in kHz
450  qint64 deltaFrequency = m_settings.m_transverterMode ? m_settings.m_transverterDeltaFrequency/1000 : 0;
451  ((PlutoSDROutput *) m_sampleSink)->getLORange(minLimit, maxLimit);
452 
453  minLimit = minLimit/1000 + deltaFrequency;
454  maxLimit = maxLimit/1000 + deltaFrequency;
455 
456  minLimit = minLimit < 0 ? 0 : minLimit > 9999999 ? 9999999 : minLimit;
457  maxLimit = maxLimit < 0 ? 0 : maxLimit > 9999999 ? 9999999 : maxLimit;
458 
459  qDebug("PlutoSDRInputGui::updateFrequencyLimits: delta: %lld min: %lld max: %lld", deltaFrequency, minLimit, maxLimit);
460 
461  ui->centerFrequency->setValueRange(7, minLimit, maxLimit);
462 }
Ui::PlutoSDROutputGUI * ui
PlutoSDROutputSettings m_settings
DeviceSampleSink * m_sampleSink
+ Here is the caller graph for this function:

◆ updateHardware

void PlutoSDROutputGUI::updateHardware ( )
privateslot

Definition at line 356 of file plutosdroutputgui.cpp.

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

Referenced by PlutoSDROutputGUI().

357 {
358  if (m_doApplySettings)
359  {
360  qDebug() << "PlutoSDROutputGUI::updateHardware";
363  m_forceSettings = false;
364  m_updateTimer.stop();
365  }
366 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
static MsgConfigurePlutoSDR * create(const PlutoSDROutputSettings &settings, bool force)
PlutoSDROutputSettings m_settings
DeviceSampleSink * m_sampleSink
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateSampleRateAndFrequency()

void PlutoSDROutputGUI::updateSampleRateAndFrequency ( )
private

Definition at line 493 of file plutosdroutputgui.cpp.

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

Referenced by handleInputMessages().

494 {
498 }
DeviceUISet * m_deviceUISet
void setSampleRate(qint32 sampleRate)
Definition: glspectrum.cpp:211
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 PlutoSDROutputGUI::updateStatus ( )
privateslot

Definition at line 373 of file plutosdroutputgui.cpp.

References arg(), DeviceAPI::errorMessage(), DeviceAPI::isBuddyLeader(), DeviceUISet::m_deviceAPI, m_deviceUISet, m_lastEngineState, m_sampleSink, m_statusCounter, DeviceAPI::state(), DeviceAPI::StError, DeviceAPI::StIdle, DeviceAPI::StNotStarted, DeviceAPI::StRunning, and ui.

Referenced by PlutoSDROutputGUI().

374 {
375  int state = m_deviceUISet->m_deviceAPI->state();
376 
377  if(m_lastEngineState != state)
378  {
379  switch(state)
380  {
382  ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
383  break;
384  case DeviceAPI::StIdle:
385  ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
386  break;
388  ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
389  break;
390  case DeviceAPI::StError:
391  ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
392  QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
393  break;
394  default:
395  break;
396  }
397 
398  m_lastEngineState = state;
399  }
400 
401  if (m_statusCounter % 2 == 0) // 1s
402  {
403  uint32_t dacRate = ((PlutoSDROutput *) m_sampleSink)->getDACSampleRate();
404 
405  if (dacRate < 100000000) {
406  ui->dacRateLabel->setText(tr("%1k").arg(QString::number(dacRate / 1000.0f, 'g', 5)));
407  } else {
408  ui->dacRateLabel->setText(tr("%1M").arg(QString::number(dacRate / 1000000.0f, 'g', 5)));
409  }
410  }
411 
412  if (m_statusCounter % 4 == 0) // 2s
413  {
414  std::string rssiStr;
415  ((PlutoSDROutput *) m_sampleSink)->getRSSI(rssiStr);
416  ui->rssiText->setText(tr("-%1").arg(QString::fromStdString(rssiStr)));
417  }
418 
419  if (m_statusCounter % 10 == 0) // 5s
420  {
422  ((PlutoSDROutput *) m_sampleSink)->fetchTemperature();
423  }
424 
425  ui->temperatureText->setText(tr("%1C").arg(QString::number(((PlutoSDROutput *) m_sampleSink)->getTemperature(), 'f', 0)));
426  }
427 
428  m_statusCounter++;
429 }
DeviceUISet * m_deviceUISet
bool isBuddyLeader() const
Definition: deviceapi.h:163
QString errorMessage()
Last error message from the device engine.
Definition: deviceapi.cpp:290
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
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::PlutoSDROutputGUI * ui
engine is running
Definition: deviceapi.h:56
engine is in error
Definition: deviceapi.h:57
DeviceSampleSink * m_sampleSink
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_deviceCenterFrequency

quint64 PlutoSDROutputGUI::m_deviceCenterFrequency
private

Center frequency in device.

Definition at line 66 of file plutosdroutputgui.h.

Referenced by handleInputMessages(), and updateSampleRateAndFrequency().

◆ m_deviceUISet

DeviceUISet* PlutoSDROutputGUI::m_deviceUISet
private

◆ m_doApplySettings

bool PlutoSDROutputGUI::m_doApplySettings
private

Definition at line 68 of file plutosdroutputgui.h.

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

◆ m_forceSettings

bool PlutoSDROutputGUI::m_forceSettings
private

Definition at line 61 of file plutosdroutputgui.h.

Referenced by sendSettings(), and updateHardware().

◆ m_inputMessageQueue

MessageQueue PlutoSDROutputGUI::m_inputMessageQueue
private

Definition at line 70 of file plutosdroutputgui.h.

Referenced by handleInputMessages(), and PlutoSDROutputGUI().

◆ m_lastEngineState

int PlutoSDROutputGUI::m_lastEngineState
private

Definition at line 67 of file plutosdroutputgui.h.

Referenced by updateStatus().

◆ m_sampleRate

int PlutoSDROutputGUI::m_sampleRate
private

Definition at line 65 of file plutosdroutputgui.h.

Referenced by handleInputMessages(), and updateSampleRateAndFrequency().

◆ m_sampleRateMode

bool PlutoSDROutputGUI::m_sampleRateMode
private

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

Definition at line 60 of file plutosdroutputgui.h.

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

◆ m_sampleSink

DeviceSampleSink* PlutoSDROutputGUI::m_sampleSink
private

◆ m_settings

PlutoSDROutputSettings PlutoSDROutputGUI::m_settings
private

◆ m_statusCounter

uint32_t PlutoSDROutputGUI::m_statusCounter
private

Definition at line 69 of file plutosdroutputgui.h.

Referenced by updateStatus().

◆ m_statusTimer

QTimer PlutoSDROutputGUI::m_statusTimer
private

Definition at line 63 of file plutosdroutputgui.h.

Referenced by PlutoSDROutputGUI().

◆ m_updateTimer

QTimer PlutoSDROutputGUI::m_updateTimer
private

Definition at line 62 of file plutosdroutputgui.h.

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

◆ ui

Ui::PlutoSDROutputGUI* PlutoSDROutputGUI::ui
private

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