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.
Static Public Member Functions | List of all members
WebAPIAdapterBase Class Reference

#include <webapiadapterbase.h>

Static Public Member Functions

static void webapiFormatPreferences (SWGSDRangel::SWGPreferences *apiPreferences, const Preferences &preferences)
 
static void webapiFormatPreset (SWGSDRangel::SWGPreset *apiPreset, const Preset &preset)
 

Detailed Description

Adapter between API and objects in sdrbase library

Definition at line 31 of file webapiadapterbase.h.

Member Function Documentation

◆ webapiFormatPreferences()

void WebAPIAdapterBase::webapiFormatPreferences ( SWGSDRangel::SWGPreferences apiPreferences,
const Preferences preferences 
)
static

Definition at line 21 of file webapiadapterbase.cpp.

References SWGSDRangel::SWGPreferences::init(), Preferences::m_audioDevice, Preferences::m_audioType, Preferences::m_consoleMinLogLevel, Preferences::m_fileMinLogLevel, Preferences::m_latitude, Preferences::m_logFileName, Preferences::m_longitude, Preferences::m_sourceDevice, Preferences::m_sourceIndex, Preferences::m_useLogFile, SWGSDRangel::SWGPreferences::setAudioDevice(), SWGSDRangel::SWGPreferences::setAudioType(), SWGSDRangel::SWGPreferences::setConsoleMinLogLevel(), SWGSDRangel::SWGPreferences::setFileMinLogLevel(), SWGSDRangel::SWGPreferences::setLatitude(), SWGSDRangel::SWGPreferences::setLogFileName(), SWGSDRangel::SWGPreferences::setLongitude(), SWGSDRangel::SWGPreferences::setSourceDevice(), SWGSDRangel::SWGPreferences::setSourceIndex(), and SWGSDRangel::SWGPreferences::setUseLogFile().

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

25 {
26  apiPreferences->init();
27  apiPreferences->setSourceDevice(new QString(preferences.m_sourceDevice));
28  apiPreferences->setSourceIndex(preferences.m_sourceIndex);
29  apiPreferences->setAudioType(new QString(preferences.m_audioType));
30  apiPreferences->setAudioDevice(new QString(preferences.m_audioDevice));
31  apiPreferences->setLatitude(preferences.m_latitude);
32  apiPreferences->setLongitude(preferences.m_longitude);
33  apiPreferences->setConsoleMinLogLevel((int) preferences.m_consoleMinLogLevel);
34  apiPreferences->setUseLogFile(preferences.m_useLogFile ? 1 : 0);
35  apiPreferences->setLogFileName(new QString(preferences.m_logFileName));
36  apiPreferences->setFileMinLogLevel((int) preferences.m_fileMinLogLevel);
37 }
float m_longitude
Definition: preferences.h:50
void setLongitude(float longitude)
void setUseLogFile(qint32 use_log_file)
QtMsgType m_consoleMinLogLevel
Definition: preferences.h:52
bool m_useLogFile
Definition: preferences.h:54
void setFileMinLogLevel(qint32 file_min_log_level)
int m_sourceIndex
Index of the source used in R0 tab (GUI flavor) at startup.
Definition: preferences.h:44
void setSourceDevice(QString *source_device)
void setSourceIndex(qint32 source_index)
void setLogFileName(QString *log_file_name)
QString m_audioType
Definition: preferences.h:46
QString m_sourceDevice
Identification of the source used in R0 tab (GUI flavor) at startup.
Definition: preferences.h:43
void setConsoleMinLogLevel(qint32 console_min_log_level)
float m_latitude
Definition: preferences.h:49
QString m_audioDevice
Definition: preferences.h:47
void setAudioDevice(QString *audio_device)
QtMsgType m_fileMinLogLevel
Definition: preferences.h:53
QString m_logFileName
Definition: preferences.h:55
void setLatitude(float latitude)
void setAudioType(QString *audio_type)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ webapiFormatPreset()

void WebAPIAdapterBase::webapiFormatPreset ( SWGSDRangel::SWGPreset apiPreset,
const Preset preset 
)
static

Definition at line 39 of file webapiadapterbase.cpp.

References SWGSDRangel::SWGPreset::getMSpectrumConfig(), SWGSDRangel::SWGGLSpectrum::init(), SWGSDRangel::SWGPreset::init(), Preset::m_centerFrequency, Preset::m_dcOffsetCorrection, Preset::m_description, Preset::m_group, Preset::m_iqImbalanceCorrection, Preset::m_sourcePreset, SWGSDRangel::SWGPreset::setCenterFrequency(), SWGSDRangel::SWGPreset::setDcOffsetCorrection(), SWGSDRangel::SWGPreset::setDescription(), SWGSDRangel::SWGPreset::setGroup(), SWGSDRangel::SWGPreset::setIqImbalanceCorrection(), and SWGSDRangel::SWGPreset::setSourcePreset().

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

43 {
44  apiPreset->init();
45  apiPreset->setSourcePreset(preset.m_sourcePreset ? 1 : 0);
46  apiPreset->setGroup(new QString(preset.m_group));
47  apiPreset->setDescription(new QString(preset.m_description));
48  apiPreset->setCenterFrequency(preset.m_centerFrequency);
49  apiPreset->getMSpectrumConfig()->init(); // TODO when spectrum config is extracted to sdrbase
50  apiPreset->setDcOffsetCorrection(preset.m_dcOffsetCorrection ? 1 : 0);
51  apiPreset->setIqImbalanceCorrection(preset.m_iqImbalanceCorrection ? 1 : 0);
52  // TODO: channel configs
53  // TODO: device configs
54 }
void setDcOffsetCorrection(qint32 dc_offset_correction)
Definition: SWGPreset.cpp:251
quint64 m_centerFrequency
Definition: preset.h:127
void setSourcePreset(qint32 source_preset)
Definition: SWGPreset.cpp:201
bool m_sourcePreset
Definition: preset.h:122
void setIqImbalanceCorrection(qint32 iq_imbalance_correction)
Definition: SWGPreset.cpp:261
void setDescription(QString *description)
Definition: SWGPreset.cpp:221
void setGroup(QString *group)
Definition: SWGPreset.cpp:211
SWGGLSpectrum * getMSpectrumConfig()
Definition: SWGPreset.cpp:237
void setCenterFrequency(qint64 center_frequency)
Definition: SWGPreset.cpp:231
QString m_group
Definition: preset.h:125
QString m_description
Definition: preset.h:126
bool m_dcOffsetCorrection
Definition: preset.h:133
bool m_iqImbalanceCorrection
Definition: preset.h:134
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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