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

#include <perseussettings.h>

Public Types

enum  Attenuator {
  Attenuator_None, Attenuator_10dB, Attenuator_20dB, Attenuator_30dB,
  Attenuator_last
}
 

Public Member Functions

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

Public Attributes

quint64 m_centerFrequency
 
qint32 m_LOppmTenths
 
quint32 m_devSampleRateIndex
 
quint32 m_log2Decim
 
bool m_transverterMode
 
qint64 m_transverterDeltaFrequency
 
bool m_adcDither
 
bool m_adcPreamp
 
bool m_wideBand
 
Attenuator m_attenuator
 
QString m_fileRecordName
 
bool m_useReverseAPI
 
QString m_reverseAPIAddress
 
uint16_t m_reverseAPIPort
 
uint16_t m_reverseAPIDeviceIndex
 

Detailed Description

Definition at line 24 of file perseussettings.h.

Member Enumeration Documentation

◆ Attenuator

Constructor & Destructor Documentation

◆ PerseusSettings()

PerseusSettings::PerseusSettings ( )

Definition at line 22 of file perseussettings.cpp.

References resetToDefaults().

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

Member Function Documentation

◆ deserialize()

bool PerseusSettings::deserialize ( const QByteArray &  data)

Definition at line 67 of file perseussettings.cpp.

References Attenuator_last, Attenuator_None, SimpleDeserializer::getVersion(), SimpleDeserializer::isValid(), m_adcDither, m_adcPreamp, m_attenuator, m_devSampleRateIndex, m_log2Decim, m_LOppmTenths, m_reverseAPIAddress, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_transverterDeltaFrequency, m_transverterMode, m_useReverseAPI, m_wideBand, SimpleDeserializer::readBool(), SimpleDeserializer::readS32(), SimpleDeserializer::readS64(), SimpleDeserializer::readString(), SimpleDeserializer::readU32(), and resetToDefaults().

Referenced by PerseusGui::deserialize(), and PerseusInput::deserialize().

68 {
69  SimpleDeserializer d(data);
70 
71  if (!d.isValid())
72  {
74  return false;
75  }
76 
77  if (d.getVersion() == 1)
78  {
79  int intval;
80  uint32_t uintval;
81 
82  d.readU32(1, &m_devSampleRateIndex, 0);
83  d.readS32(2, &m_LOppmTenths, 0);
84  d.readU32(3, &m_log2Decim, 0);
85  d.readBool(4, &m_transverterMode, false);
86  d.readS64(5, &m_transverterDeltaFrequency, 0);
87  d.readBool(6, &m_adcDither, false);
88  d.readBool(7, &m_adcPreamp, false);
89  d.readBool(8, &m_wideBand, false);
90  d.readS32(9, &intval, 0);
91 
92  if ((intval >= 0) && (intval < (int) Attenuator_last)) {
93  m_attenuator = (Attenuator) intval;
94  } else {
96  }
97 
98  d.readBool(10, &m_useReverseAPI, false);
99  d.readString(11, &m_reverseAPIAddress, "127.0.0.1");
100  d.readU32(12, &uintval, 0);
101 
102  if ((uintval > 1023) && (uintval < 65535)) {
103  m_reverseAPIPort = uintval;
104  } else {
105  m_reverseAPIPort = 8888;
106  }
107 
108  d.readU32(13, &uintval, 0);
109  m_reverseAPIDeviceIndex = uintval > 99 ? 99 : uintval;
110 
111  return true;
112  }
113  else
114  {
115  resetToDefaults();
116  return false;
117  }
118 }
qint64 m_transverterDeltaFrequency
Attenuator m_attenuator
quint32 m_devSampleRateIndex
uint16_t m_reverseAPIDeviceIndex
unsigned int uint32_t
Definition: rtptypes_win.h:46
QString m_reverseAPIAddress
uint16_t m_reverseAPIPort
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetToDefaults()

void PerseusSettings::resetToDefaults ( )

Definition at line 27 of file perseussettings.cpp.

References Attenuator_None, m_adcDither, m_adcPreamp, m_attenuator, m_centerFrequency, m_devSampleRateIndex, m_fileRecordName, m_log2Decim, m_LOppmTenths, m_reverseAPIAddress, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_transverterDeltaFrequency, m_transverterMode, m_useReverseAPI, and m_wideBand.

Referenced by deserialize(), PerseusInput::deserialize(), PerseusSettings(), and PerseusGui::resetToDefaults().

28 {
29  m_centerFrequency = 7150*1000;
30  m_LOppmTenths = 0;
32  m_log2Decim = 0;
33  m_transverterMode = false;
35  m_adcDither = false;
36  m_adcPreamp = false;
37  m_wideBand = false;
39  m_fileRecordName = "";
40  m_useReverseAPI = false;
41  m_reverseAPIAddress = "127.0.0.1";
42  m_reverseAPIPort = 8888;
44 }
qint64 m_transverterDeltaFrequency
Attenuator m_attenuator
quint32 m_devSampleRateIndex
QString m_fileRecordName
uint16_t m_reverseAPIDeviceIndex
quint64 m_centerFrequency
QString m_reverseAPIAddress
uint16_t m_reverseAPIPort
+ Here is the caller graph for this function:

◆ serialize()

QByteArray PerseusSettings::serialize ( ) const

Definition at line 46 of file perseussettings.cpp.

References SimpleSerializer::final(), m_adcDither, m_adcPreamp, m_attenuator, m_devSampleRateIndex, m_log2Decim, m_LOppmTenths, m_reverseAPIAddress, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_transverterDeltaFrequency, m_transverterMode, m_useReverseAPI, m_wideBand, SimpleSerializer::writeBool(), SimpleSerializer::writeS32(), SimpleSerializer::writeS64(), SimpleSerializer::writeString(), and SimpleSerializer::writeU32().

Referenced by PerseusGui::serialize(), and PerseusInput::serialize().

47 {
48  SimpleSerializer s(1);
49 
50  s.writeU32(1, m_devSampleRateIndex);
51  s.writeS32(2, m_LOppmTenths);
52  s.writeU32(3, m_log2Decim);
53  s.writeBool(4, m_transverterMode);
54  s.writeS64(5, m_transverterDeltaFrequency);
55  s.writeBool(6, m_adcDither);
56  s.writeBool(7, m_adcPreamp);
57  s.writeBool(8, m_wideBand);
58  s.writeS32(9, (int) m_attenuator);
59  s.writeBool(10, m_useReverseAPI);
60  s.writeString(11, m_reverseAPIAddress);
61  s.writeU32(12, m_reverseAPIPort);
62  s.writeU32(13, m_reverseAPIDeviceIndex);
63 
64  return s.final();
65 }
qint64 m_transverterDeltaFrequency
Attenuator m_attenuator
quint32 m_devSampleRateIndex
uint16_t m_reverseAPIDeviceIndex
QString m_reverseAPIAddress
uint16_t m_reverseAPIPort
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_adcDither

bool PerseusSettings::m_adcDither

◆ m_adcPreamp

bool PerseusSettings::m_adcPreamp

◆ m_attenuator

Attenuator PerseusSettings::m_attenuator

◆ m_centerFrequency

quint64 PerseusSettings::m_centerFrequency

◆ m_devSampleRateIndex

quint32 PerseusSettings::m_devSampleRateIndex

◆ m_fileRecordName

QString PerseusSettings::m_fileRecordName

◆ m_log2Decim

quint32 PerseusSettings::m_log2Decim

◆ m_LOppmTenths

qint32 PerseusSettings::m_LOppmTenths

◆ m_reverseAPIAddress

QString PerseusSettings::m_reverseAPIAddress

◆ m_reverseAPIDeviceIndex

uint16_t PerseusSettings::m_reverseAPIDeviceIndex

◆ m_reverseAPIPort

uint16_t PerseusSettings::m_reverseAPIPort

◆ m_transverterDeltaFrequency

qint64 PerseusSettings::m_transverterDeltaFrequency

◆ m_transverterMode

bool PerseusSettings::m_transverterMode

◆ m_useReverseAPI

bool PerseusSettings::m_useReverseAPI

◆ m_wideBand

bool PerseusSettings::m_wideBand

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