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::SWGRemoteInputReport Class Reference

#include <SWGRemoteInputReport.h>

+ Inheritance diagram for SWGSDRangel::SWGRemoteInputReport:
+ Collaboration diagram for SWGSDRangel::SWGRemoteInputReport:

Public Member Functions

 SWGRemoteInputReport ()
 
 SWGRemoteInputReport (QString *json)
 
virtual ~SWGRemoteInputReport ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGRemoteInputReportfromJson (QString &jsonString) override
 
qint32 getCenterFrequency ()
 
void setCenterFrequency (qint32 center_frequency)
 
qint32 getSampleRate ()
 
void setSampleRate (qint32 sample_rate)
 
qint32 getBufferRwBalance ()
 
void setBufferRwBalance (qint32 buffer_rw_balance)
 
QString * getRemoteTimestamp ()
 
void setRemoteTimestamp (QString *remote_timestamp)
 
qint32 getMinNbBlocks ()
 
void setMinNbBlocks (qint32 min_nb_blocks)
 
qint32 getMaxNbRecovery ()
 
void setMaxNbRecovery (qint32 max_nb_recovery)
 
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
 
qint32 buffer_rw_balance
 
bool m_buffer_rw_balance_isSet
 
QString * remote_timestamp
 
bool m_remote_timestamp_isSet
 
qint32 min_nb_blocks
 
bool m_min_nb_blocks_isSet
 
qint32 max_nb_recovery
 
bool m_max_nb_recovery_isSet
 

Detailed Description

Definition at line 32 of file SWGRemoteInputReport.h.

Constructor & Destructor Documentation

◆ SWGRemoteInputReport() [1/2]

SWGSDRangel::SWGRemoteInputReport::SWGRemoteInputReport ( )

Definition at line 30 of file SWGRemoteInputReport.cpp.

References buffer_rw_balance, center_frequency, m_buffer_rw_balance_isSet, m_center_frequency_isSet, m_max_nb_recovery_isSet, m_min_nb_blocks_isSet, m_remote_timestamp_isSet, m_sample_rate_isSet, max_nb_recovery, min_nb_blocks, remote_timestamp, and sample_rate.

30  {
31  center_frequency = 0;
33  sample_rate = 0;
34  m_sample_rate_isSet = false;
37  remote_timestamp = nullptr;
39  min_nb_blocks = 0;
40  m_min_nb_blocks_isSet = false;
41  max_nb_recovery = 0;
43 }

◆ SWGRemoteInputReport() [2/2]

SWGSDRangel::SWGRemoteInputReport::SWGRemoteInputReport ( QString *  json)

Definition at line 25 of file SWGRemoteInputReport.cpp.

References fromJson(), and init().

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

◆ ~SWGRemoteInputReport()

SWGSDRangel::SWGRemoteInputReport::~SWGRemoteInputReport ( )
virtual

Definition at line 45 of file SWGRemoteInputReport.cpp.

References cleanup().

45  {
46  this->cleanup();
47 }
+ Here is the call graph for this function:

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGRemoteInputReport::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 103 of file SWGRemoteInputReport.cpp.

References asJsonObject().

104 {
105  QJsonObject* obj = this->asJsonObject();
106 
107  QJsonDocument doc(*obj);
108  QByteArray bytes = doc.toJson();
109  delete obj;
110  return QString(bytes);
111 }
virtual QJsonObject * asJsonObject() override
+ Here is the call graph for this function:

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 114 of file SWGRemoteInputReport.cpp.

References buffer_rw_balance, center_frequency, m_buffer_rw_balance_isSet, m_center_frequency_isSet, m_max_nb_recovery_isSet, m_min_nb_blocks_isSet, m_sample_rate_isSet, max_nb_recovery, min_nb_blocks, remote_timestamp, sample_rate, and SWGSDRangel::toJsonValue().

Referenced by asJson().

114  {
115  QJsonObject* obj = new QJsonObject();
117  obj->insert("centerFrequency", QJsonValue(center_frequency));
118  }
120  obj->insert("sampleRate", QJsonValue(sample_rate));
121  }
123  obj->insert("bufferRWBalance", QJsonValue(buffer_rw_balance));
124  }
125  if(remote_timestamp != nullptr && *remote_timestamp != QString("")){
126  toJsonValue(QString("remoteTimestamp"), remote_timestamp, obj, QString("QString"));
127  }
129  obj->insert("minNbBlocks", QJsonValue(min_nb_blocks));
130  }
132  obj->insert("maxNbRecovery", QJsonValue(max_nb_recovery));
133  }
134 
135  return obj;
136 }
void toJsonValue(QString name, void *value, QJsonObject *output, QString type)
Definition: SWGHelpers.cpp:383
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cleanup()

void SWGSDRangel::SWGRemoteInputReport::cleanup ( )

Definition at line 66 of file SWGRemoteInputReport.cpp.

References remote_timestamp.

Referenced by ~SWGRemoteInputReport().

66  {
67 
68 
69 
70  if(remote_timestamp != nullptr) {
71  delete remote_timestamp;
72  }
73 
74 
75 }
+ Here is the caller graph for this function:

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 78 of file SWGRemoteInputReport.cpp.

References fromJsonObject().

Referenced by SWGRemoteInputReport().

78  {
79  QByteArray array (json.toStdString().c_str());
80  QJsonDocument doc = QJsonDocument::fromJson(array);
81  QJsonObject jsonObject = doc.object();
82  this->fromJsonObject(jsonObject);
83  return this;
84 }
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::SWGRemoteInputReport::fromJsonObject ( QJsonObject &  json)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 87 of file SWGRemoteInputReport.cpp.

References buffer_rw_balance, center_frequency, max_nb_recovery, min_nb_blocks, remote_timestamp, sample_rate, and SWGSDRangel::setValue().

Referenced by fromJson().

87  {
88  ::SWGSDRangel::setValue(&center_frequency, pJson["centerFrequency"], "qint32", "");
89 
90  ::SWGSDRangel::setValue(&sample_rate, pJson["sampleRate"], "qint32", "");
91 
92  ::SWGSDRangel::setValue(&buffer_rw_balance, pJson["bufferRWBalance"], "qint32", "");
93 
94  ::SWGSDRangel::setValue(&remote_timestamp, pJson["remoteTimestamp"], "QString", "QString");
95 
96  ::SWGSDRangel::setValue(&min_nb_blocks, pJson["minNbBlocks"], "qint32", "");
97 
98  ::SWGSDRangel::setValue(&max_nb_recovery, pJson["maxNbRecovery"], "qint32", "");
99 
100 }
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:

◆ getBufferRwBalance()

qint32 SWGSDRangel::SWGRemoteInputReport::getBufferRwBalance ( )

Definition at line 159 of file SWGRemoteInputReport.cpp.

References buffer_rw_balance.

159  {
160  return buffer_rw_balance;
161 }

◆ getCenterFrequency()

qint32 SWGSDRangel::SWGRemoteInputReport::getCenterFrequency ( )

Definition at line 139 of file SWGRemoteInputReport.cpp.

References center_frequency.

139  {
140  return center_frequency;
141 }

◆ getMaxNbRecovery()

qint32 SWGSDRangel::SWGRemoteInputReport::getMaxNbRecovery ( )

Definition at line 189 of file SWGRemoteInputReport.cpp.

References max_nb_recovery.

189  {
190  return max_nb_recovery;
191 }

◆ getMinNbBlocks()

qint32 SWGSDRangel::SWGRemoteInputReport::getMinNbBlocks ( )

Definition at line 179 of file SWGRemoteInputReport.cpp.

References min_nb_blocks.

179  {
180  return min_nb_blocks;
181 }

◆ getRemoteTimestamp()

QString * SWGSDRangel::SWGRemoteInputReport::getRemoteTimestamp ( )

Definition at line 169 of file SWGRemoteInputReport.cpp.

References remote_timestamp.

169  {
170  return remote_timestamp;
171 }

◆ getSampleRate()

qint32 SWGSDRangel::SWGRemoteInputReport::getSampleRate ( )

Definition at line 149 of file SWGRemoteInputReport.cpp.

References sample_rate.

149  {
150  return sample_rate;
151 }

◆ init()

void SWGSDRangel::SWGRemoteInputReport::init ( )

Definition at line 50 of file SWGRemoteInputReport.cpp.

References buffer_rw_balance, center_frequency, m_buffer_rw_balance_isSet, m_center_frequency_isSet, m_max_nb_recovery_isSet, m_min_nb_blocks_isSet, m_remote_timestamp_isSet, m_sample_rate_isSet, max_nb_recovery, min_nb_blocks, remote_timestamp, and sample_rate.

Referenced by SWGRemoteInputReport(), and RemoteInput::webapiReportGet().

50  {
51  center_frequency = 0;
53  sample_rate = 0;
54  m_sample_rate_isSet = false;
57  remote_timestamp = new QString("");
59  min_nb_blocks = 0;
60  m_min_nb_blocks_isSet = false;
61  max_nb_recovery = 0;
63 }
+ Here is the caller graph for this function:

◆ isSet()

bool SWGSDRangel::SWGRemoteInputReport::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 200 of file SWGRemoteInputReport.cpp.

References m_buffer_rw_balance_isSet, m_center_frequency_isSet, m_max_nb_recovery_isSet, m_min_nb_blocks_isSet, m_sample_rate_isSet, and remote_timestamp.

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

200  {
201  bool isObjectUpdated = false;
202  do{
203  if(m_center_frequency_isSet){ isObjectUpdated = true; break;}
204  if(m_sample_rate_isSet){ isObjectUpdated = true; break;}
205  if(m_buffer_rw_balance_isSet){ isObjectUpdated = true; break;}
206  if(remote_timestamp != nullptr && *remote_timestamp != QString("")){ isObjectUpdated = true; break;}
207  if(m_min_nb_blocks_isSet){ isObjectUpdated = true; break;}
208  if(m_max_nb_recovery_isSet){ isObjectUpdated = true; break;}
209  }while(false);
210  return isObjectUpdated;
211 }
+ Here is the caller graph for this function:

◆ setBufferRwBalance()

void SWGSDRangel::SWGRemoteInputReport::setBufferRwBalance ( qint32  buffer_rw_balance)

Definition at line 163 of file SWGRemoteInputReport.cpp.

References buffer_rw_balance, and m_buffer_rw_balance_isSet.

Referenced by RemoteInput::webapiFormatDeviceReport().

+ Here is the caller graph for this function:

◆ setCenterFrequency()

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

Definition at line 143 of file SWGRemoteInputReport.cpp.

References center_frequency, and m_center_frequency_isSet.

Referenced by RemoteInput::webapiFormatDeviceReport().

+ Here is the caller graph for this function:

◆ setMaxNbRecovery()

void SWGSDRangel::SWGRemoteInputReport::setMaxNbRecovery ( qint32  max_nb_recovery)

Definition at line 193 of file SWGRemoteInputReport.cpp.

References m_max_nb_recovery_isSet, and max_nb_recovery.

Referenced by RemoteInput::webapiFormatDeviceReport().

+ Here is the caller graph for this function:

◆ setMinNbBlocks()

void SWGSDRangel::SWGRemoteInputReport::setMinNbBlocks ( qint32  min_nb_blocks)

Definition at line 183 of file SWGRemoteInputReport.cpp.

References m_min_nb_blocks_isSet, and min_nb_blocks.

Referenced by RemoteInput::webapiFormatDeviceReport().

+ Here is the caller graph for this function:

◆ setRemoteTimestamp()

void SWGSDRangel::SWGRemoteInputReport::setRemoteTimestamp ( QString *  remote_timestamp)

Definition at line 173 of file SWGRemoteInputReport.cpp.

References m_remote_timestamp_isSet, and remote_timestamp.

Referenced by RemoteInput::webapiFormatDeviceReport().

+ Here is the caller graph for this function:

◆ setSampleRate()

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

Definition at line 153 of file SWGRemoteInputReport.cpp.

References m_sample_rate_isSet, and sample_rate.

Referenced by RemoteInput::webapiFormatDeviceReport().

+ Here is the caller graph for this function:

Member Data Documentation

◆ buffer_rw_balance

qint32 SWGSDRangel::SWGRemoteInputReport::buffer_rw_balance
private

◆ center_frequency

qint32 SWGSDRangel::SWGRemoteInputReport::center_frequency
private

◆ m_buffer_rw_balance_isSet

bool SWGSDRangel::SWGRemoteInputReport::m_buffer_rw_balance_isSet
private

◆ m_center_frequency_isSet

bool SWGSDRangel::SWGRemoteInputReport::m_center_frequency_isSet
private

◆ m_max_nb_recovery_isSet

bool SWGSDRangel::SWGRemoteInputReport::m_max_nb_recovery_isSet
private

◆ m_min_nb_blocks_isSet

bool SWGSDRangel::SWGRemoteInputReport::m_min_nb_blocks_isSet
private

◆ m_remote_timestamp_isSet

bool SWGSDRangel::SWGRemoteInputReport::m_remote_timestamp_isSet
private

Definition at line 77 of file SWGRemoteInputReport.h.

Referenced by init(), setRemoteTimestamp(), and SWGRemoteInputReport().

◆ m_sample_rate_isSet

bool SWGSDRangel::SWGRemoteInputReport::m_sample_rate_isSet
private

Definition at line 71 of file SWGRemoteInputReport.h.

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

◆ max_nb_recovery

qint32 SWGSDRangel::SWGRemoteInputReport::max_nb_recovery
private

◆ min_nb_blocks

qint32 SWGSDRangel::SWGRemoteInputReport::min_nb_blocks
private

◆ remote_timestamp

QString* SWGSDRangel::SWGRemoteInputReport::remote_timestamp
private

◆ sample_rate

qint32 SWGSDRangel::SWGRemoteInputReport::sample_rate
private

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