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

#include <ssbdemodsettings.h>

+ Collaboration diagram for SSBDemodSettings:

Public Member Functions

 SSBDemodSettings ()
 
void resetToDefaults ()
 
void setChannelMarker (Serializable *channelMarker)
 
void setSpectrumGUI (Serializable *spectrumGUI)
 
QByteArray serialize () const
 
bool deserialize (const QByteArray &data)
 

Public Attributes

qint32 m_inputFrequencyOffset
 
Real m_rfBandwidth
 
Real m_lowCutoff
 
Real m_volume
 
int m_spanLog2
 
bool m_audioBinaural
 
bool m_audioFlipChannels
 
bool m_dsb
 
bool m_audioMute
 
bool m_agc
 
bool m_agcClamping
 
int m_agcTimeLog2
 
int m_agcPowerThreshold
 
int m_agcThresholdGate
 
quint32 m_rgbColor
 
QString m_title
 
QString m_audioDeviceName
 
bool m_useReverseAPI
 
QString m_reverseAPIAddress
 
uint16_t m_reverseAPIPort
 
uint16_t m_reverseAPIDeviceIndex
 
uint16_t m_reverseAPIChannelIndex
 
Serializablem_channelMarker
 
Serializablem_spectrumGUI
 

Static Public Attributes

static const int m_minPowerThresholdDB = -100
 
static const float m_mminPowerThresholdDBf = 100.0f
 

Detailed Description

Definition at line 25 of file ssbdemodsettings.h.

Constructor & Destructor Documentation

◆ SSBDemodSettings()

SSBDemodSettings::SSBDemodSettings ( )

Definition at line 33 of file ssbdemodsettings.cpp.

References resetToDefaults().

33  :
34  m_channelMarker(0),
35  m_spectrumGUI(0)
36 {
38 }
Serializable * m_spectrumGUI
Serializable * m_channelMarker
+ Here is the call graph for this function:

Member Function Documentation

◆ deserialize()

bool SSBDemodSettings::deserialize ( const QByteArray &  data)

Definition at line 99 of file ssbdemodsettings.cpp.

References Serializable::deserialize(), SimpleDeserializer::getVersion(), SimpleDeserializer::isValid(), m_agc, m_agcClamping, m_agcPowerThreshold, m_agcThresholdGate, m_agcTimeLog2, m_audioBinaural, m_audioDeviceName, m_audioFlipChannels, AudioDeviceManager::m_defaultDeviceName, m_dsb, m_inputFrequencyOffset, m_lowCutoff, m_reverseAPIAddress, m_reverseAPIChannelIndex, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_rfBandwidth, m_rgbColor, m_spanLog2, m_spectrumGUI, m_title, m_useReverseAPI, m_volume, SimpleDeserializer::readBlob(), SimpleDeserializer::readBool(), SimpleDeserializer::readS32(), SimpleDeserializer::readString(), SimpleDeserializer::readU32(), and resetToDefaults().

Referenced by SSBDemodGUI::deserialize(), SSBDemod::deserialize(), and setSpectrumGUI().

100 {
101  SimpleDeserializer d(data);
102 
103  if(!d.isValid())
104  {
105  resetToDefaults();
106  return false;
107  }
108 
109  if(d.getVersion() == 1)
110  {
111  QByteArray bytetmp;
112  qint32 tmp;
113  uint32_t utmp;
114  QString strtmp;
115 
116  d.readS32(1, &m_inputFrequencyOffset, 0);
117  d.readS32(2, &tmp, 30);
118  m_rfBandwidth = tmp * 100.0;
119  d.readS32(3, &tmp, 30);
120  m_volume = tmp / 10.0;
121 
122  if (m_spectrumGUI) {
123  d.readBlob(4, &bytetmp);
124  m_spectrumGUI->deserialize(bytetmp);
125  }
126 
127  d.readU32(5, &m_rgbColor);
128  d.readS32(6, &tmp, 30);
129  m_lowCutoff = tmp * 100.0;
130  d.readS32(7, &m_spanLog2, 3);
131  d.readBool(8, &m_audioBinaural, false);
132  d.readBool(9, &m_audioFlipChannels, false);
133  d.readBool(10, &m_dsb, false);
134  d.readBool(11, &m_agc, false);
135  d.readS32(12, &m_agcTimeLog2, 7);
136  d.readS32(13, &m_agcPowerThreshold, -40);
137  d.readS32(14, &m_agcThresholdGate, 4);
138  d.readBool(15, &m_agcClamping, false);
139  d.readString(16, &m_title, "SSB Demodulator");
141  d.readBool(18, &m_useReverseAPI, false);
142  d.readString(19, &m_reverseAPIAddress, "127.0.0.1");
143  d.readU32(20, &utmp, 0);
144 
145  if ((utmp > 1023) && (utmp < 65535)) {
146  m_reverseAPIPort = utmp;
147  } else {
148  m_reverseAPIPort = 8888;
149  }
150 
151  d.readU32(21, &utmp, 0);
152  m_reverseAPIDeviceIndex = utmp > 99 ? 99 : utmp;
153  d.readU32(22, &utmp, 0);
154  m_reverseAPIChannelIndex = utmp > 99 ? 99 : utmp;
155 
156  return true;
157  }
158  else
159  {
160  resetToDefaults();
161  return false;
162  }
163 }
static const QString m_defaultDeviceName
uint16_t m_reverseAPIPort
unsigned int uint32_t
Definition: rtptypes_win.h:46
Serializable * m_spectrumGUI
virtual bool deserialize(const QByteArray &data)=0
uint16_t m_reverseAPIDeviceIndex
uint16_t m_reverseAPIChannelIndex
qint32 m_inputFrequencyOffset
QString m_reverseAPIAddress
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetToDefaults()

void SSBDemodSettings::resetToDefaults ( )

Definition at line 40 of file ssbdemodsettings.cpp.

References m_agc, m_agcClamping, m_agcPowerThreshold, m_agcThresholdGate, m_agcTimeLog2, m_audioBinaural, m_audioDeviceName, m_audioFlipChannels, m_audioMute, AudioDeviceManager::m_defaultDeviceName, m_dsb, m_inputFrequencyOffset, m_lowCutoff, m_reverseAPIAddress, m_reverseAPIChannelIndex, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_rfBandwidth, m_rgbColor, m_spanLog2, m_title, m_useReverseAPI, and m_volume.

Referenced by SSBDemodGUI::deserialize(), deserialize(), SSBDemod::deserialize(), SSBDemodGUI::resetToDefaults(), and SSBDemodSettings().

41 {
42  m_audioBinaural = false;
43  m_audioFlipChannels = false;
44  m_dsb = false;
45  m_audioMute = false;
46  m_agc = false;
47  m_agcClamping = false;
48  m_agcPowerThreshold = -100;
50  m_agcTimeLog2 = 7;
51  m_rfBandwidth = 3000;
52  m_lowCutoff = 300;
53  m_volume = 1.0;
54  m_spanLog2 = 3;
56  m_rgbColor = QColor(0, 255, 0).rgb();
57  m_title = "SSB Demodulator";
59  m_useReverseAPI = false;
60  m_reverseAPIAddress = "127.0.0.1";
61  m_reverseAPIPort = 8888;
64 }
static const QString m_defaultDeviceName
uint16_t m_reverseAPIPort
uint16_t m_reverseAPIDeviceIndex
uint16_t m_reverseAPIChannelIndex
qint32 m_inputFrequencyOffset
QString m_reverseAPIAddress
+ Here is the caller graph for this function:

◆ serialize()

QByteArray SSBDemodSettings::serialize ( ) const

Definition at line 66 of file ssbdemodsettings.cpp.

References SimpleSerializer::final(), m_agc, m_agcClamping, m_agcPowerThreshold, m_agcThresholdGate, m_agcTimeLog2, m_audioBinaural, m_audioDeviceName, m_audioFlipChannels, m_dsb, m_inputFrequencyOffset, m_lowCutoff, m_reverseAPIAddress, m_reverseAPIChannelIndex, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_rfBandwidth, m_rgbColor, m_spanLog2, m_spectrumGUI, m_title, m_useReverseAPI, m_volume, Serializable::serialize(), SimpleSerializer::writeBlob(), SimpleSerializer::writeBool(), SimpleSerializer::writeS32(), SimpleSerializer::writeString(), and SimpleSerializer::writeU32().

Referenced by SSBDemodGUI::serialize(), SSBDemod::serialize(), and setSpectrumGUI().

67 {
68  SimpleSerializer s(1);
69  s.writeS32(1, m_inputFrequencyOffset);
70  s.writeS32(2, m_rfBandwidth / 100.0);
71  s.writeS32(3, m_volume * 10.0);
72 
73  if (m_spectrumGUI) {
74  s.writeBlob(4, m_spectrumGUI->serialize());
75  }
76 
77  s.writeU32(5, m_rgbColor);
78  s.writeS32(6, m_lowCutoff / 100.0);
79  s.writeS32(7, m_spanLog2);
80  s.writeBool(8, m_audioBinaural);
81  s.writeBool(9, m_audioFlipChannels);
82  s.writeBool(10, m_dsb);
83  s.writeBool(11, m_agc);
84  s.writeS32(12, m_agcTimeLog2);
85  s.writeS32(13, m_agcPowerThreshold);
86  s.writeS32(14, m_agcThresholdGate);
87  s.writeBool(15, m_agcClamping);
88  s.writeString(16, m_title);
89  s.writeString(17, m_audioDeviceName);
90  s.writeBool(18, m_useReverseAPI);
91  s.writeString(19, m_reverseAPIAddress);
92  s.writeU32(20, m_reverseAPIPort);
93  s.writeU32(21, m_reverseAPIDeviceIndex);
94  s.writeU32(22, m_reverseAPIChannelIndex);
95 
96  return s.final();
97 }
uint16_t m_reverseAPIPort
Serializable * m_spectrumGUI
uint16_t m_reverseAPIDeviceIndex
uint16_t m_reverseAPIChannelIndex
qint32 m_inputFrequencyOffset
virtual QByteArray serialize() const =0
QString m_reverseAPIAddress
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setChannelMarker()

void SSBDemodSettings::setChannelMarker ( Serializable channelMarker)
inline

Definition at line 55 of file ssbdemodsettings.h.

Referenced by SSBDemodGUI::SSBDemodGUI().

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

◆ setSpectrumGUI()

void SSBDemodSettings::setSpectrumGUI ( Serializable spectrumGUI)
inline

Definition at line 56 of file ssbdemodsettings.h.

References deserialize(), and serialize().

Referenced by SSBDemodGUI::SSBDemodGUI().

56 { m_spectrumGUI = spectrumGUI; }
Serializable * m_spectrumGUI
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_agc

bool SSBDemodSettings::m_agc

◆ m_agcClamping

bool SSBDemodSettings::m_agcClamping

◆ m_agcPowerThreshold

int SSBDemodSettings::m_agcPowerThreshold

◆ m_agcThresholdGate

int SSBDemodSettings::m_agcThresholdGate

◆ m_agcTimeLog2

int SSBDemodSettings::m_agcTimeLog2

◆ m_audioBinaural

bool SSBDemodSettings::m_audioBinaural

◆ m_audioDeviceName

QString SSBDemodSettings::m_audioDeviceName

◆ m_audioFlipChannels

bool SSBDemodSettings::m_audioFlipChannels

◆ m_audioMute

bool SSBDemodSettings::m_audioMute

◆ m_channelMarker

Serializable* SSBDemodSettings::m_channelMarker

Definition at line 50 of file ssbdemodsettings.h.

◆ m_dsb

bool SSBDemodSettings::m_dsb

◆ m_inputFrequencyOffset

qint32 SSBDemodSettings::m_inputFrequencyOffset

◆ m_lowCutoff

Real SSBDemodSettings::m_lowCutoff

◆ m_minPowerThresholdDB

const int SSBDemodSettings::m_minPowerThresholdDB = -100
static

◆ m_mminPowerThresholdDBf

const float SSBDemodSettings::m_mminPowerThresholdDBf = 100.0f
static

Definition at line 61 of file ssbdemodsettings.h.

Referenced by SSBDemodGUI::tick().

◆ m_reverseAPIAddress

QString SSBDemodSettings::m_reverseAPIAddress

◆ m_reverseAPIChannelIndex

uint16_t SSBDemodSettings::m_reverseAPIChannelIndex

◆ m_reverseAPIDeviceIndex

uint16_t SSBDemodSettings::m_reverseAPIDeviceIndex

◆ m_reverseAPIPort

uint16_t SSBDemodSettings::m_reverseAPIPort

◆ m_rfBandwidth

Real SSBDemodSettings::m_rfBandwidth

◆ m_rgbColor

quint32 SSBDemodSettings::m_rgbColor

◆ m_spanLog2

int SSBDemodSettings::m_spanLog2

◆ m_spectrumGUI

Serializable* SSBDemodSettings::m_spectrumGUI

Definition at line 51 of file ssbdemodsettings.h.

Referenced by deserialize(), and serialize().

◆ m_title

QString SSBDemodSettings::m_title

◆ m_useReverseAPI

bool SSBDemodSettings::m_useReverseAPI

◆ m_volume

Real SSBDemodSettings::m_volume

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