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
TestMISettings Struct Reference

#include <testmisettings.h>

Public Member Functions

 TestMISettings ()
 
 TestMISettings (const TestMISettings &other)
 
void resetToDefaults ()
 
QByteArray serialize () const
 
bool deserialize (const QByteArray &data)
 

Public Attributes

QString m_fileRecordName
 
bool m_useReverseAPI
 
QString m_reverseAPIAddress
 
uint16_t m_reverseAPIPort
 
uint16_t m_reverseAPIDeviceIndex
 
std::vector< TestMIStreamSettingsm_streams
 

Detailed Description

Definition at line 68 of file testmisettings.h.

Constructor & Destructor Documentation

◆ TestMISettings() [1/2]

TestMISettings::TestMISettings ( )

Definition at line 47 of file testmisettings.cpp.

References TestMIStreamSettings::TestMIStreamSettings().

48 {
49  m_fileRecordName = "";
50  m_useReverseAPI = false;
51  m_reverseAPIAddress = "127.0.0.1";
52  m_reverseAPIPort = 8888;
54  m_streams.push_back(TestMIStreamSettings());
55  m_streams.push_back(TestMIStreamSettings());
56 }
QString m_reverseAPIAddress
uint16_t m_reverseAPIPort
uint16_t m_reverseAPIDeviceIndex
std::vector< TestMIStreamSettings > m_streams
QString m_fileRecordName
+ Here is the call graph for this function:

◆ TestMISettings() [2/2]

TestMISettings::TestMISettings ( const TestMISettings other)

Definition at line 58 of file testmisettings.cpp.

References m_fileRecordName, m_reverseAPIAddress, m_reverseAPIDeviceIndex, m_reverseAPIPort, and m_useReverseAPI.

58  :
59  m_streams(other.m_streams)
60 {
66 }
QString m_reverseAPIAddress
uint16_t m_reverseAPIPort
uint16_t m_reverseAPIDeviceIndex
std::vector< TestMIStreamSettings > m_streams
QString m_fileRecordName

Member Function Documentation

◆ deserialize()

bool TestMISettings::deserialize ( const QByteArray &  data)

Definition at line 106 of file testmisettings.cpp.

References TestMIStreamSettings::AutoCorrLast, TestMIStreamSettings::AutoCorrNone, SimpleDeserializer::getVersion(), i, SimpleDeserializer::isValid(), m_reverseAPIAddress, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_streams, m_useReverseAPI, TestMIStreamSettings::ModulationLast, TestMIStreamSettings::ModulationNone, SimpleDeserializer::readBool(), SimpleDeserializer::readFloat(), SimpleDeserializer::readS32(), SimpleDeserializer::readString(), SimpleDeserializer::readU32(), and resetToDefaults().

Referenced by TestMIGui::deserialize(), and TestMI::deserialize().

107 {
108  SimpleDeserializer d(data);
109 
110  if (!d.isValid())
111  {
112  resetToDefaults();
113  return false;
114  }
115 
116  if (d.getVersion() == 1)
117  {
118  int intval;
119  uint32_t utmp;
120 
121  d.readBool(1, &m_useReverseAPI, false);
122  d.readString(2, &m_reverseAPIAddress, "127.0.0.1");
123  d.readU32(3, &utmp, 0);
124 
125  if ((utmp > 1023) && (utmp < 65535)) {
126  m_reverseAPIPort = utmp;
127  } else {
128  m_reverseAPIPort = 8888;
129  }
130 
131  d.readU32(4, &utmp, 0);
132  m_reverseAPIDeviceIndex = utmp > 99 ? 99 : utmp;
133 
134  for (unsigned int i = 0; i < m_streams.size(); i++)
135  {
136  d.readS32(10 + 30*i, &m_streams[i].m_frequencyShift, 0);
137  d.readU32(11 + 30*i, &m_streams[i].m_sampleRate, 768*1000);
138  d.readU32(12 + 30*i, &m_streams[i].m_log2Decim, 4);
139  d.readS32(13 + 30*i, &intval, 0);
140  m_streams[i].m_fcPos = (TestMIStreamSettings::fcPos_t) intval;
141  d.readU32(14 + 30*i, &m_streams[i].m_sampleSizeIndex, 0);
142  d.readS32(15 + 30*i, &m_streams[i].m_amplitudeBits, 128);
143  d.readS32(16 + 30*i, &intval, 0);
144 
145  if (intval < 0 || intval > (int) TestMIStreamSettings::AutoCorrLast) {
146  m_streams[i].m_autoCorrOptions = TestMIStreamSettings::AutoCorrNone;
147  } else {
148  m_streams[i].m_autoCorrOptions = (TestMIStreamSettings::AutoCorrOptions) intval;
149  }
150 
151  d.readFloat(17 + 30*i, &m_streams[i].m_dcFactor, 0.0f);
152  d.readFloat(18 + 30*i, &m_streams[i].m_iFactor, 0.0f);
153  d.readFloat(19 + 30*i, &m_streams[i].m_qFactor, 0.0f);
154  d.readFloat(20 + 30*i, &m_streams[i].m_phaseImbalance, 0.0f);
155  d.readS32(21 + 30*i, &intval, 0);
156 
157  if (intval < 0 || intval > (int) TestMIStreamSettings::ModulationLast) {
159  } else {
160  m_streams[i].m_modulation = (TestMIStreamSettings::Modulation) intval;
161  }
162 
163  d.readS32(22 + 30*i, &m_streams[i].m_modulationTone, 44);
164  d.readS32(23 + 30*i, &m_streams[i].m_amModulation, 50);
165  d.readS32(24 + 30*i, &m_streams[i].m_fmDeviation, 50);
166  }
167 
168  return true;
169  }
170  else
171  {
172  resetToDefaults();
173  return false;
174  }
175 }
QString m_reverseAPIAddress
uint16_t m_reverseAPIPort
unsigned int uint32_t
Definition: rtptypes_win.h:46
int32_t i
Definition: decimators.h:244
uint16_t m_reverseAPIDeviceIndex
std::vector< TestMIStreamSettings > m_streams
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetToDefaults()

void TestMISettings::resetToDefaults ( )

Definition at line 68 of file testmisettings.cpp.

References i, and m_streams.

Referenced by deserialize(), TestMI::deserialize(), and TestMIGui::resetToDefaults().

69 {
70  for (unsigned int i = 0; i < m_streams.size(); i++) {
71  m_streams[i].resetToDefaults();
72  }
73 }
int32_t i
Definition: decimators.h:244
std::vector< TestMIStreamSettings > m_streams
+ Here is the caller graph for this function:

◆ serialize()

QByteArray TestMISettings::serialize ( ) const

Definition at line 75 of file testmisettings.cpp.

References SimpleSerializer::final(), i, m_reverseAPIAddress, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_streams, m_useReverseAPI, SimpleSerializer::writeBool(), SimpleSerializer::writeFloat(), SimpleSerializer::writeS32(), SimpleSerializer::writeString(), and SimpleSerializer::writeU32().

Referenced by TestMIGui::serialize(), and TestMI::serialize().

76 {
77  SimpleSerializer s(1);
78 
79  s.writeBool(1, m_useReverseAPI);
80  s.writeString(2, m_reverseAPIAddress);
81  s.writeU32(3, m_reverseAPIPort);
82  s.writeU32(4, m_reverseAPIDeviceIndex);
83 
84  for (unsigned int i = 0; i < m_streams.size(); i++)
85  {
86  s.writeS32(10 + 30*i, m_streams[i].m_frequencyShift);
87  s.writeU32(11 + 30*i, m_streams[i].m_sampleRate);
88  s.writeU32(12 + 30*i, m_streams[i].m_log2Decim);
89  s.writeS32(13 + 30*i, (int) m_streams[i].m_fcPos);
90  s.writeU32(14 + 30*i, m_streams[i].m_sampleSizeIndex);
91  s.writeS32(15 + 30*i, m_streams[i].m_amplitudeBits);
92  s.writeS32(16 + 30*i, (int) m_streams[i].m_autoCorrOptions);
93  s.writeFloat(17 + 30*i, m_streams[i].m_dcFactor);
94  s.writeFloat(18 + 30*i, m_streams[i].m_iFactor);
95  s.writeFloat(19 + 30*i, m_streams[i].m_qFactor);
96  s.writeFloat(20 + 30*i, m_streams[i].m_phaseImbalance);
97  s.writeS32(21 + 30*i, (int) m_streams[i].m_modulation);
98  s.writeS32(22 + 30*i, m_streams[i].m_modulationTone);
99  s.writeS32(23 + 30*i, m_streams[i].m_amModulation);
100  s.writeS32(24 + 30*i, m_streams[i].m_fmDeviation);
101  }
102 
103  return s.final();
104 }
QString m_reverseAPIAddress
uint16_t m_reverseAPIPort
int32_t i
Definition: decimators.h:244
uint16_t m_reverseAPIDeviceIndex
std::vector< TestMIStreamSettings > m_streams
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_fileRecordName

QString TestMISettings::m_fileRecordName

◆ m_reverseAPIAddress

QString TestMISettings::m_reverseAPIAddress

◆ m_reverseAPIDeviceIndex

uint16_t TestMISettings::m_reverseAPIDeviceIndex

◆ m_reverseAPIPort

uint16_t TestMISettings::m_reverseAPIPort

◆ m_streams

std::vector<TestMIStreamSettings> TestMISettings::m_streams

◆ m_useReverseAPI

bool TestMISettings::m_useReverseAPI

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