mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-09-05 14:47:50 -04:00
Web API: /sdrangel/deviceset/{deviceSetIndex}/channel/{channelIndex}/settings GET for NFM demod and mod
This commit is contained in:
parent
0667c5b479
commit
2dd82e9eca
@ -1,5 +1,7 @@
|
|||||||
project(nfm)
|
project(nfm)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||||
|
|
||||||
set(nfm_SOURCES
|
set(nfm_SOURCES
|
||||||
nfmdemod.cpp
|
nfmdemod.cpp
|
||||||
nfmdemodgui.cpp
|
nfmdemodgui.cpp
|
||||||
@ -21,6 +23,7 @@ set(nfm_FORMS
|
|||||||
include_directories(
|
include_directories(
|
||||||
.
|
.
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
|
||||||
)
|
)
|
||||||
|
|
||||||
#include(${QT_USE_FILE})
|
#include(${QT_USE_FILE})
|
||||||
@ -41,6 +44,7 @@ target_link_libraries(demodnfm
|
|||||||
${QT_LIBRARIES}
|
${QT_LIBRARIES}
|
||||||
sdrbase
|
sdrbase
|
||||||
sdrgui
|
sdrgui
|
||||||
|
swagger
|
||||||
)
|
)
|
||||||
|
|
||||||
qt5_use_modules(demodnfm Core Widgets)
|
qt5_use_modules(demodnfm Core Widgets)
|
||||||
|
@ -20,6 +20,7 @@ QMAKE_CXXFLAGS += -std=c++11
|
|||||||
INCLUDEPATH += $$PWD
|
INCLUDEPATH += $$PWD
|
||||||
INCLUDEPATH += ../../../sdrbase
|
INCLUDEPATH += ../../../sdrbase
|
||||||
INCLUDEPATH += ../../../sdrgui
|
INCLUDEPATH += ../../../sdrgui
|
||||||
|
INCLUDEPATH += ../../../swagger/sdrangel/code/qt5/client
|
||||||
|
|
||||||
CONFIG(Release):build_subdir = release
|
CONFIG(Release):build_subdir = release
|
||||||
CONFIG(Debug):build_subdir = debug
|
CONFIG(Debug):build_subdir = debug
|
||||||
@ -38,5 +39,6 @@ FORMS += nfmdemodgui.ui
|
|||||||
|
|
||||||
LIBS += -L../../../sdrbase/$${build_subdir} -lsdrbase
|
LIBS += -L../../../sdrbase/$${build_subdir} -lsdrbase
|
||||||
LIBS += -L../../../sdrgui/$${build_subdir} -lsdrgui
|
LIBS += -L../../../sdrgui/$${build_subdir} -lsdrgui
|
||||||
|
LIBS += -L../../../swagger/$${build_subdir} -lswagger
|
||||||
|
|
||||||
RESOURCES = ../../../sdrgui/resources/res.qrc
|
RESOURCES = ../../../sdrgui/resources/res.qrc
|
||||||
|
@ -20,6 +20,9 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <complex.h>
|
#include <complex.h>
|
||||||
|
|
||||||
|
#include "SWGChannelSettings.h"
|
||||||
|
#include "SWGNFMDemodSettings.h"
|
||||||
|
|
||||||
#include <dsp/downchannelizer.h>
|
#include <dsp/downchannelizer.h>
|
||||||
#include "util/stepfunctions.h"
|
#include "util/stepfunctions.h"
|
||||||
#include "audio/audiooutput.h"
|
#include "audio/audiooutput.h"
|
||||||
@ -451,3 +454,29 @@ void NFMDemod::applySettings(const NFMDemodSettings& settings, bool force)
|
|||||||
|
|
||||||
m_settings = settings;
|
m_settings = settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int NFMDemod::webapiSettingsGet(
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage __attribute__((unused)))
|
||||||
|
{
|
||||||
|
response.setNfmDemodSettings(new SWGSDRangel::SWGNFMDemodSettings());
|
||||||
|
response.getNfmDemodSettings()->setAfBandwidth(m_settings.m_afBandwidth);
|
||||||
|
response.getNfmDemodSettings()->setAudioMute(m_settings.m_audioMute ? 1 : 0);
|
||||||
|
response.getNfmDemodSettings()->setAudioSampleRate(m_settings.m_audioSampleRate);
|
||||||
|
response.getNfmDemodSettings()->setCopyAudioToUdp(m_settings.m_copyAudioToUDP ? 1 : 0);
|
||||||
|
response.getNfmDemodSettings()->setCtcssIndex(m_settings.m_ctcssIndex);
|
||||||
|
response.getNfmDemodSettings()->setCtcssOn(m_settings.m_ctcssOn ? 1 : 0);
|
||||||
|
response.getNfmDemodSettings()->setDeltaSquelch(m_settings.m_deltaSquelch ? 1 : 0);
|
||||||
|
response.getNfmDemodSettings()->setFmDeviation(m_settings.m_fmDeviation);
|
||||||
|
response.getNfmDemodSettings()->setInputFrequencyOffset(m_settings.m_inputFrequencyOffset);
|
||||||
|
response.getNfmDemodSettings()->setInputSampleRate(m_settings.m_inputSampleRate);
|
||||||
|
response.getNfmDemodSettings()->setRfBandwidth(m_settings.m_rfBandwidth);
|
||||||
|
response.getNfmDemodSettings()->setRgbColor(m_settings.m_rgbColor);
|
||||||
|
response.getNfmDemodSettings()->setSquelch(m_settings.m_squelch);
|
||||||
|
response.getNfmDemodSettings()->setSquelchGate(m_settings.m_squelchGate);
|
||||||
|
*response.getNfmDemodSettings()->getTitle() = m_settings.m_title;
|
||||||
|
*response.getNfmDemodSettings()->getUdpAddress() = m_settings.m_udpAddress;
|
||||||
|
response.getNfmDemodSettings()->setUdpPort(m_settings.m_udpPort);
|
||||||
|
response.getNfmDemodSettings()->setVolume(m_settings.m_volume);
|
||||||
|
return 200;
|
||||||
|
}
|
||||||
|
@ -121,6 +121,10 @@ public:
|
|||||||
virtual void getIdentifier(QString& id) { id = objectName(); }
|
virtual void getIdentifier(QString& id) { id = objectName(); }
|
||||||
virtual void getTitle(QString& title) { title = m_settings.m_title; }
|
virtual void getTitle(QString& title) { title = m_settings.m_title; }
|
||||||
|
|
||||||
|
virtual int webapiSettingsGet(
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage);
|
||||||
|
|
||||||
const Real *getCtcssToneSet(int& nbTones) const {
|
const Real *getCtcssToneSet(int& nbTones) const {
|
||||||
nbTones = m_ctcssDetector.getNTones();
|
nbTones = m_ctcssDetector.getNTones();
|
||||||
return m_ctcssDetector.getToneSet();
|
return m_ctcssDetector.getToneSet();
|
||||||
|
@ -70,7 +70,7 @@ AMMod::AMMod(DeviceSinkAPI *deviceAPI) :
|
|||||||
// CW keyer
|
// CW keyer
|
||||||
m_cwKeyer.setSampleRate(m_settings.m_audioSampleRate);
|
m_cwKeyer.setSampleRate(m_settings.m_audioSampleRate);
|
||||||
m_cwKeyer.setWPM(13);
|
m_cwKeyer.setWPM(13);
|
||||||
m_cwKeyer.setMode(CWKeyer::CWNone);
|
m_cwKeyer.setMode(CWKeyerSettings::CWNone);
|
||||||
|
|
||||||
m_channelizer = new UpChannelizer(this);
|
m_channelizer = new UpChannelizer(this);
|
||||||
m_threadedChannelizer = new ThreadedBasebandSampleSource(m_channelizer, this);
|
m_threadedChannelizer = new ThreadedBasebandSampleSource(m_channelizer, this);
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
project(modnfm)
|
project(modnfm)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||||
|
|
||||||
set(modnfm_SOURCES
|
set(modnfm_SOURCES
|
||||||
nfmmod.cpp
|
nfmmod.cpp
|
||||||
nfmmodgui.cpp
|
nfmmodgui.cpp
|
||||||
@ -21,6 +23,7 @@ set(modnfm_FORMS
|
|||||||
include_directories(
|
include_directories(
|
||||||
.
|
.
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
|
||||||
)
|
)
|
||||||
|
|
||||||
add_definitions(${QT_DEFINITIONS})
|
add_definitions(${QT_DEFINITIONS})
|
||||||
@ -39,6 +42,7 @@ target_link_libraries(modnfm
|
|||||||
${QT_LIBRARIES}
|
${QT_LIBRARIES}
|
||||||
sdrbase
|
sdrbase
|
||||||
sdrgui
|
sdrgui
|
||||||
|
swagger
|
||||||
)
|
)
|
||||||
|
|
||||||
qt5_use_modules(modnfm Core Widgets)
|
qt5_use_modules(modnfm Core Widgets)
|
||||||
|
@ -20,6 +20,7 @@ QMAKE_CXXFLAGS += -std=c++11
|
|||||||
INCLUDEPATH += $$PWD
|
INCLUDEPATH += $$PWD
|
||||||
INCLUDEPATH += ../../../sdrbase
|
INCLUDEPATH += ../../../sdrbase
|
||||||
INCLUDEPATH += ../../../sdrgui
|
INCLUDEPATH += ../../../sdrgui
|
||||||
|
INCLUDEPATH += ../../../swagger/sdrangel/code/qt5/client
|
||||||
|
|
||||||
CONFIG(Release):build_subdir = release
|
CONFIG(Release):build_subdir = release
|
||||||
CONFIG(Debug):build_subdir = debug
|
CONFIG(Debug):build_subdir = debug
|
||||||
@ -38,5 +39,6 @@ FORMS += nfmmodgui.ui
|
|||||||
|
|
||||||
LIBS += -L../../../sdrbase/$${build_subdir} -lsdrbase
|
LIBS += -L../../../sdrbase/$${build_subdir} -lsdrbase
|
||||||
LIBS += -L../../../sdrgui/$${build_subdir} -lsdrgui
|
LIBS += -L../../../sdrgui/$${build_subdir} -lsdrgui
|
||||||
|
LIBS += -L../../../swagger/$${build_subdir} -lswagger
|
||||||
|
|
||||||
RESOURCES = ../../../sdrgui/resources/res.qrc
|
RESOURCES = ../../../sdrgui/resources/res.qrc
|
||||||
|
@ -18,6 +18,9 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QMutexLocker>
|
#include <QMutexLocker>
|
||||||
|
|
||||||
|
#include "SWGChannelSettings.h"
|
||||||
|
#include "SWGCWKeyerSettings.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <complex.h>
|
#include <complex.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@ -75,7 +78,7 @@ NFMMod::NFMMod(DeviceSinkAPI *deviceAPI) :
|
|||||||
// CW keyer
|
// CW keyer
|
||||||
m_cwKeyer.setSampleRate(m_settings.m_audioSampleRate);
|
m_cwKeyer.setSampleRate(m_settings.m_audioSampleRate);
|
||||||
m_cwKeyer.setWPM(13);
|
m_cwKeyer.setWPM(13);
|
||||||
m_cwKeyer.setMode(CWKeyer::CWNone);
|
m_cwKeyer.setMode(CWKeyerSettings::CWNone);
|
||||||
|
|
||||||
m_channelizer = new UpChannelizer(this);
|
m_channelizer = new UpChannelizer(this);
|
||||||
m_threadedChannelizer = new ThreadedBasebandSampleSource(m_channelizer, this);
|
m_threadedChannelizer = new ThreadedBasebandSampleSource(m_channelizer, this);
|
||||||
@ -467,3 +470,32 @@ void NFMMod::applySettings(const NFMModSettings& settings, bool force)
|
|||||||
m_settings = settings;
|
m_settings = settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int NFMMod::webapiSettingsGet(
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage __attribute__((unused)))
|
||||||
|
{
|
||||||
|
response.setNfmModSettings(new SWGSDRangel::SWGNFMModSettings());
|
||||||
|
response.getNfmModSettings()->setAfBandwidth(m_settings.m_afBandwidth);
|
||||||
|
response.getNfmModSettings()->setAudioSampleRate(m_settings.m_audioSampleRate);
|
||||||
|
response.getNfmModSettings()->setBasebandSampleRate(m_settings.m_basebandSampleRate);
|
||||||
|
response.getNfmModSettings()->setChannelMute(m_settings.m_channelMute ? 1 : 0);
|
||||||
|
response.getNfmModSettings()->setCtcssIndex(m_settings.m_ctcssIndex);
|
||||||
|
response.getNfmModSettings()->setCtcssOn(m_settings.m_ctcssOn ? 1 : 0);
|
||||||
|
response.getNfmModSettings()->setFmDeviation(m_settings.m_fmDeviation);
|
||||||
|
response.getNfmModSettings()->setInputFrequencyOffset(m_settings.m_inputFrequencyOffset);
|
||||||
|
response.getNfmModSettings()->setOutputSampleRate(m_settings.m_outputSampleRate);
|
||||||
|
response.getNfmModSettings()->setPlayLoop(m_settings.m_playLoop ? 1 : 0);
|
||||||
|
response.getNfmModSettings()->setRfBandwidth(m_settings.m_rfBandwidth);
|
||||||
|
response.getNfmModSettings()->setRgbColor(m_settings.m_rgbColor);
|
||||||
|
*response.getNfmModSettings()->getTitle() = m_settings.m_title;
|
||||||
|
response.getNfmModSettings()->setToneFrequency(m_settings.m_toneFrequency);
|
||||||
|
response.getNfmModSettings()->setVolumeFactor(m_settings.m_volumeFactor);
|
||||||
|
SWGSDRangel::SWGCWKeyerSettings *apiCwKeyerSettings = response.getNfmModSettings()->getCwKeyer();
|
||||||
|
const CWKeyerSettings& cwKeyerSettings = m_cwKeyer.getSettings();
|
||||||
|
apiCwKeyerSettings->setLoop(cwKeyerSettings.m_loop ? 1 : 0);
|
||||||
|
apiCwKeyerSettings->setMode((int) cwKeyerSettings.m_mode);
|
||||||
|
apiCwKeyerSettings->setSampleRate(cwKeyerSettings.m_sampleRate);
|
||||||
|
apiCwKeyerSettings->setText(new QString(cwKeyerSettings.m_text));
|
||||||
|
apiCwKeyerSettings->setWpm(cwKeyerSettings.m_wpm);
|
||||||
|
return 200;
|
||||||
|
}
|
||||||
|
@ -241,6 +241,10 @@ public:
|
|||||||
virtual void getIdentifier(QString& id) { id = objectName(); }
|
virtual void getIdentifier(QString& id) { id = objectName(); }
|
||||||
virtual void getTitle(QString& title) { title = m_settings.m_title; }
|
virtual void getTitle(QString& title) { title = m_settings.m_title; }
|
||||||
|
|
||||||
|
virtual int webapiSettingsGet(
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
QString& errorMessage);
|
||||||
|
|
||||||
double getMagSq() const { return m_magsq; }
|
double getMagSq() const { return m_magsq; }
|
||||||
|
|
||||||
CWKeyer *getCWKeyer() { return &m_cwKeyer; }
|
CWKeyer *getCWKeyer() { return &m_cwKeyer; }
|
||||||
|
@ -90,7 +90,7 @@ SSBMod::SSBMod(DeviceSinkAPI *deviceAPI) :
|
|||||||
// CW keyer
|
// CW keyer
|
||||||
m_cwKeyer.setSampleRate(m_settings.m_audioSampleRate);
|
m_cwKeyer.setSampleRate(m_settings.m_audioSampleRate);
|
||||||
m_cwKeyer.setWPM(13);
|
m_cwKeyer.setWPM(13);
|
||||||
m_cwKeyer.setMode(CWKeyer::CWNone);
|
m_cwKeyer.setMode(CWKeyerSettings::CWNone);
|
||||||
|
|
||||||
m_inAGC.setGate(m_settings.m_agcThresholdGate);
|
m_inAGC.setGate(m_settings.m_agcThresholdGate);
|
||||||
m_inAGC.setStepDownDelay(m_settings.m_agcThresholdDelay);
|
m_inAGC.setStepDownDelay(m_settings.m_agcThresholdDelay);
|
||||||
|
@ -80,7 +80,7 @@ WFMMod::WFMMod(DeviceSinkAPI *deviceAPI) :
|
|||||||
// CW keyer
|
// CW keyer
|
||||||
m_cwKeyer.setSampleRate(m_settings.m_outputSampleRate);
|
m_cwKeyer.setSampleRate(m_settings.m_outputSampleRate);
|
||||||
m_cwKeyer.setWPM(13);
|
m_cwKeyer.setWPM(13);
|
||||||
m_cwKeyer.setMode(CWKeyer::CWNone);
|
m_cwKeyer.setMode(CWKeyerSettings::CWNone);
|
||||||
m_cwKeyer.reset();
|
m_cwKeyer.reset();
|
||||||
|
|
||||||
m_channelizer = new UpChannelizer(this);
|
m_channelizer = new UpChannelizer(this);
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
#include "util/simpleserializer.h"
|
#include "util/simpleserializer.h"
|
||||||
#include "dsp/dspcommands.h"
|
#include "dsp/dspcommands.h"
|
||||||
|
#include "dsp/dspengine.h"
|
||||||
#include "device/devicesinkapi.h"
|
#include "device/devicesinkapi.h"
|
||||||
#include "device/devicesourceapi.h"
|
#include "device/devicesourceapi.h"
|
||||||
#include "bladerf/devicebladerfshared.h"
|
#include "bladerf/devicebladerfshared.h"
|
||||||
@ -490,6 +491,7 @@ int BladerfOutput::webapiRun(
|
|||||||
if (m_deviceAPI->initGeneration())
|
if (m_deviceAPI->initGeneration())
|
||||||
{
|
{
|
||||||
m_deviceAPI->startGeneration();
|
m_deviceAPI->startGeneration();
|
||||||
|
DSPEngine::instance()->startAudioInputImmediate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -16,6 +16,7 @@ set(sdrbase_SOURCES
|
|||||||
dsp/channelmarker.cpp
|
dsp/channelmarker.cpp
|
||||||
dsp/ctcssdetector.cpp
|
dsp/ctcssdetector.cpp
|
||||||
dsp/cwkeyer.cpp
|
dsp/cwkeyer.cpp
|
||||||
|
dsp/cwkeyersettings.cpp
|
||||||
dsp/dspcommands.cpp
|
dsp/dspcommands.cpp
|
||||||
dsp/dspengine.cpp
|
dsp/dspengine.cpp
|
||||||
dsp/dspdevicesourceengine.cpp
|
dsp/dspdevicesourceengine.cpp
|
||||||
@ -91,6 +92,7 @@ set(sdrbase_HEADERS
|
|||||||
dsp/channelmarker.h
|
dsp/channelmarker.h
|
||||||
dsp/complex.h
|
dsp/complex.h
|
||||||
dsp/cwkeyer.h
|
dsp/cwkeyer.h
|
||||||
|
dsp/cwkeyersettings.h
|
||||||
dsp/decimators.h
|
dsp/decimators.h
|
||||||
dsp/interpolators.h
|
dsp/interpolators.h
|
||||||
dsp/dspcommands.h
|
dsp/dspcommands.h
|
||||||
|
@ -24,6 +24,11 @@
|
|||||||
|
|
||||||
#include "util/export.h"
|
#include "util/export.h"
|
||||||
|
|
||||||
|
namespace SWGSDRangel
|
||||||
|
{
|
||||||
|
class SWGChannelSettings;
|
||||||
|
}
|
||||||
|
|
||||||
class SDRANGEL_API ChannelSinkAPI {
|
class SDRANGEL_API ChannelSinkAPI {
|
||||||
public:
|
public:
|
||||||
ChannelSinkAPI();
|
ChannelSinkAPI();
|
||||||
@ -33,6 +38,11 @@ public:
|
|||||||
virtual void getIdentifier(QString& id) = 0;
|
virtual void getIdentifier(QString& id) = 0;
|
||||||
virtual void getTitle(QString& title) = 0;
|
virtual void getTitle(QString& title) = 0;
|
||||||
|
|
||||||
|
virtual int webapiSettingsGet(
|
||||||
|
SWGSDRangel::SWGChannelSettings& response __attribute__((unused)),
|
||||||
|
QString& errorMessage)
|
||||||
|
{ errorMessage = "Not implemented"; return 501; }
|
||||||
|
|
||||||
int getIndexInDeviceSet() const { return m_indexInDeviceSet; }
|
int getIndexInDeviceSet() const { return m_indexInDeviceSet; }
|
||||||
void setIndexInDeviceSet(int indexInDeviceSet) { m_indexInDeviceSet = indexInDeviceSet; }
|
void setIndexInDeviceSet(int indexInDeviceSet) { m_indexInDeviceSet = indexInDeviceSet; }
|
||||||
uint64_t getUID() const { return m_uid; }
|
uint64_t getUID() const { return m_uid; }
|
||||||
|
@ -24,6 +24,11 @@
|
|||||||
|
|
||||||
#include "util/export.h"
|
#include "util/export.h"
|
||||||
|
|
||||||
|
namespace SWGSDRangel
|
||||||
|
{
|
||||||
|
class SWGChannelSettings;
|
||||||
|
}
|
||||||
|
|
||||||
class SDRANGEL_API ChannelSourceAPI {
|
class SDRANGEL_API ChannelSourceAPI {
|
||||||
public:
|
public:
|
||||||
ChannelSourceAPI();
|
ChannelSourceAPI();
|
||||||
@ -33,6 +38,11 @@ public:
|
|||||||
virtual void getIdentifier(QString& id) = 0;
|
virtual void getIdentifier(QString& id) = 0;
|
||||||
virtual void getTitle(QString& title) = 0;
|
virtual void getTitle(QString& title) = 0;
|
||||||
|
|
||||||
|
virtual int webapiSettingsGet(
|
||||||
|
SWGSDRangel::SWGChannelSettings& response __attribute__((unused)),
|
||||||
|
QString& errorMessage)
|
||||||
|
{ errorMessage = "Not implemented"; return 501; }
|
||||||
|
|
||||||
int getIndexInDeviceSet() const { return m_indexInDeviceSet; }
|
int getIndexInDeviceSet() const { return m_indexInDeviceSet; }
|
||||||
void setIndexInDeviceSet(int indexInDeviceSet) { m_indexInDeviceSet = indexInDeviceSet; }
|
void setIndexInDeviceSet(int indexInDeviceSet) { m_indexInDeviceSet = indexInDeviceSet; }
|
||||||
uint64_t getUID() const { return m_uid; }
|
uint64_t getUID() const { return m_uid; }
|
||||||
|
@ -159,7 +159,6 @@ const signed char CWKeyer::m_asciiToMorse[128][7] = {
|
|||||||
|
|
||||||
CWKeyer::CWKeyer() :
|
CWKeyer::CWKeyer() :
|
||||||
m_mutex(QMutex::Recursive),
|
m_mutex(QMutex::Recursive),
|
||||||
m_sampleRate(48000),
|
|
||||||
m_textPointer(0),
|
m_textPointer(0),
|
||||||
m_elementPointer(0),
|
m_elementPointer(0),
|
||||||
m_samplePointer(0),
|
m_samplePointer(0),
|
||||||
@ -169,9 +168,7 @@ CWKeyer::CWKeyer() :
|
|||||||
m_dot(false),
|
m_dot(false),
|
||||||
m_dash(false),
|
m_dash(false),
|
||||||
m_elementOn(false),
|
m_elementOn(false),
|
||||||
m_loop(false),
|
|
||||||
m_asciiChar('\0'),
|
m_asciiChar('\0'),
|
||||||
m_mode(CWNone),
|
|
||||||
m_keyIambicState(KeySilent),
|
m_keyIambicState(KeySilent),
|
||||||
m_textState(TextStart)
|
m_textState(TextStart)
|
||||||
{
|
{
|
||||||
@ -185,9 +182,9 @@ CWKeyer::~CWKeyer()
|
|||||||
void CWKeyer::setSampleRate(int sampleRate)
|
void CWKeyer::setSampleRate(int sampleRate)
|
||||||
{
|
{
|
||||||
m_mutex.lock();
|
m_mutex.lock();
|
||||||
m_sampleRate = sampleRate;
|
m_settings.m_sampleRate = sampleRate;
|
||||||
m_mutex.unlock();
|
m_mutex.unlock();
|
||||||
setWPM(m_wpm);
|
setWPM(m_settings.m_wpm);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CWKeyer::setWPM(int wpm)
|
void CWKeyer::setWPM(int wpm)
|
||||||
@ -195,8 +192,8 @@ void CWKeyer::setWPM(int wpm)
|
|||||||
if ((wpm > 0) && (wpm < 27))
|
if ((wpm > 0) && (wpm < 27))
|
||||||
{
|
{
|
||||||
QMutexLocker mutexLocker(&m_mutex);
|
QMutexLocker mutexLocker(&m_mutex);
|
||||||
m_dotLength = (int) (0.24f * m_sampleRate * (5.0f / wpm));
|
m_dotLength = (int) (0.24f * m_settings.m_sampleRate * (5.0f / wpm));
|
||||||
m_wpm = wpm;
|
m_settings.m_wpm = wpm;
|
||||||
m_cwSmoother.setNbFadeSamples(m_dotLength/5); // 20% the dot time
|
m_cwSmoother.setNbFadeSamples(m_dotLength/5); // 20% the dot time
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -204,34 +201,34 @@ void CWKeyer::setWPM(int wpm)
|
|||||||
void CWKeyer::setText(const QString& text)
|
void CWKeyer::setText(const QString& text)
|
||||||
{
|
{
|
||||||
QMutexLocker mutexLocker(&m_mutex);
|
QMutexLocker mutexLocker(&m_mutex);
|
||||||
m_text = text;
|
m_settings.m_text = text;
|
||||||
m_textState = TextStart;
|
m_textState = TextStart;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CWKeyer::setMode(CWMode mode)
|
void CWKeyer::setMode(CWKeyerSettings::CWMode mode)
|
||||||
{
|
{
|
||||||
if (mode != m_mode)
|
if (mode != m_settings.m_mode)
|
||||||
{
|
{
|
||||||
QMutexLocker mutexLocker(&m_mutex);
|
QMutexLocker mutexLocker(&m_mutex);
|
||||||
|
|
||||||
if (mode == CWText)
|
if (mode == CWKeyerSettings::CWText)
|
||||||
{
|
{
|
||||||
m_textState = TextStart;
|
m_textState = TextStart;
|
||||||
}
|
}
|
||||||
else if (mode == CWDots)
|
else if (mode == CWKeyerSettings::CWDots)
|
||||||
{
|
{
|
||||||
m_dot = true;
|
m_dot = true;
|
||||||
m_dash = false;
|
m_dash = false;
|
||||||
m_keyIambicState = KeySilent;
|
m_keyIambicState = KeySilent;
|
||||||
}
|
}
|
||||||
else if (mode == CWDashes)
|
else if (mode == CWKeyerSettings::CWDashes)
|
||||||
{
|
{
|
||||||
m_dot = false;
|
m_dot = false;
|
||||||
m_dash = true;
|
m_dash = true;
|
||||||
m_keyIambicState = KeySilent;
|
m_keyIambicState = KeySilent;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_mode = mode;
|
m_settings.m_mode = mode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -239,12 +236,12 @@ int CWKeyer::getSample()
|
|||||||
{
|
{
|
||||||
QMutexLocker mutexLocker(&m_mutex);
|
QMutexLocker mutexLocker(&m_mutex);
|
||||||
|
|
||||||
if (m_mode == CWText)
|
if (m_settings.m_mode == CWKeyerSettings::CWText)
|
||||||
{
|
{
|
||||||
nextStateText();
|
nextStateText();
|
||||||
return m_key ? 1 : 0;
|
return m_key ? 1 : 0;
|
||||||
}
|
}
|
||||||
else if ((m_mode == CWDots) || (m_mode == CWDashes))
|
else if ((m_settings.m_mode == CWKeyerSettings::CWDots) || (m_settings.m_mode == CWKeyerSettings::CWDashes))
|
||||||
{
|
{
|
||||||
nextStateIambic();
|
nextStateIambic();
|
||||||
return m_key ? 1 : 0;
|
return m_key ? 1 : 0;
|
||||||
@ -336,7 +333,6 @@ void CWKeyer::nextStateIambic()
|
|||||||
|
|
||||||
void CWKeyer::nextStateText()
|
void CWKeyer::nextStateText()
|
||||||
{
|
{
|
||||||
// TODO...
|
|
||||||
switch (m_textState)
|
switch (m_textState)
|
||||||
{
|
{
|
||||||
case TextStart:
|
case TextStart:
|
||||||
@ -351,9 +347,9 @@ void CWKeyer::nextStateText()
|
|||||||
case TextStartChar:
|
case TextStartChar:
|
||||||
m_samplePointer = 0;
|
m_samplePointer = 0;
|
||||||
m_elementPointer = 0;
|
m_elementPointer = 0;
|
||||||
if (m_textPointer < m_text.length())
|
if (m_textPointer < m_settings.m_text.length())
|
||||||
{
|
{
|
||||||
m_asciiChar = (m_text.at(m_textPointer)).toLatin1();
|
m_asciiChar = (m_settings.m_text.at(m_textPointer)).toLatin1();
|
||||||
// qDebug() << "CWKeyer::nextStateText: TextStartChar: " << m_asciiChar;
|
// qDebug() << "CWKeyer::nextStateText: TextStartChar: " << m_asciiChar;
|
||||||
|
|
||||||
if (m_asciiChar < 0) { // non ASCII
|
if (m_asciiChar < 0) { // non ASCII
|
||||||
@ -433,7 +429,7 @@ void CWKeyer::nextStateText()
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TextEnd:
|
case TextEnd:
|
||||||
if (m_loop)
|
if (m_settings.m_loop)
|
||||||
{
|
{
|
||||||
m_textState = TextStart;
|
m_textState = TextStart;
|
||||||
}
|
}
|
||||||
@ -452,7 +448,7 @@ void CWKeyer::nextStateText()
|
|||||||
|
|
||||||
bool CWKeyer::eom()
|
bool CWKeyer::eom()
|
||||||
{
|
{
|
||||||
return !(m_textPointer < m_text.length());
|
return !(m_textPointer < m_settings.m_text.length());
|
||||||
}
|
}
|
||||||
|
|
||||||
CWSmoother::CWSmoother() :
|
CWSmoother::CWSmoother() :
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
|
|
||||||
#include "util/export.h"
|
#include "util/export.h"
|
||||||
|
#include "cwkeyersettings.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ancillary class to smooth out CW transitions with a sine shape
|
* Ancillary class to smooth out CW transitions with a sine shape
|
||||||
@ -48,13 +49,13 @@ class SDRANGEL_API CWKeyer : public QObject {
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef enum
|
// typedef enum
|
||||||
{
|
// {
|
||||||
CWNone,
|
// CWNone,
|
||||||
CWText,
|
// CWText,
|
||||||
CWDots,
|
// CWDots,
|
||||||
CWDashes
|
// CWDashes
|
||||||
} CWMode;
|
// } CWMode;
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
@ -85,8 +86,10 @@ public:
|
|||||||
void setSampleRate(int sampleRate);
|
void setSampleRate(int sampleRate);
|
||||||
void setWPM(int wpm);
|
void setWPM(int wpm);
|
||||||
void setText(const QString& text);
|
void setText(const QString& text);
|
||||||
void setMode(CWMode mode);
|
void setMode(CWKeyerSettings::CWMode mode);
|
||||||
void setLoop(bool loop) { m_loop = loop; }
|
void setLoop(bool loop) { m_settings.m_loop = loop; }
|
||||||
|
const CWKeyerSettings& getSettings() const { return m_settings; }
|
||||||
|
|
||||||
void reset() { m_keyIambicState = KeySilent; }
|
void reset() { m_keyIambicState = KeySilent; }
|
||||||
|
|
||||||
CWSmoother& getCWSmoother() { return m_cwSmoother; }
|
CWSmoother& getCWSmoother() { return m_cwSmoother; }
|
||||||
@ -97,10 +100,8 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
QMutex m_mutex;
|
QMutex m_mutex;
|
||||||
int m_sampleRate;
|
CWKeyerSettings m_settings;
|
||||||
int m_wpm;
|
|
||||||
int m_dotLength; //!< dot length in samples
|
int m_dotLength; //!< dot length in samples
|
||||||
QString m_text;
|
|
||||||
int m_textPointer;
|
int m_textPointer;
|
||||||
int m_elementPointer;
|
int m_elementPointer;
|
||||||
int m_samplePointer;
|
int m_samplePointer;
|
||||||
@ -110,9 +111,7 @@ private:
|
|||||||
bool m_dot;
|
bool m_dot;
|
||||||
bool m_dash;
|
bool m_dash;
|
||||||
bool m_elementOn;
|
bool m_elementOn;
|
||||||
bool m_loop;
|
|
||||||
char m_asciiChar;
|
char m_asciiChar;
|
||||||
CWMode m_mode;
|
|
||||||
CWKeyIambicState m_keyIambicState;
|
CWKeyIambicState m_keyIambicState;
|
||||||
CWTextState m_textState;
|
CWTextState m_textState;
|
||||||
CWSmoother m_cwSmoother;
|
CWSmoother m_cwSmoother;
|
||||||
|
76
sdrbase/dsp/cwkeyersettings.cpp
Normal file
76
sdrbase/dsp/cwkeyersettings.cpp
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Copyright (C) 2016 F4EXB //
|
||||||
|
// written by Edouard Griffiths //
|
||||||
|
// //
|
||||||
|
// This program is free software; you can redistribute it and/or modify //
|
||||||
|
// it under the terms of the GNU General Public License as published by //
|
||||||
|
// the Free Software Foundation as version 3 of the License, or //
|
||||||
|
// //
|
||||||
|
// This program is distributed in the hope that it will be useful, //
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||||
|
// GNU General Public License V3 for more details. //
|
||||||
|
// //
|
||||||
|
// You should have received a copy of the GNU General Public License //
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "util/simpleserializer.h"
|
||||||
|
#include "cwkeyersettings.h"
|
||||||
|
|
||||||
|
CWKeyerSettings::CWKeyerSettings()
|
||||||
|
{
|
||||||
|
resetToDefaults();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CWKeyerSettings::resetToDefaults()
|
||||||
|
{
|
||||||
|
m_loop = false;
|
||||||
|
m_mode = CWNone;
|
||||||
|
m_sampleRate = 48000;
|
||||||
|
m_text = "";
|
||||||
|
m_wpm = 13;
|
||||||
|
}
|
||||||
|
|
||||||
|
QByteArray CWKeyerSettings::serialize() const
|
||||||
|
{
|
||||||
|
SimpleSerializer s(1);
|
||||||
|
|
||||||
|
s.writeBool(2, m_loop);
|
||||||
|
s.writeS32(3, (int) m_mode);
|
||||||
|
s.writeS32(4, m_sampleRate);
|
||||||
|
s.writeString(5, m_text);
|
||||||
|
s.writeS32(6, m_wpm);
|
||||||
|
|
||||||
|
return s.final();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CWKeyerSettings::deserialize(const QByteArray& data)
|
||||||
|
{
|
||||||
|
SimpleDeserializer d(data);
|
||||||
|
|
||||||
|
if (!d.isValid())
|
||||||
|
{
|
||||||
|
resetToDefaults();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (d.getVersion() == 1)
|
||||||
|
{
|
||||||
|
int intval;
|
||||||
|
|
||||||
|
d.readBool(2, &m_loop, false);
|
||||||
|
d.readS32(3, &intval, 0);
|
||||||
|
m_mode = (CWMode) intval;
|
||||||
|
d.readS32(4, &m_sampleRate, 48000);
|
||||||
|
d.readString(5, &m_text, "");
|
||||||
|
d.readS32(6, &m_wpm, 13);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
resetToDefaults();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
49
sdrbase/dsp/cwkeyersettings.h
Normal file
49
sdrbase/dsp/cwkeyersettings.h
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Copyright (C) 2016 F4EXB //
|
||||||
|
// written by Edouard Griffiths //
|
||||||
|
// //
|
||||||
|
// This program is free software; you can redistribute it and/or modify //
|
||||||
|
// it under the terms of the GNU General Public License as published by //
|
||||||
|
// the Free Software Foundation as version 3 of the License, or //
|
||||||
|
// //
|
||||||
|
// This program is distributed in the hope that it will be useful, //
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||||
|
// GNU General Public License V3 for more details. //
|
||||||
|
// //
|
||||||
|
// You should have received a copy of the GNU General Public License //
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef SDRBASE_DSP_CWKEYERSETTINGS_H_
|
||||||
|
#define SDRBASE_DSP_CWKEYERSETTINGS_H_
|
||||||
|
|
||||||
|
#include <QString>
|
||||||
|
#include <QByteArray>
|
||||||
|
|
||||||
|
struct CWKeyerSettings
|
||||||
|
{
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
CWNone,
|
||||||
|
CWText,
|
||||||
|
CWDots,
|
||||||
|
CWDashes
|
||||||
|
} CWMode;
|
||||||
|
|
||||||
|
bool m_loop;
|
||||||
|
CWMode m_mode;
|
||||||
|
int m_sampleRate;
|
||||||
|
QString m_text;
|
||||||
|
int m_wpm;
|
||||||
|
|
||||||
|
CWKeyerSettings();
|
||||||
|
void resetToDefaults();
|
||||||
|
|
||||||
|
QByteArray serialize() const;
|
||||||
|
bool deserialize(const QByteArray& data);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* SDRBASE_DSP_CWKEYERSETTINGS_H_ */
|
File diff suppressed because it is too large
Load Diff
@ -63,6 +63,7 @@ SOURCES += audio/audiodeviceinfo.cpp\
|
|||||||
dsp/channelmarker.cpp\
|
dsp/channelmarker.cpp\
|
||||||
dsp/ctcssdetector.cpp\
|
dsp/ctcssdetector.cpp\
|
||||||
dsp/cwkeyer.cpp\
|
dsp/cwkeyer.cpp\
|
||||||
|
dsp/cwkeyersettings.cpp\
|
||||||
dsp/dspcommands.cpp\
|
dsp/dspcommands.cpp\
|
||||||
dsp/dspengine.cpp\
|
dsp/dspengine.cpp\
|
||||||
dsp/dspdevicesourceengine.cpp\
|
dsp/dspdevicesourceengine.cpp\
|
||||||
@ -127,6 +128,7 @@ HEADERS += audio/audiodeviceinfo.h\
|
|||||||
dsp/upchannelizer.h\
|
dsp/upchannelizer.h\
|
||||||
dsp/channelmarker.h\
|
dsp/channelmarker.h\
|
||||||
dsp/cwkeyer.h\
|
dsp/cwkeyer.h\
|
||||||
|
dsp/cwkeyersettings.h\
|
||||||
dsp/complex.h\
|
dsp/complex.h\
|
||||||
dsp/decimators.h\
|
dsp/decimators.h\
|
||||||
dsp/interpolators.h\
|
dsp/interpolators.h\
|
||||||
|
@ -32,3 +32,4 @@ std::regex WebAPIAdapterInterface::devicesetURLRe("^/sdrangel/deviceset/([0-9]{1
|
|||||||
std::regex WebAPIAdapterInterface::devicesetDeviceURLRe("^/sdrangel/deviceset/([0-9]{1,2})/device$");
|
std::regex WebAPIAdapterInterface::devicesetDeviceURLRe("^/sdrangel/deviceset/([0-9]{1,2})/device$");
|
||||||
std::regex WebAPIAdapterInterface::devicesetDeviceSettingsURLRe("^/sdrangel/deviceset/([0-9]{1,2})/device/settings$");
|
std::regex WebAPIAdapterInterface::devicesetDeviceSettingsURLRe("^/sdrangel/deviceset/([0-9]{1,2})/device/settings$");
|
||||||
std::regex WebAPIAdapterInterface::devicesetDeviceRunURLRe("^/sdrangel/deviceset/([0-9]{1,2})/device/run");
|
std::regex WebAPIAdapterInterface::devicesetDeviceRunURLRe("^/sdrangel/deviceset/([0-9]{1,2})/device/run");
|
||||||
|
std::regex WebAPIAdapterInterface::devicesetChannelSettingsURLRe("^/sdrangel/deviceset/([0-9]{1,2})/channel/([0-9]{1,2})/settings$");
|
||||||
|
@ -40,6 +40,7 @@ namespace SWGSDRangel
|
|||||||
class SWGDeviceListItem;
|
class SWGDeviceListItem;
|
||||||
class SWGDeviceSettings;
|
class SWGDeviceSettings;
|
||||||
class SWGDeviceState;
|
class SWGDeviceState;
|
||||||
|
class SWGChannelSettings;
|
||||||
class SWGErrorResponse;
|
class SWGErrorResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -288,6 +289,17 @@ public:
|
|||||||
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
|
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
|
||||||
{ return 501; }
|
{ return 501; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handler of /sdrangel/deviceset/{deviceSetIndex}/channel/{channelIndex}/settings (GET) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels
|
||||||
|
* returns the Http status code (default 501: not implemented)
|
||||||
|
*/
|
||||||
|
virtual int devicesetChannelSettingsGet(
|
||||||
|
int deviceSetIndex __attribute__((unused)),
|
||||||
|
int channelIndex __attribute__((unused)),
|
||||||
|
SWGSDRangel::SWGChannelSettings& response __attribute__((unused)),
|
||||||
|
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
|
||||||
|
{ return 501; }
|
||||||
|
|
||||||
static QString instanceSummaryURL;
|
static QString instanceSummaryURL;
|
||||||
static QString instanceDevicesURL;
|
static QString instanceDevicesURL;
|
||||||
static QString instanceChannelsURL;
|
static QString instanceChannelsURL;
|
||||||
@ -301,6 +313,7 @@ public:
|
|||||||
static std::regex devicesetDeviceURLRe;
|
static std::regex devicesetDeviceURLRe;
|
||||||
static std::regex devicesetDeviceSettingsURLRe;
|
static std::regex devicesetDeviceSettingsURLRe;
|
||||||
static std::regex devicesetDeviceRunURLRe;
|
static std::regex devicesetDeviceRunURLRe;
|
||||||
|
static std::regex devicesetChannelSettingsURLRe;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
#include "SWGPresetIdentifier.h"
|
#include "SWGPresetIdentifier.h"
|
||||||
#include "SWGDeviceSettings.h"
|
#include "SWGDeviceSettings.h"
|
||||||
#include "SWGDeviceState.h"
|
#include "SWGDeviceState.h"
|
||||||
|
#include "SWGChannelSettings.h"
|
||||||
#include "SWGErrorResponse.h"
|
#include "SWGErrorResponse.h"
|
||||||
|
|
||||||
WebAPIRequestMapper::WebAPIRequestMapper(QObject* parent) :
|
WebAPIRequestMapper::WebAPIRequestMapper(QObject* parent) :
|
||||||
@ -95,6 +96,8 @@ void WebAPIRequestMapper::service(qtwebapp::HttpRequest& request, qtwebapp::Http
|
|||||||
devicesetDeviceSettingsService(std::string(desc_match[1]), request, response);
|
devicesetDeviceSettingsService(std::string(desc_match[1]), request, response);
|
||||||
} else if (std::regex_match(pathStr, desc_match, WebAPIAdapterInterface::devicesetDeviceRunURLRe)) {
|
} else if (std::regex_match(pathStr, desc_match, WebAPIAdapterInterface::devicesetDeviceRunURLRe)) {
|
||||||
devicesetDeviceRunService(std::string(desc_match[1]), request, response);
|
devicesetDeviceRunService(std::string(desc_match[1]), request, response);
|
||||||
|
} else if (std::regex_match(pathStr, desc_match, WebAPIAdapterInterface::devicesetChannelSettingsURLRe)) {
|
||||||
|
devicesetChannelSettingsService(std::string(desc_match[1]), std::string(desc_match[2]), request, response);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -762,6 +765,47 @@ void WebAPIRequestMapper::devicesetDeviceRunService(const std::string& indexStr,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WebAPIRequestMapper::devicesetChannelSettingsService(
|
||||||
|
const std::string& deviceSetIndexStr,
|
||||||
|
const std::string& channelIndexStr,
|
||||||
|
qtwebapp::HttpRequest& request,
|
||||||
|
qtwebapp::HttpResponse& response)
|
||||||
|
{
|
||||||
|
SWGSDRangel::SWGErrorResponse errorResponse;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int deviceSetIndex = boost::lexical_cast<int>(deviceSetIndexStr);
|
||||||
|
int channelIndex = boost::lexical_cast<int>(channelIndexStr);
|
||||||
|
|
||||||
|
if (request.getMethod() == "GET")
|
||||||
|
{
|
||||||
|
SWGSDRangel::SWGChannelSettings normalResponse;
|
||||||
|
resetChannelSettings(normalResponse);
|
||||||
|
int status = m_adapter->devicesetChannelSettingsGet(deviceSetIndex, channelIndex, normalResponse, errorResponse);
|
||||||
|
response.setStatus(status);
|
||||||
|
|
||||||
|
if (status == 200) {
|
||||||
|
response.write(normalResponse.asJson().toUtf8());
|
||||||
|
} else {
|
||||||
|
response.write(errorResponse.asJson().toUtf8());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
response.setStatus(405,"Invalid HTTP method");
|
||||||
|
response.write("Invalid HTTP method");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (const boost::bad_lexical_cast &e)
|
||||||
|
{
|
||||||
|
errorResponse.init();
|
||||||
|
*errorResponse.getMessage() = "Wrong integer conversion on index";
|
||||||
|
response.setStatus(400,"Invalid data");
|
||||||
|
response.write(errorResponse.asJson().toUtf8());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool WebAPIRequestMapper::parseJsonBody(QString& jsonStr, QJsonObject& jsonObject, qtwebapp::HttpResponse& response)
|
bool WebAPIRequestMapper::parseJsonBody(QString& jsonStr, QJsonObject& jsonObject, qtwebapp::HttpResponse& response)
|
||||||
{
|
{
|
||||||
SWGSDRangel::SWGErrorResponse errorResponse;
|
SWGSDRangel::SWGErrorResponse errorResponse;
|
||||||
@ -902,3 +946,10 @@ void WebAPIRequestMapper::resetDeviceSettings(SWGSDRangel::SWGDeviceSettings& de
|
|||||||
deviceSettings.setLimeSdrOutputSettings(0);
|
deviceSettings.setLimeSdrOutputSettings(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WebAPIRequestMapper::resetChannelSettings(SWGSDRangel::SWGChannelSettings& channelSettings)
|
||||||
|
{
|
||||||
|
channelSettings.cleanup();
|
||||||
|
channelSettings.setNfmDemodSettings(0);
|
||||||
|
channelSettings.setNfmModSettings(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -59,6 +59,7 @@ private:
|
|||||||
void devicesetDeviceService(const std::string& indexStr, qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response);
|
void devicesetDeviceService(const std::string& indexStr, qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response);
|
||||||
void devicesetDeviceSettingsService(const std::string& indexStr, qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response);
|
void devicesetDeviceSettingsService(const std::string& indexStr, qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response);
|
||||||
void devicesetDeviceRunService(const std::string& indexStr, qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response);
|
void devicesetDeviceRunService(const std::string& indexStr, qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response);
|
||||||
|
void devicesetChannelSettingsService(const std::string& deviceSetIndexStr, const std::string& channelIndexStr, qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response);
|
||||||
|
|
||||||
bool validatePresetTransfer(SWGSDRangel::SWGPresetTransfer& presetTransfer);
|
bool validatePresetTransfer(SWGSDRangel::SWGPresetTransfer& presetTransfer);
|
||||||
bool validatePresetIdentifer(SWGSDRangel::SWGPresetIdentifier& presetIdentifier);
|
bool validatePresetIdentifer(SWGSDRangel::SWGPresetIdentifier& presetIdentifier);
|
||||||
@ -67,6 +68,7 @@ private:
|
|||||||
bool parseJsonBody(QString& jsonStr, QJsonObject& jsonObject, qtwebapp::HttpResponse& response);
|
bool parseJsonBody(QString& jsonStr, QJsonObject& jsonObject, qtwebapp::HttpResponse& response);
|
||||||
|
|
||||||
void resetDeviceSettings(SWGSDRangel::SWGDeviceSettings& deviceSettings);
|
void resetDeviceSettings(SWGSDRangel::SWGDeviceSettings& deviceSettings);
|
||||||
|
void resetChannelSettings(SWGSDRangel::SWGChannelSettings& deviceSettings);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* SDRBASE_WEBAPI_WEBAPIREQUESTMAPPER_H_ */
|
#endif /* SDRBASE_WEBAPI_WEBAPIREQUESTMAPPER_H_ */
|
||||||
|
@ -115,7 +115,7 @@ void CWKeyerGUI::on_playDots_toggled(bool checked)
|
|||||||
ui->playDashes->setEnabled(!checked);
|
ui->playDashes->setEnabled(!checked);
|
||||||
ui->playText->setEnabled(!checked);
|
ui->playText->setEnabled(!checked);
|
||||||
|
|
||||||
m_cwKeyer->setMode(checked ? CWKeyer::CWDots : CWKeyer::CWNone);
|
m_cwKeyer->setMode(checked ? CWKeyerSettings::CWDots : CWKeyerSettings::CWNone);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CWKeyerGUI::on_playDashes_toggled(bool checked)
|
void CWKeyerGUI::on_playDashes_toggled(bool checked)
|
||||||
@ -124,7 +124,7 @@ void CWKeyerGUI::on_playDashes_toggled(bool checked)
|
|||||||
//ui->playDashes->setEnabled(!checked);
|
//ui->playDashes->setEnabled(!checked);
|
||||||
ui->playText->setEnabled(!checked);
|
ui->playText->setEnabled(!checked);
|
||||||
|
|
||||||
m_cwKeyer->setMode(checked ? CWKeyer::CWDashes : CWKeyer::CWNone);
|
m_cwKeyer->setMode(checked ? CWKeyerSettings::CWDashes : CWKeyerSettings::CWNone);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CWKeyerGUI::on_playText_toggled(bool checked)
|
void CWKeyerGUI::on_playText_toggled(bool checked)
|
||||||
@ -133,7 +133,7 @@ void CWKeyerGUI::on_playText_toggled(bool checked)
|
|||||||
ui->playDashes->setEnabled(!checked);
|
ui->playDashes->setEnabled(!checked);
|
||||||
//ui->playText->setEnabled(!checked);
|
//ui->playText->setEnabled(!checked);
|
||||||
|
|
||||||
m_cwKeyer->setMode(checked ? CWKeyer::CWText : CWKeyer::CWNone);
|
m_cwKeyer->setMode(checked ? CWKeyerSettings::CWText : CWKeyerSettings::CWNone);
|
||||||
|
|
||||||
if (checked) {
|
if (checked) {
|
||||||
ui->playStop->setChecked(true);
|
ui->playStop->setChecked(true);
|
||||||
|
@ -52,6 +52,7 @@
|
|||||||
#include "SWGPresetIdentifier.h"
|
#include "SWGPresetIdentifier.h"
|
||||||
#include "SWGDeviceSettings.h"
|
#include "SWGDeviceSettings.h"
|
||||||
#include "SWGDeviceState.h"
|
#include "SWGDeviceState.h"
|
||||||
|
#include "SWGChannelSettings.h"
|
||||||
#include "SWGErrorResponse.h"
|
#include "SWGErrorResponse.h"
|
||||||
|
|
||||||
#include "webapiadaptergui.h"
|
#include "webapiadaptergui.h"
|
||||||
@ -886,6 +887,65 @@ int WebAPIAdapterGUI::devicesetDeviceRunDelete(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int WebAPIAdapterGUI::devicesetChannelSettingsGet(
|
||||||
|
int deviceSetIndex,
|
||||||
|
int channelIndex,
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
SWGSDRangel::SWGErrorResponse& error)
|
||||||
|
{
|
||||||
|
if ((deviceSetIndex >= 0) && (deviceSetIndex < (int) m_mainWindow.m_deviceUIs.size()))
|
||||||
|
{
|
||||||
|
DeviceUISet *deviceSet = m_mainWindow.m_deviceUIs[deviceSetIndex];
|
||||||
|
|
||||||
|
if (deviceSet->m_deviceSourceEngine) // Rx
|
||||||
|
{
|
||||||
|
ChannelSinkAPI *channelAPI = deviceSet->m_deviceSourceAPI->getChanelAPIAt(channelIndex);
|
||||||
|
|
||||||
|
if (channelAPI == 0)
|
||||||
|
{
|
||||||
|
error.init();
|
||||||
|
*error.getMessage() = QString("There is no channel with index %1").arg(channelIndex);
|
||||||
|
return 404;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
response.setChannelType(new QString());
|
||||||
|
channelAPI->getIdentifier(*response.getChannelType());
|
||||||
|
response.setTx(0);
|
||||||
|
return channelAPI->webapiSettingsGet(response, *error.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (deviceSet->m_deviceSinkEngine) // Tx
|
||||||
|
{
|
||||||
|
ChannelSourceAPI *channelAPI = deviceSet->m_deviceSinkAPI->getChanelAPIAt(channelIndex);
|
||||||
|
|
||||||
|
if (channelAPI == 0)
|
||||||
|
{
|
||||||
|
error.init();
|
||||||
|
*error.getMessage() = QString("There is no channel with index %1").arg(channelIndex);
|
||||||
|
return 404;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
response.setChannelType(new QString());
|
||||||
|
channelAPI->getIdentifier(*response.getChannelType());
|
||||||
|
response.setTx(1);
|
||||||
|
return channelAPI->webapiSettingsGet(response, *error.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
*error.getMessage() = QString("DeviceSet error");
|
||||||
|
return 500;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
error.init();
|
||||||
|
*error.getMessage() = QString("There is no device set with index %1").arg(deviceSetIndex);
|
||||||
|
return 404;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void WebAPIAdapterGUI::getDeviceSetList(SWGSDRangel::SWGDeviceSetList* deviceSetList)
|
void WebAPIAdapterGUI::getDeviceSetList(SWGSDRangel::SWGDeviceSetList* deviceSetList)
|
||||||
{
|
{
|
||||||
|
@ -146,6 +146,12 @@ public:
|
|||||||
SWGSDRangel::SWGDeviceState& response,
|
SWGSDRangel::SWGDeviceState& response,
|
||||||
SWGSDRangel::SWGErrorResponse& error);
|
SWGSDRangel::SWGErrorResponse& error);
|
||||||
|
|
||||||
|
virtual int devicesetChannelSettingsGet(
|
||||||
|
int deviceSetIndex,
|
||||||
|
int channelIndex,
|
||||||
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
|
SWGSDRangel::SWGErrorResponse& error);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MainWindow& m_mainWindow;
|
MainWindow& m_mainWindow;
|
||||||
|
|
||||||
|
12
swagger/sdrangel/api/swagger/include/CWKeyer.yaml
Normal file
12
swagger/sdrangel/api/swagger/include/CWKeyer.yaml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
CWKeyerSettings:
|
||||||
|
properties:
|
||||||
|
sampleRate:
|
||||||
|
type: integer
|
||||||
|
wpm:
|
||||||
|
type: integer
|
||||||
|
mode:
|
||||||
|
type: integer
|
||||||
|
text:
|
||||||
|
type: string
|
||||||
|
loop:
|
||||||
|
type: integer
|
44
swagger/sdrangel/api/swagger/include/NFMDemod.yaml
Normal file
44
swagger/sdrangel/api/swagger/include/NFMDemod.yaml
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
NFMDemodSettings:
|
||||||
|
properties:
|
||||||
|
inputSampleRate:
|
||||||
|
type: integer
|
||||||
|
inputFrequencyOffset:
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
rfBandwidth:
|
||||||
|
type: number
|
||||||
|
format: float
|
||||||
|
afBandwidth:
|
||||||
|
type: number
|
||||||
|
format: float
|
||||||
|
fmDeviation:
|
||||||
|
type: integer
|
||||||
|
squelchGate:
|
||||||
|
type: integer
|
||||||
|
deltaSquelch:
|
||||||
|
type: integer
|
||||||
|
squelch:
|
||||||
|
type: number
|
||||||
|
format: float
|
||||||
|
volume:
|
||||||
|
type: number
|
||||||
|
format: float
|
||||||
|
ctcssOn:
|
||||||
|
type: integer
|
||||||
|
audioMute:
|
||||||
|
type: integer
|
||||||
|
ctcssIndex:
|
||||||
|
type: integer
|
||||||
|
audioSampleRate:
|
||||||
|
type: integer
|
||||||
|
copyAudioToUDP:
|
||||||
|
type: integer
|
||||||
|
udpAddress:
|
||||||
|
type: string
|
||||||
|
udpPort:
|
||||||
|
type: integer
|
||||||
|
rgbColor:
|
||||||
|
type: integer
|
||||||
|
title:
|
||||||
|
type: string
|
||||||
|
|
41
swagger/sdrangel/api/swagger/include/NFMMod.yaml
Normal file
41
swagger/sdrangel/api/swagger/include/NFMMod.yaml
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
NFMModSettings:
|
||||||
|
properties:
|
||||||
|
basebandSampleRate:
|
||||||
|
type: integer
|
||||||
|
outputSampleRate:
|
||||||
|
type: integer
|
||||||
|
inputFrequencyOffset:
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
rfBandwidth:
|
||||||
|
type: number
|
||||||
|
format: float
|
||||||
|
afBandwidth:
|
||||||
|
type: number
|
||||||
|
format: float
|
||||||
|
fmDeviation:
|
||||||
|
type: number
|
||||||
|
format: float
|
||||||
|
toneFrequency:
|
||||||
|
type: number
|
||||||
|
format: float
|
||||||
|
volumeFactor:
|
||||||
|
type: number
|
||||||
|
format: float
|
||||||
|
audioSampleRate:
|
||||||
|
type: integer
|
||||||
|
channelMute:
|
||||||
|
type: integer
|
||||||
|
playLoop:
|
||||||
|
type: integer
|
||||||
|
ctcssOn:
|
||||||
|
type: integer
|
||||||
|
ctcssIndex:
|
||||||
|
type: integer
|
||||||
|
rgbColor:
|
||||||
|
type: integer
|
||||||
|
title:
|
||||||
|
type: string
|
||||||
|
cwKeyer:
|
||||||
|
$ref: "http://localhost:8081/CWKeyer.yaml#/CWKeyerSettings"
|
||||||
|
|
@ -714,6 +714,187 @@ paths:
|
|||||||
$ref: "#/definitions/ErrorResponse"
|
$ref: "#/definitions/ErrorResponse"
|
||||||
"501":
|
"501":
|
||||||
description: Function not implemented
|
description: Function not implemented
|
||||||
|
/sdrangel/deviceset/{deviceSetIndex}/channel:
|
||||||
|
x-swagger-router-controller: deviceset
|
||||||
|
post:
|
||||||
|
description: add a channel
|
||||||
|
operationId: devicesetChannelPost
|
||||||
|
tags:
|
||||||
|
- DeviceSet
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: deviceSetIndex
|
||||||
|
type: integer
|
||||||
|
required: true
|
||||||
|
description: Index of device set in the device set list
|
||||||
|
- name: body
|
||||||
|
in: body
|
||||||
|
description: Channel identification (no settings data)
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/ChannelSettings"
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: On success return new channel settings
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/ChannelSettings"
|
||||||
|
"400":
|
||||||
|
description: Invalid device set index
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/ErrorResponse"
|
||||||
|
"404":
|
||||||
|
description: Device not found
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/ErrorResponse"
|
||||||
|
"500":
|
||||||
|
description: Error
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/ErrorResponse"
|
||||||
|
"501":
|
||||||
|
description: Function not implemented
|
||||||
|
/sdrangel/deviceset/{deviceSetIndex}/channel/{channelIndex}:
|
||||||
|
delete:
|
||||||
|
description: delete channel
|
||||||
|
operationId: devicesetChannelDelete
|
||||||
|
tags:
|
||||||
|
- DeviceSet
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: deviceSetIndex
|
||||||
|
type: integer
|
||||||
|
required: true
|
||||||
|
description: Index of device set in the device set list
|
||||||
|
- in: path
|
||||||
|
name: channelIndex
|
||||||
|
type: integer
|
||||||
|
required: true
|
||||||
|
description: Index of channel in the channels list
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: On success return deleted channel settings
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/ChannelSettings"
|
||||||
|
"400":
|
||||||
|
description: Invalid device set or channel index
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/ErrorResponse"
|
||||||
|
"404":
|
||||||
|
description: Device or channel not found
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/ErrorResponse"
|
||||||
|
"500":
|
||||||
|
description: Error
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/ErrorResponse"
|
||||||
|
"501":
|
||||||
|
description: Function not implemented
|
||||||
|
/sdrangel/deviceset/{deviceSetIndex}/channel/{channelIndex}/settings:
|
||||||
|
x-swagger-router-controller: deviceset
|
||||||
|
get:
|
||||||
|
description: get a channel settings
|
||||||
|
operationId: devicesetChannelSettingsGet
|
||||||
|
tags:
|
||||||
|
- DeviceSet
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: deviceSetIndex
|
||||||
|
type: integer
|
||||||
|
required: true
|
||||||
|
description: Index of device set in the device set list
|
||||||
|
- in: path
|
||||||
|
name: channelIndex
|
||||||
|
type: integer
|
||||||
|
required: true
|
||||||
|
description: Index of the channel in the channels list for this device set
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: On success return channel settings
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/ChannelSettings"
|
||||||
|
"400":
|
||||||
|
description: Invalid device set or channel index
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/ErrorResponse"
|
||||||
|
"404":
|
||||||
|
description: Device or channel not found
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/ErrorResponse"
|
||||||
|
"500":
|
||||||
|
description: Error
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/ErrorResponse"
|
||||||
|
"501":
|
||||||
|
description: Function not implemented
|
||||||
|
put:
|
||||||
|
description: apply all settings unconditionally (force)
|
||||||
|
operationId: devicesetChannelSettingsPut
|
||||||
|
tags:
|
||||||
|
- DeviceSet
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: deviceSetIndex
|
||||||
|
type: integer
|
||||||
|
required: true
|
||||||
|
description: Index of device set in the device set list
|
||||||
|
- in: path
|
||||||
|
name: channelIndex
|
||||||
|
type: integer
|
||||||
|
required: true
|
||||||
|
description: Index of the channel in the channels list for this device set
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: On success return channel new settings
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/ChannelSettings"
|
||||||
|
"400":
|
||||||
|
description: Invalid device set or channel index
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/ErrorResponse"
|
||||||
|
"404":
|
||||||
|
description: Device or channel not found
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/ErrorResponse"
|
||||||
|
"500":
|
||||||
|
description: Error
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/ErrorResponse"
|
||||||
|
"501":
|
||||||
|
description: Function not implemented
|
||||||
|
patch:
|
||||||
|
description: apply settings differentially (no force)
|
||||||
|
operationId: devicesetChannelSettingsPatch
|
||||||
|
tags:
|
||||||
|
- DeviceSet
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: deviceSetIndex
|
||||||
|
type: integer
|
||||||
|
required: true
|
||||||
|
description: Index of device set in the device set list
|
||||||
|
- in: path
|
||||||
|
name: channelIndex
|
||||||
|
type: integer
|
||||||
|
required: true
|
||||||
|
description: Index of the channel in the channels list for this device set
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: On success return channel new settings
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/ChannelSettings"
|
||||||
|
"400":
|
||||||
|
description: Invalid device set or channel index
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/ErrorResponse"
|
||||||
|
"404":
|
||||||
|
description: Device or channel not found
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/ErrorResponse"
|
||||||
|
"500":
|
||||||
|
description: Error
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/ErrorResponse"
|
||||||
|
"501":
|
||||||
|
description: Function not implemented
|
||||||
/swagger:
|
/swagger:
|
||||||
x-swagger-pipe: swagger_raw
|
x-swagger-pipe: swagger_raw
|
||||||
# complex objects have schema definitions
|
# complex objects have schema definitions
|
||||||
@ -1124,3 +1305,20 @@ definitions:
|
|||||||
$ref: "http://localhost:8081/LimeSdr.yaml#/LimeSdrInputSettings"
|
$ref: "http://localhost:8081/LimeSdr.yaml#/LimeSdrInputSettings"
|
||||||
limeSdrOutputSettings:
|
limeSdrOutputSettings:
|
||||||
$ref: "http://localhost:8081/LimeSdr.yaml#/LimeSdrOutputSettings"
|
$ref: "http://localhost:8081/LimeSdr.yaml#/LimeSdrOutputSettings"
|
||||||
|
ChannelSettings:
|
||||||
|
description: Base channel settings
|
||||||
|
discriminator: channelType
|
||||||
|
required:
|
||||||
|
- channelType
|
||||||
|
- tx
|
||||||
|
properties:
|
||||||
|
channelType:
|
||||||
|
description: Channel type code
|
||||||
|
type: string
|
||||||
|
tx:
|
||||||
|
description: Not zero if it is a tx channel else it is a rx channel
|
||||||
|
type: integer
|
||||||
|
NFMDemodSettings:
|
||||||
|
$ref: "http://localhost:8081/NFMDemod.yaml#/NFMDemodSettings"
|
||||||
|
NFMModSettings:
|
||||||
|
$ref: "http://localhost:8081/NFMMod.yaml#/NFMModSettings"
|
||||||
|
File diff suppressed because it is too large
Load Diff
151
swagger/sdrangel/code/qt5/client/SWGCWKeyerSettings.cpp
Normal file
151
swagger/sdrangel/code/qt5/client/SWGCWKeyerSettings.cpp
Normal file
@ -0,0 +1,151 @@
|
|||||||
|
/**
|
||||||
|
* SDRangel
|
||||||
|
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 4.0.0
|
||||||
|
* Contact: f4exb06@gmail.com
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "SWGCWKeyerSettings.h"
|
||||||
|
|
||||||
|
#include "SWGHelpers.h"
|
||||||
|
|
||||||
|
#include <QJsonDocument>
|
||||||
|
#include <QJsonArray>
|
||||||
|
#include <QObject>
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
|
namespace SWGSDRangel {
|
||||||
|
|
||||||
|
SWGCWKeyerSettings::SWGCWKeyerSettings(QString* json) {
|
||||||
|
init();
|
||||||
|
this->fromJson(*json);
|
||||||
|
}
|
||||||
|
|
||||||
|
SWGCWKeyerSettings::SWGCWKeyerSettings() {
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
SWGCWKeyerSettings::~SWGCWKeyerSettings() {
|
||||||
|
this->cleanup();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SWGCWKeyerSettings::init() {
|
||||||
|
sample_rate = 0;
|
||||||
|
wpm = 0;
|
||||||
|
mode = 0;
|
||||||
|
text = new QString("");
|
||||||
|
loop = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SWGCWKeyerSettings::cleanup() {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if(text != nullptr) {
|
||||||
|
delete text;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
SWGCWKeyerSettings*
|
||||||
|
SWGCWKeyerSettings::fromJson(QString &json) {
|
||||||
|
QByteArray array (json.toStdString().c_str());
|
||||||
|
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||||
|
QJsonObject jsonObject = doc.object();
|
||||||
|
this->fromJsonObject(jsonObject);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SWGCWKeyerSettings::fromJsonObject(QJsonObject &pJson) {
|
||||||
|
::SWGSDRangel::setValue(&sample_rate, pJson["sampleRate"], "qint32", "");
|
||||||
|
::SWGSDRangel::setValue(&wpm, pJson["wpm"], "qint32", "");
|
||||||
|
::SWGSDRangel::setValue(&mode, pJson["mode"], "qint32", "");
|
||||||
|
::SWGSDRangel::setValue(&text, pJson["text"], "QString", "QString");
|
||||||
|
::SWGSDRangel::setValue(&loop, pJson["loop"], "qint32", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
QString
|
||||||
|
SWGCWKeyerSettings::asJson ()
|
||||||
|
{
|
||||||
|
QJsonObject* obj = this->asJsonObject();
|
||||||
|
|
||||||
|
QJsonDocument doc(*obj);
|
||||||
|
QByteArray bytes = doc.toJson();
|
||||||
|
return QString(bytes);
|
||||||
|
}
|
||||||
|
|
||||||
|
QJsonObject*
|
||||||
|
SWGCWKeyerSettings::asJsonObject() {
|
||||||
|
QJsonObject* obj = new QJsonObject();
|
||||||
|
|
||||||
|
obj->insert("sampleRate", QJsonValue(sample_rate));
|
||||||
|
|
||||||
|
obj->insert("wpm", QJsonValue(wpm));
|
||||||
|
|
||||||
|
obj->insert("mode", QJsonValue(mode));
|
||||||
|
|
||||||
|
toJsonValue(QString("text"), text, obj, QString("QString"));
|
||||||
|
|
||||||
|
obj->insert("loop", QJsonValue(loop));
|
||||||
|
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
qint32
|
||||||
|
SWGCWKeyerSettings::getSampleRate() {
|
||||||
|
return sample_rate;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGCWKeyerSettings::setSampleRate(qint32 sample_rate) {
|
||||||
|
this->sample_rate = sample_rate;
|
||||||
|
}
|
||||||
|
|
||||||
|
qint32
|
||||||
|
SWGCWKeyerSettings::getWpm() {
|
||||||
|
return wpm;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGCWKeyerSettings::setWpm(qint32 wpm) {
|
||||||
|
this->wpm = wpm;
|
||||||
|
}
|
||||||
|
|
||||||
|
qint32
|
||||||
|
SWGCWKeyerSettings::getMode() {
|
||||||
|
return mode;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGCWKeyerSettings::setMode(qint32 mode) {
|
||||||
|
this->mode = mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString*
|
||||||
|
SWGCWKeyerSettings::getText() {
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGCWKeyerSettings::setText(QString* text) {
|
||||||
|
this->text = text;
|
||||||
|
}
|
||||||
|
|
||||||
|
qint32
|
||||||
|
SWGCWKeyerSettings::getLoop() {
|
||||||
|
return loop;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGCWKeyerSettings::setLoop(qint32 loop) {
|
||||||
|
this->loop = loop;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
71
swagger/sdrangel/code/qt5/client/SWGCWKeyerSettings.h
Normal file
71
swagger/sdrangel/code/qt5/client/SWGCWKeyerSettings.h
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
/**
|
||||||
|
* SDRangel
|
||||||
|
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 4.0.0
|
||||||
|
* Contact: f4exb06@gmail.com
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* SWGCWKeyerSettings.h
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SWGCWKeyerSettings_H_
|
||||||
|
#define SWGCWKeyerSettings_H_
|
||||||
|
|
||||||
|
#include <QJsonObject>
|
||||||
|
|
||||||
|
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
|
#include "SWGObject.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace SWGSDRangel {
|
||||||
|
|
||||||
|
class SWGCWKeyerSettings: public SWGObject {
|
||||||
|
public:
|
||||||
|
SWGCWKeyerSettings();
|
||||||
|
SWGCWKeyerSettings(QString* json);
|
||||||
|
virtual ~SWGCWKeyerSettings();
|
||||||
|
void init();
|
||||||
|
void cleanup();
|
||||||
|
|
||||||
|
QString asJson ();
|
||||||
|
QJsonObject* asJsonObject();
|
||||||
|
void fromJsonObject(QJsonObject &json);
|
||||||
|
SWGCWKeyerSettings* fromJson(QString &jsonString);
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
qint32 sample_rate;
|
||||||
|
qint32 wpm;
|
||||||
|
qint32 mode;
|
||||||
|
QString* text;
|
||||||
|
qint32 loop;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* SWGCWKeyerSettings_H_ */
|
143
swagger/sdrangel/code/qt5/client/SWGChannelSettings.cpp
Normal file
143
swagger/sdrangel/code/qt5/client/SWGChannelSettings.cpp
Normal file
@ -0,0 +1,143 @@
|
|||||||
|
/**
|
||||||
|
* SDRangel
|
||||||
|
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 4.0.0
|
||||||
|
* Contact: f4exb06@gmail.com
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "SWGChannelSettings.h"
|
||||||
|
|
||||||
|
#include "SWGHelpers.h"
|
||||||
|
|
||||||
|
#include <QJsonDocument>
|
||||||
|
#include <QJsonArray>
|
||||||
|
#include <QObject>
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
|
namespace SWGSDRangel {
|
||||||
|
|
||||||
|
SWGChannelSettings::SWGChannelSettings(QString* json) {
|
||||||
|
init();
|
||||||
|
this->fromJson(*json);
|
||||||
|
}
|
||||||
|
|
||||||
|
SWGChannelSettings::SWGChannelSettings() {
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
SWGChannelSettings::~SWGChannelSettings() {
|
||||||
|
this->cleanup();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SWGChannelSettings::init() {
|
||||||
|
channel_type = new QString("");
|
||||||
|
tx = 0;
|
||||||
|
nfm_demod_settings = new SWGNFMDemodSettings();
|
||||||
|
nfm_mod_settings = new SWGNFMModSettings();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SWGChannelSettings::cleanup() {
|
||||||
|
|
||||||
|
if(channel_type != nullptr) {
|
||||||
|
delete channel_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(nfm_demod_settings != nullptr) {
|
||||||
|
delete nfm_demod_settings;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(nfm_mod_settings != nullptr) {
|
||||||
|
delete nfm_mod_settings;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SWGChannelSettings*
|
||||||
|
SWGChannelSettings::fromJson(QString &json) {
|
||||||
|
QByteArray array (json.toStdString().c_str());
|
||||||
|
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||||
|
QJsonObject jsonObject = doc.object();
|
||||||
|
this->fromJsonObject(jsonObject);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SWGChannelSettings::fromJsonObject(QJsonObject &pJson) {
|
||||||
|
::SWGSDRangel::setValue(&channel_type, pJson["channelType"], "QString", "QString");
|
||||||
|
::SWGSDRangel::setValue(&tx, pJson["tx"], "qint32", "");
|
||||||
|
::SWGSDRangel::setValue(&nfm_demod_settings, pJson["NFMDemodSettings"], "SWGNFMDemodSettings", "SWGNFMDemodSettings");
|
||||||
|
::SWGSDRangel::setValue(&nfm_mod_settings, pJson["NFMModSettings"], "SWGNFMModSettings", "SWGNFMModSettings");
|
||||||
|
}
|
||||||
|
|
||||||
|
QString
|
||||||
|
SWGChannelSettings::asJson ()
|
||||||
|
{
|
||||||
|
QJsonObject* obj = this->asJsonObject();
|
||||||
|
|
||||||
|
QJsonDocument doc(*obj);
|
||||||
|
QByteArray bytes = doc.toJson();
|
||||||
|
return QString(bytes);
|
||||||
|
}
|
||||||
|
|
||||||
|
QJsonObject*
|
||||||
|
SWGChannelSettings::asJsonObject() {
|
||||||
|
QJsonObject* obj = new QJsonObject();
|
||||||
|
|
||||||
|
toJsonValue(QString("channelType"), channel_type, obj, QString("QString"));
|
||||||
|
|
||||||
|
obj->insert("tx", QJsonValue(tx));
|
||||||
|
|
||||||
|
toJsonValue(QString("NFMDemodSettings"), nfm_demod_settings, obj, QString("SWGNFMDemodSettings"));
|
||||||
|
|
||||||
|
toJsonValue(QString("NFMModSettings"), nfm_mod_settings, obj, QString("SWGNFMModSettings"));
|
||||||
|
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString*
|
||||||
|
SWGChannelSettings::getChannelType() {
|
||||||
|
return channel_type;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGChannelSettings::setChannelType(QString* channel_type) {
|
||||||
|
this->channel_type = channel_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
qint32
|
||||||
|
SWGChannelSettings::getTx() {
|
||||||
|
return tx;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGChannelSettings::setTx(qint32 tx) {
|
||||||
|
this->tx = tx;
|
||||||
|
}
|
||||||
|
|
||||||
|
SWGNFMDemodSettings*
|
||||||
|
SWGChannelSettings::getNfmDemodSettings() {
|
||||||
|
return nfm_demod_settings;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGChannelSettings::setNfmDemodSettings(SWGNFMDemodSettings* nfm_demod_settings) {
|
||||||
|
this->nfm_demod_settings = nfm_demod_settings;
|
||||||
|
}
|
||||||
|
|
||||||
|
SWGNFMModSettings*
|
||||||
|
SWGChannelSettings::getNfmModSettings() {
|
||||||
|
return nfm_mod_settings;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGChannelSettings::setNfmModSettings(SWGNFMModSettings* nfm_mod_settings) {
|
||||||
|
this->nfm_mod_settings = nfm_mod_settings;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
69
swagger/sdrangel/code/qt5/client/SWGChannelSettings.h
Normal file
69
swagger/sdrangel/code/qt5/client/SWGChannelSettings.h
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
/**
|
||||||
|
* SDRangel
|
||||||
|
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 4.0.0
|
||||||
|
* Contact: f4exb06@gmail.com
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* SWGChannelSettings.h
|
||||||
|
*
|
||||||
|
* Base channel settings
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SWGChannelSettings_H_
|
||||||
|
#define SWGChannelSettings_H_
|
||||||
|
|
||||||
|
#include <QJsonObject>
|
||||||
|
|
||||||
|
|
||||||
|
#include "SWGNFMDemodSettings.h"
|
||||||
|
#include "SWGNFMModSettings.h"
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
|
#include "SWGObject.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace SWGSDRangel {
|
||||||
|
|
||||||
|
class SWGChannelSettings: public SWGObject {
|
||||||
|
public:
|
||||||
|
SWGChannelSettings();
|
||||||
|
SWGChannelSettings(QString* json);
|
||||||
|
virtual ~SWGChannelSettings();
|
||||||
|
void init();
|
||||||
|
void cleanup();
|
||||||
|
|
||||||
|
QString asJson ();
|
||||||
|
QJsonObject* asJsonObject();
|
||||||
|
void fromJsonObject(QJsonObject &json);
|
||||||
|
SWGChannelSettings* fromJson(QString &jsonString);
|
||||||
|
|
||||||
|
QString* getChannelType();
|
||||||
|
void setChannelType(QString* channel_type);
|
||||||
|
|
||||||
|
qint32 getTx();
|
||||||
|
void setTx(qint32 tx);
|
||||||
|
|
||||||
|
SWGNFMDemodSettings* getNfmDemodSettings();
|
||||||
|
void setNfmDemodSettings(SWGNFMDemodSettings* nfm_demod_settings);
|
||||||
|
|
||||||
|
SWGNFMModSettings* getNfmModSettings();
|
||||||
|
void setNfmModSettings(SWGNFMModSettings* nfm_mod_settings);
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString* channel_type;
|
||||||
|
qint32 tx;
|
||||||
|
SWGNFMDemodSettings* nfm_demod_settings;
|
||||||
|
SWGNFMModSettings* nfm_mod_settings;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* SWGChannelSettings_H_ */
|
@ -28,6 +28,266 @@ SWGDeviceSetApi::SWGDeviceSetApi(QString host, QString basePath) {
|
|||||||
this->basePath = basePath;
|
this->basePath = basePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SWGDeviceSetApi::devicesetChannelDelete(qint32 device_set_index, qint32 channel_index) {
|
||||||
|
QString fullPath;
|
||||||
|
fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}/channel/{channelIndex}");
|
||||||
|
|
||||||
|
QString device_set_indexPathParam("{"); device_set_indexPathParam.append("deviceSetIndex").append("}");
|
||||||
|
fullPath.replace(device_set_indexPathParam, stringValue(device_set_index));
|
||||||
|
QString channel_indexPathParam("{"); channel_indexPathParam.append("channelIndex").append("}");
|
||||||
|
fullPath.replace(channel_indexPathParam, stringValue(channel_index));
|
||||||
|
|
||||||
|
|
||||||
|
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||||
|
HttpRequestInput input(fullPath, "DELETE");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
foreach(QString key, this->defaultHeaders.keys()) {
|
||||||
|
input.headers.insert(key, this->defaultHeaders.value(key));
|
||||||
|
}
|
||||||
|
|
||||||
|
connect(worker,
|
||||||
|
&HttpRequestWorker::on_execution_finished,
|
||||||
|
this,
|
||||||
|
&SWGDeviceSetApi::devicesetChannelDeleteCallback);
|
||||||
|
|
||||||
|
worker->execute(&input);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SWGDeviceSetApi::devicesetChannelDeleteCallback(HttpRequestWorker * worker) {
|
||||||
|
QString msg;
|
||||||
|
QString error_str = worker->error_str;
|
||||||
|
QNetworkReply::NetworkError error_type = worker->error_type;
|
||||||
|
|
||||||
|
if (worker->error_type == QNetworkReply::NoError) {
|
||||||
|
msg = QString("Success! %1 bytes").arg(worker->response.length());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
msg = "Error: " + worker->error_str;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QString json(worker->response);
|
||||||
|
SWGChannelSettings* output = static_cast<SWGChannelSettings*>(create(json, QString("SWGChannelSettings")));
|
||||||
|
worker->deleteLater();
|
||||||
|
|
||||||
|
emit devicesetChannelDeleteSignal(output);
|
||||||
|
emit devicesetChannelDeleteSignalE(output, error_type, error_str);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SWGDeviceSetApi::devicesetChannelPost(qint32 device_set_index, SWGChannelSettings body) {
|
||||||
|
QString fullPath;
|
||||||
|
fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}/channel");
|
||||||
|
|
||||||
|
QString device_set_indexPathParam("{"); device_set_indexPathParam.append("deviceSetIndex").append("}");
|
||||||
|
fullPath.replace(device_set_indexPathParam, stringValue(device_set_index));
|
||||||
|
|
||||||
|
|
||||||
|
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||||
|
HttpRequestInput input(fullPath, "POST");
|
||||||
|
|
||||||
|
|
||||||
|
QString output = body.asJson();
|
||||||
|
input.request_body.append(output);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
foreach(QString key, this->defaultHeaders.keys()) {
|
||||||
|
input.headers.insert(key, this->defaultHeaders.value(key));
|
||||||
|
}
|
||||||
|
|
||||||
|
connect(worker,
|
||||||
|
&HttpRequestWorker::on_execution_finished,
|
||||||
|
this,
|
||||||
|
&SWGDeviceSetApi::devicesetChannelPostCallback);
|
||||||
|
|
||||||
|
worker->execute(&input);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SWGDeviceSetApi::devicesetChannelPostCallback(HttpRequestWorker * worker) {
|
||||||
|
QString msg;
|
||||||
|
QString error_str = worker->error_str;
|
||||||
|
QNetworkReply::NetworkError error_type = worker->error_type;
|
||||||
|
|
||||||
|
if (worker->error_type == QNetworkReply::NoError) {
|
||||||
|
msg = QString("Success! %1 bytes").arg(worker->response.length());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
msg = "Error: " + worker->error_str;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QString json(worker->response);
|
||||||
|
SWGChannelSettings* output = static_cast<SWGChannelSettings*>(create(json, QString("SWGChannelSettings")));
|
||||||
|
worker->deleteLater();
|
||||||
|
|
||||||
|
emit devicesetChannelPostSignal(output);
|
||||||
|
emit devicesetChannelPostSignalE(output, error_type, error_str);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SWGDeviceSetApi::devicesetChannelSettingsGet(qint32 device_set_index, qint32 channel_index) {
|
||||||
|
QString fullPath;
|
||||||
|
fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}/channel/{channelIndex}/settings");
|
||||||
|
|
||||||
|
QString device_set_indexPathParam("{"); device_set_indexPathParam.append("deviceSetIndex").append("}");
|
||||||
|
fullPath.replace(device_set_indexPathParam, stringValue(device_set_index));
|
||||||
|
QString channel_indexPathParam("{"); channel_indexPathParam.append("channelIndex").append("}");
|
||||||
|
fullPath.replace(channel_indexPathParam, stringValue(channel_index));
|
||||||
|
|
||||||
|
|
||||||
|
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||||
|
HttpRequestInput input(fullPath, "GET");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
foreach(QString key, this->defaultHeaders.keys()) {
|
||||||
|
input.headers.insert(key, this->defaultHeaders.value(key));
|
||||||
|
}
|
||||||
|
|
||||||
|
connect(worker,
|
||||||
|
&HttpRequestWorker::on_execution_finished,
|
||||||
|
this,
|
||||||
|
&SWGDeviceSetApi::devicesetChannelSettingsGetCallback);
|
||||||
|
|
||||||
|
worker->execute(&input);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SWGDeviceSetApi::devicesetChannelSettingsGetCallback(HttpRequestWorker * worker) {
|
||||||
|
QString msg;
|
||||||
|
QString error_str = worker->error_str;
|
||||||
|
QNetworkReply::NetworkError error_type = worker->error_type;
|
||||||
|
|
||||||
|
if (worker->error_type == QNetworkReply::NoError) {
|
||||||
|
msg = QString("Success! %1 bytes").arg(worker->response.length());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
msg = "Error: " + worker->error_str;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QString json(worker->response);
|
||||||
|
SWGChannelSettings* output = static_cast<SWGChannelSettings*>(create(json, QString("SWGChannelSettings")));
|
||||||
|
worker->deleteLater();
|
||||||
|
|
||||||
|
emit devicesetChannelSettingsGetSignal(output);
|
||||||
|
emit devicesetChannelSettingsGetSignalE(output, error_type, error_str);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SWGDeviceSetApi::devicesetChannelSettingsPatch(qint32 device_set_index, qint32 channel_index) {
|
||||||
|
QString fullPath;
|
||||||
|
fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}/channel/{channelIndex}/settings");
|
||||||
|
|
||||||
|
QString device_set_indexPathParam("{"); device_set_indexPathParam.append("deviceSetIndex").append("}");
|
||||||
|
fullPath.replace(device_set_indexPathParam, stringValue(device_set_index));
|
||||||
|
QString channel_indexPathParam("{"); channel_indexPathParam.append("channelIndex").append("}");
|
||||||
|
fullPath.replace(channel_indexPathParam, stringValue(channel_index));
|
||||||
|
|
||||||
|
|
||||||
|
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||||
|
HttpRequestInput input(fullPath, "PATCH");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
foreach(QString key, this->defaultHeaders.keys()) {
|
||||||
|
input.headers.insert(key, this->defaultHeaders.value(key));
|
||||||
|
}
|
||||||
|
|
||||||
|
connect(worker,
|
||||||
|
&HttpRequestWorker::on_execution_finished,
|
||||||
|
this,
|
||||||
|
&SWGDeviceSetApi::devicesetChannelSettingsPatchCallback);
|
||||||
|
|
||||||
|
worker->execute(&input);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SWGDeviceSetApi::devicesetChannelSettingsPatchCallback(HttpRequestWorker * worker) {
|
||||||
|
QString msg;
|
||||||
|
QString error_str = worker->error_str;
|
||||||
|
QNetworkReply::NetworkError error_type = worker->error_type;
|
||||||
|
|
||||||
|
if (worker->error_type == QNetworkReply::NoError) {
|
||||||
|
msg = QString("Success! %1 bytes").arg(worker->response.length());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
msg = "Error: " + worker->error_str;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QString json(worker->response);
|
||||||
|
SWGChannelSettings* output = static_cast<SWGChannelSettings*>(create(json, QString("SWGChannelSettings")));
|
||||||
|
worker->deleteLater();
|
||||||
|
|
||||||
|
emit devicesetChannelSettingsPatchSignal(output);
|
||||||
|
emit devicesetChannelSettingsPatchSignalE(output, error_type, error_str);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SWGDeviceSetApi::devicesetChannelSettingsPut(qint32 device_set_index, qint32 channel_index) {
|
||||||
|
QString fullPath;
|
||||||
|
fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}/channel/{channelIndex}/settings");
|
||||||
|
|
||||||
|
QString device_set_indexPathParam("{"); device_set_indexPathParam.append("deviceSetIndex").append("}");
|
||||||
|
fullPath.replace(device_set_indexPathParam, stringValue(device_set_index));
|
||||||
|
QString channel_indexPathParam("{"); channel_indexPathParam.append("channelIndex").append("}");
|
||||||
|
fullPath.replace(channel_indexPathParam, stringValue(channel_index));
|
||||||
|
|
||||||
|
|
||||||
|
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||||
|
HttpRequestInput input(fullPath, "PUT");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
foreach(QString key, this->defaultHeaders.keys()) {
|
||||||
|
input.headers.insert(key, this->defaultHeaders.value(key));
|
||||||
|
}
|
||||||
|
|
||||||
|
connect(worker,
|
||||||
|
&HttpRequestWorker::on_execution_finished,
|
||||||
|
this,
|
||||||
|
&SWGDeviceSetApi::devicesetChannelSettingsPutCallback);
|
||||||
|
|
||||||
|
worker->execute(&input);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SWGDeviceSetApi::devicesetChannelSettingsPutCallback(HttpRequestWorker * worker) {
|
||||||
|
QString msg;
|
||||||
|
QString error_str = worker->error_str;
|
||||||
|
QNetworkReply::NetworkError error_type = worker->error_type;
|
||||||
|
|
||||||
|
if (worker->error_type == QNetworkReply::NoError) {
|
||||||
|
msg = QString("Success! %1 bytes").arg(worker->response.length());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
msg = "Error: " + worker->error_str;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QString json(worker->response);
|
||||||
|
SWGChannelSettings* output = static_cast<SWGChannelSettings*>(create(json, QString("SWGChannelSettings")));
|
||||||
|
worker->deleteLater();
|
||||||
|
|
||||||
|
emit devicesetChannelSettingsPutSignal(output);
|
||||||
|
emit devicesetChannelSettingsPutSignalE(output, error_type, error_str);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
SWGDeviceSetApi::devicesetDevicePut(qint32 device_set_index, SWGDeviceListItem body) {
|
SWGDeviceSetApi::devicesetDevicePut(qint32 device_set_index, SWGDeviceListItem body) {
|
||||||
QString fullPath;
|
QString fullPath;
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
#include "SWGHttpRequest.h"
|
#include "SWGHttpRequest.h"
|
||||||
|
|
||||||
|
#include "SWGChannelSettings.h"
|
||||||
#include "SWGDeviceListItem.h"
|
#include "SWGDeviceListItem.h"
|
||||||
#include "SWGDeviceSet.h"
|
#include "SWGDeviceSet.h"
|
||||||
#include "SWGDeviceSettings.h"
|
#include "SWGDeviceSettings.h"
|
||||||
@ -37,6 +38,11 @@ public:
|
|||||||
QString basePath;
|
QString basePath;
|
||||||
QMap<QString, QString> defaultHeaders;
|
QMap<QString, QString> defaultHeaders;
|
||||||
|
|
||||||
|
void devicesetChannelDelete(qint32 device_set_index, qint32 channel_index);
|
||||||
|
void devicesetChannelPost(qint32 device_set_index, SWGChannelSettings body);
|
||||||
|
void devicesetChannelSettingsGet(qint32 device_set_index, qint32 channel_index);
|
||||||
|
void devicesetChannelSettingsPatch(qint32 device_set_index, qint32 channel_index);
|
||||||
|
void devicesetChannelSettingsPut(qint32 device_set_index, qint32 channel_index);
|
||||||
void devicesetDevicePut(qint32 device_set_index, SWGDeviceListItem body);
|
void devicesetDevicePut(qint32 device_set_index, SWGDeviceListItem body);
|
||||||
void devicesetDeviceRunDelete(qint32 device_set_index);
|
void devicesetDeviceRunDelete(qint32 device_set_index);
|
||||||
void devicesetDeviceRunGet(qint32 device_set_index);
|
void devicesetDeviceRunGet(qint32 device_set_index);
|
||||||
@ -47,6 +53,11 @@ public:
|
|||||||
void devicesetGet(qint32 device_set_index);
|
void devicesetGet(qint32 device_set_index);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void devicesetChannelDeleteCallback (HttpRequestWorker * worker);
|
||||||
|
void devicesetChannelPostCallback (HttpRequestWorker * worker);
|
||||||
|
void devicesetChannelSettingsGetCallback (HttpRequestWorker * worker);
|
||||||
|
void devicesetChannelSettingsPatchCallback (HttpRequestWorker * worker);
|
||||||
|
void devicesetChannelSettingsPutCallback (HttpRequestWorker * worker);
|
||||||
void devicesetDevicePutCallback (HttpRequestWorker * worker);
|
void devicesetDevicePutCallback (HttpRequestWorker * worker);
|
||||||
void devicesetDeviceRunDeleteCallback (HttpRequestWorker * worker);
|
void devicesetDeviceRunDeleteCallback (HttpRequestWorker * worker);
|
||||||
void devicesetDeviceRunGetCallback (HttpRequestWorker * worker);
|
void devicesetDeviceRunGetCallback (HttpRequestWorker * worker);
|
||||||
@ -57,6 +68,11 @@ private:
|
|||||||
void devicesetGetCallback (HttpRequestWorker * worker);
|
void devicesetGetCallback (HttpRequestWorker * worker);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
void devicesetChannelDeleteSignal(SWGChannelSettings* summary);
|
||||||
|
void devicesetChannelPostSignal(SWGChannelSettings* summary);
|
||||||
|
void devicesetChannelSettingsGetSignal(SWGChannelSettings* summary);
|
||||||
|
void devicesetChannelSettingsPatchSignal(SWGChannelSettings* summary);
|
||||||
|
void devicesetChannelSettingsPutSignal(SWGChannelSettings* summary);
|
||||||
void devicesetDevicePutSignal(SWGDeviceListItem* summary);
|
void devicesetDevicePutSignal(SWGDeviceListItem* summary);
|
||||||
void devicesetDeviceRunDeleteSignal(SWGDeviceState* summary);
|
void devicesetDeviceRunDeleteSignal(SWGDeviceState* summary);
|
||||||
void devicesetDeviceRunGetSignal(SWGDeviceState* summary);
|
void devicesetDeviceRunGetSignal(SWGDeviceState* summary);
|
||||||
@ -66,6 +82,11 @@ signals:
|
|||||||
void devicesetDeviceSettingsPutSignal(SWGDeviceSettings* summary);
|
void devicesetDeviceSettingsPutSignal(SWGDeviceSettings* summary);
|
||||||
void devicesetGetSignal(SWGDeviceSet* summary);
|
void devicesetGetSignal(SWGDeviceSet* summary);
|
||||||
|
|
||||||
|
void devicesetChannelDeleteSignalE(SWGChannelSettings* summary, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||||
|
void devicesetChannelPostSignalE(SWGChannelSettings* summary, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||||
|
void devicesetChannelSettingsGetSignalE(SWGChannelSettings* summary, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||||
|
void devicesetChannelSettingsPatchSignalE(SWGChannelSettings* summary, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||||
|
void devicesetChannelSettingsPutSignalE(SWGChannelSettings* summary, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||||
void devicesetDevicePutSignalE(SWGDeviceListItem* summary, QNetworkReply::NetworkError error_type, QString& error_str);
|
void devicesetDevicePutSignalE(SWGDeviceListItem* summary, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||||
void devicesetDeviceRunDeleteSignalE(SWGDeviceState* summary, QNetworkReply::NetworkError error_type, QString& error_str);
|
void devicesetDeviceRunDeleteSignalE(SWGDeviceState* summary, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||||
void devicesetDeviceRunGetSignalE(SWGDeviceState* summary, QNetworkReply::NetworkError error_type, QString& error_str);
|
void devicesetDeviceRunGetSignalE(SWGDeviceState* summary, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||||
|
@ -17,8 +17,10 @@
|
|||||||
#include "SWGAudioDevice.h"
|
#include "SWGAudioDevice.h"
|
||||||
#include "SWGAudioDevices.h"
|
#include "SWGAudioDevices.h"
|
||||||
#include "SWGAudioDevicesSelect.h"
|
#include "SWGAudioDevicesSelect.h"
|
||||||
|
#include "SWGCWKeyerSettings.h"
|
||||||
#include "SWGChannel.h"
|
#include "SWGChannel.h"
|
||||||
#include "SWGChannelListItem.h"
|
#include "SWGChannelListItem.h"
|
||||||
|
#include "SWGChannelSettings.h"
|
||||||
#include "SWGDVSeralDevices.h"
|
#include "SWGDVSeralDevices.h"
|
||||||
#include "SWGDVSerialDevice.h"
|
#include "SWGDVSerialDevice.h"
|
||||||
#include "SWGDeviceListItem.h"
|
#include "SWGDeviceListItem.h"
|
||||||
@ -35,6 +37,8 @@
|
|||||||
#include "SWGLimeSdrOutputSettings.h"
|
#include "SWGLimeSdrOutputSettings.h"
|
||||||
#include "SWGLocationInformation.h"
|
#include "SWGLocationInformation.h"
|
||||||
#include "SWGLoggingInfo.h"
|
#include "SWGLoggingInfo.h"
|
||||||
|
#include "SWGNFMDemodSettings.h"
|
||||||
|
#include "SWGNFMModSettings.h"
|
||||||
#include "SWGPresetGroup.h"
|
#include "SWGPresetGroup.h"
|
||||||
#include "SWGPresetIdentifier.h"
|
#include "SWGPresetIdentifier.h"
|
||||||
#include "SWGPresetItem.h"
|
#include "SWGPresetItem.h"
|
||||||
@ -55,12 +59,18 @@ namespace SWGSDRangel {
|
|||||||
if(QString("SWGAudioDevicesSelect").compare(type) == 0) {
|
if(QString("SWGAudioDevicesSelect").compare(type) == 0) {
|
||||||
return new SWGAudioDevicesSelect();
|
return new SWGAudioDevicesSelect();
|
||||||
}
|
}
|
||||||
|
if(QString("SWGCWKeyerSettings").compare(type) == 0) {
|
||||||
|
return new SWGCWKeyerSettings();
|
||||||
|
}
|
||||||
if(QString("SWGChannel").compare(type) == 0) {
|
if(QString("SWGChannel").compare(type) == 0) {
|
||||||
return new SWGChannel();
|
return new SWGChannel();
|
||||||
}
|
}
|
||||||
if(QString("SWGChannelListItem").compare(type) == 0) {
|
if(QString("SWGChannelListItem").compare(type) == 0) {
|
||||||
return new SWGChannelListItem();
|
return new SWGChannelListItem();
|
||||||
}
|
}
|
||||||
|
if(QString("SWGChannelSettings").compare(type) == 0) {
|
||||||
|
return new SWGChannelSettings();
|
||||||
|
}
|
||||||
if(QString("SWGDVSeralDevices").compare(type) == 0) {
|
if(QString("SWGDVSeralDevices").compare(type) == 0) {
|
||||||
return new SWGDVSeralDevices();
|
return new SWGDVSeralDevices();
|
||||||
}
|
}
|
||||||
@ -109,6 +119,12 @@ namespace SWGSDRangel {
|
|||||||
if(QString("SWGLoggingInfo").compare(type) == 0) {
|
if(QString("SWGLoggingInfo").compare(type) == 0) {
|
||||||
return new SWGLoggingInfo();
|
return new SWGLoggingInfo();
|
||||||
}
|
}
|
||||||
|
if(QString("SWGNFMDemodSettings").compare(type) == 0) {
|
||||||
|
return new SWGNFMDemodSettings();
|
||||||
|
}
|
||||||
|
if(QString("SWGNFMModSettings").compare(type) == 0) {
|
||||||
|
return new SWGNFMModSettings();
|
||||||
|
}
|
||||||
if(QString("SWGPresetGroup").compare(type) == 0) {
|
if(QString("SWGPresetGroup").compare(type) == 0) {
|
||||||
return new SWGPresetGroup();
|
return new SWGPresetGroup();
|
||||||
}
|
}
|
||||||
|
336
swagger/sdrangel/code/qt5/client/SWGNFMDemodSettings.cpp
Normal file
336
swagger/sdrangel/code/qt5/client/SWGNFMDemodSettings.cpp
Normal file
@ -0,0 +1,336 @@
|
|||||||
|
/**
|
||||||
|
* SDRangel
|
||||||
|
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 4.0.0
|
||||||
|
* Contact: f4exb06@gmail.com
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "SWGNFMDemodSettings.h"
|
||||||
|
|
||||||
|
#include "SWGHelpers.h"
|
||||||
|
|
||||||
|
#include <QJsonDocument>
|
||||||
|
#include <QJsonArray>
|
||||||
|
#include <QObject>
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
|
namespace SWGSDRangel {
|
||||||
|
|
||||||
|
SWGNFMDemodSettings::SWGNFMDemodSettings(QString* json) {
|
||||||
|
init();
|
||||||
|
this->fromJson(*json);
|
||||||
|
}
|
||||||
|
|
||||||
|
SWGNFMDemodSettings::SWGNFMDemodSettings() {
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
SWGNFMDemodSettings::~SWGNFMDemodSettings() {
|
||||||
|
this->cleanup();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SWGNFMDemodSettings::init() {
|
||||||
|
input_sample_rate = 0;
|
||||||
|
input_frequency_offset = 0L;
|
||||||
|
rf_bandwidth = 0.0f;
|
||||||
|
af_bandwidth = 0.0f;
|
||||||
|
fm_deviation = 0;
|
||||||
|
squelch_gate = 0;
|
||||||
|
delta_squelch = 0;
|
||||||
|
squelch = 0.0f;
|
||||||
|
volume = 0.0f;
|
||||||
|
ctcss_on = 0;
|
||||||
|
audio_mute = 0;
|
||||||
|
ctcss_index = 0;
|
||||||
|
audio_sample_rate = 0;
|
||||||
|
copy_audio_to_udp = 0;
|
||||||
|
udp_address = new QString("");
|
||||||
|
udp_port = 0;
|
||||||
|
rgb_color = 0;
|
||||||
|
title = new QString("");
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SWGNFMDemodSettings::cleanup() {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if(udp_address != nullptr) {
|
||||||
|
delete udp_address;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if(title != nullptr) {
|
||||||
|
delete title;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SWGNFMDemodSettings*
|
||||||
|
SWGNFMDemodSettings::fromJson(QString &json) {
|
||||||
|
QByteArray array (json.toStdString().c_str());
|
||||||
|
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||||
|
QJsonObject jsonObject = doc.object();
|
||||||
|
this->fromJsonObject(jsonObject);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SWGNFMDemodSettings::fromJsonObject(QJsonObject &pJson) {
|
||||||
|
::SWGSDRangel::setValue(&input_sample_rate, pJson["inputSampleRate"], "qint32", "");
|
||||||
|
::SWGSDRangel::setValue(&input_frequency_offset, pJson["inputFrequencyOffset"], "qint64", "");
|
||||||
|
::SWGSDRangel::setValue(&rf_bandwidth, pJson["rfBandwidth"], "float", "");
|
||||||
|
::SWGSDRangel::setValue(&af_bandwidth, pJson["afBandwidth"], "float", "");
|
||||||
|
::SWGSDRangel::setValue(&fm_deviation, pJson["fmDeviation"], "qint32", "");
|
||||||
|
::SWGSDRangel::setValue(&squelch_gate, pJson["squelchGate"], "qint32", "");
|
||||||
|
::SWGSDRangel::setValue(&delta_squelch, pJson["deltaSquelch"], "qint32", "");
|
||||||
|
::SWGSDRangel::setValue(&squelch, pJson["squelch"], "float", "");
|
||||||
|
::SWGSDRangel::setValue(&volume, pJson["volume"], "float", "");
|
||||||
|
::SWGSDRangel::setValue(&ctcss_on, pJson["ctcssOn"], "qint32", "");
|
||||||
|
::SWGSDRangel::setValue(&audio_mute, pJson["audioMute"], "qint32", "");
|
||||||
|
::SWGSDRangel::setValue(&ctcss_index, pJson["ctcssIndex"], "qint32", "");
|
||||||
|
::SWGSDRangel::setValue(&audio_sample_rate, pJson["audioSampleRate"], "qint32", "");
|
||||||
|
::SWGSDRangel::setValue(©_audio_to_udp, pJson["copyAudioToUDP"], "qint32", "");
|
||||||
|
::SWGSDRangel::setValue(&udp_address, pJson["udpAddress"], "QString", "QString");
|
||||||
|
::SWGSDRangel::setValue(&udp_port, pJson["udpPort"], "qint32", "");
|
||||||
|
::SWGSDRangel::setValue(&rgb_color, pJson["rgbColor"], "qint32", "");
|
||||||
|
::SWGSDRangel::setValue(&title, pJson["title"], "QString", "QString");
|
||||||
|
}
|
||||||
|
|
||||||
|
QString
|
||||||
|
SWGNFMDemodSettings::asJson ()
|
||||||
|
{
|
||||||
|
QJsonObject* obj = this->asJsonObject();
|
||||||
|
|
||||||
|
QJsonDocument doc(*obj);
|
||||||
|
QByteArray bytes = doc.toJson();
|
||||||
|
return QString(bytes);
|
||||||
|
}
|
||||||
|
|
||||||
|
QJsonObject*
|
||||||
|
SWGNFMDemodSettings::asJsonObject() {
|
||||||
|
QJsonObject* obj = new QJsonObject();
|
||||||
|
|
||||||
|
obj->insert("inputSampleRate", QJsonValue(input_sample_rate));
|
||||||
|
|
||||||
|
obj->insert("inputFrequencyOffset", QJsonValue(input_frequency_offset));
|
||||||
|
|
||||||
|
obj->insert("rfBandwidth", QJsonValue(rf_bandwidth));
|
||||||
|
|
||||||
|
obj->insert("afBandwidth", QJsonValue(af_bandwidth));
|
||||||
|
|
||||||
|
obj->insert("fmDeviation", QJsonValue(fm_deviation));
|
||||||
|
|
||||||
|
obj->insert("squelchGate", QJsonValue(squelch_gate));
|
||||||
|
|
||||||
|
obj->insert("deltaSquelch", QJsonValue(delta_squelch));
|
||||||
|
|
||||||
|
obj->insert("squelch", QJsonValue(squelch));
|
||||||
|
|
||||||
|
obj->insert("volume", QJsonValue(volume));
|
||||||
|
|
||||||
|
obj->insert("ctcssOn", QJsonValue(ctcss_on));
|
||||||
|
|
||||||
|
obj->insert("audioMute", QJsonValue(audio_mute));
|
||||||
|
|
||||||
|
obj->insert("ctcssIndex", QJsonValue(ctcss_index));
|
||||||
|
|
||||||
|
obj->insert("audioSampleRate", QJsonValue(audio_sample_rate));
|
||||||
|
|
||||||
|
obj->insert("copyAudioToUDP", QJsonValue(copy_audio_to_udp));
|
||||||
|
|
||||||
|
toJsonValue(QString("udpAddress"), udp_address, obj, QString("QString"));
|
||||||
|
|
||||||
|
obj->insert("udpPort", QJsonValue(udp_port));
|
||||||
|
|
||||||
|
obj->insert("rgbColor", QJsonValue(rgb_color));
|
||||||
|
|
||||||
|
toJsonValue(QString("title"), title, obj, QString("QString"));
|
||||||
|
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
qint32
|
||||||
|
SWGNFMDemodSettings::getInputSampleRate() {
|
||||||
|
return input_sample_rate;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGNFMDemodSettings::setInputSampleRate(qint32 input_sample_rate) {
|
||||||
|
this->input_sample_rate = input_sample_rate;
|
||||||
|
}
|
||||||
|
|
||||||
|
qint64
|
||||||
|
SWGNFMDemodSettings::getInputFrequencyOffset() {
|
||||||
|
return input_frequency_offset;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGNFMDemodSettings::setInputFrequencyOffset(qint64 input_frequency_offset) {
|
||||||
|
this->input_frequency_offset = input_frequency_offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
float
|
||||||
|
SWGNFMDemodSettings::getRfBandwidth() {
|
||||||
|
return rf_bandwidth;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGNFMDemodSettings::setRfBandwidth(float rf_bandwidth) {
|
||||||
|
this->rf_bandwidth = rf_bandwidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
float
|
||||||
|
SWGNFMDemodSettings::getAfBandwidth() {
|
||||||
|
return af_bandwidth;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGNFMDemodSettings::setAfBandwidth(float af_bandwidth) {
|
||||||
|
this->af_bandwidth = af_bandwidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
qint32
|
||||||
|
SWGNFMDemodSettings::getFmDeviation() {
|
||||||
|
return fm_deviation;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGNFMDemodSettings::setFmDeviation(qint32 fm_deviation) {
|
||||||
|
this->fm_deviation = fm_deviation;
|
||||||
|
}
|
||||||
|
|
||||||
|
qint32
|
||||||
|
SWGNFMDemodSettings::getSquelchGate() {
|
||||||
|
return squelch_gate;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGNFMDemodSettings::setSquelchGate(qint32 squelch_gate) {
|
||||||
|
this->squelch_gate = squelch_gate;
|
||||||
|
}
|
||||||
|
|
||||||
|
qint32
|
||||||
|
SWGNFMDemodSettings::getDeltaSquelch() {
|
||||||
|
return delta_squelch;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGNFMDemodSettings::setDeltaSquelch(qint32 delta_squelch) {
|
||||||
|
this->delta_squelch = delta_squelch;
|
||||||
|
}
|
||||||
|
|
||||||
|
float
|
||||||
|
SWGNFMDemodSettings::getSquelch() {
|
||||||
|
return squelch;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGNFMDemodSettings::setSquelch(float squelch) {
|
||||||
|
this->squelch = squelch;
|
||||||
|
}
|
||||||
|
|
||||||
|
float
|
||||||
|
SWGNFMDemodSettings::getVolume() {
|
||||||
|
return volume;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGNFMDemodSettings::setVolume(float volume) {
|
||||||
|
this->volume = volume;
|
||||||
|
}
|
||||||
|
|
||||||
|
qint32
|
||||||
|
SWGNFMDemodSettings::getCtcssOn() {
|
||||||
|
return ctcss_on;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGNFMDemodSettings::setCtcssOn(qint32 ctcss_on) {
|
||||||
|
this->ctcss_on = ctcss_on;
|
||||||
|
}
|
||||||
|
|
||||||
|
qint32
|
||||||
|
SWGNFMDemodSettings::getAudioMute() {
|
||||||
|
return audio_mute;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGNFMDemodSettings::setAudioMute(qint32 audio_mute) {
|
||||||
|
this->audio_mute = audio_mute;
|
||||||
|
}
|
||||||
|
|
||||||
|
qint32
|
||||||
|
SWGNFMDemodSettings::getCtcssIndex() {
|
||||||
|
return ctcss_index;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGNFMDemodSettings::setCtcssIndex(qint32 ctcss_index) {
|
||||||
|
this->ctcss_index = ctcss_index;
|
||||||
|
}
|
||||||
|
|
||||||
|
qint32
|
||||||
|
SWGNFMDemodSettings::getAudioSampleRate() {
|
||||||
|
return audio_sample_rate;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGNFMDemodSettings::setAudioSampleRate(qint32 audio_sample_rate) {
|
||||||
|
this->audio_sample_rate = audio_sample_rate;
|
||||||
|
}
|
||||||
|
|
||||||
|
qint32
|
||||||
|
SWGNFMDemodSettings::getCopyAudioToUdp() {
|
||||||
|
return copy_audio_to_udp;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGNFMDemodSettings::setCopyAudioToUdp(qint32 copy_audio_to_udp) {
|
||||||
|
this->copy_audio_to_udp = copy_audio_to_udp;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString*
|
||||||
|
SWGNFMDemodSettings::getUdpAddress() {
|
||||||
|
return udp_address;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGNFMDemodSettings::setUdpAddress(QString* udp_address) {
|
||||||
|
this->udp_address = udp_address;
|
||||||
|
}
|
||||||
|
|
||||||
|
qint32
|
||||||
|
SWGNFMDemodSettings::getUdpPort() {
|
||||||
|
return udp_port;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGNFMDemodSettings::setUdpPort(qint32 udp_port) {
|
||||||
|
this->udp_port = udp_port;
|
||||||
|
}
|
||||||
|
|
||||||
|
qint32
|
||||||
|
SWGNFMDemodSettings::getRgbColor() {
|
||||||
|
return rgb_color;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGNFMDemodSettings::setRgbColor(qint32 rgb_color) {
|
||||||
|
this->rgb_color = rgb_color;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString*
|
||||||
|
SWGNFMDemodSettings::getTitle() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGNFMDemodSettings::setTitle(QString* title) {
|
||||||
|
this->title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
123
swagger/sdrangel/code/qt5/client/SWGNFMDemodSettings.h
Normal file
123
swagger/sdrangel/code/qt5/client/SWGNFMDemodSettings.h
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
/**
|
||||||
|
* SDRangel
|
||||||
|
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 4.0.0
|
||||||
|
* Contact: f4exb06@gmail.com
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* SWGNFMDemodSettings.h
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SWGNFMDemodSettings_H_
|
||||||
|
#define SWGNFMDemodSettings_H_
|
||||||
|
|
||||||
|
#include <QJsonObject>
|
||||||
|
|
||||||
|
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
|
#include "SWGObject.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace SWGSDRangel {
|
||||||
|
|
||||||
|
class SWGNFMDemodSettings: public SWGObject {
|
||||||
|
public:
|
||||||
|
SWGNFMDemodSettings();
|
||||||
|
SWGNFMDemodSettings(QString* json);
|
||||||
|
virtual ~SWGNFMDemodSettings();
|
||||||
|
void init();
|
||||||
|
void cleanup();
|
||||||
|
|
||||||
|
QString asJson ();
|
||||||
|
QJsonObject* asJsonObject();
|
||||||
|
void fromJsonObject(QJsonObject &json);
|
||||||
|
SWGNFMDemodSettings* fromJson(QString &jsonString);
|
||||||
|
|
||||||
|
qint32 getInputSampleRate();
|
||||||
|
void setInputSampleRate(qint32 input_sample_rate);
|
||||||
|
|
||||||
|
qint64 getInputFrequencyOffset();
|
||||||
|
void setInputFrequencyOffset(qint64 input_frequency_offset);
|
||||||
|
|
||||||
|
float getRfBandwidth();
|
||||||
|
void setRfBandwidth(float rf_bandwidth);
|
||||||
|
|
||||||
|
float getAfBandwidth();
|
||||||
|
void setAfBandwidth(float af_bandwidth);
|
||||||
|
|
||||||
|
qint32 getFmDeviation();
|
||||||
|
void setFmDeviation(qint32 fm_deviation);
|
||||||
|
|
||||||
|
qint32 getSquelchGate();
|
||||||
|
void setSquelchGate(qint32 squelch_gate);
|
||||||
|
|
||||||
|
qint32 getDeltaSquelch();
|
||||||
|
void setDeltaSquelch(qint32 delta_squelch);
|
||||||
|
|
||||||
|
float getSquelch();
|
||||||
|
void setSquelch(float squelch);
|
||||||
|
|
||||||
|
float getVolume();
|
||||||
|
void setVolume(float volume);
|
||||||
|
|
||||||
|
qint32 getCtcssOn();
|
||||||
|
void setCtcssOn(qint32 ctcss_on);
|
||||||
|
|
||||||
|
qint32 getAudioMute();
|
||||||
|
void setAudioMute(qint32 audio_mute);
|
||||||
|
|
||||||
|
qint32 getCtcssIndex();
|
||||||
|
void setCtcssIndex(qint32 ctcss_index);
|
||||||
|
|
||||||
|
qint32 getAudioSampleRate();
|
||||||
|
void setAudioSampleRate(qint32 audio_sample_rate);
|
||||||
|
|
||||||
|
qint32 getCopyAudioToUdp();
|
||||||
|
void setCopyAudioToUdp(qint32 copy_audio_to_udp);
|
||||||
|
|
||||||
|
QString* getUdpAddress();
|
||||||
|
void setUdpAddress(QString* udp_address);
|
||||||
|
|
||||||
|
qint32 getUdpPort();
|
||||||
|
void setUdpPort(qint32 udp_port);
|
||||||
|
|
||||||
|
qint32 getRgbColor();
|
||||||
|
void setRgbColor(qint32 rgb_color);
|
||||||
|
|
||||||
|
QString* getTitle();
|
||||||
|
void setTitle(QString* title);
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
qint32 input_sample_rate;
|
||||||
|
qint64 input_frequency_offset;
|
||||||
|
float rf_bandwidth;
|
||||||
|
float af_bandwidth;
|
||||||
|
qint32 fm_deviation;
|
||||||
|
qint32 squelch_gate;
|
||||||
|
qint32 delta_squelch;
|
||||||
|
float squelch;
|
||||||
|
float volume;
|
||||||
|
qint32 ctcss_on;
|
||||||
|
qint32 audio_mute;
|
||||||
|
qint32 ctcss_index;
|
||||||
|
qint32 audio_sample_rate;
|
||||||
|
qint32 copy_audio_to_udp;
|
||||||
|
QString* udp_address;
|
||||||
|
qint32 udp_port;
|
||||||
|
qint32 rgb_color;
|
||||||
|
QString* title;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* SWGNFMDemodSettings_H_ */
|
308
swagger/sdrangel/code/qt5/client/SWGNFMModSettings.cpp
Normal file
308
swagger/sdrangel/code/qt5/client/SWGNFMModSettings.cpp
Normal file
@ -0,0 +1,308 @@
|
|||||||
|
/**
|
||||||
|
* SDRangel
|
||||||
|
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 4.0.0
|
||||||
|
* Contact: f4exb06@gmail.com
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "SWGNFMModSettings.h"
|
||||||
|
|
||||||
|
#include "SWGHelpers.h"
|
||||||
|
|
||||||
|
#include <QJsonDocument>
|
||||||
|
#include <QJsonArray>
|
||||||
|
#include <QObject>
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
|
namespace SWGSDRangel {
|
||||||
|
|
||||||
|
SWGNFMModSettings::SWGNFMModSettings(QString* json) {
|
||||||
|
init();
|
||||||
|
this->fromJson(*json);
|
||||||
|
}
|
||||||
|
|
||||||
|
SWGNFMModSettings::SWGNFMModSettings() {
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
SWGNFMModSettings::~SWGNFMModSettings() {
|
||||||
|
this->cleanup();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SWGNFMModSettings::init() {
|
||||||
|
baseband_sample_rate = 0;
|
||||||
|
output_sample_rate = 0;
|
||||||
|
input_frequency_offset = 0L;
|
||||||
|
rf_bandwidth = 0.0f;
|
||||||
|
af_bandwidth = 0.0f;
|
||||||
|
fm_deviation = 0.0f;
|
||||||
|
tone_frequency = 0.0f;
|
||||||
|
volume_factor = 0.0f;
|
||||||
|
audio_sample_rate = 0;
|
||||||
|
channel_mute = 0;
|
||||||
|
play_loop = 0;
|
||||||
|
ctcss_on = 0;
|
||||||
|
ctcss_index = 0;
|
||||||
|
rgb_color = 0;
|
||||||
|
title = new QString("");
|
||||||
|
cw_keyer = new SWGCWKeyerSettings();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SWGNFMModSettings::cleanup() {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if(title != nullptr) {
|
||||||
|
delete title;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(cw_keyer != nullptr) {
|
||||||
|
delete cw_keyer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SWGNFMModSettings*
|
||||||
|
SWGNFMModSettings::fromJson(QString &json) {
|
||||||
|
QByteArray array (json.toStdString().c_str());
|
||||||
|
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||||
|
QJsonObject jsonObject = doc.object();
|
||||||
|
this->fromJsonObject(jsonObject);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SWGNFMModSettings::fromJsonObject(QJsonObject &pJson) {
|
||||||
|
::SWGSDRangel::setValue(&baseband_sample_rate, pJson["basebandSampleRate"], "qint32", "");
|
||||||
|
::SWGSDRangel::setValue(&output_sample_rate, pJson["outputSampleRate"], "qint32", "");
|
||||||
|
::SWGSDRangel::setValue(&input_frequency_offset, pJson["inputFrequencyOffset"], "qint64", "");
|
||||||
|
::SWGSDRangel::setValue(&rf_bandwidth, pJson["rfBandwidth"], "float", "");
|
||||||
|
::SWGSDRangel::setValue(&af_bandwidth, pJson["afBandwidth"], "float", "");
|
||||||
|
::SWGSDRangel::setValue(&fm_deviation, pJson["fmDeviation"], "float", "");
|
||||||
|
::SWGSDRangel::setValue(&tone_frequency, pJson["toneFrequency"], "float", "");
|
||||||
|
::SWGSDRangel::setValue(&volume_factor, pJson["volumeFactor"], "float", "");
|
||||||
|
::SWGSDRangel::setValue(&audio_sample_rate, pJson["audioSampleRate"], "qint32", "");
|
||||||
|
::SWGSDRangel::setValue(&channel_mute, pJson["channelMute"], "qint32", "");
|
||||||
|
::SWGSDRangel::setValue(&play_loop, pJson["playLoop"], "qint32", "");
|
||||||
|
::SWGSDRangel::setValue(&ctcss_on, pJson["ctcssOn"], "qint32", "");
|
||||||
|
::SWGSDRangel::setValue(&ctcss_index, pJson["ctcssIndex"], "qint32", "");
|
||||||
|
::SWGSDRangel::setValue(&rgb_color, pJson["rgbColor"], "qint32", "");
|
||||||
|
::SWGSDRangel::setValue(&title, pJson["title"], "QString", "QString");
|
||||||
|
::SWGSDRangel::setValue(&cw_keyer, pJson["cwKeyer"], "SWGCWKeyerSettings", "SWGCWKeyerSettings");
|
||||||
|
}
|
||||||
|
|
||||||
|
QString
|
||||||
|
SWGNFMModSettings::asJson ()
|
||||||
|
{
|
||||||
|
QJsonObject* obj = this->asJsonObject();
|
||||||
|
|
||||||
|
QJsonDocument doc(*obj);
|
||||||
|
QByteArray bytes = doc.toJson();
|
||||||
|
return QString(bytes);
|
||||||
|
}
|
||||||
|
|
||||||
|
QJsonObject*
|
||||||
|
SWGNFMModSettings::asJsonObject() {
|
||||||
|
QJsonObject* obj = new QJsonObject();
|
||||||
|
|
||||||
|
obj->insert("basebandSampleRate", QJsonValue(baseband_sample_rate));
|
||||||
|
|
||||||
|
obj->insert("outputSampleRate", QJsonValue(output_sample_rate));
|
||||||
|
|
||||||
|
obj->insert("inputFrequencyOffset", QJsonValue(input_frequency_offset));
|
||||||
|
|
||||||
|
obj->insert("rfBandwidth", QJsonValue(rf_bandwidth));
|
||||||
|
|
||||||
|
obj->insert("afBandwidth", QJsonValue(af_bandwidth));
|
||||||
|
|
||||||
|
obj->insert("fmDeviation", QJsonValue(fm_deviation));
|
||||||
|
|
||||||
|
obj->insert("toneFrequency", QJsonValue(tone_frequency));
|
||||||
|
|
||||||
|
obj->insert("volumeFactor", QJsonValue(volume_factor));
|
||||||
|
|
||||||
|
obj->insert("audioSampleRate", QJsonValue(audio_sample_rate));
|
||||||
|
|
||||||
|
obj->insert("channelMute", QJsonValue(channel_mute));
|
||||||
|
|
||||||
|
obj->insert("playLoop", QJsonValue(play_loop));
|
||||||
|
|
||||||
|
obj->insert("ctcssOn", QJsonValue(ctcss_on));
|
||||||
|
|
||||||
|
obj->insert("ctcssIndex", QJsonValue(ctcss_index));
|
||||||
|
|
||||||
|
obj->insert("rgbColor", QJsonValue(rgb_color));
|
||||||
|
|
||||||
|
toJsonValue(QString("title"), title, obj, QString("QString"));
|
||||||
|
|
||||||
|
toJsonValue(QString("cwKeyer"), cw_keyer, obj, QString("SWGCWKeyerSettings"));
|
||||||
|
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
qint32
|
||||||
|
SWGNFMModSettings::getBasebandSampleRate() {
|
||||||
|
return baseband_sample_rate;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGNFMModSettings::setBasebandSampleRate(qint32 baseband_sample_rate) {
|
||||||
|
this->baseband_sample_rate = baseband_sample_rate;
|
||||||
|
}
|
||||||
|
|
||||||
|
qint32
|
||||||
|
SWGNFMModSettings::getOutputSampleRate() {
|
||||||
|
return output_sample_rate;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGNFMModSettings::setOutputSampleRate(qint32 output_sample_rate) {
|
||||||
|
this->output_sample_rate = output_sample_rate;
|
||||||
|
}
|
||||||
|
|
||||||
|
qint64
|
||||||
|
SWGNFMModSettings::getInputFrequencyOffset() {
|
||||||
|
return input_frequency_offset;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGNFMModSettings::setInputFrequencyOffset(qint64 input_frequency_offset) {
|
||||||
|
this->input_frequency_offset = input_frequency_offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
float
|
||||||
|
SWGNFMModSettings::getRfBandwidth() {
|
||||||
|
return rf_bandwidth;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGNFMModSettings::setRfBandwidth(float rf_bandwidth) {
|
||||||
|
this->rf_bandwidth = rf_bandwidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
float
|
||||||
|
SWGNFMModSettings::getAfBandwidth() {
|
||||||
|
return af_bandwidth;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGNFMModSettings::setAfBandwidth(float af_bandwidth) {
|
||||||
|
this->af_bandwidth = af_bandwidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
float
|
||||||
|
SWGNFMModSettings::getFmDeviation() {
|
||||||
|
return fm_deviation;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGNFMModSettings::setFmDeviation(float fm_deviation) {
|
||||||
|
this->fm_deviation = fm_deviation;
|
||||||
|
}
|
||||||
|
|
||||||
|
float
|
||||||
|
SWGNFMModSettings::getToneFrequency() {
|
||||||
|
return tone_frequency;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGNFMModSettings::setToneFrequency(float tone_frequency) {
|
||||||
|
this->tone_frequency = tone_frequency;
|
||||||
|
}
|
||||||
|
|
||||||
|
float
|
||||||
|
SWGNFMModSettings::getVolumeFactor() {
|
||||||
|
return volume_factor;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGNFMModSettings::setVolumeFactor(float volume_factor) {
|
||||||
|
this->volume_factor = volume_factor;
|
||||||
|
}
|
||||||
|
|
||||||
|
qint32
|
||||||
|
SWGNFMModSettings::getAudioSampleRate() {
|
||||||
|
return audio_sample_rate;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGNFMModSettings::setAudioSampleRate(qint32 audio_sample_rate) {
|
||||||
|
this->audio_sample_rate = audio_sample_rate;
|
||||||
|
}
|
||||||
|
|
||||||
|
qint32
|
||||||
|
SWGNFMModSettings::getChannelMute() {
|
||||||
|
return channel_mute;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGNFMModSettings::setChannelMute(qint32 channel_mute) {
|
||||||
|
this->channel_mute = channel_mute;
|
||||||
|
}
|
||||||
|
|
||||||
|
qint32
|
||||||
|
SWGNFMModSettings::getPlayLoop() {
|
||||||
|
return play_loop;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGNFMModSettings::setPlayLoop(qint32 play_loop) {
|
||||||
|
this->play_loop = play_loop;
|
||||||
|
}
|
||||||
|
|
||||||
|
qint32
|
||||||
|
SWGNFMModSettings::getCtcssOn() {
|
||||||
|
return ctcss_on;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGNFMModSettings::setCtcssOn(qint32 ctcss_on) {
|
||||||
|
this->ctcss_on = ctcss_on;
|
||||||
|
}
|
||||||
|
|
||||||
|
qint32
|
||||||
|
SWGNFMModSettings::getCtcssIndex() {
|
||||||
|
return ctcss_index;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGNFMModSettings::setCtcssIndex(qint32 ctcss_index) {
|
||||||
|
this->ctcss_index = ctcss_index;
|
||||||
|
}
|
||||||
|
|
||||||
|
qint32
|
||||||
|
SWGNFMModSettings::getRgbColor() {
|
||||||
|
return rgb_color;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGNFMModSettings::setRgbColor(qint32 rgb_color) {
|
||||||
|
this->rgb_color = rgb_color;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString*
|
||||||
|
SWGNFMModSettings::getTitle() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGNFMModSettings::setTitle(QString* title) {
|
||||||
|
this->title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
SWGCWKeyerSettings*
|
||||||
|
SWGNFMModSettings::getCwKeyer() {
|
||||||
|
return cw_keyer;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGNFMModSettings::setCwKeyer(SWGCWKeyerSettings* cw_keyer) {
|
||||||
|
this->cw_keyer = cw_keyer;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
116
swagger/sdrangel/code/qt5/client/SWGNFMModSettings.h
Normal file
116
swagger/sdrangel/code/qt5/client/SWGNFMModSettings.h
Normal file
@ -0,0 +1,116 @@
|
|||||||
|
/**
|
||||||
|
* SDRangel
|
||||||
|
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 4.0.0
|
||||||
|
* Contact: f4exb06@gmail.com
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* SWGNFMModSettings.h
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SWGNFMModSettings_H_
|
||||||
|
#define SWGNFMModSettings_H_
|
||||||
|
|
||||||
|
#include <QJsonObject>
|
||||||
|
|
||||||
|
|
||||||
|
#include "SWGCWKeyerSettings.h"
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
|
#include "SWGObject.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace SWGSDRangel {
|
||||||
|
|
||||||
|
class SWGNFMModSettings: public SWGObject {
|
||||||
|
public:
|
||||||
|
SWGNFMModSettings();
|
||||||
|
SWGNFMModSettings(QString* json);
|
||||||
|
virtual ~SWGNFMModSettings();
|
||||||
|
void init();
|
||||||
|
void cleanup();
|
||||||
|
|
||||||
|
QString asJson ();
|
||||||
|
QJsonObject* asJsonObject();
|
||||||
|
void fromJsonObject(QJsonObject &json);
|
||||||
|
SWGNFMModSettings* fromJson(QString &jsonString);
|
||||||
|
|
||||||
|
qint32 getBasebandSampleRate();
|
||||||
|
void setBasebandSampleRate(qint32 baseband_sample_rate);
|
||||||
|
|
||||||
|
qint32 getOutputSampleRate();
|
||||||
|
void setOutputSampleRate(qint32 output_sample_rate);
|
||||||
|
|
||||||
|
qint64 getInputFrequencyOffset();
|
||||||
|
void setInputFrequencyOffset(qint64 input_frequency_offset);
|
||||||
|
|
||||||
|
float getRfBandwidth();
|
||||||
|
void setRfBandwidth(float rf_bandwidth);
|
||||||
|
|
||||||
|
float getAfBandwidth();
|
||||||
|
void setAfBandwidth(float af_bandwidth);
|
||||||
|
|
||||||
|
float getFmDeviation();
|
||||||
|
void setFmDeviation(float fm_deviation);
|
||||||
|
|
||||||
|
float getToneFrequency();
|
||||||
|
void setToneFrequency(float tone_frequency);
|
||||||
|
|
||||||
|
float getVolumeFactor();
|
||||||
|
void setVolumeFactor(float volume_factor);
|
||||||
|
|
||||||
|
qint32 getAudioSampleRate();
|
||||||
|
void setAudioSampleRate(qint32 audio_sample_rate);
|
||||||
|
|
||||||
|
qint32 getChannelMute();
|
||||||
|
void setChannelMute(qint32 channel_mute);
|
||||||
|
|
||||||
|
qint32 getPlayLoop();
|
||||||
|
void setPlayLoop(qint32 play_loop);
|
||||||
|
|
||||||
|
qint32 getCtcssOn();
|
||||||
|
void setCtcssOn(qint32 ctcss_on);
|
||||||
|
|
||||||
|
qint32 getCtcssIndex();
|
||||||
|
void setCtcssIndex(qint32 ctcss_index);
|
||||||
|
|
||||||
|
qint32 getRgbColor();
|
||||||
|
void setRgbColor(qint32 rgb_color);
|
||||||
|
|
||||||
|
QString* getTitle();
|
||||||
|
void setTitle(QString* title);
|
||||||
|
|
||||||
|
SWGCWKeyerSettings* getCwKeyer();
|
||||||
|
void setCwKeyer(SWGCWKeyerSettings* cw_keyer);
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
qint32 baseband_sample_rate;
|
||||||
|
qint32 output_sample_rate;
|
||||||
|
qint64 input_frequency_offset;
|
||||||
|
float rf_bandwidth;
|
||||||
|
float af_bandwidth;
|
||||||
|
float fm_deviation;
|
||||||
|
float tone_frequency;
|
||||||
|
float volume_factor;
|
||||||
|
qint32 audio_sample_rate;
|
||||||
|
qint32 channel_mute;
|
||||||
|
qint32 play_loop;
|
||||||
|
qint32 ctcss_on;
|
||||||
|
qint32 ctcss_index;
|
||||||
|
qint32 rgb_color;
|
||||||
|
QString* title;
|
||||||
|
SWGCWKeyerSettings* cw_keyer;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* SWGNFMModSettings_H_ */
|
99
swagger/sdrangel/examples/ptt.py
Normal file
99
swagger/sdrangel/examples/ptt.py
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import requests, json, traceback, sys
|
||||||
|
from optparse import OptionParser
|
||||||
|
|
||||||
|
base_url = "http://127.0.0.1:8888/sdrangel"
|
||||||
|
|
||||||
|
# ======================================================================
|
||||||
|
def getInputOptions():
|
||||||
|
|
||||||
|
parser = OptionParser(usage="usage: %%prog [-t]\n")
|
||||||
|
parser.add_option("-a", "--address", dest="address", help="address and port", metavar="ADDRESS", type="string")
|
||||||
|
parser.add_option("-t", "--transmit", dest="transmit", help="transmit", metavar="TRANSMIT", action="store_true", default=False)
|
||||||
|
|
||||||
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
|
if (options.address == None):
|
||||||
|
options.address = "127.0.0.1:8888"
|
||||||
|
|
||||||
|
return options
|
||||||
|
|
||||||
|
# ======================================================================
|
||||||
|
def startDevice(deviceIndex):
|
||||||
|
dev_run_url = base_url+("/deviceset/%d/device/run" % deviceIndex)
|
||||||
|
r = requests.get(url=dev_run_url)
|
||||||
|
if r.status_code == 200:
|
||||||
|
rj = r.json()
|
||||||
|
state = rj.get("state", None)
|
||||||
|
if state is not None:
|
||||||
|
if state == "idle":
|
||||||
|
r = requests.post(url=dev_run_url)
|
||||||
|
if r.status_code == 200:
|
||||||
|
print("Device %d started" % deviceIndex)
|
||||||
|
else:
|
||||||
|
print("Error starting device %d" % deviceIndex)
|
||||||
|
else:
|
||||||
|
print("device %d not in idle state" % deviceIndex)
|
||||||
|
else:
|
||||||
|
print("Cannot get device %d running state" % deviceIndex)
|
||||||
|
else:
|
||||||
|
print("Error getting device %d running state" % deviceIndex)
|
||||||
|
|
||||||
|
# ======================================================================
|
||||||
|
def stopDevice(deviceIndex):
|
||||||
|
dev_run_url = base_url+("/deviceset/%d/device/run" % deviceIndex)
|
||||||
|
r = requests.get(url=dev_run_url)
|
||||||
|
if r.status_code == 200:
|
||||||
|
rj = r.json()
|
||||||
|
state = rj.get("state", None)
|
||||||
|
if state is not None:
|
||||||
|
if state == "running":
|
||||||
|
r = requests.delete(url=dev_run_url)
|
||||||
|
if r.status_code == 200:
|
||||||
|
print("Device %d stopped" % deviceIndex)
|
||||||
|
else:
|
||||||
|
print("Error stopping device %d" % deviceIndex)
|
||||||
|
else:
|
||||||
|
print("device %d not in running state" % deviceIndex)
|
||||||
|
else:
|
||||||
|
print("Cannot get device %d running state" % deviceIndex)
|
||||||
|
else:
|
||||||
|
print("Error getting device %d running state" % deviceIndex)
|
||||||
|
|
||||||
|
# ======================================================================
|
||||||
|
def main():
|
||||||
|
try:
|
||||||
|
options = getInputOptions()
|
||||||
|
global base_url
|
||||||
|
base_url = "http://%s/sdrangel" % options.address
|
||||||
|
r = requests.get(url=base_url+"/devicesets")
|
||||||
|
if r.status_code == 200:
|
||||||
|
rj = r.json()
|
||||||
|
deviceSets = rj.get("deviceSets", None)
|
||||||
|
if deviceSets is not None:
|
||||||
|
if len(deviceSets) > 1:
|
||||||
|
if deviceSets[0]["samplingDevice"]["tx"] == 0 and deviceSets[1]["samplingDevice"]["tx"] == 1:
|
||||||
|
if options.transmit:
|
||||||
|
stopDevice(0)
|
||||||
|
startDevice(1)
|
||||||
|
else:
|
||||||
|
stopDevice(1)
|
||||||
|
startDevice(0)
|
||||||
|
else:
|
||||||
|
print("Incorrect configuration expecting Rx0 and Tx1")
|
||||||
|
else:
|
||||||
|
print("Need at least a Rx and a Tx device set")
|
||||||
|
else:
|
||||||
|
print("Cannot get device sets configuration")
|
||||||
|
else:
|
||||||
|
print("Error getting device sets configuration")
|
||||||
|
|
||||||
|
except Exception, msg:
|
||||||
|
tb = traceback.format_exc()
|
||||||
|
print >> sys.stderr, tb
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
|
|
8
swagger/sdrangel/generate.sh
Executable file
8
swagger/sdrangel/generate.sh
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
CODEGEN=/opt/install/swagger/swagger-codegen
|
||||||
|
SDRANGEL_SRC=/opt/build/sdrangel
|
||||||
|
|
||||||
|
${CODEGEN} generate -i api/swagger/swagger.yaml -l qt5cpp -c qt5cpp-config.json -o code/qt5
|
||||||
|
${CODEGEN} generate -i api/swagger/swagger.yaml -l html2 -c html2-config.json -o code/html2
|
||||||
|
cp -v code/html2/index.html ${SDRANGEL_SRC}/sdrbase/resources/
|
Loading…
x
Reference in New Issue
Block a user