1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-04-04 10:38:45 -04:00

VOR single channel: added REST API and channel report message

This commit is contained in:
f4exb 2020-11-29 09:26:32 +01:00
parent efcc46a747
commit 38787f2a19
30 changed files with 1735 additions and 66 deletions

View File

@ -16,8 +16,6 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
///////////////////////////////////////////////////////////////////////////////////
#include "vordemodsc.h"
#include <QTime>
#include <QDebug>
#include <QNetworkAccessManager>
@ -40,6 +38,9 @@
#include "util/db.h"
#include "maincore.h"
#include "vordemodscreport.h"
#include "vordemodsc.h"
MESSAGE_CLASS_DEFINITION(VORDemodSC::MsgConfigureVORDemod, Message)
const char * const VORDemodSC::m_channelIdURI = "sdrangel.channel.vordemodsc";
@ -53,6 +54,7 @@ VORDemodSC::VORDemodSC(DeviceAPI *deviceAPI) :
setObjectName(m_channelId);
m_basebandSink = new VORDemodSCBaseband();
m_basebandSink->setMessageQueueToChannel(getInputMessageQueue());
m_basebandSink->moveToThread(&m_thread);
applySettings(m_settings, true);
@ -141,6 +143,48 @@ bool VORDemodSC::handleMessage(const Message& cmd)
return true;
}
else if (VORDemodSCReport::MsgReportRadial::match(cmd))
{
VORDemodSCReport::MsgReportRadial& report = (VORDemodSCReport::MsgReportRadial&) cmd;
m_radial = report.getRadial();
m_refMag = report.getRefMag();
m_varMag = report.getVarMag();
if (m_guiMessageQueue)
{
VORDemodSCReport::MsgReportRadial *msg = new VORDemodSCReport::MsgReportRadial(report);
m_guiMessageQueue->push(msg);
}
MessagePipes& messagePipes = MainCore::instance()->getMessagePipes();
QList<MessageQueue*> *reportMessageQueues = messagePipes.getMessageQueues(this, "report");
if (reportMessageQueues) {
sendChannelReport(reportMessageQueues);
}
return true;
}
else if (VORDemodSCReport::MsgReportIdent::match(cmd))
{
VORDemodSCReport::MsgReportIdent& report = (VORDemodSCReport::MsgReportIdent&) cmd;
m_morseIdent = report.getIdent();
if (m_guiMessageQueue)
{
VORDemodSCReport::MsgReportIdent *msg = new VORDemodSCReport::MsgReportIdent(report);
m_guiMessageQueue->push(msg);
}
MessagePipes& messagePipes = MainCore::instance()->getMessagePipes();
QList<MessageQueue*> *reportMessageQueues = messagePipes.getMessageQueues(this, "report");
if (reportMessageQueues) {
sendChannelReport(reportMessageQueues);
}
return true;
}
else
{
return false;
@ -150,6 +194,8 @@ bool VORDemodSC::handleMessage(const Message& cmd)
void VORDemodSC::applySettings(const VORDemodSCSettings& settings, bool force)
{
qDebug() << "VORDemodSC::applySettings:"
<< " m_inputFrequencyOffset: " << settings.m_inputFrequencyOffset
<< " m_navId: " << settings.m_navId
<< " m_volume: " << settings.m_volume
<< " m_squelch: " << settings.m_squelch
<< " m_audioMute: " << settings.m_audioMute
@ -164,6 +210,12 @@ void VORDemodSC::applySettings(const VORDemodSCSettings& settings, bool force)
QList<QString> reverseAPIKeys;
if ((m_settings.m_inputFrequencyOffset != settings.m_inputFrequencyOffset) || force) {
reverseAPIKeys.append("inputFrequencyOffset");
}
if ((m_settings.m_navId != settings.m_navId) || force) {
reverseAPIKeys.append("navId");
}
if ((m_settings.m_squelch != settings.m_squelch) || force) {
reverseAPIKeys.append("squelch");
}
@ -243,8 +295,8 @@ int VORDemodSC::webapiSettingsGet(
QString& errorMessage)
{
(void) errorMessage;
response.setVorDemodSettings(new SWGSDRangel::SWGVORDemodSettings());
response.getVorDemodSettings()->init();
response.setVorDemodScSettings(new SWGSDRangel::SWGVORDemodSCSettings());
response.getVorDemodScSettings()->init();
webapiFormatChannelSettings(response, m_settings);
return 200;
}
@ -279,45 +331,51 @@ void VORDemodSC::webapiUpdateChannelSettings(
const QStringList& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings& response)
{
if (channelSettingsKeys.contains("inputFrequencyOffset")) {
settings.m_inputFrequencyOffset = response.getVorDemodScSettings()->getInputFrequencyOffset();
}
if (channelSettingsKeys.contains("navId")) {
settings.m_navId = response.getVorDemodScSettings()->getNavId();
}
if (channelSettingsKeys.contains("audioMute")) {
settings.m_audioMute = response.getVorDemodSettings()->getAudioMute() != 0;
settings.m_audioMute = response.getVorDemodScSettings()->getAudioMute() != 0;
}
if (channelSettingsKeys.contains("rgbColor")) {
settings.m_rgbColor = response.getVorDemodSettings()->getRgbColor();
settings.m_rgbColor = response.getVorDemodScSettings()->getRgbColor();
}
if (channelSettingsKeys.contains("squelch")) {
settings.m_squelch = response.getVorDemodSettings()->getSquelch();
settings.m_squelch = response.getVorDemodScSettings()->getSquelch();
}
if (channelSettingsKeys.contains("title")) {
settings.m_title = *response.getVorDemodSettings()->getTitle();
settings.m_title = *response.getVorDemodScSettings()->getTitle();
}
if (channelSettingsKeys.contains("volume")) {
settings.m_volume = response.getVorDemodSettings()->getVolume();
settings.m_volume = response.getVorDemodScSettings()->getVolume();
}
if (channelSettingsKeys.contains("audioDeviceName")) {
settings.m_audioDeviceName = *response.getVorDemodSettings()->getAudioDeviceName();
settings.m_audioDeviceName = *response.getVorDemodScSettings()->getAudioDeviceName();
}
if (channelSettingsKeys.contains("streamIndex")) {
settings.m_streamIndex = response.getVorDemodSettings()->getStreamIndex();
settings.m_streamIndex = response.getVorDemodScSettings()->getStreamIndex();
}
if (channelSettingsKeys.contains("useReverseAPI")) {
settings.m_useReverseAPI = response.getVorDemodSettings()->getUseReverseApi() != 0;
settings.m_useReverseAPI = response.getVorDemodScSettings()->getUseReverseApi() != 0;
}
if (channelSettingsKeys.contains("reverseAPIAddress")) {
settings.m_reverseAPIAddress = *response.getVorDemodSettings()->getReverseApiAddress();
settings.m_reverseAPIAddress = *response.getVorDemodScSettings()->getReverseApiAddress();
}
if (channelSettingsKeys.contains("reverseAPIPort")) {
settings.m_reverseAPIPort = response.getVorDemodSettings()->getReverseApiPort();
settings.m_reverseAPIPort = response.getVorDemodScSettings()->getReverseApiPort();
}
if (channelSettingsKeys.contains("reverseAPIDeviceIndex")) {
settings.m_reverseAPIDeviceIndex = response.getVorDemodSettings()->getReverseApiDeviceIndex();
settings.m_reverseAPIDeviceIndex = response.getVorDemodScSettings()->getReverseApiDeviceIndex();
}
if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
settings.m_reverseAPIChannelIndex = response.getVorDemodSettings()->getReverseApiChannelIndex();
settings.m_reverseAPIChannelIndex = response.getVorDemodScSettings()->getReverseApiChannelIndex();
}
if (channelSettingsKeys.contains("identThreshold")) {
settings.m_identThreshold = response.getVorDemodSettings()->getIdentThreshold();
settings.m_identThreshold = response.getVorDemodScSettings()->getIdentThreshold();
}
}
@ -326,45 +384,47 @@ int VORDemodSC::webapiReportGet(
QString& errorMessage)
{
(void) errorMessage;
response.setVorDemodReport(new SWGSDRangel::SWGVORDemodReport());
response.getVorDemodReport()->init();
response.setVorDemodScReport(new SWGSDRangel::SWGVORDemodSCReport());
response.getVorDemodScReport()->init();
webapiFormatChannelReport(response);
return 200;
}
void VORDemodSC::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const VORDemodSCSettings& settings)
{
response.getVorDemodSettings()->setAudioMute(settings.m_audioMute ? 1 : 0);
response.getVorDemodSettings()->setRgbColor(settings.m_rgbColor);
response.getVorDemodSettings()->setSquelch(settings.m_squelch);
response.getVorDemodSettings()->setVolume(settings.m_volume);
response.getVorDemodScSettings()->setInputFrequencyOffset(settings.m_inputFrequencyOffset);
response.getVorDemodScSettings()->setNavId(settings.m_navId);
response.getVorDemodScSettings()->setAudioMute(settings.m_audioMute ? 1 : 0);
response.getVorDemodScSettings()->setRgbColor(settings.m_rgbColor);
response.getVorDemodScSettings()->setSquelch(settings.m_squelch);
response.getVorDemodScSettings()->setVolume(settings.m_volume);
if (response.getVorDemodSettings()->getTitle()) {
*response.getVorDemodSettings()->getTitle() = settings.m_title;
if (response.getVorDemodScSettings()->getTitle()) {
*response.getVorDemodScSettings()->getTitle() = settings.m_title;
} else {
response.getVorDemodSettings()->setTitle(new QString(settings.m_title));
response.getVorDemodScSettings()->setTitle(new QString(settings.m_title));
}
if (response.getVorDemodSettings()->getAudioDeviceName()) {
*response.getVorDemodSettings()->getAudioDeviceName() = settings.m_audioDeviceName;
if (response.getVorDemodScSettings()->getAudioDeviceName()) {
*response.getVorDemodScSettings()->getAudioDeviceName() = settings.m_audioDeviceName;
} else {
response.getVorDemodSettings()->setAudioDeviceName(new QString(settings.m_audioDeviceName));
response.getVorDemodScSettings()->setAudioDeviceName(new QString(settings.m_audioDeviceName));
}
response.getVorDemodSettings()->setStreamIndex(settings.m_streamIndex);
response.getVorDemodSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
response.getVorDemodScSettings()->setStreamIndex(settings.m_streamIndex);
response.getVorDemodScSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
if (response.getVorDemodSettings()->getReverseApiAddress()) {
*response.getVorDemodSettings()->getReverseApiAddress() = settings.m_reverseAPIAddress;
if (response.getVorDemodScSettings()->getReverseApiAddress()) {
*response.getVorDemodScSettings()->getReverseApiAddress() = settings.m_reverseAPIAddress;
} else {
response.getVorDemodSettings()->setReverseApiAddress(new QString(settings.m_reverseAPIAddress));
response.getVorDemodScSettings()->setReverseApiAddress(new QString(settings.m_reverseAPIAddress));
}
response.getVorDemodSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getVorDemodSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
response.getVorDemodSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex);
response.getVorDemodScSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getVorDemodScSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
response.getVorDemodScSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex);
response.getVorDemodSettings()->setIdentThreshold(settings.m_identThreshold);
response.getVorDemodScSettings()->setIdentThreshold(settings.m_identThreshold);
}
void VORDemodSC::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
@ -373,9 +433,18 @@ void VORDemodSC::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& respon
int nbMagsqSamples;
getMagSqLevels(magsqAvg, magsqPeak, nbMagsqSamples);
response.getVorDemodReport()->setChannelPowerDb(CalcDb::dbPower(magsqAvg));
response.getVorDemodReport()->setSquelch(m_basebandSink->getSquelchOpen() ? 1 : 0);
response.getVorDemodReport()->setAudioSampleRate(m_basebandSink->getAudioSampleRate());
response.getVorDemodScReport()->setChannelPowerDb(CalcDb::dbPower(magsqAvg));
response.getVorDemodScReport()->setSquelch(m_basebandSink->getSquelchOpen() ? 1 : 0);
response.getVorDemodScReport()->setAudioSampleRate(m_basebandSink->getAudioSampleRate());
response.getVorDemodScReport()->setRadial(m_radial);
response.getVorDemodScReport()->setRefMag(m_refMag);
response.getVorDemodScReport()->setVarMag(m_varMag);
if (response.getVorDemodScReport()->getMorseIdent()) {
*response.getVorDemodScReport()->getMorseIdent() = m_morseIdent;
} else {
response.getVorDemodScReport()->setMorseIdent(new QString(m_morseIdent));
}
}
void VORDemodSC::webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const VORDemodSCSettings& settings, bool force)
@ -431,6 +500,19 @@ void VORDemodSC::featuresSendSettings(QList<QString>& channelSettingsKeys, const
}
}
void VORDemodSC::sendChannelReport(QList<MessageQueue*> *messageQueues)
{
SWGSDRangel::SWGChannelReport *swgChannelReport = new SWGSDRangel::SWGChannelReport();
webapiFormatChannelReport(*swgChannelReport);
QList<MessageQueue*>::iterator it = messageQueues->begin();
for (; it != messageQueues->end(); ++it)
{
MainCore::MsgChannelReport *msg = MainCore::MsgChannelReport::create(this, swgChannelReport);
(*it)->push(msg);
}
}
void VORDemodSC::webapiFormatChannelSettings(
QList<QString>& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings *swgChannelSettings,
@ -442,34 +524,40 @@ void VORDemodSC::webapiFormatChannelSettings(
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString("VORDemodSC"));
swgChannelSettings->setVorDemodSettings(new SWGSDRangel::SWGVORDemodSettings());
SWGSDRangel::SWGVORDemodSettings *swgVORDemodSettings = swgChannelSettings->getVorDemodSettings();
swgChannelSettings->setVorDemodScSettings(new SWGSDRangel::SWGVORDemodSCSettings());
SWGSDRangel::SWGVORDemodSCSettings *swgVORDemodSCSettings = swgChannelSettings->getVorDemodScSettings();
// transfer data that has been modified. When force is on transfer all data except reverse API data
if (channelSettingsKeys.contains("inputFrequencyOffset") || force) {
swgVORDemodSCSettings->setInputFrequencyOffset(settings.m_inputFrequencyOffset);
}
if (channelSettingsKeys.contains("navId") || force) {
swgVORDemodSCSettings->setNavId(settings.m_navId);
}
if (channelSettingsKeys.contains("audioMute") || force) {
swgVORDemodSettings->setAudioMute(settings.m_audioMute ? 1 : 0);
swgVORDemodSCSettings->setAudioMute(settings.m_audioMute ? 1 : 0);
}
if (channelSettingsKeys.contains("rgbColor") || force) {
swgVORDemodSettings->setRgbColor(settings.m_rgbColor);
swgVORDemodSCSettings->setRgbColor(settings.m_rgbColor);
}
if (channelSettingsKeys.contains("squelch") || force) {
swgVORDemodSettings->setSquelch(settings.m_squelch);
swgVORDemodSCSettings->setSquelch(settings.m_squelch);
}
if (channelSettingsKeys.contains("title") || force) {
swgVORDemodSettings->setTitle(new QString(settings.m_title));
swgVORDemodSCSettings->setTitle(new QString(settings.m_title));
}
if (channelSettingsKeys.contains("volume") || force) {
swgVORDemodSettings->setVolume(settings.m_volume);
swgVORDemodSCSettings->setVolume(settings.m_volume);
}
if (channelSettingsKeys.contains("audioDeviceName") || force) {
swgVORDemodSettings->setAudioDeviceName(new QString(settings.m_audioDeviceName));
swgVORDemodSCSettings->setAudioDeviceName(new QString(settings.m_audioDeviceName));
}
if (channelSettingsKeys.contains("streamIndex") || force) {
swgVORDemodSettings->setStreamIndex(settings.m_streamIndex);
swgVORDemodSCSettings->setStreamIndex(settings.m_streamIndex);
}
if (channelSettingsKeys.contains("identThreshold") || force) {
swgVORDemodSettings->setAudioMute(settings.m_identThreshold);
swgVORDemodSCSettings->setAudioMute(settings.m_identThreshold);
}
}

View File

@ -120,10 +120,6 @@ public:
void getMagSqLevels(double& avg, double& peak, int& nbSamples) {
m_basebandSink->getMagSqLevels(avg, peak, nbSamples);
}
void setMessageQueueToGUI(MessageQueue* queue) override {
BasebandSampleSink::setMessageQueueToGUI(queue);
m_basebandSink->setMessageQueueToGUI(queue);
}
uint32_t getNumberOfDeviceStreams() const;
@ -138,6 +134,11 @@ private:
int m_basebandSampleRate; //!< stored from device message used when starting baseband sink
qint64 m_centerFrequency;
float m_radial; //!< current detected radial
float m_refMag; //!< current reference signal magnitude
float m_varMag; //!< current variable signal magnitude
QString m_morseIdent; //!< identification morse code transcript
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;
@ -145,6 +146,7 @@ private:
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const VORDemodSCSettings& settings, bool force);
void featuresSendSettings(QList<QString>& channelSettingsKeys, const VORDemodSCSettings& settings, bool force);
void sendChannelReport(QList<MessageQueue*> *messageQueues);
void webapiFormatChannelSettings(
QList<QString>& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings *swgChannelSettings,

View File

@ -65,7 +65,7 @@ public:
void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end);
MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } //!< Get the queue for asynchronous inbound communication
void getMagSqLevels(double& avg, double& peak, int& nbSamples) { m_sink.getMagSqLevels(avg, peak, nbSamples); }
void setMessageQueueToGUI(MessageQueue *messageQueue) { m_sink.setMessageQueueToGUI(messageQueue); }
void setMessageQueueToChannel(MessageQueue *messageQueue) { m_sink.setMessageQueueToChannel(messageQueue); }
bool getSquelchOpen() const { return m_sink.getSquelchOpen(); }
int getAudioSampleRate() const { return m_sink.getAudioSampleRate(); }
double getMagSq() const { return m_sink.getMagSq(); }

View File

@ -32,6 +32,7 @@ VORDemodSCSettings::VORDemodSCSettings() :
void VORDemodSCSettings::resetToDefaults()
{
m_inputFrequencyOffset = 0;
m_navId = -1;
m_squelch = -60.0;
m_volume = 2.0;
m_audioMute = false;

View File

@ -27,6 +27,7 @@ class Serializable;
struct VORDemodSCSettings
{
qint32 m_inputFrequencyOffset;
int m_navId; //!< VOR unique identifier when set by VOR localizer feature
Real m_squelch;
Real m_volume;
bool m_audioMute;

View File

@ -249,10 +249,10 @@ void VORDemodSCSink::processOneSample(Complex &ci)
// qDebug() << "Ref phase: " << phaseDeg << " var phase " << varPhase;
if (getMessageQueueToGUI())
if (getMessageQueueToChannel())
{
VORDemodSCReport::MsgReportRadial *msg = VORDemodSCReport::MsgReportRadial::create(phaseDifference, refMag, varMag);
getMessageQueueToGUI()->push(msg);
getMessageQueueToChannel()->push(msg);
}
m_refGoertzel.reset();
@ -303,11 +303,13 @@ void VORDemodSCSink::processOneSample(Complex &ci)
if (m_ident != "")
{
qDebug() << m_ident << " " << Morse::toString(m_ident);
if (getMessageQueueToGUI())
if (getMessageQueueToChannel())
{
VORDemodSCReport::MsgReportIdent *msg = VORDemodSCReport::MsgReportIdent::create(m_ident);
getMessageQueueToGUI()->push(msg);
getMessageQueueToChannel()->push(msg);
}
m_ident = "";
}
}
@ -342,11 +344,13 @@ void VORDemodSCSink::processOneSample(Complex &ci)
if (m_ident != "")
{
qDebug() << m_ident << " " << Morse::toString(m_ident);
if (getMessageQueueToGUI())
if (getMessageQueueToChannel())
{
VORDemodSCReport::MsgReportIdent *msg = VORDemodSCReport::MsgReportIdent::create(m_ident);
getMessageQueueToGUI()->push(msg);
getMessageQueueToChannel()->push(msg);
}
m_ident = "";
}
m_bitTime = 0;

View File

@ -43,7 +43,7 @@ public:
void applyChannelSettings(int channelSampleRate, int channelFrequencyOffset, bool force = false);
void applySettings(const VORDemodSCSettings& settings, bool force = false);
void setMessageQueueToGUI(MessageQueue *messageQueue) { m_messageQueueToGUI = messageQueue; }
void setMessageQueueToChannel(MessageQueue *messageQueue) { m_messageQueueToChannel = messageQueue; }
void applyAudioSampleRate(int sampleRate);
int getAudioSampleRate() const { return m_audioSampleRate; }
@ -101,6 +101,7 @@ private:
int m_magsqCount;
MagSqLevelsStore m_magSqLevelStore;
MessageQueue *m_messageQueueToChannel;
MessageQueue *m_messageQueueToGUI;
MovingAverageUtil<Real, double, 16> m_movingAverage;
@ -137,7 +138,7 @@ private:
void processOneSample(Complex &ci);
void processOneAudioSample(Complex &ci);
MessageQueue *getMessageQueueToGUI() { return m_messageQueueToGUI; }
MessageQueue *getMessageQueueToChannel() { return m_messageQueueToChannel; }
};
#endif // INCLUDE_VORDEMODSCSINK_H

View File

@ -160,6 +160,8 @@ set(sdrbase_SOURCES
limerfe/limerfeusbcalib.cpp
pipes/messagepipes.cpp
settings/featuresetpreset.cpp
settings/preferences.cpp
settings/preset.cpp
@ -331,6 +333,8 @@ set(sdrbase_HEADERS
limerfe/limerfeusbcalib.h
pipes/messagepipes.h
plugin/plugininterface.h
plugin/pluginapi.h
plugin/pluginmanager.h

View File

@ -45,6 +45,7 @@ MESSAGE_CLASS_DEFINITION(MainCore::MsgDeleteChannel, Message)
MESSAGE_CLASS_DEFINITION(MainCore::MsgApplySettings, Message)
MESSAGE_CLASS_DEFINITION(MainCore::MsgAddFeature, Message)
MESSAGE_CLASS_DEFINITION(MainCore::MsgDeleteFeature, Message)
MESSAGE_CLASS_DEFINITION(MainCore::MsgChannelReport, Message)
MainCore::MainCore()
{

View File

@ -26,6 +26,7 @@
#include "export.h"
#include "settings/mainsettings.h"
#include "util/message.h"
#include "pipes/messagepipes.h"
class DeviceSet;
class FeatureSet;
@ -38,6 +39,11 @@ namespace qtwebapp {
class LoggerWithFile;
}
namespace SWGSDRangel
{
class SWGChannelReport;
}
class SDRBASE_API MainCore
{
public:
@ -402,6 +408,34 @@ public:
{ }
};
class SDRBASE_API MsgChannelReport : public Message {
MESSAGE_CLASS_DECLARATION
public:
const ChannelAPI *getChannelAPI() const { return m_channelAPI; }
SWGSDRangel::SWGChannelReport *getSWGReport() const { return m_swgReport; }
static MsgChannelReport* create(
const ChannelAPI *channelAPI,
SWGSDRangel::SWGChannelReport *swgReport)
{
return new MsgChannelReport(channelAPI, swgReport);
}
private:
const ChannelAPI *m_channelAPI;
SWGSDRangel::SWGChannelReport *m_swgReport;
MsgChannelReport(
const ChannelAPI *channelAPI,
SWGSDRangel::SWGChannelReport *swgReport
) :
Message(),
m_channelAPI(channelAPI),
m_swgReport(swgReport)
{ }
};
MainCore();
~MainCore();
static MainCore *instance();
@ -433,6 +467,8 @@ public:
void removeFeatureInstanceAt(FeatureSet *featureSet, int featureIndex);
void removeFeatureInstance(Feature *feature);
void clearFeatures(FeatureSet *featureSet);
// pipes
MessagePipes& getMessagePipes() { return m_messagePipes; }
friend class MainServer;
friend class MainWindow;
@ -451,6 +487,7 @@ private:
QMap<ChannelAPI*, DeviceSet*> m_channelsMap; //!< Channel to device set map
QMap<Feature*, FeatureSet*> m_featuresMap; //!< Feature to feature set map
PluginManager* m_pluginManager;
MessagePipes m_messagePipes;
void debugMaps();
};

View File

@ -0,0 +1,88 @@
///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2015 Edouard Griffiths, F4EXB //
// //
// 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 //
// (at your option) any later version. //
// //
// 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 <QGlobalStatic>
#include "messagepipes.h"
bool MessagePipes::ChannelRegistrationKey::operator<(const ChannelRegistrationKey& other) const
{
if (m_channel != other.m_channel) {
return m_channel < other.m_channel;
} else {
return m_typeId < other.m_typeId;
}
}
MessagePipes::MessagePipes() :
m_typeCount(0)
{}
MessagePipes::~MessagePipes()
{
QMap<ChannelRegistrationKey, QList<MessageQueue*>>::iterator mit = m_messageRegistrations.begin();
for (; mit != m_messageRegistrations.end(); ++mit)
{
QList<MessageQueue*>::iterator lit = mit->begin();
for (; lit != mit->end(); ++lit) {
delete *lit;
}
}
}
void MessagePipes::registerChannelToFeature(const ChannelAPI *source, const Feature *feature, const QString& type)
{
int typeId;
if (m_typeIds.contains(type))
{
typeId = m_typeIds.value(type);
}
else
{
typeId++;
m_typeIds.insert(type, typeId);
}
const ChannelRegistrationKey regKey = ChannelRegistrationKey{source, typeId};
if (m_messageRegistrations.contains(regKey))
{
m_messageRegistrations.insert(regKey, QList<MessageQueue*>());
m_featureRegistrations.insert(regKey, QList<const Feature*>());
}
m_messageRegistrations[regKey].append(new MessageQueue());
m_featureRegistrations[regKey].append(feature);
}
QList<MessageQueue*>* MessagePipes::getMessageQueues(const ChannelAPI *source, const QString& type)
{
if (!m_typeIds.contains(type)) {
return nullptr;
}
const ChannelRegistrationKey regKey = ChannelRegistrationKey{source, m_typeIds.value(type)};
if (m_messageRegistrations.contains(regKey)) {
return &m_messageRegistrations[regKey];
} else {
return nullptr;
}
}

View File

@ -0,0 +1,58 @@
///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2015 Edouard Griffiths, F4EXB //
// //
// 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 //
// (at your option) any later version. //
// //
// 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_PIPES_MESSAGEPIPES_H_
#define SDRBASE_PIPES_MESSAGEPIPES_H_
#include <QObject>
#include <QHash>
#include <QMap>
#include "export.h"
#include "util/messagequeue.h"
class ChannelAPI;
class Feature;
class SDRBASE_API MessagePipes : public QObject
{
Q_OBJECT
public:
struct ChannelRegistrationKey
{
const ChannelAPI *m_channel;
int m_typeId;
bool operator<(const ChannelRegistrationKey& other) const;
};
MessagePipes();
MessagePipes(const MessagePipes&) = delete;
MessagePipes& operator=(const MessagePipes&) = delete;
~MessagePipes();
void registerChannelToFeature(const ChannelAPI *source, const Feature *feature, const QString& type);
QList<MessageQueue*>* getMessageQueues(const ChannelAPI *source, const QString& type);
private:
QHash<QString, int> m_typeIds;
int m_typeCount;
QMap<ChannelRegistrationKey, QList<MessageQueue*>> m_messageRegistrations;
QMap<ChannelRegistrationKey, QList<const Feature*>> m_featureRegistrations;
};
#endif // SDRBASE_PIPES_MESSAGEPIPES_H_

View File

@ -84,6 +84,7 @@
<file>webapi/doc/swagger/include/User.yaml</file>
<file>webapi/doc/swagger/include/USRP.yaml</file>
<file>webapi/doc/swagger/include/VORDemod.yaml</file>
<file>webapi/doc/swagger/include/VORDemodSC.yaml</file>
<file>webapi/doc/swagger/include/WFMDemod.yaml</file>
<file>webapi/doc/swagger/include/WFMMod.yaml</file>
<file>webapi/doc/swagger/include/Xtrx.yaml</file>

View File

@ -2573,6 +2573,9 @@ margin-bottom: 20px;
"VORDemodReport" : {
"$ref" : "#/definitions/VORDemodReport"
},
"VORDemodSCReport" : {
"$ref" : "#/definitions/VORDemodSCReport"
},
"WFMDemodReport" : {
"$ref" : "#/definitions/WFMDemodReport"
},
@ -2698,6 +2701,9 @@ margin-bottom: 20px;
"VORDemodSettings" : {
"$ref" : "#/definitions/VORDemodSettings"
},
"VORDemodSCSettings" : {
"$ref" : "#/definitions/VORDemodSCSettings"
},
"WFMDemodSettings" : {
"$ref" : "#/definitions/WFMDemodSettings"
},
@ -9456,6 +9462,104 @@ margin-bottom: 20px;
}
},
"description" : "VORDemod"
};
defs.VORDemodSCReport = {
"properties" : {
"channelPowerDB" : {
"type" : "number",
"format" : "float",
"description" : "power received in channel (dB)"
},
"squelch" : {
"type" : "integer",
"description" : "squelch status (1 if open else 0)"
},
"audioSampleRate" : {
"type" : "integer"
},
"volume" : {
"type" : "number",
"format" : "float"
},
"radial" : {
"type" : "number",
"format" : "float",
"description" : "current detected radial"
},
"refMag" : {
"type" : "number",
"format" : "float",
"description" : "current reference signal magnitude"
},
"varMag" : {
"type" : "number",
"format" : "float",
"description" : "current variable signal magnitude"
},
"morseIdent" : {
"type" : "string",
"description" : "current identification morse code transcript"
}
},
"description" : "VORDemodSC"
};
defs.VORDemodSCSettings = {
"properties" : {
"inputFrequencyOffset" : {
"type" : "integer",
"format" : "int64"
},
"navId" : {
"type" : "integer",
"description" : "VOR unique identifier when set by VOR localizer feature"
},
"squelch" : {
"type" : "number",
"format" : "float",
"description" : "power squelch threshold in decibels"
},
"volume" : {
"type" : "number",
"format" : "float"
},
"audioMute" : {
"type" : "integer"
},
"rgbColor" : {
"type" : "integer"
},
"title" : {
"type" : "string"
},
"audioDeviceName" : {
"type" : "string"
},
"streamIndex" : {
"type" : "integer",
"description" : "MIMO channel. Not relevant when connected to SI (single Rx)."
},
"useReverseAPI" : {
"type" : "integer",
"description" : "Synchronize with reverse API (1 for yes, 0 for no)"
},
"reverseAPIAddress" : {
"type" : "string"
},
"reverseAPIPort" : {
"type" : "integer"
},
"reverseAPIDeviceIndex" : {
"type" : "integer"
},
"reverseAPIChannelIndex" : {
"type" : "integer"
},
"identThreshold" : {
"type" : "integer",
"description" : "Morse code ident threshold (linear SNR)"
}
},
"description" : "VORDemodSC"
};
defs.VORDemodSettings = {
"properties" : {
@ -44712,7 +44816,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2020-11-25T13:34:12.214+01:00
Generated 2020-11-29T08:58:14.732+01:00
</div>
</div>
</div>

View File

@ -59,6 +59,8 @@ ChannelReport:
$ref: "/doc/swagger/include/UDPSink.yaml#/UDPSinkReport"
VORDemodReport:
$ref: "/doc/swagger/include/VORDemod.yaml#/VORDemodReport"
VORDemodSCReport:
$ref: "/doc/swagger/include/VORDemodSC.yaml#/VORDemodSCReport"
WFMDemodReport:
$ref: "/doc/swagger/include/WFMDemod.yaml#/WFMDemodReport"
WFMModReport:

View File

@ -81,6 +81,8 @@ ChannelSettings:
$ref: "/doc/swagger/include/UDPSink.yaml#/UDPSinkSettings"
VORDemodSettings:
$ref: "/doc/swagger/include/VORDemod.yaml#/VORDemodSettings"
VORDemodSCSettings:
$ref: "/doc/swagger/include/VORDemodSC.yaml#/VORDemodSCSettings"
WFMDemodSettings:
$ref: "/doc/swagger/include/WFMDemod.yaml#/WFMDemodSettings"
WFMModSettings:

View File

@ -0,0 +1,72 @@
VORDemodSCSettings:
description: VORDemodSC
properties:
inputFrequencyOffset:
type: integer
format: int64
navId:
description: VOR unique identifier when set by VOR localizer feature
type: integer
squelch:
description: power squelch threshold in decibels
type: number
format: float
volume:
type: number
format: float
audioMute:
type: integer
rgbColor:
type: integer
title:
type: string
audioDeviceName:
type: string
streamIndex:
description: MIMO channel. Not relevant when connected to SI (single Rx).
type: integer
useReverseAPI:
description: Synchronize with reverse API (1 for yes, 0 for no)
type: integer
reverseAPIAddress:
type: string
reverseAPIPort:
type: integer
reverseAPIDeviceIndex:
type: integer
reverseAPIChannelIndex:
type: integer
identThreshold:
description: Morse code ident threshold (linear SNR)
type: integer
VORDemodSCReport:
description: VORDemodSC
properties:
channelPowerDB:
description: power received in channel (dB)
type: number
format: float
squelch:
description: squelch status (1 if open else 0)
type: integer
audioSampleRate:
type: integer
volume:
type: number
format: float
radial:
description: current detected radial
type: number
format: float
refMag:
description: current reference signal magnitude
type: number
format: float
varMag:
description: current variable signal magnitude
type: number
format: float
morseIdent:
description: current identification morse code transcript
type: string

View File

@ -59,6 +59,8 @@ ChannelReport:
$ref: "http://swgserver:8081/api/swagger/include/UDPSink.yaml#/UDPSinkReport"
VORDemodReport:
$ref: "http://swgserver:8081/api/swagger/include/VORDemod.yaml#/VORDemodReport"
VORDemodSCReport:
$ref: "http://swgserver:8081/api/swagger/include/VORDemodSC.yaml#/VORDemodSCReport"
WFMDemodReport:
$ref: "http://swgserver:8081/api/swagger/include/WFMDemod.yaml#/WFMDemodReport"
WFMModReport:

View File

@ -81,6 +81,8 @@ ChannelSettings:
$ref: "http://swgserver:8081/api/swagger/include/UDPSink.yaml#/UDPSinkSettings"
VORDemodSettings:
$ref: "http://swgserver:8081/api/swagger/include/VORDemod.yaml#/VORDemodSettings"
VORDemodSCSettings:
$ref: "http://swgserver:8081/api/swagger/include/VORDemodSC.yaml#/VORDemodSCSettings"
WFMDemodSettings:
$ref: "http://swgserver:8081/api/swagger/include/WFMDemod.yaml#/WFMDemodSettings"
WFMModSettings:

View File

@ -0,0 +1,72 @@
VORDemodSCSettings:
description: VORDemodSC
properties:
inputFrequencyOffset:
type: integer
format: int64
navId:
description: VOR unique identifier when set by VOR localizer feature
type: integer
squelch:
description: power squelch threshold in decibels
type: number
format: float
volume:
type: number
format: float
audioMute:
type: integer
rgbColor:
type: integer
title:
type: string
audioDeviceName:
type: string
streamIndex:
description: MIMO channel. Not relevant when connected to SI (single Rx).
type: integer
useReverseAPI:
description: Synchronize with reverse API (1 for yes, 0 for no)
type: integer
reverseAPIAddress:
type: string
reverseAPIPort:
type: integer
reverseAPIDeviceIndex:
type: integer
reverseAPIChannelIndex:
type: integer
identThreshold:
description: Morse code ident threshold (linear SNR)
type: integer
VORDemodSCReport:
description: VORDemodSC
properties:
channelPowerDB:
description: power received in channel (dB)
type: number
format: float
squelch:
description: squelch status (1 if open else 0)
type: integer
audioSampleRate:
type: integer
volume:
type: number
format: float
radial:
description: current detected radial
type: number
format: float
refMag:
description: current reference signal magnitude
type: number
format: float
varMag:
description: current variable signal magnitude
type: number
format: float
morseIdent:
description: current identification morse code transcript
type: string

View File

@ -2573,6 +2573,9 @@ margin-bottom: 20px;
"VORDemodReport" : {
"$ref" : "#/definitions/VORDemodReport"
},
"VORDemodSCReport" : {
"$ref" : "#/definitions/VORDemodSCReport"
},
"WFMDemodReport" : {
"$ref" : "#/definitions/WFMDemodReport"
},
@ -2698,6 +2701,9 @@ margin-bottom: 20px;
"VORDemodSettings" : {
"$ref" : "#/definitions/VORDemodSettings"
},
"VORDemodSCSettings" : {
"$ref" : "#/definitions/VORDemodSCSettings"
},
"WFMDemodSettings" : {
"$ref" : "#/definitions/WFMDemodSettings"
},
@ -9456,6 +9462,104 @@ margin-bottom: 20px;
}
},
"description" : "VORDemod"
};
defs.VORDemodSCReport = {
"properties" : {
"channelPowerDB" : {
"type" : "number",
"format" : "float",
"description" : "power received in channel (dB)"
},
"squelch" : {
"type" : "integer",
"description" : "squelch status (1 if open else 0)"
},
"audioSampleRate" : {
"type" : "integer"
},
"volume" : {
"type" : "number",
"format" : "float"
},
"radial" : {
"type" : "number",
"format" : "float",
"description" : "current detected radial"
},
"refMag" : {
"type" : "number",
"format" : "float",
"description" : "current reference signal magnitude"
},
"varMag" : {
"type" : "number",
"format" : "float",
"description" : "current variable signal magnitude"
},
"morseIdent" : {
"type" : "string",
"description" : "current identification morse code transcript"
}
},
"description" : "VORDemodSC"
};
defs.VORDemodSCSettings = {
"properties" : {
"inputFrequencyOffset" : {
"type" : "integer",
"format" : "int64"
},
"navId" : {
"type" : "integer",
"description" : "VOR unique identifier when set by VOR localizer feature"
},
"squelch" : {
"type" : "number",
"format" : "float",
"description" : "power squelch threshold in decibels"
},
"volume" : {
"type" : "number",
"format" : "float"
},
"audioMute" : {
"type" : "integer"
},
"rgbColor" : {
"type" : "integer"
},
"title" : {
"type" : "string"
},
"audioDeviceName" : {
"type" : "string"
},
"streamIndex" : {
"type" : "integer",
"description" : "MIMO channel. Not relevant when connected to SI (single Rx)."
},
"useReverseAPI" : {
"type" : "integer",
"description" : "Synchronize with reverse API (1 for yes, 0 for no)"
},
"reverseAPIAddress" : {
"type" : "string"
},
"reverseAPIPort" : {
"type" : "integer"
},
"reverseAPIDeviceIndex" : {
"type" : "integer"
},
"reverseAPIChannelIndex" : {
"type" : "integer"
},
"identThreshold" : {
"type" : "integer",
"description" : "Morse code ident threshold (linear SNR)"
}
},
"description" : "VORDemodSC"
};
defs.VORDemodSettings = {
"properties" : {
@ -44712,7 +44816,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2020-11-25T13:34:12.214+01:00
Generated 2020-11-29T08:58:14.732+01:00
</div>
</div>
</div>

View File

@ -80,6 +80,8 @@ SWGChannelReport::SWGChannelReport() {
m_udp_sink_report_isSet = false;
vor_demod_report = nullptr;
m_vor_demod_report_isSet = false;
vor_demod_sc_report = nullptr;
m_vor_demod_sc_report_isSet = false;
wfm_demod_report = nullptr;
m_wfm_demod_report_isSet = false;
wfm_mod_report = nullptr;
@ -144,6 +146,8 @@ SWGChannelReport::init() {
m_udp_sink_report_isSet = false;
vor_demod_report = new SWGVORDemodReport();
m_vor_demod_report_isSet = false;
vor_demod_sc_report = new SWGVORDemodSCReport();
m_vor_demod_sc_report_isSet = false;
wfm_demod_report = new SWGWFMDemodReport();
m_wfm_demod_report_isSet = false;
wfm_mod_report = new SWGWFMModReport();
@ -228,6 +232,9 @@ SWGChannelReport::cleanup() {
if(vor_demod_report != nullptr) {
delete vor_demod_report;
}
if(vor_demod_sc_report != nullptr) {
delete vor_demod_sc_report;
}
if(wfm_demod_report != nullptr) {
delete wfm_demod_report;
}
@ -299,6 +306,8 @@ SWGChannelReport::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&vor_demod_report, pJson["VORDemodReport"], "SWGVORDemodReport", "SWGVORDemodReport");
::SWGSDRangel::setValue(&vor_demod_sc_report, pJson["VORDemodSCReport"], "SWGVORDemodSCReport", "SWGVORDemodSCReport");
::SWGSDRangel::setValue(&wfm_demod_report, pJson["WFMDemodReport"], "SWGWFMDemodReport", "SWGWFMDemodReport");
::SWGSDRangel::setValue(&wfm_mod_report, pJson["WFMModReport"], "SWGWFMModReport", "SWGWFMModReport");
@ -397,6 +406,9 @@ SWGChannelReport::asJsonObject() {
if((vor_demod_report != nullptr) && (vor_demod_report->isSet())){
toJsonValue(QString("VORDemodReport"), vor_demod_report, obj, QString("SWGVORDemodReport"));
}
if((vor_demod_sc_report != nullptr) && (vor_demod_sc_report->isSet())){
toJsonValue(QString("VORDemodSCReport"), vor_demod_sc_report, obj, QString("SWGVORDemodSCReport"));
}
if((wfm_demod_report != nullptr) && (wfm_demod_report->isSet())){
toJsonValue(QString("WFMDemodReport"), wfm_demod_report, obj, QString("SWGWFMDemodReport"));
}
@ -667,6 +679,16 @@ SWGChannelReport::setVorDemodReport(SWGVORDemodReport* vor_demod_report) {
this->m_vor_demod_report_isSet = true;
}
SWGVORDemodSCReport*
SWGChannelReport::getVorDemodScReport() {
return vor_demod_sc_report;
}
void
SWGChannelReport::setVorDemodScReport(SWGVORDemodSCReport* vor_demod_sc_report) {
this->vor_demod_sc_report = vor_demod_sc_report;
this->m_vor_demod_sc_report_isSet = true;
}
SWGWFMDemodReport*
SWGChannelReport::getWfmDemodReport() {
return wfm_demod_report;
@ -770,6 +792,9 @@ SWGChannelReport::isSet(){
if(vor_demod_report && vor_demod_report->isSet()){
isObjectUpdated = true; break;
}
if(vor_demod_sc_report && vor_demod_sc_report->isSet()){
isObjectUpdated = true; break;
}
if(wfm_demod_report && wfm_demod_report->isSet()){
isObjectUpdated = true; break;
}

View File

@ -46,6 +46,7 @@
#include "SWGUDPSinkReport.h"
#include "SWGUDPSourceReport.h"
#include "SWGVORDemodReport.h"
#include "SWGVORDemodSCReport.h"
#include "SWGWFMDemodReport.h"
#include "SWGWFMModReport.h"
#include <QString>
@ -146,6 +147,9 @@ public:
SWGVORDemodReport* getVorDemodReport();
void setVorDemodReport(SWGVORDemodReport* vor_demod_report);
SWGVORDemodSCReport* getVorDemodScReport();
void setVorDemodScReport(SWGVORDemodSCReport* vor_demod_sc_report);
SWGWFMDemodReport* getWfmDemodReport();
void setWfmDemodReport(SWGWFMDemodReport* wfm_demod_report);
@ -234,6 +238,9 @@ private:
SWGVORDemodReport* vor_demod_report;
bool m_vor_demod_report_isSet;
SWGVORDemodSCReport* vor_demod_sc_report;
bool m_vor_demod_sc_report_isSet;
SWGWFMDemodReport* wfm_demod_report;
bool m_wfm_demod_report_isSet;

View File

@ -100,6 +100,8 @@ SWGChannelSettings::SWGChannelSettings() {
m_udp_sink_settings_isSet = false;
vor_demod_settings = nullptr;
m_vor_demod_settings_isSet = false;
vor_demod_sc_settings = nullptr;
m_vor_demod_sc_settings_isSet = false;
wfm_demod_settings = nullptr;
m_wfm_demod_settings_isSet = false;
wfm_mod_settings = nullptr;
@ -184,6 +186,8 @@ SWGChannelSettings::init() {
m_udp_sink_settings_isSet = false;
vor_demod_settings = new SWGVORDemodSettings();
m_vor_demod_settings_isSet = false;
vor_demod_sc_settings = new SWGVORDemodSCSettings();
m_vor_demod_sc_settings_isSet = false;
wfm_demod_settings = new SWGWFMDemodSettings();
m_wfm_demod_settings_isSet = false;
wfm_mod_settings = new SWGWFMModSettings();
@ -294,6 +298,9 @@ SWGChannelSettings::cleanup() {
if(vor_demod_settings != nullptr) {
delete vor_demod_settings;
}
if(vor_demod_sc_settings != nullptr) {
delete vor_demod_sc_settings;
}
if(wfm_demod_settings != nullptr) {
delete wfm_demod_settings;
}
@ -385,6 +392,8 @@ SWGChannelSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&vor_demod_settings, pJson["VORDemodSettings"], "SWGVORDemodSettings", "SWGVORDemodSettings");
::SWGSDRangel::setValue(&vor_demod_sc_settings, pJson["VORDemodSCSettings"], "SWGVORDemodSCSettings", "SWGVORDemodSCSettings");
::SWGSDRangel::setValue(&wfm_demod_settings, pJson["WFMDemodSettings"], "SWGWFMDemodSettings", "SWGWFMDemodSettings");
::SWGSDRangel::setValue(&wfm_mod_settings, pJson["WFMModSettings"], "SWGWFMModSettings", "SWGWFMModSettings");
@ -513,6 +522,9 @@ SWGChannelSettings::asJsonObject() {
if((vor_demod_settings != nullptr) && (vor_demod_settings->isSet())){
toJsonValue(QString("VORDemodSettings"), vor_demod_settings, obj, QString("SWGVORDemodSettings"));
}
if((vor_demod_sc_settings != nullptr) && (vor_demod_sc_settings->isSet())){
toJsonValue(QString("VORDemodSCSettings"), vor_demod_sc_settings, obj, QString("SWGVORDemodSCSettings"));
}
if((wfm_demod_settings != nullptr) && (wfm_demod_settings->isSet())){
toJsonValue(QString("WFMDemodSettings"), wfm_demod_settings, obj, QString("SWGWFMDemodSettings"));
}
@ -883,6 +895,16 @@ SWGChannelSettings::setVorDemodSettings(SWGVORDemodSettings* vor_demod_settings)
this->m_vor_demod_settings_isSet = true;
}
SWGVORDemodSCSettings*
SWGChannelSettings::getVorDemodScSettings() {
return vor_demod_sc_settings;
}
void
SWGChannelSettings::setVorDemodScSettings(SWGVORDemodSCSettings* vor_demod_sc_settings) {
this->vor_demod_sc_settings = vor_demod_sc_settings;
this->m_vor_demod_sc_settings_isSet = true;
}
SWGWFMDemodSettings*
SWGChannelSettings::getWfmDemodSettings() {
return wfm_demod_settings;
@ -1016,6 +1038,9 @@ SWGChannelSettings::isSet(){
if(vor_demod_settings && vor_demod_settings->isSet()){
isObjectUpdated = true; break;
}
if(vor_demod_sc_settings && vor_demod_sc_settings->isSet()){
isObjectUpdated = true; break;
}
if(wfm_demod_settings && wfm_demod_settings->isSet()){
isObjectUpdated = true; break;
}

View File

@ -53,6 +53,7 @@
#include "SWGSigMFFileSinkSettings.h"
#include "SWGUDPSinkSettings.h"
#include "SWGUDPSourceSettings.h"
#include "SWGVORDemodSCSettings.h"
#include "SWGVORDemodSettings.h"
#include "SWGWFMDemodSettings.h"
#include "SWGWFMModSettings.h"
@ -184,6 +185,9 @@ public:
SWGVORDemodSettings* getVorDemodSettings();
void setVorDemodSettings(SWGVORDemodSettings* vor_demod_settings);
SWGVORDemodSCSettings* getVorDemodScSettings();
void setVorDemodScSettings(SWGVORDemodSCSettings* vor_demod_sc_settings);
SWGWFMDemodSettings* getWfmDemodSettings();
void setWfmDemodSettings(SWGWFMDemodSettings* wfm_demod_settings);
@ -302,6 +306,9 @@ private:
SWGVORDemodSettings* vor_demod_settings;
bool m_vor_demod_settings_isSet;
SWGVORDemodSCSettings* vor_demod_sc_settings;
bool m_vor_demod_sc_settings_isSet;
SWGWFMDemodSettings* wfm_demod_settings;
bool m_wfm_demod_settings_isSet;

View File

@ -222,6 +222,8 @@
#include "SWGUSRPOutputReport.h"
#include "SWGUSRPOutputSettings.h"
#include "SWGVORDemodReport.h"
#include "SWGVORDemodSCReport.h"
#include "SWGVORDemodSCSettings.h"
#include "SWGVORDemodSettings.h"
#include "SWGWFMDemodReport.h"
#include "SWGWFMDemodSettings.h"
@ -861,6 +863,12 @@ namespace SWGSDRangel {
if(QString("SWGVORDemodReport").compare(type) == 0) {
return new SWGVORDemodReport();
}
if(QString("SWGVORDemodSCReport").compare(type) == 0) {
return new SWGVORDemodSCReport();
}
if(QString("SWGVORDemodSCSettings").compare(type) == 0) {
return new SWGVORDemodSCSettings();
}
if(QString("SWGVORDemodSettings").compare(type) == 0) {
return new SWGVORDemodSettings();
}

View File

@ -0,0 +1,271 @@
/**
* SDRangel
* This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time ---
*
* OpenAPI spec version: 6.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 "SWGVORDemodSCReport.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace SWGSDRangel {
SWGVORDemodSCReport::SWGVORDemodSCReport(QString* json) {
init();
this->fromJson(*json);
}
SWGVORDemodSCReport::SWGVORDemodSCReport() {
channel_power_db = 0.0f;
m_channel_power_db_isSet = false;
squelch = 0;
m_squelch_isSet = false;
audio_sample_rate = 0;
m_audio_sample_rate_isSet = false;
volume = 0.0f;
m_volume_isSet = false;
radial = 0.0f;
m_radial_isSet = false;
ref_mag = 0.0f;
m_ref_mag_isSet = false;
var_mag = 0.0f;
m_var_mag_isSet = false;
morse_ident = nullptr;
m_morse_ident_isSet = false;
}
SWGVORDemodSCReport::~SWGVORDemodSCReport() {
this->cleanup();
}
void
SWGVORDemodSCReport::init() {
channel_power_db = 0.0f;
m_channel_power_db_isSet = false;
squelch = 0;
m_squelch_isSet = false;
audio_sample_rate = 0;
m_audio_sample_rate_isSet = false;
volume = 0.0f;
m_volume_isSet = false;
radial = 0.0f;
m_radial_isSet = false;
ref_mag = 0.0f;
m_ref_mag_isSet = false;
var_mag = 0.0f;
m_var_mag_isSet = false;
morse_ident = new QString("");
m_morse_ident_isSet = false;
}
void
SWGVORDemodSCReport::cleanup() {
if(morse_ident != nullptr) {
delete morse_ident;
}
}
SWGVORDemodSCReport*
SWGVORDemodSCReport::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGVORDemodSCReport::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&channel_power_db, pJson["channelPowerDB"], "float", "");
::SWGSDRangel::setValue(&squelch, pJson["squelch"], "qint32", "");
::SWGSDRangel::setValue(&audio_sample_rate, pJson["audioSampleRate"], "qint32", "");
::SWGSDRangel::setValue(&volume, pJson["volume"], "float", "");
::SWGSDRangel::setValue(&radial, pJson["radial"], "float", "");
::SWGSDRangel::setValue(&ref_mag, pJson["refMag"], "float", "");
::SWGSDRangel::setValue(&var_mag, pJson["varMag"], "float", "");
::SWGSDRangel::setValue(&morse_ident, pJson["morseIdent"], "QString", "QString");
}
QString
SWGVORDemodSCReport::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
delete obj;
return QString(bytes);
}
QJsonObject*
SWGVORDemodSCReport::asJsonObject() {
QJsonObject* obj = new QJsonObject();
if(m_channel_power_db_isSet){
obj->insert("channelPowerDB", QJsonValue(channel_power_db));
}
if(m_squelch_isSet){
obj->insert("squelch", QJsonValue(squelch));
}
if(m_audio_sample_rate_isSet){
obj->insert("audioSampleRate", QJsonValue(audio_sample_rate));
}
if(m_volume_isSet){
obj->insert("volume", QJsonValue(volume));
}
if(m_radial_isSet){
obj->insert("radial", QJsonValue(radial));
}
if(m_ref_mag_isSet){
obj->insert("refMag", QJsonValue(ref_mag));
}
if(m_var_mag_isSet){
obj->insert("varMag", QJsonValue(var_mag));
}
if(morse_ident != nullptr && *morse_ident != QString("")){
toJsonValue(QString("morseIdent"), morse_ident, obj, QString("QString"));
}
return obj;
}
float
SWGVORDemodSCReport::getChannelPowerDb() {
return channel_power_db;
}
void
SWGVORDemodSCReport::setChannelPowerDb(float channel_power_db) {
this->channel_power_db = channel_power_db;
this->m_channel_power_db_isSet = true;
}
qint32
SWGVORDemodSCReport::getSquelch() {
return squelch;
}
void
SWGVORDemodSCReport::setSquelch(qint32 squelch) {
this->squelch = squelch;
this->m_squelch_isSet = true;
}
qint32
SWGVORDemodSCReport::getAudioSampleRate() {
return audio_sample_rate;
}
void
SWGVORDemodSCReport::setAudioSampleRate(qint32 audio_sample_rate) {
this->audio_sample_rate = audio_sample_rate;
this->m_audio_sample_rate_isSet = true;
}
float
SWGVORDemodSCReport::getVolume() {
return volume;
}
void
SWGVORDemodSCReport::setVolume(float volume) {
this->volume = volume;
this->m_volume_isSet = true;
}
float
SWGVORDemodSCReport::getRadial() {
return radial;
}
void
SWGVORDemodSCReport::setRadial(float radial) {
this->radial = radial;
this->m_radial_isSet = true;
}
float
SWGVORDemodSCReport::getRefMag() {
return ref_mag;
}
void
SWGVORDemodSCReport::setRefMag(float ref_mag) {
this->ref_mag = ref_mag;
this->m_ref_mag_isSet = true;
}
float
SWGVORDemodSCReport::getVarMag() {
return var_mag;
}
void
SWGVORDemodSCReport::setVarMag(float var_mag) {
this->var_mag = var_mag;
this->m_var_mag_isSet = true;
}
QString*
SWGVORDemodSCReport::getMorseIdent() {
return morse_ident;
}
void
SWGVORDemodSCReport::setMorseIdent(QString* morse_ident) {
this->morse_ident = morse_ident;
this->m_morse_ident_isSet = true;
}
bool
SWGVORDemodSCReport::isSet(){
bool isObjectUpdated = false;
do{
if(m_channel_power_db_isSet){
isObjectUpdated = true; break;
}
if(m_squelch_isSet){
isObjectUpdated = true; break;
}
if(m_audio_sample_rate_isSet){
isObjectUpdated = true; break;
}
if(m_volume_isSet){
isObjectUpdated = true; break;
}
if(m_radial_isSet){
isObjectUpdated = true; break;
}
if(m_ref_mag_isSet){
isObjectUpdated = true; break;
}
if(m_var_mag_isSet){
isObjectUpdated = true; break;
}
if(morse_ident && *morse_ident != QString("")){
isObjectUpdated = true; break;
}
}while(false);
return isObjectUpdated;
}
}

View File

@ -0,0 +1,101 @@
/**
* SDRangel
* This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time ---
*
* OpenAPI spec version: 6.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.
*/
/*
* SWGVORDemodSCReport.h
*
* VORDemodSC
*/
#ifndef SWGVORDemodSCReport_H_
#define SWGVORDemodSCReport_H_
#include <QJsonObject>
#include <QString>
#include "SWGObject.h"
#include "export.h"
namespace SWGSDRangel {
class SWG_API SWGVORDemodSCReport: public SWGObject {
public:
SWGVORDemodSCReport();
SWGVORDemodSCReport(QString* json);
virtual ~SWGVORDemodSCReport();
void init();
void cleanup();
virtual QString asJson () override;
virtual QJsonObject* asJsonObject() override;
virtual void fromJsonObject(QJsonObject &json) override;
virtual SWGVORDemodSCReport* fromJson(QString &jsonString) override;
float getChannelPowerDb();
void setChannelPowerDb(float channel_power_db);
qint32 getSquelch();
void setSquelch(qint32 squelch);
qint32 getAudioSampleRate();
void setAudioSampleRate(qint32 audio_sample_rate);
float getVolume();
void setVolume(float volume);
float getRadial();
void setRadial(float radial);
float getRefMag();
void setRefMag(float ref_mag);
float getVarMag();
void setVarMag(float var_mag);
QString* getMorseIdent();
void setMorseIdent(QString* morse_ident);
virtual bool isSet() override;
private:
float channel_power_db;
bool m_channel_power_db_isSet;
qint32 squelch;
bool m_squelch_isSet;
qint32 audio_sample_rate;
bool m_audio_sample_rate_isSet;
float volume;
bool m_volume_isSet;
float radial;
bool m_radial_isSet;
float ref_mag;
bool m_ref_mag_isSet;
float var_mag;
bool m_var_mag_isSet;
QString* morse_ident;
bool m_morse_ident_isSet;
};
}
#endif /* SWGVORDemodSCReport_H_ */

View File

@ -0,0 +1,436 @@
/**
* SDRangel
* This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time ---
*
* OpenAPI spec version: 6.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 "SWGVORDemodSCSettings.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace SWGSDRangel {
SWGVORDemodSCSettings::SWGVORDemodSCSettings(QString* json) {
init();
this->fromJson(*json);
}
SWGVORDemodSCSettings::SWGVORDemodSCSettings() {
input_frequency_offset = 0L;
m_input_frequency_offset_isSet = false;
nav_id = 0;
m_nav_id_isSet = false;
squelch = 0.0f;
m_squelch_isSet = false;
volume = 0.0f;
m_volume_isSet = false;
audio_mute = 0;
m_audio_mute_isSet = false;
rgb_color = 0;
m_rgb_color_isSet = false;
title = nullptr;
m_title_isSet = false;
audio_device_name = nullptr;
m_audio_device_name_isSet = false;
stream_index = 0;
m_stream_index_isSet = false;
use_reverse_api = 0;
m_use_reverse_api_isSet = false;
reverse_api_address = nullptr;
m_reverse_api_address_isSet = false;
reverse_api_port = 0;
m_reverse_api_port_isSet = false;
reverse_api_device_index = 0;
m_reverse_api_device_index_isSet = false;
reverse_api_channel_index = 0;
m_reverse_api_channel_index_isSet = false;
ident_threshold = 0;
m_ident_threshold_isSet = false;
}
SWGVORDemodSCSettings::~SWGVORDemodSCSettings() {
this->cleanup();
}
void
SWGVORDemodSCSettings::init() {
input_frequency_offset = 0L;
m_input_frequency_offset_isSet = false;
nav_id = 0;
m_nav_id_isSet = false;
squelch = 0.0f;
m_squelch_isSet = false;
volume = 0.0f;
m_volume_isSet = false;
audio_mute = 0;
m_audio_mute_isSet = false;
rgb_color = 0;
m_rgb_color_isSet = false;
title = new QString("");
m_title_isSet = false;
audio_device_name = new QString("");
m_audio_device_name_isSet = false;
stream_index = 0;
m_stream_index_isSet = false;
use_reverse_api = 0;
m_use_reverse_api_isSet = false;
reverse_api_address = new QString("");
m_reverse_api_address_isSet = false;
reverse_api_port = 0;
m_reverse_api_port_isSet = false;
reverse_api_device_index = 0;
m_reverse_api_device_index_isSet = false;
reverse_api_channel_index = 0;
m_reverse_api_channel_index_isSet = false;
ident_threshold = 0;
m_ident_threshold_isSet = false;
}
void
SWGVORDemodSCSettings::cleanup() {
if(title != nullptr) {
delete title;
}
if(audio_device_name != nullptr) {
delete audio_device_name;
}
if(reverse_api_address != nullptr) {
delete reverse_api_address;
}
}
SWGVORDemodSCSettings*
SWGVORDemodSCSettings::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGVORDemodSCSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&input_frequency_offset, pJson["inputFrequencyOffset"], "qint64", "");
::SWGSDRangel::setValue(&nav_id, pJson["navId"], "qint32", "");
::SWGSDRangel::setValue(&squelch, pJson["squelch"], "float", "");
::SWGSDRangel::setValue(&volume, pJson["volume"], "float", "");
::SWGSDRangel::setValue(&audio_mute, pJson["audioMute"], "qint32", "");
::SWGSDRangel::setValue(&rgb_color, pJson["rgbColor"], "qint32", "");
::SWGSDRangel::setValue(&title, pJson["title"], "QString", "QString");
::SWGSDRangel::setValue(&audio_device_name, pJson["audioDeviceName"], "QString", "QString");
::SWGSDRangel::setValue(&stream_index, pJson["streamIndex"], "qint32", "");
::SWGSDRangel::setValue(&use_reverse_api, pJson["useReverseAPI"], "qint32", "");
::SWGSDRangel::setValue(&reverse_api_address, pJson["reverseAPIAddress"], "QString", "QString");
::SWGSDRangel::setValue(&reverse_api_port, pJson["reverseAPIPort"], "qint32", "");
::SWGSDRangel::setValue(&reverse_api_device_index, pJson["reverseAPIDeviceIndex"], "qint32", "");
::SWGSDRangel::setValue(&reverse_api_channel_index, pJson["reverseAPIChannelIndex"], "qint32", "");
::SWGSDRangel::setValue(&ident_threshold, pJson["identThreshold"], "qint32", "");
}
QString
SWGVORDemodSCSettings::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
delete obj;
return QString(bytes);
}
QJsonObject*
SWGVORDemodSCSettings::asJsonObject() {
QJsonObject* obj = new QJsonObject();
if(m_input_frequency_offset_isSet){
obj->insert("inputFrequencyOffset", QJsonValue(input_frequency_offset));
}
if(m_nav_id_isSet){
obj->insert("navId", QJsonValue(nav_id));
}
if(m_squelch_isSet){
obj->insert("squelch", QJsonValue(squelch));
}
if(m_volume_isSet){
obj->insert("volume", QJsonValue(volume));
}
if(m_audio_mute_isSet){
obj->insert("audioMute", QJsonValue(audio_mute));
}
if(m_rgb_color_isSet){
obj->insert("rgbColor", QJsonValue(rgb_color));
}
if(title != nullptr && *title != QString("")){
toJsonValue(QString("title"), title, obj, QString("QString"));
}
if(audio_device_name != nullptr && *audio_device_name != QString("")){
toJsonValue(QString("audioDeviceName"), audio_device_name, obj, QString("QString"));
}
if(m_stream_index_isSet){
obj->insert("streamIndex", QJsonValue(stream_index));
}
if(m_use_reverse_api_isSet){
obj->insert("useReverseAPI", QJsonValue(use_reverse_api));
}
if(reverse_api_address != nullptr && *reverse_api_address != QString("")){
toJsonValue(QString("reverseAPIAddress"), reverse_api_address, obj, QString("QString"));
}
if(m_reverse_api_port_isSet){
obj->insert("reverseAPIPort", QJsonValue(reverse_api_port));
}
if(m_reverse_api_device_index_isSet){
obj->insert("reverseAPIDeviceIndex", QJsonValue(reverse_api_device_index));
}
if(m_reverse_api_channel_index_isSet){
obj->insert("reverseAPIChannelIndex", QJsonValue(reverse_api_channel_index));
}
if(m_ident_threshold_isSet){
obj->insert("identThreshold", QJsonValue(ident_threshold));
}
return obj;
}
qint64
SWGVORDemodSCSettings::getInputFrequencyOffset() {
return input_frequency_offset;
}
void
SWGVORDemodSCSettings::setInputFrequencyOffset(qint64 input_frequency_offset) {
this->input_frequency_offset = input_frequency_offset;
this->m_input_frequency_offset_isSet = true;
}
qint32
SWGVORDemodSCSettings::getNavId() {
return nav_id;
}
void
SWGVORDemodSCSettings::setNavId(qint32 nav_id) {
this->nav_id = nav_id;
this->m_nav_id_isSet = true;
}
float
SWGVORDemodSCSettings::getSquelch() {
return squelch;
}
void
SWGVORDemodSCSettings::setSquelch(float squelch) {
this->squelch = squelch;
this->m_squelch_isSet = true;
}
float
SWGVORDemodSCSettings::getVolume() {
return volume;
}
void
SWGVORDemodSCSettings::setVolume(float volume) {
this->volume = volume;
this->m_volume_isSet = true;
}
qint32
SWGVORDemodSCSettings::getAudioMute() {
return audio_mute;
}
void
SWGVORDemodSCSettings::setAudioMute(qint32 audio_mute) {
this->audio_mute = audio_mute;
this->m_audio_mute_isSet = true;
}
qint32
SWGVORDemodSCSettings::getRgbColor() {
return rgb_color;
}
void
SWGVORDemodSCSettings::setRgbColor(qint32 rgb_color) {
this->rgb_color = rgb_color;
this->m_rgb_color_isSet = true;
}
QString*
SWGVORDemodSCSettings::getTitle() {
return title;
}
void
SWGVORDemodSCSettings::setTitle(QString* title) {
this->title = title;
this->m_title_isSet = true;
}
QString*
SWGVORDemodSCSettings::getAudioDeviceName() {
return audio_device_name;
}
void
SWGVORDemodSCSettings::setAudioDeviceName(QString* audio_device_name) {
this->audio_device_name = audio_device_name;
this->m_audio_device_name_isSet = true;
}
qint32
SWGVORDemodSCSettings::getStreamIndex() {
return stream_index;
}
void
SWGVORDemodSCSettings::setStreamIndex(qint32 stream_index) {
this->stream_index = stream_index;
this->m_stream_index_isSet = true;
}
qint32
SWGVORDemodSCSettings::getUseReverseApi() {
return use_reverse_api;
}
void
SWGVORDemodSCSettings::setUseReverseApi(qint32 use_reverse_api) {
this->use_reverse_api = use_reverse_api;
this->m_use_reverse_api_isSet = true;
}
QString*
SWGVORDemodSCSettings::getReverseApiAddress() {
return reverse_api_address;
}
void
SWGVORDemodSCSettings::setReverseApiAddress(QString* reverse_api_address) {
this->reverse_api_address = reverse_api_address;
this->m_reverse_api_address_isSet = true;
}
qint32
SWGVORDemodSCSettings::getReverseApiPort() {
return reverse_api_port;
}
void
SWGVORDemodSCSettings::setReverseApiPort(qint32 reverse_api_port) {
this->reverse_api_port = reverse_api_port;
this->m_reverse_api_port_isSet = true;
}
qint32
SWGVORDemodSCSettings::getReverseApiDeviceIndex() {
return reverse_api_device_index;
}
void
SWGVORDemodSCSettings::setReverseApiDeviceIndex(qint32 reverse_api_device_index) {
this->reverse_api_device_index = reverse_api_device_index;
this->m_reverse_api_device_index_isSet = true;
}
qint32
SWGVORDemodSCSettings::getReverseApiChannelIndex() {
return reverse_api_channel_index;
}
void
SWGVORDemodSCSettings::setReverseApiChannelIndex(qint32 reverse_api_channel_index) {
this->reverse_api_channel_index = reverse_api_channel_index;
this->m_reverse_api_channel_index_isSet = true;
}
qint32
SWGVORDemodSCSettings::getIdentThreshold() {
return ident_threshold;
}
void
SWGVORDemodSCSettings::setIdentThreshold(qint32 ident_threshold) {
this->ident_threshold = ident_threshold;
this->m_ident_threshold_isSet = true;
}
bool
SWGVORDemodSCSettings::isSet(){
bool isObjectUpdated = false;
do{
if(m_input_frequency_offset_isSet){
isObjectUpdated = true; break;
}
if(m_nav_id_isSet){
isObjectUpdated = true; break;
}
if(m_squelch_isSet){
isObjectUpdated = true; break;
}
if(m_volume_isSet){
isObjectUpdated = true; break;
}
if(m_audio_mute_isSet){
isObjectUpdated = true; break;
}
if(m_rgb_color_isSet){
isObjectUpdated = true; break;
}
if(title && *title != QString("")){
isObjectUpdated = true; break;
}
if(audio_device_name && *audio_device_name != QString("")){
isObjectUpdated = true; break;
}
if(m_stream_index_isSet){
isObjectUpdated = true; break;
}
if(m_use_reverse_api_isSet){
isObjectUpdated = true; break;
}
if(reverse_api_address && *reverse_api_address != QString("")){
isObjectUpdated = true; break;
}
if(m_reverse_api_port_isSet){
isObjectUpdated = true; break;
}
if(m_reverse_api_device_index_isSet){
isObjectUpdated = true; break;
}
if(m_reverse_api_channel_index_isSet){
isObjectUpdated = true; break;
}
if(m_ident_threshold_isSet){
isObjectUpdated = true; break;
}
}while(false);
return isObjectUpdated;
}
}

View File

@ -0,0 +1,143 @@
/**
* SDRangel
* This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time ---
*
* OpenAPI spec version: 6.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.
*/
/*
* SWGVORDemodSCSettings.h
*
* VORDemodSC
*/
#ifndef SWGVORDemodSCSettings_H_
#define SWGVORDemodSCSettings_H_
#include <QJsonObject>
#include <QString>
#include "SWGObject.h"
#include "export.h"
namespace SWGSDRangel {
class SWG_API SWGVORDemodSCSettings: public SWGObject {
public:
SWGVORDemodSCSettings();
SWGVORDemodSCSettings(QString* json);
virtual ~SWGVORDemodSCSettings();
void init();
void cleanup();
virtual QString asJson () override;
virtual QJsonObject* asJsonObject() override;
virtual void fromJsonObject(QJsonObject &json) override;
virtual SWGVORDemodSCSettings* fromJson(QString &jsonString) override;
qint64 getInputFrequencyOffset();
void setInputFrequencyOffset(qint64 input_frequency_offset);
qint32 getNavId();
void setNavId(qint32 nav_id);
float getSquelch();
void setSquelch(float squelch);
float getVolume();
void setVolume(float volume);
qint32 getAudioMute();
void setAudioMute(qint32 audio_mute);
qint32 getRgbColor();
void setRgbColor(qint32 rgb_color);
QString* getTitle();
void setTitle(QString* title);
QString* getAudioDeviceName();
void setAudioDeviceName(QString* audio_device_name);
qint32 getStreamIndex();
void setStreamIndex(qint32 stream_index);
qint32 getUseReverseApi();
void setUseReverseApi(qint32 use_reverse_api);
QString* getReverseApiAddress();
void setReverseApiAddress(QString* reverse_api_address);
qint32 getReverseApiPort();
void setReverseApiPort(qint32 reverse_api_port);
qint32 getReverseApiDeviceIndex();
void setReverseApiDeviceIndex(qint32 reverse_api_device_index);
qint32 getReverseApiChannelIndex();
void setReverseApiChannelIndex(qint32 reverse_api_channel_index);
qint32 getIdentThreshold();
void setIdentThreshold(qint32 ident_threshold);
virtual bool isSet() override;
private:
qint64 input_frequency_offset;
bool m_input_frequency_offset_isSet;
qint32 nav_id;
bool m_nav_id_isSet;
float squelch;
bool m_squelch_isSet;
float volume;
bool m_volume_isSet;
qint32 audio_mute;
bool m_audio_mute_isSet;
qint32 rgb_color;
bool m_rgb_color_isSet;
QString* title;
bool m_title_isSet;
QString* audio_device_name;
bool m_audio_device_name_isSet;
qint32 stream_index;
bool m_stream_index_isSet;
qint32 use_reverse_api;
bool m_use_reverse_api_isSet;
QString* reverse_api_address;
bool m_reverse_api_address_isSet;
qint32 reverse_api_port;
bool m_reverse_api_port_isSet;
qint32 reverse_api_device_index;
bool m_reverse_api_device_index_isSet;
qint32 reverse_api_channel_index;
bool m_reverse_api_channel_index_isSet;
qint32 ident_threshold;
bool m_ident_threshold_isSet;
};
}
#endif /* SWGVORDemodSCSettings_H_ */