kopia lustrzana https://github.com/f4exb/sdrangel
Web API: file source settings getter (1)
rodzic
d6b156a8d3
commit
fc4627f82e
|
@ -21,6 +21,7 @@ set(filesource_FORMS
|
|||
include_directories(
|
||||
.
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
|
||||
)
|
||||
|
||||
#include(${QT_USE_FILE})
|
||||
|
@ -41,6 +42,7 @@ target_link_libraries(inputfilesource
|
|||
${QT_LIBRARIES}
|
||||
sdrbase
|
||||
sdrgui
|
||||
swagger
|
||||
)
|
||||
|
||||
qt5_use_modules(inputfilesource Core Widgets)
|
||||
|
|
|
@ -20,6 +20,7 @@ QMAKE_CXXFLAGS += -std=c++11
|
|||
INCLUDEPATH += $$PWD
|
||||
INCLUDEPATH += ../../../sdrbase
|
||||
INCLUDEPATH += ../../../sdrgui
|
||||
INCLUDEPATH += ../../../swagger/sdrangel/code/qt5/client
|
||||
|
||||
CONFIG(Release):build_subdir = release
|
||||
CONFIG(Debug):build_subdir = debug
|
||||
|
@ -38,5 +39,6 @@ FORMS += filesourcegui.ui
|
|||
|
||||
LIBS += -L../../../sdrbase/$${build_subdir} -lsdrbase
|
||||
LIBS += -L../../../sdrgui/$${build_subdir} -lsdrgui
|
||||
LIBS += -L../../../swagger/$${build_subdir} -lswagger
|
||||
|
||||
RESOURCES = ../../../sdrgui/resources/res.qrc
|
||||
|
|
|
@ -1,292 +1,304 @@
|
|||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2015 Edouard Griffiths, F4EXB //
|
||||
// //
|
||||
// This program is free software; you can redistribute it and/or modify //
|
||||
// it under the terms of the GNU General Public License as published by //
|
||||
// the Free Software Foundation as version 3 of the License, or //
|
||||
// //
|
||||
// This program is distributed in the hope that it will be useful, //
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||
// GNU General Public License V3 for more details. //
|
||||
// //
|
||||
// You should have received a copy of the GNU General Public License //
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <QDebug>
|
||||
|
||||
#include "util/simpleserializer.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/dspengine.h"
|
||||
#include "dsp/filerecord.h"
|
||||
#include "device/devicesourceapi.h"
|
||||
|
||||
#include "filesourcegui.h"
|
||||
#include "filesourceinput.h"
|
||||
#include "filesourcethread.h"
|
||||
|
||||
MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgConfigureFileSource, Message)
|
||||
MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgConfigureFileSourceName, Message)
|
||||
MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgConfigureFileSourceWork, Message)
|
||||
MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgConfigureFileSourceSeek, Message)
|
||||
MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgConfigureFileSourceStreamTiming, Message)
|
||||
MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgReportFileSourceAcquisition, Message)
|
||||
MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgReportFileSourceStreamData, Message)
|
||||
MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgReportFileSourceStreamTiming, Message)
|
||||
|
||||
FileSourceInput::Settings::Settings() :
|
||||
m_fileName("./test.sdriq")
|
||||
{
|
||||
}
|
||||
|
||||
void FileSourceInput::Settings::resetToDefaults()
|
||||
{
|
||||
m_fileName = "./test.sdriq";
|
||||
}
|
||||
|
||||
QByteArray FileSourceInput::Settings::serialize() const
|
||||
{
|
||||
SimpleSerializer s(1);
|
||||
s.writeString(1, m_fileName);
|
||||
return s.final();
|
||||
}
|
||||
|
||||
bool FileSourceInput::Settings::deserialize(const QByteArray& data)
|
||||
{
|
||||
SimpleDeserializer d(data);
|
||||
|
||||
if(!d.isValid()) {
|
||||
resetToDefaults();
|
||||
return false;
|
||||
}
|
||||
|
||||
if(d.getVersion() == 1) {
|
||||
d.readString(1, &m_fileName, "./test.sdriq");
|
||||
return true;
|
||||
} else {
|
||||
resetToDefaults();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
FileSourceInput::FileSourceInput(DeviceSourceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_settings(),
|
||||
m_fileSourceThread(NULL),
|
||||
m_deviceDescription(),
|
||||
m_fileName("..."),
|
||||
m_sampleRate(0),
|
||||
m_centerFrequency(0),
|
||||
m_recordLength(0),
|
||||
m_startingTimeStamp(0),
|
||||
m_masterTimer(deviceAPI->getMasterTimer())
|
||||
{
|
||||
}
|
||||
|
||||
FileSourceInput::~FileSourceInput()
|
||||
{
|
||||
stop();
|
||||
}
|
||||
|
||||
void FileSourceInput::destroy()
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
|
||||
void FileSourceInput::openFileStream()
|
||||
{
|
||||
//stopInput();
|
||||
|
||||
if (m_ifstream.is_open()) {
|
||||
m_ifstream.close();
|
||||
}
|
||||
|
||||
m_ifstream.open(m_fileName.toStdString().c_str(), std::ios::binary | std::ios::ate);
|
||||
quint64 fileSize = m_ifstream.tellg();
|
||||
m_ifstream.seekg(0,std::ios_base::beg);
|
||||
FileRecord::Header header;
|
||||
FileRecord::readHeader(m_ifstream, header);
|
||||
|
||||
m_sampleRate = header.sampleRate;
|
||||
m_centerFrequency = header.centerFrequency;
|
||||
m_startingTimeStamp = header.startTimeStamp;
|
||||
|
||||
if (fileSize > sizeof(FileRecord::Header)) {
|
||||
m_recordLength = (fileSize - sizeof(FileRecord::Header)) / (4 * m_sampleRate);
|
||||
} else {
|
||||
m_recordLength = 0;
|
||||
}
|
||||
|
||||
qDebug() << "FileSourceInput::openFileStream: " << m_fileName.toStdString().c_str()
|
||||
<< " fileSize: " << fileSize << "bytes"
|
||||
<< " length: " << m_recordLength << " seconds";
|
||||
|
||||
MsgReportFileSourceStreamData *report = MsgReportFileSourceStreamData::create(m_sampleRate,
|
||||
m_centerFrequency,
|
||||
m_startingTimeStamp,
|
||||
m_recordLength); // file stream data
|
||||
|
||||
if (getMessageQueueToGUI()) {
|
||||
getMessageQueueToGUI()->push(report);
|
||||
}
|
||||
}
|
||||
|
||||
void FileSourceInput::seekFileStream(int seekPercentage)
|
||||
{
|
||||
QMutexLocker mutexLocker(&m_mutex);
|
||||
|
||||
if ((m_ifstream.is_open()) && !m_fileSourceThread->isRunning())
|
||||
{
|
||||
int seekPoint = ((m_recordLength * seekPercentage) / 100) * m_sampleRate;
|
||||
m_fileSourceThread->setSamplesCount(seekPoint);
|
||||
seekPoint *= 4; // + sizeof(FileSink::Header)
|
||||
m_ifstream.clear();
|
||||
m_ifstream.seekg(seekPoint + sizeof(FileRecord::Header), std::ios::beg);
|
||||
}
|
||||
}
|
||||
|
||||
bool FileSourceInput::start()
|
||||
{
|
||||
QMutexLocker mutexLocker(&m_mutex);
|
||||
qDebug() << "FileSourceInput::start";
|
||||
|
||||
if (m_ifstream.tellg() != 0) {
|
||||
m_ifstream.clear();
|
||||
m_ifstream.seekg(sizeof(FileRecord::Header), std::ios::beg);
|
||||
}
|
||||
|
||||
if(!m_sampleFifo.setSize(m_sampleRate * 4)) {
|
||||
qCritical("Could not allocate SampleFifo");
|
||||
return false;
|
||||
}
|
||||
|
||||
//openFileStream();
|
||||
|
||||
if((m_fileSourceThread = new FileSourceThread(&m_ifstream, &m_sampleFifo)) == NULL) {
|
||||
qFatal("out of memory");
|
||||
stop();
|
||||
return false;
|
||||
}
|
||||
|
||||
m_fileSourceThread->setSamplerate(m_sampleRate);
|
||||
m_fileSourceThread->connectTimer(m_masterTimer);
|
||||
m_fileSourceThread->startWork();
|
||||
m_deviceDescription = "FileSource";
|
||||
|
||||
mutexLocker.unlock();
|
||||
//applySettings(m_generalSettings, m_settings, true);
|
||||
qDebug("FileSourceInput::startInput: started");
|
||||
|
||||
MsgReportFileSourceAcquisition *report = MsgReportFileSourceAcquisition::create(true); // acquisition on
|
||||
|
||||
if (getMessageQueueToGUI()) {
|
||||
getMessageQueueToGUI()->push(report);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void FileSourceInput::stop()
|
||||
{
|
||||
qDebug() << "FileSourceInput::stop";
|
||||
QMutexLocker mutexLocker(&m_mutex);
|
||||
|
||||
if(m_fileSourceThread != 0)
|
||||
{
|
||||
m_fileSourceThread->stopWork();
|
||||
delete m_fileSourceThread;
|
||||
m_fileSourceThread = 0;
|
||||
}
|
||||
|
||||
m_deviceDescription.clear();
|
||||
|
||||
MsgReportFileSourceAcquisition *report = MsgReportFileSourceAcquisition::create(false); // acquisition off
|
||||
|
||||
if (getMessageQueueToGUI()) {
|
||||
getMessageQueueToGUI()->push(report);
|
||||
}
|
||||
}
|
||||
|
||||
const QString& FileSourceInput::getDeviceDescription() const
|
||||
{
|
||||
return m_deviceDescription;
|
||||
}
|
||||
|
||||
int FileSourceInput::getSampleRate() const
|
||||
{
|
||||
return m_sampleRate;
|
||||
}
|
||||
|
||||
quint64 FileSourceInput::getCenterFrequency() const
|
||||
{
|
||||
return m_centerFrequency;
|
||||
}
|
||||
|
||||
std::time_t FileSourceInput::getStartingTimeStamp() const
|
||||
{
|
||||
return m_startingTimeStamp;
|
||||
}
|
||||
|
||||
bool FileSourceInput::handleMessage(const Message& message)
|
||||
{
|
||||
if (MsgConfigureFileSourceName::match(message))
|
||||
{
|
||||
MsgConfigureFileSourceName& conf = (MsgConfigureFileSourceName&) message;
|
||||
m_fileName = conf.getFileName();
|
||||
openFileStream();
|
||||
return true;
|
||||
}
|
||||
else if (MsgConfigureFileSourceWork::match(message))
|
||||
{
|
||||
MsgConfigureFileSourceWork& conf = (MsgConfigureFileSourceWork&) message;
|
||||
bool working = conf.isWorking();
|
||||
|
||||
if (m_fileSourceThread != 0)
|
||||
{
|
||||
if (working)
|
||||
{
|
||||
m_fileSourceThread->startWork();
|
||||
/*
|
||||
MsgReportFileSourceStreamTiming *report =
|
||||
MsgReportFileSourceStreamTiming::create(m_fileSourceThread->getSamplesCount());
|
||||
getOutputMessageQueueToGUI()->push(report);*/
|
||||
}
|
||||
else
|
||||
{
|
||||
m_fileSourceThread->stopWork();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (MsgConfigureFileSourceSeek::match(message))
|
||||
{
|
||||
MsgConfigureFileSourceSeek& conf = (MsgConfigureFileSourceSeek&) message;
|
||||
int seekPercentage = conf.getPercentage();
|
||||
seekFileStream(seekPercentage);
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (MsgConfigureFileSourceStreamTiming::match(message))
|
||||
{
|
||||
MsgReportFileSourceStreamTiming *report;
|
||||
|
||||
if (m_fileSourceThread != 0)
|
||||
{
|
||||
report = MsgReportFileSourceStreamTiming::create(m_fileSourceThread->getSamplesCount());
|
||||
|
||||
if (getMessageQueueToGUI()) {
|
||||
getMessageQueueToGUI()->push(report);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2015 Edouard Griffiths, F4EXB //
|
||||
// //
|
||||
// This program is free software; you can redistribute it and/or modify //
|
||||
// it under the terms of the GNU General Public License as published by //
|
||||
// the Free Software Foundation as version 3 of the License, or //
|
||||
// //
|
||||
// This program is distributed in the hope that it will be useful, //
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||
// GNU General Public License V3 for more details. //
|
||||
// //
|
||||
// You should have received a copy of the GNU General Public License //
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <QDebug>
|
||||
|
||||
#include "SWGDeviceSettings.h"
|
||||
#include "SWGFileSourceSettings.h"
|
||||
|
||||
#include "util/simpleserializer.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/dspengine.h"
|
||||
#include "dsp/filerecord.h"
|
||||
#include "device/devicesourceapi.h"
|
||||
|
||||
#include "filesourcegui.h"
|
||||
#include "filesourceinput.h"
|
||||
#include "filesourcethread.h"
|
||||
|
||||
MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgConfigureFileSource, Message)
|
||||
MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgConfigureFileSourceName, Message)
|
||||
MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgConfigureFileSourceWork, Message)
|
||||
MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgConfigureFileSourceSeek, Message)
|
||||
MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgConfigureFileSourceStreamTiming, Message)
|
||||
MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgReportFileSourceAcquisition, Message)
|
||||
MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgReportFileSourceStreamData, Message)
|
||||
MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgReportFileSourceStreamTiming, Message)
|
||||
|
||||
FileSourceInput::Settings::Settings() :
|
||||
m_fileName("./test.sdriq")
|
||||
{
|
||||
}
|
||||
|
||||
void FileSourceInput::Settings::resetToDefaults()
|
||||
{
|
||||
m_fileName = "./test.sdriq";
|
||||
}
|
||||
|
||||
QByteArray FileSourceInput::Settings::serialize() const
|
||||
{
|
||||
SimpleSerializer s(1);
|
||||
s.writeString(1, m_fileName);
|
||||
return s.final();
|
||||
}
|
||||
|
||||
bool FileSourceInput::Settings::deserialize(const QByteArray& data)
|
||||
{
|
||||
SimpleDeserializer d(data);
|
||||
|
||||
if(!d.isValid()) {
|
||||
resetToDefaults();
|
||||
return false;
|
||||
}
|
||||
|
||||
if(d.getVersion() == 1) {
|
||||
d.readString(1, &m_fileName, "./test.sdriq");
|
||||
return true;
|
||||
} else {
|
||||
resetToDefaults();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
FileSourceInput::FileSourceInput(DeviceSourceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_settings(),
|
||||
m_fileSourceThread(NULL),
|
||||
m_deviceDescription(),
|
||||
m_fileName("..."),
|
||||
m_sampleRate(0),
|
||||
m_centerFrequency(0),
|
||||
m_recordLength(0),
|
||||
m_startingTimeStamp(0),
|
||||
m_masterTimer(deviceAPI->getMasterTimer())
|
||||
{
|
||||
}
|
||||
|
||||
FileSourceInput::~FileSourceInput()
|
||||
{
|
||||
stop();
|
||||
}
|
||||
|
||||
void FileSourceInput::destroy()
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
|
||||
void FileSourceInput::openFileStream()
|
||||
{
|
||||
//stopInput();
|
||||
|
||||
if (m_ifstream.is_open()) {
|
||||
m_ifstream.close();
|
||||
}
|
||||
|
||||
m_ifstream.open(m_fileName.toStdString().c_str(), std::ios::binary | std::ios::ate);
|
||||
quint64 fileSize = m_ifstream.tellg();
|
||||
m_ifstream.seekg(0,std::ios_base::beg);
|
||||
FileRecord::Header header;
|
||||
FileRecord::readHeader(m_ifstream, header);
|
||||
|
||||
m_sampleRate = header.sampleRate;
|
||||
m_centerFrequency = header.centerFrequency;
|
||||
m_startingTimeStamp = header.startTimeStamp;
|
||||
|
||||
if (fileSize > sizeof(FileRecord::Header)) {
|
||||
m_recordLength = (fileSize - sizeof(FileRecord::Header)) / (4 * m_sampleRate);
|
||||
} else {
|
||||
m_recordLength = 0;
|
||||
}
|
||||
|
||||
qDebug() << "FileSourceInput::openFileStream: " << m_fileName.toStdString().c_str()
|
||||
<< " fileSize: " << fileSize << "bytes"
|
||||
<< " length: " << m_recordLength << " seconds";
|
||||
|
||||
MsgReportFileSourceStreamData *report = MsgReportFileSourceStreamData::create(m_sampleRate,
|
||||
m_centerFrequency,
|
||||
m_startingTimeStamp,
|
||||
m_recordLength); // file stream data
|
||||
|
||||
if (getMessageQueueToGUI()) {
|
||||
getMessageQueueToGUI()->push(report);
|
||||
}
|
||||
}
|
||||
|
||||
void FileSourceInput::seekFileStream(int seekPercentage)
|
||||
{
|
||||
QMutexLocker mutexLocker(&m_mutex);
|
||||
|
||||
if ((m_ifstream.is_open()) && !m_fileSourceThread->isRunning())
|
||||
{
|
||||
int seekPoint = ((m_recordLength * seekPercentage) / 100) * m_sampleRate;
|
||||
m_fileSourceThread->setSamplesCount(seekPoint);
|
||||
seekPoint *= 4; // + sizeof(FileSink::Header)
|
||||
m_ifstream.clear();
|
||||
m_ifstream.seekg(seekPoint + sizeof(FileRecord::Header), std::ios::beg);
|
||||
}
|
||||
}
|
||||
|
||||
bool FileSourceInput::start()
|
||||
{
|
||||
QMutexLocker mutexLocker(&m_mutex);
|
||||
qDebug() << "FileSourceInput::start";
|
||||
|
||||
if (m_ifstream.tellg() != 0) {
|
||||
m_ifstream.clear();
|
||||
m_ifstream.seekg(sizeof(FileRecord::Header), std::ios::beg);
|
||||
}
|
||||
|
||||
if(!m_sampleFifo.setSize(m_sampleRate * 4)) {
|
||||
qCritical("Could not allocate SampleFifo");
|
||||
return false;
|
||||
}
|
||||
|
||||
//openFileStream();
|
||||
|
||||
if((m_fileSourceThread = new FileSourceThread(&m_ifstream, &m_sampleFifo)) == NULL) {
|
||||
qFatal("out of memory");
|
||||
stop();
|
||||
return false;
|
||||
}
|
||||
|
||||
m_fileSourceThread->setSamplerate(m_sampleRate);
|
||||
m_fileSourceThread->connectTimer(m_masterTimer);
|
||||
m_fileSourceThread->startWork();
|
||||
m_deviceDescription = "FileSource";
|
||||
|
||||
mutexLocker.unlock();
|
||||
//applySettings(m_generalSettings, m_settings, true);
|
||||
qDebug("FileSourceInput::startInput: started");
|
||||
|
||||
MsgReportFileSourceAcquisition *report = MsgReportFileSourceAcquisition::create(true); // acquisition on
|
||||
|
||||
if (getMessageQueueToGUI()) {
|
||||
getMessageQueueToGUI()->push(report);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void FileSourceInput::stop()
|
||||
{
|
||||
qDebug() << "FileSourceInput::stop";
|
||||
QMutexLocker mutexLocker(&m_mutex);
|
||||
|
||||
if(m_fileSourceThread != 0)
|
||||
{
|
||||
m_fileSourceThread->stopWork();
|
||||
delete m_fileSourceThread;
|
||||
m_fileSourceThread = 0;
|
||||
}
|
||||
|
||||
m_deviceDescription.clear();
|
||||
|
||||
MsgReportFileSourceAcquisition *report = MsgReportFileSourceAcquisition::create(false); // acquisition off
|
||||
|
||||
if (getMessageQueueToGUI()) {
|
||||
getMessageQueueToGUI()->push(report);
|
||||
}
|
||||
}
|
||||
|
||||
const QString& FileSourceInput::getDeviceDescription() const
|
||||
{
|
||||
return m_deviceDescription;
|
||||
}
|
||||
|
||||
int FileSourceInput::getSampleRate() const
|
||||
{
|
||||
return m_sampleRate;
|
||||
}
|
||||
|
||||
quint64 FileSourceInput::getCenterFrequency() const
|
||||
{
|
||||
return m_centerFrequency;
|
||||
}
|
||||
|
||||
std::time_t FileSourceInput::getStartingTimeStamp() const
|
||||
{
|
||||
return m_startingTimeStamp;
|
||||
}
|
||||
|
||||
bool FileSourceInput::handleMessage(const Message& message)
|
||||
{
|
||||
if (MsgConfigureFileSourceName::match(message))
|
||||
{
|
||||
MsgConfigureFileSourceName& conf = (MsgConfigureFileSourceName&) message;
|
||||
m_fileName = conf.getFileName();
|
||||
openFileStream();
|
||||
return true;
|
||||
}
|
||||
else if (MsgConfigureFileSourceWork::match(message))
|
||||
{
|
||||
MsgConfigureFileSourceWork& conf = (MsgConfigureFileSourceWork&) message;
|
||||
bool working = conf.isWorking();
|
||||
|
||||
if (m_fileSourceThread != 0)
|
||||
{
|
||||
if (working)
|
||||
{
|
||||
m_fileSourceThread->startWork();
|
||||
/*
|
||||
MsgReportFileSourceStreamTiming *report =
|
||||
MsgReportFileSourceStreamTiming::create(m_fileSourceThread->getSamplesCount());
|
||||
getOutputMessageQueueToGUI()->push(report);*/
|
||||
}
|
||||
else
|
||||
{
|
||||
m_fileSourceThread->stopWork();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (MsgConfigureFileSourceSeek::match(message))
|
||||
{
|
||||
MsgConfigureFileSourceSeek& conf = (MsgConfigureFileSourceSeek&) message;
|
||||
int seekPercentage = conf.getPercentage();
|
||||
seekFileStream(seekPercentage);
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (MsgConfigureFileSourceStreamTiming::match(message))
|
||||
{
|
||||
MsgReportFileSourceStreamTiming *report;
|
||||
|
||||
if (m_fileSourceThread != 0)
|
||||
{
|
||||
report = MsgReportFileSourceStreamTiming::create(m_fileSourceThread->getSamplesCount());
|
||||
|
||||
if (getMessageQueueToGUI()) {
|
||||
getMessageQueueToGUI()->push(report);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
int FileSourceInput::webapiSettingsGet(
|
||||
SWGSDRangel::SWGDeviceSettings& response,
|
||||
QString& errorMessage __attribute__((unused)))
|
||||
{
|
||||
response.setFileSourceSettings(new SWGSDRangel::SWGFileSourceSettings());
|
||||
*response.getFileSourceSettings()->getFileName() = m_settings.m_fileName;
|
||||
return 200;
|
||||
}
|
||||
|
|
|
@ -1,245 +1,249 @@
|
|||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2015 Edouard Griffiths, F4EXB //
|
||||
// //
|
||||
// This program is free software; you can redistribute it and/or modify //
|
||||
// it under the terms of the GNU General Public License as published by //
|
||||
// the Free Software Foundation as version 3 of the License, or //
|
||||
// //
|
||||
// This program is distributed in the hope that it will be useful, //
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||
// GNU General Public License V3 for more details. //
|
||||
// //
|
||||
// You should have received a copy of the GNU General Public License //
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef INCLUDE_FILESOURCEINPUT_H
|
||||
#define INCLUDE_FILESOURCEINPUT_H
|
||||
|
||||
#include <dsp/devicesamplesource.h>
|
||||
#include <QString>
|
||||
#include <QTimer>
|
||||
#include <ctime>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
class FileSourceThread;
|
||||
class DeviceSourceAPI;
|
||||
|
||||
class FileSourceInput : public DeviceSampleSource {
|
||||
public:
|
||||
struct Settings {
|
||||
QString m_fileName;
|
||||
|
||||
Settings();
|
||||
void resetToDefaults();
|
||||
QByteArray serialize() const;
|
||||
bool deserialize(const QByteArray& data);
|
||||
};
|
||||
|
||||
class MsgConfigureFileSource : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
const Settings& getSettings() const { return m_settings; }
|
||||
|
||||
static MsgConfigureFileSource* create(const Settings& settings)
|
||||
{
|
||||
return new MsgConfigureFileSource(settings);
|
||||
}
|
||||
|
||||
private:
|
||||
Settings m_settings;
|
||||
|
||||
MsgConfigureFileSource(const Settings& settings) :
|
||||
Message(),
|
||||
m_settings(settings)
|
||||
{ }
|
||||
};
|
||||
|
||||
class MsgConfigureFileSourceName : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
const QString& getFileName() const { return m_fileName; }
|
||||
|
||||
static MsgConfigureFileSourceName* create(const QString& fileName)
|
||||
{
|
||||
return new MsgConfigureFileSourceName(fileName);
|
||||
}
|
||||
|
||||
private:
|
||||
QString m_fileName;
|
||||
|
||||
MsgConfigureFileSourceName(const QString& fileName) :
|
||||
Message(),
|
||||
m_fileName(fileName)
|
||||
{ }
|
||||
};
|
||||
|
||||
class MsgConfigureFileSourceWork : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
bool isWorking() const { return m_working; }
|
||||
|
||||
static MsgConfigureFileSourceWork* create(bool working)
|
||||
{
|
||||
return new MsgConfigureFileSourceWork(working);
|
||||
}
|
||||
|
||||
private:
|
||||
bool m_working;
|
||||
|
||||
MsgConfigureFileSourceWork(bool working) :
|
||||
Message(),
|
||||
m_working(working)
|
||||
{ }
|
||||
};
|
||||
|
||||
class MsgConfigureFileSourceStreamTiming : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
|
||||
static MsgConfigureFileSourceStreamTiming* create()
|
||||
{
|
||||
return new MsgConfigureFileSourceStreamTiming();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
MsgConfigureFileSourceStreamTiming() :
|
||||
Message()
|
||||
{ }
|
||||
};
|
||||
|
||||
class MsgConfigureFileSourceSeek : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
int getPercentage() const { return m_seekPercentage; }
|
||||
|
||||
static MsgConfigureFileSourceSeek* create(int seekPercentage)
|
||||
{
|
||||
return new MsgConfigureFileSourceSeek(seekPercentage);
|
||||
}
|
||||
|
||||
protected:
|
||||
int m_seekPercentage; //!< percentage of seek position from the beginning 0..100
|
||||
|
||||
MsgConfigureFileSourceSeek(int seekPercentage) :
|
||||
Message(),
|
||||
m_seekPercentage(seekPercentage)
|
||||
{ }
|
||||
};
|
||||
|
||||
class MsgReportFileSourceAcquisition : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
bool getAcquisition() const { return m_acquisition; }
|
||||
|
||||
static MsgReportFileSourceAcquisition* create(bool acquisition)
|
||||
{
|
||||
return new MsgReportFileSourceAcquisition(acquisition);
|
||||
}
|
||||
|
||||
protected:
|
||||
bool m_acquisition;
|
||||
|
||||
MsgReportFileSourceAcquisition(bool acquisition) :
|
||||
Message(),
|
||||
m_acquisition(acquisition)
|
||||
{ }
|
||||
};
|
||||
|
||||
class MsgReportFileSourceStreamData : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
int getSampleRate() const { return m_sampleRate; }
|
||||
quint64 getCenterFrequency() const { return m_centerFrequency; }
|
||||
std::time_t getStartingTimeStamp() const { return m_startingTimeStamp; }
|
||||
quint32 getRecordLength() const { return m_recordLength; }
|
||||
|
||||
static MsgReportFileSourceStreamData* create(int sampleRate,
|
||||
quint64 centerFrequency,
|
||||
std::time_t startingTimeStamp,
|
||||
quint32 recordLength)
|
||||
{
|
||||
return new MsgReportFileSourceStreamData(sampleRate, centerFrequency, startingTimeStamp, recordLength);
|
||||
}
|
||||
|
||||
protected:
|
||||
int m_sampleRate;
|
||||
quint64 m_centerFrequency;
|
||||
std::time_t m_startingTimeStamp;
|
||||
quint32 m_recordLength;
|
||||
|
||||
MsgReportFileSourceStreamData(int sampleRate,
|
||||
quint64 centerFrequency,
|
||||
std::time_t startingTimeStamp,
|
||||
quint32 recordLength) :
|
||||
Message(),
|
||||
m_sampleRate(sampleRate),
|
||||
m_centerFrequency(centerFrequency),
|
||||
m_startingTimeStamp(startingTimeStamp),
|
||||
m_recordLength(recordLength)
|
||||
{ }
|
||||
};
|
||||
|
||||
class MsgReportFileSourceStreamTiming : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
std::size_t getSamplesCount() const { return m_samplesCount; }
|
||||
|
||||
static MsgReportFileSourceStreamTiming* create(std::size_t samplesCount)
|
||||
{
|
||||
return new MsgReportFileSourceStreamTiming(samplesCount);
|
||||
}
|
||||
|
||||
protected:
|
||||
std::size_t m_samplesCount;
|
||||
|
||||
MsgReportFileSourceStreamTiming(std::size_t samplesCount) :
|
||||
Message(),
|
||||
m_samplesCount(samplesCount)
|
||||
{ }
|
||||
};
|
||||
|
||||
FileSourceInput(DeviceSourceAPI *deviceAPI);
|
||||
virtual ~FileSourceInput();
|
||||
virtual void destroy();
|
||||
|
||||
virtual bool start();
|
||||
virtual void stop();
|
||||
|
||||
virtual const QString& getDeviceDescription() const;
|
||||
virtual int getSampleRate() const;
|
||||
virtual quint64 getCenterFrequency() const;
|
||||
std::time_t getStartingTimeStamp() const;
|
||||
|
||||
virtual bool handleMessage(const Message& message);
|
||||
|
||||
private:
|
||||
DeviceSourceAPI *m_deviceAPI;
|
||||
QMutex m_mutex;
|
||||
Settings m_settings;
|
||||
std::ifstream m_ifstream;
|
||||
FileSourceThread* m_fileSourceThread;
|
||||
QString m_deviceDescription;
|
||||
QString m_fileName;
|
||||
int m_sampleRate;
|
||||
quint64 m_centerFrequency;
|
||||
quint32 m_recordLength; //!< record length in seconds computed from file size
|
||||
std::time_t m_startingTimeStamp;
|
||||
const QTimer& m_masterTimer;
|
||||
|
||||
void openFileStream();
|
||||
void seekFileStream(int seekPercentage);
|
||||
};
|
||||
|
||||
#endif // INCLUDE_FILESOURCEINPUT_H
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2015 Edouard Griffiths, F4EXB //
|
||||
// //
|
||||
// This program is free software; you can redistribute it and/or modify //
|
||||
// it under the terms of the GNU General Public License as published by //
|
||||
// the Free Software Foundation as version 3 of the License, or //
|
||||
// //
|
||||
// This program is distributed in the hope that it will be useful, //
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||
// GNU General Public License V3 for more details. //
|
||||
// //
|
||||
// You should have received a copy of the GNU General Public License //
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef INCLUDE_FILESOURCEINPUT_H
|
||||
#define INCLUDE_FILESOURCEINPUT_H
|
||||
|
||||
#include <dsp/devicesamplesource.h>
|
||||
#include <QString>
|
||||
#include <QTimer>
|
||||
#include <ctime>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
class FileSourceThread;
|
||||
class DeviceSourceAPI;
|
||||
|
||||
class FileSourceInput : public DeviceSampleSource {
|
||||
public:
|
||||
struct Settings {
|
||||
QString m_fileName;
|
||||
|
||||
Settings();
|
||||
void resetToDefaults();
|
||||
QByteArray serialize() const;
|
||||
bool deserialize(const QByteArray& data);
|
||||
};
|
||||
|
||||
class MsgConfigureFileSource : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
const Settings& getSettings() const { return m_settings; }
|
||||
|
||||
static MsgConfigureFileSource* create(const Settings& settings)
|
||||
{
|
||||
return new MsgConfigureFileSource(settings);
|
||||
}
|
||||
|
||||
private:
|
||||
Settings m_settings;
|
||||
|
||||
MsgConfigureFileSource(const Settings& settings) :
|
||||
Message(),
|
||||
m_settings(settings)
|
||||
{ }
|
||||
};
|
||||
|
||||
class MsgConfigureFileSourceName : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
const QString& getFileName() const { return m_fileName; }
|
||||
|
||||
static MsgConfigureFileSourceName* create(const QString& fileName)
|
||||
{
|
||||
return new MsgConfigureFileSourceName(fileName);
|
||||
}
|
||||
|
||||
private:
|
||||
QString m_fileName;
|
||||
|
||||
MsgConfigureFileSourceName(const QString& fileName) :
|
||||
Message(),
|
||||
m_fileName(fileName)
|
||||
{ }
|
||||
};
|
||||
|
||||
class MsgConfigureFileSourceWork : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
bool isWorking() const { return m_working; }
|
||||
|
||||
static MsgConfigureFileSourceWork* create(bool working)
|
||||
{
|
||||
return new MsgConfigureFileSourceWork(working);
|
||||
}
|
||||
|
||||
private:
|
||||
bool m_working;
|
||||
|
||||
MsgConfigureFileSourceWork(bool working) :
|
||||
Message(),
|
||||
m_working(working)
|
||||
{ }
|
||||
};
|
||||
|
||||
class MsgConfigureFileSourceStreamTiming : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
|
||||
static MsgConfigureFileSourceStreamTiming* create()
|
||||
{
|
||||
return new MsgConfigureFileSourceStreamTiming();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
MsgConfigureFileSourceStreamTiming() :
|
||||
Message()
|
||||
{ }
|
||||
};
|
||||
|
||||
class MsgConfigureFileSourceSeek : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
int getPercentage() const { return m_seekPercentage; }
|
||||
|
||||
static MsgConfigureFileSourceSeek* create(int seekPercentage)
|
||||
{
|
||||
return new MsgConfigureFileSourceSeek(seekPercentage);
|
||||
}
|
||||
|
||||
protected:
|
||||
int m_seekPercentage; //!< percentage of seek position from the beginning 0..100
|
||||
|
||||
MsgConfigureFileSourceSeek(int seekPercentage) :
|
||||
Message(),
|
||||
m_seekPercentage(seekPercentage)
|
||||
{ }
|
||||
};
|
||||
|
||||
class MsgReportFileSourceAcquisition : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
bool getAcquisition() const { return m_acquisition; }
|
||||
|
||||
static MsgReportFileSourceAcquisition* create(bool acquisition)
|
||||
{
|
||||
return new MsgReportFileSourceAcquisition(acquisition);
|
||||
}
|
||||
|
||||
protected:
|
||||
bool m_acquisition;
|
||||
|
||||
MsgReportFileSourceAcquisition(bool acquisition) :
|
||||
Message(),
|
||||
m_acquisition(acquisition)
|
||||
{ }
|
||||
};
|
||||
|
||||
class MsgReportFileSourceStreamData : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
int getSampleRate() const { return m_sampleRate; }
|
||||
quint64 getCenterFrequency() const { return m_centerFrequency; }
|
||||
std::time_t getStartingTimeStamp() const { return m_startingTimeStamp; }
|
||||
quint32 getRecordLength() const { return m_recordLength; }
|
||||
|
||||
static MsgReportFileSourceStreamData* create(int sampleRate,
|
||||
quint64 centerFrequency,
|
||||
std::time_t startingTimeStamp,
|
||||
quint32 recordLength)
|
||||
{
|
||||
return new MsgReportFileSourceStreamData(sampleRate, centerFrequency, startingTimeStamp, recordLength);
|
||||
}
|
||||
|
||||
protected:
|
||||
int m_sampleRate;
|
||||
quint64 m_centerFrequency;
|
||||
std::time_t m_startingTimeStamp;
|
||||
quint32 m_recordLength;
|
||||
|
||||
MsgReportFileSourceStreamData(int sampleRate,
|
||||
quint64 centerFrequency,
|
||||
std::time_t startingTimeStamp,
|
||||
quint32 recordLength) :
|
||||
Message(),
|
||||
m_sampleRate(sampleRate),
|
||||
m_centerFrequency(centerFrequency),
|
||||
m_startingTimeStamp(startingTimeStamp),
|
||||
m_recordLength(recordLength)
|
||||
{ }
|
||||
};
|
||||
|
||||
class MsgReportFileSourceStreamTiming : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
std::size_t getSamplesCount() const { return m_samplesCount; }
|
||||
|
||||
static MsgReportFileSourceStreamTiming* create(std::size_t samplesCount)
|
||||
{
|
||||
return new MsgReportFileSourceStreamTiming(samplesCount);
|
||||
}
|
||||
|
||||
protected:
|
||||
std::size_t m_samplesCount;
|
||||
|
||||
MsgReportFileSourceStreamTiming(std::size_t samplesCount) :
|
||||
Message(),
|
||||
m_samplesCount(samplesCount)
|
||||
{ }
|
||||
};
|
||||
|
||||
FileSourceInput(DeviceSourceAPI *deviceAPI);
|
||||
virtual ~FileSourceInput();
|
||||
virtual void destroy();
|
||||
|
||||
virtual bool start();
|
||||
virtual void stop();
|
||||
|
||||
virtual const QString& getDeviceDescription() const;
|
||||
virtual int getSampleRate() const;
|
||||
virtual quint64 getCenterFrequency() const;
|
||||
std::time_t getStartingTimeStamp() const;
|
||||
|
||||
virtual bool handleMessage(const Message& message);
|
||||
|
||||
virtual int webapiSettingsGet(
|
||||
SWGSDRangel::SWGDeviceSettings& response __attribute__((unused)),
|
||||
QString& errorMessage);
|
||||
|
||||
private:
|
||||
DeviceSourceAPI *m_deviceAPI;
|
||||
QMutex m_mutex;
|
||||
Settings m_settings;
|
||||
std::ifstream m_ifstream;
|
||||
FileSourceThread* m_fileSourceThread;
|
||||
QString m_deviceDescription;
|
||||
QString m_fileName;
|
||||
int m_sampleRate;
|
||||
quint64 m_centerFrequency;
|
||||
quint32 m_recordLength; //!< record length in seconds computed from file size
|
||||
std::time_t m_startingTimeStamp;
|
||||
const QTimer& m_masterTimer;
|
||||
|
||||
void openFileStream();
|
||||
void seekFileStream(int seekPercentage);
|
||||
};
|
||||
|
||||
#endif // INCLUDE_FILESOURCEINPUT_H
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
namespace SWGSDRangel
|
||||
{
|
||||
class SWGObject;
|
||||
class SWGDeviceSettings;
|
||||
}
|
||||
|
||||
class SDRANGEL_API DeviceSampleSink : public QObject {
|
||||
|
@ -47,7 +47,7 @@ public:
|
|||
virtual bool handleMessage(const Message& message) = 0;
|
||||
|
||||
virtual int webapiSettingsGet(
|
||||
SWGSDRangel::SWGObject *response __attribute__((unused)),
|
||||
SWGSDRangel::SWGDeviceSettings& response __attribute__((unused)),
|
||||
QString& errorMessage)
|
||||
{ errorMessage = "Not implemented"; return 501; }
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
namespace SWGSDRangel
|
||||
{
|
||||
class SWGObject;
|
||||
class SWGDeviceSettings;
|
||||
}
|
||||
|
||||
class SDRANGEL_API DeviceSampleSource : public QObject {
|
||||
|
@ -47,7 +47,7 @@ public:
|
|||
virtual bool handleMessage(const Message& message) = 0;
|
||||
|
||||
virtual int webapiSettingsGet(
|
||||
SWGSDRangel::SWGObject *response __attribute__((unused)),
|
||||
SWGSDRangel::SWGDeviceSettings& response __attribute__((unused)),
|
||||
QString& errorMessage)
|
||||
{ errorMessage = "Not implemented"; return 501; }
|
||||
|
||||
|
|
Plik diff jest za duży
Load Diff
|
@ -604,6 +604,11 @@ void WebAPIRequestMapper::devicesetDeviceService(const std::string& indexStr, qt
|
|||
else if (request.getMethod() == "GET")
|
||||
{
|
||||
SWGSDRangel::SWGDeviceSettings normalResponse;
|
||||
normalResponse.cleanup();
|
||||
normalResponse.setFileSourceSettings(0);
|
||||
normalResponse.setRtlSdrSettings(0);
|
||||
normalResponse.setLimeSdrInputSettings(0);
|
||||
normalResponse.setLimeSdrOutputSettings(0);
|
||||
int status = m_adapter->devicesetDeviceGet(deviceSetIndex, normalResponse, errorResponse);
|
||||
response.setStatus(status);
|
||||
|
||||
|
|
|
@ -705,13 +705,17 @@ int WebAPIAdapterGUI::devicesetDeviceGet(
|
|||
|
||||
if (deviceSet->m_deviceSourceEngine) // Rx
|
||||
{
|
||||
response.setDeviceHwType(new QString(deviceSet->m_deviceSourceAPI->getHardwareId()));
|
||||
response.setTx(0);
|
||||
DeviceSampleSource *source = deviceSet->m_deviceSourceAPI->getSampleSource();
|
||||
return source->webapiSettingsGet(response.getData(), *error.getMessage());
|
||||
return source->webapiSettingsGet(response, *error.getMessage());
|
||||
}
|
||||
else if (deviceSet->m_deviceSinkEngine) // Tx
|
||||
{
|
||||
response.setDeviceHwType(new QString(deviceSet->m_deviceSinkAPI->getHardwareId()));
|
||||
response.setTx(1);
|
||||
DeviceSampleSink *sink = deviceSet->m_deviceSinkAPI->getSampleSink();
|
||||
return sink->webapiSettingsGet(response.getData(), *error.getMessage());
|
||||
return sink->webapiSettingsGet(response, *error.getMessage());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -938,23 +938,22 @@ definitions:
|
|||
$ref: "#/definitions/PresetIdentifier"
|
||||
DeviceSettings:
|
||||
description: Base device settings
|
||||
discriminator: deviceType
|
||||
discriminator: deviceHwType
|
||||
required:
|
||||
- deviceType
|
||||
- deviceHwType
|
||||
- tx
|
||||
properties:
|
||||
deviceType:
|
||||
deviceHwType:
|
||||
description: Device hardware type code
|
||||
type: string
|
||||
data:
|
||||
type: object
|
||||
DeviceSettingsImpl:
|
||||
description: dummy structure to handle all devices settings
|
||||
properties:
|
||||
fileSource:
|
||||
tx:
|
||||
description: Not zero if it is a tx device else it is a rx device
|
||||
type: integer
|
||||
fileSourceSettings:
|
||||
$ref: "http://localhost:8081/FileSource.yaml#/FileSourceSettings"
|
||||
rtlsdr:
|
||||
rtlSdrSettings:
|
||||
$ref: "http://localhost:8081/RtlSdr.yaml#/RtlSdrSettings"
|
||||
limesdrInput:
|
||||
limeSdrInputSettings:
|
||||
$ref: "http://localhost:8081/LimeSdr.yaml#/LimeSdrInputSettings"
|
||||
limesdrOutput:
|
||||
limeSdrOutputSettings:
|
||||
$ref: "http://localhost:8081/LimeSdr.yaml#/LimeSdrOutputSettings"
|
||||
|
|
@ -1,201 +0,0 @@
|
|||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright {yyyy} {name of copyright owner}
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
Plik diff jest za duży
Load Diff
|
@ -37,19 +37,36 @@ SWGDeviceSettings::~SWGDeviceSettings() {
|
|||
|
||||
void
|
||||
SWGDeviceSettings::init() {
|
||||
device_type = new QString("");
|
||||
data = NULL;
|
||||
device_hw_type = new QString("");
|
||||
tx = 0;
|
||||
file_source_settings = new SWGFileSourceSettings();
|
||||
rtl_sdr_settings = new SWGRtlSdrSettings();
|
||||
lime_sdr_input_settings = new SWGLimeSdrInputSettings();
|
||||
lime_sdr_output_settings = new SWGLimeSdrOutputSettings();
|
||||
}
|
||||
|
||||
void
|
||||
SWGDeviceSettings::cleanup() {
|
||||
|
||||
if(device_type != nullptr) {
|
||||
delete device_type;
|
||||
if(device_hw_type != nullptr) {
|
||||
delete device_hw_type;
|
||||
}
|
||||
|
||||
if(data != nullptr) {
|
||||
delete data;
|
||||
|
||||
if(file_source_settings != nullptr) {
|
||||
delete file_source_settings;
|
||||
}
|
||||
|
||||
if(rtl_sdr_settings != nullptr) {
|
||||
delete rtl_sdr_settings;
|
||||
}
|
||||
|
||||
if(lime_sdr_input_settings != nullptr) {
|
||||
delete lime_sdr_input_settings;
|
||||
}
|
||||
|
||||
if(lime_sdr_output_settings != nullptr) {
|
||||
delete lime_sdr_output_settings;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -64,8 +81,12 @@ SWGDeviceSettings::fromJson(QString &json) {
|
|||
|
||||
void
|
||||
SWGDeviceSettings::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&device_type, pJson["deviceType"], "QString", "QString");
|
||||
::SWGSDRangel::setValue(&data, pJson["data"], "SWGObject", "SWGObject");
|
||||
::SWGSDRangel::setValue(&device_hw_type, pJson["deviceHwType"], "QString", "QString");
|
||||
::SWGSDRangel::setValue(&tx, pJson["tx"], "qint32", "");
|
||||
::SWGSDRangel::setValue(&file_source_settings, pJson["fileSourceSettings"], "SWGFileSourceSettings", "SWGFileSourceSettings");
|
||||
::SWGSDRangel::setValue(&rtl_sdr_settings, pJson["rtlSdrSettings"], "SWGRtlSdrSettings", "SWGRtlSdrSettings");
|
||||
::SWGSDRangel::setValue(&lime_sdr_input_settings, pJson["limeSdrInputSettings"], "SWGLimeSdrInputSettings", "SWGLimeSdrInputSettings");
|
||||
::SWGSDRangel::setValue(&lime_sdr_output_settings, pJson["limeSdrOutputSettings"], "SWGLimeSdrOutputSettings", "SWGLimeSdrOutputSettings");
|
||||
}
|
||||
|
||||
QString
|
||||
|
@ -82,29 +103,73 @@ QJsonObject*
|
|||
SWGDeviceSettings::asJsonObject() {
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
|
||||
toJsonValue(QString("deviceType"), device_type, obj, QString("QString"));
|
||||
toJsonValue(QString("deviceHwType"), device_hw_type, obj, QString("QString"));
|
||||
|
||||
toJsonValue(QString("data"), data, obj, QString("SWGObject"));
|
||||
obj->insert("tx", QJsonValue(tx));
|
||||
|
||||
toJsonValue(QString("fileSourceSettings"), file_source_settings, obj, QString("SWGFileSourceSettings"));
|
||||
|
||||
toJsonValue(QString("rtlSdrSettings"), rtl_sdr_settings, obj, QString("SWGRtlSdrSettings"));
|
||||
|
||||
toJsonValue(QString("limeSdrInputSettings"), lime_sdr_input_settings, obj, QString("SWGLimeSdrInputSettings"));
|
||||
|
||||
toJsonValue(QString("limeSdrOutputSettings"), lime_sdr_output_settings, obj, QString("SWGLimeSdrOutputSettings"));
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
QString*
|
||||
SWGDeviceSettings::getDeviceType() {
|
||||
return device_type;
|
||||
SWGDeviceSettings::getDeviceHwType() {
|
||||
return device_hw_type;
|
||||
}
|
||||
void
|
||||
SWGDeviceSettings::setDeviceType(QString* device_type) {
|
||||
this->device_type = device_type;
|
||||
SWGDeviceSettings::setDeviceHwType(QString* device_hw_type) {
|
||||
this->device_hw_type = device_hw_type;
|
||||
}
|
||||
|
||||
SWGObject*
|
||||
SWGDeviceSettings::getData() {
|
||||
return data;
|
||||
qint32
|
||||
SWGDeviceSettings::getTx() {
|
||||
return tx;
|
||||
}
|
||||
void
|
||||
SWGDeviceSettings::setData(SWGObject* data) {
|
||||
this->data = data;
|
||||
SWGDeviceSettings::setTx(qint32 tx) {
|
||||
this->tx = tx;
|
||||
}
|
||||
|
||||
SWGFileSourceSettings*
|
||||
SWGDeviceSettings::getFileSourceSettings() {
|
||||
return file_source_settings;
|
||||
}
|
||||
void
|
||||
SWGDeviceSettings::setFileSourceSettings(SWGFileSourceSettings* file_source_settings) {
|
||||
this->file_source_settings = file_source_settings;
|
||||
}
|
||||
|
||||
SWGRtlSdrSettings*
|
||||
SWGDeviceSettings::getRtlSdrSettings() {
|
||||
return rtl_sdr_settings;
|
||||
}
|
||||
void
|
||||
SWGDeviceSettings::setRtlSdrSettings(SWGRtlSdrSettings* rtl_sdr_settings) {
|
||||
this->rtl_sdr_settings = rtl_sdr_settings;
|
||||
}
|
||||
|
||||
SWGLimeSdrInputSettings*
|
||||
SWGDeviceSettings::getLimeSdrInputSettings() {
|
||||
return lime_sdr_input_settings;
|
||||
}
|
||||
void
|
||||
SWGDeviceSettings::setLimeSdrInputSettings(SWGLimeSdrInputSettings* lime_sdr_input_settings) {
|
||||
this->lime_sdr_input_settings = lime_sdr_input_settings;
|
||||
}
|
||||
|
||||
SWGLimeSdrOutputSettings*
|
||||
SWGDeviceSettings::getLimeSdrOutputSettings() {
|
||||
return lime_sdr_output_settings;
|
||||
}
|
||||
void
|
||||
SWGDeviceSettings::setLimeSdrOutputSettings(SWGLimeSdrOutputSettings* lime_sdr_output_settings) {
|
||||
this->lime_sdr_output_settings = lime_sdr_output_settings;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -22,7 +22,10 @@
|
|||
#include <QJsonObject>
|
||||
|
||||
|
||||
#include "SWGObject.h"
|
||||
#include "SWGFileSourceSettings.h"
|
||||
#include "SWGLimeSdrInputSettings.h"
|
||||
#include "SWGLimeSdrOutputSettings.h"
|
||||
#include "SWGRtlSdrSettings.h"
|
||||
#include <QString>
|
||||
|
||||
#include "SWGObject.h"
|
||||
|
@ -43,16 +46,32 @@ public:
|
|||
void fromJsonObject(QJsonObject &json);
|
||||
SWGDeviceSettings* fromJson(QString &jsonString);
|
||||
|
||||
QString* getDeviceType();
|
||||
void setDeviceType(QString* device_type);
|
||||
QString* getDeviceHwType();
|
||||
void setDeviceHwType(QString* device_hw_type);
|
||||
|
||||
SWGObject* getData();
|
||||
void setData(SWGObject* data);
|
||||
qint32 getTx();
|
||||
void setTx(qint32 tx);
|
||||
|
||||
SWGFileSourceSettings* getFileSourceSettings();
|
||||
void setFileSourceSettings(SWGFileSourceSettings* file_source_settings);
|
||||
|
||||
SWGRtlSdrSettings* getRtlSdrSettings();
|
||||
void setRtlSdrSettings(SWGRtlSdrSettings* rtl_sdr_settings);
|
||||
|
||||
SWGLimeSdrInputSettings* getLimeSdrInputSettings();
|
||||
void setLimeSdrInputSettings(SWGLimeSdrInputSettings* lime_sdr_input_settings);
|
||||
|
||||
SWGLimeSdrOutputSettings* getLimeSdrOutputSettings();
|
||||
void setLimeSdrOutputSettings(SWGLimeSdrOutputSettings* lime_sdr_output_settings);
|
||||
|
||||
|
||||
private:
|
||||
QString* device_type;
|
||||
SWGObject* data;
|
||||
QString* device_hw_type;
|
||||
qint32 tx;
|
||||
SWGFileSourceSettings* file_source_settings;
|
||||
SWGRtlSdrSettings* rtl_sdr_settings;
|
||||
SWGLimeSdrInputSettings* lime_sdr_input_settings;
|
||||
SWGLimeSdrOutputSettings* lime_sdr_output_settings;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -1,146 +0,0 @@
|
|||
/**
|
||||
* SDRangel
|
||||
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
|
||||
*
|
||||
* OpenAPI spec version: 4.0.0
|
||||
* Contact: f4exb06@gmail.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
#include "SWGDeviceSettingsImpl.h"
|
||||
|
||||
#include "SWGHelpers.h"
|
||||
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonArray>
|
||||
#include <QObject>
|
||||
#include <QDebug>
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGDeviceSettingsImpl::SWGDeviceSettingsImpl(QString* json) {
|
||||
init();
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGDeviceSettingsImpl::SWGDeviceSettingsImpl() {
|
||||
init();
|
||||
}
|
||||
|
||||
SWGDeviceSettingsImpl::~SWGDeviceSettingsImpl() {
|
||||
this->cleanup();
|
||||
}
|
||||
|
||||
void
|
||||
SWGDeviceSettingsImpl::init() {
|
||||
file_source = new SWGFileSourceSettings();
|
||||
rtlsdr = new SWGRtlSdrSettings();
|
||||
limesdr_input = new SWGLimeSdrInputSettings();
|
||||
limesdr_output = new SWGLimeSdrOutputSettings();
|
||||
}
|
||||
|
||||
void
|
||||
SWGDeviceSettingsImpl::cleanup() {
|
||||
|
||||
if(file_source != nullptr) {
|
||||
delete file_source;
|
||||
}
|
||||
|
||||
if(rtlsdr != nullptr) {
|
||||
delete rtlsdr;
|
||||
}
|
||||
|
||||
if(limesdr_input != nullptr) {
|
||||
delete limesdr_input;
|
||||
}
|
||||
|
||||
if(limesdr_output != nullptr) {
|
||||
delete limesdr_output;
|
||||
}
|
||||
}
|
||||
|
||||
SWGDeviceSettingsImpl*
|
||||
SWGDeviceSettingsImpl::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
this->fromJsonObject(jsonObject);
|
||||
return this;
|
||||
}
|
||||
|
||||
void
|
||||
SWGDeviceSettingsImpl::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&file_source, pJson["fileSource"], "SWGFileSourceSettings", "SWGFileSourceSettings");
|
||||
::SWGSDRangel::setValue(&rtlsdr, pJson["rtlsdr"], "SWGRtlSdrSettings", "SWGRtlSdrSettings");
|
||||
::SWGSDRangel::setValue(&limesdr_input, pJson["limesdrInput"], "SWGLimeSdrInputSettings", "SWGLimeSdrInputSettings");
|
||||
::SWGSDRangel::setValue(&limesdr_output, pJson["limesdrOutput"], "SWGLimeSdrOutputSettings", "SWGLimeSdrOutputSettings");
|
||||
}
|
||||
|
||||
QString
|
||||
SWGDeviceSettingsImpl::asJson ()
|
||||
{
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject*
|
||||
SWGDeviceSettingsImpl::asJsonObject() {
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
|
||||
toJsonValue(QString("fileSource"), file_source, obj, QString("SWGFileSourceSettings"));
|
||||
|
||||
toJsonValue(QString("rtlsdr"), rtlsdr, obj, QString("SWGRtlSdrSettings"));
|
||||
|
||||
toJsonValue(QString("limesdrInput"), limesdr_input, obj, QString("SWGLimeSdrInputSettings"));
|
||||
|
||||
toJsonValue(QString("limesdrOutput"), limesdr_output, obj, QString("SWGLimeSdrOutputSettings"));
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
SWGFileSourceSettings*
|
||||
SWGDeviceSettingsImpl::getFileSource() {
|
||||
return file_source;
|
||||
}
|
||||
void
|
||||
SWGDeviceSettingsImpl::setFileSource(SWGFileSourceSettings* file_source) {
|
||||
this->file_source = file_source;
|
||||
}
|
||||
|
||||
SWGRtlSdrSettings*
|
||||
SWGDeviceSettingsImpl::getRtlsdr() {
|
||||
return rtlsdr;
|
||||
}
|
||||
void
|
||||
SWGDeviceSettingsImpl::setRtlsdr(SWGRtlSdrSettings* rtlsdr) {
|
||||
this->rtlsdr = rtlsdr;
|
||||
}
|
||||
|
||||
SWGLimeSdrInputSettings*
|
||||
SWGDeviceSettingsImpl::getLimesdrInput() {
|
||||
return limesdr_input;
|
||||
}
|
||||
void
|
||||
SWGDeviceSettingsImpl::setLimesdrInput(SWGLimeSdrInputSettings* limesdr_input) {
|
||||
this->limesdr_input = limesdr_input;
|
||||
}
|
||||
|
||||
SWGLimeSdrOutputSettings*
|
||||
SWGDeviceSettingsImpl::getLimesdrOutput() {
|
||||
return limesdr_output;
|
||||
}
|
||||
void
|
||||
SWGDeviceSettingsImpl::setLimesdrOutput(SWGLimeSdrOutputSettings* limesdr_output) {
|
||||
this->limesdr_output = limesdr_output;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,70 +0,0 @@
|
|||
/**
|
||||
* SDRangel
|
||||
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
|
||||
*
|
||||
* OpenAPI spec version: 4.0.0
|
||||
* Contact: f4exb06@gmail.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
/*
|
||||
* SWGDeviceSettingsImpl.h
|
||||
*
|
||||
* dummy structure to handle all devices settings
|
||||
*/
|
||||
|
||||
#ifndef SWGDeviceSettingsImpl_H_
|
||||
#define SWGDeviceSettingsImpl_H_
|
||||
|
||||
#include <QJsonObject>
|
||||
|
||||
|
||||
#include "SWGFileSourceSettings.h"
|
||||
#include "SWGLimeSdrInputSettings.h"
|
||||
#include "SWGLimeSdrOutputSettings.h"
|
||||
#include "SWGRtlSdrSettings.h"
|
||||
|
||||
#include "SWGObject.h"
|
||||
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
class SWGDeviceSettingsImpl: public SWGObject {
|
||||
public:
|
||||
SWGDeviceSettingsImpl();
|
||||
SWGDeviceSettingsImpl(QString* json);
|
||||
virtual ~SWGDeviceSettingsImpl();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGDeviceSettingsImpl* fromJson(QString &jsonString);
|
||||
|
||||
SWGFileSourceSettings* getFileSource();
|
||||
void setFileSource(SWGFileSourceSettings* file_source);
|
||||
|
||||
SWGRtlSdrSettings* getRtlsdr();
|
||||
void setRtlsdr(SWGRtlSdrSettings* rtlsdr);
|
||||
|
||||
SWGLimeSdrInputSettings* getLimesdrInput();
|
||||
void setLimesdrInput(SWGLimeSdrInputSettings* limesdr_input);
|
||||
|
||||
SWGLimeSdrOutputSettings* getLimesdrOutput();
|
||||
void setLimesdrOutput(SWGLimeSdrOutputSettings* limesdr_output);
|
||||
|
||||
|
||||
private:
|
||||
SWGFileSourceSettings* file_source;
|
||||
SWGRtlSdrSettings* rtlsdr;
|
||||
SWGLimeSdrInputSettings* limesdr_input;
|
||||
SWGLimeSdrOutputSettings* limesdr_output;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif /* SWGDeviceSettingsImpl_H_ */
|
|
@ -25,7 +25,6 @@
|
|||
#include "SWGDeviceSet.h"
|
||||
#include "SWGDeviceSetList.h"
|
||||
#include "SWGDeviceSettings.h"
|
||||
#include "SWGDeviceSettingsImpl.h"
|
||||
#include "SWGErrorResponse.h"
|
||||
#include "SWGFileSourceSettings.h"
|
||||
#include "SWGInstanceChannelsResponse.h"
|
||||
|
@ -80,9 +79,6 @@ namespace SWGSDRangel {
|
|||
if(QString("SWGDeviceSettings").compare(type) == 0) {
|
||||
return new SWGDeviceSettings();
|
||||
}
|
||||
if(QString("SWGDeviceSettingsImpl").compare(type) == 0) {
|
||||
return new SWGDeviceSettingsImpl();
|
||||
}
|
||||
if(QString("SWGErrorResponse").compare(type) == 0) {
|
||||
return new SWGErrorResponse();
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue