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

#include <SWGCWKeyerSettings.h>

+ Inheritance diagram for SWGSDRangel::SWGCWKeyerSettings:
+ Collaboration diagram for SWGSDRangel::SWGCWKeyerSettings:

Public Member Functions

 SWGCWKeyerSettings ()
 
 SWGCWKeyerSettings (QString *json)
 
virtual ~SWGCWKeyerSettings ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGCWKeyerSettingsfromJson (QString &jsonString) override
 
qint32 getSampleRate ()
 
void setSampleRate (qint32 sample_rate)
 
qint32 getWpm ()
 
void setWpm (qint32 wpm)
 
qint32 getMode ()
 
void setMode (qint32 mode)
 
QString * getText ()
 
void setText (QString *text)
 
qint32 getLoop ()
 
void setLoop (qint32 loop)
 
qint32 getKeyboardIambic ()
 
void setKeyboardIambic (qint32 keyboard_iambic)
 
qint32 getDotKey ()
 
void setDotKey (qint32 dot_key)
 
qint32 getDotKeyModifiers ()
 
void setDotKeyModifiers (qint32 dot_key_modifiers)
 
qint32 getDashKey ()
 
void setDashKey (qint32 dash_key)
 
qint32 getDashKeyModifiers ()
 
void setDashKeyModifiers (qint32 dash_key_modifiers)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

qint32 sample_rate
 
bool m_sample_rate_isSet
 
qint32 wpm
 
bool m_wpm_isSet
 
qint32 mode
 
bool m_mode_isSet
 
QString * text
 
bool m_text_isSet
 
qint32 loop
 
bool m_loop_isSet
 
qint32 keyboard_iambic
 
bool m_keyboard_iambic_isSet
 
qint32 dot_key
 
bool m_dot_key_isSet
 
qint32 dot_key_modifiers
 
bool m_dot_key_modifiers_isSet
 
qint32 dash_key
 
bool m_dash_key_isSet
 
qint32 dash_key_modifiers
 
bool m_dash_key_modifiers_isSet
 

Detailed Description

Definition at line 32 of file SWGCWKeyerSettings.h.

Constructor & Destructor Documentation

◆ SWGCWKeyerSettings() [1/2]

SWGSDRangel::SWGCWKeyerSettings::SWGCWKeyerSettings ( )

Definition at line 30 of file SWGCWKeyerSettings.cpp.

References dash_key, dash_key_modifiers, dot_key, dot_key_modifiers, keyboard_iambic, loop, m_dash_key_isSet, m_dash_key_modifiers_isSet, m_dot_key_isSet, m_dot_key_modifiers_isSet, m_keyboard_iambic_isSet, m_loop_isSet, m_mode_isSet, m_sample_rate_isSet, m_text_isSet, m_wpm_isSet, mode, sample_rate, text, and wpm.

30  {
31  sample_rate = 0;
32  m_sample_rate_isSet = false;
33  wpm = 0;
34  m_wpm_isSet = false;
35  mode = 0;
36  m_mode_isSet = false;
37  text = nullptr;
38  m_text_isSet = false;
39  loop = 0;
40  m_loop_isSet = false;
41  keyboard_iambic = 0;
43  dot_key = 0;
44  m_dot_key_isSet = false;
47  dash_key = 0;
48  m_dash_key_isSet = false;
51 }

◆ SWGCWKeyerSettings() [2/2]

SWGSDRangel::SWGCWKeyerSettings::SWGCWKeyerSettings ( QString *  json)

Definition at line 25 of file SWGCWKeyerSettings.cpp.

References fromJson(), and init().

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

◆ ~SWGCWKeyerSettings()

SWGSDRangel::SWGCWKeyerSettings::~SWGCWKeyerSettings ( )
virtual

Definition at line 53 of file SWGCWKeyerSettings.cpp.

References cleanup().

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

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGCWKeyerSettings::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 131 of file SWGCWKeyerSettings.cpp.

References asJsonObject().

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

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 142 of file SWGCWKeyerSettings.cpp.

References dash_key, dash_key_modifiers, dot_key, dot_key_modifiers, keyboard_iambic, loop, m_dash_key_isSet, m_dash_key_modifiers_isSet, m_dot_key_isSet, m_dot_key_modifiers_isSet, m_keyboard_iambic_isSet, m_loop_isSet, m_mode_isSet, m_sample_rate_isSet, m_wpm_isSet, mode, sample_rate, text, SWGSDRangel::toJsonValue(), and wpm.

Referenced by asJson().

142  {
143  QJsonObject* obj = new QJsonObject();
145  obj->insert("sampleRate", QJsonValue(sample_rate));
146  }
147  if(m_wpm_isSet){
148  obj->insert("wpm", QJsonValue(wpm));
149  }
150  if(m_mode_isSet){
151  obj->insert("mode", QJsonValue(mode));
152  }
153  if(text != nullptr && *text != QString("")){
154  toJsonValue(QString("text"), text, obj, QString("QString"));
155  }
156  if(m_loop_isSet){
157  obj->insert("loop", QJsonValue(loop));
158  }
160  obj->insert("keyboardIambic", QJsonValue(keyboard_iambic));
161  }
162  if(m_dot_key_isSet){
163  obj->insert("dotKey", QJsonValue(dot_key));
164  }
166  obj->insert("dotKeyModifiers", QJsonValue(dot_key_modifiers));
167  }
168  if(m_dash_key_isSet){
169  obj->insert("dashKey", QJsonValue(dash_key));
170  }
172  obj->insert("dashKeyModifiers", QJsonValue(dash_key_modifiers));
173  }
174 
175  return obj;
176 }
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::SWGCWKeyerSettings::cleanup ( )

Definition at line 82 of file SWGCWKeyerSettings.cpp.

References text.

Referenced by ~SWGCWKeyerSettings().

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

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 98 of file SWGCWKeyerSettings.cpp.

References fromJsonObject().

Referenced by SWGCWKeyerSettings().

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 107 of file SWGCWKeyerSettings.cpp.

References dash_key, dash_key_modifiers, dot_key, dot_key_modifiers, keyboard_iambic, loop, mode, sample_rate, SWGSDRangel::setValue(), text, and wpm.

Referenced by fromJson().

107  {
108  ::SWGSDRangel::setValue(&sample_rate, pJson["sampleRate"], "qint32", "");
109 
110  ::SWGSDRangel::setValue(&wpm, pJson["wpm"], "qint32", "");
111 
112  ::SWGSDRangel::setValue(&mode, pJson["mode"], "qint32", "");
113 
114  ::SWGSDRangel::setValue(&text, pJson["text"], "QString", "QString");
115 
116  ::SWGSDRangel::setValue(&loop, pJson["loop"], "qint32", "");
117 
118  ::SWGSDRangel::setValue(&keyboard_iambic, pJson["keyboardIambic"], "qint32", "");
119 
120  ::SWGSDRangel::setValue(&dot_key, pJson["dotKey"], "qint32", "");
121 
122  ::SWGSDRangel::setValue(&dot_key_modifiers, pJson["dotKeyModifiers"], "qint32", "");
123 
124  ::SWGSDRangel::setValue(&dash_key, pJson["dashKey"], "qint32", "");
125 
126  ::SWGSDRangel::setValue(&dash_key_modifiers, pJson["dashKeyModifiers"], "qint32", "");
127 
128 }
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:

◆ getDashKey()

qint32 SWGSDRangel::SWGCWKeyerSettings::getDashKey ( )

Definition at line 259 of file SWGCWKeyerSettings.cpp.

References dash_key.

Referenced by CWKeyer::webapiSettingsPutPatch().

259  {
260  return dash_key;
261 }
+ Here is the caller graph for this function:

◆ getDashKeyModifiers()

qint32 SWGSDRangel::SWGCWKeyerSettings::getDashKeyModifiers ( )

Definition at line 269 of file SWGCWKeyerSettings.cpp.

References dash_key_modifiers.

Referenced by CWKeyer::webapiSettingsPutPatch().

269  {
270  return dash_key_modifiers;
271 }
+ Here is the caller graph for this function:

◆ getDotKey()

qint32 SWGSDRangel::SWGCWKeyerSettings::getDotKey ( )

Definition at line 239 of file SWGCWKeyerSettings.cpp.

References dot_key.

Referenced by CWKeyer::webapiSettingsPutPatch().

239  {
240  return dot_key;
241 }
+ Here is the caller graph for this function:

◆ getDotKeyModifiers()

qint32 SWGSDRangel::SWGCWKeyerSettings::getDotKeyModifiers ( )

Definition at line 249 of file SWGCWKeyerSettings.cpp.

References dot_key_modifiers.

Referenced by CWKeyer::webapiSettingsPutPatch().

249  {
250  return dot_key_modifiers;
251 }
+ Here is the caller graph for this function:

◆ getKeyboardIambic()

qint32 SWGSDRangel::SWGCWKeyerSettings::getKeyboardIambic ( )

Definition at line 229 of file SWGCWKeyerSettings.cpp.

References keyboard_iambic.

Referenced by CWKeyer::webapiSettingsPutPatch().

229  {
230  return keyboard_iambic;
231 }
+ Here is the caller graph for this function:

◆ getLoop()

qint32 SWGSDRangel::SWGCWKeyerSettings::getLoop ( )

Definition at line 219 of file SWGCWKeyerSettings.cpp.

References loop.

Referenced by CWKeyer::webapiSettingsPutPatch().

219  {
220  return loop;
221 }
+ Here is the caller graph for this function:

◆ getMode()

qint32 SWGSDRangel::SWGCWKeyerSettings::getMode ( )

Definition at line 199 of file SWGCWKeyerSettings.cpp.

References mode.

Referenced by CWKeyer::webapiSettingsPutPatch().

199  {
200  return mode;
201 }
+ Here is the caller graph for this function:

◆ getSampleRate()

qint32 SWGSDRangel::SWGCWKeyerSettings::getSampleRate ( )

Definition at line 179 of file SWGCWKeyerSettings.cpp.

References sample_rate.

Referenced by CWKeyer::webapiSettingsPutPatch().

179  {
180  return sample_rate;
181 }
+ Here is the caller graph for this function:

◆ getText()

QString * SWGSDRangel::SWGCWKeyerSettings::getText ( )

Definition at line 209 of file SWGCWKeyerSettings.cpp.

References text.

Referenced by CWKeyer::webapiFormatChannelSettings(), and CWKeyer::webapiSettingsPutPatch().

209  {
210  return text;
211 }
+ Here is the caller graph for this function:

◆ getWpm()

qint32 SWGSDRangel::SWGCWKeyerSettings::getWpm ( )

Definition at line 189 of file SWGCWKeyerSettings.cpp.

References wpm.

Referenced by CWKeyer::webapiSettingsPutPatch().

189  {
190  return wpm;
191 }
+ Here is the caller graph for this function:

◆ init()

void SWGSDRangel::SWGCWKeyerSettings::init ( )

Definition at line 58 of file SWGCWKeyerSettings.cpp.

References dash_key, dash_key_modifiers, dot_key, dot_key_modifiers, keyboard_iambic, loop, m_dash_key_isSet, m_dash_key_modifiers_isSet, m_dot_key_isSet, m_dot_key_modifiers_isSet, m_keyboard_iambic_isSet, m_loop_isSet, m_mode_isSet, m_sample_rate_isSet, m_text_isSet, m_wpm_isSet, mode, sample_rate, text, and wpm.

Referenced by SWGCWKeyerSettings().

58  {
59  sample_rate = 0;
60  m_sample_rate_isSet = false;
61  wpm = 0;
62  m_wpm_isSet = false;
63  mode = 0;
64  m_mode_isSet = false;
65  text = new QString("");
66  m_text_isSet = false;
67  loop = 0;
68  m_loop_isSet = false;
69  keyboard_iambic = 0;
71  dot_key = 0;
72  m_dot_key_isSet = false;
75  dash_key = 0;
76  m_dash_key_isSet = false;
79 }
+ Here is the caller graph for this function:

◆ isSet()

bool SWGSDRangel::SWGCWKeyerSettings::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 280 of file SWGCWKeyerSettings.cpp.

References m_dash_key_isSet, m_dash_key_modifiers_isSet, m_dot_key_isSet, m_dot_key_modifiers_isSet, m_keyboard_iambic_isSet, m_loop_isSet, m_mode_isSet, m_sample_rate_isSet, m_wpm_isSet, and text.

Referenced by SWGSDRangel::SWGAMModSettings::asJsonObject(), SWGSDRangel::SWGNFMModSettings::asJsonObject(), SWGSDRangel::SWGWFMModSettings::asJsonObject(), SWGSDRangel::SWGFreeDVModSettings::asJsonObject(), SWGSDRangel::SWGSSBModSettings::asJsonObject(), SWGSDRangel::SWGAMModSettings::isSet(), SWGSDRangel::SWGFreeDVModSettings::isSet(), SWGSDRangel::SWGWFMModSettings::isSet(), SWGSDRangel::SWGNFMModSettings::isSet(), and SWGSDRangel::SWGSSBModSettings::isSet().

280  {
281  bool isObjectUpdated = false;
282  do{
283  if(m_sample_rate_isSet){ isObjectUpdated = true; break;}
284  if(m_wpm_isSet){ isObjectUpdated = true; break;}
285  if(m_mode_isSet){ isObjectUpdated = true; break;}
286  if(text != nullptr && *text != QString("")){ isObjectUpdated = true; break;}
287  if(m_loop_isSet){ isObjectUpdated = true; break;}
288  if(m_keyboard_iambic_isSet){ isObjectUpdated = true; break;}
289  if(m_dot_key_isSet){ isObjectUpdated = true; break;}
290  if(m_dot_key_modifiers_isSet){ isObjectUpdated = true; break;}
291  if(m_dash_key_isSet){ isObjectUpdated = true; break;}
292  if(m_dash_key_modifiers_isSet){ isObjectUpdated = true; break;}
293  }while(false);
294  return isObjectUpdated;
295 }
+ Here is the caller graph for this function:

◆ setDashKey()

void SWGSDRangel::SWGCWKeyerSettings::setDashKey ( qint32  dash_key)

Definition at line 263 of file SWGCWKeyerSettings.cpp.

References dash_key, and m_dash_key_isSet.

Referenced by CWKeyer::webapiFormatChannelSettings().

263  {
264  this->dash_key = dash_key;
265  this->m_dash_key_isSet = true;
266 }
+ Here is the caller graph for this function:

◆ setDashKeyModifiers()

void SWGSDRangel::SWGCWKeyerSettings::setDashKeyModifiers ( qint32  dash_key_modifiers)

Definition at line 273 of file SWGCWKeyerSettings.cpp.

References dash_key_modifiers, and m_dash_key_modifiers_isSet.

Referenced by CWKeyer::webapiFormatChannelSettings().

+ Here is the caller graph for this function:

◆ setDotKey()

void SWGSDRangel::SWGCWKeyerSettings::setDotKey ( qint32  dot_key)

Definition at line 243 of file SWGCWKeyerSettings.cpp.

References dot_key, and m_dot_key_isSet.

Referenced by CWKeyer::webapiFormatChannelSettings().

243  {
244  this->dot_key = dot_key;
245  this->m_dot_key_isSet = true;
246 }
+ Here is the caller graph for this function:

◆ setDotKeyModifiers()

void SWGSDRangel::SWGCWKeyerSettings::setDotKeyModifiers ( qint32  dot_key_modifiers)

Definition at line 253 of file SWGCWKeyerSettings.cpp.

References dot_key_modifiers, and m_dot_key_modifiers_isSet.

Referenced by CWKeyer::webapiFormatChannelSettings().

+ Here is the caller graph for this function:

◆ setKeyboardIambic()

void SWGSDRangel::SWGCWKeyerSettings::setKeyboardIambic ( qint32  keyboard_iambic)

Definition at line 233 of file SWGCWKeyerSettings.cpp.

References keyboard_iambic, and m_keyboard_iambic_isSet.

Referenced by CWKeyer::webapiFormatChannelSettings().

+ Here is the caller graph for this function:

◆ setLoop()

void SWGSDRangel::SWGCWKeyerSettings::setLoop ( qint32  loop)

Definition at line 223 of file SWGCWKeyerSettings.cpp.

References loop, and m_loop_isSet.

Referenced by CWKeyer::webapiFormatChannelSettings().

223  {
224  this->loop = loop;
225  this->m_loop_isSet = true;
226 }
+ Here is the caller graph for this function:

◆ setMode()

void SWGSDRangel::SWGCWKeyerSettings::setMode ( qint32  mode)

Definition at line 203 of file SWGCWKeyerSettings.cpp.

References m_mode_isSet, and mode.

Referenced by CWKeyer::webapiFormatChannelSettings().

203  {
204  this->mode = mode;
205  this->m_mode_isSet = true;
206 }
+ Here is the caller graph for this function:

◆ setSampleRate()

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

Definition at line 183 of file SWGCWKeyerSettings.cpp.

References m_sample_rate_isSet, and sample_rate.

Referenced by CWKeyer::webapiFormatChannelSettings().

+ Here is the caller graph for this function:

◆ setText()

void SWGSDRangel::SWGCWKeyerSettings::setText ( QString *  text)

Definition at line 213 of file SWGCWKeyerSettings.cpp.

References m_text_isSet, and text.

Referenced by CWKeyer::webapiFormatChannelSettings().

213  {
214  this->text = text;
215  this->m_text_isSet = true;
216 }
+ Here is the caller graph for this function:

◆ setWpm()

void SWGSDRangel::SWGCWKeyerSettings::setWpm ( qint32  wpm)

Definition at line 193 of file SWGCWKeyerSettings.cpp.

References m_wpm_isSet, and wpm.

Referenced by CWKeyer::webapiFormatChannelSettings(), and NFMMod::webapiFormatChannelSettings().

193  {
194  this->wpm = wpm;
195  this->m_wpm_isSet = true;
196 }
+ Here is the caller graph for this function:

Member Data Documentation

◆ dash_key

qint32 SWGSDRangel::SWGCWKeyerSettings::dash_key
private

◆ dash_key_modifiers

qint32 SWGSDRangel::SWGCWKeyerSettings::dash_key_modifiers
private

◆ dot_key

qint32 SWGSDRangel::SWGCWKeyerSettings::dot_key
private

◆ dot_key_modifiers

qint32 SWGSDRangel::SWGCWKeyerSettings::dot_key_modifiers
private

◆ keyboard_iambic

qint32 SWGSDRangel::SWGCWKeyerSettings::keyboard_iambic
private

◆ loop

qint32 SWGSDRangel::SWGCWKeyerSettings::loop
private

◆ m_dash_key_isSet

bool SWGSDRangel::SWGCWKeyerSettings::m_dash_key_isSet
private

Definition at line 104 of file SWGCWKeyerSettings.h.

Referenced by asJsonObject(), init(), isSet(), setDashKey(), and SWGCWKeyerSettings().

◆ m_dash_key_modifiers_isSet

bool SWGSDRangel::SWGCWKeyerSettings::m_dash_key_modifiers_isSet
private

◆ m_dot_key_isSet

bool SWGSDRangel::SWGCWKeyerSettings::m_dot_key_isSet
private

Definition at line 98 of file SWGCWKeyerSettings.h.

Referenced by asJsonObject(), init(), isSet(), setDotKey(), and SWGCWKeyerSettings().

◆ m_dot_key_modifiers_isSet

bool SWGSDRangel::SWGCWKeyerSettings::m_dot_key_modifiers_isSet
private

◆ m_keyboard_iambic_isSet

bool SWGSDRangel::SWGCWKeyerSettings::m_keyboard_iambic_isSet
private

Definition at line 95 of file SWGCWKeyerSettings.h.

Referenced by asJsonObject(), init(), isSet(), setKeyboardIambic(), and SWGCWKeyerSettings().

◆ m_loop_isSet

bool SWGSDRangel::SWGCWKeyerSettings::m_loop_isSet
private

Definition at line 92 of file SWGCWKeyerSettings.h.

Referenced by asJsonObject(), init(), isSet(), setLoop(), and SWGCWKeyerSettings().

◆ m_mode_isSet

bool SWGSDRangel::SWGCWKeyerSettings::m_mode_isSet
private

Definition at line 86 of file SWGCWKeyerSettings.h.

Referenced by asJsonObject(), init(), isSet(), setMode(), and SWGCWKeyerSettings().

◆ m_sample_rate_isSet

bool SWGSDRangel::SWGCWKeyerSettings::m_sample_rate_isSet
private

Definition at line 80 of file SWGCWKeyerSettings.h.

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

◆ m_text_isSet

bool SWGSDRangel::SWGCWKeyerSettings::m_text_isSet
private

Definition at line 89 of file SWGCWKeyerSettings.h.

Referenced by init(), setText(), and SWGCWKeyerSettings().

◆ m_wpm_isSet

bool SWGSDRangel::SWGCWKeyerSettings::m_wpm_isSet
private

Definition at line 83 of file SWGCWKeyerSettings.h.

Referenced by asJsonObject(), init(), isSet(), setWpm(), and SWGCWKeyerSettings().

◆ mode

qint32 SWGSDRangel::SWGCWKeyerSettings::mode
private

◆ sample_rate

qint32 SWGSDRangel::SWGCWKeyerSettings::sample_rate
private

◆ text

QString* SWGSDRangel::SWGCWKeyerSettings::text
private

◆ wpm

qint32 SWGSDRangel::SWGCWKeyerSettings::wpm
private

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