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

#include <airspygui.h>

+ Inheritance diagram for AirspyGui:
+ Collaboration diagram for AirspyGui:

Public Member Functions

 AirspyGui (DeviceUISet *deviceUISet, QWidget *parent=0)
 
virtual ~AirspyGui ()
 
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)
 
uint32_t getDevSampleRate (unsigned int index)
 
int getDevSampleRateIndex (uint32_t sampleRate)
 
- Public Member Functions inherited from PluginInstanceGUI
 PluginInstanceGUI ()
 
virtual ~PluginInstanceGUI ()
 

Private Slots

void on_centerFrequency_changed (quint64 value)
 
void on_LOppm_valueChanged (int value)
 
void on_dcOffset_toggled (bool checked)
 
void on_iqImbalance_toggled (bool checked)
 
void on_sampleRate_currentIndexChanged (int index)
 
void on_biasT_stateChanged (int state)
 
void on_decim_currentIndexChanged (int index)
 
void on_fcPos_currentIndexChanged (int index)
 
void on_lna_valueChanged (int value)
 
void on_mix_valueChanged (int value)
 
void on_vga_valueChanged (int value)
 
void on_lnaAGC_stateChanged (int state)
 
void on_mixAGC_stateChanged (int state)
 
void on_startStop_toggled (bool checked)
 
void on_record_toggled (bool checked)
 
void on_transverter_clicked ()
 
void updateHardware ()
 
void updateStatus ()
 
void handleInputMessages ()
 
void openDeviceSettingsDialog (const QPoint &p)
 

Private Member Functions

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

Private Attributes

Ui::AirspyGui * ui
 
DeviceUISetm_deviceUISet
 
bool m_doApplySettings
 
bool m_forceSettings
 
AirspySettings m_settings
 
QTimer m_updateTimer
 
QTimer m_statusTimer
 
std::vector< uint32_tm_rates
 
DeviceSampleSourcem_sampleSource
 
int m_sampleRate
 
quint64 m_deviceCenterFrequency
 Center frequency in device. More...
 
int m_lastEngineState
 
MessageQueue m_inputMessageQueue
 

Detailed Description

Definition at line 35 of file airspygui.h.

Constructor & Destructor Documentation

◆ AirspyGui()

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

Definition at line 37 of file airspygui.cpp.

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

37  :
38  QWidget(parent),
39  ui(new Ui::AirspyGui),
40  m_deviceUISet(deviceUISet),
41  m_doApplySettings(true),
42  m_forceSettings(true),
43  m_settings(),
44  m_sampleSource(0),
46 {
48 
49  ui->setupUi(this);
50  ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
52 
53  connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware()));
54  connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus()));
55  m_statusTimer.start(500);
56 
57  CRightClickEnabler *startStopRightClickEnabler = new CRightClickEnabler(ui->startStop);
58  connect(startStopRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(openDeviceSettingsDialog(const QPoint &)));
59 
61 
62  m_rates = ((AirspyInput*) m_sampleSource)->getSampleRates();
64  connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection);
66 
67  sendSettings();
68 }
AirspySettings m_settings
Definition: airspygui.h:62
std::vector< uint32_t > m_rates
Definition: airspygui.h:65
DeviceSampleSource * getSampleSource()
Return pointer to the device sample source (single Rx) or nullptr.
Definition: deviceapi.cpp:213
void updateHardware()
Definition: airspygui.cpp:401
int m_lastEngineState
Definition: airspygui.h:69
MessageQueue m_inputMessageQueue
Definition: airspygui.h:70
DeviceSampleSource * m_sampleSource
Definition: airspygui.h:66
engine is before initialization
Definition: deviceapi.h:53
DeviceAPI * m_deviceAPI
Definition: deviceuiset.h:48
bool m_forceSettings
Definition: airspygui.h:61
void sendSettings()
Definition: airspygui.cpp:263
void updateFrequencyLimits()
Definition: airspygui.cpp:188
void displaySampleRates()
Definition: airspygui.cpp:236
bool m_doApplySettings
Definition: airspygui.h:60
QTimer m_updateTimer
Definition: airspygui.h:63
void displaySettings()
Definition: airspygui.cpp:203
Ui::AirspyGui * ui
Definition: airspygui.h:57
virtual void setMessageQueueToGUI(MessageQueue *queue)=0
DeviceUISet * m_deviceUISet
Definition: airspygui.h:59
void updateStatus()
Definition: airspygui.cpp:410
void handleInputMessages()
Definition: airspygui.cpp:153
QTimer m_statusTimer
Definition: airspygui.h:64
void openDeviceSettingsDialog(const QPoint &p)
Definition: airspygui.cpp:464
+ Here is the call graph for this function:

◆ ~AirspyGui()

AirspyGui::~AirspyGui ( )
virtual

Definition at line 70 of file airspygui.cpp.

References ui.

71 {
72  delete ui;
73 }
Ui::AirspyGui * ui
Definition: airspygui.h:57

Member Function Documentation

◆ blockApplySettings()

void AirspyGui::blockApplySettings ( bool  block)
inlineprivate

Definition at line 72 of file airspygui.h.

Referenced by handleMessage().

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

◆ deserialize()

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

Implements PluginInstanceGUI.

Definition at line 114 of file airspygui.cpp.

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

115 {
116  if(m_settings.deserialize(data)) {
117  displaySettings();
118  m_forceSettings = true;
119  sendSettings();
120  return true;
121  } else {
122  resetToDefaults();
123  return false;
124  }
125 }
AirspySettings m_settings
Definition: airspygui.h:62
void resetToDefaults()
Definition: airspygui.cpp:90
bool m_forceSettings
Definition: airspygui.h:61
void sendSettings()
Definition: airspygui.cpp:263
void displaySettings()
Definition: airspygui.cpp:203
bool deserialize(const QByteArray &data)
+ Here is the call graph for this function:

◆ destroy()

void AirspyGui::destroy ( )
virtual

Implements PluginInstanceGUI.

Definition at line 75 of file airspygui.cpp.

76 {
77  delete this;
78 }

◆ displaySampleRates()

void AirspyGui::displaySampleRates ( )
private

Definition at line 236 of file airspygui.cpp.

References arg(), i, AirspySettings::m_devSampleRateIndex, m_rates, m_settings, and ui.

Referenced by AirspyGui().

237 {
238  unsigned int savedIndex = m_settings.m_devSampleRateIndex;
239  ui->sampleRate->blockSignals(true);
240 
241  if (m_rates.size() > 0)
242  {
243  ui->sampleRate->clear();
244 
245  for (unsigned int i = 0; i < m_rates.size(); i++)
246  {
247  ui->sampleRate->addItem(QString("%1").arg(QString::number(m_rates[i]/1000000.0, 'f', 1)));
248  }
249  }
250 
251  ui->sampleRate->blockSignals(false);
252 
253  if (savedIndex < m_rates.size())
254  {
255  ui->sampleRate->setCurrentIndex(savedIndex);
256  }
257  else
258  {
259  ui->sampleRate->setCurrentIndex((int) m_rates.size()-1);
260  }
261 }
quint32 m_devSampleRateIndex
AirspySettings m_settings
Definition: airspygui.h:62
std::vector< uint32_t > m_rates
Definition: airspygui.h:65
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
int32_t i
Definition: decimators.h:244
Ui::AirspyGui * ui
Definition: airspygui.h:57
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ displaySettings()

void AirspyGui::displaySettings ( )
private

Definition at line 203 of file airspygui.cpp.

References arg(), AirspySettings::m_biasT, AirspySettings::m_centerFrequency, AirspySettings::m_dcBlock, AirspySettings::m_devSampleRateIndex, AirspySettings::m_fcPos, AirspySettings::m_iqCorrection, AirspySettings::m_lnaAGC, AirspySettings::m_lnaGain, AirspySettings::m_log2Decim, AirspySettings::m_LOppmTenths, AirspySettings::m_mixerAGC, AirspySettings::m_mixerGain, m_settings, AirspySettings::m_transverterDeltaFrequency, AirspySettings::m_transverterMode, AirspySettings::m_vgaGain, ui, and updateFrequencyLimits().

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

204 {
205  ui->transverter->setDeltaFrequency(m_settings.m_transverterDeltaFrequency);
206  ui->transverter->setDeltaFrequencyActive(m_settings.m_transverterMode);
208  ui->centerFrequency->setValue(m_settings.m_centerFrequency / 1000);
209 
210  ui->LOppm->setValue(m_settings.m_LOppmTenths);
211  ui->LOppmText->setText(QString("%1").arg(QString::number(m_settings.m_LOppmTenths/10.0, 'f', 1)));
212 
213  ui->sampleRate->setCurrentIndex(m_settings.m_devSampleRateIndex);
214 
215  ui->biasT->setChecked(m_settings.m_biasT);
216  ui->dcOffset->setChecked(m_settings.m_dcBlock);
217  ui->iqImbalance->setChecked(m_settings.m_iqCorrection);
218 
219  ui->decim->setCurrentIndex(m_settings.m_log2Decim);
220 
221  ui->fcPos->setCurrentIndex((int) m_settings.m_fcPos);
222 
223  ui->lnaGainText->setText(tr("%1dB").arg(m_settings.m_lnaGain));
224  ui->lna->setValue(m_settings.m_lnaGain);
225 
226  ui->mixText->setText(tr("%1dB").arg(m_settings.m_mixerGain));
227  ui->mix->setValue(m_settings.m_mixerGain);
228 
229  ui->vgaText->setText(tr("%1dB").arg(m_settings.m_vgaGain));
230  ui->vga->setValue(m_settings.m_vgaGain);
231 
232  ui->lnaAGC->setChecked(m_settings.m_lnaAGC);
233  ui->mixAGC->setChecked(m_settings.m_mixerAGC);
234 }
quint32 m_devSampleRateIndex
AirspySettings m_settings
Definition: airspygui.h:62
quint64 m_centerFrequency
quint32 m_log2Decim
quint32 m_mixerGain
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void updateFrequencyLimits()
Definition: airspygui.cpp:188
qint64 m_transverterDeltaFrequency
Ui::AirspyGui * ui
Definition: airspygui.h:57
qint32 m_LOppmTenths
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCenterFrequency()

qint64 AirspyGui::getCenterFrequency ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 97 of file airspygui.cpp.

References AirspySettings::m_centerFrequency, and m_settings.

98 {
100 }
AirspySettings m_settings
Definition: airspygui.h:62
quint64 m_centerFrequency

◆ getDevSampleRate()

uint32_t AirspyGui::getDevSampleRate ( unsigned int  index)

Definition at line 439 of file airspygui.cpp.

References m_rates.

440 {
441  if (rate_index < m_rates.size())
442  {
443  return m_rates[rate_index];
444  }
445  else
446  {
447  return m_rates[0];
448  }
449 }
std::vector< uint32_t > m_rates
Definition: airspygui.h:65

◆ getDevSampleRateIndex()

int AirspyGui::getDevSampleRateIndex ( uint32_t  sampleRate)

Definition at line 451 of file airspygui.cpp.

References i, and m_rates.

452 {
453  for (unsigned int i=0; i < m_rates.size(); i++)
454  {
455  if (sampeRate == m_rates[i])
456  {
457  return i;
458  }
459  }
460 
461  return -1;
462 }
std::vector< uint32_t > m_rates
Definition: airspygui.h:65
int32_t i
Definition: decimators.h:244

◆ getInputMessageQueue()

virtual MessageQueue* AirspyGui::getInputMessageQueue ( )
inlinevirtual

Implements PluginInstanceGUI.

Definition at line 51 of file airspygui.h.

51 { return &m_inputMessageQueue; }
MessageQueue m_inputMessageQueue
Definition: airspygui.h:70

◆ getName()

QString AirspyGui::getName ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 85 of file airspygui.cpp.

86 {
87  return objectName();
88 }

◆ handleInputMessages

void AirspyGui::handleInputMessages ( )
privateslot

Definition at line 153 of file airspygui.cpp.

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

Referenced by AirspyGui().

154 {
155  Message* message;
156 
157  while ((message = m_inputMessageQueue.pop()) != 0)
158  {
159  qDebug("AirspyGui::handleInputMessages: message: %s", message->getIdentifier());
160 
161  if (DSPSignalNotification::match(*message))
162  {
163  DSPSignalNotification* notif = (DSPSignalNotification*) message;
164  m_sampleRate = notif->getSampleRate();
166  qDebug("AirspyGui::handleInputMessages: DSPSignalNotification: SampleRate:%d, CenterFrequency:%llu", notif->getSampleRate(), notif->getCenterFrequency());
168 
169  delete message;
170  }
171  else
172  {
173  if (handleMessage(*message))
174  {
175  delete message;
176  }
177  }
178  }
179 }
Message * pop()
Pop message from queue.
MessageQueue m_inputMessageQueue
Definition: airspygui.h:70
void updateSampleRateAndFrequency()
Definition: airspygui.cpp:181
qint64 getCenterFrequency() const
Definition: dspcommands.h:329
static bool match(const Message *message)
Definition: message.cpp:45
virtual bool handleMessage(const Message &message)
Definition: airspygui.cpp:127
int getSampleRate() const
Definition: dspcommands.h:328
virtual const char * getIdentifier() const
Definition: message.cpp:35
quint64 m_deviceCenterFrequency
Center frequency in device.
Definition: airspygui.h:68
int m_sampleRate
Definition: airspygui.h:67
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleMessage()

bool AirspyGui::handleMessage ( const Message message)
virtual

Implements PluginInstanceGUI.

Definition at line 127 of file airspygui.cpp.

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

Referenced by handleInputMessages().

128 {
130  {
132  m_settings = cfg.getSettings();
133  blockApplySettings(true);
134  displaySettings();
135  blockApplySettings(false);
136  return true;
137  }
138  else if (AirspyInput::MsgStartStop::match(message))
139  {
141  blockApplySettings(true);
142  ui->startStop->setChecked(notif.getStartStop());
143  blockApplySettings(false);
144 
145  return true;
146  }
147  else
148  {
149  return false;
150  }
151 }
AirspySettings m_settings
Definition: airspygui.h:62
const AirspySettings & getSettings() const
Definition: airspyinput.h:42
void blockApplySettings(bool block)
Definition: airspygui.h:72
static bool match(const Message *message)
Definition: message.cpp:45
bool getStartStop() const
Definition: airspyinput.h:84
void displaySettings()
Definition: airspygui.cpp:203
Ui::AirspyGui * ui
Definition: airspygui.h:57
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_biasT_stateChanged

void AirspyGui::on_biasT_stateChanged ( int  state)
privateslot

Definition at line 300 of file airspygui.cpp.

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

301 {
302  m_settings.m_biasT = (state == Qt::Checked);
303  sendSettings();
304 }
AirspySettings m_settings
Definition: airspygui.h:62
void sendSettings()
Definition: airspygui.cpp:263
+ Here is the call graph for this function:

◆ on_centerFrequency_changed

void AirspyGui::on_centerFrequency_changed ( quint64  value)
privateslot

Definition at line 269 of file airspygui.cpp.

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

270 {
271  m_settings.m_centerFrequency = value * 1000;
272  sendSettings();
273 }
AirspySettings m_settings
Definition: airspygui.h:62
quint64 m_centerFrequency
void sendSettings()
Definition: airspygui.cpp:263
+ Here is the call graph for this function:

◆ on_dcOffset_toggled

void AirspyGui::on_dcOffset_toggled ( bool  checked)
privateslot

Definition at line 282 of file airspygui.cpp.

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

283 {
284  m_settings.m_dcBlock = checked;
285  sendSettings();
286 }
AirspySettings m_settings
Definition: airspygui.h:62
void sendSettings()
Definition: airspygui.cpp:263
+ Here is the call graph for this function:

◆ on_decim_currentIndexChanged

void AirspyGui::on_decim_currentIndexChanged ( int  index)
privateslot

Definition at line 318 of file airspygui.cpp.

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

319 {
320  if ((index <0) || (index > 6))
321  return;
322  m_settings.m_log2Decim = index;
323  sendSettings();
324 }
AirspySettings m_settings
Definition: airspygui.h:62
quint32 m_log2Decim
void sendSettings()
Definition: airspygui.cpp:263
+ Here is the call graph for this function:

◆ on_fcPos_currentIndexChanged

void AirspyGui::on_fcPos_currentIndexChanged ( int  index)
privateslot

Definition at line 326 of file airspygui.cpp.

References AirspySettings::FC_POS_CENTER, AirspySettings::FC_POS_INFRA, AirspySettings::FC_POS_SUPRA, AirspySettings::m_fcPos, m_settings, and sendSettings().

327 {
328  if (index == 0) {
330  sendSettings();
331  } else if (index == 1) {
333  sendSettings();
334  } else if (index == 2) {
336  sendSettings();
337  }
338 }
AirspySettings m_settings
Definition: airspygui.h:62
void sendSettings()
Definition: airspygui.cpp:263
+ Here is the call graph for this function:

◆ on_iqImbalance_toggled

void AirspyGui::on_iqImbalance_toggled ( bool  checked)
privateslot

Definition at line 288 of file airspygui.cpp.

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

289 {
290  m_settings.m_iqCorrection = checked;
291  sendSettings();
292 }
AirspySettings m_settings
Definition: airspygui.h:62
void sendSettings()
Definition: airspygui.cpp:263
+ Here is the call graph for this function:

◆ on_lna_valueChanged

void AirspyGui::on_lna_valueChanged ( int  value)
privateslot

Definition at line 340 of file airspygui.cpp.

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

341 {
342  if ((value < 0) || (value > 14))
343  return;
344 
345  ui->lnaGainText->setText(tr("%1dB").arg(value));
346  m_settings.m_lnaGain = value;
347  sendSettings();
348 }
AirspySettings m_settings
Definition: airspygui.h:62
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void sendSettings()
Definition: airspygui.cpp:263
Ui::AirspyGui * ui
Definition: airspygui.h:57
+ Here is the call graph for this function:

◆ on_lnaAGC_stateChanged

void AirspyGui::on_lnaAGC_stateChanged ( int  state)
privateslot

Definition at line 306 of file airspygui.cpp.

References AirspySettings::m_lnaAGC, m_settings, and sendSettings().

307 {
308  m_settings.m_lnaAGC = (state == Qt::Checked);
309  sendSettings();
310 }
AirspySettings m_settings
Definition: airspygui.h:62
void sendSettings()
Definition: airspygui.cpp:263
+ Here is the call graph for this function:

◆ on_LOppm_valueChanged

void AirspyGui::on_LOppm_valueChanged ( int  value)
privateslot

Definition at line 275 of file airspygui.cpp.

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

276 {
277  m_settings.m_LOppmTenths = value;
278  ui->LOppmText->setText(QString("%1").arg(QString::number(m_settings.m_LOppmTenths/10.0, 'f', 1)));
279  sendSettings();
280 }
AirspySettings m_settings
Definition: airspygui.h:62
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void sendSettings()
Definition: airspygui.cpp:263
Ui::AirspyGui * ui
Definition: airspygui.h:57
qint32 m_LOppmTenths
+ Here is the call graph for this function:

◆ on_mix_valueChanged

void AirspyGui::on_mix_valueChanged ( int  value)
privateslot

Definition at line 350 of file airspygui.cpp.

References arg(), AirspySettings::m_mixerGain, m_settings, sendSettings(), and ui.

351 {
352  if ((value < 0) || (value > 15))
353  return;
354 
355  ui->mixText->setText(tr("%1dB").arg(value));
356  m_settings.m_mixerGain = value;
357  sendSettings();
358 }
AirspySettings m_settings
Definition: airspygui.h:62
quint32 m_mixerGain
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void sendSettings()
Definition: airspygui.cpp:263
Ui::AirspyGui * ui
Definition: airspygui.h:57
+ Here is the call graph for this function:

◆ on_mixAGC_stateChanged

void AirspyGui::on_mixAGC_stateChanged ( int  state)
privateslot

Definition at line 312 of file airspygui.cpp.

References AirspySettings::m_mixerAGC, m_settings, and sendSettings().

313 {
314  m_settings.m_mixerAGC = (state == Qt::Checked);
315  sendSettings();
316 }
AirspySettings m_settings
Definition: airspygui.h:62
void sendSettings()
Definition: airspygui.cpp:263
+ Here is the call graph for this function:

◆ on_record_toggled

void AirspyGui::on_record_toggled ( bool  checked)
privateslot

Definition at line 379 of file airspygui.cpp.

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

380 {
381  if (checked) {
382  ui->record->setStyleSheet("QToolButton { background-color : red; }");
383  } else {
384  ui->record->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
385  }
386 
389 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
DeviceSampleSource * m_sampleSource
Definition: airspygui.h:66
Ui::AirspyGui * ui
Definition: airspygui.h:57
static MsgFileRecord * create(bool startStop)
Definition: airspyinput.h:67
+ Here is the call graph for this function:

◆ on_sampleRate_currentIndexChanged

void AirspyGui::on_sampleRate_currentIndexChanged ( int  index)
privateslot

Definition at line 294 of file airspygui.cpp.

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

295 {
297  sendSettings();
298 }
quint32 m_devSampleRateIndex
AirspySettings m_settings
Definition: airspygui.h:62
void sendSettings()
Definition: airspygui.cpp:263
+ Here is the call graph for this function:

◆ on_startStop_toggled

void AirspyGui::on_startStop_toggled ( bool  checked)
privateslot

Definition at line 370 of file airspygui.cpp.

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

371 {
372  if (m_doApplySettings)
373  {
376  }
377 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
static MsgStartStop * create(bool startStop)
Definition: airspyinput.h:86
DeviceSampleSource * m_sampleSource
Definition: airspygui.h:66
bool m_doApplySettings
Definition: airspygui.h:60
+ Here is the call graph for this function:

◆ on_transverter_clicked

void AirspyGui::on_transverter_clicked ( )
privateslot

Definition at line 391 of file airspygui.cpp.

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

392 {
393  m_settings.m_transverterMode = ui->transverter->getDeltaFrequencyAcive();
394  m_settings.m_transverterDeltaFrequency = ui->transverter->getDeltaFrequency();
395  qDebug("AirspyGui::on_transverter_clicked: %lld Hz %s", m_settings.m_transverterDeltaFrequency, m_settings.m_transverterMode ? "on" : "off");
397  m_settings.m_centerFrequency = ui->centerFrequency->getValueNew()*1000;
398  sendSettings();
399 }
AirspySettings m_settings
Definition: airspygui.h:62
quint64 m_centerFrequency
void sendSettings()
Definition: airspygui.cpp:263
void updateFrequencyLimits()
Definition: airspygui.cpp:188
qint64 m_transverterDeltaFrequency
Ui::AirspyGui * ui
Definition: airspygui.h:57
+ Here is the call graph for this function:

◆ on_vga_valueChanged

void AirspyGui::on_vga_valueChanged ( int  value)
privateslot

Definition at line 360 of file airspygui.cpp.

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

361 {
362  if ((value < 0) || (value > 15))
363  return;
364 
365  ui->vgaText->setText(tr("%1dB").arg(value));
366  m_settings.m_vgaGain = value;
367  sendSettings();
368 }
AirspySettings m_settings
Definition: airspygui.h:62
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void sendSettings()
Definition: airspygui.cpp:263
Ui::AirspyGui * ui
Definition: airspygui.h:57
+ Here is the call graph for this function:

◆ openDeviceSettingsDialog

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

Definition at line 464 of file airspygui.cpp.

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

Referenced by AirspyGui().

465 {
466  BasicDeviceSettingsDialog dialog(this);
467  dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
468  dialog.setReverseAPIAddress(m_settings.m_reverseAPIAddress);
469  dialog.setReverseAPIPort(m_settings.m_reverseAPIPort);
470  dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex);
471 
472  dialog.move(p);
473  dialog.exec();
474 
475  m_settings.m_useReverseAPI = dialog.useReverseAPI();
476  m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress();
477  m_settings.m_reverseAPIPort = dialog.getReverseAPIPort();
478  m_settings.m_reverseAPIDeviceIndex = dialog.getReverseAPIDeviceIndex();
479 
480  sendSettings();
481 }
AirspySettings m_settings
Definition: airspygui.h:62
void sendSettings()
Definition: airspygui.cpp:263
uint16_t m_reverseAPIPort
QString m_reverseAPIAddress
uint16_t m_reverseAPIDeviceIndex
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetToDefaults()

void AirspyGui::resetToDefaults ( )
virtual

Implements PluginInstanceGUI.

Definition at line 90 of file airspygui.cpp.

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

Referenced by deserialize().

91 {
94  sendSettings();
95 }
AirspySettings m_settings
Definition: airspygui.h:62
void sendSettings()
Definition: airspygui.cpp:263
void displaySettings()
Definition: airspygui.cpp:203
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendSettings()

void AirspyGui::sendSettings ( )
private

◆ serialize()

QByteArray AirspyGui::serialize ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 109 of file airspygui.cpp.

References m_settings, and AirspySettings::serialize().

110 {
111  return m_settings.serialize();
112 }
AirspySettings m_settings
Definition: airspygui.h:62
QByteArray serialize() const
+ Here is the call graph for this function:

◆ setCenterFrequency()

void AirspyGui::setCenterFrequency ( qint64  centerFrequency)
virtual

Implements PluginInstanceGUI.

Definition at line 102 of file airspygui.cpp.

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

103 {
104  m_settings.m_centerFrequency = centerFrequency;
105  displaySettings();
106  sendSettings();
107 }
AirspySettings m_settings
Definition: airspygui.h:62
quint64 m_centerFrequency
void sendSettings()
Definition: airspygui.cpp:263
void displaySettings()
Definition: airspygui.cpp:203
+ Here is the call graph for this function:

◆ setName()

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

Implements PluginInstanceGUI.

Definition at line 80 of file airspygui.cpp.

81 {
82  setObjectName(name);
83 }

◆ updateFrequencyLimits()

void AirspyGui::updateFrequencyLimits ( )
private

Definition at line 188 of file airspygui.cpp.

References AirspyInput::loHighLimitFreq, AirspyInput::loLowLimitFreq, m_settings, AirspySettings::m_transverterDeltaFrequency, AirspySettings::m_transverterMode, and ui.

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

189 {
190  // values in kHz
191  qint64 deltaFrequency = m_settings.m_transverterMode ? m_settings.m_transverterDeltaFrequency/1000 : 0;
192  qint64 minLimit = AirspyInput::loLowLimitFreq/1000 + deltaFrequency;
193  qint64 maxLimit = AirspyInput::loHighLimitFreq/1000 + deltaFrequency;
194 
195  minLimit = minLimit < 0 ? 0 : minLimit > 9999999 ? 9999999 : minLimit;
196  maxLimit = maxLimit < 0 ? 0 : maxLimit > 9999999 ? 9999999 : maxLimit;
197 
198  qDebug("AirspyGui::updateFrequencyLimits: delta: %lld min: %lld max: %lld", deltaFrequency, minLimit, maxLimit);
199 
200  ui->centerFrequency->setValueRange(7, minLimit, maxLimit);
201 }
AirspySettings m_settings
Definition: airspygui.h:62
static const qint64 loLowLimitFreq
Definition: airspyinput.h:143
qint64 m_transverterDeltaFrequency
static const qint64 loHighLimitFreq
Definition: airspyinput.h:144
Ui::AirspyGui * ui
Definition: airspygui.h:57
+ Here is the caller graph for this function:

◆ updateHardware

void AirspyGui::updateHardware ( )
privateslot

Definition at line 401 of file airspygui.cpp.

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

Referenced by AirspyGui().

402 {
403  qDebug() << "AirspyGui::updateHardware";
406  m_forceSettings = false;
407  m_updateTimer.stop();
408 }
AirspySettings m_settings
Definition: airspygui.h:62
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
DeviceSampleSource * m_sampleSource
Definition: airspygui.h:66
bool m_forceSettings
Definition: airspygui.h:61
QTimer m_updateTimer
Definition: airspygui.h:63
static MsgConfigureAirspy * create(const AirspySettings &settings, bool force)
Definition: airspyinput.h:45
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateSampleRateAndFrequency()

void AirspyGui::updateSampleRateAndFrequency ( )
private

Definition at line 181 of file airspygui.cpp.

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

Referenced by handleInputMessages().

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

◆ updateStatus

void AirspyGui::updateStatus ( )
privateslot

Definition at line 410 of file airspygui.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 AirspyGui().

411 {
412  int state = m_deviceUISet->m_deviceAPI->state();
413 
414  if(m_lastEngineState != state)
415  {
416  switch(state)
417  {
419  ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
420  break;
421  case DeviceAPI::StIdle:
422  ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
423  break;
425  ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
426  break;
427  case DeviceAPI::StError:
428  ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
429  QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
430  break;
431  default:
432  break;
433  }
434 
435  m_lastEngineState = state;
436  }
437 }
QString errorMessage()
Last error message from the device engine.
Definition: deviceapi.cpp:290
int m_lastEngineState
Definition: airspygui.h:69
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::AirspyGui * ui
Definition: airspygui.h:57
engine is running
Definition: deviceapi.h:56
DeviceUISet * m_deviceUISet
Definition: airspygui.h:59
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 AirspyGui::m_deviceCenterFrequency
private

Center frequency in device.

Definition at line 68 of file airspygui.h.

Referenced by handleInputMessages(), and updateSampleRateAndFrequency().

◆ m_deviceUISet

DeviceUISet* AirspyGui::m_deviceUISet
private

Definition at line 59 of file airspygui.h.

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

◆ m_doApplySettings

bool AirspyGui::m_doApplySettings
private

Definition at line 60 of file airspygui.h.

Referenced by on_startStop_toggled().

◆ m_forceSettings

bool AirspyGui::m_forceSettings
private

Definition at line 61 of file airspygui.h.

Referenced by deserialize(), and updateHardware().

◆ m_inputMessageQueue

MessageQueue AirspyGui::m_inputMessageQueue
private

Definition at line 70 of file airspygui.h.

Referenced by AirspyGui(), and handleInputMessages().

◆ m_lastEngineState

int AirspyGui::m_lastEngineState
private

Definition at line 69 of file airspygui.h.

Referenced by updateStatus().

◆ m_rates

std::vector<uint32_t> AirspyGui::m_rates
private

Definition at line 65 of file airspygui.h.

Referenced by AirspyGui(), displaySampleRates(), getDevSampleRate(), and getDevSampleRateIndex().

◆ m_sampleRate

int AirspyGui::m_sampleRate
private

Definition at line 67 of file airspygui.h.

Referenced by handleInputMessages(), and updateSampleRateAndFrequency().

◆ m_sampleSource

DeviceSampleSource* AirspyGui::m_sampleSource
private

Definition at line 66 of file airspygui.h.

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

◆ m_settings

AirspySettings AirspyGui::m_settings
private

◆ m_statusTimer

QTimer AirspyGui::m_statusTimer
private

Definition at line 64 of file airspygui.h.

Referenced by AirspyGui().

◆ m_updateTimer

QTimer AirspyGui::m_updateTimer
private

Definition at line 63 of file airspygui.h.

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

◆ ui

Ui::AirspyGui* AirspyGui::ui
private

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