mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-04-03 18:18:31 -04:00
Reverse API: WFM mod
This commit is contained in:
parent
98459f3972
commit
f8f01d928f
@ -1334,7 +1334,7 @@ void SSBMod::webapiReverseSendCWSettings(const CWKeyerSettings& cwKeyerSettings)
|
||||
{
|
||||
SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings();
|
||||
swgChannelSettings->setTx(1);
|
||||
swgChannelSettings->setChannelType(new QString("AMMod"));
|
||||
swgChannelSettings->setChannelType(new QString("SSBMod"));
|
||||
swgChannelSettings->setSsbModSettings(new SWGSDRangel::SWGSSBModSettings());
|
||||
SWGSDRangel::SWGSSBModSettings *swgSSBModSettings = swgChannelSettings->getSsbModSettings();
|
||||
|
||||
|
@ -17,6 +17,9 @@
|
||||
#include <QTime>
|
||||
#include <QDebug>
|
||||
#include <QMutexLocker>
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QNetworkReply>
|
||||
#include <QBuffer>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <complex.h>
|
||||
@ -95,10 +98,15 @@ WFMMod::WFMMod(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*)));
|
||||
}
|
||||
|
||||
WFMMod::~WFMMod()
|
||||
{
|
||||
disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
delete m_networkManager;
|
||||
DSPEngine::instance()->getAudioDeviceManager()->removeAudioSource(&m_audioFifo);
|
||||
m_deviceAPI->removeChannelAPI(this);
|
||||
m_deviceAPI->removeThreadedSource(m_threadedChannelizer);
|
||||
@ -358,6 +366,16 @@ bool WFMMod::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;
|
||||
@ -478,11 +496,34 @@ void WFMMod::applySettings(const WFMModSettings& settings, bool force)
|
||||
<< " m_toneFrequency: " << settings.m_toneFrequency
|
||||
<< " m_channelMute: " << settings.m_channelMute
|
||||
<< " m_playLoop: " << settings.m_playLoop
|
||||
<< " m_modAFInput: " << settings.m_modAFInput
|
||||
<< " m_audioDeviceName: " << settings.m_audioDeviceName
|
||||
<< " force: " << force;
|
||||
|
||||
if((settings.m_afBandwidth != m_settings.m_afBandwidth) || force)
|
||||
QList<QString> reverseAPIKeys;
|
||||
|
||||
if ((settings.m_inputFrequencyOffset != m_settings.m_inputFrequencyOffset) || force) {
|
||||
reverseAPIKeys.append("inputFrequencyOffset");
|
||||
}
|
||||
if ((settings.m_fmDeviation != m_settings.m_fmDeviation) || force) {
|
||||
reverseAPIKeys.append("fmDeviation");
|
||||
}
|
||||
if ((settings.m_volumeFactor != m_settings.m_volumeFactor) || force) {
|
||||
reverseAPIKeys.append("volumeFactor");
|
||||
}
|
||||
if ((settings.m_channelMute != m_settings.m_channelMute) || force) {
|
||||
reverseAPIKeys.append("channelMute");
|
||||
}
|
||||
if ((settings.m_playLoop != m_settings.m_playLoop) || force) {
|
||||
reverseAPIKeys.append("playLoop");
|
||||
}
|
||||
if ((settings.m_modAFInput != m_settings.m_modAFInput) || force) {
|
||||
reverseAPIKeys.append("modAFInput");
|
||||
}
|
||||
|
||||
if ((settings.m_afBandwidth != m_settings.m_afBandwidth) || force)
|
||||
{
|
||||
reverseAPIKeys.append("afBandwidth");
|
||||
m_settingsMutex.lock();
|
||||
m_interpolatorDistanceRemain = 0;
|
||||
m_interpolatorConsumed = false;
|
||||
@ -493,6 +534,7 @@ void WFMMod::applySettings(const WFMModSettings& settings, bool force)
|
||||
|
||||
if ((settings.m_rfBandwidth != m_settings.m_rfBandwidth) || force)
|
||||
{
|
||||
reverseAPIKeys.append("rfBandwidth");
|
||||
m_settingsMutex.lock();
|
||||
Real lowCut = -(settings.m_rfBandwidth / 2.0) / m_outputSampleRate;
|
||||
Real hiCut = (settings.m_rfBandwidth / 2.0) / m_outputSampleRate;
|
||||
@ -502,6 +544,7 @@ void WFMMod::applySettings(const WFMModSettings& settings, bool force)
|
||||
|
||||
if ((settings.m_toneFrequency != m_settings.m_toneFrequency) || force)
|
||||
{
|
||||
reverseAPIKeys.append("toneFrequency");
|
||||
m_settingsMutex.lock();
|
||||
m_toneNcoRF.setFreq(settings.m_toneFrequency, m_outputSampleRate);
|
||||
m_settingsMutex.unlock();
|
||||
@ -509,6 +552,7 @@ void WFMMod::applySettings(const WFMModSettings& settings, bool force)
|
||||
|
||||
if ((settings.m_audioDeviceName != m_settings.m_audioDeviceName) || force)
|
||||
{
|
||||
reverseAPIKeys.append("audioDeviceName");
|
||||
AudioDeviceManager *audioDeviceManager = DSPEngine::instance()->getAudioDeviceManager();
|
||||
int audioDeviceIndex = audioDeviceManager->getInputDeviceIndex(settings.m_audioDeviceName);
|
||||
audioDeviceManager->addAudioSource(&m_audioFifo, getInputMessageQueue(), audioDeviceIndex);
|
||||
@ -519,6 +563,16 @@ void WFMMod::applySettings(const WFMModSettings& 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;
|
||||
}
|
||||
|
||||
@ -720,3 +774,133 @@ void WFMMod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
|
||||
response.getWfmModReport()->setChannelSampleRate(m_outputSampleRate);
|
||||
}
|
||||
|
||||
void WFMMod::webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const WFMModSettings& settings, bool force)
|
||||
{
|
||||
SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings();
|
||||
swgChannelSettings->setTx(1);
|
||||
swgChannelSettings->setChannelType(new QString("WFMMod"));
|
||||
swgChannelSettings->setWfmModSettings(new SWGSDRangel::SWGWFMModSettings());
|
||||
SWGSDRangel::SWGWFMModSettings *swgWFMModSettings = swgChannelSettings->getWfmModSettings();
|
||||
|
||||
// transfer data that has been modified. When force is on transfer all data except reverse API data
|
||||
|
||||
if (channelSettingsKeys.contains("channelMute") || force) {
|
||||
swgWFMModSettings->setChannelMute(settings.m_channelMute ? 1 : 0);
|
||||
}
|
||||
if (channelSettingsKeys.contains("inputFrequencyOffset") || force) {
|
||||
swgWFMModSettings->setInputFrequencyOffset(settings.m_inputFrequencyOffset);
|
||||
}
|
||||
if (channelSettingsKeys.contains("modAFInput") || force) {
|
||||
swgWFMModSettings->setModAfInput((int) settings.m_modAFInput);
|
||||
}
|
||||
if (channelSettingsKeys.contains("playLoop") || force) {
|
||||
swgWFMModSettings->setPlayLoop(settings.m_playLoop ? 1 : 0);
|
||||
}
|
||||
if (channelSettingsKeys.contains("rfBandwidth") || force) {
|
||||
swgWFMModSettings->setRfBandwidth(settings.m_rfBandwidth);
|
||||
}
|
||||
if (channelSettingsKeys.contains("afBandwidth") || force) {
|
||||
swgWFMModSettings->setAfBandwidth(settings.m_afBandwidth);
|
||||
}
|
||||
if (channelSettingsKeys.contains("rgbColor") || force) {
|
||||
swgWFMModSettings->setRgbColor(settings.m_rgbColor);
|
||||
}
|
||||
if (channelSettingsKeys.contains("title") || force) {
|
||||
swgWFMModSettings->setTitle(new QString(settings.m_title));
|
||||
}
|
||||
if (channelSettingsKeys.contains("toneFrequency") || force) {
|
||||
swgWFMModSettings->setToneFrequency(settings.m_toneFrequency);
|
||||
}
|
||||
if (channelSettingsKeys.contains("volumeFactor") || force) {
|
||||
swgWFMModSettings->setVolumeFactor(settings.m_volumeFactor);
|
||||
}
|
||||
if (channelSettingsKeys.contains("fmDeviation")) {
|
||||
swgWFMModSettings->setFmDeviation(settings.m_fmDeviation);
|
||||
}
|
||||
if (channelSettingsKeys.contains("audioDeviceName") || force) {
|
||||
swgWFMModSettings->setAudioDeviceName(new QString(settings.m_audioDeviceName));
|
||||
}
|
||||
|
||||
if (force)
|
||||
{
|
||||
const CWKeyerSettings& cwKeyerSettings = m_cwKeyer.getSettings();
|
||||
swgWFMModSettings->setCwKeyer(new SWGSDRangel::SWGCWKeyerSettings());
|
||||
SWGSDRangel::SWGCWKeyerSettings *apiCwKeyerSettings = swgWFMModSettings->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 WFMMod::webapiReverseSendCWSettings(const CWKeyerSettings& cwKeyerSettings)
|
||||
{
|
||||
SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings();
|
||||
swgChannelSettings->setTx(1);
|
||||
swgChannelSettings->setChannelType(new QString("WFMMod"));
|
||||
swgChannelSettings->setWfmModSettings(new SWGSDRangel::SWGWFMModSettings());
|
||||
SWGSDRangel::SWGWFMModSettings *swgWFMModSettings = swgChannelSettings->getWfmModSettings();
|
||||
|
||||
swgWFMModSettings->setCwKeyer(new SWGSDRangel::SWGCWKeyerSettings());
|
||||
SWGSDRangel::SWGCWKeyerSettings *apiCwKeyerSettings = swgWFMModSettings->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 WFMMod::networkManagerFinished(QNetworkReply *reply)
|
||||
{
|
||||
QNetworkReply::NetworkError replyError = reply->error();
|
||||
|
||||
if (replyError)
|
||||
{
|
||||
qWarning() << "WFMMod::networkManagerFinished:"
|
||||
<< " error(" << (int) replyError
|
||||
<< "): " << replyError
|
||||
<< ": " << reply->errorString();
|
||||
return;
|
||||
}
|
||||
|
||||
QString answer = reply->readAll();
|
||||
answer.chop(1); // remove last \n
|
||||
qDebug("WFMMod::networkManagerFinished: reply:\n%s", answer.toStdString().c_str());
|
||||
}
|
||||
|
@ -17,11 +17,13 @@
|
||||
#ifndef PLUGINS_CHANNELTX_MODWFM_WFMMOD_H_
|
||||
#define PLUGINS_CHANNELTX_MODWFM_WFMMOD_H_
|
||||
|
||||
#include <QMutex>
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
#include <QMutex>
|
||||
#include <QNetworkRequest>
|
||||
|
||||
#include "dsp/basebandsamplesource.h"
|
||||
#include "channel/channelsourceapi.h"
|
||||
#include "dsp/nco.h"
|
||||
@ -36,6 +38,8 @@
|
||||
|
||||
#include "wfmmodsettings.h"
|
||||
|
||||
class QNetworkAccessManager;
|
||||
class QNetworkReply;
|
||||
class DeviceSinkAPI;
|
||||
class ThreadedBasebandSampleSource;
|
||||
class UpChannelizer;
|
||||
@ -295,6 +299,10 @@ private:
|
||||
Real m_peakLevel;
|
||||
Real m_levelSum;
|
||||
CWKeyer m_cwKeyer;
|
||||
|
||||
QNetworkAccessManager *m_networkManager;
|
||||
QNetworkRequest m_networkRequest;
|
||||
|
||||
static const int m_levelNbSamples;
|
||||
|
||||
void applyAudioSampleRate(int sampleRate);
|
||||
@ -306,6 +314,11 @@ private:
|
||||
void seekFileStream(int seekPercentage);
|
||||
void webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const WFMModSettings& settings);
|
||||
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
|
||||
void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const WFMModSettings& settings, bool force);
|
||||
void webapiReverseSendCWSettings(const CWKeyerSettings& settings);
|
||||
|
||||
private slots:
|
||||
void networkManagerFinished(QNetworkReply *reply);
|
||||
};
|
||||
|
||||
|
||||
|
@ -285,12 +285,23 @@ void WFMModGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
void WFMModGUI::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);
|
||||
|
@ -49,6 +49,11 @@ void WFMModSettings::resetToDefaults()
|
||||
m_title = "WFM Modulator";
|
||||
m_modAFInput = WFMModInputNone;
|
||||
m_audioDeviceName = AudioDeviceManager::m_defaultDeviceName;
|
||||
m_useReverseAPI = false;
|
||||
m_reverseAPIAddress = "127.0.0.1";
|
||||
m_reverseAPIPort = 8888;
|
||||
m_reverseAPIDeviceIndex = 0;
|
||||
m_reverseAPIChannelIndex = 0;
|
||||
}
|
||||
|
||||
QByteArray WFMModSettings::serialize() const
|
||||
@ -74,6 +79,11 @@ QByteArray WFMModSettings::serialize() const
|
||||
s.writeString(10, m_title);
|
||||
s.writeString(11, m_audioDeviceName);
|
||||
s.writeS32(12, (int) m_modAFInput);
|
||||
s.writeBool(13, m_useReverseAPI);
|
||||
s.writeString(14, m_reverseAPIAddress);
|
||||
s.writeU32(15, m_reverseAPIPort);
|
||||
s.writeU32(16, m_reverseAPIDeviceIndex);
|
||||
s.writeU32(17, m_reverseAPIChannelIndex);
|
||||
|
||||
return s.final();
|
||||
}
|
||||
@ -92,6 +102,7 @@ bool WFMModSettings::deserialize(const QByteArray& data)
|
||||
{
|
||||
QByteArray bytetmp;
|
||||
qint32 tmp;
|
||||
uint32_t utmp;
|
||||
|
||||
d.readS32(1, &tmp, 0);
|
||||
m_inputFrequencyOffset = tmp;
|
||||
@ -122,6 +133,21 @@ bool WFMModSettings::deserialize(const QByteArray& data)
|
||||
m_modAFInput = (WFMModInputAF) tmp;
|
||||
}
|
||||
|
||||
d.readBool(13, &m_useReverseAPI, false);
|
||||
d.readString(14, &m_reverseAPIAddress, "127.0.0.1");
|
||||
d.readU32(15, &utmp, 0);
|
||||
|
||||
if ((utmp > 1023) && (utmp < 65535)) {
|
||||
m_reverseAPIPort = utmp;
|
||||
} else {
|
||||
m_reverseAPIPort = 8888;
|
||||
}
|
||||
|
||||
d.readU32(16, &utmp, 0);
|
||||
m_reverseAPIDeviceIndex = utmp > 99 ? 99 : utmp;
|
||||
d.readU32(17, &utmp, 0);
|
||||
m_reverseAPIChannelIndex = utmp > 99 ? 99 : utmp;
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
@ -47,6 +47,11 @@ struct WFMModSettings
|
||||
QString m_title;
|
||||
WFMModInputAF 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_cwKeyerGUI;
|
||||
|
@ -4760,6 +4760,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"
|
||||
}
|
||||
@ -23797,7 +23813,7 @@ except ApiException as e:
|
||||
</div>
|
||||
<div id="generator">
|
||||
<div class="content">
|
||||
Generated 2018-12-21T01:58:52.307+01:00
|
||||
Generated 2018-12-21T16:19:50.202+01:00
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -31,6 +31,17 @@ WFMModSettings:
|
||||
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"
|
||||
|
||||
@ -45,4 +56,3 @@ WFMModReport:
|
||||
type: integer
|
||||
channelSampleRate:
|
||||
type: integer
|
||||
|
@ -31,6 +31,17 @@ WFMModSettings:
|
||||
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"
|
||||
|
||||
@ -45,4 +56,3 @@ WFMModReport:
|
||||
type: integer
|
||||
channelSampleRate:
|
||||
type: integer
|
||||
|
@ -4760,6 +4760,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"
|
||||
}
|
||||
@ -23797,7 +23813,7 @@ except ApiException as e:
|
||||
</div>
|
||||
<div id="generator">
|
||||
<div class="content">
|
||||
Generated 2018-12-21T01:58:52.307+01:00
|
||||
Generated 2018-12-21T16:19:50.202+01:00
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -52,6 +52,16 @@ SWGWFMModSettings::SWGWFMModSettings() {
|
||||
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;
|
||||
}
|
||||
@ -86,6 +96,16 @@ SWGWFMModSettings::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;
|
||||
}
|
||||
@ -108,6 +128,13 @@ SWGWFMModSettings::cleanup() {
|
||||
delete audio_device_name;
|
||||
}
|
||||
|
||||
|
||||
if(reverse_api_address != nullptr) {
|
||||
delete reverse_api_address;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(cw_keyer != nullptr) {
|
||||
delete cw_keyer;
|
||||
}
|
||||
@ -148,6 +175,16 @@ SWGWFMModSettings::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");
|
||||
|
||||
}
|
||||
@ -202,6 +239,21 @@ SWGWFMModSettings::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"));
|
||||
}
|
||||
@ -329,6 +381,56 @@ SWGWFMModSettings::setModAfInput(qint32 mod_af_input) {
|
||||
this->m_mod_af_input_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGWFMModSettings::getUseReverseApi() {
|
||||
return use_reverse_api;
|
||||
}
|
||||
void
|
||||
SWGWFMModSettings::setUseReverseApi(qint32 use_reverse_api) {
|
||||
this->use_reverse_api = use_reverse_api;
|
||||
this->m_use_reverse_api_isSet = true;
|
||||
}
|
||||
|
||||
QString*
|
||||
SWGWFMModSettings::getReverseApiAddress() {
|
||||
return reverse_api_address;
|
||||
}
|
||||
void
|
||||
SWGWFMModSettings::setReverseApiAddress(QString* reverse_api_address) {
|
||||
this->reverse_api_address = reverse_api_address;
|
||||
this->m_reverse_api_address_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGWFMModSettings::getReverseApiPort() {
|
||||
return reverse_api_port;
|
||||
}
|
||||
void
|
||||
SWGWFMModSettings::setReverseApiPort(qint32 reverse_api_port) {
|
||||
this->reverse_api_port = reverse_api_port;
|
||||
this->m_reverse_api_port_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGWFMModSettings::getReverseApiDeviceIndex() {
|
||||
return reverse_api_device_index;
|
||||
}
|
||||
void
|
||||
SWGWFMModSettings::setReverseApiDeviceIndex(qint32 reverse_api_device_index) {
|
||||
this->reverse_api_device_index = reverse_api_device_index;
|
||||
this->m_reverse_api_device_index_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGWFMModSettings::getReverseApiChannelIndex() {
|
||||
return reverse_api_channel_index;
|
||||
}
|
||||
void
|
||||
SWGWFMModSettings::setReverseApiChannelIndex(qint32 reverse_api_channel_index) {
|
||||
this->reverse_api_channel_index = reverse_api_channel_index;
|
||||
this->m_reverse_api_channel_index_isSet = true;
|
||||
}
|
||||
|
||||
SWGCWKeyerSettings*
|
||||
SWGWFMModSettings::getCwKeyer() {
|
||||
return cw_keyer;
|
||||
@ -356,6 +458,11 @@ SWGWFMModSettings::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;
|
||||
|
@ -79,6 +79,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);
|
||||
|
||||
@ -122,6 +137,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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user