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 | List of all members
RemoteSourceSettings Struct Reference

#include <remotesourcesettings.h>

+ Collaboration diagram for RemoteSourceSettings:

Public Member Functions

 RemoteSourceSettings ()
 
void resetToDefaults ()
 
void setChannelMarker (Serializable *channelMarker)
 
QByteArray serialize () const
 
bool deserialize (const QByteArray &data)
 

Public Attributes

QString m_dataAddress
 Listening (local) data address. More...
 
uint16_t m_dataPort
 Listening data port. More...
 
quint32 m_rgbColor
 
QString m_title
 
bool m_useReverseAPI
 
QString m_reverseAPIAddress
 
uint16_t m_reverseAPIPort
 
uint16_t m_reverseAPIDeviceIndex
 
uint16_t m_reverseAPIChannelIndex
 
Serializablem_channelMarker
 

Detailed Description

Definition at line 26 of file remotesourcesettings.h.

Constructor & Destructor Documentation

◆ RemoteSourceSettings()

RemoteSourceSettings::RemoteSourceSettings ( )

Definition at line 26 of file remotesourcesettings.cpp.

References resetToDefaults().

27 {
29 }
+ Here is the call graph for this function:

Member Function Documentation

◆ deserialize()

bool RemoteSourceSettings::deserialize ( const QByteArray &  data)

Definition at line 61 of file remotesourcesettings.cpp.

References SimpleDeserializer::getVersion(), SimpleDeserializer::isValid(), m_dataAddress, m_dataPort, m_reverseAPIAddress, m_reverseAPIChannelIndex, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_rgbColor, m_title, m_useReverseAPI, SimpleDeserializer::readBool(), SimpleDeserializer::readString(), SimpleDeserializer::readU32(), and resetToDefaults().

Referenced by RemoteSourceGUI::deserialize(), RemoteSource::deserialize(), and setChannelMarker().

62 {
63  SimpleDeserializer d(data);
64 
65  if(!d.isValid())
66  {
68  return false;
69  }
70 
71  if(d.getVersion() == 1)
72  {
73  uint32_t tmp;
74  QString strtmp;
75 
76  d.readString(1, &m_dataAddress, "127.0.0.1");
77  d.readU32(2, &tmp, 0);
78 
79  if ((tmp > 1023) && (tmp < 65535)) {
80  m_dataPort = tmp;
81  } else {
82  m_dataPort = 9090;
83  }
84 
85  d.readU32(3, &m_rgbColor, QColor(0, 255, 255).rgb());
86  d.readString(4, &m_title, "Remote source");
87  d.readBool(5, &m_useReverseAPI, false);
88  d.readString(6, &m_reverseAPIAddress, "127.0.0.1");
89  d.readU32(7, &tmp, 0);
90 
91  if ((tmp > 1023) && (tmp < 65535)) {
92  m_reverseAPIPort = tmp;
93  } else {
94  m_reverseAPIPort = 8888;
95  }
96 
97  d.readU32(8, &tmp, 0);
98  m_reverseAPIDeviceIndex = tmp > 99 ? 99 : tmp;
99  d.readU32(9, &tmp, 0);
100  m_reverseAPIChannelIndex = tmp > 99 ? 99 : tmp;
101  return true;
102  }
103  else
104  {
105  resetToDefaults();
106  return false;
107  }
108 }
unsigned int uint32_t
Definition: rtptypes_win.h:46
uint16_t m_dataPort
Listening data port.
QString m_dataAddress
Listening (local) data address.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetToDefaults()

void RemoteSourceSettings::resetToDefaults ( )

Definition at line 31 of file remotesourcesettings.cpp.

References m_channelMarker, m_dataAddress, m_dataPort, m_reverseAPIAddress, m_reverseAPIChannelIndex, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_rgbColor, m_title, and m_useReverseAPI.

Referenced by deserialize(), RemoteSource::deserialize(), RemoteSourceSettings(), and RemoteSourceGUI::resetToDefaults().

32 {
33  m_dataAddress = "127.0.0.1";
34  m_dataPort = 9090;
35  m_rgbColor = QColor(140, 4, 4).rgb();
36  m_title = "Remote source";
37  m_channelMarker = nullptr;
38  m_useReverseAPI = false;
39  m_reverseAPIAddress = "127.0.0.1";
40  m_reverseAPIPort = 8888;
43 }
uint16_t m_dataPort
Listening data port.
QString m_dataAddress
Listening (local) data address.
Serializable * m_channelMarker
+ Here is the caller graph for this function:

◆ serialize()

QByteArray RemoteSourceSettings::serialize ( ) const

Definition at line 45 of file remotesourcesettings.cpp.

References SimpleSerializer::final(), m_dataAddress, m_dataPort, m_reverseAPIAddress, m_reverseAPIChannelIndex, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_rgbColor, m_title, m_useReverseAPI, SimpleSerializer::writeBool(), SimpleSerializer::writeString(), and SimpleSerializer::writeU32().

Referenced by RemoteSourceGUI::serialize(), RemoteSource::serialize(), and setChannelMarker().

46 {
47  SimpleSerializer s(1);
48  s.writeString(1, m_dataAddress);
49  s.writeU32(2, m_dataPort);
50  s.writeU32(3, m_rgbColor);
51  s.writeString(4, m_title);
52  s.writeBool(5, m_useReverseAPI);
53  s.writeString(6, m_reverseAPIAddress);
54  s.writeU32(7, m_reverseAPIPort);
55  s.writeU32(8, m_reverseAPIDeviceIndex);
56  s.writeU32(9, m_reverseAPIChannelIndex);
57 
58  return s.final();
59 }
uint16_t m_dataPort
Listening data port.
QString m_dataAddress
Listening (local) data address.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setChannelMarker()

void RemoteSourceSettings::setChannelMarker ( Serializable channelMarker)
inline

Definition at line 42 of file remotesourcesettings.h.

References deserialize(), and serialize().

Referenced by RemoteSourceGUI::RemoteSourceGUI().

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

Member Data Documentation

◆ m_channelMarker

Serializable* RemoteSourceSettings::m_channelMarker

Definition at line 38 of file remotesourcesettings.h.

Referenced by resetToDefaults().

◆ m_dataAddress

QString RemoteSourceSettings::m_dataAddress

◆ m_dataPort

uint16_t RemoteSourceSettings::m_dataPort

◆ m_reverseAPIAddress

QString RemoteSourceSettings::m_reverseAPIAddress

◆ m_reverseAPIChannelIndex

uint16_t RemoteSourceSettings::m_reverseAPIChannelIndex

◆ m_reverseAPIDeviceIndex

uint16_t RemoteSourceSettings::m_reverseAPIDeviceIndex

◆ m_reverseAPIPort

uint16_t RemoteSourceSettings::m_reverseAPIPort

◆ m_rgbColor

quint32 RemoteSourceSettings::m_rgbColor

◆ m_title

QString RemoteSourceSettings::m_title

◆ m_useReverseAPI

bool RemoteSourceSettings::m_useReverseAPI

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