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

#include <SWGDeviceListItem.h>

+ Inheritance diagram for SWGSDRangel::SWGDeviceListItem:
+ Collaboration diagram for SWGSDRangel::SWGDeviceListItem:

Public Member Functions

 SWGDeviceListItem ()
 
 SWGDeviceListItem (QString *json)
 
virtual ~SWGDeviceListItem ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGDeviceListItemfromJson (QString &jsonString) override
 
QString * getDisplayedName ()
 
void setDisplayedName (QString *displayed_name)
 
QString * getHwType ()
 
void setHwType (QString *hw_type)
 
QString * getSerial ()
 
void setSerial (QString *serial)
 
qint32 getSequence ()
 
void setSequence (qint32 sequence)
 
qint32 getDirection ()
 
void setDirection (qint32 direction)
 
qint32 getDeviceNbStreams ()
 
void setDeviceNbStreams (qint32 device_nb_streams)
 
qint32 getDeviceStreamIndex ()
 
void setDeviceStreamIndex (qint32 device_stream_index)
 
qint32 getDeviceSetIndex ()
 
void setDeviceSetIndex (qint32 device_set_index)
 
qint32 getIndex ()
 
void setIndex (qint32 index)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

QString * displayed_name
 
bool m_displayed_name_isSet
 
QString * hw_type
 
bool m_hw_type_isSet
 
QString * serial
 
bool m_serial_isSet
 
qint32 sequence
 
bool m_sequence_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 device_set_index
 
bool m_device_set_index_isSet
 
qint32 index
 
bool m_index_isSet
 

Detailed Description

Definition at line 32 of file SWGDeviceListItem.h.

Constructor & Destructor Documentation

◆ SWGDeviceListItem() [1/2]

SWGSDRangel::SWGDeviceListItem::SWGDeviceListItem ( )

Definition at line 30 of file SWGDeviceListItem.cpp.

References device_nb_streams, device_set_index, device_stream_index, direction, displayed_name, hw_type, index, m_device_nb_streams_isSet, m_device_set_index_isSet, m_device_stream_index_isSet, m_direction_isSet, m_displayed_name_isSet, m_hw_type_isSet, m_index_isSet, m_sequence_isSet, m_serial_isSet, sequence, and serial.

30  {
31  displayed_name = nullptr;
32  m_displayed_name_isSet = false;
33  hw_type = nullptr;
34  m_hw_type_isSet = false;
35  serial = nullptr;
36  m_serial_isSet = false;
37  sequence = 0;
38  m_sequence_isSet = false;
39  direction = 0;
40  m_direction_isSet = false;
45  device_set_index = 0;
47  index = 0;
48  m_index_isSet = false;
49 }

◆ SWGDeviceListItem() [2/2]

SWGSDRangel::SWGDeviceListItem::SWGDeviceListItem ( QString *  json)

Definition at line 25 of file SWGDeviceListItem.cpp.

References fromJson(), and init().

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

◆ ~SWGDeviceListItem()

SWGSDRangel::SWGDeviceListItem::~SWGDeviceListItem ( )
virtual

Definition at line 51 of file SWGDeviceListItem.cpp.

References cleanup().

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

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGDeviceListItem::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 128 of file SWGDeviceListItem.cpp.

References asJsonObject().

Referenced by SWGSDRangel::SWGDeviceSetApi::devicesetDevicePut(), and WebAPIRequestMapper::devicesetDeviceService().

129 {
130  QJsonObject* obj = this->asJsonObject();
131 
132  QJsonDocument doc(*obj);
133  QByteArray bytes = doc.toJson();
134  delete obj;
135  return QString(bytes);
136 }
virtual QJsonObject * asJsonObject() override
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 139 of file SWGDeviceListItem.cpp.

References device_nb_streams, device_set_index, device_stream_index, direction, displayed_name, hw_type, index, m_device_nb_streams_isSet, m_device_set_index_isSet, m_device_stream_index_isSet, m_direction_isSet, m_index_isSet, m_sequence_isSet, sequence, serial, and SWGSDRangel::toJsonValue().

Referenced by asJson().

139  {
140  QJsonObject* obj = new QJsonObject();
141  if(displayed_name != nullptr && *displayed_name != QString("")){
142  toJsonValue(QString("displayedName"), displayed_name, obj, QString("QString"));
143  }
144  if(hw_type != nullptr && *hw_type != QString("")){
145  toJsonValue(QString("hwType"), hw_type, obj, QString("QString"));
146  }
147  if(serial != nullptr && *serial != QString("")){
148  toJsonValue(QString("serial"), serial, obj, QString("QString"));
149  }
150  if(m_sequence_isSet){
151  obj->insert("sequence", QJsonValue(sequence));
152  }
153  if(m_direction_isSet){
154  obj->insert("direction", QJsonValue(direction));
155  }
157  obj->insert("deviceNbStreams", QJsonValue(device_nb_streams));
158  }
160  obj->insert("deviceStreamIndex", QJsonValue(device_stream_index));
161  }
163  obj->insert("deviceSetIndex", QJsonValue(device_set_index));
164  }
165  if(m_index_isSet){
166  obj->insert("index", QJsonValue(index));
167  }
168 
169  return obj;
170 }
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::SWGDeviceListItem::cleanup ( )

Definition at line 78 of file SWGDeviceListItem.cpp.

References displayed_name, hw_type, and serial.

Referenced by ~SWGDeviceListItem().

78  {
79  if(displayed_name != nullptr) {
80  delete displayed_name;
81  }
82  if(hw_type != nullptr) {
83  delete hw_type;
84  }
85  if(serial != nullptr) {
86  delete serial;
87  }
88 
89 
90 
91 
92 
93 
94 }
+ Here is the caller graph for this function:

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 97 of file SWGDeviceListItem.cpp.

References fromJsonObject().

Referenced by SWGDeviceListItem().

97  {
98  QByteArray array (json.toStdString().c_str());
99  QJsonDocument doc = QJsonDocument::fromJson(array);
100  QJsonObject jsonObject = doc.object();
101  this->fromJsonObject(jsonObject);
102  return this;
103 }
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::SWGDeviceListItem::fromJsonObject ( QJsonObject &  json)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 106 of file SWGDeviceListItem.cpp.

References device_nb_streams, device_set_index, device_stream_index, direction, displayed_name, hw_type, index, sequence, serial, and SWGSDRangel::setValue().

Referenced by fromJson().

106  {
107  ::SWGSDRangel::setValue(&displayed_name, pJson["displayedName"], "QString", "QString");
108 
109  ::SWGSDRangel::setValue(&hw_type, pJson["hwType"], "QString", "QString");
110 
111  ::SWGSDRangel::setValue(&serial, pJson["serial"], "QString", "QString");
112 
113  ::SWGSDRangel::setValue(&sequence, pJson["sequence"], "qint32", "");
114 
115  ::SWGSDRangel::setValue(&direction, pJson["direction"], "qint32", "");
116 
117  ::SWGSDRangel::setValue(&device_nb_streams, pJson["deviceNbStreams"], "qint32", "");
118 
119  ::SWGSDRangel::setValue(&device_stream_index, pJson["deviceStreamIndex"], "qint32", "");
120 
121  ::SWGSDRangel::setValue(&device_set_index, pJson["deviceSetIndex"], "qint32", "");
122 
123  ::SWGSDRangel::setValue(&index, pJson["index"], "qint32", "");
124 
125 }
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:

◆ getDeviceNbStreams()

qint32 SWGSDRangel::SWGDeviceListItem::getDeviceNbStreams ( )

Definition at line 223 of file SWGDeviceListItem.cpp.

References device_nb_streams.

223  {
224  return device_nb_streams;
225 }

◆ getDeviceSetIndex()

qint32 SWGSDRangel::SWGDeviceListItem::getDeviceSetIndex ( )

Definition at line 243 of file SWGDeviceListItem.cpp.

References device_set_index.

243  {
244  return device_set_index;
245 }

◆ getDeviceStreamIndex()

qint32 SWGSDRangel::SWGDeviceListItem::getDeviceStreamIndex ( )

Definition at line 233 of file SWGDeviceListItem.cpp.

References device_stream_index.

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

233  {
234  return device_stream_index;
235 }
+ Here is the caller graph for this function:

◆ getDirection()

qint32 SWGSDRangel::SWGDeviceListItem::getDirection ( )

Definition at line 213 of file SWGDeviceListItem.cpp.

References direction.

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

213  {
214  return direction;
215 }
+ Here is the caller graph for this function:

◆ getDisplayedName()

QString * SWGSDRangel::SWGDeviceListItem::getDisplayedName ( )

Definition at line 173 of file SWGDeviceListItem.cpp.

References displayed_name.

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

173  {
174  return displayed_name;
175 }
+ Here is the caller graph for this function:

◆ getHwType()

QString * SWGSDRangel::SWGDeviceListItem::getHwType ( )

Definition at line 183 of file SWGDeviceListItem.cpp.

References hw_type.

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

183  {
184  return hw_type;
185 }
+ Here is the caller graph for this function:

◆ getIndex()

qint32 SWGSDRangel::SWGDeviceListItem::getIndex ( )

Definition at line 253 of file SWGDeviceListItem.cpp.

References index.

253  {
254  return index;
255 }

◆ getSequence()

qint32 SWGSDRangel::SWGDeviceListItem::getSequence ( )

Definition at line 203 of file SWGDeviceListItem.cpp.

References sequence.

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

203  {
204  return sequence;
205 }
+ Here is the caller graph for this function:

◆ getSerial()

QString * SWGSDRangel::SWGDeviceListItem::getSerial ( )

Definition at line 193 of file SWGDeviceListItem.cpp.

References serial.

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

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

◆ init()

void SWGSDRangel::SWGDeviceListItem::init ( )

Definition at line 56 of file SWGDeviceListItem.cpp.

References device_nb_streams, device_set_index, device_stream_index, direction, displayed_name, hw_type, index, m_device_nb_streams_isSet, m_device_set_index_isSet, m_device_stream_index_isSet, m_direction_isSet, m_displayed_name_isSet, m_hw_type_isSet, m_index_isSet, m_sequence_isSet, m_serial_isSet, sequence, and serial.

Referenced by WebAPIAdapterGUI::devicesetDevicePut(), WebAPIAdapterSrv::devicesetDevicePut(), and SWGDeviceListItem().

56  {
57  displayed_name = new QString("");
58  m_displayed_name_isSet = false;
59  hw_type = new QString("");
60  m_hw_type_isSet = false;
61  serial = new QString("");
62  m_serial_isSet = false;
63  sequence = 0;
64  m_sequence_isSet = false;
65  direction = 0;
66  m_direction_isSet = false;
71  device_set_index = 0;
73  index = 0;
74  m_index_isSet = false;
75 }
+ Here is the caller graph for this function:

◆ isSet()

bool SWGSDRangel::SWGDeviceListItem::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 264 of file SWGDeviceListItem.cpp.

References displayed_name, hw_type, m_device_nb_streams_isSet, m_device_set_index_isSet, m_device_stream_index_isSet, m_direction_isSet, m_index_isSet, m_sequence_isSet, and serial.

264  {
265  bool isObjectUpdated = false;
266  do{
267  if(displayed_name != nullptr && *displayed_name != QString("")){ isObjectUpdated = true; break;}
268  if(hw_type != nullptr && *hw_type != QString("")){ isObjectUpdated = true; break;}
269  if(serial != nullptr && *serial != QString("")){ isObjectUpdated = true; break;}
270  if(m_sequence_isSet){ isObjectUpdated = true; break;}
271  if(m_direction_isSet){ isObjectUpdated = true; break;}
272  if(m_device_nb_streams_isSet){ isObjectUpdated = true; break;}
273  if(m_device_stream_index_isSet){ isObjectUpdated = true; break;}
274  if(m_device_set_index_isSet){ isObjectUpdated = true; break;}
275  if(m_index_isSet){ isObjectUpdated = true; break;}
276  }while(false);
277  return isObjectUpdated;
278 }

◆ setDeviceNbStreams()

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

Definition at line 227 of file SWGDeviceListItem.cpp.

References device_nb_streams, and m_device_nb_streams_isSet.

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

+ Here is the caller graph for this function:

◆ setDeviceSetIndex()

void SWGSDRangel::SWGDeviceListItem::setDeviceSetIndex ( qint32  device_set_index)

Definition at line 247 of file SWGDeviceListItem.cpp.

References device_set_index, and m_device_set_index_isSet.

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

+ Here is the caller graph for this function:

◆ setDeviceStreamIndex()

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

◆ setDirection()

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

Definition at line 217 of file SWGDeviceListItem.cpp.

References direction, and m_direction_isSet.

Referenced by WebAPIAdapterGUI::devicesetDevicePut(), WebAPIAdapterSrv::devicesetDevicePut(), and WebAPIRequestMapper::validateDeviceListItem().

217  {
218  this->direction = direction;
219  this->m_direction_isSet = true;
220 }
+ Here is the caller graph for this function:

◆ setDisplayedName()

void SWGSDRangel::SWGDeviceListItem::setDisplayedName ( QString *  displayed_name)

Definition at line 177 of file SWGDeviceListItem.cpp.

References displayed_name, and m_displayed_name_isSet.

Referenced by WebAPIRequestMapper::validateDeviceListItem().

177  {
179  this->m_displayed_name_isSet = true;
180 }
+ Here is the caller graph for this function:

◆ setHwType()

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

Definition at line 187 of file SWGDeviceListItem.cpp.

References hw_type, and m_hw_type_isSet.

Referenced by WebAPIRequestMapper::validateDeviceListItem().

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

◆ setIndex()

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

Definition at line 257 of file SWGDeviceListItem.cpp.

References index, and m_index_isSet.

Referenced by WebAPIAdapterGUI::devicesetDevicePut(), WebAPIAdapterSrv::devicesetDevicePut(), and WebAPIRequestMapper::validateDeviceListItem().

257  {
258  this->index = index;
259  this->m_index_isSet = true;
260 }
+ Here is the caller graph for this function:

◆ setSequence()

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

Definition at line 207 of file SWGDeviceListItem.cpp.

References m_sequence_isSet, and sequence.

Referenced by WebAPIAdapterGUI::devicesetDevicePut(), WebAPIAdapterSrv::devicesetDevicePut(), and WebAPIRequestMapper::validateDeviceListItem().

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

◆ setSerial()

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

Definition at line 197 of file SWGDeviceListItem.cpp.

References m_serial_isSet, and serial.

Referenced by WebAPIRequestMapper::validateDeviceListItem().

197  {
198  this->serial = serial;
199  this->m_serial_isSet = true;
200 }
+ Here is the caller graph for this function:

Member Data Documentation

◆ device_nb_streams

qint32 SWGSDRangel::SWGDeviceListItem::device_nb_streams
private

◆ device_set_index

qint32 SWGSDRangel::SWGDeviceListItem::device_set_index
private

◆ device_stream_index

qint32 SWGSDRangel::SWGDeviceListItem::device_stream_index
private

◆ direction

qint32 SWGSDRangel::SWGDeviceListItem::direction
private

◆ displayed_name

QString* SWGSDRangel::SWGDeviceListItem::displayed_name
private

◆ hw_type

QString* SWGSDRangel::SWGDeviceListItem::hw_type
private

◆ index

qint32 SWGSDRangel::SWGDeviceListItem::index
private

◆ m_device_nb_streams_isSet

bool SWGSDRangel::SWGDeviceListItem::m_device_nb_streams_isSet
private

Definition at line 92 of file SWGDeviceListItem.h.

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

◆ m_device_set_index_isSet

bool SWGSDRangel::SWGDeviceListItem::m_device_set_index_isSet
private

Definition at line 98 of file SWGDeviceListItem.h.

Referenced by asJsonObject(), init(), isSet(), setDeviceSetIndex(), and SWGDeviceListItem().

◆ m_device_stream_index_isSet

bool SWGSDRangel::SWGDeviceListItem::m_device_stream_index_isSet
private

◆ m_direction_isSet

bool SWGSDRangel::SWGDeviceListItem::m_direction_isSet
private

Definition at line 89 of file SWGDeviceListItem.h.

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

◆ m_displayed_name_isSet

bool SWGSDRangel::SWGDeviceListItem::m_displayed_name_isSet
private

Definition at line 77 of file SWGDeviceListItem.h.

Referenced by init(), setDisplayedName(), and SWGDeviceListItem().

◆ m_hw_type_isSet

bool SWGSDRangel::SWGDeviceListItem::m_hw_type_isSet
private

Definition at line 80 of file SWGDeviceListItem.h.

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

◆ m_index_isSet

bool SWGSDRangel::SWGDeviceListItem::m_index_isSet
private

Definition at line 101 of file SWGDeviceListItem.h.

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

◆ m_sequence_isSet

bool SWGSDRangel::SWGDeviceListItem::m_sequence_isSet
private

Definition at line 86 of file SWGDeviceListItem.h.

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

◆ m_serial_isSet

bool SWGSDRangel::SWGDeviceListItem::m_serial_isSet
private

Definition at line 83 of file SWGDeviceListItem.h.

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

◆ sequence

qint32 SWGSDRangel::SWGDeviceListItem::sequence
private

◆ serial

QString* SWGSDRangel::SWGDeviceListItem::serial
private

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