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 Types | Public Member Functions | Public Attributes | List of all members
FreqTrackerSettings Struct Reference

#include <freqtrackersettings.h>

+ Collaboration diagram for FreqTrackerSettings:

Public Types

enum  TrackerType { TrackerNone, TrackerFLL, TrackerPLL }
 

Public Member Functions

 FreqTrackerSettings ()
 
void resetToDefaults ()
 
void setChannelMarker (Serializable *channelMarker)
 
QByteArray serialize () const
 
bool deserialize (const QByteArray &data)
 

Public Attributes

qint32 m_inputFrequencyOffset
 
Real m_rfBandwidth
 
uint32_t m_log2Decim
 
Real m_squelch
 
quint32 m_rgbColor
 
QString m_title
 
Serializablem_channelMarker
 
float m_alphaEMA
 alpha factor for delta frequency EMA More...
 
bool m_tracking
 
TrackerType m_trackerType
 
uint32_t m_pllPskOrder
 
bool m_rrc
 
uint32_t m_rrcRolloff
 in 100ths More...
 
int m_squelchGate
 in 10s of ms More...
 
bool m_useReverseAPI
 
QString m_reverseAPIAddress
 
uint16_t m_reverseAPIPort
 
uint16_t m_reverseAPIDeviceIndex
 
uint16_t m_reverseAPIChannelIndex
 

Detailed Description

Definition at line 28 of file freqtrackersettings.h.

Member Enumeration Documentation

◆ TrackerType

Enumerator
TrackerNone 
TrackerFLL 
TrackerPLL 

Definition at line 30 of file freqtrackersettings.h.

Constructor & Destructor Documentation

◆ FreqTrackerSettings()

FreqTrackerSettings::FreqTrackerSettings ( )

Definition at line 25 of file freqtrackersettings.cpp.

References resetToDefaults().

25  :
27 {
29 }
Serializable * m_channelMarker
+ Here is the call graph for this function:

Member Function Documentation

◆ deserialize()

bool FreqTrackerSettings::deserialize ( const QByteArray &  data)

Definition at line 83 of file freqtrackersettings.cpp.

References Serializable::deserialize(), SimpleDeserializer::getVersion(), SimpleDeserializer::isValid(), m_alphaEMA, m_channelMarker, m_inputFrequencyOffset, m_log2Decim, m_pllPskOrder, m_reverseAPIAddress, m_reverseAPIChannelIndex, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_rfBandwidth, m_rgbColor, m_rrc, m_rrcRolloff, m_squelch, m_squelchGate, m_title, m_trackerType, m_tracking, m_useReverseAPI, SimpleDeserializer::readBlob(), SimpleDeserializer::readBool(), SimpleDeserializer::readFloat(), SimpleDeserializer::readS32(), SimpleDeserializer::readString(), SimpleDeserializer::readU32(), resetToDefaults(), and TrackerPLL.

Referenced by FreqTrackerGUI::deserialize(), FreqTracker::deserialize(), and setChannelMarker().

84 {
85  SimpleDeserializer d(data);
86 
87  if(!d.isValid())
88  {
90  return false;
91  }
92 
93  if(d.getVersion() == 1)
94  {
95  QByteArray bytetmp;
96  qint32 tmp;
97  uint32_t utmp;
98  QString strtmp;
99  float ftmp;
100 
101  d.readS32(1, &m_inputFrequencyOffset, 0);
102  d.readS32(2, &tmp, 4);
103  m_rfBandwidth = 100 * tmp;
104  d.readU32(3, &utmp, 0);
105  m_log2Decim = utmp > 6 ? 6 : utmp;
106  d.readS32(4, &tmp, 20);
107  d.readS32(5, &tmp, -40);
108  m_squelch = tmp;
109  d.readBlob(6, &bytetmp);
110 
111  if (m_channelMarker) {
112  m_channelMarker->deserialize(bytetmp);
113  }
114 
115  d.readU32(7, &m_rgbColor, QColor(200, 244, 66).rgb());
116  d.readFloat(8, &ftmp, 0.1);
117  m_alphaEMA = ftmp < 0.01 ? 0.01 : ftmp > 1.0 ? 1.0 : ftmp;
118  d.readString(9, &m_title, "Frequency Tracker");
119  d.readBool(10, &m_tracking, false);
120  d.readS32(12, &tmp, 0);
121  m_trackerType = tmp < 0 ? TrackerFLL : tmp > 2 ? TrackerPLL : (TrackerType) tmp;
122  d.readU32(13, &utmp, 2);
123  m_pllPskOrder = utmp > 32 ? 32 : utmp;
124  d.readBool(14, &m_rrc, false);
125  d.readU32(15, &utmp, 35);
126  m_rrcRolloff = utmp > 100 ? 100 : utmp;
127  d.readBool(16, &m_useReverseAPI, false);
128  d.readString(17, &m_reverseAPIAddress, "127.0.0.1");
129  d.readU32(18, &utmp, 0);
130 
131  if ((utmp > 1023) && (utmp < 65535)) {
132  m_reverseAPIPort = utmp;
133  } else {
134  m_reverseAPIPort = 8888;
135  }
136 
137  d.readU32(19, &utmp, 0);
138  m_reverseAPIDeviceIndex = utmp > 99 ? 99 : utmp;
139  d.readU32(20, &utmp, 0);
140  m_reverseAPIChannelIndex = utmp > 99 ? 99 : utmp;
141  d.readS32(21, &tmp, 5);
142  m_squelchGate = tmp < 0 ? 0 : tmp > 99 ? 99 : tmp;
143 
144  return true;
145  }
146  else
147  {
148  resetToDefaults();
149  return false;
150  }
151 }
int m_squelchGate
in 10s of ms
unsigned int uint32_t
Definition: rtptypes_win.h:46
Serializable * m_channelMarker
virtual bool deserialize(const QByteArray &data)=0
uint32_t m_rrcRolloff
in 100ths
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:

◆ resetToDefaults()

void FreqTrackerSettings::resetToDefaults ( )

Definition at line 31 of file freqtrackersettings.cpp.

References m_alphaEMA, m_inputFrequencyOffset, m_log2Decim, m_pllPskOrder, m_reverseAPIAddress, m_reverseAPIChannelIndex, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_rfBandwidth, m_rgbColor, m_rrc, m_rrcRolloff, m_squelch, m_squelchGate, m_title, m_trackerType, m_tracking, m_useReverseAPI, and TrackerFLL.

Referenced by deserialize(), FreqTracker::deserialize(), FreqTrackerSettings(), and FreqTrackerGUI::resetToDefaults().

32 {
34  m_rfBandwidth = 6000;
35  m_log2Decim = 0;
36  m_squelch = -40.0;
37  m_rgbColor = QColor(200, 244, 66).rgb();
38  m_title = "Frequency Tracker";
39  m_alphaEMA = 0.1;
40  m_tracking = false;
42  m_pllPskOrder = 2; // BPSK
43  m_rrc = false;
44  m_rrcRolloff = 35;
45  m_squelchGate = 5; // 50 ms
46  m_useReverseAPI = false;
47  m_reverseAPIAddress = "127.0.0.1";
48  m_reverseAPIPort = 8888;
51 }
int m_squelchGate
in 10s of ms
uint32_t m_rrcRolloff
in 100ths
float m_alphaEMA
alpha factor for delta frequency EMA
+ Here is the caller graph for this function:

◆ serialize()

QByteArray FreqTrackerSettings::serialize ( ) const

Definition at line 53 of file freqtrackersettings.cpp.

References SimpleSerializer::final(), m_alphaEMA, m_channelMarker, m_inputFrequencyOffset, m_log2Decim, m_pllPskOrder, m_reverseAPIAddress, m_reverseAPIChannelIndex, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_rfBandwidth, m_rgbColor, m_rrc, m_rrcRolloff, m_squelch, m_squelchGate, m_title, m_trackerType, m_tracking, m_useReverseAPI, Serializable::serialize(), SimpleSerializer::writeBlob(), SimpleSerializer::writeBool(), SimpleSerializer::writeFloat(), SimpleSerializer::writeS32(), SimpleSerializer::writeString(), and SimpleSerializer::writeU32().

Referenced by FreqTrackerGUI::serialize(), FreqTracker::serialize(), and setChannelMarker().

54 {
55  SimpleSerializer s(1);
56  s.writeS32(1, m_inputFrequencyOffset);
57  s.writeS32(2, m_rfBandwidth/100);
58  s.writeU32(3, m_log2Decim);
59  s.writeS32(5, m_squelch);
60 
61  if (m_channelMarker) {
62  s.writeBlob(6, m_channelMarker->serialize());
63  }
64 
65  s.writeU32(7, m_rgbColor);
66  s.writeFloat(8, m_alphaEMA);
67  s.writeString(9, m_title);
68  s.writeBool(10, m_tracking);
69  s.writeS32(12, (int) m_trackerType);
70  s.writeU32(13, m_pllPskOrder);
71  s.writeBool(14, m_rrc);
72  s.writeU32(15, m_rrcRolloff);
73  s.writeBool(16, m_useReverseAPI);
74  s.writeString(17, m_reverseAPIAddress);
75  s.writeU32(18, m_reverseAPIPort);
76  s.writeU32(19, m_reverseAPIDeviceIndex);
77  s.writeU32(20, m_reverseAPIChannelIndex);
78  s.writeS32(21, m_squelchGate);
79 
80  return s.final();
81 }
int m_squelchGate
in 10s of ms
Serializable * m_channelMarker
virtual QByteArray serialize() const =0
uint32_t m_rrcRolloff
in 100ths
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:

◆ setChannelMarker()

void FreqTrackerSettings::setChannelMarker ( Serializable channelMarker)
inline

Definition at line 59 of file freqtrackersettings.h.

References deserialize(), and serialize().

Referenced by FreqTrackerGUI::FreqTrackerGUI().

59 { m_channelMarker = channelMarker; }
Serializable * m_channelMarker
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_alphaEMA

float FreqTrackerSettings::m_alphaEMA

◆ m_channelMarker

Serializable* FreqTrackerSettings::m_channelMarker

Definition at line 43 of file freqtrackersettings.h.

Referenced by deserialize(), and serialize().

◆ m_inputFrequencyOffset

qint32 FreqTrackerSettings::m_inputFrequencyOffset

◆ m_log2Decim

uint32_t FreqTrackerSettings::m_log2Decim

◆ m_pllPskOrder

uint32_t FreqTrackerSettings::m_pllPskOrder

◆ m_reverseAPIAddress

QString FreqTrackerSettings::m_reverseAPIAddress

◆ m_reverseAPIChannelIndex

uint16_t FreqTrackerSettings::m_reverseAPIChannelIndex

◆ m_reverseAPIDeviceIndex

uint16_t FreqTrackerSettings::m_reverseAPIDeviceIndex

◆ m_reverseAPIPort

uint16_t FreqTrackerSettings::m_reverseAPIPort

◆ m_rfBandwidth

Real FreqTrackerSettings::m_rfBandwidth

◆ m_rgbColor

quint32 FreqTrackerSettings::m_rgbColor

◆ m_rrc

bool FreqTrackerSettings::m_rrc

◆ m_rrcRolloff

uint32_t FreqTrackerSettings::m_rrcRolloff

◆ m_squelch

Real FreqTrackerSettings::m_squelch

◆ m_squelchGate

int FreqTrackerSettings::m_squelchGate

◆ m_title

QString FreqTrackerSettings::m_title

◆ m_trackerType

TrackerType FreqTrackerSettings::m_trackerType

◆ m_tracking

bool FreqTrackerSettings::m_tracking

◆ m_useReverseAPI

bool FreqTrackerSettings::m_useReverseAPI

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