mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-05-23 18:52:28 -04:00
SDRDaemonSource: adaptation to remote DaemonSink channel
This commit is contained in:
parent
4c0c51b17d
commit
95b105f453
@ -24,14 +24,10 @@
|
||||
#include <QTime>
|
||||
#include <QDateTime>
|
||||
#include <QString>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <nn.h>
|
||||
#include <pair.h>
|
||||
#else
|
||||
#include <nanomsg/nn.h>
|
||||
#include <nanomsg/pair.h>
|
||||
#endif
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QNetworkReply>
|
||||
#include <QJsonParseError>
|
||||
#include <QJsonObject>
|
||||
|
||||
#include "ui_sdrdaemonsourcegui.h"
|
||||
#include "gui/colormapper.h"
|
||||
@ -40,9 +36,9 @@
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "mainwindow.h"
|
||||
#include "util/simpleserializer.h"
|
||||
|
||||
#include <device/devicesourceapi.h>
|
||||
#include "device/devicesourceapi.h"
|
||||
#include "device/deviceuiset.h"
|
||||
|
||||
#include "sdrdaemonsourcegui.h"
|
||||
|
||||
SDRdaemonSourceGui::SDRdaemonSourceGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
@ -80,12 +76,6 @@ SDRdaemonSourceGui::SDRdaemonSourceGui(DeviceUISet *deviceUISet, QWidget* parent
|
||||
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
||||
ui->centerFrequency->setValueRange(7, 0, 9999999U);
|
||||
|
||||
ui->freq->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
||||
ui->freq->setValueRange(7, 0, 9999999U);
|
||||
|
||||
ui->sampleRate->setColorMapper(ColorMapper(ColorMapper::GrayGreenYellow));
|
||||
ui->sampleRate->setValueRange(7, 32000U, 9999999U);
|
||||
|
||||
displaySettings();
|
||||
|
||||
connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus()));
|
||||
@ -97,6 +87,9 @@ SDRdaemonSourceGui::SDRdaemonSourceGui(DeviceUISet *deviceUISet, QWidget* parent
|
||||
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection);
|
||||
m_sampleSource->setMessageQueueToGUI(&m_inputMessageQueue);
|
||||
|
||||
m_networkManager = new QNetworkAccessManager();
|
||||
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
|
||||
m_eventsTime.start();
|
||||
displayEventCounts();
|
||||
displayEventTimer();
|
||||
@ -107,6 +100,8 @@ SDRdaemonSourceGui::SDRdaemonSourceGui(DeviceUISet *deviceUISet, QWidget* parent
|
||||
|
||||
SDRdaemonSourceGui::~SDRdaemonSourceGui()
|
||||
{
|
||||
disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
delete m_networkManager;
|
||||
delete ui;
|
||||
}
|
||||
|
||||
@ -149,7 +144,6 @@ bool SDRdaemonSourceGui::deserialize(const QByteArray& data)
|
||||
|
||||
if (m_settings.deserialize(data))
|
||||
{
|
||||
updateTxDelay();
|
||||
displaySettings();
|
||||
m_forceSettings = true;
|
||||
sendSettings();
|
||||
@ -167,10 +161,8 @@ qint64 SDRdaemonSourceGui::getCenterFrequency() const
|
||||
return m_streamCenterFrequency;
|
||||
}
|
||||
|
||||
void SDRdaemonSourceGui::setCenterFrequency(qint64 centerFrequency)
|
||||
void SDRdaemonSourceGui::setCenterFrequency(qint64 centerFrequency __attribute__((unused)))
|
||||
{
|
||||
m_settings.m_centerFrequency = centerFrequency;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
bool SDRdaemonSourceGui::handleMessage(const Message& message)
|
||||
@ -220,10 +212,8 @@ bool SDRdaemonSourceGui::handleMessage(const Message& message)
|
||||
|
||||
int nbFECBlocks = ((SDRdaemonSourceInput::MsgReportSDRdaemonSourceStreamTiming&)message).getNbFECBlocksPerFrame();
|
||||
|
||||
if (m_nbFECBlocks != nbFECBlocks)
|
||||
{
|
||||
if (m_nbFECBlocks != nbFECBlocks) {
|
||||
m_nbFECBlocks = nbFECBlocks;
|
||||
updateTxDelay();
|
||||
}
|
||||
|
||||
updateWithStreamTime();
|
||||
@ -256,10 +246,8 @@ void SDRdaemonSourceGui::handleInputMessages()
|
||||
{
|
||||
DSPSignalNotification* notif = (DSPSignalNotification*) message;
|
||||
|
||||
if (notif->getSampleRate() != m_streamSampleRate)
|
||||
{
|
||||
if (notif->getSampleRate() != m_streamSampleRate) {
|
||||
m_streamSampleRate = notif->getSampleRate();
|
||||
updateTxDelay();
|
||||
}
|
||||
|
||||
m_streamCenterFrequency = notif->getCenterFrequency();
|
||||
@ -289,21 +277,9 @@ void SDRdaemonSourceGui::updateSampleRateAndFrequency()
|
||||
ui->deviceRateText->setText(tr("%1k").arg((float)m_streamSampleRate / 1000));
|
||||
blockApplySettings(true);
|
||||
ui->centerFrequency->setValue(m_streamCenterFrequency / 1000);
|
||||
ui->freq->setValue(m_streamCenterFrequency / 1000);
|
||||
blockApplySettings(false);
|
||||
}
|
||||
|
||||
void SDRdaemonSourceGui::updateTxDelay()
|
||||
{
|
||||
if (m_streamSampleRate == 0) {
|
||||
m_txDelay = 0.0; // 0 value will not set the Tx delay
|
||||
} else {
|
||||
m_txDelay = ((127*127*m_settings.m_txDelay) / m_streamSampleRate)/(128 + m_nbFECBlocks);
|
||||
}
|
||||
|
||||
ui->txDelayText->setToolTip(tr("%1 us").arg(QString::number(m_txDelay*1e6, 'f', 0)));
|
||||
}
|
||||
|
||||
void SDRdaemonSourceGui::displaySettings()
|
||||
{
|
||||
blockApplySettings(true);
|
||||
@ -311,24 +287,10 @@ void SDRdaemonSourceGui::displaySettings()
|
||||
ui->centerFrequency->setValue(m_streamCenterFrequency / 1000);
|
||||
ui->deviceRateText->setText(tr("%1k").arg(m_streamSampleRate / 1000.0));
|
||||
|
||||
ui->freq->setValue(m_streamCenterFrequency / 1000);
|
||||
ui->decim->setCurrentIndex(m_settings.m_log2Decim);
|
||||
ui->fcPos->setCurrentIndex(m_settings.m_fcPos);
|
||||
ui->sampleRate->setValue(m_settings.m_sampleRate);
|
||||
ui->specificParms->setText(m_settings.m_specificParameters);
|
||||
ui->specificParms->setCursorPosition(0);
|
||||
ui->txDelayText->setText(tr("%1").arg(m_settings.m_txDelay*100));
|
||||
ui->nbFECBlocks->setValue(m_settings.m_nbFECBlocks);
|
||||
QString nstr = QString("%1").arg(m_settings.m_nbFECBlocks, 2, 10, QChar('0'));
|
||||
ui->nbFECBlocksText->setText(nstr);
|
||||
|
||||
QString s0 = QString::number(128 + m_settings.m_nbFECBlocks, 'f', 0);
|
||||
ui->nominalNbBlocksText->setText(tr("%1/%2").arg(s0).arg(nstr));
|
||||
|
||||
ui->address->setText(m_settings.m_address);
|
||||
ui->apiAddress->setText(m_settings.m_apiAddress);
|
||||
ui->apiPort->setText(tr("%1").arg(m_settings.m_apiPort));
|
||||
ui->dataPort->setText(tr("%1").arg(m_settings.m_dataPort));
|
||||
ui->controlPort->setText(tr("%1").arg(m_settings.m_controlPort));
|
||||
ui->specificParms->setText(m_settings.m_specificParameters);
|
||||
ui->dataAddress->setText(m_settings.m_dataAddress);
|
||||
|
||||
ui->dcOffset->setChecked(m_settings.m_dcBlock);
|
||||
ui->iqImbalance->setChecked(m_settings.m_iqCorrection);
|
||||
@ -342,45 +304,48 @@ void SDRdaemonSourceGui::sendSettings()
|
||||
m_updateTimer.start(100);
|
||||
}
|
||||
|
||||
void SDRdaemonSourceGui::on_applyButton_clicked(bool checked __attribute__((unused)))
|
||||
void SDRdaemonSourceGui::on_apiApplyButton_clicked(bool checked __attribute__((unused)))
|
||||
{
|
||||
m_settings.m_address = ui->address->text();
|
||||
m_settings.m_apiAddress = ui->apiAddress->text();
|
||||
|
||||
bool send = false;
|
||||
bool ctlOk;
|
||||
int udpCtlPort = ui->controlPort->text().toInt(&ctlOk);
|
||||
int udpApiPort = ui->apiPort->text().toInt(&ctlOk);
|
||||
|
||||
if((ctlOk) && (udpCtlPort >= 1024) && (udpCtlPort < 65535))
|
||||
{
|
||||
m_settings.m_controlPort = udpCtlPort;
|
||||
send = true;
|
||||
if((ctlOk) && (udpApiPort >= 1024) && (udpApiPort < 65535)) {
|
||||
m_settings.m_apiPort = udpApiPort;
|
||||
}
|
||||
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void SDRdaemonSourceGui::on_dataApplyButton_clicked(bool checked __attribute__((unused)))
|
||||
{
|
||||
m_settings.m_dataAddress = ui->dataAddress->text();
|
||||
|
||||
bool dataOk;
|
||||
int udpDataPort = ui->dataPort->text().toInt(&dataOk);
|
||||
|
||||
if((dataOk) && (udpDataPort >= 1024) && (udpDataPort < 65535))
|
||||
{
|
||||
if((dataOk) && (udpDataPort >= 1024) && (udpDataPort < 65535)) {
|
||||
m_settings.m_dataPort = udpDataPort;
|
||||
send = true;
|
||||
}
|
||||
|
||||
if (send) {
|
||||
sendSettings();
|
||||
}
|
||||
}
|
||||
|
||||
void SDRdaemonSourceGui::on_sendButton_clicked(bool checked __attribute__((unused)))
|
||||
void SDRdaemonSourceGui::on_apiAddress_returnPressed()
|
||||
{
|
||||
updateTxDelay();
|
||||
m_forceSettings = true;
|
||||
m_settings.m_apiAddress = ui->apiAddress->text();
|
||||
|
||||
QString infoURL = QString("http://%1:%2/sdrangel").arg(m_settings.m_apiAddress).arg(m_settings.m_apiPort);
|
||||
m_networkRequest.setUrl(QUrl(infoURL));
|
||||
m_networkManager->get(m_networkRequest);
|
||||
|
||||
sendSettings();
|
||||
ui->specificParms->setCursorPosition(0);
|
||||
}
|
||||
|
||||
void SDRdaemonSourceGui::on_address_returnPressed()
|
||||
void SDRdaemonSourceGui::on_dataAddress_returnPressed()
|
||||
{
|
||||
m_settings.m_address = ui->address->text();
|
||||
m_settings.m_dataAddress = ui->dataAddress->text();
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
@ -400,18 +365,23 @@ void SDRdaemonSourceGui::on_dataPort_returnPressed()
|
||||
}
|
||||
}
|
||||
|
||||
void SDRdaemonSourceGui::on_controlPort_returnPressed()
|
||||
void SDRdaemonSourceGui::on_apiPort_returnPressed()
|
||||
{
|
||||
bool ctlOk;
|
||||
int udpCtlPort = ui->controlPort->text().toInt(&ctlOk);
|
||||
int udpApiPort = ui->apiPort->text().toInt(&ctlOk);
|
||||
|
||||
if((!ctlOk) || (udpCtlPort < 1024) || (udpCtlPort > 65535))
|
||||
if((!ctlOk) || (udpApiPort < 1024) || (udpApiPort > 65535))
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_settings.m_controlPort = udpCtlPort;
|
||||
m_settings.m_apiPort = udpApiPort;
|
||||
|
||||
QString infoURL = QString("http://%1:%2/sdrangel").arg(m_settings.m_apiAddress).arg(m_settings.m_apiPort);
|
||||
m_networkRequest.setUrl(QUrl(infoURL));
|
||||
m_networkManager->get(m_networkRequest);
|
||||
|
||||
sendSettings();
|
||||
}
|
||||
}
|
||||
@ -428,54 +398,6 @@ void SDRdaemonSourceGui::on_iqImbalance_toggled(bool checked)
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void SDRdaemonSourceGui::on_freq_changed(quint64 value)
|
||||
{
|
||||
m_settings.m_centerFrequency = value * 1000;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void SDRdaemonSourceGui::on_sampleRate_changed(quint64 value)
|
||||
{
|
||||
m_settings.m_sampleRate = value;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void SDRdaemonSourceGui::on_specificParms_returnPressed()
|
||||
{
|
||||
if ((ui->specificParms->text()).size() > 0) {
|
||||
m_settings.m_specificParameters = ui->specificParms->text();
|
||||
sendSettings();
|
||||
}
|
||||
}
|
||||
|
||||
void SDRdaemonSourceGui::on_decim_currentIndexChanged(int index __attribute__((unused)))
|
||||
{
|
||||
m_settings.m_log2Decim = ui->decim->currentIndex();
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void SDRdaemonSourceGui::on_fcPos_currentIndexChanged(int index __attribute__((unused)))
|
||||
{
|
||||
m_settings.m_fcPos = ui->fcPos->currentIndex();
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void SDRdaemonSourceGui::on_txDelay_valueChanged(int value)
|
||||
{
|
||||
m_settings.m_txDelay = value / 100.0;
|
||||
ui->txDelayText->setText(tr("%1").arg(value));
|
||||
updateTxDelay();
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void SDRdaemonSourceGui::on_nbFECBlocks_valueChanged(int value)
|
||||
{
|
||||
m_settings.m_nbFECBlocks = value;
|
||||
QString nstr = QString("%1").arg(m_settings.m_nbFECBlocks, 2, 10, QChar('0'));
|
||||
ui->nbFECBlocksText->setText(nstr);
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void SDRdaemonSourceGui::on_startStop_toggled(bool checked)
|
||||
{
|
||||
if (m_doApplySettings)
|
||||
@ -631,3 +553,72 @@ void SDRdaemonSourceGui::updateStatus()
|
||||
ui->startStop->setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
void SDRdaemonSourceGui::networkManagerFinished(QNetworkReply *reply)
|
||||
{
|
||||
if (reply->error())
|
||||
{
|
||||
ui->apiAddressLabel->setStyleSheet("QLabel { background:rgb(79,79,79); }");
|
||||
ui->statusText->setText(reply->errorString());
|
||||
return;
|
||||
}
|
||||
|
||||
QString answer = reply->readAll();
|
||||
|
||||
try
|
||||
{
|
||||
QByteArray jsonBytes(answer.toStdString().c_str());
|
||||
QJsonParseError error;
|
||||
QJsonDocument doc = QJsonDocument::fromJson(jsonBytes, &error);
|
||||
|
||||
if (error.error == QJsonParseError::NoError)
|
||||
{
|
||||
ui->apiAddressLabel->setStyleSheet("QLabel { background-color : green; }");
|
||||
ui->statusText->setText(QString("API OK"));
|
||||
analyzeApiReply(doc.object());
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->apiAddressLabel->setStyleSheet("QLabel { background:rgb(79,79,79); }");
|
||||
QString errorMsg = QString("Reply JSON error: ") + error.errorString() + QString(" at offset ") + QString::number(error.offset);
|
||||
ui->statusText->setText(QString("JSON error. See log"));
|
||||
qInfo().noquote() << "SDRdaemonSinkGui::networkManagerFinished" << errorMsg;
|
||||
}
|
||||
}
|
||||
catch (const std::exception& ex)
|
||||
{
|
||||
ui->apiAddressLabel->setStyleSheet("QLabel { background:rgb(79,79,79); }");
|
||||
QString errorMsg = QString("Error parsing request: ") + ex.what();
|
||||
ui->statusText->setText("Error parsing request. See log for details");
|
||||
qInfo().noquote() << "SDRdaemonSinkGui::networkManagerFinished" << errorMsg;
|
||||
}
|
||||
}
|
||||
|
||||
void SDRdaemonSourceGui::analyzeApiReply(const QJsonObject& jsonObject)
|
||||
{
|
||||
QString infoLine;
|
||||
|
||||
if (jsonObject.contains("version")) {
|
||||
infoLine = "v" + jsonObject["version"].toString();
|
||||
}
|
||||
|
||||
if (jsonObject.contains("qtVersion")) {
|
||||
infoLine += " Qt" + jsonObject["qtVersion"].toString();
|
||||
}
|
||||
|
||||
if (jsonObject.contains("architecture")) {
|
||||
infoLine += " " + jsonObject["architecture"].toString();
|
||||
}
|
||||
|
||||
if (jsonObject.contains("os")) {
|
||||
infoLine += " " + jsonObject["os"].toString();
|
||||
}
|
||||
|
||||
if (jsonObject.contains("dspRxBits") && jsonObject.contains("dspTxBits")) {
|
||||
infoLine += QString(" %1/%2b").arg(jsonObject["dspRxBits"].toInt()).arg(jsonObject["dspTxBits"].toInt());
|
||||
}
|
||||
|
||||
if (infoLine.size() > 0) {
|
||||
ui->infoText->setText(infoLine);
|
||||
}
|
||||
}
|
||||
|
@ -17,16 +17,21 @@
|
||||
#ifndef INCLUDE_SDRDAEMONSOURCEGUI_H
|
||||
#define INCLUDE_SDRDAEMONSOURCEGUI_H
|
||||
|
||||
#include <plugin/plugininstancegui.h>
|
||||
#include <QTimer>
|
||||
#include <QWidget>
|
||||
#include <sys/time.h>
|
||||
|
||||
#include <QTimer>
|
||||
#include <QWidget>
|
||||
#include <QNetworkRequest>
|
||||
|
||||
#include "plugin/plugininstancegui.h"
|
||||
#include "util/messagequeue.h"
|
||||
|
||||
#include "sdrdaemonsourceinput.h"
|
||||
|
||||
class DeviceUISet;
|
||||
class QNetworkAccessManager;
|
||||
class QNetworkReply;
|
||||
class QJsonObject;
|
||||
|
||||
namespace Ui {
|
||||
class SDRdaemonSourceGui;
|
||||
@ -98,6 +103,9 @@ private:
|
||||
QPalette m_paletteGreenText;
|
||||
QPalette m_paletteWhiteText;
|
||||
|
||||
QNetworkAccessManager *m_networkManager;
|
||||
QNetworkRequest m_networkRequest;
|
||||
|
||||
void blockApplySettings(bool block);
|
||||
void displaySettings();
|
||||
void displayTime();
|
||||
@ -105,31 +113,26 @@ private:
|
||||
void updateWithAcquisition();
|
||||
void updateWithStreamTime();
|
||||
void updateSampleRateAndFrequency();
|
||||
void updateTxDelay();
|
||||
void displayEventCounts();
|
||||
void displayEventTimer();
|
||||
void analyzeApiReply(const QJsonObject& jsonObject);
|
||||
|
||||
private slots:
|
||||
void handleInputMessages();
|
||||
void on_applyButton_clicked(bool checked);
|
||||
void on_apiApplyButton_clicked(bool checked);
|
||||
void on_dataApplyButton_clicked(bool checked);
|
||||
void on_dcOffset_toggled(bool checked);
|
||||
void on_iqImbalance_toggled(bool checked);
|
||||
void on_address_returnPressed();
|
||||
void on_apiAddress_returnPressed();
|
||||
void on_apiPort_returnPressed();
|
||||
void on_dataAddress_returnPressed();
|
||||
void on_dataPort_returnPressed();
|
||||
void on_controlPort_returnPressed();
|
||||
void on_sendButton_clicked(bool checked);
|
||||
void on_freq_changed(quint64 value);
|
||||
void on_sampleRate_changed(quint64 value);
|
||||
void on_specificParms_returnPressed();
|
||||
void on_decim_currentIndexChanged(int index);
|
||||
void on_fcPos_currentIndexChanged(int index);
|
||||
void on_startStop_toggled(bool checked);
|
||||
void on_record_toggled(bool checked);
|
||||
void on_eventCountsReset_clicked(bool checked);
|
||||
void on_txDelay_valueChanged(int value);
|
||||
void on_nbFECBlocks_valueChanged(int value);
|
||||
void updateHardware();
|
||||
void updateStatus();
|
||||
void networkManagerFinished(QNetworkReply *reply);
|
||||
};
|
||||
|
||||
#endif // INCLUDE_SDRDAEMONSOURCEGUI_H
|
||||
|
@ -6,14 +6,14 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>372</width>
|
||||
<height>261</height>
|
||||
<width>360</width>
|
||||
<height>270</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>372</width>
|
||||
<height>261</height>
|
||||
<width>360</width>
|
||||
<height>270</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
@ -373,41 +373,6 @@
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="streamLayout">
|
||||
<item>
|
||||
<widget class="QDial" name="nbFECBlocks">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Desired number of FEC blocks per frame</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>64</number>
|
||||
</property>
|
||||
<property name="pageStep">
|
||||
<number>1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="nbFECBlocksText">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>18</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Desired number of FEC blocks per frame</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>00</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="nominalNbBlocksText">
|
||||
<property name="minimumSize">
|
||||
@ -577,28 +542,34 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="addressLayout">
|
||||
<layout class="QHBoxLayout" name="apiAddressLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="addressLabel">
|
||||
<widget class="QLabel" name="apiAddressLabel">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Addr:</string>
|
||||
<string>API</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="address">
|
||||
<widget class="QLineEdit" name="apiAddress">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>110</width>
|
||||
<width>120</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>110</width>
|
||||
<width>120</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
@ -617,52 +588,14 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="dataPortLabel">
|
||||
<widget class="QLabel" name="apiPortSeparator">
|
||||
<property name="text">
|
||||
<string>D:</string>
|
||||
<string>:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="dataPort">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>60</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>60</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Local data connection port</string>
|
||||
</property>
|
||||
<property name="inputMask">
|
||||
<string>00000</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="controlPortLabel">
|
||||
<property name="text">
|
||||
<string>C:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="controlPort">
|
||||
<widget class="QLineEdit" name="apiPort">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>60</width>
|
||||
@ -703,7 +636,7 @@
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="applyButton">
|
||||
<widget class="QPushButton" name="apiApplyButton">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
@ -721,54 +654,77 @@
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_freq">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
<layout class="QHBoxLayout" name="dataAddressLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="dataAddressLabel">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="frequencyLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="freqLabel">
|
||||
<property name="text">
|
||||
<string>Fc:</string>
|
||||
<string>Data</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="ValueDial" name="freq" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
<widget class="QLineEdit" name="dataAddress">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>120</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>120</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="inputMask">
|
||||
<string>000.000.000.000</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>0.0.0.0</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="dataPortSeparator">
|
||||
<property name="text">
|
||||
<string>:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="dataPort">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>16</height>
|
||||
<width>60</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Liberation Mono</family>
|
||||
<pointsize>12</pointsize>
|
||||
<italic>false</italic>
|
||||
</font>
|
||||
</property>
|
||||
<property name="cursor">
|
||||
<cursorShape>PointingHandCursor</cursorShape>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>60</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Desired device center frequency</string>
|
||||
<string>Local data connection port</string>
|
||||
</property>
|
||||
<property name="inputMask">
|
||||
<string>00000</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="freqUnitLabel">
|
||||
<property name="text">
|
||||
<string>kHz</string>
|
||||
<string>0</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -786,256 +742,37 @@
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="txDelayLabel">
|
||||
<property name="text">
|
||||
<string>UDly</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDial" name="txDelay">
|
||||
<widget class="QPushButton" name="dataApplyButton">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Delay between consecutive UDP packets in percentage of nominal UDP packet process time</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>90</number>
|
||||
</property>
|
||||
<property name="pageStep">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>50</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="txDelayText">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<width>30</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>90</string>
|
||||
<string>Set</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="sampleRateLayout">
|
||||
<layout class="QHBoxLayout" name="statusLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="sampleRateLabel">
|
||||
<widget class="QLabel" name="statusText">
|
||||
<property name="text">
|
||||
<string>SR:</string>
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="ValueDial" name="sampleRate" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Liberation Mono</family>
|
||||
<pointsize>12</pointsize>
|
||||
<italic>false</italic>
|
||||
</font>
|
||||
</property>
|
||||
<property name="cursor">
|
||||
<cursorShape>PointingHandCursor</cursorShape>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Desired remote device sample rate</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="sampleRateUnits">
|
||||
<property name="text">
|
||||
<string>S/s</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="decimLabel">
|
||||
<property name="text">
|
||||
<string>Dec:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="decim">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>45</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Decimation</string>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>2</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>4</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>8</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>16</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>32</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>64</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="fcPosLabel">
|
||||
<property name="text">
|
||||
<string> Fp:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="fcPos">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Center frequency position (Infradyne, Supradyne, Centered)</string>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Inf</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Sup</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Cen</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="controlLayout2">
|
||||
<layout class="QHBoxLayout" name="infoLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="specificParmsLAbel">
|
||||
<widget class="QLabel" name="infoText">
|
||||
<property name="text">
|
||||
<string>Sp:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="specificParms">
|
||||
<property name="toolTip">
|
||||
<string>Other parameters that are hardware specific</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="sendButton">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Send commands to remote SDRdaemonRx instance</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Send</string>
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -57,12 +57,6 @@ SDRdaemonSourceInput::SDRdaemonSourceInput(DeviceSourceAPI *deviceAPI) :
|
||||
m_deviceDescription(),
|
||||
m_startingTimeStamp(0)
|
||||
{
|
||||
m_sender = nn_socket(AF_SP, NN_PAIR);
|
||||
assert(m_sender != -1);
|
||||
int millis = 500;
|
||||
int rc __attribute__((unused)) = nn_setsockopt (m_sender, NN_SOL_SOCKET, NN_SNDTIMEO, &millis, sizeof (millis));
|
||||
assert (rc == 0);
|
||||
|
||||
m_sampleFifo.setSize(96000 * 4);
|
||||
m_SDRdaemonUDPHandler = new SDRdaemonSourceUDPHandler(&m_sampleFifo, m_deviceAPI);
|
||||
|
||||
@ -141,29 +135,16 @@ const QString& SDRdaemonSourceInput::getDeviceDescription() const
|
||||
|
||||
int SDRdaemonSourceInput::getSampleRate() const
|
||||
{
|
||||
if (m_SDRdaemonUDPHandler->getSampleRate()) {
|
||||
return m_SDRdaemonUDPHandler->getSampleRate();
|
||||
} else {
|
||||
return m_settings.m_sampleRate / (1<<m_settings.m_log2Decim);
|
||||
}
|
||||
}
|
||||
|
||||
quint64 SDRdaemonSourceInput::getCenterFrequency() const
|
||||
{
|
||||
if (m_SDRdaemonUDPHandler->getCenterFrequency()) {
|
||||
return m_SDRdaemonUDPHandler->getCenterFrequency();
|
||||
} else {
|
||||
return m_settings.m_centerFrequency;
|
||||
}
|
||||
}
|
||||
|
||||
void SDRdaemonSourceInput::setCenterFrequency(qint64 centerFrequency)
|
||||
void SDRdaemonSourceInput::setCenterFrequency(qint64 centerFrequency __attribute__((unused)))
|
||||
{
|
||||
SDRdaemonSourceSettings settings = m_settings;
|
||||
settings.m_centerFrequency = centerFrequency;
|
||||
|
||||
MsgConfigureSDRdaemonSource* message = MsgConfigureSDRdaemonSource::create(m_settings, false);
|
||||
m_inputMessageQueue.push(message);
|
||||
}
|
||||
|
||||
std::time_t SDRdaemonSourceInput::getStartingTimeStamp() const
|
||||
@ -240,9 +221,7 @@ bool SDRdaemonSourceInput::handleMessage(const Message& message)
|
||||
void SDRdaemonSourceInput::applySettings(const SDRdaemonSourceSettings& settings, bool force)
|
||||
{
|
||||
QMutexLocker mutexLocker(&m_mutex);
|
||||
bool changeTxDelay = false;
|
||||
std::ostringstream os;
|
||||
int nbArgs = 0;
|
||||
QString remoteAddress;
|
||||
m_SDRdaemonUDPHandler->getRemoteAddress(remoteAddress);
|
||||
|
||||
@ -250,139 +229,26 @@ void SDRdaemonSourceInput::applySettings(const SDRdaemonSourceSettings& settings
|
||||
{
|
||||
m_deviceAPI->configureCorrections(settings.m_dcBlock, settings.m_iqCorrection);
|
||||
qDebug("SDRdaemonSourceInput::applySettings: corrections: DC block: %s IQ imbalance: %s",
|
||||
m_settings.m_dcBlock ? "true" : "false",
|
||||
m_settings.m_iqCorrection ? "true" : "false");
|
||||
settings.m_dcBlock ? "true" : "false",
|
||||
settings.m_iqCorrection ? "true" : "false");
|
||||
}
|
||||
|
||||
if (force || (m_settings.m_address != settings.m_address) || (m_settings.m_dataPort != settings.m_dataPort))
|
||||
if (force || (m_settings.m_dataAddress != settings.m_dataAddress) || (m_settings.m_dataPort != settings.m_dataPort))
|
||||
{
|
||||
m_SDRdaemonUDPHandler->configureUDPLink(settings.m_address, settings.m_dataPort);
|
||||
m_SDRdaemonUDPHandler->configureUDPLink(settings.m_dataAddress, settings.m_dataPort);
|
||||
m_SDRdaemonUDPHandler->getRemoteAddress(remoteAddress);
|
||||
}
|
||||
|
||||
if (force || (remoteAddress != m_remoteAddress) || (m_settings.m_controlPort != settings.m_controlPort))
|
||||
{
|
||||
int rc = nn_shutdown(m_sender, 0);
|
||||
|
||||
if (rc < 0) {
|
||||
qDebug() << "SDRdaemonSourceInput::applySettings: nn disconnection failed";
|
||||
} else {
|
||||
qDebug() << "SDRdaemonSourceInput::applySettings: nn disconnection successful";
|
||||
}
|
||||
|
||||
std::ostringstream os;
|
||||
os << "tcp://" << remoteAddress.toStdString() << ":" << m_settings.m_controlPort;
|
||||
std::string addrstrng = os.str();
|
||||
rc = nn_connect(m_sender, addrstrng.c_str());
|
||||
|
||||
if (rc < 0) {
|
||||
qDebug() << "SDRdaemonSourceInput::applySettings: nn connexion to " << addrstrng.c_str() << " failed";
|
||||
} else {
|
||||
qDebug() << "SDRdaemonSourceInput::applySettings: nn connexion to " << addrstrng.c_str() << " successful";
|
||||
}
|
||||
}
|
||||
|
||||
if (force || (m_settings.m_centerFrequency != settings.m_centerFrequency))
|
||||
{
|
||||
os << "freq=" << settings.m_centerFrequency;
|
||||
nbArgs++;
|
||||
}
|
||||
|
||||
if (force || (m_settings.m_sampleRate != settings.m_sampleRate) || (m_settings.m_log2Decim != settings.m_log2Decim))
|
||||
{
|
||||
if (nbArgs > 0) os << ",";
|
||||
os << "srate=" << m_settings.m_sampleRate;
|
||||
nbArgs++;
|
||||
changeTxDelay = m_settings.m_sampleRate != settings.m_sampleRate;
|
||||
}
|
||||
|
||||
if (force || (m_settings.m_log2Decim != settings.m_log2Decim))
|
||||
{
|
||||
if (nbArgs > 0) os << ",";
|
||||
os << "decim=" << settings.m_log2Decim;
|
||||
nbArgs++;
|
||||
}
|
||||
|
||||
if ((m_settings.m_fcPos != settings.m_fcPos) || force)
|
||||
{
|
||||
if (nbArgs > 0) os << ",";
|
||||
os << "fcpos=" << m_settings.m_fcPos;
|
||||
nbArgs++;
|
||||
}
|
||||
|
||||
if (force || (m_settings.m_nbFECBlocks != settings.m_nbFECBlocks))
|
||||
{
|
||||
if (nbArgs > 0) os << ",";
|
||||
os << "fecblk=" << m_settings.m_nbFECBlocks;
|
||||
nbArgs++;
|
||||
changeTxDelay = true;
|
||||
}
|
||||
|
||||
if (force || (m_settings.m_txDelay != settings.m_txDelay))
|
||||
{
|
||||
changeTxDelay = true;
|
||||
}
|
||||
|
||||
if (changeTxDelay)
|
||||
{
|
||||
double delay = ((127*127*settings.m_txDelay) / settings.m_sampleRate)/(128 + settings.m_nbFECBlocks);
|
||||
qDebug("SDRdaemonSourceInput::applySettings: Tx delay: %f us", delay*1e6);
|
||||
|
||||
if (delay != 0.0)
|
||||
{
|
||||
if (nbArgs > 0) os << ",";
|
||||
os << "txdelay=" << (int) (delay*1e6);
|
||||
nbArgs++;
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_specificParameters != settings.m_specificParameters) || force)
|
||||
{
|
||||
if (settings.m_specificParameters.size() > 0)
|
||||
{
|
||||
if (nbArgs > 0) os << ",";
|
||||
os << settings.m_specificParameters.toStdString();
|
||||
nbArgs++;
|
||||
}
|
||||
}
|
||||
|
||||
if (nbArgs > 0)
|
||||
{
|
||||
int config_size = os.str().size();
|
||||
int rc = nn_send(m_sender, (void *) os.str().c_str(), config_size, 0);
|
||||
|
||||
if (rc != config_size)
|
||||
{
|
||||
qDebug() << "SDRdaemonSourceInput::applySettings: Cannot nn send to "
|
||||
<< " remoteAddress: " << remoteAddress
|
||||
<< " remotePort: " << settings.m_controlPort
|
||||
<< " message: " << os.str().c_str();
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug() << "SDRdaemonSourceInput::applySettings: nn send to "
|
||||
<< "remoteAddress:" << remoteAddress
|
||||
<< "remotePort:" << settings.m_controlPort
|
||||
<< "message:" << os.str().c_str();
|
||||
}
|
||||
}
|
||||
|
||||
mutexLocker.unlock();
|
||||
m_settings = settings;
|
||||
m_remoteAddress = remoteAddress;
|
||||
|
||||
qDebug() << "SDRdaemonSourceInput::applySettings: "
|
||||
<< " m_address: " << m_settings.m_address
|
||||
<< " m_remoteAddress: " << m_remoteAddress
|
||||
<< " m_dataAddress: " << m_settings.m_dataAddress
|
||||
<< " m_dataPort: " << m_settings.m_dataPort
|
||||
<< " m_controlPort: " << m_settings.m_controlPort
|
||||
<< " m_centerFrequency: " << m_settings.m_centerFrequency
|
||||
<< " m_sampleRate: " << m_settings.m_sampleRate
|
||||
<< " m_log2Decim: " << m_settings.m_log2Decim
|
||||
<< " m_fcPos: " << m_settings.m_fcPos
|
||||
<< " m_txDelay: " << m_settings.m_txDelay
|
||||
<< " m_nbFECBlocks: " << m_settings.m_nbFECBlocks
|
||||
<< " m_specificParameters: " << m_settings.m_specificParameters;
|
||||
<< " m_apiAddress: " << m_settings.m_apiAddress
|
||||
<< " m_apiPort: " << m_settings.m_apiPort
|
||||
<< " m_remoteAddress: " << m_remoteAddress;
|
||||
}
|
||||
|
||||
int SDRdaemonSourceInput::webapiRunGet(
|
||||
@ -429,43 +295,24 @@ int SDRdaemonSourceInput::webapiSettingsPutPatch(
|
||||
{
|
||||
SDRdaemonSourceSettings settings = m_settings;
|
||||
|
||||
if (deviceSettingsKeys.contains("centerFrequency")) {
|
||||
settings.m_centerFrequency = response.getSdrDaemonSourceSettings()->getCenterFrequency();
|
||||
if (deviceSettingsKeys.contains("apiAddress")) {
|
||||
settings.m_apiAddress = *response.getSdrDaemonSourceSettings()->getApiAddress();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("sampleRate")) {
|
||||
settings.m_sampleRate = response.getSdrDaemonSourceSettings()->getSampleRate();
|
||||
if (deviceSettingsKeys.contains("apiPort")) {
|
||||
settings.m_apiPort = response.getSdrDaemonSourceSettings()->getApiPort();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("log2Decim")) {
|
||||
settings.m_log2Decim = response.getSdrDaemonSourceSettings()->getLog2Decim();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("txDelay")) {
|
||||
settings.m_txDelay = response.getSdrDaemonSourceSettings()->getTxDelay();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("nbFECBlocks")) {
|
||||
settings.m_txDelay = response.getSdrDaemonSourceSettings()->getNbFecBlocks();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("address")) {
|
||||
settings.m_address = *response.getSdrDaemonSourceSettings()->getAddress();
|
||||
if (deviceSettingsKeys.contains("dataAddress")) {
|
||||
settings.m_dataAddress = *response.getSdrDaemonSourceSettings()->getDataAddress();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("dataPort")) {
|
||||
settings.m_dataPort = response.getSdrDaemonSourceSettings()->getDataPort();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("controlPort")) {
|
||||
settings.m_controlPort = response.getSdrDaemonSourceSettings()->getControlPort();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("specificParameters")) {
|
||||
settings.m_specificParameters = *response.getSdrDaemonSourceSettings()->getSpecificParameters();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("dcBlock")) {
|
||||
settings.m_dcBlock = response.getSdrDaemonSourceSettings()->getDcBlock() != 0;
|
||||
}
|
||||
if (deviceSettingsKeys.contains("iqCorrection")) {
|
||||
settings.m_iqCorrection = response.getSdrDaemonSourceSettings()->getIqCorrection() != 0;
|
||||
}
|
||||
if (deviceSettingsKeys.contains("fcPos")) {
|
||||
int fcPos = response.getSdrDaemonSourceSettings()->getFcPos();
|
||||
settings.m_fcPos = fcPos < 0 ? 0 : fcPos > 2 ? 2 : fcPos;
|
||||
}
|
||||
if (deviceSettingsKeys.contains("fileRecordName")) {
|
||||
settings.m_fileRecordName = *response.getSdrDaemonSourceSettings()->getFileRecordName();
|
||||
}
|
||||
@ -485,18 +332,12 @@ int SDRdaemonSourceInput::webapiSettingsPutPatch(
|
||||
|
||||
void SDRdaemonSourceInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& response, const SDRdaemonSourceSettings& settings)
|
||||
{
|
||||
response.getSdrDaemonSourceSettings()->setCenterFrequency(settings.m_centerFrequency);
|
||||
response.getSdrDaemonSourceSettings()->setSampleRate(settings.m_sampleRate);
|
||||
response.getSdrDaemonSourceSettings()->setLog2Decim(settings.m_log2Decim);
|
||||
response.getSdrDaemonSourceSettings()->setTxDelay(settings.m_txDelay);
|
||||
response.getSdrDaemonSourceSettings()->setNbFecBlocks(settings.m_nbFECBlocks);
|
||||
response.getSdrDaemonSourceSettings()->setAddress(new QString(settings.m_address));
|
||||
response.getSdrDaemonSourceSettings()->setApiAddress(new QString(settings.m_apiAddress));
|
||||
response.getSdrDaemonSourceSettings()->setApiPort(settings.m_apiPort);
|
||||
response.getSdrDaemonSourceSettings()->setDataAddress(new QString(settings.m_dataAddress));
|
||||
response.getSdrDaemonSourceSettings()->setDataPort(settings.m_dataPort);
|
||||
response.getSdrDaemonSourceSettings()->setControlPort(settings.m_controlPort);
|
||||
response.getSdrDaemonSourceSettings()->setSpecificParameters(new QString(settings.m_specificParameters));
|
||||
response.getSdrDaemonSourceSettings()->setDcBlock(settings.m_dcBlock ? 1 : 0);
|
||||
response.getSdrDaemonSourceSettings()->setIqCorrection(settings.m_iqCorrection);
|
||||
response.getSdrDaemonSourceSettings()->setFcPos((int) settings.m_fcPos);
|
||||
|
||||
if (response.getSdrDaemonSourceSettings()->getFileRecordName()) {
|
||||
*response.getSdrDaemonSourceSettings()->getFileRecordName() = settings.m_fileRecordName;
|
||||
|
@ -308,7 +308,6 @@ private:
|
||||
SDRdaemonSourceSettings m_settings;
|
||||
SDRdaemonSourceUDPHandler* m_SDRdaemonUDPHandler;
|
||||
QString m_remoteAddress;
|
||||
int m_sender;
|
||||
QString m_deviceDescription;
|
||||
std::time_t m_startingTimeStamp;
|
||||
FileRecord *m_fileSink; //!< File sink to record device I/Q output
|
||||
|
@ -24,18 +24,12 @@ SDRdaemonSourceSettings::SDRdaemonSourceSettings()
|
||||
|
||||
void SDRdaemonSourceSettings::resetToDefaults()
|
||||
{
|
||||
m_centerFrequency = 435000*1000;
|
||||
m_sampleRate = 256000;
|
||||
m_log2Decim = 1;
|
||||
m_txDelay = 0.5;
|
||||
m_nbFECBlocks = 0;
|
||||
m_address = "127.0.0.1";
|
||||
m_dataPort = 9092;
|
||||
m_controlPort = 9093;
|
||||
m_specificParameters = "";
|
||||
m_apiAddress = "127.0.0.1";
|
||||
m_apiPort = 9091;
|
||||
m_dataAddress = "127.0.0.1";
|
||||
m_dataPort = 9090;
|
||||
m_dcBlock = false;
|
||||
m_iqCorrection = false;
|
||||
m_fcPos = 2; // center
|
||||
m_fileRecordName = "";
|
||||
}
|
||||
|
||||
@ -43,17 +37,12 @@ QByteArray SDRdaemonSourceSettings::serialize() const
|
||||
{
|
||||
SimpleSerializer s(1);
|
||||
|
||||
s.writeU64(1, m_sampleRate);
|
||||
s.writeU32(2, m_log2Decim);
|
||||
s.writeFloat(3, m_txDelay);
|
||||
s.writeU32(4, m_nbFECBlocks);
|
||||
s.writeString(5, m_address);
|
||||
s.writeString(5, m_apiAddress);
|
||||
s.writeU32(6, m_dataPort);
|
||||
s.writeU32(7, m_controlPort);
|
||||
s.writeString(8, m_specificParameters);
|
||||
s.writeU32(7, m_apiPort);
|
||||
s.writeString(8, m_dataAddress);
|
||||
s.writeBool(9, m_dcBlock);
|
||||
s.writeBool(10, m_iqCorrection);
|
||||
s.writeU32(11, m_fcPos);
|
||||
|
||||
return s.final();
|
||||
}
|
||||
@ -71,19 +60,14 @@ bool SDRdaemonSourceSettings::deserialize(const QByteArray& data)
|
||||
if (d.getVersion() == 1)
|
||||
{
|
||||
quint32 uintval;
|
||||
d.readU64(1, &m_sampleRate, 48000);
|
||||
d.readU32(2, &m_log2Decim, 0);
|
||||
d.readFloat(3, &m_txDelay, 0.5);
|
||||
d.readU32(4, &m_nbFECBlocks, 0);
|
||||
d.readString(5, &m_address, "127.0.0.1");
|
||||
d.readString(5, &m_apiAddress, "127.0.0.1");
|
||||
d.readU32(6, &uintval, 9090);
|
||||
m_dataPort = uintval % (1<<16);
|
||||
d.readU32(7, &uintval, 9090);
|
||||
m_controlPort = uintval % (1<<16);
|
||||
d.readString(8, &m_specificParameters, "");
|
||||
d.readU32(7, &uintval, 9091);
|
||||
m_dataPort = uintval % (1<<16);
|
||||
d.readString(8, &m_dataAddress, "127.0.0.1");
|
||||
d.readBool(9, &m_dcBlock, false);
|
||||
d.readBool(10, &m_iqCorrection, false);
|
||||
d.readU32(11, &m_fcPos, 2);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
@ -21,18 +21,12 @@
|
||||
#include <QString>
|
||||
|
||||
struct SDRdaemonSourceSettings {
|
||||
quint64 m_centerFrequency;
|
||||
quint64 m_sampleRate;
|
||||
quint32 m_log2Decim;
|
||||
float m_txDelay;
|
||||
quint32 m_nbFECBlocks;
|
||||
QString m_address;
|
||||
QString m_apiAddress;
|
||||
quint16 m_apiPort;
|
||||
QString m_dataAddress;
|
||||
quint16 m_dataPort;
|
||||
quint16 m_controlPort;
|
||||
QString m_specificParameters;
|
||||
bool m_dcBlock;
|
||||
bool m_iqCorrection;
|
||||
quint32 m_fcPos;
|
||||
QString m_fileRecordName;
|
||||
|
||||
SDRdaemonSourceSettings();
|
||||
|
@ -3421,46 +3421,24 @@ margin-bottom: 20px;
|
||||
};
|
||||
defs.SDRdaemonSourceSettings = {
|
||||
"properties" : {
|
||||
"centerFrequency" : {
|
||||
"type" : "integer",
|
||||
"format" : "uint64"
|
||||
"apiAddress" : {
|
||||
"type" : "string"
|
||||
},
|
||||
"sampleRate" : {
|
||||
"apiPort" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"log2Decim" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"txDelay" : {
|
||||
"type" : "number",
|
||||
"format" : "float",
|
||||
"description" : "minimum delay in ms between two consecutive packets sending"
|
||||
},
|
||||
"nbFECBlocks" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"address" : {
|
||||
"dataAddress" : {
|
||||
"type" : "string"
|
||||
},
|
||||
"dataPort" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"controlPort" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"specificParameters" : {
|
||||
"type" : "string"
|
||||
},
|
||||
"dcBlock" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"iqCorrection" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"fcPos" : {
|
||||
"type" : "integer",
|
||||
"description" : "0=Infra 1=Supra 2=Center"
|
||||
},
|
||||
"fileRecordName" : {
|
||||
"type" : "string"
|
||||
}
|
||||
@ -28730,7 +28708,7 @@ except ApiException as e:
|
||||
</div>
|
||||
<div id="generator">
|
||||
<div class="content">
|
||||
Generated 2018-09-08T18:41:07.952+02:00
|
||||
Generated 2018-09-08T22:13:50.971+02:00
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,34 +1,18 @@
|
||||
SDRdaemonSourceSettings:
|
||||
description: SDRdaemonSource
|
||||
properties:
|
||||
centerFrequency:
|
||||
apiAddress:
|
||||
type: string
|
||||
apiPort:
|
||||
type: integer
|
||||
format: uint64
|
||||
sampleRate:
|
||||
type: integer
|
||||
log2Decim:
|
||||
type: integer
|
||||
txDelay:
|
||||
description: minimum delay in ms between two consecutive packets sending
|
||||
type: number
|
||||
format: float
|
||||
nbFECBlocks:
|
||||
type: integer
|
||||
address:
|
||||
dataAddress:
|
||||
type: string
|
||||
dataPort:
|
||||
type: integer
|
||||
controlPort:
|
||||
type: integer
|
||||
specificParameters:
|
||||
type: string
|
||||
dcBlock:
|
||||
type: integer
|
||||
iqCorrection:
|
||||
type: integer
|
||||
fcPos:
|
||||
description: 0=Infra 1=Supra 2=Center
|
||||
type: integer
|
||||
fileRecordName:
|
||||
type: string
|
||||
|
||||
|
@ -1,34 +1,18 @@
|
||||
SDRdaemonSourceSettings:
|
||||
description: SDRdaemonSource
|
||||
properties:
|
||||
centerFrequency:
|
||||
apiAddress:
|
||||
type: string
|
||||
apiPort:
|
||||
type: integer
|
||||
format: uint64
|
||||
sampleRate:
|
||||
type: integer
|
||||
log2Decim:
|
||||
type: integer
|
||||
txDelay:
|
||||
description: minimum delay in ms between two consecutive packets sending
|
||||
type: number
|
||||
format: float
|
||||
nbFECBlocks:
|
||||
type: integer
|
||||
address:
|
||||
dataAddress:
|
||||
type: string
|
||||
dataPort:
|
||||
type: integer
|
||||
controlPort:
|
||||
type: integer
|
||||
specificParameters:
|
||||
type: string
|
||||
dcBlock:
|
||||
type: integer
|
||||
iqCorrection:
|
||||
type: integer
|
||||
fcPos:
|
||||
description: 0=Infra 1=Supra 2=Center
|
||||
type: integer
|
||||
fileRecordName:
|
||||
type: string
|
||||
|
||||
|
@ -3421,46 +3421,24 @@ margin-bottom: 20px;
|
||||
};
|
||||
defs.SDRdaemonSourceSettings = {
|
||||
"properties" : {
|
||||
"centerFrequency" : {
|
||||
"type" : "integer",
|
||||
"format" : "uint64"
|
||||
"apiAddress" : {
|
||||
"type" : "string"
|
||||
},
|
||||
"sampleRate" : {
|
||||
"apiPort" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"log2Decim" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"txDelay" : {
|
||||
"type" : "number",
|
||||
"format" : "float",
|
||||
"description" : "minimum delay in ms between two consecutive packets sending"
|
||||
},
|
||||
"nbFECBlocks" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"address" : {
|
||||
"dataAddress" : {
|
||||
"type" : "string"
|
||||
},
|
||||
"dataPort" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"controlPort" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"specificParameters" : {
|
||||
"type" : "string"
|
||||
},
|
||||
"dcBlock" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"iqCorrection" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"fcPos" : {
|
||||
"type" : "integer",
|
||||
"description" : "0=Infra 1=Supra 2=Center"
|
||||
},
|
||||
"fileRecordName" : {
|
||||
"type" : "string"
|
||||
}
|
||||
@ -28730,7 +28708,7 @@ except ApiException as e:
|
||||
</div>
|
||||
<div id="generator">
|
||||
<div class="content">
|
||||
Generated 2018-09-08T18:41:07.952+02:00
|
||||
Generated 2018-09-08T22:13:50.971+02:00
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -28,30 +28,18 @@ SWGSDRdaemonSourceSettings::SWGSDRdaemonSourceSettings(QString* json) {
|
||||
}
|
||||
|
||||
SWGSDRdaemonSourceSettings::SWGSDRdaemonSourceSettings() {
|
||||
center_frequency = 0;
|
||||
m_center_frequency_isSet = false;
|
||||
sample_rate = 0;
|
||||
m_sample_rate_isSet = false;
|
||||
log2_decim = 0;
|
||||
m_log2_decim_isSet = false;
|
||||
tx_delay = 0.0f;
|
||||
m_tx_delay_isSet = false;
|
||||
nb_fec_blocks = 0;
|
||||
m_nb_fec_blocks_isSet = false;
|
||||
address = nullptr;
|
||||
m_address_isSet = false;
|
||||
api_address = nullptr;
|
||||
m_api_address_isSet = false;
|
||||
api_port = 0;
|
||||
m_api_port_isSet = false;
|
||||
data_address = nullptr;
|
||||
m_data_address_isSet = false;
|
||||
data_port = 0;
|
||||
m_data_port_isSet = false;
|
||||
control_port = 0;
|
||||
m_control_port_isSet = false;
|
||||
specific_parameters = nullptr;
|
||||
m_specific_parameters_isSet = false;
|
||||
dc_block = 0;
|
||||
m_dc_block_isSet = false;
|
||||
iq_correction = 0;
|
||||
m_iq_correction_isSet = false;
|
||||
fc_pos = 0;
|
||||
m_fc_pos_isSet = false;
|
||||
file_record_name = nullptr;
|
||||
m_file_record_name_isSet = false;
|
||||
}
|
||||
@ -62,48 +50,30 @@ SWGSDRdaemonSourceSettings::~SWGSDRdaemonSourceSettings() {
|
||||
|
||||
void
|
||||
SWGSDRdaemonSourceSettings::init() {
|
||||
center_frequency = 0;
|
||||
m_center_frequency_isSet = false;
|
||||
sample_rate = 0;
|
||||
m_sample_rate_isSet = false;
|
||||
log2_decim = 0;
|
||||
m_log2_decim_isSet = false;
|
||||
tx_delay = 0.0f;
|
||||
m_tx_delay_isSet = false;
|
||||
nb_fec_blocks = 0;
|
||||
m_nb_fec_blocks_isSet = false;
|
||||
address = new QString("");
|
||||
m_address_isSet = false;
|
||||
api_address = new QString("");
|
||||
m_api_address_isSet = false;
|
||||
api_port = 0;
|
||||
m_api_port_isSet = false;
|
||||
data_address = new QString("");
|
||||
m_data_address_isSet = false;
|
||||
data_port = 0;
|
||||
m_data_port_isSet = false;
|
||||
control_port = 0;
|
||||
m_control_port_isSet = false;
|
||||
specific_parameters = new QString("");
|
||||
m_specific_parameters_isSet = false;
|
||||
dc_block = 0;
|
||||
m_dc_block_isSet = false;
|
||||
iq_correction = 0;
|
||||
m_iq_correction_isSet = false;
|
||||
fc_pos = 0;
|
||||
m_fc_pos_isSet = false;
|
||||
file_record_name = new QString("");
|
||||
m_file_record_name_isSet = false;
|
||||
}
|
||||
|
||||
void
|
||||
SWGSDRdaemonSourceSettings::cleanup() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(address != nullptr) {
|
||||
delete address;
|
||||
if(api_address != nullptr) {
|
||||
delete api_address;
|
||||
}
|
||||
|
||||
|
||||
if(specific_parameters != nullptr) {
|
||||
delete specific_parameters;
|
||||
if(data_address != nullptr) {
|
||||
delete data_address;
|
||||
}
|
||||
|
||||
|
||||
@ -124,30 +94,18 @@ SWGSDRdaemonSourceSettings::fromJson(QString &json) {
|
||||
|
||||
void
|
||||
SWGSDRdaemonSourceSettings::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(¢er_frequency, pJson["centerFrequency"], "qint32", "");
|
||||
::SWGSDRangel::setValue(&api_address, pJson["apiAddress"], "QString", "QString");
|
||||
|
||||
::SWGSDRangel::setValue(&sample_rate, pJson["sampleRate"], "qint32", "");
|
||||
::SWGSDRangel::setValue(&api_port, pJson["apiPort"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&log2_decim, pJson["log2Decim"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&tx_delay, pJson["txDelay"], "float", "");
|
||||
|
||||
::SWGSDRangel::setValue(&nb_fec_blocks, pJson["nbFECBlocks"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&address, pJson["address"], "QString", "QString");
|
||||
::SWGSDRangel::setValue(&data_address, pJson["dataAddress"], "QString", "QString");
|
||||
|
||||
::SWGSDRangel::setValue(&data_port, pJson["dataPort"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&control_port, pJson["controlPort"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&specific_parameters, pJson["specificParameters"], "QString", "QString");
|
||||
|
||||
::SWGSDRangel::setValue(&dc_block, pJson["dcBlock"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&iq_correction, pJson["iqCorrection"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&fc_pos, pJson["fcPos"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&file_record_name, pJson["fileRecordName"], "QString", "QString");
|
||||
|
||||
}
|
||||
@ -166,42 +124,24 @@ SWGSDRdaemonSourceSettings::asJson ()
|
||||
QJsonObject*
|
||||
SWGSDRdaemonSourceSettings::asJsonObject() {
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(m_center_frequency_isSet){
|
||||
obj->insert("centerFrequency", QJsonValue(center_frequency));
|
||||
if(api_address != nullptr && *api_address != QString("")){
|
||||
toJsonValue(QString("apiAddress"), api_address, obj, QString("QString"));
|
||||
}
|
||||
if(m_sample_rate_isSet){
|
||||
obj->insert("sampleRate", QJsonValue(sample_rate));
|
||||
if(m_api_port_isSet){
|
||||
obj->insert("apiPort", QJsonValue(api_port));
|
||||
}
|
||||
if(m_log2_decim_isSet){
|
||||
obj->insert("log2Decim", QJsonValue(log2_decim));
|
||||
}
|
||||
if(m_tx_delay_isSet){
|
||||
obj->insert("txDelay", QJsonValue(tx_delay));
|
||||
}
|
||||
if(m_nb_fec_blocks_isSet){
|
||||
obj->insert("nbFECBlocks", QJsonValue(nb_fec_blocks));
|
||||
}
|
||||
if(address != nullptr && *address != QString("")){
|
||||
toJsonValue(QString("address"), address, obj, QString("QString"));
|
||||
if(data_address != nullptr && *data_address != QString("")){
|
||||
toJsonValue(QString("dataAddress"), data_address, obj, QString("QString"));
|
||||
}
|
||||
if(m_data_port_isSet){
|
||||
obj->insert("dataPort", QJsonValue(data_port));
|
||||
}
|
||||
if(m_control_port_isSet){
|
||||
obj->insert("controlPort", QJsonValue(control_port));
|
||||
}
|
||||
if(specific_parameters != nullptr && *specific_parameters != QString("")){
|
||||
toJsonValue(QString("specificParameters"), specific_parameters, obj, QString("QString"));
|
||||
}
|
||||
if(m_dc_block_isSet){
|
||||
obj->insert("dcBlock", QJsonValue(dc_block));
|
||||
}
|
||||
if(m_iq_correction_isSet){
|
||||
obj->insert("iqCorrection", QJsonValue(iq_correction));
|
||||
}
|
||||
if(m_fc_pos_isSet){
|
||||
obj->insert("fcPos", QJsonValue(fc_pos));
|
||||
}
|
||||
if(file_record_name != nullptr && *file_record_name != QString("")){
|
||||
toJsonValue(QString("fileRecordName"), file_record_name, obj, QString("QString"));
|
||||
}
|
||||
@ -209,64 +149,34 @@ SWGSDRdaemonSourceSettings::asJsonObject() {
|
||||
return obj;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGSDRdaemonSourceSettings::getCenterFrequency() {
|
||||
return center_frequency;
|
||||
QString*
|
||||
SWGSDRdaemonSourceSettings::getApiAddress() {
|
||||
return api_address;
|
||||
}
|
||||
void
|
||||
SWGSDRdaemonSourceSettings::setCenterFrequency(qint32 center_frequency) {
|
||||
this->center_frequency = center_frequency;
|
||||
this->m_center_frequency_isSet = true;
|
||||
SWGSDRdaemonSourceSettings::setApiAddress(QString* api_address) {
|
||||
this->api_address = api_address;
|
||||
this->m_api_address_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGSDRdaemonSourceSettings::getSampleRate() {
|
||||
return sample_rate;
|
||||
SWGSDRdaemonSourceSettings::getApiPort() {
|
||||
return api_port;
|
||||
}
|
||||
void
|
||||
SWGSDRdaemonSourceSettings::setSampleRate(qint32 sample_rate) {
|
||||
this->sample_rate = sample_rate;
|
||||
this->m_sample_rate_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGSDRdaemonSourceSettings::getLog2Decim() {
|
||||
return log2_decim;
|
||||
}
|
||||
void
|
||||
SWGSDRdaemonSourceSettings::setLog2Decim(qint32 log2_decim) {
|
||||
this->log2_decim = log2_decim;
|
||||
this->m_log2_decim_isSet = true;
|
||||
}
|
||||
|
||||
float
|
||||
SWGSDRdaemonSourceSettings::getTxDelay() {
|
||||
return tx_delay;
|
||||
}
|
||||
void
|
||||
SWGSDRdaemonSourceSettings::setTxDelay(float tx_delay) {
|
||||
this->tx_delay = tx_delay;
|
||||
this->m_tx_delay_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGSDRdaemonSourceSettings::getNbFecBlocks() {
|
||||
return nb_fec_blocks;
|
||||
}
|
||||
void
|
||||
SWGSDRdaemonSourceSettings::setNbFecBlocks(qint32 nb_fec_blocks) {
|
||||
this->nb_fec_blocks = nb_fec_blocks;
|
||||
this->m_nb_fec_blocks_isSet = true;
|
||||
SWGSDRdaemonSourceSettings::setApiPort(qint32 api_port) {
|
||||
this->api_port = api_port;
|
||||
this->m_api_port_isSet = true;
|
||||
}
|
||||
|
||||
QString*
|
||||
SWGSDRdaemonSourceSettings::getAddress() {
|
||||
return address;
|
||||
SWGSDRdaemonSourceSettings::getDataAddress() {
|
||||
return data_address;
|
||||
}
|
||||
void
|
||||
SWGSDRdaemonSourceSettings::setAddress(QString* address) {
|
||||
this->address = address;
|
||||
this->m_address_isSet = true;
|
||||
SWGSDRdaemonSourceSettings::setDataAddress(QString* data_address) {
|
||||
this->data_address = data_address;
|
||||
this->m_data_address_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
@ -279,26 +189,6 @@ SWGSDRdaemonSourceSettings::setDataPort(qint32 data_port) {
|
||||
this->m_data_port_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGSDRdaemonSourceSettings::getControlPort() {
|
||||
return control_port;
|
||||
}
|
||||
void
|
||||
SWGSDRdaemonSourceSettings::setControlPort(qint32 control_port) {
|
||||
this->control_port = control_port;
|
||||
this->m_control_port_isSet = true;
|
||||
}
|
||||
|
||||
QString*
|
||||
SWGSDRdaemonSourceSettings::getSpecificParameters() {
|
||||
return specific_parameters;
|
||||
}
|
||||
void
|
||||
SWGSDRdaemonSourceSettings::setSpecificParameters(QString* specific_parameters) {
|
||||
this->specific_parameters = specific_parameters;
|
||||
this->m_specific_parameters_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGSDRdaemonSourceSettings::getDcBlock() {
|
||||
return dc_block;
|
||||
@ -319,16 +209,6 @@ SWGSDRdaemonSourceSettings::setIqCorrection(qint32 iq_correction) {
|
||||
this->m_iq_correction_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGSDRdaemonSourceSettings::getFcPos() {
|
||||
return fc_pos;
|
||||
}
|
||||
void
|
||||
SWGSDRdaemonSourceSettings::setFcPos(qint32 fc_pos) {
|
||||
this->fc_pos = fc_pos;
|
||||
this->m_fc_pos_isSet = true;
|
||||
}
|
||||
|
||||
QString*
|
||||
SWGSDRdaemonSourceSettings::getFileRecordName() {
|
||||
return file_record_name;
|
||||
@ -344,18 +224,12 @@ bool
|
||||
SWGSDRdaemonSourceSettings::isSet(){
|
||||
bool isObjectUpdated = false;
|
||||
do{
|
||||
if(m_center_frequency_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_sample_rate_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_log2_decim_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_tx_delay_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_nb_fec_blocks_isSet){ isObjectUpdated = true; break;}
|
||||
if(address != nullptr && *address != QString("")){ isObjectUpdated = true; break;}
|
||||
if(api_address != nullptr && *api_address != QString("")){ isObjectUpdated = true; break;}
|
||||
if(m_api_port_isSet){ isObjectUpdated = true; break;}
|
||||
if(data_address != nullptr && *data_address != QString("")){ isObjectUpdated = true; break;}
|
||||
if(m_data_port_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_control_port_isSet){ isObjectUpdated = true; break;}
|
||||
if(specific_parameters != nullptr && *specific_parameters != QString("")){ isObjectUpdated = true; break;}
|
||||
if(m_dc_block_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_iq_correction_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_fc_pos_isSet){ isObjectUpdated = true; break;}
|
||||
if(file_record_name != nullptr && *file_record_name != QString("")){ isObjectUpdated = true; break;}
|
||||
}while(false);
|
||||
return isObjectUpdated;
|
||||
|
@ -42,42 +42,24 @@ public:
|
||||
virtual void fromJsonObject(QJsonObject &json) override;
|
||||
virtual SWGSDRdaemonSourceSettings* fromJson(QString &jsonString) override;
|
||||
|
||||
qint32 getCenterFrequency();
|
||||
void setCenterFrequency(qint32 center_frequency);
|
||||
QString* getApiAddress();
|
||||
void setApiAddress(QString* api_address);
|
||||
|
||||
qint32 getSampleRate();
|
||||
void setSampleRate(qint32 sample_rate);
|
||||
qint32 getApiPort();
|
||||
void setApiPort(qint32 api_port);
|
||||
|
||||
qint32 getLog2Decim();
|
||||
void setLog2Decim(qint32 log2_decim);
|
||||
|
||||
float getTxDelay();
|
||||
void setTxDelay(float tx_delay);
|
||||
|
||||
qint32 getNbFecBlocks();
|
||||
void setNbFecBlocks(qint32 nb_fec_blocks);
|
||||
|
||||
QString* getAddress();
|
||||
void setAddress(QString* address);
|
||||
QString* getDataAddress();
|
||||
void setDataAddress(QString* data_address);
|
||||
|
||||
qint32 getDataPort();
|
||||
void setDataPort(qint32 data_port);
|
||||
|
||||
qint32 getControlPort();
|
||||
void setControlPort(qint32 control_port);
|
||||
|
||||
QString* getSpecificParameters();
|
||||
void setSpecificParameters(QString* specific_parameters);
|
||||
|
||||
qint32 getDcBlock();
|
||||
void setDcBlock(qint32 dc_block);
|
||||
|
||||
qint32 getIqCorrection();
|
||||
void setIqCorrection(qint32 iq_correction);
|
||||
|
||||
qint32 getFcPos();
|
||||
void setFcPos(qint32 fc_pos);
|
||||
|
||||
QString* getFileRecordName();
|
||||
void setFileRecordName(QString* file_record_name);
|
||||
|
||||
@ -85,42 +67,24 @@ public:
|
||||
virtual bool isSet() override;
|
||||
|
||||
private:
|
||||
qint32 center_frequency;
|
||||
bool m_center_frequency_isSet;
|
||||
QString* api_address;
|
||||
bool m_api_address_isSet;
|
||||
|
||||
qint32 sample_rate;
|
||||
bool m_sample_rate_isSet;
|
||||
qint32 api_port;
|
||||
bool m_api_port_isSet;
|
||||
|
||||
qint32 log2_decim;
|
||||
bool m_log2_decim_isSet;
|
||||
|
||||
float tx_delay;
|
||||
bool m_tx_delay_isSet;
|
||||
|
||||
qint32 nb_fec_blocks;
|
||||
bool m_nb_fec_blocks_isSet;
|
||||
|
||||
QString* address;
|
||||
bool m_address_isSet;
|
||||
QString* data_address;
|
||||
bool m_data_address_isSet;
|
||||
|
||||
qint32 data_port;
|
||||
bool m_data_port_isSet;
|
||||
|
||||
qint32 control_port;
|
||||
bool m_control_port_isSet;
|
||||
|
||||
QString* specific_parameters;
|
||||
bool m_specific_parameters_isSet;
|
||||
|
||||
qint32 dc_block;
|
||||
bool m_dc_block_isSet;
|
||||
|
||||
qint32 iq_correction;
|
||||
bool m_iq_correction_isSet;
|
||||
|
||||
qint32 fc_pos;
|
||||
bool m_fc_pos_isSet;
|
||||
|
||||
QString* file_record_name;
|
||||
bool m_file_record_name_isSet;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user