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

#include <airspyhfgui.h>

+ Inheritance diagram for AirspyHFGui:
+ Collaboration diagram for AirspyHFGui:

Public Member Functions

 AirspyHFGui (DeviceUISet *deviceUISet, QWidget *parent=0)
 
virtual ~AirspyHFGui ()
 
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_resetLOppm_clicked ()
 
void on_dcOffset_toggled (bool checked)
 
void on_iqImbalance_toggled (bool checked)
 
void on_sampleRate_currentIndexChanged (int index)
 
void on_decim_currentIndexChanged (int index)
 
void on_startStop_toggled (bool checked)
 
void on_record_toggled (bool checked)
 
void on_transverter_clicked ()
 
void on_band_currentIndexChanged (int index)
 
void on_dsp_toggled (bool checked)
 
void on_lna_toggled (bool checked)
 
void on_agc_currentIndexChanged (int index)
 
void on_att_currentIndexChanged (int index)
 
void updateHardware ()
 
void updateStatus ()
 
void handleInputMessages ()
 
void openDeviceSettingsDialog (const QPoint &p)
 

Private Member Functions

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

Private Attributes

Ui::AirspyHFGui * ui
 
DeviceUISetm_deviceUISet
 
bool m_doApplySettings
 
bool m_forceSettings
 
AirspyHFSettings 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 36 of file airspyhfgui.h.

Constructor & Destructor Documentation

◆ AirspyHFGui()

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

Definition at line 36 of file airspyhfgui.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().

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

◆ ~AirspyHFGui()

AirspyHFGui::~AirspyHFGui ( )
virtual

Definition at line 69 of file airspyhfgui.cpp.

References ui.

70 {
71  delete ui;
72 }
Ui::AirspyHFGui * ui
Definition: airspyhfgui.h:58

Member Function Documentation

◆ blockApplySettings()

void AirspyHFGui::blockApplySettings ( bool  block)
inlineprivate

Definition at line 73 of file airspyhfgui.h.

Referenced by displaySettings(), and handleMessage().

73 { m_doApplySettings = !block; }
bool m_doApplySettings
Definition: airspyhfgui.h:61
+ Here is the caller graph for this function:

◆ deserialize()

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

Implements PluginInstanceGUI.

Definition at line 113 of file airspyhfgui.cpp.

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

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

◆ destroy()

void AirspyHFGui::destroy ( )
virtual

Implements PluginInstanceGUI.

Definition at line 74 of file airspyhfgui.cpp.

75 {
76  delete this;
77 }

◆ displayAGC()

void AirspyHFGui::displayAGC ( )
private

Definition at line 268 of file airspyhfgui.cpp.

References AirspyHFSettings::m_agcHigh, m_settings, AirspyHFSettings::m_useAGC, and ui.

Referenced by displaySettings().

269 {
270  if (m_settings.m_useAGC)
271  {
272  if (m_settings.m_agcHigh) {
273  ui->agc->setCurrentIndex(2);
274  } else {
275  ui->agc->setCurrentIndex(1);
276  }
277  }
278  else
279  {
280  ui->agc->setCurrentIndex(0);
281  }
282 }
AirspyHFSettings m_settings
Definition: airspyhfgui.h:63
Ui::AirspyHFGui * ui
Definition: airspyhfgui.h:58
+ Here is the caller graph for this function:

◆ displaySampleRates()

void AirspyHFGui::displaySampleRates ( )
private

Definition at line 240 of file airspyhfgui.cpp.

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

Referenced by AirspyHFGui().

241 {
242  unsigned int savedIndex = m_settings.m_devSampleRateIndex;
243  ui->sampleRate->blockSignals(true);
244 
245  if (m_rates.size() > 0)
246  {
247  ui->sampleRate->clear();
248 
249  for (unsigned int i = 0; i < m_rates.size(); i++)
250  {
251  int sampleRate = m_rates[i]/1000;
252  ui->sampleRate->addItem(QString("%1").arg(QString("%1").arg(sampleRate, 5, 10, QChar(' '))));
253  }
254  }
255 
256  ui->sampleRate->blockSignals(false);
257 
258  if (savedIndex < m_rates.size())
259  {
260  ui->sampleRate->setCurrentIndex(savedIndex);
261  }
262  else
263  {
264  ui->sampleRate->setCurrentIndex((int) m_rates.size()-1);
265  }
266 }
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
AirspyHFSettings m_settings
Definition: airspyhfgui.h:63
int32_t i
Definition: decimators.h:244
quint32 m_devSampleRateIndex
std::vector< uint32_t > m_rates
Definition: airspyhfgui.h:66
Ui::AirspyHFGui * ui
Definition: airspyhfgui.h:58
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ displaySettings()

void AirspyHFGui::displaySettings ( )
private

Definition at line 216 of file airspyhfgui.cpp.

References arg(), blockApplySettings(), displayAGC(), AirspyHFSettings::m_attenuatorSteps, AirspyHFSettings::m_bandIndex, AirspyHFSettings::m_centerFrequency, AirspyHFSettings::m_dcBlock, AirspyHFSettings::m_devSampleRateIndex, AirspyHFSettings::m_iqCorrection, AirspyHFSettings::m_log2Decim, AirspyHFSettings::m_LOppmTenths, m_settings, AirspyHFSettings::m_transverterDeltaFrequency, AirspyHFSettings::m_transverterMode, AirspyHFSettings::m_useDSP, AirspyHFSettings::m_useLNA, ui, and updateFrequencyLimits().

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

217 {
218  blockApplySettings(true);
219  ui->band->blockSignals(true);
220  m_settings.m_bandIndex = m_settings.m_centerFrequency <= 31000000UL ? 0 : 1; // override
221  ui->band->setCurrentIndex(m_settings.m_bandIndex);
223  ui->transverter->setDeltaFrequency(m_settings.m_transverterDeltaFrequency);
224  ui->transverter->setDeltaFrequencyActive(m_settings.m_transverterMode);
225  ui->centerFrequency->setValue(m_settings.m_centerFrequency / 1000);
226  ui->LOppm->setValue(m_settings.m_LOppmTenths);
227  ui->LOppmText->setText(QString("%1").arg(QString::number(m_settings.m_LOppmTenths/10.0, 'f', 1)));
228  ui->sampleRate->setCurrentIndex(m_settings.m_devSampleRateIndex);
229  ui->decim->setCurrentIndex(m_settings.m_log2Decim);
230  ui->band->blockSignals(false);
231  ui->dsp->setChecked(m_settings.m_useDSP);
232  ui->lna->setChecked(m_settings.m_useLNA);
233  ui->att->setCurrentIndex(m_settings.m_attenuatorSteps);
234  ui->dcOffset->setChecked(m_settings.m_dcBlock);
235  ui->iqImbalance->setChecked(m_settings.m_iqCorrection);
236  displayAGC();
237  blockApplySettings(false);
238 }
void displayAGC()
void blockApplySettings(bool block)
Definition: airspyhfgui.h:73
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
AirspyHFSettings m_settings
Definition: airspyhfgui.h:63
qint64 m_transverterDeltaFrequency
quint32 m_devSampleRateIndex
void updateFrequencyLimits()
Ui::AirspyHFGui * ui
Definition: airspyhfgui.h:58
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCenterFrequency()

qint64 AirspyHFGui::getCenterFrequency ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 96 of file airspyhfgui.cpp.

References AirspyHFSettings::m_centerFrequency, and m_settings.

97 {
99 }
AirspyHFSettings m_settings
Definition: airspyhfgui.h:63

◆ getDevSampleRate()

uint32_t AirspyHFGui::getDevSampleRate ( unsigned int  index)

Definition at line 458 of file airspyhfgui.cpp.

References m_rates.

459 {
460  if (rate_index < m_rates.size())
461  {
462  return m_rates[rate_index];
463  }
464  else
465  {
466  return m_rates[0];
467  }
468 }
std::vector< uint32_t > m_rates
Definition: airspyhfgui.h:66

◆ getDevSampleRateIndex()

int AirspyHFGui::getDevSampleRateIndex ( uint32_t  sampleRate)

Definition at line 470 of file airspyhfgui.cpp.

References i, and m_rates.

471 {
472  for (unsigned int i=0; i < m_rates.size(); i++)
473  {
474  if (sampeRate == m_rates[i])
475  {
476  return i;
477  }
478  }
479 
480  return -1;
481 }
int32_t i
Definition: decimators.h:244
std::vector< uint32_t > m_rates
Definition: airspyhfgui.h:66

◆ getInputMessageQueue()

virtual MessageQueue* AirspyHFGui::getInputMessageQueue ( )
inlinevirtual

Implements PluginInstanceGUI.

Definition at line 52 of file airspyhfgui.h.

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

◆ getName()

QString AirspyHFGui::getName ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 84 of file airspyhfgui.cpp.

85 {
86  return objectName();
87 }

◆ handleInputMessages

void AirspyHFGui::handleInputMessages ( )
privateslot

Definition at line 152 of file airspyhfgui.cpp.

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

Referenced by AirspyHFGui().

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

◆ handleMessage()

bool AirspyHFGui::handleMessage ( const Message message)
virtual

Implements PluginInstanceGUI.

Definition at line 126 of file airspyhfgui.cpp.

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

Referenced by handleInputMessages().

127 {
129  {
131  m_settings = cfg.getSettings();
132  blockApplySettings(true);
133  displaySettings();
134  blockApplySettings(false);
135  return true;
136  }
137  else if (AirspyHFInput::MsgStartStop::match(message))
138  {
140  blockApplySettings(true);
141  ui->startStop->setChecked(notif.getStartStop());
142  blockApplySettings(false);
143 
144  return true;
145  }
146  else
147  {
148  return false;
149  }
150 }
void displaySettings()
void blockApplySettings(bool block)
Definition: airspyhfgui.h:73
AirspyHFSettings m_settings
Definition: airspyhfgui.h:63
static bool match(const Message *message)
Definition: message.cpp:45
const AirspyHFSettings & getSettings() const
Definition: airspyhfinput.h:43
Ui::AirspyHFGui * ui
Definition: airspyhfgui.h:58
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_agc_currentIndexChanged

void AirspyHFGui::on_agc_currentIndexChanged ( int  index)
privateslot

Definition at line 378 of file airspyhfgui.cpp.

References AirspyHFSettings::m_agcHigh, m_settings, AirspyHFSettings::m_useAGC, and sendSettings().

379 {
380  if (index == 0)
381  {
382  m_settings.m_useAGC = false;
383  sendSettings();
384  }
385  else if (index <= 2)
386  {
387  m_settings.m_useAGC = true;
388 
389  if (index == 1) {
390  m_settings.m_agcHigh = false;
391  } else {
392  m_settings.m_agcHigh = true;
393  }
394 
395  sendSettings();
396  }
397 }
void sendSettings()
AirspyHFSettings m_settings
Definition: airspyhfgui.h:63
+ Here is the call graph for this function:

◆ on_att_currentIndexChanged

void AirspyHFGui::on_att_currentIndexChanged ( int  index)
privateslot

Definition at line 399 of file airspyhfgui.cpp.

References AirspyHFSettings::m_attenuatorSteps, m_settings, and sendSettings().

400 {
401  if ((index >= 0) && (index <= 8))
402  {
404  sendSettings();
405  }
406 }
void sendSettings()
AirspyHFSettings m_settings
Definition: airspyhfgui.h:63
+ Here is the call graph for this function:

◆ on_band_currentIndexChanged

void AirspyHFGui::on_band_currentIndexChanged ( int  index)
privateslot

Definition at line 353 of file airspyhfgui.cpp.

References AirspyHFSettings::m_bandIndex, AirspyHFSettings::m_centerFrequency, m_settings, sendSettings(), ui, and updateFrequencyLimits().

354 {
355  if ((index < 0) || (index > 1)) {
356  return;
357  }
358 
359  m_settings.m_bandIndex = index;
361  qDebug("AirspyHFGui::on_band_currentIndexChanged: freq: %llu", ui->centerFrequency->getValueNew() * 1000);
362  m_settings.m_centerFrequency = ui->centerFrequency->getValueNew() * 1000;
363  sendSettings();
364 }
void sendSettings()
AirspyHFSettings m_settings
Definition: airspyhfgui.h:63
void updateFrequencyLimits()
Ui::AirspyHFGui * ui
Definition: airspyhfgui.h:58
+ Here is the call graph for this function:

◆ on_centerFrequency_changed

void AirspyHFGui::on_centerFrequency_changed ( quint64  value)
privateslot

Definition at line 290 of file airspyhfgui.cpp.

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

291 {
292  m_settings.m_centerFrequency = value * 1000;
293  sendSettings();
294 }
void sendSettings()
AirspyHFSettings m_settings
Definition: airspyhfgui.h:63
+ Here is the call graph for this function:

◆ on_dcOffset_toggled

void AirspyHFGui::on_dcOffset_toggled ( bool  checked)
privateslot

Definition at line 408 of file airspyhfgui.cpp.

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

409 {
410  m_settings.m_dcBlock = checked;
411  sendSettings();
412 }
void sendSettings()
AirspyHFSettings m_settings
Definition: airspyhfgui.h:63
+ Here is the call graph for this function:

◆ on_decim_currentIndexChanged

void AirspyHFGui::on_decim_currentIndexChanged ( int  index)
privateslot

Definition at line 314 of file airspyhfgui.cpp.

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

315 {
316  if ((index < 0) || (index > 6))
317  return;
318  m_settings.m_log2Decim = index;
319  sendSettings();
320 }
void sendSettings()
AirspyHFSettings m_settings
Definition: airspyhfgui.h:63
+ Here is the call graph for this function:

◆ on_dsp_toggled

void AirspyHFGui::on_dsp_toggled ( bool  checked)
privateslot

Definition at line 366 of file airspyhfgui.cpp.

References m_settings, AirspyHFSettings::m_useDSP, and sendSettings().

367 {
368  m_settings.m_useDSP = checked;
369  sendSettings();
370 }
void sendSettings()
AirspyHFSettings m_settings
Definition: airspyhfgui.h:63
+ Here is the call graph for this function:

◆ on_iqImbalance_toggled

void AirspyHFGui::on_iqImbalance_toggled ( bool  checked)
privateslot

Definition at line 414 of file airspyhfgui.cpp.

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

415 {
416  m_settings.m_iqCorrection = checked;
417  sendSettings();
418 }
void sendSettings()
AirspyHFSettings m_settings
Definition: airspyhfgui.h:63
+ Here is the call graph for this function:

◆ on_lna_toggled

void AirspyHFGui::on_lna_toggled ( bool  checked)
privateslot

Definition at line 372 of file airspyhfgui.cpp.

References m_settings, AirspyHFSettings::m_useLNA, and sendSettings().

373 {
374  m_settings.m_useLNA = checked;
375  sendSettings();
376 }
void sendSettings()
AirspyHFSettings m_settings
Definition: airspyhfgui.h:63
+ Here is the call graph for this function:

◆ on_LOppm_valueChanged

void AirspyHFGui::on_LOppm_valueChanged ( int  value)
privateslot

Definition at line 296 of file airspyhfgui.cpp.

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

297 {
298  m_settings.m_LOppmTenths = value;
299  ui->LOppmText->setText(QString("%1").arg(QString::number(m_settings.m_LOppmTenths/10.0, 'f', 1)));
300  sendSettings();
301 }
void sendSettings()
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
AirspyHFSettings m_settings
Definition: airspyhfgui.h:63
Ui::AirspyHFGui * ui
Definition: airspyhfgui.h:58
+ Here is the call graph for this function:

◆ on_record_toggled

void AirspyHFGui::on_record_toggled ( bool  checked)
privateslot

Definition at line 331 of file airspyhfgui.cpp.

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

332 {
333  if (checked) {
334  ui->record->setStyleSheet("QToolButton { background-color : red; }");
335  } else {
336  ui->record->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
337  }
338 
341 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
static MsgFileRecord * create(bool startStop)
Definition: airspyhfinput.h:68
DeviceSampleSource * m_sampleSource
Definition: airspyhfgui.h:67
Ui::AirspyHFGui * ui
Definition: airspyhfgui.h:58
+ Here is the call graph for this function:

◆ on_resetLOppm_clicked

void AirspyHFGui::on_resetLOppm_clicked ( )
privateslot

Definition at line 303 of file airspyhfgui.cpp.

References ui.

304 {
305  ui->LOppm->setValue(0);
306 }
Ui::AirspyHFGui * ui
Definition: airspyhfgui.h:58

◆ on_sampleRate_currentIndexChanged

void AirspyHFGui::on_sampleRate_currentIndexChanged ( int  index)
privateslot

Definition at line 308 of file airspyhfgui.cpp.

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

309 {
311  sendSettings();
312 }
void sendSettings()
AirspyHFSettings m_settings
Definition: airspyhfgui.h:63
quint32 m_devSampleRateIndex
+ Here is the call graph for this function:

◆ on_startStop_toggled

void AirspyHFGui::on_startStop_toggled ( bool  checked)
privateslot

Definition at line 322 of file airspyhfgui.cpp.

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

323 {
324  if (m_doApplySettings)
325  {
328  }
329 }
bool m_doApplySettings
Definition: airspyhfgui.h:61
static MsgStartStop * create(bool startStop)
Definition: airspyhfinput.h:87
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
DeviceSampleSource * m_sampleSource
Definition: airspyhfgui.h:67
+ Here is the call graph for this function:

◆ on_transverter_clicked

void AirspyHFGui::on_transverter_clicked ( )
privateslot

Definition at line 343 of file airspyhfgui.cpp.

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

344 {
345  m_settings.m_transverterMode = ui->transverter->getDeltaFrequencyAcive();
346  m_settings.m_transverterDeltaFrequency = ui->transverter->getDeltaFrequency();
347  qDebug("AirspyHFGui::on_transverter_clicked: %lld Hz %s", m_settings.m_transverterDeltaFrequency, m_settings.m_transverterMode ? "on" : "off");
349  m_settings.m_centerFrequency = ui->centerFrequency->getValueNew()*1000;
350  sendSettings();
351 }
void sendSettings()
AirspyHFSettings m_settings
Definition: airspyhfgui.h:63
qint64 m_transverterDeltaFrequency
void updateFrequencyLimits()
Ui::AirspyHFGui * ui
Definition: airspyhfgui.h:58
+ Here is the call graph for this function:

◆ openDeviceSettingsDialog

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

Definition at line 483 of file airspyhfgui.cpp.

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

Referenced by AirspyHFGui().

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

◆ resetToDefaults()

void AirspyHFGui::resetToDefaults ( )
virtual

Implements PluginInstanceGUI.

Definition at line 89 of file airspyhfgui.cpp.

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

Referenced by deserialize().

90 {
93  sendSettings();
94 }
void sendSettings()
void displaySettings()
AirspyHFSettings m_settings
Definition: airspyhfgui.h:63
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendSettings()

void AirspyHFGui::sendSettings ( )
private

◆ serialize()

QByteArray AirspyHFGui::serialize ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 108 of file airspyhfgui.cpp.

References m_settings, and AirspyHFSettings::serialize().

109 {
110  return m_settings.serialize();
111 }
AirspyHFSettings m_settings
Definition: airspyhfgui.h:63
QByteArray serialize() const
+ Here is the call graph for this function:

◆ setCenterFrequency()

void AirspyHFGui::setCenterFrequency ( qint64  centerFrequency)
virtual

Implements PluginInstanceGUI.

Definition at line 101 of file airspyhfgui.cpp.

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

102 {
103  m_settings.m_centerFrequency = centerFrequency;
104  displaySettings();
105  sendSettings();
106 }
void sendSettings()
void displaySettings()
AirspyHFSettings m_settings
Definition: airspyhfgui.h:63
+ Here is the call graph for this function:

◆ setName()

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

Implements PluginInstanceGUI.

Definition at line 79 of file airspyhfgui.cpp.

80 {
81  setObjectName(name);
82 }

◆ updateFrequencyLimits()

void AirspyHFGui::updateFrequencyLimits ( )
private

Definition at line 187 of file airspyhfgui.cpp.

References AirspyHFInput::loHighLimitFreqHF, AirspyHFInput::loHighLimitFreqVHF, AirspyHFInput::loLowLimitFreqHF, AirspyHFInput::loLowLimitFreqVHF, AirspyHFSettings::m_bandIndex, m_settings, AirspyHFSettings::m_transverterDeltaFrequency, AirspyHFSettings::m_transverterMode, and ui.

Referenced by AirspyHFGui(), displaySettings(), on_band_currentIndexChanged(), and on_transverter_clicked().

188 {
189  // values in kHz
190  qint64 deltaFrequency = m_settings.m_transverterMode ? m_settings.m_transverterDeltaFrequency/1000 : 0;
191 
192  qint64 minLimit;
193  qint64 maxLimit;
194 
195  switch(m_settings.m_bandIndex)
196  {
197  case 1:
198  minLimit = AirspyHFInput::loLowLimitFreqVHF/1000 + deltaFrequency;
199  maxLimit = AirspyHFInput::loHighLimitFreqVHF/1000 + deltaFrequency;
200  break;
201  case 0:
202  default:
203  minLimit = AirspyHFInput::loLowLimitFreqHF/1000 + deltaFrequency;
204  maxLimit = AirspyHFInput::loHighLimitFreqHF/1000 + deltaFrequency;
205  break;
206  }
207 
208  minLimit = minLimit < 0 ? 0 : minLimit > 9999999 ? 9999999 : minLimit;
209  maxLimit = maxLimit < 0 ? 0 : maxLimit > 9999999 ? 9999999 : maxLimit;
210 
211  qDebug("AirspyHFGui::updateFrequencyLimits: delta: %lld min: %lld max: %lld", deltaFrequency, minLimit, maxLimit);
212 
213  ui->centerFrequency->setValueRange(7, minLimit, maxLimit);
214 }
static const qint64 loHighLimitFreqVHF
static const qint64 loLowLimitFreqVHF
AirspyHFSettings m_settings
Definition: airspyhfgui.h:63
qint64 m_transverterDeltaFrequency
static const qint64 loLowLimitFreqHF
static const qint64 loHighLimitFreqHF
Ui::AirspyHFGui * ui
Definition: airspyhfgui.h:58
+ Here is the caller graph for this function:

◆ updateHardware

void AirspyHFGui::updateHardware ( )
privateslot

Definition at line 420 of file airspyhfgui.cpp.

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

Referenced by AirspyHFGui().

421 {
422  qDebug() << "AirspyHFGui::updateHardware";
425  m_forceSettings = false;
426  m_updateTimer.stop();
427 }
static MsgConfigureAirspyHF * create(const AirspyHFSettings &settings, bool force)
Definition: airspyhfinput.h:46
void push(Message *message, bool emitSignal=true)
Push message onto queue.
bool m_forceSettings
Definition: airspyhfgui.h:62
MessageQueue * getInputMessageQueue()
QTimer m_updateTimer
Definition: airspyhfgui.h:64
AirspyHFSettings m_settings
Definition: airspyhfgui.h:63
DeviceSampleSource * m_sampleSource
Definition: airspyhfgui.h:67
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateSampleRateAndFrequency()

void AirspyHFGui::updateSampleRateAndFrequency ( )
private

Definition at line 180 of file airspyhfgui.cpp.

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

Referenced by handleInputMessages().

181 {
184  ui->deviceRateText->setText(tr("%1k").arg((float)m_sampleRate / 1000));
185 }
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
DeviceUISet * m_deviceUISet
Definition: airspyhfgui.h:60
int m_sampleRate
Definition: airspyhfgui.h:68
quint64 m_deviceCenterFrequency
Center frequency in device.
Definition: airspyhfgui.h:69
void setCenterFrequency(qint64 frequency)
Definition: glspectrum.cpp:175
Ui::AirspyHFGui * ui
Definition: airspyhfgui.h:58
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateStatus

void AirspyHFGui::updateStatus ( )
privateslot

Definition at line 429 of file airspyhfgui.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 AirspyHFGui().

430 {
431  int state = m_deviceUISet->m_deviceAPI->state();
432 
433  if(m_lastEngineState != state)
434  {
435  switch(state)
436  {
438  ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
439  break;
440  case DeviceAPI::StIdle:
441  ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
442  break;
444  ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
445  break;
446  case DeviceAPI::StError:
447  ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
448  QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
449  break;
450  default:
451  break;
452  }
453 
454  m_lastEngineState = state;
455  }
456 }
QString errorMessage()
Last error message from the device engine.
Definition: deviceapi.cpp:290
engine is before initialization
Definition: deviceapi.h:53
EngineState state() const
Return the state of the device engine corresponding to the stream type.
Definition: deviceapi.cpp:277
DeviceAPI * m_deviceAPI
Definition: deviceuiset.h:48
engine is idle
Definition: deviceapi.h:54
DeviceUISet * m_deviceUISet
Definition: airspyhfgui.h:60
int m_lastEngineState
Definition: airspyhfgui.h:70
engine is running
Definition: deviceapi.h:56
engine is in error
Definition: deviceapi.h:57
Ui::AirspyHFGui * ui
Definition: airspyhfgui.h:58
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_deviceCenterFrequency

quint64 AirspyHFGui::m_deviceCenterFrequency
private

Center frequency in device.

Definition at line 69 of file airspyhfgui.h.

Referenced by handleInputMessages(), and updateSampleRateAndFrequency().

◆ m_deviceUISet

DeviceUISet* AirspyHFGui::m_deviceUISet
private

Definition at line 60 of file airspyhfgui.h.

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

◆ m_doApplySettings

bool AirspyHFGui::m_doApplySettings
private

Definition at line 61 of file airspyhfgui.h.

Referenced by on_startStop_toggled().

◆ m_forceSettings

bool AirspyHFGui::m_forceSettings
private

Definition at line 62 of file airspyhfgui.h.

Referenced by deserialize(), and updateHardware().

◆ m_inputMessageQueue

MessageQueue AirspyHFGui::m_inputMessageQueue
private

Definition at line 71 of file airspyhfgui.h.

Referenced by AirspyHFGui(), and handleInputMessages().

◆ m_lastEngineState

int AirspyHFGui::m_lastEngineState
private

Definition at line 70 of file airspyhfgui.h.

Referenced by updateStatus().

◆ m_rates

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

◆ m_sampleRate

int AirspyHFGui::m_sampleRate
private

Definition at line 68 of file airspyhfgui.h.

Referenced by handleInputMessages(), and updateSampleRateAndFrequency().

◆ m_sampleSource

DeviceSampleSource* AirspyHFGui::m_sampleSource
private

Definition at line 67 of file airspyhfgui.h.

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

◆ m_settings

AirspyHFSettings AirspyHFGui::m_settings
private

◆ m_statusTimer

QTimer AirspyHFGui::m_statusTimer
private

Definition at line 65 of file airspyhfgui.h.

Referenced by AirspyHFGui().

◆ m_updateTimer

QTimer AirspyHFGui::m_updateTimer
private

Definition at line 64 of file airspyhfgui.h.

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

◆ ui

Ui::AirspyHFGui* AirspyHFGui::ui
private

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