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

#include <SWGSamplingDevice.h>

+ Inheritance diagram for SWGSDRangel::SWGSamplingDevice:
+ Collaboration diagram for SWGSDRangel::SWGSamplingDevice:

Public Member Functions

 SWGSamplingDevice ()
 
 SWGSamplingDevice (QString *json)
 
virtual ~SWGSamplingDevice ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGSamplingDevicefromJson (QString &jsonString) override
 
qint32 getIndex ()
 
void setIndex (qint32 index)
 
QString * getHwType ()
 
void setHwType (QString *hw_type)
 
qint32 getDirection ()
 
void setDirection (qint32 direction)
 
qint32 getDeviceNbStreams ()
 
void setDeviceNbStreams (qint32 device_nb_streams)
 
qint32 getDeviceStreamIndex ()
 
void setDeviceStreamIndex (qint32 device_stream_index)
 
qint32 getSequence ()
 
void setSequence (qint32 sequence)
 
QString * getSerial ()
 
void setSerial (QString *serial)
 
qint64 getCenterFrequency ()
 
void setCenterFrequency (qint64 center_frequency)
 
qint32 getBandwidth ()
 
void setBandwidth (qint32 bandwidth)
 
QString * getState ()
 
void setState (QString *state)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

qint32 index
 
bool m_index_isSet
 
QString * hw_type
 
bool m_hw_type_isSet
 
qint32 direction
 
bool m_direction_isSet
 
qint32 device_nb_streams
 
bool m_device_nb_streams_isSet
 
qint32 device_stream_index
 
bool m_device_stream_index_isSet
 
qint32 sequence
 
bool m_sequence_isSet
 
QString * serial
 
bool m_serial_isSet
 
qint64 center_frequency
 
bool m_center_frequency_isSet
 
qint32 bandwidth
 
bool m_bandwidth_isSet
 
QString * state
 
bool m_state_isSet
 

Detailed Description

Definition at line 32 of file SWGSamplingDevice.h.

Constructor & Destructor Documentation

◆ SWGSamplingDevice() [1/2]

SWGSDRangel::SWGSamplingDevice::SWGSamplingDevice ( )

Definition at line 30 of file SWGSamplingDevice.cpp.

References bandwidth, center_frequency, device_nb_streams, device_stream_index, direction, hw_type, index, m_bandwidth_isSet, m_center_frequency_isSet, m_device_nb_streams_isSet, m_device_stream_index_isSet, m_direction_isSet, m_hw_type_isSet, m_index_isSet, m_sequence_isSet, m_serial_isSet, m_state_isSet, sequence, serial, and state.

30  {
31  index = 0;
32  m_index_isSet = false;
33  hw_type = nullptr;
34  m_hw_type_isSet = false;
35  direction = 0;
36  m_direction_isSet = false;
41  sequence = 0;
42  m_sequence_isSet = false;
43  serial = nullptr;
44  m_serial_isSet = false;
45  center_frequency = 0L;
47  bandwidth = 0;
48  m_bandwidth_isSet = false;
49  state = nullptr;
50  m_state_isSet = false;
51 }

◆ SWGSamplingDevice() [2/2]

SWGSDRangel::SWGSamplingDevice::SWGSamplingDevice ( QString *  json)

Definition at line 25 of file SWGSamplingDevice.cpp.

References fromJson(), and init().

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

◆ ~SWGSamplingDevice()

SWGSDRangel::SWGSamplingDevice::~SWGSamplingDevice ( )
virtual

Definition at line 53 of file SWGSamplingDevice.cpp.

References cleanup().

53  {
54  this->cleanup();
55 }
+ Here is the call graph for this function:

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGSamplingDevice::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 135 of file SWGSamplingDevice.cpp.

References asJsonObject().

136 {
137  QJsonObject* obj = this->asJsonObject();
138 
139  QJsonDocument doc(*obj);
140  QByteArray bytes = doc.toJson();
141  delete obj;
142  return QString(bytes);
143 }
virtual QJsonObject * asJsonObject() override
+ Here is the call graph for this function:

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 146 of file SWGSamplingDevice.cpp.

References bandwidth, center_frequency, device_nb_streams, device_stream_index, direction, hw_type, index, m_bandwidth_isSet, m_center_frequency_isSet, m_device_nb_streams_isSet, m_device_stream_index_isSet, m_direction_isSet, m_index_isSet, m_sequence_isSet, sequence, serial, state, and SWGSDRangel::toJsonValue().

Referenced by asJson().

146  {
147  QJsonObject* obj = new QJsonObject();
148  if(m_index_isSet){
149  obj->insert("index", QJsonValue(index));
150  }
151  if(hw_type != nullptr && *hw_type != QString("")){
152  toJsonValue(QString("hwType"), hw_type, obj, QString("QString"));
153  }
154  if(m_direction_isSet){
155  obj->insert("direction", QJsonValue(direction));
156  }
158  obj->insert("deviceNbStreams", QJsonValue(device_nb_streams));
159  }
161  obj->insert("deviceStreamIndex", QJsonValue(device_stream_index));
162  }
163  if(m_sequence_isSet){
164  obj->insert("sequence", QJsonValue(sequence));
165  }
166  if(serial != nullptr && *serial != QString("")){
167  toJsonValue(QString("serial"), serial, obj, QString("QString"));
168  }
170  obj->insert("centerFrequency", QJsonValue(center_frequency));
171  }
172  if(m_bandwidth_isSet){
173  obj->insert("bandwidth", QJsonValue(bandwidth));
174  }
175  if(state != nullptr && *state != QString("")){
176  toJsonValue(QString("state"), state, obj, QString("QString"));
177  }
178 
179  return obj;
180 }
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::SWGSamplingDevice::cleanup ( )

Definition at line 82 of file SWGSamplingDevice.cpp.

References hw_type, serial, and state.

Referenced by ~SWGSamplingDevice().

82  {
83 
84  if(hw_type != nullptr) {
85  delete hw_type;
86  }
87 
88 
89 
90 
91  if(serial != nullptr) {
92  delete serial;
93  }
94 
95 
96  if(state != nullptr) {
97  delete state;
98  }
99 }
+ Here is the caller graph for this function:

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 102 of file SWGSamplingDevice.cpp.

References fromJsonObject().

Referenced by SWGSamplingDevice().

102  {
103  QByteArray array (json.toStdString().c_str());
104  QJsonDocument doc = QJsonDocument::fromJson(array);
105  QJsonObject jsonObject = doc.object();
106  this->fromJsonObject(jsonObject);
107  return this;
108 }
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::SWGSamplingDevice::fromJsonObject ( QJsonObject &  json)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 111 of file SWGSamplingDevice.cpp.

References bandwidth, center_frequency, device_nb_streams, device_stream_index, direction, hw_type, index, sequence, serial, SWGSDRangel::setValue(), and state.

Referenced by fromJson().

111  {
112  ::SWGSDRangel::setValue(&index, pJson["index"], "qint32", "");
113 
114  ::SWGSDRangel::setValue(&hw_type, pJson["hwType"], "QString", "QString");
115 
116  ::SWGSDRangel::setValue(&direction, pJson["direction"], "qint32", "");
117 
118  ::SWGSDRangel::setValue(&device_nb_streams, pJson["deviceNbStreams"], "qint32", "");
119 
120  ::SWGSDRangel::setValue(&device_stream_index, pJson["deviceStreamIndex"], "qint32", "");
121 
122  ::SWGSDRangel::setValue(&sequence, pJson["sequence"], "qint32", "");
123 
124  ::SWGSDRangel::setValue(&serial, pJson["serial"], "QString", "QString");
125 
126  ::SWGSDRangel::setValue(&center_frequency, pJson["centerFrequency"], "qint64", "");
127 
128  ::SWGSDRangel::setValue(&bandwidth, pJson["bandwidth"], "qint32", "");
129 
130  ::SWGSDRangel::setValue(&state, pJson["state"], "QString", "QString");
131 
132 }
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:

◆ getBandwidth()

qint32 SWGSDRangel::SWGSamplingDevice::getBandwidth ( )

Definition at line 263 of file SWGSamplingDevice.cpp.

References bandwidth.

263  {
264  return bandwidth;
265 }

◆ getCenterFrequency()

qint64 SWGSDRangel::SWGSamplingDevice::getCenterFrequency ( )

Definition at line 253 of file SWGSamplingDevice.cpp.

References center_frequency.

253  {
254  return center_frequency;
255 }

◆ getDeviceNbStreams()

qint32 SWGSDRangel::SWGSamplingDevice::getDeviceNbStreams ( )

Definition at line 213 of file SWGSamplingDevice.cpp.

References device_nb_streams.

213  {
214  return device_nb_streams;
215 }

◆ getDeviceStreamIndex()

qint32 SWGSDRangel::SWGSamplingDevice::getDeviceStreamIndex ( )

Definition at line 223 of file SWGSamplingDevice.cpp.

References device_stream_index.

223  {
224  return device_stream_index;
225 }

◆ getDirection()

qint32 SWGSDRangel::SWGSamplingDevice::getDirection ( )

Definition at line 203 of file SWGSamplingDevice.cpp.

References direction.

203  {
204  return direction;
205 }

◆ getHwType()

QString * SWGSDRangel::SWGSamplingDevice::getHwType ( )

Definition at line 193 of file SWGSamplingDevice.cpp.

References hw_type.

Referenced by WebAPIAdapterGUI::getDeviceSet(), and WebAPIAdapterSrv::getDeviceSet().

193  {
194  return hw_type;
195 }
+ Here is the caller graph for this function:

◆ getIndex()

qint32 SWGSDRangel::SWGSamplingDevice::getIndex ( )

Definition at line 183 of file SWGSamplingDevice.cpp.

References index.

183  {
184  return index;
185 }

◆ getSequence()

qint32 SWGSDRangel::SWGSamplingDevice::getSequence ( )

Definition at line 233 of file SWGSamplingDevice.cpp.

References sequence.

233  {
234  return sequence;
235 }

◆ getSerial()

QString * SWGSDRangel::SWGSamplingDevice::getSerial ( )

Definition at line 243 of file SWGSamplingDevice.cpp.

References serial.

Referenced by WebAPIAdapterGUI::getDeviceSet(), and WebAPIAdapterSrv::getDeviceSet().

243  {
244  return serial;
245 }
+ Here is the caller graph for this function:

◆ getState()

QString * SWGSDRangel::SWGSamplingDevice::getState ( )

Definition at line 273 of file SWGSamplingDevice.cpp.

References state.

Referenced by WebAPIAdapterGUI::getDeviceSet(), and WebAPIAdapterSrv::getDeviceSet().

273  {
274  return state;
275 }
+ Here is the caller graph for this function:

◆ init()

void SWGSDRangel::SWGSamplingDevice::init ( )

Definition at line 58 of file SWGSamplingDevice.cpp.

References bandwidth, center_frequency, device_nb_streams, device_stream_index, direction, hw_type, index, m_bandwidth_isSet, m_center_frequency_isSet, m_device_nb_streams_isSet, m_device_stream_index_isSet, m_direction_isSet, m_hw_type_isSet, m_index_isSet, m_sequence_isSet, m_serial_isSet, m_state_isSet, sequence, serial, and state.

Referenced by WebAPIAdapterGUI::getDeviceSet(), WebAPIAdapterSrv::getDeviceSet(), and SWGSamplingDevice().

58  {
59  index = 0;
60  m_index_isSet = false;
61  hw_type = new QString("");
62  m_hw_type_isSet = false;
63  direction = 0;
64  m_direction_isSet = false;
69  sequence = 0;
70  m_sequence_isSet = false;
71  serial = new QString("");
72  m_serial_isSet = false;
73  center_frequency = 0L;
75  bandwidth = 0;
76  m_bandwidth_isSet = false;
77  state = new QString("");
78  m_state_isSet = false;
79 }
+ Here is the caller graph for this function:

◆ isSet()

bool SWGSDRangel::SWGSamplingDevice::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 284 of file SWGSamplingDevice.cpp.

References hw_type, m_bandwidth_isSet, m_center_frequency_isSet, m_device_nb_streams_isSet, m_device_stream_index_isSet, m_direction_isSet, m_index_isSet, m_sequence_isSet, serial, and state.

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

284  {
285  bool isObjectUpdated = false;
286  do{
287  if(m_index_isSet){ isObjectUpdated = true; break;}
288  if(hw_type != nullptr && *hw_type != QString("")){ isObjectUpdated = true; break;}
289  if(m_direction_isSet){ isObjectUpdated = true; break;}
290  if(m_device_nb_streams_isSet){ isObjectUpdated = true; break;}
291  if(m_device_stream_index_isSet){ isObjectUpdated = true; break;}
292  if(m_sequence_isSet){ isObjectUpdated = true; break;}
293  if(serial != nullptr && *serial != QString("")){ isObjectUpdated = true; break;}
294  if(m_center_frequency_isSet){ isObjectUpdated = true; break;}
295  if(m_bandwidth_isSet){ isObjectUpdated = true; break;}
296  if(state != nullptr && *state != QString("")){ isObjectUpdated = true; break;}
297  }while(false);
298  return isObjectUpdated;
299 }
+ Here is the caller graph for this function:

◆ setBandwidth()

void SWGSDRangel::SWGSamplingDevice::setBandwidth ( qint32  bandwidth)

Definition at line 267 of file SWGSamplingDevice.cpp.

References bandwidth, and m_bandwidth_isSet.

Referenced by WebAPIAdapterGUI::getDeviceSet(), and WebAPIAdapterSrv::getDeviceSet().

267  {
268  this->bandwidth = bandwidth;
269  this->m_bandwidth_isSet = true;
270 }
+ Here is the caller graph for this function:

◆ setCenterFrequency()

void SWGSDRangel::SWGSamplingDevice::setCenterFrequency ( qint64  center_frequency)

Definition at line 257 of file SWGSamplingDevice.cpp.

References center_frequency, and m_center_frequency_isSet.

Referenced by WebAPIAdapterGUI::getDeviceSet(), and WebAPIAdapterSrv::getDeviceSet().

+ Here is the caller graph for this function:

◆ setDeviceNbStreams()

void SWGSDRangel::SWGSamplingDevice::setDeviceNbStreams ( qint32  device_nb_streams)

Definition at line 217 of file SWGSamplingDevice.cpp.

References device_nb_streams, and m_device_nb_streams_isSet.

Referenced by WebAPIAdapterGUI::getDeviceSet(), and WebAPIAdapterSrv::getDeviceSet().

+ Here is the caller graph for this function:

◆ setDeviceStreamIndex()

void SWGSDRangel::SWGSamplingDevice::setDeviceStreamIndex ( qint32  device_stream_index)

Definition at line 227 of file SWGSamplingDevice.cpp.

References device_stream_index, and m_device_stream_index_isSet.

Referenced by WebAPIAdapterGUI::getDeviceSet(), and WebAPIAdapterSrv::getDeviceSet().

+ Here is the caller graph for this function:

◆ setDirection()

void SWGSDRangel::SWGSamplingDevice::setDirection ( qint32  direction)

Definition at line 207 of file SWGSamplingDevice.cpp.

References direction, and m_direction_isSet.

Referenced by WebAPIAdapterGUI::getDeviceSet(), and WebAPIAdapterSrv::getDeviceSet().

207  {
208  this->direction = direction;
209  this->m_direction_isSet = true;
210 }
+ Here is the caller graph for this function:

◆ setHwType()

void SWGSDRangel::SWGSamplingDevice::setHwType ( QString *  hw_type)

Definition at line 197 of file SWGSamplingDevice.cpp.

References hw_type, and m_hw_type_isSet.

197  {
198  this->hw_type = hw_type;
199  this->m_hw_type_isSet = true;
200 }

◆ setIndex()

void SWGSDRangel::SWGSamplingDevice::setIndex ( qint32  index)

Definition at line 187 of file SWGSamplingDevice.cpp.

References index, and m_index_isSet.

Referenced by WebAPIAdapterGUI::getDeviceSet(), and WebAPIAdapterSrv::getDeviceSet().

187  {
188  this->index = index;
189  this->m_index_isSet = true;
190 }
+ Here is the caller graph for this function:

◆ setSequence()

void SWGSDRangel::SWGSamplingDevice::setSequence ( qint32  sequence)

Definition at line 237 of file SWGSamplingDevice.cpp.

References m_sequence_isSet, and sequence.

Referenced by WebAPIAdapterGUI::getDeviceSet(), and WebAPIAdapterSrv::getDeviceSet().

237  {
238  this->sequence = sequence;
239  this->m_sequence_isSet = true;
240 }
+ Here is the caller graph for this function:

◆ setSerial()

void SWGSDRangel::SWGSamplingDevice::setSerial ( QString *  serial)

Definition at line 247 of file SWGSamplingDevice.cpp.

References m_serial_isSet, and serial.

247  {
248  this->serial = serial;
249  this->m_serial_isSet = true;
250 }

◆ setState()

void SWGSDRangel::SWGSamplingDevice::setState ( QString *  state)

Definition at line 277 of file SWGSamplingDevice.cpp.

References m_state_isSet, and state.

277  {
278  this->state = state;
279  this->m_state_isSet = true;
280 }

Member Data Documentation

◆ bandwidth

qint32 SWGSDRangel::SWGSamplingDevice::bandwidth
private

◆ center_frequency

qint64 SWGSDRangel::SWGSamplingDevice::center_frequency
private

◆ device_nb_streams

qint32 SWGSDRangel::SWGSamplingDevice::device_nb_streams
private

◆ device_stream_index

qint32 SWGSDRangel::SWGSamplingDevice::device_stream_index
private

◆ direction

qint32 SWGSDRangel::SWGSamplingDevice::direction
private

◆ hw_type

QString* SWGSDRangel::SWGSamplingDevice::hw_type
private

◆ index

qint32 SWGSDRangel::SWGSamplingDevice::index
private

◆ m_bandwidth_isSet

bool SWGSDRangel::SWGSamplingDevice::m_bandwidth_isSet
private

Definition at line 104 of file SWGSamplingDevice.h.

Referenced by asJsonObject(), init(), isSet(), setBandwidth(), and SWGSamplingDevice().

◆ m_center_frequency_isSet

bool SWGSDRangel::SWGSamplingDevice::m_center_frequency_isSet
private

Definition at line 101 of file SWGSamplingDevice.h.

Referenced by asJsonObject(), init(), isSet(), setCenterFrequency(), and SWGSamplingDevice().

◆ m_device_nb_streams_isSet

bool SWGSDRangel::SWGSamplingDevice::m_device_nb_streams_isSet
private

Definition at line 89 of file SWGSamplingDevice.h.

Referenced by asJsonObject(), init(), isSet(), setDeviceNbStreams(), and SWGSamplingDevice().

◆ m_device_stream_index_isSet

bool SWGSDRangel::SWGSamplingDevice::m_device_stream_index_isSet
private

◆ m_direction_isSet

bool SWGSDRangel::SWGSamplingDevice::m_direction_isSet
private

Definition at line 86 of file SWGSamplingDevice.h.

Referenced by asJsonObject(), init(), isSet(), setDirection(), and SWGSamplingDevice().

◆ m_hw_type_isSet

bool SWGSDRangel::SWGSamplingDevice::m_hw_type_isSet
private

Definition at line 83 of file SWGSamplingDevice.h.

Referenced by init(), setHwType(), and SWGSamplingDevice().

◆ m_index_isSet

bool SWGSDRangel::SWGSamplingDevice::m_index_isSet
private

Definition at line 80 of file SWGSamplingDevice.h.

Referenced by asJsonObject(), init(), isSet(), setIndex(), and SWGSamplingDevice().

◆ m_sequence_isSet

bool SWGSDRangel::SWGSamplingDevice::m_sequence_isSet
private

Definition at line 95 of file SWGSamplingDevice.h.

Referenced by asJsonObject(), init(), isSet(), setSequence(), and SWGSamplingDevice().

◆ m_serial_isSet

bool SWGSDRangel::SWGSamplingDevice::m_serial_isSet
private

Definition at line 98 of file SWGSamplingDevice.h.

Referenced by init(), setSerial(), and SWGSamplingDevice().

◆ m_state_isSet

bool SWGSDRangel::SWGSamplingDevice::m_state_isSet
private

Definition at line 107 of file SWGSamplingDevice.h.

Referenced by init(), setState(), and SWGSamplingDevice().

◆ sequence

qint32 SWGSDRangel::SWGSamplingDevice::sequence
private

◆ serial

QString* SWGSDRangel::SWGSamplingDevice::serial
private

◆ state

QString* SWGSDRangel::SWGSamplingDevice::state
private

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