mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-22 16:08:39 -05:00
Reverse API: DSD demod
This commit is contained in:
parent
98ae61f4e0
commit
6dc443c512
@ -16,12 +16,16 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#include <QTime>
|
||||
#include <QDebug>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <complex.h>
|
||||
|
||||
#include <QTime>
|
||||
#include <QDebug>
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QNetworkReply>
|
||||
#include <QBuffer>
|
||||
|
||||
#include "SWGChannelSettings.h"
|
||||
#include "SWGDSDDemodSettings.h"
|
||||
#include "SWGChannelReport.h"
|
||||
@ -92,10 +96,15 @@ DSDDemod::DSDDemod(DeviceSourceAPI *deviceAPI) :
|
||||
m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this);
|
||||
m_deviceAPI->addThreadedSink(m_threadedChannelizer);
|
||||
m_deviceAPI->addChannelAPI(this);
|
||||
|
||||
m_networkManager = new QNetworkAccessManager();
|
||||
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
}
|
||||
|
||||
DSDDemod::~DSDDemod()
|
||||
{
|
||||
disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
delete m_networkManager;
|
||||
delete[] m_sampleBuffer;
|
||||
DSPEngine::instance()->getAudioDeviceManager()->removeAudioSink(&m_audioFifo1);
|
||||
DSPEngine::instance()->getAudioDeviceManager()->removeAudioSink(&m_audioFifo2);
|
||||
@ -479,10 +488,41 @@ void DSDDemod::applySettings(const DSDDemodSettings& settings, bool force)
|
||||
<< " m_pllLock: " << settings.m_pllLock
|
||||
<< " m_highPassFilter: "<< settings.m_highPassFilter
|
||||
<< " m_audioDeviceName: " << settings.m_audioDeviceName
|
||||
<< " m_traceLengthMutliplier: " << settings.m_traceLengthMutliplier
|
||||
<< " m_traceStroke: " << settings.m_traceStroke
|
||||
<< " m_traceDecay: " << settings.m_traceDecay
|
||||
<< " force: " << force;
|
||||
|
||||
QList<QString> reverseAPIKeys;
|
||||
|
||||
if ((settings.m_inputFrequencyOffset != m_settings.m_inputFrequencyOffset) || force) {
|
||||
reverseAPIKeys.append("inputFrequencyOffset");
|
||||
}
|
||||
if ((settings.m_demodGain != m_settings.m_demodGain) || force) {
|
||||
reverseAPIKeys.append("demodGain");
|
||||
}
|
||||
if ((settings.m_audioMute != m_settings.m_audioMute) || force) {
|
||||
reverseAPIKeys.append("audioMute");
|
||||
}
|
||||
if ((settings.m_syncOrConstellation != m_settings.m_syncOrConstellation) || force) {
|
||||
reverseAPIKeys.append("syncOrConstellation");
|
||||
}
|
||||
if ((settings.m_slot1On != m_settings.m_slot1On) || force) {
|
||||
reverseAPIKeys.append("slot1On");
|
||||
}
|
||||
if ((settings.m_slot2On != m_settings.m_slot2On) || force) {
|
||||
reverseAPIKeys.append("slot2On");
|
||||
}
|
||||
if ((settings.m_demodGain != m_settings.m_demodGain) || force) {
|
||||
reverseAPIKeys.append("demodGain");
|
||||
}
|
||||
if ((settings.m_traceLengthMutliplier != m_settings.m_traceLengthMutliplier) || force) {
|
||||
reverseAPIKeys.append("traceLengthMutliplier");
|
||||
}
|
||||
|
||||
if ((settings.m_rfBandwidth != m_settings.m_rfBandwidth) || force)
|
||||
{
|
||||
reverseAPIKeys.append("rfBandwidth");
|
||||
m_settingsMutex.lock();
|
||||
m_interpolator.create(16, m_inputSampleRate, (settings.m_rfBandwidth) / 2.2);
|
||||
m_interpolatorDistanceRemain = 0;
|
||||
@ -493,53 +533,63 @@ void DSDDemod::applySettings(const DSDDemodSettings& settings, bool force)
|
||||
|
||||
if ((settings.m_fmDeviation != m_settings.m_fmDeviation) || force)
|
||||
{
|
||||
reverseAPIKeys.append("fmDeviation");
|
||||
m_phaseDiscri.setFMScaling(48000.0f / (2.0f*settings.m_fmDeviation));
|
||||
}
|
||||
|
||||
if ((settings.m_squelchGate != m_settings.m_squelchGate) || force)
|
||||
{
|
||||
reverseAPIKeys.append("squelchGate");
|
||||
m_squelchGate = 480 * settings.m_squelchGate; // gate is given in 10s of ms at 48000 Hz audio sample rate
|
||||
m_squelchCount = 0; // reset squelch open counter
|
||||
}
|
||||
|
||||
if ((settings.m_squelch != m_settings.m_squelch) || force)
|
||||
{
|
||||
reverseAPIKeys.append("squelch");
|
||||
// input is a value in dB
|
||||
m_squelchLevel = std::pow(10.0, settings.m_squelch / 10.0);
|
||||
}
|
||||
|
||||
if ((settings.m_volume != m_settings.m_volume) || force)
|
||||
{
|
||||
reverseAPIKeys.append("volume");
|
||||
m_dsdDecoder.setAudioGain(settings.m_volume);
|
||||
}
|
||||
|
||||
if ((settings.m_baudRate != m_settings.m_baudRate) || force)
|
||||
{
|
||||
reverseAPIKeys.append("baudRate");
|
||||
m_dsdDecoder.setBaudRate(settings.m_baudRate);
|
||||
}
|
||||
|
||||
if ((settings.m_enableCosineFiltering != m_settings.m_enableCosineFiltering) || force)
|
||||
{
|
||||
reverseAPIKeys.append("enableCosineFiltering");
|
||||
m_dsdDecoder.enableCosineFiltering(settings.m_enableCosineFiltering);
|
||||
}
|
||||
|
||||
if ((settings.m_tdmaStereo != m_settings.m_tdmaStereo) || force)
|
||||
{
|
||||
reverseAPIKeys.append("tdmaStereo");
|
||||
m_dsdDecoder.setTDMAStereo(settings.m_tdmaStereo);
|
||||
}
|
||||
|
||||
if ((settings.m_pllLock != m_settings.m_pllLock) || force)
|
||||
{
|
||||
reverseAPIKeys.append("pllLock");
|
||||
m_dsdDecoder.setSymbolPLLLock(settings.m_pllLock);
|
||||
}
|
||||
|
||||
if ((settings.m_highPassFilter != m_settings.m_highPassFilter) || force)
|
||||
{
|
||||
reverseAPIKeys.append("highPassFilter");
|
||||
m_dsdDecoder.useHPMbelib(settings.m_highPassFilter);
|
||||
}
|
||||
|
||||
if ((settings.m_audioDeviceName != m_settings.m_audioDeviceName) || force)
|
||||
{
|
||||
reverseAPIKeys.append("audioDeviceName");
|
||||
AudioDeviceManager *audioDeviceManager = DSPEngine::instance()->getAudioDeviceManager();
|
||||
int audioDeviceIndex = audioDeviceManager->getOutputDeviceIndex(settings.m_audioDeviceName);
|
||||
//qDebug("AMDemod::applySettings: audioDeviceName: %s audioDeviceIndex: %d", qPrintable(settings.m_audioDeviceName), audioDeviceIndex);
|
||||
@ -552,6 +602,16 @@ void DSDDemod::applySettings(const DSDDemodSettings& 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;
|
||||
}
|
||||
|
||||
@ -855,6 +915,21 @@ int DSDDemod::webapiSettingsPutPatch(
|
||||
if (channelSettingsKeys.contains("traceDecay")) {
|
||||
settings.m_traceDecay = response.getDsdDemodSettings()->getTraceDecay();
|
||||
}
|
||||
if (channelSettingsKeys.contains("useReverseAPI")) {
|
||||
settings.m_useReverseAPI = response.getDsdDemodSettings()->getUseReverseApi() != 0;
|
||||
}
|
||||
if (channelSettingsKeys.contains("reverseAPIAddress")) {
|
||||
settings.m_reverseAPIAddress = *response.getDsdDemodSettings()->getReverseApiAddress() != 0;
|
||||
}
|
||||
if (channelSettingsKeys.contains("reverseAPIPort")) {
|
||||
settings.m_reverseAPIPort = response.getDsdDemodSettings()->getReverseApiPort();
|
||||
}
|
||||
if (channelSettingsKeys.contains("reverseAPIDeviceIndex")) {
|
||||
settings.m_reverseAPIDeviceIndex = response.getDsdDemodSettings()->getReverseApiDeviceIndex();
|
||||
}
|
||||
if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
|
||||
settings.m_reverseAPIChannelIndex = response.getDsdDemodSettings()->getReverseApiChannelIndex();
|
||||
}
|
||||
|
||||
if (frequencyOffsetChanged)
|
||||
{
|
||||
@ -924,6 +999,18 @@ void DSDDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp
|
||||
response.getDsdDemodSettings()->setTraceLengthMutliplier(settings.m_traceLengthMutliplier);
|
||||
response.getDsdDemodSettings()->setTraceStroke(settings.m_traceStroke);
|
||||
response.getDsdDemodSettings()->setTraceDecay(settings.m_traceDecay);
|
||||
response.getDsdDemodSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
|
||||
|
||||
if (response.getDsdDemodSettings()->getReverseApiAddress()) {
|
||||
*response.getDsdDemodSettings()->getReverseApiAddress() = settings.m_reverseAPIAddress;
|
||||
} else {
|
||||
response.getDsdDemodSettings()->setReverseApiAddress(new QString(settings.m_reverseAPIAddress));
|
||||
}
|
||||
|
||||
response.getDsdDemodSettings()->setReverseApiPort(settings.m_reverseAPIPort);
|
||||
response.getDsdDemodSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
|
||||
response.getDsdDemodSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex);
|
||||
|
||||
}
|
||||
|
||||
void DSDDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
|
||||
@ -946,3 +1033,117 @@ void DSDDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response
|
||||
response.getDsdDemodReport()->setSyncRate(getDecoder().getSymbolSyncQuality());
|
||||
response.getDsdDemodReport()->setStatusText(new QString(updateAndGetStatusText()));
|
||||
}
|
||||
|
||||
void DSDDemod::webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const DSDDemodSettings& settings, bool force)
|
||||
{
|
||||
SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings();
|
||||
swgChannelSettings->setTx(0);
|
||||
swgChannelSettings->setChannelType(new QString("DSDDemod"));
|
||||
swgChannelSettings->setDsdDemodSettings(new SWGSDRangel::SWGDSDDemodSettings());
|
||||
SWGSDRangel::SWGDSDDemodSettings *swgDSDDemodSettings = swgChannelSettings->getDsdDemodSettings();
|
||||
|
||||
// transfer data that has been modified. When force is on transfer all data except reverse API data
|
||||
|
||||
if (channelSettingsKeys.contains("inputFrequencyOffset") || force) {
|
||||
swgDSDDemodSettings->setInputFrequencyOffset(settings.m_inputFrequencyOffset);
|
||||
}
|
||||
if (channelSettingsKeys.contains("rfBandwidth") || force) {
|
||||
swgDSDDemodSettings->setRfBandwidth(settings.m_rfBandwidth);
|
||||
}
|
||||
if (channelSettingsKeys.contains("fmDeviation") || force) {
|
||||
swgDSDDemodSettings->setFmDeviation(settings.m_fmDeviation);
|
||||
}
|
||||
if (channelSettingsKeys.contains("demodGain") || force) {
|
||||
swgDSDDemodSettings->setDemodGain(settings.m_demodGain);
|
||||
}
|
||||
if (channelSettingsKeys.contains("volume") || force) {
|
||||
swgDSDDemodSettings->setVolume(settings.m_volume);
|
||||
}
|
||||
if (channelSettingsKeys.contains("baudRate") || force) {
|
||||
swgDSDDemodSettings->setBaudRate(settings.m_baudRate);
|
||||
}
|
||||
if (channelSettingsKeys.contains("squelchGate") || force) {
|
||||
swgDSDDemodSettings->setSquelchGate(settings.m_squelchGate);
|
||||
}
|
||||
if (channelSettingsKeys.contains("squelch") || force) {
|
||||
swgDSDDemodSettings->setSquelch(settings.m_squelch);
|
||||
}
|
||||
if (channelSettingsKeys.contains("audioMute") || force) {
|
||||
swgDSDDemodSettings->setAudioMute(settings.m_audioMute ? 1 : 0);
|
||||
}
|
||||
if (channelSettingsKeys.contains("enableCosineFiltering") || force) {
|
||||
swgDSDDemodSettings->setEnableCosineFiltering(settings.m_enableCosineFiltering ? 1 : 0);
|
||||
}
|
||||
if (channelSettingsKeys.contains("syncOrConstellation") || force) {
|
||||
swgDSDDemodSettings->setSyncOrConstellation(settings.m_syncOrConstellation ? 1 : 0);
|
||||
}
|
||||
if (channelSettingsKeys.contains("slot1On") || force) {
|
||||
swgDSDDemodSettings->setSlot1On(settings.m_slot1On ? 1 : 0);
|
||||
}
|
||||
if (channelSettingsKeys.contains("slot2On") || force) {
|
||||
swgDSDDemodSettings->setSlot2On(settings.m_slot2On ? 1 : 0);
|
||||
}
|
||||
if (channelSettingsKeys.contains("tdmaStereo") || force) {
|
||||
swgDSDDemodSettings->setTdmaStereo(settings.m_tdmaStereo ? 1 : 0);
|
||||
}
|
||||
if (channelSettingsKeys.contains("pllLock") || force) {
|
||||
swgDSDDemodSettings->setPllLock(settings.m_pllLock ? 1 : 0);
|
||||
}
|
||||
if (channelSettingsKeys.contains("rgbColor") || force) {
|
||||
swgDSDDemodSettings->setRgbColor(settings.m_rgbColor);
|
||||
}
|
||||
if (channelSettingsKeys.contains("title") || force) {
|
||||
swgDSDDemodSettings->setTitle(new QString(settings.m_title));
|
||||
}
|
||||
if (channelSettingsKeys.contains("audioDeviceName") || force) {
|
||||
swgDSDDemodSettings->setAudioDeviceName(new QString(settings.m_audioDeviceName));
|
||||
}
|
||||
if (channelSettingsKeys.contains("highPassFilter") || force) {
|
||||
swgDSDDemodSettings->setHighPassFilter(settings.m_highPassFilter ? 1 : 0);
|
||||
}
|
||||
if (channelSettingsKeys.contains("traceLengthMutliplier") || force) {
|
||||
swgDSDDemodSettings->setTraceLengthMutliplier(settings.m_traceLengthMutliplier);
|
||||
}
|
||||
if (channelSettingsKeys.contains("traceStroke") || force) {
|
||||
swgDSDDemodSettings->setTraceStroke(settings.m_traceStroke);
|
||||
}
|
||||
if (channelSettingsKeys.contains("traceDecay") || force) {
|
||||
swgDSDDemodSettings->setTraceDecay(settings.m_traceDecay);
|
||||
}
|
||||
|
||||
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 DSDDemod::networkManagerFinished(QNetworkReply *reply)
|
||||
{
|
||||
QNetworkReply::NetworkError replyError = reply->error();
|
||||
|
||||
if (replyError)
|
||||
{
|
||||
qWarning() << "DSDDemod::networkManagerFinished:"
|
||||
<< " error(" << (int) replyError
|
||||
<< "): " << replyError
|
||||
<< ": " << reply->errorString();
|
||||
return;
|
||||
}
|
||||
|
||||
QString answer = reply->readAll();
|
||||
answer.chop(1); // remove last \n
|
||||
qDebug("DSDDemod::networkManagerFinished: reply:\n%s", answer.toStdString().c_str());
|
||||
}
|
||||
|
@ -18,9 +18,11 @@
|
||||
#ifndef INCLUDE_DSDDEMOD_H
|
||||
#define INCLUDE_DSDDEMOD_H
|
||||
|
||||
#include <QMutex>
|
||||
#include <vector>
|
||||
|
||||
#include <QMutex>
|
||||
#include <QNetworkRequest>
|
||||
|
||||
#include "dsp/basebandsamplesink.h"
|
||||
#include "channel/channelsinkapi.h"
|
||||
#include "dsp/phasediscri.h"
|
||||
@ -38,11 +40,14 @@
|
||||
#include "dsddemodsettings.h"
|
||||
#include "dsddecoder.h"
|
||||
|
||||
class QNetworkAccessManager;
|
||||
class QNetworkReply;
|
||||
class DeviceSourceAPI;
|
||||
class ThreadedBasebandSampleSink;
|
||||
class DownChannelizer;
|
||||
|
||||
class DSDDemod : public BasebandSampleSink, public ChannelSinkAPI {
|
||||
Q_OBJECT
|
||||
public:
|
||||
class MsgConfigureDSDDemod : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
@ -244,6 +249,9 @@ private:
|
||||
SignalFormat m_signalFormat; //!< Used to keep formatting during successive calls for the same standard type
|
||||
PhaseDiscriminators m_phaseDiscri;
|
||||
|
||||
QNetworkAccessManager *m_networkManager;
|
||||
QNetworkRequest m_networkRequest;
|
||||
|
||||
QMutex m_settingsMutex;
|
||||
|
||||
static const int m_udpBlockSize;
|
||||
@ -255,6 +263,11 @@ private:
|
||||
|
||||
void webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const DSDDemodSettings& settings);
|
||||
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
|
||||
void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const DSDDemodSettings& settings, bool force);
|
||||
|
||||
private slots:
|
||||
void networkManagerFinished(QNetworkReply *reply);
|
||||
|
||||
};
|
||||
|
||||
#endif // INCLUDE_DSDDEMOD_H
|
||||
|
@ -274,12 +274,23 @@ void DSDDemodGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
//qDebug("DSDDemodGUI::onMenuDialogCalled: x: %d y: %d", p.x(), p.y());
|
||||
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);
|
||||
|
@ -52,6 +52,11 @@ void DSDDemodSettings::resetToDefaults()
|
||||
m_traceStroke = 100;
|
||||
m_traceDecay = 200;
|
||||
m_audioDeviceName = AudioDeviceManager::m_defaultDeviceName;
|
||||
m_useReverseAPI = false;
|
||||
m_reverseAPIAddress = "127.0.0.1";
|
||||
m_reverseAPIPort = 8888;
|
||||
m_reverseAPIDeviceIndex = 0;
|
||||
m_reverseAPIChannelIndex = 0;
|
||||
}
|
||||
|
||||
QByteArray DSDDemodSettings::serialize() const
|
||||
@ -87,6 +92,11 @@ QByteArray DSDDemodSettings::serialize() const
|
||||
s.writeS32(21, m_traceLengthMutliplier);
|
||||
s.writeS32(22, m_traceStroke);
|
||||
s.writeS32(23, m_traceDecay);
|
||||
s.writeBool(24, m_useReverseAPI);
|
||||
s.writeString(25, m_reverseAPIAddress);
|
||||
s.writeU32(26, m_reverseAPIPort);
|
||||
s.writeU32(27, m_reverseAPIDeviceIndex);
|
||||
s.writeU32(28, m_reverseAPIChannelIndex);
|
||||
|
||||
return s.final();
|
||||
}
|
||||
@ -106,6 +116,7 @@ bool DSDDemodSettings::deserialize(const QByteArray& data)
|
||||
QByteArray bytetmp;
|
||||
QString strtmp;
|
||||
qint32 tmp;
|
||||
uint32_t utmp;
|
||||
|
||||
if (m_channelMarker) {
|
||||
d.readBlob(17, &bytetmp);
|
||||
@ -147,6 +158,20 @@ bool DSDDemodSettings::deserialize(const QByteArray& data)
|
||||
m_traceStroke = tmp < 0 ? 0 : tmp > 255 ? 255 : tmp;
|
||||
d.readS32(23, &tmp, 200);
|
||||
m_traceDecay = tmp < 0 ? 0 : tmp > 255 ? 255 : tmp;
|
||||
d.readBool(24, &m_useReverseAPI, false);
|
||||
d.readString(25, &m_reverseAPIAddress, "127.0.0.1");
|
||||
d.readU32(26, &utmp, 0);
|
||||
|
||||
if ((utmp > 1023) && (utmp < 65535)) {
|
||||
m_reverseAPIPort = utmp;
|
||||
} else {
|
||||
m_reverseAPIPort = 8888;
|
||||
}
|
||||
|
||||
d.readU32(27, &utmp, 0);
|
||||
m_reverseAPIDeviceIndex = utmp > 99 ? 99 : utmp;
|
||||
d.readU32(28, &utmp, 0);
|
||||
m_reverseAPIChannelIndex = utmp > 99 ? 99 : utmp;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -45,6 +45,11 @@ struct DSDDemodSettings
|
||||
int m_traceStroke; // [0..255]
|
||||
int m_traceDecay; // [0..255]
|
||||
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_scopeGUI;
|
||||
|
@ -1898,6 +1898,22 @@ margin-bottom: 20px;
|
||||
"traceDecay" : {
|
||||
"type" : "integer",
|
||||
"description" : "0 to 255"
|
||||
},
|
||||
"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"
|
||||
}
|
||||
},
|
||||
"description" : "DSDDemod"
|
||||
@ -23861,7 +23877,7 @@ except ApiException as e:
|
||||
</div>
|
||||
<div id="generator">
|
||||
<div class="content">
|
||||
Generated 2018-12-22T06:36:02.816+01:00
|
||||
Generated 2018-12-22T12:54:35.895+01:00
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -54,6 +54,17 @@ DSDDemodSettings:
|
||||
traceDecay:
|
||||
description: 0 to 255
|
||||
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
|
||||
|
||||
DSDDemodReport:
|
||||
description: DSDDemod
|
||||
@ -97,4 +108,3 @@ DSDDemodReport:
|
||||
description: mode dependent status messages (ref UI documentation)
|
||||
type: string
|
||||
|
||||
|
@ -54,6 +54,17 @@ DSDDemodSettings:
|
||||
traceDecay:
|
||||
description: 0 to 255
|
||||
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
|
||||
|
||||
DSDDemodReport:
|
||||
description: DSDDemod
|
||||
@ -97,4 +108,3 @@ DSDDemodReport:
|
||||
description: mode dependent status messages (ref UI documentation)
|
||||
type: string
|
||||
|
||||
|
@ -1898,6 +1898,22 @@ margin-bottom: 20px;
|
||||
"traceDecay" : {
|
||||
"type" : "integer",
|
||||
"description" : "0 to 255"
|
||||
},
|
||||
"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"
|
||||
}
|
||||
},
|
||||
"description" : "DSDDemod"
|
||||
@ -23861,7 +23877,7 @@ except ApiException as e:
|
||||
</div>
|
||||
<div id="generator">
|
||||
<div class="content">
|
||||
Generated 2018-12-22T06:36:02.816+01:00
|
||||
Generated 2018-12-22T12:54:35.895+01:00
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -72,6 +72,16 @@ SWGDSDDemodSettings::SWGDSDDemodSettings() {
|
||||
m_trace_stroke_isSet = false;
|
||||
trace_decay = 0;
|
||||
m_trace_decay_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;
|
||||
}
|
||||
|
||||
SWGDSDDemodSettings::~SWGDSDDemodSettings() {
|
||||
@ -124,6 +134,16 @@ SWGDSDDemodSettings::init() {
|
||||
m_trace_stroke_isSet = false;
|
||||
trace_decay = 0;
|
||||
m_trace_decay_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;
|
||||
}
|
||||
|
||||
void
|
||||
@ -154,6 +174,13 @@ SWGDSDDemodSettings::cleanup() {
|
||||
|
||||
|
||||
|
||||
|
||||
if(reverse_api_address != nullptr) {
|
||||
delete reverse_api_address;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
SWGDSDDemodSettings*
|
||||
@ -211,6 +238,16 @@ SWGDSDDemodSettings::fromJsonObject(QJsonObject &pJson) {
|
||||
|
||||
::SWGSDRangel::setValue(&trace_decay, pJson["traceDecay"], "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", "");
|
||||
|
||||
}
|
||||
|
||||
QString
|
||||
@ -293,6 +330,21 @@ SWGDSDDemodSettings::asJsonObject() {
|
||||
if(m_trace_decay_isSet){
|
||||
obj->insert("traceDecay", QJsonValue(trace_decay));
|
||||
}
|
||||
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));
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
@ -517,6 +569,56 @@ SWGDSDDemodSettings::setTraceDecay(qint32 trace_decay) {
|
||||
this->m_trace_decay_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGDSDDemodSettings::getUseReverseApi() {
|
||||
return use_reverse_api;
|
||||
}
|
||||
void
|
||||
SWGDSDDemodSettings::setUseReverseApi(qint32 use_reverse_api) {
|
||||
this->use_reverse_api = use_reverse_api;
|
||||
this->m_use_reverse_api_isSet = true;
|
||||
}
|
||||
|
||||
QString*
|
||||
SWGDSDDemodSettings::getReverseApiAddress() {
|
||||
return reverse_api_address;
|
||||
}
|
||||
void
|
||||
SWGDSDDemodSettings::setReverseApiAddress(QString* reverse_api_address) {
|
||||
this->reverse_api_address = reverse_api_address;
|
||||
this->m_reverse_api_address_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGDSDDemodSettings::getReverseApiPort() {
|
||||
return reverse_api_port;
|
||||
}
|
||||
void
|
||||
SWGDSDDemodSettings::setReverseApiPort(qint32 reverse_api_port) {
|
||||
this->reverse_api_port = reverse_api_port;
|
||||
this->m_reverse_api_port_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGDSDDemodSettings::getReverseApiDeviceIndex() {
|
||||
return reverse_api_device_index;
|
||||
}
|
||||
void
|
||||
SWGDSDDemodSettings::setReverseApiDeviceIndex(qint32 reverse_api_device_index) {
|
||||
this->reverse_api_device_index = reverse_api_device_index;
|
||||
this->m_reverse_api_device_index_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGDSDDemodSettings::getReverseApiChannelIndex() {
|
||||
return reverse_api_channel_index;
|
||||
}
|
||||
void
|
||||
SWGDSDDemodSettings::setReverseApiChannelIndex(qint32 reverse_api_channel_index) {
|
||||
this->reverse_api_channel_index = reverse_api_channel_index;
|
||||
this->m_reverse_api_channel_index_isSet = true;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
SWGDSDDemodSettings::isSet(){
|
||||
@ -544,6 +646,11 @@ SWGDSDDemodSettings::isSet(){
|
||||
if(m_trace_length_mutliplier_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_trace_stroke_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_trace_decay_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;}
|
||||
}while(false);
|
||||
return isObjectUpdated;
|
||||
}
|
||||
|
@ -108,6 +108,21 @@ public:
|
||||
qint32 getTraceDecay();
|
||||
void setTraceDecay(qint32 trace_decay);
|
||||
|
||||
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);
|
||||
|
||||
|
||||
virtual bool isSet() override;
|
||||
|
||||
@ -178,6 +193,21 @@ private:
|
||||
qint32 trace_decay;
|
||||
bool m_trace_decay_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;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user