1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-09-27 07:16:48 -04:00

Reverse API: SSB mod

This commit is contained in:
f4exb 2018-12-21 02:02:16 +01:00
parent ccad513947
commit 98459f3972
11 changed files with 539 additions and 3 deletions

View File

@ -19,6 +19,9 @@
#include <QTime>
#include <QDebug>
#include <QMutexLocker>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QBuffer>
#include <stdio.h>
#include <complex.h>
@ -114,10 +117,16 @@ SSBMod::SSBMod(DeviceSinkAPI *deviceAPI) :
m_threadedChannelizer = new ThreadedBasebandSampleSource(m_channelizer, this);
m_deviceAPI->addThreadedSource(m_threadedChannelizer);
m_deviceAPI->addChannelAPI(this);
m_networkManager = new QNetworkAccessManager();
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
}
SSBMod::~SSBMod()
{
disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
delete m_networkManager;
DSPEngine::instance()->getAudioDeviceManager()->removeAudioSource(&m_audioFifo);
m_deviceAPI->removeChannelAPI(this);
@ -583,6 +592,16 @@ bool SSBMod::handleMessage(const Message& cmd)
return true;
}
else if (CWKeyer::MsgConfigureCWKeyer::match(cmd))
{
const CWKeyer::MsgConfigureCWKeyer& cfg = (CWKeyer::MsgConfigureCWKeyer&) cmd;
if (m_settings.m_useReverseAPI) {
webapiReverseSendCWSettings(cfg.getSettings());
}
return true;
}
else if (DSPConfigureAudio::match(cmd))
{
DSPConfigureAudio& cfg = (DSPConfigureAudio&) cmd;
@ -744,6 +763,77 @@ void SSBMod::applySettings(const SSBModSettings& settings, bool force)
float band = settings.m_bandwidth;
float lowCutoff = settings.m_lowCutoff;
bool usb = settings.m_usb;
QList<QString> reverseAPIKeys;
if ((settings.m_inputFrequencyOffset != m_settings.m_inputFrequencyOffset) || force) {
reverseAPIKeys.append("inputFrequencyOffset");
}
if ((settings.m_bandwidth != m_settings.m_bandwidth) || force) {
reverseAPIKeys.append("bandwidth");
}
if ((settings.m_lowCutoff != m_settings.m_lowCutoff) || force) {
reverseAPIKeys.append("lowCutoff");
}
if ((settings.m_usb != m_settings.m_usb) || force) {
reverseAPIKeys.append("usb");
}
if ((settings.m_toneFrequency != m_settings.m_toneFrequency) || force) {
reverseAPIKeys.append("toneFrequency");
}
if ((settings.m_volumeFactor != m_settings.m_volumeFactor) || force) {
reverseAPIKeys.append("volumeFactor");
}
if ((settings.m_spanLog2 != m_settings.m_spanLog2) || force) {
reverseAPIKeys.append("spanLog2");
}
if ((settings.m_audioBinaural != m_settings.m_audioBinaural) || force) {
reverseAPIKeys.append("audioBinaural");
}
if ((settings.m_audioFlipChannels != m_settings.m_audioFlipChannels) || force) {
reverseAPIKeys.append("audioFlipChannels");
}
if ((settings.m_dsb != m_settings.m_dsb) || force) {
reverseAPIKeys.append("dsb");
}
if ((settings.m_audioMute != m_settings.m_audioMute) || force) {
reverseAPIKeys.append("audioMute");
}
if ((settings.m_playLoop != m_settings.m_playLoop) || force) {
reverseAPIKeys.append("playLoop");
}
if ((settings.m_agc != m_settings.m_agc) || force) {
reverseAPIKeys.append("agc");
}
if ((settings.m_agcOrder != m_settings.m_agcOrder) || force) {
reverseAPIKeys.append("agcOrder");
}
if ((settings.m_agcTime != m_settings.m_agcTime) || force) {
reverseAPIKeys.append("agcTime");
}
if ((settings.m_agcThresholdEnable != m_settings.m_agcThresholdEnable) || force) {
reverseAPIKeys.append("agcThresholdEnable");
}
if ((settings.m_agcThreshold != m_settings.m_agcThreshold) || force) {
reverseAPIKeys.append("agcThreshold");
}
if ((settings.m_agcThresholdGate != m_settings.m_agcThresholdGate) || force) {
reverseAPIKeys.append("agcThresholdGate");
}
if ((settings.m_agcThresholdDelay != m_settings.m_agcThresholdDelay) || force) {
reverseAPIKeys.append("agcThresholdDelay");
}
if ((settings.m_rgbColor != m_settings.m_rgbColor) || force) {
reverseAPIKeys.append("rgbColor");
}
if ((settings.m_title != m_settings.m_title) || force) {
reverseAPIKeys.append("title");
}
if ((settings.m_modAFInput != m_settings.m_modAFInput) || force) {
reverseAPIKeys.append("modAFInput");
}
if ((settings.m_audioDeviceName != m_settings.m_audioDeviceName) || force) {
reverseAPIKeys.append("audioDeviceName");
}
if ((settings.m_bandwidth != m_settings.m_bandwidth) ||
(settings.m_lowCutoff != m_settings.m_lowCutoff) || force)
@ -842,6 +932,16 @@ void SSBMod::applySettings(const SSBModSettings& settings, bool force)
}
}
if (settings.m_useReverseAPI)
{
bool fullUpdate = ((m_settings.m_useReverseAPI != settings.m_useReverseAPI) && settings.m_useReverseAPI) ||
(m_settings.m_reverseAPIAddress != settings.m_reverseAPIAddress) ||
(m_settings.m_reverseAPIPort != settings.m_reverseAPIPort) ||
(m_settings.m_reverseAPIDeviceIndex != settings.m_reverseAPIDeviceIndex) ||
(m_settings.m_reverseAPIChannelIndex != settings.m_reverseAPIChannelIndex);
webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force);
}
m_settings = settings;
m_settings.m_bandwidth = band;
m_settings.m_lowCutoff = lowCutoff;
@ -962,6 +1062,21 @@ int SSBMod::webapiSettingsPutPatch(
if (channelSettingsKeys.contains("audioDeviceName")) {
settings.m_audioDeviceName = *response.getSsbModSettings()->getAudioDeviceName();
}
if (channelSettingsKeys.contains("useReverseAPI")) {
settings.m_useReverseAPI = response.getSsbModSettings()->getUseReverseApi() != 0;
}
if (channelSettingsKeys.contains("reverseAPIAddress")) {
settings.m_reverseAPIAddress = *response.getSsbModSettings()->getReverseApiAddress() != 0;
}
if (channelSettingsKeys.contains("reverseAPIPort")) {
settings.m_reverseAPIPort = response.getSsbModSettings()->getReverseApiPort();
}
if (channelSettingsKeys.contains("reverseAPIDeviceIndex")) {
settings.m_reverseAPIDeviceIndex = response.getSsbModSettings()->getReverseApiDeviceIndex();
}
if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
settings.m_reverseAPIChannelIndex = response.getSsbModSettings()->getReverseApiChannelIndex();
}
if (channelSettingsKeys.contains("cwKeyer"))
{
@ -1083,6 +1198,18 @@ void SSBMod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& respon
}
apiCwKeyerSettings->setWpm(cwKeyerSettings.m_wpm);
response.getAmModSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
if (response.getAmModSettings()->getReverseApiAddress()) {
*response.getAmModSettings()->getReverseApiAddress() = settings.m_reverseAPIAddress;
} else {
response.getAmModSettings()->setReverseApiAddress(new QString(settings.m_reverseAPIAddress));
}
response.getAmModSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getAmModSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
response.getAmModSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex);
}
void SSBMod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
@ -1092,3 +1219,166 @@ void SSBMod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
response.getSsbModReport()->setChannelSampleRate(m_outputSampleRate);
}
void SSBMod::webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const SSBModSettings& settings, bool force)
{
SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings();
swgChannelSettings->setTx(1);
swgChannelSettings->setChannelType(new QString("SSBMod"));
swgChannelSettings->setSsbModSettings(new SWGSDRangel::SWGSSBModSettings());
SWGSDRangel::SWGSSBModSettings *swgSSBModSettings = swgChannelSettings->getSsbModSettings();
// transfer data that has been modified. When force is on transfer all data except reverse API data
if (channelSettingsKeys.contains("inputFrequencyOffset") || force) {
swgSSBModSettings->setInputFrequencyOffset(settings.m_inputFrequencyOffset);
}
if (channelSettingsKeys.contains("bandwidth") || force) {
swgSSBModSettings->setBandwidth(settings.m_bandwidth);
}
if (channelSettingsKeys.contains("lowCutoff") || force) {
swgSSBModSettings->setLowCutoff(settings.m_lowCutoff);
}
if (channelSettingsKeys.contains("usb") || force) {
swgSSBModSettings->setUsb(settings.m_usb ? 1 : 0);
}
if (channelSettingsKeys.contains("toneFrequency") || force) {
swgSSBModSettings->setToneFrequency(settings.m_toneFrequency);
}
if (channelSettingsKeys.contains("volumeFactor") || force) {
swgSSBModSettings->setVolumeFactor(settings.m_volumeFactor);
}
if (channelSettingsKeys.contains("spanLog2") || force) {
swgSSBModSettings->setSpanLog2(settings.m_spanLog2);
}
if (channelSettingsKeys.contains("audioBinaural") || force) {
swgSSBModSettings->setAudioBinaural(settings.m_audioBinaural ? 1 : 0);
}
if (channelSettingsKeys.contains("audioFlipChannels") || force) {
swgSSBModSettings->setAudioFlipChannels(settings.m_audioFlipChannels ? 1 : 0);
}
if (channelSettingsKeys.contains("dsb") || force) {
swgSSBModSettings->setDsb(settings.m_dsb ? 1 : 0);
}
if (channelSettingsKeys.contains("audioMute") || force) {
swgSSBModSettings->setAudioMute(settings.m_audioMute ? 1 : 0);
}
if (channelSettingsKeys.contains("playLoop") || force) {
swgSSBModSettings->setPlayLoop(settings.m_playLoop ? 1 : 0);
}
if (channelSettingsKeys.contains("agc") || force) {
swgSSBModSettings->setAgc(settings.m_agc ? 1 : 0);
}
if (channelSettingsKeys.contains("agcOrder") || force) {
swgSSBModSettings->setAgcOrder(settings.m_agcOrder);
}
if (channelSettingsKeys.contains("agcTime") || force) {
swgSSBModSettings->setAgcTime(settings.m_agcTime);
}
if (channelSettingsKeys.contains("agcThresholdEnable") || force) {
swgSSBModSettings->setAgcThresholdEnable(settings.m_agcThresholdEnable ? 1 : 0);
}
if (channelSettingsKeys.contains("agcThreshold") || force) {
swgSSBModSettings->setAgcThreshold(settings.m_agcThreshold);
}
if (channelSettingsKeys.contains("agcThresholdGate") || force) {
swgSSBModSettings->setAgcThresholdGate(settings.m_agcThresholdGate);
}
if (channelSettingsKeys.contains("agcThresholdDelay") || force) {
swgSSBModSettings->setAgcThresholdDelay(settings.m_agcThresholdDelay);
}
if (channelSettingsKeys.contains("rgbColor") || force) {
swgSSBModSettings->setRgbColor(settings.m_rgbColor);
}
if (channelSettingsKeys.contains("title") || force) {
swgSSBModSettings->setTitle(new QString(settings.m_title));
}
if (channelSettingsKeys.contains("modAFInput") || force) {
swgSSBModSettings->setModAfInput((int) settings.m_modAFInput);
}
if (channelSettingsKeys.contains("audioDeviceName") || force) {
swgSSBModSettings->setAudioDeviceName(new QString(settings.m_audioDeviceName));
}
if (force)
{
const CWKeyerSettings& cwKeyerSettings = m_cwKeyer.getSettings();
swgSSBModSettings->setCwKeyer(new SWGSDRangel::SWGCWKeyerSettings());
SWGSDRangel::SWGCWKeyerSettings *apiCwKeyerSettings = swgSSBModSettings->getCwKeyer();
apiCwKeyerSettings->setLoop(cwKeyerSettings.m_loop ? 1 : 0);
apiCwKeyerSettings->setMode(cwKeyerSettings.m_mode);
apiCwKeyerSettings->setSampleRate(cwKeyerSettings.m_sampleRate);
apiCwKeyerSettings->setText(new QString(cwKeyerSettings.m_text));
apiCwKeyerSettings->setWpm(cwKeyerSettings.m_wpm);
}
QString channelSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/channel/%4/settings")
.arg(settings.m_reverseAPIAddress)
.arg(settings.m_reverseAPIPort)
.arg(settings.m_reverseAPIDeviceIndex)
.arg(settings.m_reverseAPIChannelIndex);
m_networkRequest.setUrl(QUrl(channelSettingsURL));
m_networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
QBuffer *buffer=new QBuffer();
buffer->open((QBuffer::ReadWrite));
buffer->write(swgChannelSettings->asJson().toUtf8());
buffer->seek(0);
// Always use PATCH to avoid passing reverse API settings
m_networkManager->sendCustomRequest(m_networkRequest, "PATCH", buffer);
delete swgChannelSettings;
}
void SSBMod::webapiReverseSendCWSettings(const CWKeyerSettings& cwKeyerSettings)
{
SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings();
swgChannelSettings->setTx(1);
swgChannelSettings->setChannelType(new QString("AMMod"));
swgChannelSettings->setSsbModSettings(new SWGSDRangel::SWGSSBModSettings());
SWGSDRangel::SWGSSBModSettings *swgSSBModSettings = swgChannelSettings->getSsbModSettings();
swgSSBModSettings->setCwKeyer(new SWGSDRangel::SWGCWKeyerSettings());
SWGSDRangel::SWGCWKeyerSettings *apiCwKeyerSettings = swgSSBModSettings->getCwKeyer();
apiCwKeyerSettings->setLoop(cwKeyerSettings.m_loop ? 1 : 0);
apiCwKeyerSettings->setMode(cwKeyerSettings.m_mode);
apiCwKeyerSettings->setSampleRate(cwKeyerSettings.m_sampleRate);
apiCwKeyerSettings->setText(new QString(cwKeyerSettings.m_text));
apiCwKeyerSettings->setWpm(cwKeyerSettings.m_wpm);
QString channelSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/channel/%4/settings")
.arg(m_settings.m_reverseAPIAddress)
.arg(m_settings.m_reverseAPIPort)
.arg(m_settings.m_reverseAPIDeviceIndex)
.arg(m_settings.m_reverseAPIChannelIndex);
m_networkRequest.setUrl(QUrl(channelSettingsURL));
m_networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
QBuffer *buffer=new QBuffer();
buffer->open((QBuffer::ReadWrite));
buffer->write(swgChannelSettings->asJson().toUtf8());
buffer->seek(0);
// Always use PATCH to avoid passing reverse API settings
m_networkManager->sendCustomRequest(m_networkRequest, "PATCH", buffer);
delete swgChannelSettings;
}
void SSBMod::networkManagerFinished(QNetworkReply *reply)
{
QNetworkReply::NetworkError replyError = reply->error();
if (replyError)
{
qWarning() << "SSBMod::networkManagerFinished:"
<< " error(" << (int) replyError
<< "): " << replyError
<< ": " << reply->errorString();
return;
}
QString answer = reply->readAll();
answer.chop(1); // remove last \n
qDebug("SSBMod::networkManagerFinished: reply:\n%s", answer.toStdString().c_str());
}

View File

@ -17,11 +17,13 @@
#ifndef PLUGINS_CHANNELTX_MODSSB_SSBMOD_H_
#define PLUGINS_CHANNELTX_MODSSB_SSBMOD_H_
#include <QMutex>
#include <vector>
#include <iostream>
#include <fstream>
#include <QMutex>
#include <QNetworkRequest>
#include "dsp/basebandsamplesource.h"
#include "channel/channelsourceapi.h"
#include "dsp/basebandsamplesink.h"
@ -36,6 +38,8 @@
#include "ssbmodsettings.h"
class QNetworkAccessManager;
class QNetworkReply;
class DeviceSinkAPI;
class ThreadedBasebandSampleSource;
class UpChannelizer;
@ -309,6 +313,9 @@ private:
MagAGC m_inAGC;
int m_agcStepLength;
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;
static const int m_levelNbSamples;
void applyAudioSampleRate(int sampleRate);
@ -321,6 +328,11 @@ private:
void seekFileStream(int seekPercentage);
void webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const SSBModSettings& settings);
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const SSBModSettings& settings, bool force);
void webapiReverseSendCWSettings(const CWKeyerSettings& settings);
private slots:
void networkManagerFinished(QNetworkReply *reply);
};

View File

@ -372,12 +372,23 @@ void SSBModGUI::onWidgetRolled(QWidget* widget, bool rollDown)
void SSBModGUI::onMenuDialogCalled(const QPoint &p)
{
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
dialog.setReverseAPIAddress(m_settings.m_reverseAPIAddress);
dialog.setReverseAPIPort(m_settings.m_reverseAPIPort);
dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex);
dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex);
dialog.move(p);
dialog.exec();
m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency();
m_settings.m_rgbColor = m_channelMarker.getColor().rgb();
m_settings.m_title = m_channelMarker.getTitle();
m_settings.m_useReverseAPI = dialog.useReverseAPI();
m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress();
m_settings.m_reverseAPIPort = dialog.getReverseAPIPort();
m_settings.m_reverseAPIDeviceIndex = dialog.getReverseAPIDeviceIndex();
m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex();
setWindowTitle(m_settings.m_title);
setTitleColor(m_settings.m_rgbColor);

View File

@ -68,6 +68,11 @@ void SSBModSettings::resetToDefaults()
m_title = "SSB Modulator";
m_modAFInput = SSBModInputAF::SSBModInputNone;
m_audioDeviceName = AudioDeviceManager::m_defaultDeviceName;
m_useReverseAPI = false;
m_reverseAPIAddress = "127.0.0.1";
m_reverseAPIPort = 8888;
m_reverseAPIDeviceIndex = 0;
m_reverseAPIChannelIndex = 0;
}
QByteArray SSBModSettings::serialize() const
@ -107,6 +112,11 @@ QByteArray SSBModSettings::serialize() const
s.writeString(19, m_title);
s.writeString(20, m_audioDeviceName);
s.writeS32(21, (int) m_modAFInput);
s.writeBool(22, m_useReverseAPI);
s.writeString(23, m_reverseAPIAddress);
s.writeU32(24, m_reverseAPIPort);
s.writeU32(25, m_reverseAPIDeviceIndex);
s.writeU32(26, m_reverseAPIChannelIndex);
return s.final();
}
@ -125,6 +135,7 @@ bool SSBModSettings::deserialize(const QByteArray& data)
{
QByteArray bytetmp;
qint32 tmp;
uint32_t utmp;
d.readS32(1, &tmp, 0);
m_inputFrequencyOffset = tmp;
@ -181,6 +192,21 @@ bool SSBModSettings::deserialize(const QByteArray& data)
m_modAFInput = (SSBModInputAF) tmp;
}
d.readBool(22, &m_useReverseAPI, false);
d.readString(23, &m_reverseAPIAddress, "127.0.0.1");
d.readU32(24, &utmp, 0);
if ((utmp > 1023) && (utmp < 65535)) {
m_reverseAPIPort = utmp;
} else {
m_reverseAPIPort = 8888;
}
d.readU32(25, &utmp, 0);
m_reverseAPIDeviceIndex = utmp > 99 ? 99 : utmp;
d.readU32(26, &utmp, 0);
m_reverseAPIChannelIndex = utmp > 99 ? 99 : utmp;
return true;
}
else

View File

@ -62,6 +62,12 @@ struct SSBModSettings
SSBModInputAF m_modAFInput;
QString m_audioDeviceName;
bool m_useReverseAPI;
QString m_reverseAPIAddress;
uint16_t m_reverseAPIPort;
uint16_t m_reverseAPIDeviceIndex;
uint16_t m_reverseAPIChannelIndex;
Serializable *m_channelMarker;
Serializable *m_spectrumGUI;
Serializable *m_cwKeyerGUI;

View File

@ -4016,6 +4016,22 @@ margin-bottom: 20px;
"modAFInput" : {
"type" : "integer"
},
"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"
},
"cwKeyer" : {
"$ref" : "#/definitions/CWKeyerSettings"
}
@ -23781,7 +23797,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2018-12-21T01:11:45.184+01:00
Generated 2018-12-21T01:58:52.307+01:00
</div>
</div>
</div>

View File

@ -53,6 +53,17 @@ SSBModSettings:
type: string
modAFInput:
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
cwKeyer:
$ref: "/doc/swagger/include/CWKeyer.yaml#/CWKeyerSettings"

View File

@ -53,6 +53,17 @@ SSBModSettings:
type: string
modAFInput:
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
cwKeyer:
$ref: "http://localhost:8081/api/swagger/include/CWKeyer.yaml#/CWKeyerSettings"

View File

@ -4016,6 +4016,22 @@ margin-bottom: 20px;
"modAFInput" : {
"type" : "integer"
},
"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"
},
"cwKeyer" : {
"$ref" : "#/definitions/CWKeyerSettings"
}
@ -23781,7 +23797,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2018-12-21T01:11:45.184+01:00
Generated 2018-12-21T01:58:52.307+01:00
</div>
</div>
</div>

View File

@ -74,6 +74,16 @@ SWGSSBModSettings::SWGSSBModSettings() {
m_audio_device_name_isSet = false;
mod_af_input = 0;
m_mod_af_input_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;
cw_keyer = nullptr;
m_cw_keyer_isSet = false;
}
@ -130,6 +140,16 @@ SWGSSBModSettings::init() {
m_audio_device_name_isSet = false;
mod_af_input = 0;
m_mod_af_input_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;
cw_keyer = new SWGCWKeyerSettings();
m_cw_keyer_isSet = false;
}
@ -163,6 +183,13 @@ SWGSSBModSettings::cleanup() {
delete audio_device_name;
}
if(reverse_api_address != nullptr) {
delete reverse_api_address;
}
if(cw_keyer != nullptr) {
delete cw_keyer;
}
@ -225,6 +252,16 @@ SWGSSBModSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&mod_af_input, pJson["modAFInput"], "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(&cw_keyer, pJson["cwKeyer"], "SWGCWKeyerSettings", "SWGCWKeyerSettings");
}
@ -312,6 +349,21 @@ SWGSSBModSettings::asJsonObject() {
if(m_mod_af_input_isSet){
obj->insert("modAFInput", QJsonValue(mod_af_input));
}
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((cw_keyer != nullptr) && (cw_keyer->isSet())){
toJsonValue(QString("cwKeyer"), cw_keyer, obj, QString("SWGCWKeyerSettings"));
}
@ -549,6 +601,56 @@ SWGSSBModSettings::setModAfInput(qint32 mod_af_input) {
this->m_mod_af_input_isSet = true;
}
qint32
SWGSSBModSettings::getUseReverseApi() {
return use_reverse_api;
}
void
SWGSSBModSettings::setUseReverseApi(qint32 use_reverse_api) {
this->use_reverse_api = use_reverse_api;
this->m_use_reverse_api_isSet = true;
}
QString*
SWGSSBModSettings::getReverseApiAddress() {
return reverse_api_address;
}
void
SWGSSBModSettings::setReverseApiAddress(QString* reverse_api_address) {
this->reverse_api_address = reverse_api_address;
this->m_reverse_api_address_isSet = true;
}
qint32
SWGSSBModSettings::getReverseApiPort() {
return reverse_api_port;
}
void
SWGSSBModSettings::setReverseApiPort(qint32 reverse_api_port) {
this->reverse_api_port = reverse_api_port;
this->m_reverse_api_port_isSet = true;
}
qint32
SWGSSBModSettings::getReverseApiDeviceIndex() {
return reverse_api_device_index;
}
void
SWGSSBModSettings::setReverseApiDeviceIndex(qint32 reverse_api_device_index) {
this->reverse_api_device_index = reverse_api_device_index;
this->m_reverse_api_device_index_isSet = true;
}
qint32
SWGSSBModSettings::getReverseApiChannelIndex() {
return reverse_api_channel_index;
}
void
SWGSSBModSettings::setReverseApiChannelIndex(qint32 reverse_api_channel_index) {
this->reverse_api_channel_index = reverse_api_channel_index;
this->m_reverse_api_channel_index_isSet = true;
}
SWGCWKeyerSettings*
SWGSSBModSettings::getCwKeyer() {
return cw_keyer;
@ -587,6 +689,11 @@ SWGSSBModSettings::isSet(){
if(title != nullptr && *title != QString("")){ isObjectUpdated = true; break;}
if(audio_device_name != nullptr && *audio_device_name != QString("")){ isObjectUpdated = true; break;}
if(m_mod_af_input_isSet){ isObjectUpdated = true; break;}
if(m_use_reverse_api_isSet){ isObjectUpdated = true; break;}
if(reverse_api_address != nullptr && *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(cw_keyer != nullptr && cw_keyer->isSet()){ isObjectUpdated = true; break;}
}while(false);
return isObjectUpdated;

View File

@ -112,6 +112,21 @@ public:
qint32 getModAfInput();
void setModAfInput(qint32 mod_af_input);
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);
SWGCWKeyerSettings* getCwKeyer();
void setCwKeyer(SWGCWKeyerSettings* cw_keyer);
@ -188,6 +203,21 @@ private:
qint32 mod_af_input;
bool m_mod_af_input_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;
SWGCWKeyerSettings* cw_keyer;
bool m_cw_keyer_isSet;