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 | Private Member Functions | List of all members
SoapySDROutputSettings Struct Reference

#include <soapysdroutputsettings.h>

Public Member Functions

 SoapySDROutputSettings ()
 
void resetToDefaults ()
 
QByteArray serialize () const
 
bool deserialize (const QByteArray &data)
 

Public Attributes

quint64 m_centerFrequency
 
int m_LOppmTenths
 
qint32 m_devSampleRate
 
quint32 m_log2Interp
 
bool m_transverterMode
 
qint64 m_transverterDeltaFrequency
 
QString m_antenna
 
quint32 m_bandwidth
 
QMap< QString, double > m_tunableElements
 
qint32 m_globalGain
 
QMap< QString, double > m_individualGains
 
bool m_autoGain
 
bool m_autoDCCorrection
 
bool m_autoIQCorrection
 
std::complex< double > m_dcCorrection
 
std::complex< double > m_iqCorrection
 
QMap< QString, QVariant > m_streamArgSettings
 
QMap< QString, QVariant > m_deviceArgSettings
 
bool m_useReverseAPI
 
QString m_reverseAPIAddress
 
uint16_t m_reverseAPIPort
 
uint16_t m_reverseAPIDeviceIndex
 

Private Member Functions

QByteArray serializeNamedElementMap (const QMap< QString, double > &map) const
 
void deserializeNamedElementMap (const QByteArray &data, QMap< QString, double > &map)
 
QByteArray serializeArgumentMap (const QMap< QString, QVariant > &map) const
 
void deserializeArgumentMap (const QByteArray &data, QMap< QString, QVariant > &map)
 

Detailed Description

Definition at line 25 of file soapysdroutputsettings.h.

Constructor & Destructor Documentation

◆ SoapySDROutputSettings()

SoapySDROutputSettings::SoapySDROutputSettings ( )

Definition at line 25 of file soapysdroutputsettings.cpp.

References resetToDefaults().

26 {
28 }
+ Here is the call graph for this function:

Member Function Documentation

◆ deserialize()

bool SoapySDROutputSettings::deserialize ( const QByteArray &  data)

Definition at line 83 of file soapysdroutputsettings.cpp.

References deserializeArgumentMap(), deserializeNamedElementMap(), SimpleDeserializer::getVersion(), SimpleDeserializer::isValid(), m_antenna, m_autoDCCorrection, m_autoGain, m_autoIQCorrection, m_bandwidth, m_dcCorrection, m_deviceArgSettings, m_devSampleRate, m_globalGain, m_individualGains, m_iqCorrection, m_log2Interp, m_LOppmTenths, m_reverseAPIAddress, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_streamArgSettings, m_transverterDeltaFrequency, m_transverterMode, m_tunableElements, m_useReverseAPI, SimpleDeserializer::readBlob(), SimpleDeserializer::readBool(), SimpleDeserializer::readDouble(), SimpleDeserializer::readS32(), SimpleDeserializer::readS64(), SimpleDeserializer::readString(), SimpleDeserializer::readU32(), and resetToDefaults().

Referenced by SoapySDROutputGui::deserialize(), and SoapySDROutput::deserialize().

84 {
85  SimpleDeserializer d(data);
86 
87  if (!d.isValid())
88  {
90  return false;
91  }
92 
93  if (d.getVersion() == 1)
94  {
95  QByteArray blob;
96  double realval, imagval;
97  uint32_t uintval;
98 
99  d.readS32(1, &m_devSampleRate, 1024000);
100  d.readS32(2, &m_LOppmTenths, 0);
101  d.readU32(3, &m_log2Interp, 0);
102  d.readBool(4, &m_transverterMode, false);
103  d.readS64(5, &m_transverterDeltaFrequency, 0);
104  d.readString(6, &m_antenna, "NONE");
105  d.readU32(7, &m_bandwidth, 1000000);
106  d.readBlob(8, &blob);
108  d.readS32(12, &m_globalGain, 0);
109  d.readBlob(13, &blob);
111  d.readBool(14, &m_autoGain, false);
112  d.readBool(15, &m_autoDCCorrection, false);
113  d.readBool(16, &m_autoIQCorrection, false);
114  d.readDouble(17, &realval, 0);
115  d.readDouble(18, &imagval, 0);
116  m_dcCorrection = std::complex<double>{realval, imagval};
117  d.readDouble(19, &realval, 0);
118  d.readDouble(20, &imagval, 0);
119  m_iqCorrection = std::complex<double>{realval, imagval};
120  d.readBlob(21, &blob);
122  d.readBlob(22, &blob);
124  d.readBool(23, &m_useReverseAPI, false);
125  d.readString(24, &m_reverseAPIAddress, "127.0.0.1");
126  d.readU32(25, &uintval, 0);
127 
128  if ((uintval > 1023) && (uintval < 65535)) {
129  m_reverseAPIPort = uintval;
130  } else {
131  m_reverseAPIPort = 8888;
132  }
133 
134  d.readU32(26, &uintval, 0);
135  m_reverseAPIDeviceIndex = uintval > 99 ? 99 : uintval;
136 
137  return true;
138  }
139  else
140  {
141  resetToDefaults();
142  return false;
143  }
144 }
void deserializeArgumentMap(const QByteArray &data, QMap< QString, QVariant > &map)
QMap< QString, double > m_tunableElements
QMap< QString, QVariant > m_streamArgSettings
unsigned int uint32_t
Definition: rtptypes_win.h:46
QMap< QString, double > m_individualGains
void deserializeNamedElementMap(const QByteArray &data, QMap< QString, double > &map)
std::complex< double > m_iqCorrection
std::complex< double > m_dcCorrection
QMap< QString, QVariant > m_deviceArgSettings
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deserializeArgumentMap()

void SoapySDROutputSettings::deserializeArgumentMap ( const QByteArray &  data,
QMap< QString, QVariant > &  map 
)
private

Definition at line 173 of file soapysdroutputsettings.cpp.

Referenced by deserialize().

174 {
175  QDataStream *stream = new QDataStream(data);
176  (*stream) >> map;
177  delete stream;
178 }
+ Here is the caller graph for this function:

◆ deserializeNamedElementMap()

void SoapySDROutputSettings::deserializeNamedElementMap ( const QByteArray &  data,
QMap< QString, double > &  map 
)
private

Definition at line 156 of file soapysdroutputsettings.cpp.

Referenced by deserialize().

157 {
158  QDataStream *stream = new QDataStream(data);
159  (*stream) >> map;
160  delete stream;
161 }
+ Here is the caller graph for this function:

◆ resetToDefaults()

void SoapySDROutputSettings::resetToDefaults ( )

Definition at line 30 of file soapysdroutputsettings.cpp.

References m_antenna, m_autoDCCorrection, m_autoGain, m_autoIQCorrection, m_bandwidth, m_centerFrequency, m_dcCorrection, m_devSampleRate, m_globalGain, m_iqCorrection, m_log2Interp, m_LOppmTenths, m_reverseAPIAddress, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_transverterDeltaFrequency, m_transverterMode, and m_useReverseAPI.

Referenced by deserialize(), SoapySDROutput::deserialize(), SoapySDROutputGui::resetToDefaults(), and SoapySDROutputSettings().

31 {
32  m_centerFrequency = 435000*1000;
33  m_LOppmTenths = 0;
34  m_devSampleRate = 1024000;
35  m_log2Interp = 0;
36  m_transverterMode = false;
38  m_antenna = "NONE";
39  m_bandwidth = 1000000;
40  m_globalGain = 0;
41  m_autoGain = false;
42  m_autoDCCorrection = false;
43  m_autoIQCorrection = false;
44  m_dcCorrection = std::complex<double>{0,0};
45  m_iqCorrection = std::complex<double>{0,0};
46  m_useReverseAPI = false;
47  m_reverseAPIAddress = "127.0.0.1";
48  m_reverseAPIPort = 8888;
50 }
std::complex< double > m_iqCorrection
std::complex< double > m_dcCorrection
+ Here is the caller graph for this function:

◆ serialize()

QByteArray SoapySDROutputSettings::serialize ( ) const

Definition at line 52 of file soapysdroutputsettings.cpp.

References SimpleSerializer::final(), m_antenna, m_autoDCCorrection, m_autoGain, m_autoIQCorrection, m_bandwidth, m_dcCorrection, m_deviceArgSettings, m_devSampleRate, m_globalGain, m_individualGains, m_iqCorrection, m_log2Interp, m_LOppmTenths, m_reverseAPIAddress, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_streamArgSettings, m_transverterDeltaFrequency, m_transverterMode, m_tunableElements, m_useReverseAPI, serializeArgumentMap(), serializeNamedElementMap(), SimpleSerializer::writeBlob(), SimpleSerializer::writeBool(), SimpleSerializer::writeDouble(), SimpleSerializer::writeS32(), SimpleSerializer::writeS64(), SimpleSerializer::writeString(), and SimpleSerializer::writeU32().

Referenced by SoapySDROutputGui::serialize(), and SoapySDROutput::serialize().

53 {
54  SimpleSerializer s(1);
55 
56  s.writeS32(1, m_devSampleRate);
57  s.writeS32(2, m_LOppmTenths);
58  s.writeU32(3, m_log2Interp);
59  s.writeBool(4, m_transverterMode);
60  s.writeS64(5, m_transverterDeltaFrequency);
61  s.writeString(6, m_antenna);
62  s.writeU32(7, m_bandwidth);
64  s.writeS32(12, m_globalGain);
66  s.writeBool(14, m_autoGain);
67  s.writeBool(15, m_autoDCCorrection);
68  s.writeBool(16, m_autoIQCorrection);
69  s.writeDouble(17, m_dcCorrection.real());
70  s.writeDouble(18, m_dcCorrection.imag());
71  s.writeDouble(19, m_iqCorrection.real());
72  s.writeDouble(20, m_iqCorrection.imag());
73  s.writeBlob(21, serializeArgumentMap(m_streamArgSettings));
74  s.writeBlob(22, serializeArgumentMap(m_deviceArgSettings));
75  s.writeBool(23, m_useReverseAPI);
76  s.writeString(24, m_reverseAPIAddress);
77  s.writeU32(25, m_reverseAPIPort);
78  s.writeU32(26, m_reverseAPIDeviceIndex);
79 
80  return s.final();
81 }
QMap< QString, double > m_tunableElements
QByteArray serializeArgumentMap(const QMap< QString, QVariant > &map) const
QMap< QString, QVariant > m_streamArgSettings
QMap< QString, double > m_individualGains
QByteArray serializeNamedElementMap(const QMap< QString, double > &map) const
std::complex< double > m_iqCorrection
std::complex< double > m_dcCorrection
QMap< QString, QVariant > m_deviceArgSettings
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serializeArgumentMap()

QByteArray SoapySDROutputSettings::serializeArgumentMap ( const QMap< QString, QVariant > &  map) const
private

Definition at line 163 of file soapysdroutputsettings.cpp.

Referenced by serialize().

164 {
165  QByteArray data;
166  QDataStream *stream = new QDataStream(&data, QIODevice::WriteOnly);
167  (*stream) << map;
168  delete stream;
169 
170  return data;
171 }
+ Here is the caller graph for this function:

◆ serializeNamedElementMap()

QByteArray SoapySDROutputSettings::serializeNamedElementMap ( const QMap< QString, double > &  map) const
private

Definition at line 146 of file soapysdroutputsettings.cpp.

Referenced by serialize().

147 {
148  QByteArray data;
149  QDataStream *stream = new QDataStream(&data, QIODevice::WriteOnly);
150  (*stream) << map;
151  delete stream;
152 
153  return data;
154 }
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_antenna

QString SoapySDROutputSettings::m_antenna

◆ m_autoDCCorrection

bool SoapySDROutputSettings::m_autoDCCorrection

◆ m_autoGain

bool SoapySDROutputSettings::m_autoGain

◆ m_autoIQCorrection

bool SoapySDROutputSettings::m_autoIQCorrection

◆ m_bandwidth

quint32 SoapySDROutputSettings::m_bandwidth

◆ m_centerFrequency

quint64 SoapySDROutputSettings::m_centerFrequency

◆ m_dcCorrection

std::complex<double> SoapySDROutputSettings::m_dcCorrection

◆ m_deviceArgSettings

QMap<QString, QVariant> SoapySDROutputSettings::m_deviceArgSettings

◆ m_devSampleRate

qint32 SoapySDROutputSettings::m_devSampleRate

◆ m_globalGain

qint32 SoapySDROutputSettings::m_globalGain

◆ m_individualGains

QMap<QString, double> SoapySDROutputSettings::m_individualGains

◆ m_iqCorrection

std::complex<double> SoapySDROutputSettings::m_iqCorrection

◆ m_log2Interp

quint32 SoapySDROutputSettings::m_log2Interp

◆ m_LOppmTenths

int SoapySDROutputSettings::m_LOppmTenths

◆ m_reverseAPIAddress

QString SoapySDROutputSettings::m_reverseAPIAddress

◆ m_reverseAPIDeviceIndex

uint16_t SoapySDROutputSettings::m_reverseAPIDeviceIndex

◆ m_reverseAPIPort

uint16_t SoapySDROutputSettings::m_reverseAPIPort

◆ m_streamArgSettings

QMap<QString, QVariant> SoapySDROutputSettings::m_streamArgSettings

◆ m_transverterDeltaFrequency

qint64 SoapySDROutputSettings::m_transverterDeltaFrequency

◆ m_transverterMode

bool SoapySDROutputSettings::m_transverterMode

◆ m_tunableElements

QMap<QString, double> SoapySDROutputSettings::m_tunableElements

◆ m_useReverseAPI

bool SoapySDROutputSettings::m_useReverseAPI

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