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 | Public Attributes | List of all members
DSDDemodSettings Struct Reference

#include <dsddemodsettings.h>

+ Collaboration diagram for DSDDemodSettings:

Public Member Functions

 DSDDemodSettings ()
 
void resetToDefaults ()
 
void setChannelMarker (Serializable *channelMarker)
 
void setScopeGUI (Serializable *scopeGUI)
 
QByteArray serialize () const
 
bool deserialize (const QByteArray &data)
 

Public Attributes

qint64 m_inputFrequencyOffset
 
Real m_rfBandwidth
 
Real m_fmDeviation
 
Real m_demodGain
 
Real m_volume
 
int m_baudRate
 
int m_squelchGate
 
Real m_squelch
 
bool m_audioMute
 
bool m_enableCosineFiltering
 
bool m_syncOrConstellation
 
bool m_slot1On
 
bool m_slot2On
 
bool m_tdmaStereo
 
bool m_pllLock
 
quint32 m_rgbColor
 
QString m_title
 
bool m_highPassFilter
 
int m_traceLengthMutliplier
 
int m_traceStroke
 
int m_traceDecay
 
QString m_audioDeviceName
 
bool m_useReverseAPI
 
QString m_reverseAPIAddress
 
uint16_t m_reverseAPIPort
 
uint16_t m_reverseAPIDeviceIndex
 
uint16_t m_reverseAPIChannelIndex
 
Serializablem_channelMarker
 
Serializablem_scopeGUI
 

Detailed Description

Definition at line 25 of file dsddemodsettings.h.

Constructor & Destructor Documentation

◆ DSDDemodSettings()

DSDDemodSettings::DSDDemodSettings ( )

Definition at line 25 of file dsddemodsettings.cpp.

References resetToDefaults().

25  :
26  m_channelMarker(0),
27  m_scopeGUI(0)
28 {
30 }
Serializable * m_channelMarker
Serializable * m_scopeGUI
+ Here is the call graph for this function:

Member Function Documentation

◆ deserialize()

bool DSDDemodSettings::deserialize ( const QByteArray &  data)

Definition at line 107 of file dsddemodsettings.cpp.

References Serializable::deserialize(), SimpleDeserializer::getVersion(), SimpleDeserializer::isValid(), m_audioDeviceName, m_audioMute, m_baudRate, m_channelMarker, AudioDeviceManager::m_defaultDeviceName, m_demodGain, m_enableCosineFiltering, m_fmDeviation, m_highPassFilter, m_inputFrequencyOffset, m_pllLock, m_reverseAPIAddress, m_reverseAPIChannelIndex, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_rfBandwidth, m_rgbColor, m_scopeGUI, m_slot1On, m_slot2On, m_squelch, m_squelchGate, m_syncOrConstellation, m_tdmaStereo, m_title, m_traceDecay, m_traceLengthMutliplier, m_traceStroke, m_useReverseAPI, m_volume, SimpleDeserializer::readBlob(), SimpleDeserializer::readBool(), SimpleDeserializer::readS32(), SimpleDeserializer::readString(), SimpleDeserializer::readU32(), and resetToDefaults().

Referenced by DSDDemodGUI::deserialize(), DSDDemod::deserialize(), and setScopeGUI().

108 {
109  SimpleDeserializer d(data);
110 
111  if (!d.isValid())
112  {
113  resetToDefaults();
114  return false;
115  }
116 
117  if (d.getVersion() == 1)
118  {
119  QByteArray bytetmp;
120  QString strtmp;
121  qint32 tmp;
122  uint32_t utmp;
123 
124  if (m_channelMarker) {
125  d.readBlob(17, &bytetmp);
126  m_channelMarker->deserialize(bytetmp);
127  }
128 
129  d.readS32(1, &tmp, 0);
131  d.readS32(2, &tmp, 125);
132  m_rfBandwidth = tmp * 100.0;
133  d.readS32(3, &tmp, 125);
134  m_demodGain = tmp / 100.0;
135  d.readS32(4, &tmp, 50);
136  m_fmDeviation = tmp * 100.0;
137  d.readS32(5, &tmp, -40);
138  m_squelch = tmp < -100 ? tmp / 10.0 : tmp;
139  d.readBool(6, &m_pllLock, true);
140  d.readU32(7, &m_rgbColor);
141  d.readS32(8, &m_squelchGate, 5);
142  d.readS32(9, &tmp, 20);
143  m_volume = tmp / 10.0;
144 
145  if (m_scopeGUI) {
146  d.readBlob(10, &bytetmp);
147  m_scopeGUI->deserialize(bytetmp);
148  }
149 
150  d.readS32(11, &m_baudRate, 4800);
151  d.readBool(12, &m_enableCosineFiltering, false);
152  d.readBool(13, &m_syncOrConstellation, false);
153  d.readBool(14, &m_slot1On, false);
154  d.readBool(15, &m_slot2On, false);
155  d.readBool(16, &m_tdmaStereo, false);
156  d.readString(18, &m_title, "DSD Demodulator");
157  d.readBool(19, &m_highPassFilter, false);
159  d.readS32(21, &tmp, 6);
160  m_traceLengthMutliplier = tmp < 2 ? 2 : tmp > 30 ? 30 : tmp;
161  d.readS32(22, &tmp, 100);
162  m_traceStroke = tmp < 0 ? 0 : tmp > 255 ? 255 : tmp;
163  d.readS32(23, &tmp, 200);
164  m_traceDecay = tmp < 0 ? 0 : tmp > 255 ? 255 : tmp;
165  d.readBool(24, &m_useReverseAPI, false);
166  d.readString(25, &m_reverseAPIAddress, "127.0.0.1");
167  d.readU32(26, &utmp, 0);
168 
169  if ((utmp > 1023) && (utmp < 65535)) {
170  m_reverseAPIPort = utmp;
171  } else {
172  m_reverseAPIPort = 8888;
173  }
174 
175  d.readU32(27, &utmp, 0);
176  m_reverseAPIDeviceIndex = utmp > 99 ? 99 : utmp;
177  d.readU32(28, &utmp, 0);
178  m_reverseAPIChannelIndex = utmp > 99 ? 99 : utmp;
179  d.readBool(29, &m_audioMute, false);
180 
181  return true;
182  }
183  else
184  {
185  resetToDefaults();
186  return false;
187  }
188 }
static const QString m_defaultDeviceName
Serializable * m_channelMarker
qint64 m_inputFrequencyOffset
unsigned int uint32_t
Definition: rtptypes_win.h:46
uint16_t m_reverseAPIDeviceIndex
uint16_t m_reverseAPIPort
virtual bool deserialize(const QByteArray &data)=0
uint16_t m_reverseAPIChannelIndex
QString m_reverseAPIAddress
Serializable * m_scopeGUI
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetToDefaults()

void DSDDemodSettings::resetToDefaults ( )

Definition at line 32 of file dsddemodsettings.cpp.

References m_audioDeviceName, m_audioMute, m_baudRate, AudioDeviceManager::m_defaultDeviceName, m_demodGain, m_enableCosineFiltering, m_fmDeviation, m_highPassFilter, m_inputFrequencyOffset, m_pllLock, m_reverseAPIAddress, m_reverseAPIChannelIndex, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_rfBandwidth, m_rgbColor, m_slot1On, m_slot2On, m_squelch, m_squelchGate, m_syncOrConstellation, m_tdmaStereo, m_title, m_traceDecay, m_traceLengthMutliplier, m_traceStroke, m_useReverseAPI, and m_volume.

Referenced by deserialize(), DSDDemod::deserialize(), DSDDemodSettings(), and DSDDemodGUI::resetToDefaults().

33 {
35  m_rfBandwidth = 12500.0;
36  m_fmDeviation = 3500.0;
37  m_demodGain = 1.0;
38  m_volume = 2.0;
39  m_baudRate = 4800;
40  m_squelchGate = 5; // 10s of ms at 48000 Hz sample rate. Corresponds to 2400 for AGC attack
41  m_squelch = -40.0;
42  m_audioMute = false;
44  m_syncOrConstellation = false;
45  m_slot1On = true;
46  m_slot2On = false;
47  m_tdmaStereo = false;
48  m_pllLock = true;
49  m_rgbColor = QColor(0, 255, 255).rgb();
50  m_title = "DSD Demodulator";
51  m_highPassFilter = false;
52  m_traceLengthMutliplier = 6; // 300 ms
53  m_traceStroke = 100;
54  m_traceDecay = 200;
56  m_useReverseAPI = false;
57  m_reverseAPIAddress = "127.0.0.1";
58  m_reverseAPIPort = 8888;
61 }
static const QString m_defaultDeviceName
qint64 m_inputFrequencyOffset
uint16_t m_reverseAPIDeviceIndex
uint16_t m_reverseAPIPort
uint16_t m_reverseAPIChannelIndex
QString m_reverseAPIAddress
+ Here is the caller graph for this function:

◆ serialize()

QByteArray DSDDemodSettings::serialize ( ) const

Definition at line 63 of file dsddemodsettings.cpp.

References SimpleSerializer::final(), m_audioDeviceName, m_audioMute, m_baudRate, m_channelMarker, m_demodGain, m_enableCosineFiltering, m_fmDeviation, m_highPassFilter, m_inputFrequencyOffset, m_pllLock, m_reverseAPIAddress, m_reverseAPIChannelIndex, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_rfBandwidth, m_rgbColor, m_scopeGUI, m_slot1On, m_slot2On, m_squelch, m_squelchGate, m_syncOrConstellation, m_tdmaStereo, m_title, m_traceDecay, m_traceLengthMutliplier, m_traceStroke, m_useReverseAPI, m_volume, Serializable::serialize(), SimpleSerializer::writeBlob(), SimpleSerializer::writeBool(), SimpleSerializer::writeS32(), SimpleSerializer::writeString(), and SimpleSerializer::writeU32().

Referenced by DSDDemodGUI::serialize(), DSDDemod::serialize(), and setScopeGUI().

64 {
65  SimpleSerializer s(1);
66  s.writeS32(1, m_inputFrequencyOffset);
67  s.writeS32(2, m_rfBandwidth/100.0);
68  s.writeS32(3, m_demodGain*100.0);
69  s.writeS32(4, m_fmDeviation/100.0);
70  s.writeS32(5, m_squelch);
71  s.writeBool(6, m_pllLock);
72  s.writeU32(7, m_rgbColor);
73  s.writeS32(8, m_squelchGate);
74  s.writeS32(9, m_volume*10.0);
75 
76  if (m_scopeGUI) {
77  s.writeBlob(10, m_scopeGUI->serialize());
78  }
79 
80  s.writeS32(11, m_baudRate);
81  s.writeBool(12, m_enableCosineFiltering);
82  s.writeBool(13, m_syncOrConstellation);
83  s.writeBool(14, m_slot1On);
84  s.writeBool(15, m_slot2On);
85  s.writeBool(16, m_tdmaStereo);
86 
87  if (m_channelMarker) {
88  s.writeBlob(17, m_channelMarker->serialize());
89  }
90 
91  s.writeString(18, m_title);
92  s.writeBool(19, m_highPassFilter);
93  s.writeString(20, m_audioDeviceName);
94  s.writeS32(21, m_traceLengthMutliplier);
95  s.writeS32(22, m_traceStroke);
96  s.writeS32(23, m_traceDecay);
97  s.writeBool(24, m_useReverseAPI);
98  s.writeString(25, m_reverseAPIAddress);
99  s.writeU32(26, m_reverseAPIPort);
100  s.writeU32(27, m_reverseAPIDeviceIndex);
101  s.writeU32(28, m_reverseAPIChannelIndex);
102  s.writeBool(29, m_audioMute);
103 
104  return s.final();
105 }
Serializable * m_channelMarker
qint64 m_inputFrequencyOffset
uint16_t m_reverseAPIDeviceIndex
uint16_t m_reverseAPIPort
virtual QByteArray serialize() const =0
uint16_t m_reverseAPIChannelIndex
QString m_reverseAPIAddress
Serializable * m_scopeGUI
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setChannelMarker()

void DSDDemodSettings::setChannelMarker ( Serializable channelMarker)
inline

Definition at line 60 of file dsddemodsettings.h.

Referenced by DSDDemodGUI::DSDDemodGUI().

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

◆ setScopeGUI()

void DSDDemodSettings::setScopeGUI ( Serializable scopeGUI)
inline

Definition at line 61 of file dsddemodsettings.h.

References deserialize(), and serialize().

61 { m_scopeGUI = scopeGUI; }
Serializable * m_scopeGUI
+ Here is the call graph for this function:

Member Data Documentation

◆ m_audioDeviceName

QString DSDDemodSettings::m_audioDeviceName

◆ m_audioMute

bool DSDDemodSettings::m_audioMute

◆ m_baudRate

int DSDDemodSettings::m_baudRate

◆ m_channelMarker

Serializable* DSDDemodSettings::m_channelMarker

Definition at line 55 of file dsddemodsettings.h.

Referenced by deserialize(), and serialize().

◆ m_demodGain

Real DSDDemodSettings::m_demodGain

◆ m_enableCosineFiltering

bool DSDDemodSettings::m_enableCosineFiltering

◆ m_fmDeviation

Real DSDDemodSettings::m_fmDeviation

◆ m_highPassFilter

bool DSDDemodSettings::m_highPassFilter

◆ m_inputFrequencyOffset

qint64 DSDDemodSettings::m_inputFrequencyOffset

◆ m_pllLock

bool DSDDemodSettings::m_pllLock

◆ m_reverseAPIAddress

QString DSDDemodSettings::m_reverseAPIAddress

◆ m_reverseAPIChannelIndex

uint16_t DSDDemodSettings::m_reverseAPIChannelIndex

◆ m_reverseAPIDeviceIndex

uint16_t DSDDemodSettings::m_reverseAPIDeviceIndex

◆ m_reverseAPIPort

uint16_t DSDDemodSettings::m_reverseAPIPort

◆ m_rfBandwidth

Real DSDDemodSettings::m_rfBandwidth

◆ m_rgbColor

quint32 DSDDemodSettings::m_rgbColor

◆ m_scopeGUI

Serializable* DSDDemodSettings::m_scopeGUI

Definition at line 56 of file dsddemodsettings.h.

Referenced by deserialize(), and serialize().

◆ m_slot1On

bool DSDDemodSettings::m_slot1On

◆ m_slot2On

bool DSDDemodSettings::m_slot2On

◆ m_squelch

Real DSDDemodSettings::m_squelch

◆ m_squelchGate

int DSDDemodSettings::m_squelchGate

◆ m_syncOrConstellation

bool DSDDemodSettings::m_syncOrConstellation

◆ m_tdmaStereo

bool DSDDemodSettings::m_tdmaStereo

◆ m_title

QString DSDDemodSettings::m_title

◆ m_traceDecay

int DSDDemodSettings::m_traceDecay

◆ m_traceLengthMutliplier

int DSDDemodSettings::m_traceLengthMutliplier

◆ m_traceStroke

int DSDDemodSettings::m_traceStroke

◆ m_useReverseAPI

bool DSDDemodSettings::m_useReverseAPI

◆ m_volume

Real DSDDemodSettings::m_volume

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