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

#include <sdrplaygui.h>

+ Inheritance diagram for SDRPlayGui:
+ Collaboration diagram for SDRPlayGui:

Public Member Functions

 SDRPlayGui (DeviceUISet *deviceUISet, QWidget *parent=0)
 
virtual ~SDRPlayGui ()
 
virtual void destroy ()
 
void setName (const QString &name)
 
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 updateHardware ()
 
void updateStatus ()
 
void handleInputMessages ()
 
void on_centerFrequency_changed (quint64 value)
 
void on_ppm_valueChanged (int value)
 
void on_dcOffset_toggled (bool checked)
 
void on_iqImbalance_toggled (bool checked)
 
void on_fBand_currentIndexChanged (int index)
 
void on_bandwidth_currentIndexChanged (int index)
 
void on_samplerate_currentIndexChanged (int index)
 
void on_ifFrequency_currentIndexChanged (int index)
 
void on_decim_currentIndexChanged (int index)
 
void on_fcPos_currentIndexChanged (int index)
 
void on_gainTunerOn_toggled (bool checked)
 
void on_gainTuner_valueChanged (int value)
 
void on_gainManualOn_toggled (bool checked)
 
void on_gainLNA_toggled (bool checked)
 
void on_gainMixer_toggled (bool checked)
 
void on_gainBaseband_valueChanged (int value)
 
void on_startStop_toggled (bool checked)
 
void on_record_toggled (bool checked)
 
void openDeviceSettingsDialog (const QPoint &p)
 

Private Member Functions

void blockApplySettings (bool block)
 
void displaySettings ()
 
void sendSettings ()
 
void updateSampleRateAndFrequency ()
 

Private Attributes

Ui::SDRPlayGui * ui
 
DeviceUISetm_deviceUISet
 
bool m_doApplySettings
 
bool m_forceSettings
 
SDRPlaySettings m_settings
 
QTimer m_updateTimer
 
QTimer m_statusTimer
 
DeviceSampleSourcem_sampleSource
 
int m_sampleRate
 
quint64 m_deviceCenterFrequency
 Center frequency in device. More...
 
int m_lastEngineState
 
MessageQueue m_inputMessageQueue
 

Detailed Description

Definition at line 37 of file sdrplaygui.h.

Constructor & Destructor Documentation

◆ SDRPlayGui()

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

Definition at line 35 of file sdrplaygui.cpp.

References displaySettings(), SDRPlayBands::getBandName(), SDRPlayBandwidths::getBandwidth(), SDRPlayIF::getIF(), SDRPlayBands::getNbBands(), SDRPlayBandwidths::getNbBandwidths(), SDRPlayIF::getNbIFs(), SDRPlaySampleRates::getNbRates(), SDRPlaySampleRates::getRate(), DeviceAPI::getSampleSource(), ColorMapper::GrayGold, handleInputMessages(), i, DeviceUISet::m_deviceAPI, m_deviceUISet, m_inputMessageQueue, m_sampleSource, m_statusTimer, m_updateTimer, openDeviceSettingsDialog(), DeviceSampleSource::setMessageQueueToGUI(), ui, updateHardware(), and updateStatus().

35  :
36  QWidget(parent),
37  ui(new Ui::SDRPlayGui),
38  m_deviceUISet(deviceUISet),
39  m_doApplySettings(true),
40  m_forceSettings(true)
41 {
43 
44  ui->setupUi(this);
45  ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
46  ui->centerFrequency->setValueRange(7, 10U, 12000U);
47 
48  ui->fBand->clear();
49  for (unsigned int i = 0; i < SDRPlayBands::getNbBands(); i++)
50  {
51  ui->fBand->addItem(SDRPlayBands::getBandName(i));
52  }
53 
54  ui->ifFrequency->clear();
55  for (unsigned int i = 0; i < SDRPlayIF::getNbIFs(); i++)
56  {
57  ui->ifFrequency->addItem(QString::number(SDRPlayIF::getIF(i)/1000));
58  }
59 
60  ui->samplerate->clear();
61  for (unsigned int i = 0; i < SDRPlaySampleRates::getNbRates(); i++)
62  {
63  ui->samplerate->addItem(QString::number(SDRPlaySampleRates::getRate(i)/1000));
64  }
65 
66  ui->bandwidth->clear();
67  for (unsigned int i = 0; i < SDRPlayBandwidths::getNbBandwidths(); i++)
68  {
69  ui->bandwidth->addItem(QString::number(SDRPlayBandwidths::getBandwidth(i)/1000));
70  }
71 
72  connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware()));
73  connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus()));
74  m_statusTimer.start(500);
75 
76  CRightClickEnabler *startStopRightClickEnabler = new CRightClickEnabler(ui->startStop);
77  connect(startStopRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(openDeviceSettingsDialog(const QPoint &)));
78 
80 
81  connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection);
83 }
static unsigned int getNbRates()
QTimer m_updateTimer
Definition: sdrplaygui.h:63
DeviceSampleSource * getSampleSource()
Return pointer to the device sample source (single Rx) or nullptr.
Definition: deviceapi.cpp:213
void handleInputMessages()
Definition: sdrplaygui.cpp:198
bool m_forceSettings
Definition: sdrplaygui.h:61
static unsigned int getNbBands()
static unsigned int getNbBandwidths()
static unsigned int getNbIFs()
bool m_doApplySettings
Definition: sdrplaygui.h:60
void updateHardware()
Definition: sdrplaygui.cpp:294
DeviceAPI * m_deviceAPI
Definition: deviceuiset.h:48
int32_t i
Definition: decimators.h:244
void displaySettings()
Definition: sdrplaygui.cpp:234
Ui::SDRPlayGui * ui
Definition: sdrplaygui.h:57
static unsigned int getBandwidth(unsigned int bandwidth_index)
MessageQueue m_inputMessageQueue
Definition: sdrplaygui.h:69
void openDeviceSettingsDialog(const QPoint &p)
Definition: sdrplaygui.cpp:481
void updateStatus()
Definition: sdrplaygui.cpp:303
static unsigned int getRate(unsigned int rate_index)
static unsigned int getIF(unsigned int if_index)
DeviceUISet * m_deviceUISet
Definition: sdrplaygui.h:59
virtual void setMessageQueueToGUI(MessageQueue *queue)=0
static QString getBandName(unsigned int band_index)
DeviceSampleSource * m_sampleSource
Definition: sdrplaygui.h:65
QTimer m_statusTimer
Definition: sdrplaygui.h:64
+ Here is the call graph for this function:

◆ ~SDRPlayGui()

SDRPlayGui::~SDRPlayGui ( )
virtual

Definition at line 85 of file sdrplaygui.cpp.

References ui.

86 {
87  delete ui;
88 }
Ui::SDRPlayGui * ui
Definition: sdrplaygui.h:57

Member Function Documentation

◆ blockApplySettings()

void SDRPlayGui::blockApplySettings ( bool  block)
inlineprivate

Definition at line 71 of file sdrplaygui.h.

Referenced by handleMessage().

71 { m_doApplySettings = !block; }
bool m_doApplySettings
Definition: sdrplaygui.h:60
+ Here is the caller graph for this function:

◆ deserialize()

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

Implements PluginInstanceGUI.

Definition at line 129 of file sdrplaygui.cpp.

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

130 {
131  if(m_settings.deserialize(data))
132  {
133  displaySettings();
134  m_forceSettings = true;
135  sendSettings();
136  return true;
137  }
138  else
139  {
140  resetToDefaults();
141  return false;
142  }
143 }
bool m_forceSettings
Definition: sdrplaygui.h:61
SDRPlaySettings m_settings
Definition: sdrplaygui.h:62
virtual void resetToDefaults()
Definition: sdrplaygui.cpp:105
void displaySettings()
Definition: sdrplaygui.cpp:234
void sendSettings()
Definition: sdrplaygui.cpp:288
bool deserialize(const QByteArray &data)
+ Here is the call graph for this function:

◆ destroy()

void SDRPlayGui::destroy ( )
virtual

Implements PluginInstanceGUI.

Definition at line 90 of file sdrplaygui.cpp.

91 {
92  delete this;
93 }

◆ displaySettings()

void SDRPlayGui::displaySettings ( )
private

Definition at line 234 of file sdrplaygui.cpp.

References arg(), SDRPlaySettings::m_bandwidthIndex, SDRPlaySettings::m_basebandGain, SDRPlaySettings::m_centerFrequency, SDRPlaySettings::m_dcBlock, SDRPlaySettings::m_devSampleRateIndex, SDRPlaySettings::m_fcPos, SDRPlaySettings::m_frequencyBandIndex, SDRPlaySettings::m_ifFrequencyIndex, SDRPlaySettings::m_iqCorrection, SDRPlaySettings::m_lnaOn, SDRPlaySettings::m_log2Decim, SDRPlaySettings::m_LOppmTenths, SDRPlaySettings::m_mixerAmpOn, m_settings, SDRPlaySettings::m_tunerGain, SDRPlaySettings::m_tunerGainMode, and ui.

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

235 {
236  ui->centerFrequency->setValue(m_settings.m_centerFrequency / 1000);
237 
238  ui->ppm->setValue(m_settings.m_LOppmTenths);
239  ui->ppmText->setText(QString("%1").arg(QString::number(m_settings.m_LOppmTenths/10.0, 'f', 1)));
240 
241  ui->samplerate->setCurrentIndex(m_settings.m_devSampleRateIndex);
242 
243  ui->dcOffset->setChecked(m_settings.m_dcBlock);
244  ui->iqImbalance->setChecked(m_settings.m_iqCorrection);
245 
246  ui->fBand->setCurrentIndex(m_settings.m_frequencyBandIndex);
247  ui->bandwidth->setCurrentIndex(m_settings.m_bandwidthIndex);
248  ui->ifFrequency->setCurrentIndex(m_settings.m_ifFrequencyIndex);
249  ui->samplerate->setCurrentIndex(m_settings.m_devSampleRateIndex);
250 
251  ui->decim->setCurrentIndex(m_settings.m_log2Decim);
252  ui->fcPos->setCurrentIndex((int) m_settings.m_fcPos);
253 
254  ui->gainTunerOn->setChecked(m_settings.m_tunerGainMode);
255 
257  {
258  ui->gainTuner->setEnabled(true);
259  ui->gainLNA->setEnabled(false);
260  ui->gainMixer->setEnabled(false);
261  ui->gainBaseband->setEnabled(false);
262 
263  int gain = m_settings.m_tunerGain;
264  ui->gainTuner->setValue(gain);
265  QString gainText;
266  gainText.sprintf("%03d", gain);
267  ui->gainTunerText->setText(gainText);
268  m_settings.m_tunerGain = gain;
269  }
270  else
271  {
272  ui->gainTuner->setEnabled(false);
273  ui->gainLNA->setEnabled(true);
274  ui->gainMixer->setEnabled(true);
275  ui->gainBaseband->setEnabled(true);
276 
277  ui->gainLNA->setChecked(m_settings.m_lnaOn != 0);
278  ui->gainMixer->setChecked(m_settings.m_mixerAmpOn != 0);
279 
280  int gain = m_settings.m_basebandGain;
281  ui->gainBaseband->setValue(gain);
282  QString gainText;
283  gainText.sprintf("%02d", gain);
284  ui->gainBasebandText->setText(gainText);
285  }
286 }
uint32_t m_ifFrequencyIndex
SDRPlaySettings m_settings
Definition: sdrplaygui.h:62
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Ui::SDRPlayGui * ui
Definition: sdrplaygui.h:57
uint64_t m_centerFrequency
uint32_t m_frequencyBandIndex
uint32_t m_log2Decim
uint32_t m_bandwidthIndex
uint32_t m_devSampleRateIndex
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCenterFrequency()

qint64 SDRPlayGui::getCenterFrequency ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 112 of file sdrplaygui.cpp.

References SDRPlaySettings::m_centerFrequency, and m_settings.

113 {
115 }
SDRPlaySettings m_settings
Definition: sdrplaygui.h:62
uint64_t m_centerFrequency

◆ getInputMessageQueue()

virtual MessageQueue* SDRPlayGui::getInputMessageQueue ( )
inlinevirtual

Implements PluginInstanceGUI.

Definition at line 53 of file sdrplaygui.h.

53 { return &m_inputMessageQueue; }
MessageQueue m_inputMessageQueue
Definition: sdrplaygui.h:69

◆ getName()

QString SDRPlayGui::getName ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 100 of file sdrplaygui.cpp.

101 {
102  return objectName();
103 }

◆ handleInputMessages

void SDRPlayGui::handleInputMessages ( )
privateslot

Definition at line 198 of file sdrplaygui.cpp.

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

Referenced by SDRPlayGui().

199 {
200  Message* message;
201 
202  while ((message = m_inputMessageQueue.pop()) != 0)
203  {
204  qDebug("SDRPlayGui::handleInputMessages: message: %s", message->getIdentifier());
205 
206  if (DSPSignalNotification::match(*message))
207  {
208  DSPSignalNotification* notif = (DSPSignalNotification*) message;
209  m_sampleRate = notif->getSampleRate();
211  qDebug("SDRPlayGui::handleInputMessages: DSPSignalNotification: SampleRate:%d, CenterFrequency:%llu", notif->getSampleRate(), notif->getCenterFrequency());
213 
214  delete message;
215  }
216  else
217  {
218  if (handleMessage(*message))
219  {
220  delete message;
221  }
222  }
223  }
224 }
void updateSampleRateAndFrequency()
Definition: sdrplaygui.cpp:226
Message * pop()
Pop message from queue.
quint64 m_deviceCenterFrequency
Center frequency in device.
Definition: sdrplaygui.h:67
int m_sampleRate
Definition: sdrplaygui.h:66
qint64 getCenterFrequency() const
Definition: dspcommands.h:329
static bool match(const Message *message)
Definition: message.cpp:45
virtual bool handleMessage(const Message &message)
Definition: sdrplaygui.cpp:145
MessageQueue m_inputMessageQueue
Definition: sdrplaygui.h:69
int getSampleRate() const
Definition: dspcommands.h:328
virtual const char * getIdentifier() const
Definition: message.cpp:35
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleMessage()

bool SDRPlayGui::handleMessage ( const Message message)
virtual

Implements PluginInstanceGUI.

Definition at line 145 of file sdrplaygui.cpp.

References blockApplySettings(), displaySettings(), SDRPlayInput::MsgReportSDRPlayGains::getBasebandGain(), SDRPlayInput::MsgReportSDRPlayGains::getLNAGain(), SDRPlayInput::MsgReportSDRPlayGains::getMixerGain(), SDRPlayInput::MsgConfigureSDRPlay::getSettings(), SDRPlayInput::MsgStartStop::getStartStop(), SDRPlayInput::MsgReportSDRPlayGains::getTunerGain(), m_settings, SDRPlaySettings::m_tunerGainMode, Message::match(), and ui.

Referenced by handleInputMessages().

146 {
148  {
150  m_settings = cfg.getSettings();
151  blockApplySettings(true);
152  displaySettings();
153  blockApplySettings(false);
154  return true;
155  }
157  {
158  qDebug() << "SDRPlayGui::handleMessage: MsgReportSDRPlayGains";
159 
161 
163  {
164  ui->gainLNA->setChecked(msg.getLNAGain() != 0);
165  ui->gainMixer->setChecked(msg.getMixerGain() != 0);
166  ui->gainBaseband->setValue(msg.getBasebandGain());
167 
168  QString gainText;
169  gainText.sprintf("%02d", msg.getBasebandGain());
170  ui->gainBasebandText->setText(gainText);
171  }
172  else
173  {
174  ui->gainTuner->setValue(msg.getTunerGain());
175 
176  QString gainText;
177  gainText.sprintf("%03d", msg.getTunerGain());
178  ui->gainTunerText->setText(gainText);
179  }
180 
181  return true;
182  }
183  else if (SDRPlayInput::MsgStartStop::match(message))
184  {
186  blockApplySettings(true);
187  ui->startStop->setChecked(notif.getStartStop());
188  blockApplySettings(false);
189 
190  return true;
191  }
192  else
193  {
194  return false;
195  }
196 }
void blockApplySettings(bool block)
Definition: sdrplaygui.h:71
SDRPlaySettings m_settings
Definition: sdrplaygui.h:62
const SDRPlaySettings & getSettings() const
Definition: sdrplayinput.h:52
void displaySettings()
Definition: sdrplaygui.cpp:234
static bool match(const Message *message)
Definition: message.cpp:45
Ui::SDRPlayGui * ui
Definition: sdrplaygui.h:57
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_bandwidth_currentIndexChanged

void SDRPlayGui::on_bandwidth_currentIndexChanged ( int  index)
privateslot

Definition at line 372 of file sdrplaygui.cpp.

References SDRPlaySettings::m_bandwidthIndex, m_settings, and sendSettings().

373 {
375  sendSettings();
376 }
SDRPlaySettings m_settings
Definition: sdrplaygui.h:62
uint32_t m_bandwidthIndex
void sendSettings()
Definition: sdrplaygui.cpp:288
+ Here is the call graph for this function:

◆ on_centerFrequency_changed

void SDRPlayGui::on_centerFrequency_changed ( quint64  value)
privateslot

Definition at line 332 of file sdrplaygui.cpp.

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

333 {
334  m_settings.m_centerFrequency = value * 1000;
335  sendSettings();
336 }
SDRPlaySettings m_settings
Definition: sdrplaygui.h:62
uint64_t m_centerFrequency
void sendSettings()
Definition: sdrplaygui.cpp:288
+ Here is the call graph for this function:

◆ on_dcOffset_toggled

void SDRPlayGui::on_dcOffset_toggled ( bool  checked)
privateslot

Definition at line 345 of file sdrplaygui.cpp.

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

346 {
347  qDebug("SDRPlayGui::on_dcOffset_toggled: %s", checked ? "on" : "off");
348  m_settings.m_dcBlock = checked;
349  sendSettings();
350 }
SDRPlaySettings m_settings
Definition: sdrplaygui.h:62
void sendSettings()
Definition: sdrplaygui.cpp:288
+ Here is the call graph for this function:

◆ on_decim_currentIndexChanged

void SDRPlayGui::on_decim_currentIndexChanged ( int  index)
privateslot

Definition at line 390 of file sdrplaygui.cpp.

References SDRPlaySettings::m_log2Decim, m_settings, and sendSettings().

391 {
392  m_settings.m_log2Decim = index;
393  sendSettings();
394 }
SDRPlaySettings m_settings
Definition: sdrplaygui.h:62
uint32_t m_log2Decim
void sendSettings()
Definition: sdrplaygui.cpp:288
+ Here is the call graph for this function:

◆ on_fBand_currentIndexChanged

void SDRPlayGui::on_fBand_currentIndexChanged ( int  index)
privateslot

Definition at line 358 of file sdrplaygui.cpp.

References SDRPlayBands::getBandHigh(), SDRPlayBands::getBandLow(), SDRPlaySettings::m_centerFrequency, SDRPlaySettings::m_frequencyBandIndex, m_settings, sendSettings(), and ui.

359 {
360  ui->centerFrequency->setValueRange(
361  7,
364 
365  ui->centerFrequency->setValue((SDRPlayBands::getBandLow(index)+SDRPlayBands::getBandHigh(index)) / 2);
368 
369  sendSettings();
370 }
SDRPlaySettings m_settings
Definition: sdrplaygui.h:62
Ui::SDRPlayGui * ui
Definition: sdrplaygui.h:57
uint64_t m_centerFrequency
static unsigned int getBandLow(unsigned int band_index)
uint32_t m_frequencyBandIndex
void sendSettings()
Definition: sdrplaygui.cpp:288
static unsigned int getBandHigh(unsigned int band_index)
+ Here is the call graph for this function:

◆ on_fcPos_currentIndexChanged

void SDRPlayGui::on_fcPos_currentIndexChanged ( int  index)
privateslot

Definition at line 396 of file sdrplaygui.cpp.

References SDRPlaySettings::m_fcPos, m_settings, and sendSettings().

397 {
399  sendSettings();
400 }
SDRPlaySettings m_settings
Definition: sdrplaygui.h:62
void sendSettings()
Definition: sdrplaygui.cpp:288
+ Here is the call graph for this function:

◆ on_gainBaseband_valueChanged

void SDRPlayGui::on_gainBaseband_valueChanged ( int  value)
privateslot

Definition at line 449 of file sdrplaygui.cpp.

References SDRPlaySettings::m_basebandGain, m_settings, sendSettings(), and ui.

450 {
451  m_settings.m_basebandGain = value;
452 
453  QString gainText;
454  gainText.sprintf("%02d", value);
455  ui->gainBasebandText->setText(gainText);
456 
457  sendSettings();
458 }
SDRPlaySettings m_settings
Definition: sdrplaygui.h:62
Ui::SDRPlayGui * ui
Definition: sdrplaygui.h:57
void sendSettings()
Definition: sdrplaygui.cpp:288
+ Here is the call graph for this function:

◆ on_gainLNA_toggled

void SDRPlayGui::on_gainLNA_toggled ( bool  checked)
privateslot

Definition at line 437 of file sdrplaygui.cpp.

References SDRPlaySettings::m_lnaOn, m_settings, and sendSettings().

438 {
439  m_settings.m_lnaOn = checked ? 1 : 0;
440  sendSettings();
441 }
SDRPlaySettings m_settings
Definition: sdrplaygui.h:62
void sendSettings()
Definition: sdrplaygui.cpp:288
+ Here is the call graph for this function:

◆ on_gainManualOn_toggled

void SDRPlayGui::on_gainManualOn_toggled ( bool  checked)
privateslot

Definition at line 425 of file sdrplaygui.cpp.

References m_settings, SDRPlaySettings::m_tunerGainMode, sendSettings(), and ui.

426 {
427  qDebug("SDRPlayGui::on_gainManualOn_toggled: %s", checked ? "on" : "off");
428  m_settings.m_tunerGainMode = false;
429  ui->gainTuner->setEnabled(false);
430  ui->gainLNA->setEnabled(true);
431  ui->gainMixer->setEnabled(true);
432  ui->gainBaseband->setEnabled(true);
433 
434  sendSettings();
435 }
SDRPlaySettings m_settings
Definition: sdrplaygui.h:62
Ui::SDRPlayGui * ui
Definition: sdrplaygui.h:57
void sendSettings()
Definition: sdrplaygui.cpp:288
+ Here is the call graph for this function:

◆ on_gainMixer_toggled

void SDRPlayGui::on_gainMixer_toggled ( bool  checked)
privateslot

Definition at line 443 of file sdrplaygui.cpp.

References SDRPlaySettings::m_mixerAmpOn, m_settings, and sendSettings().

444 {
445  m_settings.m_mixerAmpOn = checked ? 1 : 0;
446  sendSettings();
447 }
SDRPlaySettings m_settings
Definition: sdrplaygui.h:62
void sendSettings()
Definition: sdrplaygui.cpp:288
+ Here is the call graph for this function:

◆ on_gainTuner_valueChanged

void SDRPlayGui::on_gainTuner_valueChanged ( int  value)
privateslot

Definition at line 414 of file sdrplaygui.cpp.

References m_settings, SDRPlaySettings::m_tunerGain, sendSettings(), and ui.

415 {
416  int gain = value;
417  QString gainText;
418  gainText.sprintf("%03d", gain);
419  ui->gainTunerText->setText(gainText);
420  m_settings.m_tunerGain = gain;
421 
422  sendSettings();
423 }
SDRPlaySettings m_settings
Definition: sdrplaygui.h:62
Ui::SDRPlayGui * ui
Definition: sdrplaygui.h:57
void sendSettings()
Definition: sdrplaygui.cpp:288
+ Here is the call graph for this function:

◆ on_gainTunerOn_toggled

void SDRPlayGui::on_gainTunerOn_toggled ( bool  checked)
privateslot

Definition at line 402 of file sdrplaygui.cpp.

References m_settings, SDRPlaySettings::m_tunerGainMode, sendSettings(), and ui.

403 {
404  qDebug("SDRPlayGui::on_gainTunerOn_toggled: %s", checked ? "on" : "off");
406  ui->gainTuner->setEnabled(true);
407  ui->gainLNA->setEnabled(false);
408  ui->gainMixer->setEnabled(false);
409  ui->gainBaseband->setEnabled(false);
410 
411  sendSettings();
412 }
SDRPlaySettings m_settings
Definition: sdrplaygui.h:62
Ui::SDRPlayGui * ui
Definition: sdrplaygui.h:57
void sendSettings()
Definition: sdrplaygui.cpp:288
+ Here is the call graph for this function:

◆ on_ifFrequency_currentIndexChanged

void SDRPlayGui::on_ifFrequency_currentIndexChanged ( int  index)
privateslot

Definition at line 384 of file sdrplaygui.cpp.

References SDRPlaySettings::m_ifFrequencyIndex, m_settings, and sendSettings().

385 {
387  sendSettings();
388 }
uint32_t m_ifFrequencyIndex
SDRPlaySettings m_settings
Definition: sdrplaygui.h:62
void sendSettings()
Definition: sdrplaygui.cpp:288
+ Here is the call graph for this function:

◆ on_iqImbalance_toggled

void SDRPlayGui::on_iqImbalance_toggled ( bool  checked)
privateslot

Definition at line 352 of file sdrplaygui.cpp.

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

353 {
354  m_settings.m_iqCorrection = checked;
355  sendSettings();
356 }
SDRPlaySettings m_settings
Definition: sdrplaygui.h:62
void sendSettings()
Definition: sdrplaygui.cpp:288
+ Here is the call graph for this function:

◆ on_ppm_valueChanged

void SDRPlayGui::on_ppm_valueChanged ( int  value)
privateslot

Definition at line 338 of file sdrplaygui.cpp.

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

339 {
340  m_settings.m_LOppmTenths = value;
341  ui->ppmText->setText(QString("%1").arg(QString::number(m_settings.m_LOppmTenths/10.0, 'f', 1)));
342  sendSettings();
343 }
SDRPlaySettings m_settings
Definition: sdrplaygui.h:62
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Ui::SDRPlayGui * ui
Definition: sdrplaygui.h:57
void sendSettings()
Definition: sdrplaygui.cpp:288
+ Here is the call graph for this function:

◆ on_record_toggled

void SDRPlayGui::on_record_toggled ( bool  checked)
privateslot

Definition at line 469 of file sdrplaygui.cpp.

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

470 {
471  if (checked) {
472  ui->record->setStyleSheet("QToolButton { background-color : red; }");
473  } else {
474  ui->record->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
475  }
476 
479 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
static MsgFileRecord * create(bool startStop)
Definition: sdrplayinput.h:106
Ui::SDRPlayGui * ui
Definition: sdrplaygui.h:57
DeviceSampleSource * m_sampleSource
Definition: sdrplaygui.h:65
+ Here is the call graph for this function:

◆ on_samplerate_currentIndexChanged

void SDRPlayGui::on_samplerate_currentIndexChanged ( int  index)
privateslot

Definition at line 378 of file sdrplaygui.cpp.

References SDRPlaySettings::m_devSampleRateIndex, m_settings, and sendSettings().

379 {
381  sendSettings();
382 }
SDRPlaySettings m_settings
Definition: sdrplaygui.h:62
void sendSettings()
Definition: sdrplaygui.cpp:288
uint32_t m_devSampleRateIndex
+ Here is the call graph for this function:

◆ on_startStop_toggled

void SDRPlayGui::on_startStop_toggled ( bool  checked)
privateslot

Definition at line 460 of file sdrplaygui.cpp.

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

461 {
462  if (m_doApplySettings)
463  {
466  }
467 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
static MsgStartStop * create(bool startStop)
Definition: sdrplayinput.h:125
MessageQueue * getInputMessageQueue()
bool m_doApplySettings
Definition: sdrplaygui.h:60
DeviceSampleSource * m_sampleSource
Definition: sdrplaygui.h:65
+ Here is the call graph for this function:

◆ openDeviceSettingsDialog

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

Definition at line 481 of file sdrplaygui.cpp.

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

Referenced by SDRPlayGui().

482 {
483  BasicDeviceSettingsDialog dialog(this);
484  dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
485  dialog.setReverseAPIAddress(m_settings.m_reverseAPIAddress);
486  dialog.setReverseAPIPort(m_settings.m_reverseAPIPort);
487  dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex);
488 
489  dialog.move(p);
490  dialog.exec();
491 
492  m_settings.m_useReverseAPI = dialog.useReverseAPI();
493  m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress();
494  m_settings.m_reverseAPIPort = dialog.getReverseAPIPort();
495  m_settings.m_reverseAPIDeviceIndex = dialog.getReverseAPIDeviceIndex();
496 
497  sendSettings();
498 }
uint16_t m_reverseAPIPort
SDRPlaySettings m_settings
Definition: sdrplaygui.h:62
QString m_reverseAPIAddress
void sendSettings()
Definition: sdrplaygui.cpp:288
uint16_t m_reverseAPIDeviceIndex
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetToDefaults()

void SDRPlayGui::resetToDefaults ( )
virtual

Implements PluginInstanceGUI.

Definition at line 105 of file sdrplaygui.cpp.

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

Referenced by deserialize().

106 {
108  displaySettings();
109  sendSettings();
110 }
SDRPlaySettings m_settings
Definition: sdrplaygui.h:62
void displaySettings()
Definition: sdrplaygui.cpp:234
void sendSettings()
Definition: sdrplaygui.cpp:288
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendSettings()

void SDRPlayGui::sendSettings ( )
private

◆ serialize()

QByteArray SDRPlayGui::serialize ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 124 of file sdrplaygui.cpp.

References m_settings, and SDRPlaySettings::serialize().

125 {
126  return m_settings.serialize();
127 }
SDRPlaySettings m_settings
Definition: sdrplaygui.h:62
QByteArray serialize() const
+ Here is the call graph for this function:

◆ setCenterFrequency()

void SDRPlayGui::setCenterFrequency ( qint64  centerFrequency)
virtual

Implements PluginInstanceGUI.

Definition at line 117 of file sdrplaygui.cpp.

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

118 {
119  m_settings.m_centerFrequency = centerFrequency;
120  displaySettings();
121  sendSettings();
122 }
SDRPlaySettings m_settings
Definition: sdrplaygui.h:62
void displaySettings()
Definition: sdrplaygui.cpp:234
uint64_t m_centerFrequency
void sendSettings()
Definition: sdrplaygui.cpp:288
+ Here is the call graph for this function:

◆ setName()

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

Implements PluginInstanceGUI.

Definition at line 95 of file sdrplaygui.cpp.

96 {
97  setObjectName(name);
98 }

◆ updateHardware

void SDRPlayGui::updateHardware ( )
privateslot

Definition at line 294 of file sdrplaygui.cpp.

References SDRPlayInput::MsgConfigureSDRPlay::create(), DeviceSampleSource::getInputMessageQueue(), m_forceSettings, m_sampleSource, m_settings, m_updateTimer, and MessageQueue::push().

Referenced by SDRPlayGui().

295 {
296  qDebug() << "SDRPlayGui::updateHardware";
299  m_forceSettings = false;
300  m_updateTimer.stop();
301 }
QTimer m_updateTimer
Definition: sdrplaygui.h:63
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
bool m_forceSettings
Definition: sdrplaygui.h:61
SDRPlaySettings m_settings
Definition: sdrplaygui.h:62
static MsgConfigureSDRPlay * create(const SDRPlaySettings &settings, bool force)
Definition: sdrplayinput.h:55
DeviceSampleSource * m_sampleSource
Definition: sdrplaygui.h:65
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateSampleRateAndFrequency()

void SDRPlayGui::updateSampleRateAndFrequency ( )
private

Definition at line 226 of file sdrplaygui.cpp.

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

Referenced by handleInputMessages().

227 {
230  ui->deviceRateText->setText(tr("%1k").arg((float)m_sampleRate / 1000));
231 }
void setSampleRate(qint32 sampleRate)
Definition: glspectrum.cpp:211
quint64 m_deviceCenterFrequency
Center frequency in device.
Definition: sdrplaygui.h:67
int m_sampleRate
Definition: sdrplaygui.h:66
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
GLSpectrum * getSpectrum()
Direct spectrum getter.
Definition: deviceuiset.h:57
Ui::SDRPlayGui * ui
Definition: sdrplaygui.h:57
void setCenterFrequency(qint64 frequency)
Definition: glspectrum.cpp:175
DeviceUISet * m_deviceUISet
Definition: sdrplaygui.h:59
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateStatus

void SDRPlayGui::updateStatus ( )
privateslot

Definition at line 303 of file sdrplaygui.cpp.

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

Referenced by SDRPlayGui().

304 {
305  int state = m_deviceUISet->m_deviceAPI->state();
306 
307  if(m_lastEngineState != state)
308  {
309  switch(state)
310  {
312  ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
313  break;
314  case DeviceAPI::StIdle:
315  ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
316  break;
318  ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
319  break;
320  case DeviceAPI::StError:
321  ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
322  QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
323  break;
324  default:
325  break;
326  }
327 
328  m_lastEngineState = state;
329  }
330 }
QString errorMessage()
Last error message from the device engine.
Definition: deviceapi.cpp:290
engine is before initialization
Definition: deviceapi.h:53
int m_lastEngineState
Definition: sdrplaygui.h:68
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::SDRPlayGui * ui
Definition: sdrplaygui.h:57
DeviceUISet * m_deviceUISet
Definition: sdrplaygui.h:59
engine is running
Definition: deviceapi.h:56
engine is in error
Definition: deviceapi.h:57
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_deviceCenterFrequency

quint64 SDRPlayGui::m_deviceCenterFrequency
private

Center frequency in device.

Definition at line 67 of file sdrplaygui.h.

Referenced by handleInputMessages(), and updateSampleRateAndFrequency().

◆ m_deviceUISet

DeviceUISet* SDRPlayGui::m_deviceUISet
private

Definition at line 59 of file sdrplaygui.h.

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

◆ m_doApplySettings

bool SDRPlayGui::m_doApplySettings
private

Definition at line 60 of file sdrplaygui.h.

Referenced by on_startStop_toggled().

◆ m_forceSettings

bool SDRPlayGui::m_forceSettings
private

Definition at line 61 of file sdrplaygui.h.

Referenced by deserialize(), and updateHardware().

◆ m_inputMessageQueue

MessageQueue SDRPlayGui::m_inputMessageQueue
private

Definition at line 69 of file sdrplaygui.h.

Referenced by handleInputMessages(), and SDRPlayGui().

◆ m_lastEngineState

int SDRPlayGui::m_lastEngineState
private

Definition at line 68 of file sdrplaygui.h.

Referenced by updateStatus().

◆ m_sampleRate

int SDRPlayGui::m_sampleRate
private

Definition at line 66 of file sdrplaygui.h.

Referenced by handleInputMessages(), and updateSampleRateAndFrequency().

◆ m_sampleSource

DeviceSampleSource* SDRPlayGui::m_sampleSource
private

Definition at line 65 of file sdrplaygui.h.

Referenced by on_record_toggled(), on_startStop_toggled(), SDRPlayGui(), and updateHardware().

◆ m_settings

SDRPlaySettings SDRPlayGui::m_settings
private

◆ m_statusTimer

QTimer SDRPlayGui::m_statusTimer
private

Definition at line 64 of file sdrplaygui.h.

Referenced by SDRPlayGui().

◆ m_updateTimer

QTimer SDRPlayGui::m_updateTimer
private

Definition at line 63 of file sdrplaygui.h.

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

◆ ui

Ui::SDRPlayGui* SDRPlayGui::ui
private

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