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 | Static Public Attributes | List of all members
LoRaDemodSettings Struct Reference

#include <lorademodsettings.h>

+ Collaboration diagram for LoRaDemodSettings:

Public Member Functions

 LoRaDemodSettings ()
 
void resetToDefaults ()
 
void setChannelMarker (Serializable *channelMarker)
 
void setSpectrumGUI (Serializable *spectrumGUI)
 
QByteArray serialize () const
 
bool deserialize (const QByteArray &data)
 

Public Attributes

int m_centerFrequency
 
int m_bandwidthIndex
 
int m_spread
 
uint32_t m_rgbColor
 
QString m_title
 
Serializablem_channelMarker
 
Serializablem_spectrumGUI
 

Static Public Attributes

static const int bandwidths [] = {7813,15625,20833,31250,62500}
 
static const int nb_bandwidths = 5
 

Detailed Description

Definition at line 12 of file lorademodsettings.h.

Constructor & Destructor Documentation

◆ LoRaDemodSettings()

LoRaDemodSettings::LoRaDemodSettings ( )

Definition at line 13 of file lorademodsettings.cpp.

References resetToDefaults().

13  :
15  m_channelMarker(0),
16  m_spectrumGUI(0)
17 {
19 }
Serializable * m_channelMarker
Serializable * m_spectrumGUI
+ Here is the call graph for this function:

Member Function Documentation

◆ deserialize()

bool LoRaDemodSettings::deserialize ( const QByteArray &  data)

Definition at line 49 of file lorademodsettings.cpp.

References Serializable::deserialize(), SimpleDeserializer::getVersion(), SimpleDeserializer::isValid(), m_bandwidthIndex, m_centerFrequency, m_channelMarker, m_spectrumGUI, m_spread, m_title, SimpleDeserializer::readBlob(), SimpleDeserializer::readS32(), SimpleDeserializer::readString(), and resetToDefaults().

Referenced by LoRaDemodGUI::deserialize(), LoRaDemod::deserialize(), and setSpectrumGUI().

50 {
51  SimpleDeserializer d(data);
52 
53  if(!d.isValid())
54  {
56  return false;
57  }
58 
59  if(d.getVersion() == 1)
60  {
61  QByteArray bytetmp;
62 
63  d.readS32(1, &m_centerFrequency, 0);
64  d.readS32(2, &m_bandwidthIndex, 0);
65  d.readS32(3, &m_spread, 0);
66 
67  if (m_spectrumGUI) {
68  d.readBlob(4, &bytetmp);
69  m_spectrumGUI->deserialize(bytetmp);
70  }
71 
72  if (m_channelMarker) {
73  d.readBlob(5, &bytetmp);
74  m_channelMarker->deserialize(bytetmp);
75  }
76 
77  d.readString(6, &m_title, "LoRa Demodulator");
78 
79  return true;
80  }
81  else
82  {
84  return false;
85  }
86 }
Serializable * m_channelMarker
Serializable * m_spectrumGUI
virtual bool deserialize(const QByteArray &data)=0
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetToDefaults()

void LoRaDemodSettings::resetToDefaults ( )

Definition at line 21 of file lorademodsettings.cpp.

References m_bandwidthIndex, m_rgbColor, m_spread, and m_title.

Referenced by deserialize(), LoRaDemod::deserialize(), LoRaDemodSettings(), and LoRaDemodGUI::resetToDefaults().

22 {
23  m_bandwidthIndex = 0;
24  m_spread = 0;
25  m_rgbColor = QColor(255, 0, 255).rgb();
26  m_title = "LoRa Demodulator";
27 }
+ Here is the caller graph for this function:

◆ serialize()

QByteArray LoRaDemodSettings::serialize ( ) const

Definition at line 29 of file lorademodsettings.cpp.

References SimpleSerializer::final(), m_bandwidthIndex, m_centerFrequency, m_channelMarker, m_spectrumGUI, m_spread, m_title, Serializable::serialize(), SimpleSerializer::writeBlob(), SimpleSerializer::writeS32(), and SimpleSerializer::writeString().

Referenced by LoRaDemodGUI::serialize(), LoRaDemod::serialize(), and setSpectrumGUI().

30 {
31  SimpleSerializer s(1);
32  s.writeS32(1, m_centerFrequency);
33  s.writeS32(2, m_bandwidthIndex);
34  s.writeS32(3, m_spread);
35 
36  if (m_spectrumGUI) {
37  s.writeBlob(4, m_spectrumGUI->serialize());
38  }
39 
40  if (m_channelMarker) {
41  s.writeBlob(5, m_channelMarker->serialize());
42  }
43 
44  s.writeString(6, m_title);
45 
46  return s.final();
47 }
Serializable * m_channelMarker
Serializable * m_spectrumGUI
virtual QByteArray serialize() const =0
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setChannelMarker()

void LoRaDemodSettings::setChannelMarker ( Serializable channelMarker)
inline

Definition at line 28 of file lorademodsettings.h.

Referenced by LoRaDemodGUI::LoRaDemodGUI().

28 { m_channelMarker = channelMarker; }
Serializable * m_channelMarker
+ Here is the caller graph for this function:

◆ setSpectrumGUI()

void LoRaDemodSettings::setSpectrumGUI ( Serializable spectrumGUI)
inline

Definition at line 29 of file lorademodsettings.h.

References deserialize(), and serialize().

Referenced by LoRaDemodGUI::LoRaDemodGUI().

29 { m_spectrumGUI = spectrumGUI; }
Serializable * m_spectrumGUI
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ bandwidths

const int LoRaDemodSettings::bandwidths = {7813,15625,20833,31250,62500}
static

◆ m_bandwidthIndex

int LoRaDemodSettings::m_bandwidthIndex

◆ m_centerFrequency

int LoRaDemodSettings::m_centerFrequency

Definition at line 14 of file lorademodsettings.h.

Referenced by deserialize(), and serialize().

◆ m_channelMarker

Serializable* LoRaDemodSettings::m_channelMarker

Definition at line 20 of file lorademodsettings.h.

Referenced by deserialize(), and serialize().

◆ m_rgbColor

uint32_t LoRaDemodSettings::m_rgbColor

Definition at line 17 of file lorademodsettings.h.

Referenced by LoRaDemodGUI::displaySettings(), and resetToDefaults().

◆ m_spectrumGUI

Serializable* LoRaDemodSettings::m_spectrumGUI

Definition at line 21 of file lorademodsettings.h.

Referenced by deserialize(), and serialize().

◆ m_spread

int LoRaDemodSettings::m_spread

Definition at line 16 of file lorademodsettings.h.

Referenced by deserialize(), resetToDefaults(), and serialize().

◆ m_title

QString LoRaDemodSettings::m_title

Definition at line 18 of file lorademodsettings.h.

Referenced by deserialize(), LoRaDemod::getTitle(), resetToDefaults(), and serialize().

◆ nb_bandwidths

const int LoRaDemodSettings::nb_bandwidths = 5
static

Definition at line 24 of file lorademodsettings.h.

Referenced by LoRaDemodGUI::on_BW_valueChanged().


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