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 | List of all members
TestSourceSettings Struct Reference

#include <testsourcesettings.h>

Public Types

enum  fcPos_t { FC_POS_INFRA = 0, FC_POS_SUPRA, FC_POS_CENTER }
 
enum  AutoCorrOptions { AutoCorrNone, AutoCorrDC, AutoCorrDCAndIQ, AutoCorrLast }
 
enum  Modulation {
  ModulationNone, ModulationAM, ModulationFM, ModulationPattern0,
  ModulationPattern1, ModulationPattern2, ModulationLast
}
 

Public Member Functions

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

Public Attributes

quint64 m_centerFrequency
 
qint32 m_frequencyShift
 
quint32 m_sampleRate
 
quint32 m_log2Decim
 
fcPos_t m_fcPos
 
quint32 m_sampleSizeIndex
 
qint32 m_amplitudeBits
 
AutoCorrOptions m_autoCorrOptions
 
Modulation m_modulation
 
int m_modulationTone
 10'Hz More...
 
int m_amModulation
 percent More...
 
int m_fmDeviation
 100'Hz More...
 
float m_dcFactor
 -1.0 < x < 1.0 More...
 
float m_iFactor
 -1.0 < x < 1.0 More...
 
float m_qFactor
 -1.0 < x < 1.0 More...
 
float m_phaseImbalance
 -1.0 < x < 1.0 More...
 
QString m_fileRecordName
 
bool m_useReverseAPI
 
QString m_reverseAPIAddress
 
uint16_t m_reverseAPIPort
 
uint16_t m_reverseAPIDeviceIndex
 

Detailed Description

Definition at line 23 of file testsourcesettings.h.

Member Enumeration Documentation

◆ AutoCorrOptions

◆ fcPos_t

◆ Modulation

Constructor & Destructor Documentation

◆ TestSourceSettings()

TestSourceSettings::TestSourceSettings ( )

Definition at line 22 of file testsourcesettings.cpp.

References resetToDefaults().

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

Member Function Documentation

◆ deserialize()

bool TestSourceSettings::deserialize ( const QByteArray &  data)

Definition at line 78 of file testsourcesettings.cpp.

References AutoCorrLast, AutoCorrNone, SimpleDeserializer::getVersion(), SimpleDeserializer::isValid(), m_amModulation, m_amplitudeBits, m_autoCorrOptions, m_dcFactor, m_fcPos, m_fmDeviation, m_frequencyShift, m_iFactor, m_log2Decim, m_modulation, m_modulationTone, m_phaseImbalance, m_qFactor, m_reverseAPIAddress, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_sampleRate, m_sampleSizeIndex, m_useReverseAPI, ModulationLast, ModulationNone, SimpleDeserializer::readBool(), SimpleDeserializer::readFloat(), SimpleDeserializer::readS32(), SimpleDeserializer::readString(), SimpleDeserializer::readU32(), and resetToDefaults().

Referenced by TestSourceGui::deserialize(), and TestSourceInput::deserialize().

79 {
80  SimpleDeserializer d(data);
81 
82  if (!d.isValid())
83  {
85  return false;
86  }
87 
88  if (d.getVersion() == 1)
89  {
90  int intval;
91  uint32_t utmp;
92 
93  d.readS32(2, &m_frequencyShift, 0);
94  d.readU32(3, &m_sampleRate, 768*1000);
95  d.readU32(4, &m_log2Decim, 4);
96  d.readS32(5, &intval, 0);
97  m_fcPos = (fcPos_t) intval;
98  d.readU32(6, &m_sampleSizeIndex, 0);
99  d.readS32(7, &m_amplitudeBits, 128);
100  d.readS32(8, &intval, 0);
101 
102  if (intval < 0 || intval > (int) AutoCorrLast) {
104  } else {
106  }
107 
108  d.readFloat(10, &m_dcFactor, 0.0f);
109  d.readFloat(11, &m_iFactor, 0.0f);
110  d.readFloat(12, &m_qFactor, 0.0f);
111  d.readFloat(13, &m_phaseImbalance, 0.0f);
112  d.readS32(14, &intval, 0);
113 
114  if (intval < 0 || intval > (int) ModulationLast) {
116  } else {
117  m_modulation = (Modulation) intval;
118  }
119 
120  d.readS32(15, &m_modulationTone, 44);
121  d.readS32(16, &m_amModulation, 50);
122  d.readS32(17, &m_fmDeviation, 50);
123 
124  d.readBool(18, &m_useReverseAPI, false);
125  d.readString(19, &m_reverseAPIAddress, "127.0.0.1");
126  d.readU32(20, &utmp, 0);
127 
128  if ((utmp > 1023) && (utmp < 65535)) {
129  m_reverseAPIPort = utmp;
130  } else {
131  m_reverseAPIPort = 8888;
132  }
133 
134  d.readU32(21, &utmp, 0);
135  m_reverseAPIDeviceIndex = utmp > 99 ? 99 : utmp;
136 
137  return true;
138  }
139  else
140  {
141  resetToDefaults();
142  return false;
143  }
144 }
float m_qFactor
-1.0 < x < 1.0
float m_phaseImbalance
-1.0 < x < 1.0
AutoCorrOptions m_autoCorrOptions
unsigned int uint32_t
Definition: rtptypes_win.h:46
float m_iFactor
-1.0 < x < 1.0
uint16_t m_reverseAPIDeviceIndex
int m_modulationTone
10&#39;Hz
int m_fmDeviation
100&#39;Hz
int m_amModulation
percent
float m_dcFactor
-1.0 < x < 1.0
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetToDefaults()

void TestSourceSettings::resetToDefaults ( )

Definition at line 27 of file testsourcesettings.cpp.

References AutoCorrNone, FC_POS_CENTER, m_amModulation, m_amplitudeBits, m_autoCorrOptions, m_centerFrequency, m_dcFactor, m_fcPos, m_fileRecordName, m_fmDeviation, m_frequencyShift, m_iFactor, m_log2Decim, m_modulation, m_modulationTone, m_phaseImbalance, m_qFactor, m_reverseAPIAddress, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_sampleRate, m_sampleSizeIndex, m_useReverseAPI, and ModulationNone.

Referenced by deserialize(), TestSourceInput::deserialize(), TestSourceGui::resetToDefaults(), and TestSourceSettings().

28 {
29  m_centerFrequency = 435000*1000;
30  m_frequencyShift = 0;
31  m_sampleRate = 768*1000;
32  m_log2Decim = 4;
35  m_amplitudeBits = 127;
38  m_modulationTone = 44; // 440 Hz
39  m_amModulation = 50; // 50%
40  m_fmDeviation = 50; // 5 kHz
41  m_dcFactor = 0.0f;
42  m_iFactor = 0.0f;
43  m_qFactor = 0.0f;
44  m_phaseImbalance = 0.0f;
45  m_fileRecordName = "";
46  m_useReverseAPI = false;
47  m_reverseAPIAddress = "127.0.0.1";
48  m_reverseAPIPort = 8888;
50 }
float m_qFactor
-1.0 < x < 1.0
float m_phaseImbalance
-1.0 < x < 1.0
AutoCorrOptions m_autoCorrOptions
float m_iFactor
-1.0 < x < 1.0
uint16_t m_reverseAPIDeviceIndex
int m_modulationTone
10&#39;Hz
int m_fmDeviation
100&#39;Hz
int m_amModulation
percent
float m_dcFactor
-1.0 < x < 1.0
+ Here is the caller graph for this function:

◆ serialize()

QByteArray TestSourceSettings::serialize ( ) const

Definition at line 52 of file testsourcesettings.cpp.

References SimpleSerializer::final(), m_amModulation, m_amplitudeBits, m_autoCorrOptions, m_dcFactor, m_fcPos, m_fmDeviation, m_frequencyShift, m_iFactor, m_log2Decim, m_modulation, m_modulationTone, m_phaseImbalance, m_qFactor, m_reverseAPIAddress, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_sampleRate, m_sampleSizeIndex, m_useReverseAPI, SimpleSerializer::writeBool(), SimpleSerializer::writeFloat(), SimpleSerializer::writeS32(), SimpleSerializer::writeString(), and SimpleSerializer::writeU32().

Referenced by TestSourceGui::serialize(), and TestSourceInput::serialize().

53 {
54  SimpleSerializer s(1);
55 
56  s.writeS32(2, m_frequencyShift);
57  s.writeU32(3, m_sampleRate);
58  s.writeU32(4, m_log2Decim);
59  s.writeS32(5, (int) m_fcPos);
60  s.writeU32(6, m_sampleSizeIndex);
61  s.writeS32(7, m_amplitudeBits);
62  s.writeS32(8, (int) m_autoCorrOptions);
63  s.writeFloat(10, m_dcFactor);
64  s.writeFloat(11, m_iFactor);
65  s.writeFloat(12, m_qFactor);
66  s.writeFloat(13, m_phaseImbalance);
67  s.writeS32(14, (int) m_modulation);
68  s.writeS32(15, m_modulationTone);
69  s.writeS32(16, m_amModulation);
70  s.writeS32(17, m_fmDeviation);
71  s.writeBool(18, m_useReverseAPI);
72  s.writeString(19, m_reverseAPIAddress);
73  s.writeU32(20, m_reverseAPIPort);
74  s.writeU32(21, m_reverseAPIDeviceIndex);
75  return s.final();
76 }
float m_qFactor
-1.0 < x < 1.0
float m_phaseImbalance
-1.0 < x < 1.0
AutoCorrOptions m_autoCorrOptions
float m_iFactor
-1.0 < x < 1.0
uint16_t m_reverseAPIDeviceIndex
int m_modulationTone
10&#39;Hz
int m_fmDeviation
100&#39;Hz
int m_amModulation
percent
float m_dcFactor
-1.0 < x < 1.0
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_amModulation

int TestSourceSettings::m_amModulation

◆ m_amplitudeBits

qint32 TestSourceSettings::m_amplitudeBits

◆ m_autoCorrOptions

AutoCorrOptions TestSourceSettings::m_autoCorrOptions

◆ m_centerFrequency

quint64 TestSourceSettings::m_centerFrequency

◆ m_dcFactor

float TestSourceSettings::m_dcFactor

◆ m_fcPos

fcPos_t TestSourceSettings::m_fcPos

◆ m_fileRecordName

QString TestSourceSettings::m_fileRecordName

◆ m_fmDeviation

int TestSourceSettings::m_fmDeviation

◆ m_frequencyShift

qint32 TestSourceSettings::m_frequencyShift

◆ m_iFactor

float TestSourceSettings::m_iFactor

◆ m_log2Decim

quint32 TestSourceSettings::m_log2Decim

◆ m_modulation

Modulation TestSourceSettings::m_modulation

◆ m_modulationTone

int TestSourceSettings::m_modulationTone

◆ m_phaseImbalance

float TestSourceSettings::m_phaseImbalance

◆ m_qFactor

float TestSourceSettings::m_qFactor

◆ m_reverseAPIAddress

QString TestSourceSettings::m_reverseAPIAddress

◆ m_reverseAPIDeviceIndex

uint16_t TestSourceSettings::m_reverseAPIDeviceIndex

◆ m_reverseAPIPort

uint16_t TestSourceSettings::m_reverseAPIPort

◆ m_sampleRate

quint32 TestSourceSettings::m_sampleRate

◆ m_sampleSizeIndex

quint32 TestSourceSettings::m_sampleSizeIndex

◆ m_useReverseAPI

bool TestSourceSettings::m_useReverseAPI

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