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 | Private Attributes | List of all members
SWGSDRangel::SWGLocalOutputReport Class Reference

#include <SWGLocalOutputReport.h>

+ Inheritance diagram for SWGSDRangel::SWGLocalOutputReport:
+ Collaboration diagram for SWGSDRangel::SWGLocalOutputReport:

Public Member Functions

 SWGLocalOutputReport ()
 
 SWGLocalOutputReport (QString *json)
 
virtual ~SWGLocalOutputReport ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGLocalOutputReportfromJson (QString &jsonString) override
 
qint32 getCenterFrequency ()
 
void setCenterFrequency (qint32 center_frequency)
 
qint32 getSampleRate ()
 
void setSampleRate (qint32 sample_rate)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

qint32 center_frequency
 
bool m_center_frequency_isSet
 
qint32 sample_rate
 
bool m_sample_rate_isSet
 

Detailed Description

Definition at line 31 of file SWGLocalOutputReport.h.

Constructor & Destructor Documentation

◆ SWGLocalOutputReport() [1/2]

SWGSDRangel::SWGLocalOutputReport::SWGLocalOutputReport ( )

◆ SWGLocalOutputReport() [2/2]

SWGSDRangel::SWGLocalOutputReport::SWGLocalOutputReport ( QString *  json)

Definition at line 25 of file SWGLocalOutputReport.cpp.

References fromJson(), and init().

25  {
26  init();
27  this->fromJson(*json);
28 }
virtual SWGLocalOutputReport * fromJson(QString &jsonString) override
+ Here is the call graph for this function:

◆ ~SWGLocalOutputReport()

SWGSDRangel::SWGLocalOutputReport::~SWGLocalOutputReport ( )
virtual

Definition at line 37 of file SWGLocalOutputReport.cpp.

References cleanup().

37  {
38  this->cleanup();
39 }
+ Here is the call graph for this function:

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGLocalOutputReport::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 73 of file SWGLocalOutputReport.cpp.

References asJsonObject().

74 {
75  QJsonObject* obj = this->asJsonObject();
76 
77  QJsonDocument doc(*obj);
78  QByteArray bytes = doc.toJson();
79  delete obj;
80  return QString(bytes);
81 }
virtual QJsonObject * asJsonObject() override
+ Here is the call graph for this function:

◆ asJsonObject()

QJsonObject * SWGSDRangel::SWGLocalOutputReport::asJsonObject ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 84 of file SWGLocalOutputReport.cpp.

References center_frequency, m_center_frequency_isSet, m_sample_rate_isSet, and sample_rate.

Referenced by asJson().

84  {
85  QJsonObject* obj = new QJsonObject();
87  obj->insert("centerFrequency", QJsonValue(center_frequency));
88  }
90  obj->insert("sampleRate", QJsonValue(sample_rate));
91  }
92 
93  return obj;
94 }
+ Here is the caller graph for this function:

◆ cleanup()

void SWGSDRangel::SWGLocalOutputReport::cleanup ( )

Definition at line 50 of file SWGLocalOutputReport.cpp.

Referenced by ~SWGLocalOutputReport().

50  {
51 
52 
53 }
+ Here is the caller graph for this function:

◆ fromJson()

SWGLocalOutputReport * SWGSDRangel::SWGLocalOutputReport::fromJson ( QString &  jsonString)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 56 of file SWGLocalOutputReport.cpp.

References fromJsonObject().

Referenced by SWGLocalOutputReport().

56  {
57  QByteArray array (json.toStdString().c_str());
58  QJsonDocument doc = QJsonDocument::fromJson(array);
59  QJsonObject jsonObject = doc.object();
60  this->fromJsonObject(jsonObject);
61  return this;
62 }
virtual void fromJsonObject(QJsonObject &json) override
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fromJsonObject()

void SWGSDRangel::SWGLocalOutputReport::fromJsonObject ( QJsonObject &  json)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 65 of file SWGLocalOutputReport.cpp.

References center_frequency, sample_rate, and SWGSDRangel::setValue().

Referenced by fromJson().

65  {
66  ::SWGSDRangel::setValue(&center_frequency, pJson["centerFrequency"], "qint32", "");
67 
68  ::SWGSDRangel::setValue(&sample_rate, pJson["sampleRate"], "qint32", "");
69 
70 }
void setValue(void *value, QJsonValue obj, QString type, QString complexType)
Definition: SWGHelpers.cpp:25
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCenterFrequency()

qint32 SWGSDRangel::SWGLocalOutputReport::getCenterFrequency ( )

Definition at line 97 of file SWGLocalOutputReport.cpp.

References center_frequency.

97  {
98  return center_frequency;
99 }

◆ getSampleRate()

qint32 SWGSDRangel::SWGLocalOutputReport::getSampleRate ( )

Definition at line 107 of file SWGLocalOutputReport.cpp.

References sample_rate.

107  {
108  return sample_rate;
109 }

◆ init()

void SWGSDRangel::SWGLocalOutputReport::init ( )

◆ isSet()

bool SWGSDRangel::SWGLocalOutputReport::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 118 of file SWGLocalOutputReport.cpp.

References m_center_frequency_isSet, and m_sample_rate_isSet.

Referenced by SWGSDRangel::SWGDeviceReport::asJsonObject(), and SWGSDRangel::SWGDeviceReport::isSet().

118  {
119  bool isObjectUpdated = false;
120  do{
121  if(m_center_frequency_isSet){ isObjectUpdated = true; break;}
122  if(m_sample_rate_isSet){ isObjectUpdated = true; break;}
123  }while(false);
124  return isObjectUpdated;
125 }
+ Here is the caller graph for this function:

◆ setCenterFrequency()

void SWGSDRangel::SWGLocalOutputReport::setCenterFrequency ( qint32  center_frequency)

Definition at line 101 of file SWGLocalOutputReport.cpp.

References center_frequency, and m_center_frequency_isSet.

Referenced by LocalOutput::webapiFormatDeviceReport().

+ Here is the caller graph for this function:

◆ setSampleRate()

void SWGSDRangel::SWGLocalOutputReport::setSampleRate ( qint32  sample_rate)

Definition at line 111 of file SWGLocalOutputReport.cpp.

References m_sample_rate_isSet, and sample_rate.

Referenced by LocalOutput::webapiFormatDeviceReport().

+ Here is the caller graph for this function:

Member Data Documentation

◆ center_frequency

qint32 SWGSDRangel::SWGLocalOutputReport::center_frequency
private

◆ m_center_frequency_isSet

bool SWGSDRangel::SWGLocalOutputReport::m_center_frequency_isSet
private

◆ m_sample_rate_isSet

bool SWGSDRangel::SWGLocalOutputReport::m_sample_rate_isSet
private

Definition at line 58 of file SWGLocalOutputReport.h.

Referenced by asJsonObject(), init(), isSet(), setSampleRate(), and SWGLocalOutputReport().

◆ sample_rate

qint32 SWGSDRangel::SWGLocalOutputReport::sample_rate
private

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