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

#include <fcdproplusgui.h>

+ Inheritance diagram for FCDProPlusGui:
+ Collaboration diagram for FCDProPlusGui:

Public Member Functions

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

Private Slots

void handleInputMessages ()
 
void on_centerFrequency_changed (quint64 value)
 
void on_decim_currentIndexChanged (int index)
 
void on_fcPos_currentIndexChanged (int index)
 
void on_dcOffset_toggled (bool checked)
 
void on_iqImbalance_toggled (bool checked)
 
void on_checkBoxG_stateChanged (int state)
 
void on_checkBoxB_stateChanged (int state)
 
void on_mixGain_stateChanged (int state)
 
void on_ifGain_valueChanged (int value)
 
void on_filterRF_currentIndexChanged (int index)
 
void on_filterIF_currentIndexChanged (int index)
 
void on_ppm_valueChanged (int value)
 
void on_startStop_toggled (bool checked)
 
void on_record_toggled (bool checked)
 
void on_transverter_clicked ()
 
void updateHardware ()
 
void updateStatus ()
 
void openDeviceSettingsDialog (const QPoint &p)
 

Private Member Functions

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

Private Attributes

Ui::FCDProPlusGui * ui
 
DeviceUISetm_deviceUISet
 
bool m_doApplySettings
 
bool m_forceSettings
 
FCDProPlusSettings m_settings
 
QTimer m_updateTimer
 
QTimer m_statusTimer
 
std::vector< int > m_gains
 
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 fcdproplusgui.h.

Constructor & Destructor Documentation

◆ FCDProPlusGui()

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

Definition at line 35 of file fcdproplusgui.cpp.

References displaySettings(), FCDProPlusConstants::fcdproplus_if_filter_nb_values(), FCDProPlusConstants::fcdproplus_rf_filter_nb_values(), DeviceAPI::getSampleSource(), ColorMapper::GrayGold, handleInputMessages(), i, FCDProPlusConstants::if_filters, DeviceUISet::m_deviceAPI, m_deviceUISet, m_inputMessageQueue, m_sampleSource, m_statusTimer, m_updateTimer, openDeviceSettingsDialog(), FCDProPlusConstants::rf_filters, DeviceSampleSource::setMessageQueueToGUI(), ui, updateFrequencyLimits(), updateHardware(), and updateStatus().

35  :
36  QWidget(parent),
37  ui(new Ui::FCDProPlusGui),
38  m_deviceUISet(deviceUISet),
39  m_forceSettings(true),
40  m_settings(),
41  m_sampleSource(NULL),
43 {
45 
46  ui->setupUi(this);
47 
48  ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
50 
51  ui->filterIF->clear();
53  {
54  ui->filterIF->addItem(QString(FCDProPlusConstants::if_filters[i].label.c_str()), i);
55  }
56 
57  ui->filterRF->clear();
59  {
60  ui->filterRF->addItem(QString(FCDProPlusConstants::rf_filters[i].label.c_str()), i);
61  }
62 
63  connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware()));
64  connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus()));
65  m_statusTimer.start(500);
66 
67  CRightClickEnabler *startStopRightClickEnabler = new CRightClickEnabler(ui->startStop);
68  connect(startStopRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(openDeviceSettingsDialog(const QPoint &)));
69 
71 
72  connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection);
74 }
static const fcdproplus_rf_filter rf_filters[]
DeviceSampleSource * getSampleSource()
Return pointer to the device sample source (single Rx) or nullptr.
Definition: deviceapi.cpp:213
DeviceUISet * m_deviceUISet
Definition: fcdproplusgui.h:57
static const fcdproplus_if_filter if_filters[]
QTimer m_updateTimer
Definition: fcdproplusgui.h:61
static int fcdproplus_rf_filter_nb_values()
MessageQueue m_inputMessageQueue
Definition: fcdproplusgui.h:68
engine is before initialization
Definition: deviceapi.h:53
DeviceAPI * m_deviceAPI
Definition: deviceuiset.h:48
int32_t i
Definition: decimators.h:244
static int fcdproplus_if_filter_nb_values()
FCDProPlusSettings m_settings
Definition: fcdproplusgui.h:60
Ui::FCDProPlusGui * ui
Definition: fcdproplusgui.h:55
bool m_forceSettings
Definition: fcdproplusgui.h:59
void openDeviceSettingsDialog(const QPoint &p)
DeviceSampleSource * m_sampleSource
Definition: fcdproplusgui.h:64
void updateFrequencyLimits()
virtual void setMessageQueueToGUI(MessageQueue *queue)=0
QTimer m_statusTimer
Definition: fcdproplusgui.h:62
void displaySettings()
void handleInputMessages()
+ Here is the call graph for this function:

◆ ~FCDProPlusGui()

FCDProPlusGui::~FCDProPlusGui ( )
virtual

Definition at line 76 of file fcdproplusgui.cpp.

References ui.

77 {
78  delete ui;
79 }
Ui::FCDProPlusGui * ui
Definition: fcdproplusgui.h:55

Member Function Documentation

◆ blockApplySettings()

void FCDProPlusGui::blockApplySettings ( bool  block)
inlineprivate

Definition at line 70 of file fcdproplusgui.h.

Referenced by handleMessage().

70 { m_doApplySettings = !block; }
bool m_doApplySettings
Definition: fcdproplusgui.h:58
+ Here is the caller graph for this function:

◆ deserialize()

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

Implements PluginInstanceGUI.

Definition at line 120 of file fcdproplusgui.cpp.

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

121 {
122  if(m_settings.deserialize(data))
123  {
124  displaySettings();
125  m_forceSettings = true;
126  sendSettings();
127  return true;
128  }
129  else
130  {
131  resetToDefaults();
132  return false;
133  }
134 }
FCDProPlusSettings m_settings
Definition: fcdproplusgui.h:60
bool deserialize(const QByteArray &data)
bool m_forceSettings
Definition: fcdproplusgui.h:59
void resetToDefaults()
void displaySettings()
+ Here is the call graph for this function:

◆ destroy()

void FCDProPlusGui::destroy ( )
virtual

Implements PluginInstanceGUI.

Definition at line 81 of file fcdproplusgui.cpp.

82 {
83  delete this;
84 }

◆ displaySettings()

void FCDProPlusGui::displaySettings ( )
private

Definition at line 210 of file fcdproplusgui.cpp.

References arg(), FCDProPlusSettings::m_biasT, FCDProPlusSettings::m_centerFrequency, FCDProPlusSettings::m_dcBlock, FCDProPlusSettings::m_fcPos, FCDProPlusSettings::m_ifFilterIndex, FCDProPlusSettings::m_ifGain, FCDProPlusSettings::m_iqImbalance, FCDProPlusSettings::m_lnaGain, FCDProPlusSettings::m_log2Decim, FCDProPlusSettings::m_LOppmTenths, FCDProPlusSettings::m_mixGain, FCDProPlusSettings::m_rfFilterIndex, m_settings, FCDProPlusSettings::m_transverterDeltaFrequency, FCDProPlusSettings::m_transverterMode, ui, and updateFrequencyLimits().

Referenced by deserialize(), FCDProPlusGui(), handleMessage(), on_ifGain_valueChanged(), on_ppm_valueChanged(), resetToDefaults(), and setCenterFrequency().

211 {
212  ui->transverter->setDeltaFrequency(m_settings.m_transverterDeltaFrequency);
213  ui->transverter->setDeltaFrequencyActive(m_settings.m_transverterMode);
215  ui->centerFrequency->setValue(m_settings.m_centerFrequency / 1000);
216  ui->decim->setCurrentIndex(m_settings.m_log2Decim);
217  ui->fcPos->setCurrentIndex((int) m_settings.m_fcPos);
218  ui->dcOffset->setChecked(m_settings.m_dcBlock);
219  ui->iqImbalance->setChecked(m_settings.m_iqImbalance);
220  ui->checkBoxG->setChecked(m_settings.m_lnaGain);
221  ui->checkBoxB->setChecked(m_settings.m_biasT);
222  ui->mixGain->setChecked(m_settings.m_mixGain);
223  ui->ifGain->setValue(m_settings.m_ifGain);
224  ui->ifGainText->setText(QString("%1dB").arg(m_settings.m_ifGain));
225  ui->filterIF->setCurrentIndex(m_settings.m_ifFilterIndex);
226  ui->filterRF->setCurrentIndex(m_settings.m_rfFilterIndex);
227  ui->ppm->setValue(m_settings.m_LOppmTenths);
228  ui->ppmText->setText(QString("%1").arg(QString::number(m_settings.m_LOppmTenths/10.0, 'f', 1)));
229 }
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
FCDProPlusSettings m_settings
Definition: fcdproplusgui.h:60
Ui::FCDProPlusGui * ui
Definition: fcdproplusgui.h:55
void updateFrequencyLimits()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCenterFrequency()

qint64 FCDProPlusGui::getCenterFrequency ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 103 of file fcdproplusgui.cpp.

References FCDProPlusSettings::m_centerFrequency, and m_settings.

104 {
106 }
FCDProPlusSettings m_settings
Definition: fcdproplusgui.h:60

◆ getInputMessageQueue()

virtual MessageQueue* FCDProPlusGui::getInputMessageQueue ( )
inlinevirtual

Implements PluginInstanceGUI.

Definition at line 51 of file fcdproplusgui.h.

51 { return &m_inputMessageQueue; }
MessageQueue m_inputMessageQueue
Definition: fcdproplusgui.h:68

◆ getName()

QString FCDProPlusGui::getName ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 91 of file fcdproplusgui.cpp.

92 {
93  return objectName();
94 }

◆ handleInputMessages

void FCDProPlusGui::handleInputMessages ( )
privateslot

Definition at line 162 of file fcdproplusgui.cpp.

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

Referenced by FCDProPlusGui().

163 {
164  Message* message;
165 
166  while ((message = m_inputMessageQueue.pop()) != 0)
167  {
168  if (DSPSignalNotification::match(*message))
169  {
170  DSPSignalNotification* notif = (DSPSignalNotification*) message;
171  m_sampleRate = notif->getSampleRate();
173  qDebug("FCDProPlusGui::handleInputMessages: DSPSignalNotification: SampleRate:%d, CenterFrequency:%llu", notif->getSampleRate(), notif->getCenterFrequency());
175 
176  delete message;
177  }
178  else
179  {
180  if (handleMessage(*message))
181  {
182  delete message;
183  }
184  }
185  }
186 }
Message * pop()
Pop message from queue.
quint64 m_deviceCenterFrequency
Center frequency in device.
Definition: fcdproplusgui.h:66
MessageQueue m_inputMessageQueue
Definition: fcdproplusgui.h:68
qint64 getCenterFrequency() const
Definition: dspcommands.h:329
virtual bool handleMessage(const Message &message)
static bool match(const Message *message)
Definition: message.cpp:45
int getSampleRate() const
Definition: dspcommands.h:328
void updateSampleRateAndFrequency()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleMessage()

bool FCDProPlusGui::handleMessage ( const Message message)
virtual

Implements PluginInstanceGUI.

Definition at line 136 of file fcdproplusgui.cpp.

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

Referenced by handleInputMessages().

137 {
139  {
141  m_settings = cfg.getSettings();
142  blockApplySettings(true);
143  displaySettings();
144  blockApplySettings(false);
145  return true;
146  }
147  else if (FCDProPlusInput::MsgStartStop::match(message))
148  {
150  blockApplySettings(true);
151  ui->startStop->setChecked(notif.getStartStop());
152  blockApplySettings(false);
153 
154  return true;
155  }
156  else
157  {
158  return false;
159  }
160 }
static bool match(const Message *message)
Definition: message.cpp:45
FCDProPlusSettings m_settings
Definition: fcdproplusgui.h:60
Ui::FCDProPlusGui * ui
Definition: fcdproplusgui.h:55
const FCDProPlusSettings & getSettings() const
void displaySettings()
void blockApplySettings(bool block)
Definition: fcdproplusgui.h:70
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_centerFrequency_changed

void FCDProPlusGui::on_centerFrequency_changed ( quint64  value)
privateslot

Definition at line 237 of file fcdproplusgui.cpp.

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

238 {
239  m_settings.m_centerFrequency = value * 1000;
240  sendSettings();
241 }
FCDProPlusSettings m_settings
Definition: fcdproplusgui.h:60
+ Here is the call graph for this function:

◆ on_checkBoxB_stateChanged

void FCDProPlusGui::on_checkBoxB_stateChanged ( int  state)
privateslot

Definition at line 322 of file fcdproplusgui.cpp.

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

323 {
324  m_settings.m_biasT = (state == Qt::Checked);
325  sendSettings();
326 }
FCDProPlusSettings m_settings
Definition: fcdproplusgui.h:60
+ Here is the call graph for this function:

◆ on_checkBoxG_stateChanged

void FCDProPlusGui::on_checkBoxG_stateChanged ( int  state)
privateslot

Definition at line 316 of file fcdproplusgui.cpp.

References FCDProPlusSettings::m_lnaGain, m_settings, and sendSettings().

317 {
318  m_settings.m_lnaGain = (state == Qt::Checked);
319  sendSettings();
320 }
FCDProPlusSettings m_settings
Definition: fcdproplusgui.h:60
+ Here is the call graph for this function:

◆ on_dcOffset_toggled

void FCDProPlusGui::on_dcOffset_toggled ( bool  checked)
privateslot

Definition at line 267 of file fcdproplusgui.cpp.

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

268 {
269  m_settings.m_dcBlock = checked;
270  sendSettings();
271 }
FCDProPlusSettings m_settings
Definition: fcdproplusgui.h:60
+ Here is the call graph for this function:

◆ on_decim_currentIndexChanged

void FCDProPlusGui::on_decim_currentIndexChanged ( int  index)
privateslot

Definition at line 243 of file fcdproplusgui.cpp.

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

244 {
245  if ((index < 0) || (index > 6)) {
246  return;
247  }
248 
249  m_settings.m_log2Decim = index;
250  sendSettings();
251 }
FCDProPlusSettings m_settings
Definition: fcdproplusgui.h:60
+ Here is the call graph for this function:

◆ on_fcPos_currentIndexChanged

void FCDProPlusGui::on_fcPos_currentIndexChanged ( int  index)
privateslot

◆ on_filterIF_currentIndexChanged

void FCDProPlusGui::on_filterIF_currentIndexChanged ( int  index)
privateslot

Definition at line 334 of file fcdproplusgui.cpp.

References FCDProPlusSettings::m_ifFilterIndex, m_settings, and sendSettings().

335 {
336  m_settings.m_ifFilterIndex = index;
337  sendSettings();
338 }
FCDProPlusSettings m_settings
Definition: fcdproplusgui.h:60
+ Here is the call graph for this function:

◆ on_filterRF_currentIndexChanged

void FCDProPlusGui::on_filterRF_currentIndexChanged ( int  index)
privateslot

Definition at line 340 of file fcdproplusgui.cpp.

References FCDProPlusSettings::m_rfFilterIndex, m_settings, and sendSettings().

341 {
342  m_settings.m_rfFilterIndex = index;
343  sendSettings();
344 }
FCDProPlusSettings m_settings
Definition: fcdproplusgui.h:60
+ Here is the call graph for this function:

◆ on_ifGain_valueChanged

void FCDProPlusGui::on_ifGain_valueChanged ( int  value)
privateslot

Definition at line 346 of file fcdproplusgui.cpp.

References displaySettings(), FCDProPlusSettings::m_ifGain, m_settings, and sendSettings().

347 {
348  m_settings.m_ifGain = value;
349  displaySettings();
350  sendSettings();
351 }
FCDProPlusSettings m_settings
Definition: fcdproplusgui.h:60
void displaySettings()
+ Here is the call graph for this function:

◆ on_iqImbalance_toggled

void FCDProPlusGui::on_iqImbalance_toggled ( bool  checked)
privateslot

Definition at line 273 of file fcdproplusgui.cpp.

References FCDProPlusSettings::m_iqImbalance, m_settings, and sendSettings().

274 {
275  m_settings.m_iqImbalance = checked;
276  sendSettings();
277 }
FCDProPlusSettings m_settings
Definition: fcdproplusgui.h:60
+ Here is the call graph for this function:

◆ on_mixGain_stateChanged

void FCDProPlusGui::on_mixGain_stateChanged ( int  state)
privateslot

Definition at line 328 of file fcdproplusgui.cpp.

References FCDProPlusSettings::m_mixGain, m_settings, and sendSettings().

329 {
330  m_settings.m_mixGain = (state == Qt::Checked);
331  sendSettings();
332 }
FCDProPlusSettings m_settings
Definition: fcdproplusgui.h:60
+ Here is the call graph for this function:

◆ on_ppm_valueChanged

void FCDProPlusGui::on_ppm_valueChanged ( int  value)
privateslot

Definition at line 353 of file fcdproplusgui.cpp.

References displaySettings(), FCDProPlusSettings::m_LOppmTenths, m_settings, and sendSettings().

354 {
355  m_settings.m_LOppmTenths = value;
356  displaySettings();
357  sendSettings();
358 }
FCDProPlusSettings m_settings
Definition: fcdproplusgui.h:60
void displaySettings()
+ Here is the call graph for this function:

◆ on_record_toggled

void FCDProPlusGui::on_record_toggled ( bool  checked)
privateslot

Definition at line 366 of file fcdproplusgui.cpp.

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

367 {
368  if (checked) {
369  ui->record->setStyleSheet("QToolButton { background-color : red; }");
370  } else {
371  ui->record->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
372  }
373 
376 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
Ui::FCDProPlusGui * ui
Definition: fcdproplusgui.h:55
DeviceSampleSource * m_sampleSource
Definition: fcdproplusgui.h:64
static MsgFileRecord * create(bool startStop)
+ Here is the call graph for this function:

◆ on_startStop_toggled

void FCDProPlusGui::on_startStop_toggled ( bool  checked)
privateslot

Definition at line 360 of file fcdproplusgui.cpp.

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

361 {
364 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
DeviceSampleSource * m_sampleSource
Definition: fcdproplusgui.h:64
static MsgStartStop * create(bool startStop)
+ Here is the call graph for this function:

◆ on_transverter_clicked

void FCDProPlusGui::on_transverter_clicked ( )
privateslot

Definition at line 378 of file fcdproplusgui.cpp.

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

379 {
380  m_settings.m_transverterMode = ui->transverter->getDeltaFrequencyAcive();
381  m_settings.m_transverterDeltaFrequency = ui->transverter->getDeltaFrequency();
382  qDebug("FCDProPlusGui::on_transverter_clicked: %lld Hz %s", m_settings.m_transverterDeltaFrequency, m_settings.m_transverterMode ? "on" : "off");
384  m_settings.m_centerFrequency = ui->centerFrequency->getValueNew()*1000;
385  sendSettings();
386 }
FCDProPlusSettings m_settings
Definition: fcdproplusgui.h:60
Ui::FCDProPlusGui * ui
Definition: fcdproplusgui.h:55
void updateFrequencyLimits()
+ Here is the call graph for this function:

◆ openDeviceSettingsDialog

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

Definition at line 388 of file fcdproplusgui.cpp.

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

Referenced by FCDProPlusGui().

389 {
390  BasicDeviceSettingsDialog dialog(this);
391  dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
392  dialog.setReverseAPIAddress(m_settings.m_reverseAPIAddress);
393  dialog.setReverseAPIPort(m_settings.m_reverseAPIPort);
394  dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex);
395 
396  dialog.move(p);
397  dialog.exec();
398 
399  m_settings.m_useReverseAPI = dialog.useReverseAPI();
400  m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress();
401  m_settings.m_reverseAPIPort = dialog.getReverseAPIPort();
402  m_settings.m_reverseAPIDeviceIndex = dialog.getReverseAPIDeviceIndex();
403 
404  sendSettings();
405 }
FCDProPlusSettings m_settings
Definition: fcdproplusgui.h:60
uint16_t m_reverseAPIDeviceIndex
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetToDefaults()

void FCDProPlusGui::resetToDefaults ( )
virtual

Implements PluginInstanceGUI.

Definition at line 96 of file fcdproplusgui.cpp.

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

Referenced by deserialize().

97 {
100  sendSettings();
101 }
FCDProPlusSettings m_settings
Definition: fcdproplusgui.h:60
void displaySettings()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendSettings()

void FCDProPlusGui::sendSettings ( )
private

◆ serialize()

QByteArray FCDProPlusGui::serialize ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 115 of file fcdproplusgui.cpp.

References m_settings, and FCDProPlusSettings::serialize().

116 {
117  return m_settings.serialize();
118 }
QByteArray serialize() const
FCDProPlusSettings m_settings
Definition: fcdproplusgui.h:60
+ Here is the call graph for this function:

◆ setCenterFrequency()

void FCDProPlusGui::setCenterFrequency ( qint64  centerFrequency)
virtual

Implements PluginInstanceGUI.

Definition at line 108 of file fcdproplusgui.cpp.

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

109 {
110  m_settings.m_centerFrequency = centerFrequency;
111  displaySettings();
112  sendSettings();
113 }
FCDProPlusSettings m_settings
Definition: fcdproplusgui.h:60
void displaySettings()
+ Here is the call graph for this function:

◆ setName()

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

Implements PluginInstanceGUI.

Definition at line 86 of file fcdproplusgui.cpp.

87 {
88  setObjectName(name);
89 }

◆ updateFrequencyLimits()

void FCDProPlusGui::updateFrequencyLimits ( )
private

Definition at line 195 of file fcdproplusgui.cpp.

References m_settings, FCDProPlusSettings::m_transverterDeltaFrequency, FCDProPlusSettings::m_transverterMode, and ui.

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

196 {
197  // values in kHz
198  qint64 deltaFrequency = m_settings.m_transverterMode ? m_settings.m_transverterDeltaFrequency/1000 : 0;
199  qint64 minLimit = fcd_traits<ProPlus>::loLowLimitFreq/1000 + deltaFrequency;
200  qint64 maxLimit = fcd_traits<ProPlus>::loHighLimitFreq/1000 + deltaFrequency;
201 
202  minLimit = minLimit < 0 ? 0 : minLimit > 9999999 ? 9999999 : minLimit;
203  maxLimit = maxLimit < 0 ? 0 : maxLimit > 9999999 ? 9999999 : maxLimit;
204 
205  qDebug("FCDProPlusGui::updateFrequencyLimits: delta: %lld min: %lld max: %lld", deltaFrequency, minLimit, maxLimit);
206 
207  ui->centerFrequency->setValueRange(7, minLimit, maxLimit);
208 }
FCDProPlusSettings m_settings
Definition: fcdproplusgui.h:60
Ui::FCDProPlusGui * ui
Definition: fcdproplusgui.h:55
+ Here is the caller graph for this function:

◆ updateHardware

void FCDProPlusGui::updateHardware ( )
privateslot

Definition at line 279 of file fcdproplusgui.cpp.

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

Referenced by FCDProPlusGui().

280 {
283  m_forceSettings = false;
284  m_updateTimer.stop();
285 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
QTimer m_updateTimer
Definition: fcdproplusgui.h:61
static MsgConfigureFCDProPlus * create(const FCDProPlusSettings &settings, bool force)
FCDProPlusSettings m_settings
Definition: fcdproplusgui.h:60
bool m_forceSettings
Definition: fcdproplusgui.h:59
DeviceSampleSource * m_sampleSource
Definition: fcdproplusgui.h:64
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateSampleRateAndFrequency()

void FCDProPlusGui::updateSampleRateAndFrequency ( )
private

Definition at line 188 of file fcdproplusgui.cpp.

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

Referenced by handleInputMessages().

189 {
192  ui->deviceRateText->setText(tr("%1k").arg((float)m_sampleRate / 1000));
193 }
quint64 m_deviceCenterFrequency
Center frequency in device.
Definition: fcdproplusgui.h:66
void setSampleRate(qint32 sampleRate)
Definition: glspectrum.cpp:211
DeviceUISet * m_deviceUISet
Definition: fcdproplusgui.h:57
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::FCDProPlusGui * ui
Definition: fcdproplusgui.h:55
void setCenterFrequency(qint64 frequency)
Definition: glspectrum.cpp:175
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateStatus

void FCDProPlusGui::updateStatus ( )
privateslot

Definition at line 287 of file fcdproplusgui.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 FCDProPlusGui().

288 {
289  int state = m_deviceUISet->m_deviceAPI->state();
290 
291  if(m_lastEngineState != state)
292  {
293  switch(state)
294  {
296  ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
297  break;
298  case DeviceAPI::StIdle:
299  ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
300  break;
302  ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
303  break;
304  case DeviceAPI::StError:
305  ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
306  QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
307  break;
308  default:
309  break;
310  }
311 
312  m_lastEngineState = state;
313  }
314 }
DeviceUISet * m_deviceUISet
Definition: fcdproplusgui.h:57
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
Ui::FCDProPlusGui * ui
Definition: fcdproplusgui.h:55
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 FCDProPlusGui::m_deviceCenterFrequency
private

Center frequency in device.

Definition at line 66 of file fcdproplusgui.h.

Referenced by handleInputMessages(), and updateSampleRateAndFrequency().

◆ m_deviceUISet

DeviceUISet* FCDProPlusGui::m_deviceUISet
private

Definition at line 57 of file fcdproplusgui.h.

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

◆ m_doApplySettings

bool FCDProPlusGui::m_doApplySettings
private

Definition at line 58 of file fcdproplusgui.h.

◆ m_forceSettings

bool FCDProPlusGui::m_forceSettings
private

Definition at line 59 of file fcdproplusgui.h.

Referenced by deserialize(), and updateHardware().

◆ m_gains

std::vector<int> FCDProPlusGui::m_gains
private

Definition at line 63 of file fcdproplusgui.h.

◆ m_inputMessageQueue

MessageQueue FCDProPlusGui::m_inputMessageQueue
private

Definition at line 68 of file fcdproplusgui.h.

Referenced by FCDProPlusGui(), and handleInputMessages().

◆ m_lastEngineState

int FCDProPlusGui::m_lastEngineState
private

Definition at line 67 of file fcdproplusgui.h.

Referenced by updateStatus().

◆ m_sampleRate

int FCDProPlusGui::m_sampleRate
private

Definition at line 65 of file fcdproplusgui.h.

Referenced by handleInputMessages(), and updateSampleRateAndFrequency().

◆ m_sampleSource

DeviceSampleSource* FCDProPlusGui::m_sampleSource
private

◆ m_settings

FCDProPlusSettings FCDProPlusGui::m_settings
private

◆ m_statusTimer

QTimer FCDProPlusGui::m_statusTimer
private

Definition at line 62 of file fcdproplusgui.h.

Referenced by FCDProPlusGui().

◆ m_updateTimer

QTimer FCDProPlusGui::m_updateTimer
private

Definition at line 61 of file fcdproplusgui.h.

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

◆ ui

Ui::FCDProPlusGui* FCDProPlusGui::ui
private

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