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

#include <soapysdrinputsettings.h>

Public Types

enum  fcPos_t { FC_POS_INFRA = 0, FC_POS_SUPRA, FC_POS_CENTER }
 

Public Member Functions

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

Public Attributes

quint64 m_centerFrequency
 
qint32 m_LOppmTenths
 
qint32 m_devSampleRate
 
quint32 m_log2Decim
 
fcPos_t m_fcPos
 
bool m_softDCCorrection
 
bool m_softIQCorrection
 
bool m_transverterMode
 
qint64 m_transverterDeltaFrequency
 
QString m_fileRecordName
 
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 26 of file soapysdrinputsettings.h.

Member Enumeration Documentation

◆ fcPos_t

Constructor & Destructor Documentation

◆ SoapySDRInputSettings()

SoapySDRInputSettings::SoapySDRInputSettings ( )

Definition at line 24 of file soapysdrinputsettings.cpp.

References resetToDefaults().

25 {
27 }
+ Here is the call graph for this function:

Member Function Documentation

◆ deserialize()

bool SoapySDRInputSettings::deserialize ( const QByteArray &  data)

Definition at line 89 of file soapysdrinputsettings.cpp.

References deserializeArgumentMap(), deserializeNamedElementMap(), FC_POS_CENTER, SimpleDeserializer::getVersion(), SimpleDeserializer::isValid(), m_antenna, m_autoDCCorrection, m_autoGain, m_autoIQCorrection, m_bandwidth, m_dcCorrection, m_deviceArgSettings, m_devSampleRate, m_fcPos, m_globalGain, m_individualGains, m_iqCorrection, m_log2Decim, m_LOppmTenths, m_reverseAPIAddress, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_softDCCorrection, m_softIQCorrection, 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 SoapySDRInputGui::deserialize().

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

◆ deserializeArgumentMap()

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

Definition at line 184 of file soapysdrinputsettings.cpp.

Referenced by deserialize().

185 {
186  QDataStream *stream = new QDataStream(data);
187  (*stream) >> map;
188  delete stream;
189 }
+ Here is the caller graph for this function:

◆ deserializeNamedElementMap()

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

Definition at line 167 of file soapysdrinputsettings.cpp.

Referenced by deserialize().

168 {
169  QDataStream *stream = new QDataStream(data);
170  (*stream) >> map;
171  delete stream;
172 }
+ Here is the caller graph for this function:

◆ resetToDefaults()

void SoapySDRInputSettings::resetToDefaults ( )

Definition at line 29 of file soapysdrinputsettings.cpp.

References FC_POS_CENTER, m_antenna, m_autoDCCorrection, m_autoGain, m_autoIQCorrection, m_bandwidth, m_centerFrequency, m_dcCorrection, m_devSampleRate, m_fcPos, m_fileRecordName, m_globalGain, m_iqCorrection, m_log2Decim, m_LOppmTenths, m_reverseAPIAddress, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_softDCCorrection, m_softIQCorrection, m_transverterDeltaFrequency, m_transverterMode, and m_useReverseAPI.

Referenced by deserialize(), SoapySDRInputGui::resetToDefaults(), and SoapySDRInputSettings().

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

◆ serialize()

QByteArray SoapySDRInputSettings::serialize ( ) const

Definition at line 55 of file soapysdrinputsettings.cpp.

References SimpleSerializer::final(), m_antenna, m_autoDCCorrection, m_autoGain, m_autoIQCorrection, m_bandwidth, m_dcCorrection, m_deviceArgSettings, m_devSampleRate, m_fcPos, m_globalGain, m_individualGains, m_iqCorrection, m_log2Decim, m_LOppmTenths, m_reverseAPIAddress, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_softDCCorrection, m_softIQCorrection, 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 SoapySDRInputGui::serialize().

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

◆ serializeArgumentMap()

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

Definition at line 174 of file soapysdrinputsettings.cpp.

Referenced by serialize().

175 {
176  QByteArray data;
177  QDataStream *stream = new QDataStream(&data, QIODevice::WriteOnly);
178  (*stream) << map;
179  delete stream;
180 
181  return data;
182 }
+ Here is the caller graph for this function:

◆ serializeNamedElementMap()

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

Definition at line 157 of file soapysdrinputsettings.cpp.

Referenced by serialize().

158 {
159  QByteArray data;
160  QDataStream *stream = new QDataStream(&data, QIODevice::WriteOnly);
161  (*stream) << map;
162  delete stream;
163 
164  return data;
165 }
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_antenna

QString SoapySDRInputSettings::m_antenna

◆ m_autoDCCorrection

bool SoapySDRInputSettings::m_autoDCCorrection

◆ m_autoGain

bool SoapySDRInputSettings::m_autoGain

◆ m_autoIQCorrection

bool SoapySDRInputSettings::m_autoIQCorrection

◆ m_bandwidth

quint32 SoapySDRInputSettings::m_bandwidth

◆ m_centerFrequency

quint64 SoapySDRInputSettings::m_centerFrequency

◆ m_dcCorrection

std::complex<double> SoapySDRInputSettings::m_dcCorrection

◆ m_deviceArgSettings

QMap<QString, QVariant> SoapySDRInputSettings::m_deviceArgSettings

◆ m_devSampleRate

qint32 SoapySDRInputSettings::m_devSampleRate

◆ m_fcPos

fcPos_t SoapySDRInputSettings::m_fcPos

◆ m_fileRecordName

QString SoapySDRInputSettings::m_fileRecordName

◆ m_globalGain

qint32 SoapySDRInputSettings::m_globalGain

◆ m_individualGains

QMap<QString, double> SoapySDRInputSettings::m_individualGains

◆ m_iqCorrection

std::complex<double> SoapySDRInputSettings::m_iqCorrection

◆ m_log2Decim

quint32 SoapySDRInputSettings::m_log2Decim

◆ m_LOppmTenths

qint32 SoapySDRInputSettings::m_LOppmTenths

◆ m_reverseAPIAddress

QString SoapySDRInputSettings::m_reverseAPIAddress

◆ m_reverseAPIDeviceIndex

uint16_t SoapySDRInputSettings::m_reverseAPIDeviceIndex

◆ m_reverseAPIPort

uint16_t SoapySDRInputSettings::m_reverseAPIPort

◆ m_softDCCorrection

bool SoapySDRInputSettings::m_softDCCorrection

◆ m_softIQCorrection

bool SoapySDRInputSettings::m_softIQCorrection

◆ m_streamArgSettings

QMap<QString, QVariant> SoapySDRInputSettings::m_streamArgSettings

◆ m_transverterDeltaFrequency

qint64 SoapySDRInputSettings::m_transverterDeltaFrequency

◆ m_transverterMode

bool SoapySDRInputSettings::m_transverterMode

◆ m_tunableElements

QMap<QString, double> SoapySDRInputSettings::m_tunableElements

◆ m_useReverseAPI

bool SoapySDRInputSettings::m_useReverseAPI

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