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 Slots | Public Member Functions | Static Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
FreqTrackerGUI Class Reference

#include <freqtrackergui.h>

+ Inheritance diagram for FreqTrackerGUI:
+ Collaboration diagram for FreqTrackerGUI:

Public Slots

void channelMarkerChangedByCursor ()
 
void channelMarkerHighlightedByCursor ()
 

Public Member Functions

virtual void destroy ()
 
void setName (const QString &name)
 
QString getName () const
 
virtual qint64 getCenterFrequency () const
 
virtual void setCenterFrequency (qint64 centerFrequency)
 
void resetToDefaults ()
 
QByteArray serialize () const
 
bool deserialize (const QByteArray &data)
 
virtual MessageQueuegetInputMessageQueue ()
 
virtual bool handleMessage (const Message &message)
 
- Public Member Functions inherited from RollupWidget
 RollupWidget (QWidget *parent=NULL)
 
void setTitleColor (const QColor &c)
 
void setHighlighted (bool highlighted)
 
- Public Member Functions inherited from PluginInstanceGUI
 PluginInstanceGUI ()
 
virtual ~PluginInstanceGUI ()
 

Static Public Member Functions

static FreqTrackerGUIcreate (PluginAPI *pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel)
 

Private Slots

void on_deltaFrequency_changed (qint64 value)
 
void on_log2Decim_currentIndexChanged (int index)
 
void on_rfBW_valueChanged (int value)
 
void on_tracking_toggled (bool checked)
 
void on_alphaEMA_valueChanged (int value)
 
void on_trackerType_currentIndexChanged (int index)
 
void on_pllPskOrder_currentIndexChanged (int index)
 
void on_rrc_toggled (bool checked)
 
void on_rrcRolloff_valueChanged (int value)
 
void on_squelch_valueChanged (int value)
 
void on_squelchGate_valueChanged (int value)
 
void onWidgetRolled (QWidget *widget, bool rollDown)
 
void onMenuDialogCalled (const QPoint &p)
 
void handleInputMessages ()
 
void tick ()
 

Private Member Functions

 FreqTrackerGUI (PluginAPI *pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget *parent=0)
 
virtual ~FreqTrackerGUI ()
 
void blockApplySettings (bool block)
 
void applySettings (bool force=false)
 
void displaySettings ()
 
void leaveEvent (QEvent *)
 
void enterEvent (QEvent *)
 

Private Attributes

Ui::FreqTrackerGUI * ui
 
PluginAPIm_pluginAPI
 
DeviceUISetm_deviceUISet
 
ChannelMarker m_channelMarker
 
FreqTrackerSettings m_settings
 
int m_channelSampleRate
 
bool m_doApplySettings
 
FreqTrackerm_freqTracker
 
bool m_squelchOpen
 
uint32_t m_tickCount
 
MessageQueue m_inputMessageQueue
 

Additional Inherited Members

- Signals inherited from RollupWidget
void widgetRolled (QWidget *widget, bool rollDown)
 
- Protected Types inherited from RollupWidget
enum  { VersionMarker = 0xff }
 
enum  ContextMenuType { ContextMenuNone, ContextMenuChannelSettings, ContextMenuStreamSettings }
 
- Protected Member Functions inherited from RollupWidget
int arrangeRollups ()
 
QByteArray saveState (int version=0) const
 
bool restoreState (const QByteArray &state, int version=0)
 
void paintEvent (QPaintEvent *)
 
int paintRollup (QWidget *rollup, int pos, QPainter *p, bool last, const QColor &frame)
 
void resizeEvent (QResizeEvent *size)
 
void mousePressEvent (QMouseEvent *event)
 
bool event (QEvent *event)
 
bool eventFilter (QObject *object, QEvent *event)
 
void resetContextMenuType ()
 
void setStreamIndicator (const QString &indicator)
 
- Protected Attributes inherited from RollupWidget
QColor m_titleColor
 
QColor m_titleTextColor
 
bool m_highlighted
 
ContextMenuType m_contextMenuType
 
QString m_streamIndicator
 

Detailed Description

Definition at line 40 of file freqtrackergui.h.

Constructor & Destructor Documentation

◆ FreqTrackerGUI()

FreqTrackerGUI::FreqTrackerGUI ( PluginAPI pluginAPI,
DeviceUISet deviceUISet,
BasebandSampleSink rxChannel,
QWidget *  parent = 0 
)
explicitprivate

Definition at line 278 of file freqtrackergui.cpp.

References DeviceUISet::addChannelMarker(), DeviceUISet::addRollupWidget(), applySettings(), arg(), channelMarkerChangedByCursor(), channelMarkerHighlightedByCursor(), LevelMeterSignalDB::ColorGreenAndBlue, displaySettings(), ChannelMarker::getColor(), getInputMessageQueue(), MainWindow::getInstance(), ColorMapper::GrayGold, handleInputMessages(), FreqTracker::m_channelIdURI, m_channelMarker, m_deviceUISet, m_freqTracker, m_settings, onMenuDialogCalled(), onWidgetRolled(), DeviceUISet::registerRxChannelInstance(), ChannelMarker::setBandwidth(), ChannelMarker::setCenterFrequency(), FreqTrackerSettings::setChannelMarker(), ChannelMarker::setColor(), BasebandSampleSink::setMessageQueueToGUI(), ChannelMarker::setTitle(), RollupWidget::setTitleColor(), ChannelMarker::setVisible(), tick(), ui, and RollupWidget::widgetRolled().

Referenced by create().

278  :
279  RollupWidget(parent),
280  ui(new Ui::FreqTrackerGUI),
281  m_pluginAPI(pluginAPI),
282  m_deviceUISet(deviceUISet),
283  m_channelMarker(this),
285  m_doApplySettings(true),
286  m_squelchOpen(false),
287  m_tickCount(0)
288 {
289  ui->setupUi(this);
290  setAttribute(Qt::WA_DeleteOnClose, true);
291  connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
292  connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
293 
294  m_freqTracker = reinterpret_cast<FreqTracker*>(rxChannel); //new FreqTracker(m_deviceUISet->m_deviceSourceAPI);
296 
297  connect(&MainWindow::getInstance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); // 50 ms
298 
299  ui->deltaFrequencyLabel->setText(QString("%1f").arg(QChar(0x94, 0x03)));
300  ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
301  ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999);
302  ui->channelPowerMeter->setColorTheme(LevelMeterSignalDB::ColorGreenAndBlue);
303 
304  m_channelMarker.blockSignals(true);
305  m_channelMarker.setColor(Qt::yellow);
308  m_channelMarker.setTitle("AM Demodulator");
309  m_channelMarker.blockSignals(false);
310  m_channelMarker.setVisible(true); // activate signal on the last setting only
311 
314 
318 
319  connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor()));
320  connect(&m_channelMarker, SIGNAL(highlightedByCursor()), this, SLOT(channelMarkerHighlightedByCursor()));
321  connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
322 
323  displaySettings();
324  applySettings(true);
325 }
static MainWindow * getInstance()
Definition: mainwindow.h:73
void setChannelMarker(Serializable *channelMarker)
void onWidgetRolled(QWidget *widget, bool rollDown)
Ui::FreqTrackerGUI * ui
void channelMarkerChangedByCursor()
FreqTrackerSettings m_settings
void addChannelMarker(ChannelMarker *channelMarker)
Add channel marker to spectrum.
Definition: deviceuiset.cpp:72
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void onMenuDialogCalled(const QPoint &p)
DeviceUISet * m_deviceUISet
static const QString m_channelIdURI
Definition: freqtracker.h:185
RollupWidget(QWidget *parent=NULL)
Definition: rollupwidget.cpp:7
FreqTracker * m_freqTracker
virtual void setMessageQueueToGUI(MessageQueue *queue)
virtual MessageQueue * getInputMessageQueue()
uint32_t m_tickCount
void setTitleColor(const QColor &c)
void registerRxChannelInstance(const QString &channelName, PluginInstanceGUI *pluginGUI)
Definition: deviceuiset.cpp:82
void addRollupWidget(QWidget *widget)
Add rollup widget to channel window.
Definition: deviceuiset.cpp:77
PluginAPI * m_pluginAPI
void handleInputMessages()
void setColor(const QColor &color)
ChannelMarker m_channelMarker
void setVisible(bool visible)
void setBandwidth(int bandwidth)
const QColor & getColor() const
Definition: channelmarker.h:64
void setTitle(const QString &title)
void setCenterFrequency(int centerFrequency)
void widgetRolled(QWidget *widget, bool rollDown)
void channelMarkerHighlightedByCursor()
void applySettings(bool force=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~FreqTrackerGUI()

FreqTrackerGUI::~FreqTrackerGUI ( )
privatevirtual

Definition at line 327 of file freqtrackergui.cpp.

References m_deviceUISet, m_freqTracker, DeviceUISet::removeRxChannelInstance(), and ui.

328 {
330  delete m_freqTracker; // TODO: check this: when the GUI closes it has to delete the demodulator
331  delete ui;
332 }
Ui::FreqTrackerGUI * ui
DeviceUISet * m_deviceUISet
FreqTracker * m_freqTracker
void removeRxChannelInstance(PluginInstanceGUI *pluginGUI)
Definition: deviceuiset.cpp:94
+ Here is the call graph for this function:

Member Function Documentation

◆ applySettings()

void FreqTrackerGUI::applySettings ( bool  force = false)
private

Definition at line 339 of file freqtrackergui.cpp.

References FreqTracker::MsgConfigureFreqTracker::create(), BasebandSampleSink::getInputMessageQueue(), m_doApplySettings, m_freqTracker, m_settings, and MessageQueue::push().

Referenced by channelMarkerChangedByCursor(), deserialize(), FreqTrackerGUI(), on_alphaEMA_valueChanged(), on_deltaFrequency_changed(), on_log2Decim_currentIndexChanged(), on_pllPskOrder_currentIndexChanged(), on_rfBW_valueChanged(), on_rrc_toggled(), on_rrcRolloff_valueChanged(), on_squelch_valueChanged(), on_squelchGate_valueChanged(), on_trackerType_currentIndexChanged(), on_tracking_toggled(), onMenuDialogCalled(), resetToDefaults(), and setCenterFrequency().

340 {
341  if (m_doApplySettings)
342  {
345  }
346 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
FreqTrackerSettings m_settings
FreqTracker * m_freqTracker
static MsgConfigureFreqTracker * create(const FreqTrackerSettings &settings, bool force)
Definition: freqtracker.h:59
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ blockApplySettings()

void FreqTrackerGUI::blockApplySettings ( bool  block)
private

Definition at line 334 of file freqtrackergui.cpp.

References m_doApplySettings.

Referenced by displaySettings(), and handleMessage().

335 {
336  m_doApplySettings = !block;
337 }
+ Here is the caller graph for this function:

◆ channelMarkerChangedByCursor

void FreqTrackerGUI::channelMarkerChangedByCursor ( )
slot

Definition at line 144 of file freqtrackergui.cpp.

References applySettings(), ChannelMarker::getCenterFrequency(), m_channelMarker, FreqTrackerSettings::m_inputFrequencyOffset, m_settings, and ui.

Referenced by FreqTrackerGUI().

145 {
146  ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
148  applySettings();
149 }
int getCenterFrequency() const
Definition: channelmarker.h:42
Ui::FreqTrackerGUI * ui
FreqTrackerSettings m_settings
ChannelMarker m_channelMarker
void applySettings(bool force=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ channelMarkerHighlightedByCursor

void FreqTrackerGUI::channelMarkerHighlightedByCursor ( )
slot

Definition at line 151 of file freqtrackergui.cpp.

References ChannelMarker::getHighlighted(), m_channelMarker, and RollupWidget::setHighlighted().

Referenced by FreqTrackerGUI().

152 {
154 }
bool getHighlighted() const
Definition: channelmarker.h:61
void setHighlighted(bool highlighted)
ChannelMarker m_channelMarker
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

FreqTrackerGUI * FreqTrackerGUI::create ( PluginAPI pluginAPI,
DeviceUISet deviceUISet,
BasebandSampleSink rxChannel 
)
static

Definition at line 40 of file freqtrackergui.cpp.

References FreqTrackerGUI().

Referenced by FreqTrackerPlugin::createRxChannelGUI().

41 {
42  FreqTrackerGUI* gui = new FreqTrackerGUI(pluginAPI, deviceUISet, rxChannel);
43  return gui;
44 }
FreqTrackerGUI(PluginAPI *pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget *parent=0)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deserialize()

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

Implements PluginInstanceGUI.

Definition at line 83 of file freqtrackergui.cpp.

References applySettings(), FreqTrackerSettings::deserialize(), displaySettings(), m_settings, and resetToDefaults().

84 {
85  if(m_settings.deserialize(data)) {
87  applySettings(true);
88  return true;
89  } else {
91  return false;
92  }
93 }
FreqTrackerSettings m_settings
bool deserialize(const QByteArray &data)
void applySettings(bool force=false)
+ Here is the call graph for this function:

◆ destroy()

void FreqTrackerGUI::destroy ( )
virtual

Implements PluginInstanceGUI.

Definition at line 46 of file freqtrackergui.cpp.

47 {
48  delete this;
49 }

◆ displaySettings()

void FreqTrackerGUI::displaySettings ( )
private

Definition at line 348 of file freqtrackergui.cpp.

References arg(), blockApplySettings(), ChannelMarker::getCenterFrequency(), ChannelMarker::getTitle(), i, FreqTrackerSettings::m_alphaEMA, m_channelMarker, FreqTrackerSettings::m_inputFrequencyOffset, FreqTrackerSettings::m_log2Decim, FreqTrackerSettings::m_pllPskOrder, FreqTrackerSettings::m_rfBandwidth, FreqTrackerSettings::m_rgbColor, FreqTrackerSettings::m_rrc, FreqTrackerSettings::m_rrcRolloff, m_settings, FreqTrackerSettings::m_squelch, FreqTrackerSettings::m_squelchGate, FreqTrackerSettings::m_title, FreqTrackerSettings::m_trackerType, FreqTrackerSettings::m_tracking, ChannelMarker::setBandwidth(), ChannelMarker::setCenterFrequency(), ChannelMarker::setColor(), ChannelMarker::setTitle(), RollupWidget::setTitleColor(), and ui.

Referenced by deserialize(), FreqTrackerGUI(), handleMessage(), and resetToDefaults().

349 {
350  m_channelMarker.blockSignals(true);
354  m_channelMarker.blockSignals(false);
355  m_channelMarker.setColor(m_settings.m_rgbColor); // activate signal on the last setting only
356 
358  setWindowTitle(m_channelMarker.getTitle());
359 
360  blockApplySettings(true);
361 
362  ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
363  ui->log2Decim->setCurrentIndex(m_settings.m_log2Decim);
364  int displayValue = m_settings.m_rfBandwidth/100.0;
365  ui->rfBW->setValue(displayValue);
366  ui->rfBWText->setText(QString("%1 kHz").arg(displayValue / 10.0, 0, 'f', 1));
367  ui->squelch->setValue(m_settings.m_squelch);
368  ui->squelchText->setText(QString("%1 dB").arg(m_settings.m_squelch));
369  ui->tracking->setChecked(m_settings.m_tracking);
370  ui->trackerType->setCurrentIndex((int) m_settings.m_trackerType);
371  QString alphaEMAStr = QString::number(m_settings.m_alphaEMA, 'f', 2);
372  ui->alphaEMAText->setText(alphaEMAStr);
373  ui->alphaEMA->setValue(m_settings.m_alphaEMA*100.0);
374 
375  int i = 0;
376  for(; ((m_settings.m_pllPskOrder>>i) & 1) == 0; i++);
377  ui->pllPskOrder->setCurrentIndex(i);
378 
379  ui->rrc->setChecked(m_settings.m_rrc);
380  ui->rrcRolloff->setValue(m_settings.m_rrcRolloff);
381  QString rolloffStr = QString::number(m_settings.m_rrcRolloff/100.0, 'f', 2);
382  ui->rrcRolloffText->setText(rolloffStr);
383  ui->squelchGateText->setText(QString("%1").arg(m_settings.m_squelchGate * 10.0f, 0, 'f', 0));
384  ui->squelchGate->setValue(m_settings.m_squelchGate);
385 
386  blockApplySettings(false);
387 }
int getCenterFrequency() const
Definition: channelmarker.h:42
int m_squelchGate
in 10s of ms
Ui::FreqTrackerGUI * ui
FreqTrackerSettings m_settings
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void setTitleColor(const QColor &c)
int32_t i
Definition: decimators.h:244
const QString & getTitle() const
Definition: channelmarker.h:38
void blockApplySettings(bool block)
void setColor(const QColor &color)
ChannelMarker m_channelMarker
uint32_t m_rrcRolloff
in 100ths
void setBandwidth(int bandwidth)
void setTitle(const QString &title)
void setCenterFrequency(int centerFrequency)
float m_alphaEMA
alpha factor for delta frequency EMA
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ enterEvent()

void FreqTrackerGUI::enterEvent ( QEvent *  )
private

Definition at line 394 of file freqtrackergui.cpp.

References m_channelMarker, and ChannelMarker::setHighlighted().

395 {
397 }
void setHighlighted(bool highlighted)
ChannelMarker m_channelMarker
+ Here is the call graph for this function:

◆ getCenterFrequency()

qint64 FreqTrackerGUI::getCenterFrequency ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 61 of file freqtrackergui.cpp.

References ChannelMarker::getCenterFrequency(), and m_channelMarker.

61  {
63 }
int getCenterFrequency() const
Definition: channelmarker.h:42
ChannelMarker m_channelMarker
+ Here is the call graph for this function:

◆ getInputMessageQueue()

virtual MessageQueue* FreqTrackerGUI::getInputMessageQueue ( )
inlinevirtual

Implements PluginInstanceGUI.

Definition at line 55 of file freqtrackergui.h.

Referenced by FreqTrackerGUI(), and handleInputMessages().

55 { return &m_inputMessageQueue; }
MessageQueue m_inputMessageQueue
+ Here is the caller graph for this function:

◆ getName()

QString FreqTrackerGUI::getName ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 56 of file freqtrackergui.cpp.

57 {
58  return objectName();
59 }

◆ handleInputMessages

void FreqTrackerGUI::handleInputMessages ( )
privateslot

Definition at line 131 of file freqtrackergui.cpp.

References getInputMessageQueue(), and handleMessage().

Referenced by FreqTrackerGUI().

132 {
133  Message* message;
134 
135  while ((message = getInputMessageQueue()->pop()) != 0)
136  {
137  if (handleMessage(*message))
138  {
139  delete message;
140  }
141  }
142 }
virtual MessageQueue * getInputMessageQueue()
virtual bool handleMessage(const Message &message)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleMessage()

bool FreqTrackerGUI::handleMessage ( const Message message)
virtual

Implements PluginInstanceGUI.

Definition at line 95 of file freqtrackergui.cpp.

References arg(), blockApplySettings(), displaySettings(), FreqTracker::MsgSampleRateNotification::getFrequencyOffset(), FreqTracker::MsgSampleRateNotification::getSampleRate(), FreqTracker::MsgConfigureFreqTracker::getSettings(), m_channelMarker, m_channelSampleRate, FreqTrackerSettings::m_inputFrequencyOffset, m_settings, FreqTrackerSettings::m_tracking, Message::match(), ChannelMarker::setCenterFrequency(), and ui.

Referenced by handleInputMessages().

96 {
98  {
99  qDebug("FreqTrackerGUI::handleMessage: FreqTracker::MsgConfigureFreqTracker");
101  m_settings = cfg.getSettings();
102  blockApplySettings(true);
103  displaySettings();
104  blockApplySettings(false);
105  return true;
106  }
108  {
109  if (!m_settings.m_tracking) {
110  qDebug("FreqTrackerGUI::handleMessage: FreqTracker::MsgSampleRateNotification");
111  }
114  ui->channelSampleRateText->setText(tr("%1k").arg(QString::number(m_channelSampleRate / 1000.0f, 'g', 5)));
115  blockApplySettings(true);
117  ui->deltaFrequency->setValue(m_settings.m_inputFrequencyOffset);
119  blockApplySettings(false);
120 
121  if (m_channelSampleRate > 1000) {
122  ui->rfBW->setMaximum(m_channelSampleRate/100);
123  }
124 
125  return true;
126  }
127 
128  return false;
129 }
Ui::FreqTrackerGUI * ui
FreqTrackerSettings m_settings
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
static bool match(const Message *message)
Definition: message.cpp:45
void blockApplySettings(bool block)
const FreqTrackerSettings & getSettings() const
Definition: freqtracker.h:56
ChannelMarker m_channelMarker
void setCenterFrequency(int centerFrequency)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ leaveEvent()

void FreqTrackerGUI::leaveEvent ( QEvent *  )
private

Definition at line 389 of file freqtrackergui.cpp.

References m_channelMarker, and ChannelMarker::setHighlighted().

390 {
392 }
void setHighlighted(bool highlighted)
ChannelMarker m_channelMarker
+ Here is the call graph for this function:

◆ on_alphaEMA_valueChanged

void FreqTrackerGUI::on_alphaEMA_valueChanged ( int  value)
privateslot

Definition at line 189 of file freqtrackergui.cpp.

References applySettings(), FreqTrackerSettings::m_alphaEMA, m_settings, and ui.

190 {
191  m_settings.m_alphaEMA = value / 100.0;
192  QString alphaEMAStr = QString::number(m_settings.m_alphaEMA, 'f', 2);
193  ui->alphaEMAText->setText(alphaEMAStr);
194  applySettings();
195 }
Ui::FreqTrackerGUI * ui
FreqTrackerSettings m_settings
float m_alphaEMA
alpha factor for delta frequency EMA
void applySettings(bool force=false)
+ Here is the call graph for this function:

◆ on_deltaFrequency_changed

void FreqTrackerGUI::on_deltaFrequency_changed ( qint64  value)
privateslot

Definition at line 156 of file freqtrackergui.cpp.

References applySettings(), ChannelMarker::getCenterFrequency(), m_channelMarker, FreqTrackerSettings::m_inputFrequencyOffset, m_settings, and ChannelMarker::setCenterFrequency().

157 {
160  applySettings();
161 }
int getCenterFrequency() const
Definition: channelmarker.h:42
FreqTrackerSettings m_settings
ChannelMarker m_channelMarker
void setCenterFrequency(int centerFrequency)
void applySettings(bool force=false)
+ Here is the call graph for this function:

◆ on_log2Decim_currentIndexChanged

void FreqTrackerGUI::on_log2Decim_currentIndexChanged ( int  index)
privateslot

Definition at line 163 of file freqtrackergui.cpp.

References applySettings(), FreqTrackerSettings::m_log2Decim, and m_settings.

164 {
165  m_settings.m_log2Decim = index < 0 ? 0 : index > 6 ? 6 : index;
166  applySettings();
167 }
FreqTrackerSettings m_settings
void applySettings(bool force=false)
+ Here is the call graph for this function:

◆ on_pllPskOrder_currentIndexChanged

void FreqTrackerGUI::on_pllPskOrder_currentIndexChanged ( int  index)
privateslot

Definition at line 203 of file freqtrackergui.cpp.

References applySettings(), FreqTrackerSettings::m_pllPskOrder, and m_settings.

204 {
205  if ((index < 0) || (index > 5)) {
206  return;
207  }
208 
209  m_settings.m_pllPskOrder = 1<<index;
210  applySettings();
211 }
FreqTrackerSettings m_settings
void applySettings(bool force=false)
+ Here is the call graph for this function:

◆ on_rfBW_valueChanged

void FreqTrackerGUI::on_rfBW_valueChanged ( int  value)
privateslot

Definition at line 169 of file freqtrackergui.cpp.

References applySettings(), arg(), m_channelMarker, FreqTrackerSettings::m_rfBandwidth, m_settings, ChannelMarker::setBandwidth(), and ui.

170 {
171  ui->rfBWText->setText(QString("%1 kHz").arg(value / 10.0, 0, 'f', 1));
172  m_channelMarker.setBandwidth(value * 100);
173  m_settings.m_rfBandwidth = value * 100;
174  applySettings();
175 }
Ui::FreqTrackerGUI * ui
FreqTrackerSettings m_settings
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
ChannelMarker m_channelMarker
void setBandwidth(int bandwidth)
void applySettings(bool force=false)
+ Here is the call graph for this function:

◆ on_rrc_toggled

void FreqTrackerGUI::on_rrc_toggled ( bool  checked)
privateslot

Definition at line 213 of file freqtrackergui.cpp.

References applySettings(), FreqTrackerSettings::m_rrc, and m_settings.

214 {
215  m_settings.m_rrc = checked;
216  applySettings();
217 }
FreqTrackerSettings m_settings
void applySettings(bool force=false)
+ Here is the call graph for this function:

◆ on_rrcRolloff_valueChanged

void FreqTrackerGUI::on_rrcRolloff_valueChanged ( int  value)
privateslot

Definition at line 219 of file freqtrackergui.cpp.

References applySettings(), FreqTrackerSettings::m_rrcRolloff, m_settings, and ui.

220 {
221  m_settings.m_rrcRolloff = value < 0 ? 0 : value > 100 ? 100 : value;
222  QString rolloffStr = QString::number(value/100.0, 'f', 2);
223  ui->rrcRolloffText->setText(rolloffStr);
224  applySettings();
225 }
Ui::FreqTrackerGUI * ui
FreqTrackerSettings m_settings
uint32_t m_rrcRolloff
in 100ths
void applySettings(bool force=false)
+ Here is the call graph for this function:

◆ on_squelch_valueChanged

void FreqTrackerGUI::on_squelch_valueChanged ( int  value)
privateslot

Definition at line 227 of file freqtrackergui.cpp.

References applySettings(), arg(), m_settings, FreqTrackerSettings::m_squelch, and ui.

228 {
229  ui->squelchText->setText(QString("%1 dB").arg(value));
230  m_settings.m_squelch = value;
231  applySettings();
232 }
Ui::FreqTrackerGUI * ui
FreqTrackerSettings m_settings
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void applySettings(bool force=false)
+ Here is the call graph for this function:

◆ on_squelchGate_valueChanged

void FreqTrackerGUI::on_squelchGate_valueChanged ( int  value)
privateslot

Definition at line 234 of file freqtrackergui.cpp.

References applySettings(), arg(), m_settings, FreqTrackerSettings::m_squelchGate, and ui.

235 {
236  ui->squelchGateText->setText(QString("%1").arg(value * 10.0f, 0, 'f', 0));
237  m_settings.m_squelchGate = value;
238  applySettings();
239 }
int m_squelchGate
in 10s of ms
Ui::FreqTrackerGUI * ui
FreqTrackerSettings m_settings
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void applySettings(bool force=false)
+ Here is the call graph for this function:

◆ on_trackerType_currentIndexChanged

void FreqTrackerGUI::on_trackerType_currentIndexChanged ( int  index)
privateslot

Definition at line 197 of file freqtrackergui.cpp.

References applySettings(), m_settings, and FreqTrackerSettings::m_trackerType.

198 {
200  applySettings();
201 }
FreqTrackerSettings m_settings
void applySettings(bool force=false)
+ Here is the call graph for this function:

◆ on_tracking_toggled

void FreqTrackerGUI::on_tracking_toggled ( bool  checked)
privateslot

Definition at line 177 of file freqtrackergui.cpp.

References applySettings(), m_settings, FreqTrackerSettings::m_tracking, and ui.

178 {
179  if (!checked)
180  {
181  ui->tracking->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
182  ui->tracking->setToolTip(tr("PLL for synchronous AM"));
183  }
184 
185  m_settings.m_tracking = checked;
186  applySettings();
187 }
Ui::FreqTrackerGUI * ui
FreqTrackerSettings m_settings
void applySettings(bool force=false)
+ Here is the call graph for this function:

◆ onMenuDialogCalled

void FreqTrackerGUI::onMenuDialogCalled ( const QPoint &  p)
privateslot

Definition at line 247 of file freqtrackergui.cpp.

References applySettings(), RollupWidget::ContextMenuChannelSettings, ChannelMarker::getCenterFrequency(), ChannelMarker::getColor(), BasicChannelSettingsDialog::getReverseAPIAddress(), BasicChannelSettingsDialog::getReverseAPIChannelIndex(), BasicChannelSettingsDialog::getReverseAPIDeviceIndex(), BasicChannelSettingsDialog::getReverseAPIPort(), ChannelMarker::getTitle(), m_channelMarker, RollupWidget::m_contextMenuType, FreqTrackerSettings::m_inputFrequencyOffset, FreqTrackerSettings::m_reverseAPIAddress, FreqTrackerSettings::m_reverseAPIChannelIndex, FreqTrackerSettings::m_reverseAPIDeviceIndex, FreqTrackerSettings::m_reverseAPIPort, FreqTrackerSettings::m_rgbColor, m_settings, FreqTrackerSettings::m_title, FreqTrackerSettings::m_useReverseAPI, RollupWidget::resetContextMenuType(), BasicChannelSettingsDialog::setReverseAPIAddress(), BasicChannelSettingsDialog::setReverseAPIChannelIndex(), BasicChannelSettingsDialog::setReverseAPIDeviceIndex(), BasicChannelSettingsDialog::setReverseAPIPort(), RollupWidget::setTitleColor(), BasicChannelSettingsDialog::setUseReverseAPI(), and BasicChannelSettingsDialog::useReverseAPI().

Referenced by FreqTrackerGUI().

248 {
250  {
252  dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
253  dialog.setReverseAPIAddress(m_settings.m_reverseAPIAddress);
254  dialog.setReverseAPIPort(m_settings.m_reverseAPIPort);
255  dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex);
256  dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex);
257  dialog.move(p);
258  dialog.exec();
259 
263  m_settings.m_useReverseAPI = dialog.useReverseAPI();
264  m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress();
265  m_settings.m_reverseAPIPort = dialog.getReverseAPIPort();
266  m_settings.m_reverseAPIDeviceIndex = dialog.getReverseAPIDeviceIndex();
267  m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex();
268 
269  setWindowTitle(m_settings.m_title);
271 
272  applySettings();
273  }
274 
276 }
int getCenterFrequency() const
Definition: channelmarker.h:42
FreqTrackerSettings m_settings
void resetContextMenuType()
Definition: rollupwidget.h:50
ContextMenuType m_contextMenuType
Definition: rollupwidget.h:33
void setTitleColor(const QColor &c)
const QString & getTitle() const
Definition: channelmarker.h:38
ChannelMarker m_channelMarker
const QColor & getColor() const
Definition: channelmarker.h:64
void applySettings(bool force=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ onWidgetRolled

void FreqTrackerGUI::onWidgetRolled ( QWidget *  widget,
bool  rollDown 
)
privateslot

Definition at line 241 of file freqtrackergui.cpp.

Referenced by FreqTrackerGUI().

242 {
243  (void) widget;
244  (void) rollDown;
245 }
+ Here is the caller graph for this function:

◆ resetToDefaults()

void FreqTrackerGUI::resetToDefaults ( )
virtual

Implements PluginInstanceGUI.

Definition at line 71 of file freqtrackergui.cpp.

References applySettings(), displaySettings(), m_settings, and FreqTrackerSettings::resetToDefaults().

Referenced by deserialize().

72 {
75  applySettings(true);
76 }
FreqTrackerSettings m_settings
void applySettings(bool force=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize()

QByteArray FreqTrackerGUI::serialize ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 78 of file freqtrackergui.cpp.

References m_settings, and FreqTrackerSettings::serialize().

79 {
80  return m_settings.serialize();
81 }
FreqTrackerSettings m_settings
QByteArray serialize() const
+ Here is the call graph for this function:

◆ setCenterFrequency()

void FreqTrackerGUI::setCenterFrequency ( qint64  centerFrequency)
virtual

Implements PluginInstanceGUI.

Definition at line 65 of file freqtrackergui.cpp.

References applySettings(), m_channelMarker, and ChannelMarker::setCenterFrequency().

66 {
67  m_channelMarker.setCenterFrequency(centerFrequency);
68  applySettings();
69 }
ChannelMarker m_channelMarker
void setCenterFrequency(int centerFrequency)
void applySettings(bool force=false)
+ Here is the call graph for this function:

◆ setName()

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

Implements PluginInstanceGUI.

Definition at line 51 of file freqtrackergui.cpp.

52 {
53  setObjectName(name);
54 }

◆ tick

void FreqTrackerGUI::tick ( )
privateslot

Definition at line 399 of file freqtrackergui.cpp.

References arg(), CalcDb::dbPower(), FreqTracker::getAvgDeltaFreq(), FreqTracker::getMagSqLevels(), FreqTracker::getPllLocked(), FreqTracker::getSquelchOpen(), m_freqTracker, m_settings, m_tickCount, FreqTrackerSettings::m_tracking, and ui.

Referenced by FreqTrackerGUI().

400 {
401  double magsqAvg, magsqPeak;
402  int nbMagsqSamples;
403  m_freqTracker->getMagSqLevels(magsqAvg, magsqPeak, nbMagsqSamples);
404  double powDbAvg = CalcDb::dbPower(magsqAvg);
405  double powDbPeak = CalcDb::dbPower(magsqPeak);
406 
407  ui->channelPowerMeter->levelChanged(
408  (100.0f + powDbAvg) / 100.0f,
409  (100.0f + powDbPeak) / 100.0f,
410  nbMagsqSamples);
411 
412  if (m_tickCount % 4 == 0) {
413  ui->channelPower->setText(QString::number(powDbAvg, 'f', 1));
414  }
415 
416  bool squelchOpen = m_freqTracker->getSquelchOpen();
417 
418  if (squelchOpen) {
419  ui->squelchLabel->setStyleSheet("QLabel { background-color : green; }");
420  } else {
421  ui->squelchLabel->setStyleSheet("QLabel { background:rgb(50,50,50); }");
422  }
423 
424  if (m_freqTracker->getPllLocked()) {
425  ui->tracking->setStyleSheet("QToolButton { background-color : green; }");
426  } else {
427  ui->tracking->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
428  }
429 
430  int freq = m_freqTracker->getAvgDeltaFreq();
431  QLocale loc;
432  ui->trackingFrequencyText->setText(tr("%1 Hz").arg(loc.toString(freq)));
433 
434  if (m_settings.m_tracking) {
435  ui->tracking->setToolTip("Tracking on");
436  } else {
437  ui->tracking->setToolTip("Tracking off");
438  }
439 
440  m_tickCount++;
441 }
static double dbPower(double magsq, double floor=1e-12)
Definition: db.cpp:22
Ui::FreqTrackerGUI * ui
FreqTrackerSettings m_settings
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void getMagSqLevels(double &avg, double &peak, int &nbSamples)
Definition: freqtracker.h:167
bool getPllLocked() const
Definition: freqtracker.h:163
FreqTracker * m_freqTracker
uint32_t m_tickCount
bool getSquelchOpen() const
Definition: freqtracker.h:162
Real getAvgDeltaFreq() const
Definition: freqtracker.h:165
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_channelMarker

ChannelMarker FreqTrackerGUI::m_channelMarker
private

◆ m_channelSampleRate

int FreqTrackerGUI::m_channelSampleRate
private

Definition at line 68 of file freqtrackergui.h.

Referenced by handleMessage().

◆ m_deviceUISet

DeviceUISet* FreqTrackerGUI::m_deviceUISet
private

Definition at line 65 of file freqtrackergui.h.

Referenced by FreqTrackerGUI(), and ~FreqTrackerGUI().

◆ m_doApplySettings

bool FreqTrackerGUI::m_doApplySettings
private

Definition at line 69 of file freqtrackergui.h.

Referenced by applySettings(), and blockApplySettings().

◆ m_freqTracker

FreqTracker* FreqTrackerGUI::m_freqTracker
private

Definition at line 71 of file freqtrackergui.h.

Referenced by applySettings(), FreqTrackerGUI(), tick(), and ~FreqTrackerGUI().

◆ m_inputMessageQueue

MessageQueue FreqTrackerGUI::m_inputMessageQueue
private

Definition at line 74 of file freqtrackergui.h.

◆ m_pluginAPI

PluginAPI* FreqTrackerGUI::m_pluginAPI
private

Definition at line 64 of file freqtrackergui.h.

◆ m_settings

FreqTrackerSettings FreqTrackerGUI::m_settings
private

◆ m_squelchOpen

bool FreqTrackerGUI::m_squelchOpen
private

Definition at line 72 of file freqtrackergui.h.

◆ m_tickCount

uint32_t FreqTrackerGUI::m_tickCount
private

Definition at line 73 of file freqtrackergui.h.

Referenced by tick().

◆ ui

Ui::FreqTrackerGUI* FreqTrackerGUI::ui
private

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