ATV modulator: Web API: settings and report implementation

This commit is contained in:
f4exb 2018-04-15 00:52:39 +02:00
parent b38d2a2a65
commit b21ea9ab2f
25 changed files with 1496 additions and 16 deletions

View File

@ -1,5 +1,7 @@
project(modatv)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(modatv_SOURCES
atvmod.cpp
atvmodgui.cpp
@ -24,6 +26,7 @@ include_directories(
.
${OpenCV_INCLUDE_DIRS}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
)
add_definitions(${QT_DEFINITIONS})
@ -43,6 +46,7 @@ target_link_libraries(modatv
${QT_LIBRARIES}
sdrbase
sdrgui
swagger
)
qt5_use_modules(modatv Core Widgets)

View File

@ -17,12 +17,17 @@
#include <QDebug>
#include <time.h>
#include "SWGChannelSettings.h"
#include "SWGChannelReport.h"
#include "SWGATVModReport.h"
#include "opencv2/imgproc/imgproc.hpp"
#include "dsp/upchannelizer.h"
#include "dsp/threadedbasebandsamplesource.h"
#include "dsp/dspcommands.h"
#include "device/devicesinkapi.h"
#include "util/db.h"
#include "atvmod.h"
@ -1177,3 +1182,157 @@ bool ATVMod::deserialize(const QByteArray& data)
return false;
}
}
int ATVMod::webapiSettingsGet(
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage __attribute__((unused)))
{
response.setAtvModSettings(new SWGSDRangel::SWGATVModSettings());
response.getAtvModSettings()->init();
webapiFormatChannelSettings(response, m_settings);
return 200;
}
int ATVMod::webapiSettingsPutPatch(
bool force,
const QStringList& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage __attribute__((unused)))
{
ATVModSettings settings;
bool frequencyOffsetChanged = false;
if (channelSettingsKeys.contains("inputFrequencyOffset"))
{
settings.m_inputFrequencyOffset = response.getAtvModSettings()->getInputFrequencyOffset();
frequencyOffsetChanged = true;
}
if (channelSettingsKeys.contains("rfBandwidth")) {
settings.m_rfBandwidth = response.getAtvModSettings()->getRfBandwidth();
}
if (channelSettingsKeys.contains("rfOppBandwidth")) {
settings.m_rfOppBandwidth = response.getAtvModSettings()->getRfBandwidth();
}
if (channelSettingsKeys.contains("atvStd")) {
settings.m_atvStd = (ATVModSettings::ATVStd) response.getAtvModSettings()->getAtvStd();
}
if (channelSettingsKeys.contains("nbLines")) {
settings.m_nbLines = response.getAtvModSettings()->getNbLines();
}
if (channelSettingsKeys.contains("fps")) {
settings.m_fps = response.getAtvModSettings()->getFps();
}
if (channelSettingsKeys.contains("atvModInput")) {
settings.m_atvModInput = (ATVModSettings::ATVModInput) response.getAtvModSettings()->getAtvModInput();
}
if (channelSettingsKeys.contains("uniformLevel")) {
settings.m_uniformLevel = response.getAtvModSettings()->getUniformLevel();
}
if (channelSettingsKeys.contains("atvModulation")) {
settings.m_atvModulation = (ATVModSettings::ATVModulation) response.getAtvModSettings()->getAtvModulation();
}
if (channelSettingsKeys.contains("videoPlayLoop")) {
settings.m_videoPlayLoop = response.getAtvModSettings()->getVideoPlayLoop() != 0;
}
if (channelSettingsKeys.contains("videoPlay")) {
settings.m_videoPlay = response.getAtvModSettings()->getVideoPlay() != 0;
}
if (channelSettingsKeys.contains("cameraPlay")) {
settings.m_cameraPlay = response.getAtvModSettings()->getCameraPlay() != 0;
}
if (channelSettingsKeys.contains("channelMute")) {
settings.m_channelMute = response.getAtvModSettings()->getChannelMute() != 0;
}
if (channelSettingsKeys.contains("invertedVideo")) {
settings.m_invertedVideo = response.getAtvModSettings()->getInvertedVideo() != 0;
}
if (channelSettingsKeys.contains("rfScalingFactor")) {
settings.m_rfScalingFactor = response.getAtvModSettings()->getRfScalingFactor();
}
if (channelSettingsKeys.contains("fmExcursion")) {
settings.m_fmExcursion = response.getAtvModSettings()->getFmExcursion();
}
if (channelSettingsKeys.contains("forceDecimator")) {
settings.m_forceDecimator = response.getAtvModSettings()->getForceDecimator() != 0;
}
if (channelSettingsKeys.contains("overlayText")) {
settings.m_overlayText = *response.getAtvModSettings()->getOverlayText();
}
if (channelSettingsKeys.contains("rgbColor")) {
settings.m_rgbColor = response.getAtvModSettings()->getRgbColor();
}
if (channelSettingsKeys.contains("title")) {
settings.m_title = *response.getAtvModSettings()->getTitle();
}
if (frequencyOffsetChanged)
{
ATVMod::MsgConfigureChannelizer *msgChan = ATVMod::MsgConfigureChannelizer::create(
settings.m_inputFrequencyOffset);
m_inputMessageQueue.push(msgChan);
}
MsgConfigureATVMod *msg = MsgConfigureATVMod::create(settings, force);
m_inputMessageQueue.push(msg);
if (m_guiMessageQueue) // forward to GUI if any
{
MsgConfigureATVMod *msgToGUI = MsgConfigureATVMod::create(settings, force);
m_guiMessageQueue->push(msgToGUI);
}
webapiFormatChannelSettings(response, settings);
return 200;
}
int ATVMod::webapiReportGet(
SWGSDRangel::SWGChannelReport& response,
QString& errorMessage __attribute__((unused)))
{
response.setAtvModReport(new SWGSDRangel::SWGATVModReport());
response.getAtvModReport()->init();
webapiFormatChannelReport(response);
return 200;
}
void ATVMod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const ATVModSettings& settings)
{
response.getAtvModSettings()->setInputFrequencyOffset(settings.m_inputFrequencyOffset);
response.getAtvModSettings()->setRfBandwidth(settings.m_rfBandwidth);
response.getAtvModSettings()->setRfOppBandwidth(settings.m_rfOppBandwidth);
response.getAtvModSettings()->setAtvStd(settings.m_atvStd);
response.getAtvModSettings()->setNbLines(settings.m_nbLines);
response.getAtvModSettings()->setFps(settings.m_fps);
response.getAtvModSettings()->setAtvModInput(settings.m_atvModInput);
response.getAtvModSettings()->setUniformLevel(settings.m_uniformLevel);
response.getAtvModSettings()->setAtvModulation(settings.m_atvModulation);
response.getAtvModSettings()->setVideoPlayLoop(settings.m_videoPlayLoop ? 1 : 0);
response.getAtvModSettings()->setVideoPlay(settings.m_videoPlay ? 1 : 0);
response.getAtvModSettings()->setCameraPlay(settings.m_cameraPlay ? 1 : 0);
response.getAtvModSettings()->setChannelMute(settings.m_channelMute ? 1 : 0);
response.getAtvModSettings()->setInvertedVideo(settings.m_invertedVideo ? 1 : 0);
response.getAtvModSettings()->setRfScalingFactor(settings.m_rfScalingFactor);
response.getAtvModSettings()->setFmExcursion(settings.m_fmExcursion);
response.getAtvModSettings()->setForceDecimator(settings.m_forceDecimator ? 1 : 0);
if (response.getAtvModSettings()->getOverlayText()) {
*response.getAtvModSettings()->getOverlayText() = settings.m_overlayText;
} else {
response.getAtvModSettings()->setOverlayText(new QString(settings.m_overlayText));
}
response.getAtvModSettings()->setRgbColor(settings.m_rgbColor);
if (response.getAtvModSettings()->getTitle()) {
*response.getAtvModSettings()->getTitle() = settings.m_title;
} else {
response.getAtvModSettings()->setTitle(new QString(settings.m_title));
}
}
void ATVMod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
{
response.getAtvModReport()->setChannelPowerDb(CalcDb::dbPower(getMagSq()));
response.getAtvModReport()->setChannelSampleRate(m_outputSampleRate);
}

View File

@ -411,6 +411,20 @@ public:
virtual QByteArray serialize() const;
virtual bool deserialize(const QByteArray& data);
virtual int webapiSettingsGet(
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage);
virtual int webapiSettingsPutPatch(
bool force,
const QStringList& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage);
virtual int webapiReportGet(
SWGSDRangel::SWGChannelReport& response,
QString& errorMessage);
int getEffectiveSampleRate() const { return m_tvSampleRate; };
double getMagSq() const { return m_movingAverage.asDouble(); }
void getCameraNumbers(std::vector<int>& numbers);
@ -583,6 +597,9 @@ private:
void resizeCamera();
void mixImageAndText(cv::Mat& image);
void webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const ATVModSettings& settings);
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
inline void pullImageLine(Real& sample, bool noHSync = false)
{
if (m_horizontalCount < m_pointsPerSync) // sync pulse

View File

@ -149,6 +149,15 @@ bool ATVModGUI::handleMessage(const Message& message)
setRFFiltersSlidersRange(sampleRate);
return true;
}
else if (ATVMod::MsgConfigureATVMod::match(message))
{
const ATVMod::MsgConfigureATVMod& cfg = (ATVMod::MsgConfigureATVMod&) message;
m_settings = cfg.getSettings();
blockApplySettings(true);
displaySettings();
blockApplySettings(false);
return true;
}
else
{
return false;

View File

@ -24,7 +24,7 @@
const PluginDescriptor ATVModPlugin::m_pluginDescriptor = {
QString("ATV Modulator"),
QString("3.12.0"),
QString("3.14.2"),
QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"),
true,

View File

@ -49,8 +49,6 @@ void ATVModSettings::resetToDefaults()
m_overlayText = "ATV";
m_rgbColor = QColor(255, 255, 255).rgb();
m_title = "ATV Modulator";
m_udpAddress = "127.0.0.1";
m_udpPort = 9999;
}
QByteArray ATVModSettings::serialize() const

View File

@ -79,9 +79,6 @@ struct ATVModSettings
quint32 m_rgbColor;
QString m_title;
QString m_udpAddress;
uint16_t m_udpPort;
Serializable *m_channelMarker;
ATVModSettings();

View File

@ -10,8 +10,10 @@
<file>webapi/doc/swagger/include/LimeSdr.yaml</file>
<file>webapi/doc/swagger/include/AMDemod.yaml</file>
<file>webapi/doc/swagger/include/AMMod.yaml</file>
<file>webapi/doc/swagger/include/ATVMod.yaml</file>
<file>webapi/doc/swagger/include/NFMDemod.yaml</file>
<file>webapi/doc/swagger/include/NFMMod.yaml</file>
<file>webapi/doc/swagger/include/SSBMod.yaml</file>
<file>webapi/doc/swagger/include/WFMMod.yaml</file>
<file>webapi/doc/swagger/include/RtlSdr.yaml</file>
<file>webapi/doc/swagger-ui/swagger-ui.js.map</file>

View File

@ -818,6 +818,90 @@ margin-bottom: 20px;
}
},
"description" : "AMMod"
};
defs.ATVModReport = {
"properties" : {
"channelPowerDB" : {
"type" : "number",
"format" : "float",
"description" : "power transmitted in channel (dB)"
},
"channelSampleRate" : {
"type" : "integer"
}
},
"description" : "ATVMod"
};
defs.ATVModSettings = {
"properties" : {
"inputFrequencyOffset" : {
"type" : "integer",
"format" : "int64"
},
"rfBandwidth" : {
"type" : "number",
"format" : "float"
},
"rfOppBandwidth" : {
"type" : "number",
"format" : "float"
},
"atvStd" : {
"type" : "integer"
},
"nbLines" : {
"type" : "integer"
},
"fps" : {
"type" : "integer"
},
"atvModInput" : {
"type" : "integer"
},
"uniformLevel" : {
"type" : "number",
"format" : "float"
},
"atvModulation" : {
"type" : "integer"
},
"videoPlayLoop" : {
"type" : "integer"
},
"videoPlay" : {
"type" : "integer"
},
"cameraPlay" : {
"type" : "integer"
},
"channelMute" : {
"type" : "integer"
},
"invertedVideo" : {
"type" : "integer"
},
"rfScalingFactor" : {
"type" : "number",
"format" : "float"
},
"fmExcursion" : {
"type" : "number",
"format" : "float"
},
"forceDecimator" : {
"type" : "integer"
},
"overlayText" : {
"type" : "string"
},
"rgbColor" : {
"type" : "integer"
},
"title" : {
"type" : "string"
}
},
"description" : "ATVMod"
};
defs.AirspyHFSettings = {
"properties" : {
@ -1124,6 +1208,9 @@ margin-bottom: 20px;
"AMModReport" : {
"$ref" : "#/definitions/AMModReport"
},
"ATVModReport" : {
"$ref" : "#/definitions/ATVModReport"
},
"NFMDemodReport" : {
"$ref" : "#/definitions/NFMDemodReport"
},
@ -1157,6 +1244,9 @@ margin-bottom: 20px;
"AMModSettings" : {
"$ref" : "#/definitions/AMModSettings"
},
"ATVModSettings" : {
"$ref" : "#/definitions/ATVModSettings"
},
"NFMDemodSettings" : {
"$ref" : "#/definitions/NFMDemodSettings"
},
@ -20439,7 +20529,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2018-04-12T23:48:02.735+02:00
Generated 2018-04-14T22:10:55.895+02:00
</div>
</div>
</div>

View File

@ -0,0 +1,60 @@
ATVModSettings:
description: ATVMod
properties:
inputFrequencyOffset:
type: integer
format: int64
rfBandwidth:
type: number
format: float
rfOppBandwidth:
type: number
format: float
atvStd:
type: integer
nbLines:
type: integer
fps:
type: integer
atvModInput:
type: integer
uniformLevel:
type: number
format: float
atvModulation:
type: integer
videoPlayLoop:
type: integer
videoPlay:
type: integer
cameraPlay:
type: integer
channelMute:
type: integer
invertedVideo:
type: integer
rfScalingFactor:
type: number
format: float
fmExcursion:
type: number
format: float
forceDecimator:
type: integer
overlayText:
type: string
rgbColor:
type: integer
title:
type: string
ATVModReport:
description: ATVMod
properties:
channelPowerDB:
description: power transmitted in channel (dB)
type: number
format: float
channelSampleRate:
type: integer

View File

@ -1749,6 +1749,8 @@ definitions:
$ref: "/doc/swagger/include/AMDemod.yaml#/AMDemodSettings"
AMModSettings:
$ref: "/doc/swagger/include/AMMod.yaml#/AMModSettings"
ATVModSettings:
$ref: "/doc/swagger/include/ATVMod.yaml#/ATVModSettings"
NFMDemodSettings:
$ref: "/doc/swagger/include/NFMDemod.yaml#/NFMDemodSettings"
NFMModSettings:
@ -1772,6 +1774,8 @@ definitions:
$ref: "/doc/swagger/include/AMDemod.yaml#/AMDemodReport"
AMModReport:
$ref: "/doc/swagger/include/AMMod.yaml#/AMModReport"
ATVModReport:
$ref: "/doc/swagger/include/ATVMod.yaml#/ATVModReport"
NFMDemodReport:
$ref: "/doc/swagger/include/NFMDemod.yaml#/NFMDemodReport"
NFMModReport:

View File

@ -1861,6 +1861,20 @@ bool WebAPIRequestMapper::validateChannelSettings(
return false;
}
}
else if (*channelType == "ATVMod")
{
if (channelSettings.getTx() != 0)
{
QJsonObject atvModSettingsJsonObject = jsonObject["ATVModSettings"].toObject();
channelSettingsKeys = atvModSettingsJsonObject.keys();
channelSettings.setAtvModSettings(new SWGSDRangel::SWGATVModSettings());
channelSettings.getAtvModSettings()->fromJsonObject(atvModSettingsJsonObject);
return true;
}
else {
return false;
}
}
else if (*channelType == "NFMDemod")
{
if (channelSettings.getTx() == 0)
@ -1991,6 +2005,20 @@ bool WebAPIRequestMapper::validateChannelReport(
return false;
}
}
else if (*channelType == "ATVMod")
{
if (channelReport.getTx() != 0)
{
QJsonObject atvModReportJsonObject = jsonObject["ATVModReport"].toObject();
channelReportKeys = atvModReportJsonObject.keys();
channelReport.setAtvModReport(new SWGSDRangel::SWGATVModReport());
channelReport.getAtvModReport()->fromJsonObject(atvModReportJsonObject);
return true;
}
else {
return false;
}
}
else if (*channelType == "NFMDemod")
{
if (channelReport.getTx() == 0)

View File

@ -0,0 +1,60 @@
ATVModSettings:
description: ATVMod
properties:
inputFrequencyOffset:
type: integer
format: int64
rfBandwidth:
type: number
format: float
rfOppBandwidth:
type: number
format: float
atvStd:
type: integer
nbLines:
type: integer
fps:
type: integer
atvModInput:
type: integer
uniformLevel:
type: number
format: float
atvModulation:
type: integer
videoPlayLoop:
type: integer
videoPlay:
type: integer
cameraPlay:
type: integer
channelMute:
type: integer
invertedVideo:
type: integer
rfScalingFactor:
type: number
format: float
fmExcursion:
type: number
format: float
forceDecimator:
type: integer
overlayText:
type: string
rgbColor:
type: integer
title:
type: string
ATVModReport:
description: ATVMod
properties:
channelPowerDB:
description: power transmitted in channel (dB)
type: number
format: float
channelSampleRate:
type: integer

View File

@ -1749,6 +1749,8 @@ definitions:
$ref: "http://localhost:8081/api/swagger/include/AMDemod.yaml#/AMDemodSettings"
AMModSettings:
$ref: "http://localhost:8081/api/swagger/include/AMMod.yaml#/AMModSettings"
ATVModSettings:
$ref: "http://localhost:8081/api/swagger/include/ATVMod.yaml#/ATVModSettings"
NFMDemodSettings:
$ref: "http://localhost:8081/api/swagger/include/NFMDemod.yaml#/NFMDemodSettings"
NFMModSettings:
@ -1772,6 +1774,8 @@ definitions:
$ref: "http://localhost:8081/api/swagger/include/AMDemod.yaml#/AMDemodReport"
AMModReport:
$ref: "http://localhost:8081/api/swagger/include/AMMod.yaml#/AMModReport"
ATVModReport:
$ref: "http://localhost:8081/api/swagger/include/ATVMod.yaml#/ATVModReport"
NFMDemodReport:
$ref: "http://localhost:8081/api/swagger/include/NFMDemod.yaml#/NFMDemodReport"
NFMModReport:

View File

@ -818,6 +818,90 @@ margin-bottom: 20px;
}
},
"description" : "AMMod"
};
defs.ATVModReport = {
"properties" : {
"channelPowerDB" : {
"type" : "number",
"format" : "float",
"description" : "power transmitted in channel (dB)"
},
"channelSampleRate" : {
"type" : "integer"
}
},
"description" : "ATVMod"
};
defs.ATVModSettings = {
"properties" : {
"inputFrequencyOffset" : {
"type" : "integer",
"format" : "int64"
},
"rfBandwidth" : {
"type" : "number",
"format" : "float"
},
"rfOppBandwidth" : {
"type" : "number",
"format" : "float"
},
"atvStd" : {
"type" : "integer"
},
"nbLines" : {
"type" : "integer"
},
"fps" : {
"type" : "integer"
},
"atvModInput" : {
"type" : "integer"
},
"uniformLevel" : {
"type" : "number",
"format" : "float"
},
"atvModulation" : {
"type" : "integer"
},
"videoPlayLoop" : {
"type" : "integer"
},
"videoPlay" : {
"type" : "integer"
},
"cameraPlay" : {
"type" : "integer"
},
"channelMute" : {
"type" : "integer"
},
"invertedVideo" : {
"type" : "integer"
},
"rfScalingFactor" : {
"type" : "number",
"format" : "float"
},
"fmExcursion" : {
"type" : "number",
"format" : "float"
},
"forceDecimator" : {
"type" : "integer"
},
"overlayText" : {
"type" : "string"
},
"rgbColor" : {
"type" : "integer"
},
"title" : {
"type" : "string"
}
},
"description" : "ATVMod"
};
defs.AirspyHFSettings = {
"properties" : {
@ -1124,6 +1208,9 @@ margin-bottom: 20px;
"AMModReport" : {
"$ref" : "#/definitions/AMModReport"
},
"ATVModReport" : {
"$ref" : "#/definitions/ATVModReport"
},
"NFMDemodReport" : {
"$ref" : "#/definitions/NFMDemodReport"
},
@ -1157,6 +1244,9 @@ margin-bottom: 20px;
"AMModSettings" : {
"$ref" : "#/definitions/AMModSettings"
},
"ATVModSettings" : {
"$ref" : "#/definitions/ATVModSettings"
},
"NFMDemodSettings" : {
"$ref" : "#/definitions/NFMDemodSettings"
},
@ -20439,7 +20529,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2018-04-12T23:48:02.735+02:00
Generated 2018-04-14T22:10:55.895+02:00
</div>
</div>
</div>

View File

@ -0,0 +1,127 @@
/**
* SDRangel
* This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Stopping instance i.e. /sdrangel with DELETE method is a server only feature. It allows stopping the instance nicely. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV demodulator, Channel Analyzer, Channel Analyzer NG, LoRa demodulator, TCP source * The content type returned is always application/json except in the following cases: * An incorrect URL was specified: this document is returned as text/html with a status 400 ---
*
* 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 "SWGATVModReport.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace SWGSDRangel {
SWGATVModReport::SWGATVModReport(QString* json) {
init();
this->fromJson(*json);
}
SWGATVModReport::SWGATVModReport() {
channel_power_db = 0.0f;
m_channel_power_db_isSet = false;
channel_sample_rate = 0;
m_channel_sample_rate_isSet = false;
}
SWGATVModReport::~SWGATVModReport() {
this->cleanup();
}
void
SWGATVModReport::init() {
channel_power_db = 0.0f;
m_channel_power_db_isSet = false;
channel_sample_rate = 0;
m_channel_sample_rate_isSet = false;
}
void
SWGATVModReport::cleanup() {
}
SWGATVModReport*
SWGATVModReport::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGATVModReport::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&channel_power_db, pJson["channelPowerDB"], "float", "");
::SWGSDRangel::setValue(&channel_sample_rate, pJson["channelSampleRate"], "qint32", "");
}
QString
SWGATVModReport::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
delete obj;
return QString(bytes);
}
QJsonObject*
SWGATVModReport::asJsonObject() {
QJsonObject* obj = new QJsonObject();
if(m_channel_power_db_isSet){
obj->insert("channelPowerDB", QJsonValue(channel_power_db));
}
if(m_channel_sample_rate_isSet){
obj->insert("channelSampleRate", QJsonValue(channel_sample_rate));
}
return obj;
}
float
SWGATVModReport::getChannelPowerDb() {
return channel_power_db;
}
void
SWGATVModReport::setChannelPowerDb(float channel_power_db) {
this->channel_power_db = channel_power_db;
this->m_channel_power_db_isSet = true;
}
qint32
SWGATVModReport::getChannelSampleRate() {
return channel_sample_rate;
}
void
SWGATVModReport::setChannelSampleRate(qint32 channel_sample_rate) {
this->channel_sample_rate = channel_sample_rate;
this->m_channel_sample_rate_isSet = true;
}
bool
SWGATVModReport::isSet(){
bool isObjectUpdated = false;
do{
if(m_channel_power_db_isSet){ isObjectUpdated = true; break;}
if(m_channel_sample_rate_isSet){ isObjectUpdated = true; break;}
}while(false);
return isObjectUpdated;
}
}

View File

@ -0,0 +1,64 @@
/**
* SDRangel
* This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Stopping instance i.e. /sdrangel with DELETE method is a server only feature. It allows stopping the instance nicely. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV demodulator, Channel Analyzer, Channel Analyzer NG, LoRa demodulator, TCP source * The content type returned is always application/json except in the following cases: * An incorrect URL was specified: this document is returned as text/html with a status 400 ---
*
* 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.
*/
/*
* SWGATVModReport.h
*
* ATVMod
*/
#ifndef SWGATVModReport_H_
#define SWGATVModReport_H_
#include <QJsonObject>
#include "SWGObject.h"
#include "export.h"
namespace SWGSDRangel {
class SWG_API SWGATVModReport: public SWGObject {
public:
SWGATVModReport();
SWGATVModReport(QString* json);
virtual ~SWGATVModReport();
void init();
void cleanup();
virtual QString asJson () override;
virtual QJsonObject* asJsonObject() override;
virtual void fromJsonObject(QJsonObject &json) override;
virtual SWGATVModReport* fromJson(QString &jsonString) override;
float getChannelPowerDb();
void setChannelPowerDb(float channel_power_db);
qint32 getChannelSampleRate();
void setChannelSampleRate(qint32 channel_sample_rate);
virtual bool isSet() override;
private:
float channel_power_db;
bool m_channel_power_db_isSet;
qint32 channel_sample_rate;
bool m_channel_sample_rate_isSet;
};
}
#endif /* SWGATVModReport_H_ */

View File

@ -0,0 +1,509 @@
/**
* SDRangel
* This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Stopping instance i.e. /sdrangel with DELETE method is a server only feature. It allows stopping the instance nicely. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV demodulator, Channel Analyzer, Channel Analyzer NG, LoRa demodulator, TCP source * The content type returned is always application/json except in the following cases: * An incorrect URL was specified: this document is returned as text/html with a status 400 ---
*
* 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 "SWGATVModSettings.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace SWGSDRangel {
SWGATVModSettings::SWGATVModSettings(QString* json) {
init();
this->fromJson(*json);
}
SWGATVModSettings::SWGATVModSettings() {
input_frequency_offset = 0L;
m_input_frequency_offset_isSet = false;
rf_bandwidth = 0.0f;
m_rf_bandwidth_isSet = false;
rf_opp_bandwidth = 0.0f;
m_rf_opp_bandwidth_isSet = false;
atv_std = 0;
m_atv_std_isSet = false;
nb_lines = 0;
m_nb_lines_isSet = false;
fps = 0;
m_fps_isSet = false;
atv_mod_input = 0;
m_atv_mod_input_isSet = false;
uniform_level = 0.0f;
m_uniform_level_isSet = false;
atv_modulation = 0;
m_atv_modulation_isSet = false;
video_play_loop = 0;
m_video_play_loop_isSet = false;
video_play = 0;
m_video_play_isSet = false;
camera_play = 0;
m_camera_play_isSet = false;
channel_mute = 0;
m_channel_mute_isSet = false;
inverted_video = 0;
m_inverted_video_isSet = false;
rf_scaling_factor = 0.0f;
m_rf_scaling_factor_isSet = false;
fm_excursion = 0.0f;
m_fm_excursion_isSet = false;
force_decimator = 0;
m_force_decimator_isSet = false;
overlay_text = nullptr;
m_overlay_text_isSet = false;
rgb_color = 0;
m_rgb_color_isSet = false;
title = nullptr;
m_title_isSet = false;
}
SWGATVModSettings::~SWGATVModSettings() {
this->cleanup();
}
void
SWGATVModSettings::init() {
input_frequency_offset = 0L;
m_input_frequency_offset_isSet = false;
rf_bandwidth = 0.0f;
m_rf_bandwidth_isSet = false;
rf_opp_bandwidth = 0.0f;
m_rf_opp_bandwidth_isSet = false;
atv_std = 0;
m_atv_std_isSet = false;
nb_lines = 0;
m_nb_lines_isSet = false;
fps = 0;
m_fps_isSet = false;
atv_mod_input = 0;
m_atv_mod_input_isSet = false;
uniform_level = 0.0f;
m_uniform_level_isSet = false;
atv_modulation = 0;
m_atv_modulation_isSet = false;
video_play_loop = 0;
m_video_play_loop_isSet = false;
video_play = 0;
m_video_play_isSet = false;
camera_play = 0;
m_camera_play_isSet = false;
channel_mute = 0;
m_channel_mute_isSet = false;
inverted_video = 0;
m_inverted_video_isSet = false;
rf_scaling_factor = 0.0f;
m_rf_scaling_factor_isSet = false;
fm_excursion = 0.0f;
m_fm_excursion_isSet = false;
force_decimator = 0;
m_force_decimator_isSet = false;
overlay_text = new QString("");
m_overlay_text_isSet = false;
rgb_color = 0;
m_rgb_color_isSet = false;
title = new QString("");
m_title_isSet = false;
}
void
SWGATVModSettings::cleanup() {
if(overlay_text != nullptr) {
delete overlay_text;
}
if(title != nullptr) {
delete title;
}
}
SWGATVModSettings*
SWGATVModSettings::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGATVModSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&input_frequency_offset, pJson["inputFrequencyOffset"], "qint64", "");
::SWGSDRangel::setValue(&rf_bandwidth, pJson["rfBandwidth"], "float", "");
::SWGSDRangel::setValue(&rf_opp_bandwidth, pJson["rfOppBandwidth"], "float", "");
::SWGSDRangel::setValue(&atv_std, pJson["atvStd"], "qint32", "");
::SWGSDRangel::setValue(&nb_lines, pJson["nbLines"], "qint32", "");
::SWGSDRangel::setValue(&fps, pJson["fps"], "qint32", "");
::SWGSDRangel::setValue(&atv_mod_input, pJson["atvModInput"], "qint32", "");
::SWGSDRangel::setValue(&uniform_level, pJson["uniformLevel"], "float", "");
::SWGSDRangel::setValue(&atv_modulation, pJson["atvModulation"], "qint32", "");
::SWGSDRangel::setValue(&video_play_loop, pJson["videoPlayLoop"], "qint32", "");
::SWGSDRangel::setValue(&video_play, pJson["videoPlay"], "qint32", "");
::SWGSDRangel::setValue(&camera_play, pJson["cameraPlay"], "qint32", "");
::SWGSDRangel::setValue(&channel_mute, pJson["channelMute"], "qint32", "");
::SWGSDRangel::setValue(&inverted_video, pJson["invertedVideo"], "qint32", "");
::SWGSDRangel::setValue(&rf_scaling_factor, pJson["rfScalingFactor"], "float", "");
::SWGSDRangel::setValue(&fm_excursion, pJson["fmExcursion"], "float", "");
::SWGSDRangel::setValue(&force_decimator, pJson["forceDecimator"], "qint32", "");
::SWGSDRangel::setValue(&overlay_text, pJson["overlayText"], "QString", "QString");
::SWGSDRangel::setValue(&rgb_color, pJson["rgbColor"], "qint32", "");
::SWGSDRangel::setValue(&title, pJson["title"], "QString", "QString");
}
QString
SWGATVModSettings::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
delete obj;
return QString(bytes);
}
QJsonObject*
SWGATVModSettings::asJsonObject() {
QJsonObject* obj = new QJsonObject();
if(m_input_frequency_offset_isSet){
obj->insert("inputFrequencyOffset", QJsonValue(input_frequency_offset));
}
if(m_rf_bandwidth_isSet){
obj->insert("rfBandwidth", QJsonValue(rf_bandwidth));
}
if(m_rf_opp_bandwidth_isSet){
obj->insert("rfOppBandwidth", QJsonValue(rf_opp_bandwidth));
}
if(m_atv_std_isSet){
obj->insert("atvStd", QJsonValue(atv_std));
}
if(m_nb_lines_isSet){
obj->insert("nbLines", QJsonValue(nb_lines));
}
if(m_fps_isSet){
obj->insert("fps", QJsonValue(fps));
}
if(m_atv_mod_input_isSet){
obj->insert("atvModInput", QJsonValue(atv_mod_input));
}
if(m_uniform_level_isSet){
obj->insert("uniformLevel", QJsonValue(uniform_level));
}
if(m_atv_modulation_isSet){
obj->insert("atvModulation", QJsonValue(atv_modulation));
}
if(m_video_play_loop_isSet){
obj->insert("videoPlayLoop", QJsonValue(video_play_loop));
}
if(m_video_play_isSet){
obj->insert("videoPlay", QJsonValue(video_play));
}
if(m_camera_play_isSet){
obj->insert("cameraPlay", QJsonValue(camera_play));
}
if(m_channel_mute_isSet){
obj->insert("channelMute", QJsonValue(channel_mute));
}
if(m_inverted_video_isSet){
obj->insert("invertedVideo", QJsonValue(inverted_video));
}
if(m_rf_scaling_factor_isSet){
obj->insert("rfScalingFactor", QJsonValue(rf_scaling_factor));
}
if(m_fm_excursion_isSet){
obj->insert("fmExcursion", QJsonValue(fm_excursion));
}
if(m_force_decimator_isSet){
obj->insert("forceDecimator", QJsonValue(force_decimator));
}
if(overlay_text != nullptr && *overlay_text != QString("")){
toJsonValue(QString("overlayText"), overlay_text, obj, QString("QString"));
}
if(m_rgb_color_isSet){
obj->insert("rgbColor", QJsonValue(rgb_color));
}
if(title != nullptr && *title != QString("")){
toJsonValue(QString("title"), title, obj, QString("QString"));
}
return obj;
}
qint64
SWGATVModSettings::getInputFrequencyOffset() {
return input_frequency_offset;
}
void
SWGATVModSettings::setInputFrequencyOffset(qint64 input_frequency_offset) {
this->input_frequency_offset = input_frequency_offset;
this->m_input_frequency_offset_isSet = true;
}
float
SWGATVModSettings::getRfBandwidth() {
return rf_bandwidth;
}
void
SWGATVModSettings::setRfBandwidth(float rf_bandwidth) {
this->rf_bandwidth = rf_bandwidth;
this->m_rf_bandwidth_isSet = true;
}
float
SWGATVModSettings::getRfOppBandwidth() {
return rf_opp_bandwidth;
}
void
SWGATVModSettings::setRfOppBandwidth(float rf_opp_bandwidth) {
this->rf_opp_bandwidth = rf_opp_bandwidth;
this->m_rf_opp_bandwidth_isSet = true;
}
qint32
SWGATVModSettings::getAtvStd() {
return atv_std;
}
void
SWGATVModSettings::setAtvStd(qint32 atv_std) {
this->atv_std = atv_std;
this->m_atv_std_isSet = true;
}
qint32
SWGATVModSettings::getNbLines() {
return nb_lines;
}
void
SWGATVModSettings::setNbLines(qint32 nb_lines) {
this->nb_lines = nb_lines;
this->m_nb_lines_isSet = true;
}
qint32
SWGATVModSettings::getFps() {
return fps;
}
void
SWGATVModSettings::setFps(qint32 fps) {
this->fps = fps;
this->m_fps_isSet = true;
}
qint32
SWGATVModSettings::getAtvModInput() {
return atv_mod_input;
}
void
SWGATVModSettings::setAtvModInput(qint32 atv_mod_input) {
this->atv_mod_input = atv_mod_input;
this->m_atv_mod_input_isSet = true;
}
float
SWGATVModSettings::getUniformLevel() {
return uniform_level;
}
void
SWGATVModSettings::setUniformLevel(float uniform_level) {
this->uniform_level = uniform_level;
this->m_uniform_level_isSet = true;
}
qint32
SWGATVModSettings::getAtvModulation() {
return atv_modulation;
}
void
SWGATVModSettings::setAtvModulation(qint32 atv_modulation) {
this->atv_modulation = atv_modulation;
this->m_atv_modulation_isSet = true;
}
qint32
SWGATVModSettings::getVideoPlayLoop() {
return video_play_loop;
}
void
SWGATVModSettings::setVideoPlayLoop(qint32 video_play_loop) {
this->video_play_loop = video_play_loop;
this->m_video_play_loop_isSet = true;
}
qint32
SWGATVModSettings::getVideoPlay() {
return video_play;
}
void
SWGATVModSettings::setVideoPlay(qint32 video_play) {
this->video_play = video_play;
this->m_video_play_isSet = true;
}
qint32
SWGATVModSettings::getCameraPlay() {
return camera_play;
}
void
SWGATVModSettings::setCameraPlay(qint32 camera_play) {
this->camera_play = camera_play;
this->m_camera_play_isSet = true;
}
qint32
SWGATVModSettings::getChannelMute() {
return channel_mute;
}
void
SWGATVModSettings::setChannelMute(qint32 channel_mute) {
this->channel_mute = channel_mute;
this->m_channel_mute_isSet = true;
}
qint32
SWGATVModSettings::getInvertedVideo() {
return inverted_video;
}
void
SWGATVModSettings::setInvertedVideo(qint32 inverted_video) {
this->inverted_video = inverted_video;
this->m_inverted_video_isSet = true;
}
float
SWGATVModSettings::getRfScalingFactor() {
return rf_scaling_factor;
}
void
SWGATVModSettings::setRfScalingFactor(float rf_scaling_factor) {
this->rf_scaling_factor = rf_scaling_factor;
this->m_rf_scaling_factor_isSet = true;
}
float
SWGATVModSettings::getFmExcursion() {
return fm_excursion;
}
void
SWGATVModSettings::setFmExcursion(float fm_excursion) {
this->fm_excursion = fm_excursion;
this->m_fm_excursion_isSet = true;
}
qint32
SWGATVModSettings::getForceDecimator() {
return force_decimator;
}
void
SWGATVModSettings::setForceDecimator(qint32 force_decimator) {
this->force_decimator = force_decimator;
this->m_force_decimator_isSet = true;
}
QString*
SWGATVModSettings::getOverlayText() {
return overlay_text;
}
void
SWGATVModSettings::setOverlayText(QString* overlay_text) {
this->overlay_text = overlay_text;
this->m_overlay_text_isSet = true;
}
qint32
SWGATVModSettings::getRgbColor() {
return rgb_color;
}
void
SWGATVModSettings::setRgbColor(qint32 rgb_color) {
this->rgb_color = rgb_color;
this->m_rgb_color_isSet = true;
}
QString*
SWGATVModSettings::getTitle() {
return title;
}
void
SWGATVModSettings::setTitle(QString* title) {
this->title = title;
this->m_title_isSet = true;
}
bool
SWGATVModSettings::isSet(){
bool isObjectUpdated = false;
do{
if(m_input_frequency_offset_isSet){ isObjectUpdated = true; break;}
if(m_rf_bandwidth_isSet){ isObjectUpdated = true; break;}
if(m_rf_opp_bandwidth_isSet){ isObjectUpdated = true; break;}
if(m_atv_std_isSet){ isObjectUpdated = true; break;}
if(m_nb_lines_isSet){ isObjectUpdated = true; break;}
if(m_fps_isSet){ isObjectUpdated = true; break;}
if(m_atv_mod_input_isSet){ isObjectUpdated = true; break;}
if(m_uniform_level_isSet){ isObjectUpdated = true; break;}
if(m_atv_modulation_isSet){ isObjectUpdated = true; break;}
if(m_video_play_loop_isSet){ isObjectUpdated = true; break;}
if(m_video_play_isSet){ isObjectUpdated = true; break;}
if(m_camera_play_isSet){ isObjectUpdated = true; break;}
if(m_channel_mute_isSet){ isObjectUpdated = true; break;}
if(m_inverted_video_isSet){ isObjectUpdated = true; break;}
if(m_rf_scaling_factor_isSet){ isObjectUpdated = true; break;}
if(m_fm_excursion_isSet){ isObjectUpdated = true; break;}
if(m_force_decimator_isSet){ isObjectUpdated = true; break;}
if(overlay_text != nullptr && *overlay_text != QString("")){ isObjectUpdated = true; break;}
if(m_rgb_color_isSet){ isObjectUpdated = true; break;}
if(title != nullptr && *title != QString("")){ isObjectUpdated = true; break;}
}while(false);
return isObjectUpdated;
}
}

View File

@ -0,0 +1,173 @@
/**
* SDRangel
* This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Stopping instance i.e. /sdrangel with DELETE method is a server only feature. It allows stopping the instance nicely. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV demodulator, Channel Analyzer, Channel Analyzer NG, LoRa demodulator, TCP source * The content type returned is always application/json except in the following cases: * An incorrect URL was specified: this document is returned as text/html with a status 400 ---
*
* 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.
*/
/*
* SWGATVModSettings.h
*
* ATVMod
*/
#ifndef SWGATVModSettings_H_
#define SWGATVModSettings_H_
#include <QJsonObject>
#include <QString>
#include "SWGObject.h"
#include "export.h"
namespace SWGSDRangel {
class SWG_API SWGATVModSettings: public SWGObject {
public:
SWGATVModSettings();
SWGATVModSettings(QString* json);
virtual ~SWGATVModSettings();
void init();
void cleanup();
virtual QString asJson () override;
virtual QJsonObject* asJsonObject() override;
virtual void fromJsonObject(QJsonObject &json) override;
virtual SWGATVModSettings* fromJson(QString &jsonString) override;
qint64 getInputFrequencyOffset();
void setInputFrequencyOffset(qint64 input_frequency_offset);
float getRfBandwidth();
void setRfBandwidth(float rf_bandwidth);
float getRfOppBandwidth();
void setRfOppBandwidth(float rf_opp_bandwidth);
qint32 getAtvStd();
void setAtvStd(qint32 atv_std);
qint32 getNbLines();
void setNbLines(qint32 nb_lines);
qint32 getFps();
void setFps(qint32 fps);
qint32 getAtvModInput();
void setAtvModInput(qint32 atv_mod_input);
float getUniformLevel();
void setUniformLevel(float uniform_level);
qint32 getAtvModulation();
void setAtvModulation(qint32 atv_modulation);
qint32 getVideoPlayLoop();
void setVideoPlayLoop(qint32 video_play_loop);
qint32 getVideoPlay();
void setVideoPlay(qint32 video_play);
qint32 getCameraPlay();
void setCameraPlay(qint32 camera_play);
qint32 getChannelMute();
void setChannelMute(qint32 channel_mute);
qint32 getInvertedVideo();
void setInvertedVideo(qint32 inverted_video);
float getRfScalingFactor();
void setRfScalingFactor(float rf_scaling_factor);
float getFmExcursion();
void setFmExcursion(float fm_excursion);
qint32 getForceDecimator();
void setForceDecimator(qint32 force_decimator);
QString* getOverlayText();
void setOverlayText(QString* overlay_text);
qint32 getRgbColor();
void setRgbColor(qint32 rgb_color);
QString* getTitle();
void setTitle(QString* title);
virtual bool isSet() override;
private:
qint64 input_frequency_offset;
bool m_input_frequency_offset_isSet;
float rf_bandwidth;
bool m_rf_bandwidth_isSet;
float rf_opp_bandwidth;
bool m_rf_opp_bandwidth_isSet;
qint32 atv_std;
bool m_atv_std_isSet;
qint32 nb_lines;
bool m_nb_lines_isSet;
qint32 fps;
bool m_fps_isSet;
qint32 atv_mod_input;
bool m_atv_mod_input_isSet;
float uniform_level;
bool m_uniform_level_isSet;
qint32 atv_modulation;
bool m_atv_modulation_isSet;
qint32 video_play_loop;
bool m_video_play_loop_isSet;
qint32 video_play;
bool m_video_play_isSet;
qint32 camera_play;
bool m_camera_play_isSet;
qint32 channel_mute;
bool m_channel_mute_isSet;
qint32 inverted_video;
bool m_inverted_video_isSet;
float rf_scaling_factor;
bool m_rf_scaling_factor_isSet;
float fm_excursion;
bool m_fm_excursion_isSet;
qint32 force_decimator;
bool m_force_decimator_isSet;
QString* overlay_text;
bool m_overlay_text_isSet;
qint32 rgb_color;
bool m_rgb_color_isSet;
QString* title;
bool m_title_isSet;
};
}
#endif /* SWGATVModSettings_H_ */

View File

@ -36,6 +36,8 @@ SWGChannelReport::SWGChannelReport() {
m_am_demod_report_isSet = false;
am_mod_report = nullptr;
m_am_mod_report_isSet = false;
atv_mod_report = nullptr;
m_atv_mod_report_isSet = false;
nfm_demod_report = nullptr;
m_nfm_demod_report_isSet = false;
nfm_mod_report = nullptr;
@ -60,6 +62,8 @@ SWGChannelReport::init() {
m_am_demod_report_isSet = false;
am_mod_report = new SWGAMModReport();
m_am_mod_report_isSet = false;
atv_mod_report = new SWGATVModReport();
m_atv_mod_report_isSet = false;
nfm_demod_report = new SWGNFMDemodReport();
m_nfm_demod_report_isSet = false;
nfm_mod_report = new SWGNFMModReport();
@ -82,6 +86,9 @@ SWGChannelReport::cleanup() {
if(am_mod_report != nullptr) {
delete am_mod_report;
}
if(atv_mod_report != nullptr) {
delete atv_mod_report;
}
if(nfm_demod_report != nullptr) {
delete nfm_demod_report;
}
@ -115,6 +122,8 @@ SWGChannelReport::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&am_mod_report, pJson["AMModReport"], "SWGAMModReport", "SWGAMModReport");
::SWGSDRangel::setValue(&atv_mod_report, pJson["ATVModReport"], "SWGATVModReport", "SWGATVModReport");
::SWGSDRangel::setValue(&nfm_demod_report, pJson["NFMDemodReport"], "SWGNFMDemodReport", "SWGNFMDemodReport");
::SWGSDRangel::setValue(&nfm_mod_report, pJson["NFMModReport"], "SWGNFMModReport", "SWGNFMModReport");
@ -151,6 +160,9 @@ SWGChannelReport::asJsonObject() {
if((am_mod_report != nullptr) && (am_mod_report->isSet())){
toJsonValue(QString("AMModReport"), am_mod_report, obj, QString("SWGAMModReport"));
}
if((atv_mod_report != nullptr) && (atv_mod_report->isSet())){
toJsonValue(QString("ATVModReport"), atv_mod_report, obj, QString("SWGATVModReport"));
}
if((nfm_demod_report != nullptr) && (nfm_demod_report->isSet())){
toJsonValue(QString("NFMDemodReport"), nfm_demod_report, obj, QString("SWGNFMDemodReport"));
}
@ -207,6 +219,16 @@ SWGChannelReport::setAmModReport(SWGAMModReport* am_mod_report) {
this->m_am_mod_report_isSet = true;
}
SWGATVModReport*
SWGChannelReport::getAtvModReport() {
return atv_mod_report;
}
void
SWGChannelReport::setAtvModReport(SWGATVModReport* atv_mod_report) {
this->atv_mod_report = atv_mod_report;
this->m_atv_mod_report_isSet = true;
}
SWGNFMDemodReport*
SWGChannelReport::getNfmDemodReport() {
return nfm_demod_report;
@ -256,6 +278,7 @@ SWGChannelReport::isSet(){
if(m_tx_isSet){ isObjectUpdated = true; break;}
if(am_demod_report != nullptr && am_demod_report->isSet()){ isObjectUpdated = true; break;}
if(am_mod_report != nullptr && am_mod_report->isSet()){ isObjectUpdated = true; break;}
if(atv_mod_report != nullptr && atv_mod_report->isSet()){ isObjectUpdated = true; break;}
if(nfm_demod_report != nullptr && nfm_demod_report->isSet()){ isObjectUpdated = true; break;}
if(nfm_mod_report != nullptr && nfm_mod_report->isSet()){ isObjectUpdated = true; break;}
if(ssb_mod_report != nullptr && ssb_mod_report->isSet()){ isObjectUpdated = true; break;}

View File

@ -24,6 +24,7 @@
#include "SWGAMDemodReport.h"
#include "SWGAMModReport.h"
#include "SWGATVModReport.h"
#include "SWGNFMDemodReport.h"
#include "SWGNFMModReport.h"
#include "SWGSSBModReport.h"
@ -60,6 +61,9 @@ public:
SWGAMModReport* getAmModReport();
void setAmModReport(SWGAMModReport* am_mod_report);
SWGATVModReport* getAtvModReport();
void setAtvModReport(SWGATVModReport* atv_mod_report);
SWGNFMDemodReport* getNfmDemodReport();
void setNfmDemodReport(SWGNFMDemodReport* nfm_demod_report);
@ -88,6 +92,9 @@ private:
SWGAMModReport* am_mod_report;
bool m_am_mod_report_isSet;
SWGATVModReport* atv_mod_report;
bool m_atv_mod_report_isSet;
SWGNFMDemodReport* nfm_demod_report;
bool m_nfm_demod_report_isSet;

View File

@ -36,6 +36,8 @@ SWGChannelSettings::SWGChannelSettings() {
m_am_demod_settings_isSet = false;
am_mod_settings = nullptr;
m_am_mod_settings_isSet = false;
atv_mod_settings = nullptr;
m_atv_mod_settings_isSet = false;
nfm_demod_settings = nullptr;
m_nfm_demod_settings_isSet = false;
nfm_mod_settings = nullptr;
@ -60,6 +62,8 @@ SWGChannelSettings::init() {
m_am_demod_settings_isSet = false;
am_mod_settings = new SWGAMModSettings();
m_am_mod_settings_isSet = false;
atv_mod_settings = new SWGATVModSettings();
m_atv_mod_settings_isSet = false;
nfm_demod_settings = new SWGNFMDemodSettings();
m_nfm_demod_settings_isSet = false;
nfm_mod_settings = new SWGNFMModSettings();
@ -82,6 +86,9 @@ SWGChannelSettings::cleanup() {
if(am_mod_settings != nullptr) {
delete am_mod_settings;
}
if(atv_mod_settings != nullptr) {
delete atv_mod_settings;
}
if(nfm_demod_settings != nullptr) {
delete nfm_demod_settings;
}
@ -115,6 +122,8 @@ SWGChannelSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&am_mod_settings, pJson["AMModSettings"], "SWGAMModSettings", "SWGAMModSettings");
::SWGSDRangel::setValue(&atv_mod_settings, pJson["ATVModSettings"], "SWGATVModSettings", "SWGATVModSettings");
::SWGSDRangel::setValue(&nfm_demod_settings, pJson["NFMDemodSettings"], "SWGNFMDemodSettings", "SWGNFMDemodSettings");
::SWGSDRangel::setValue(&nfm_mod_settings, pJson["NFMModSettings"], "SWGNFMModSettings", "SWGNFMModSettings");
@ -151,6 +160,9 @@ SWGChannelSettings::asJsonObject() {
if((am_mod_settings != nullptr) && (am_mod_settings->isSet())){
toJsonValue(QString("AMModSettings"), am_mod_settings, obj, QString("SWGAMModSettings"));
}
if((atv_mod_settings != nullptr) && (atv_mod_settings->isSet())){
toJsonValue(QString("ATVModSettings"), atv_mod_settings, obj, QString("SWGATVModSettings"));
}
if((nfm_demod_settings != nullptr) && (nfm_demod_settings->isSet())){
toJsonValue(QString("NFMDemodSettings"), nfm_demod_settings, obj, QString("SWGNFMDemodSettings"));
}
@ -207,6 +219,16 @@ SWGChannelSettings::setAmModSettings(SWGAMModSettings* am_mod_settings) {
this->m_am_mod_settings_isSet = true;
}
SWGATVModSettings*
SWGChannelSettings::getAtvModSettings() {
return atv_mod_settings;
}
void
SWGChannelSettings::setAtvModSettings(SWGATVModSettings* atv_mod_settings) {
this->atv_mod_settings = atv_mod_settings;
this->m_atv_mod_settings_isSet = true;
}
SWGNFMDemodSettings*
SWGChannelSettings::getNfmDemodSettings() {
return nfm_demod_settings;
@ -256,6 +278,7 @@ SWGChannelSettings::isSet(){
if(m_tx_isSet){ isObjectUpdated = true; break;}
if(am_demod_settings != nullptr && am_demod_settings->isSet()){ isObjectUpdated = true; break;}
if(am_mod_settings != nullptr && am_mod_settings->isSet()){ isObjectUpdated = true; break;}
if(atv_mod_settings != nullptr && atv_mod_settings->isSet()){ isObjectUpdated = true; break;}
if(nfm_demod_settings != nullptr && nfm_demod_settings->isSet()){ isObjectUpdated = true; break;}
if(nfm_mod_settings != nullptr && nfm_mod_settings->isSet()){ isObjectUpdated = true; break;}
if(ssb_mod_settings != nullptr && ssb_mod_settings->isSet()){ isObjectUpdated = true; break;}

View File

@ -24,6 +24,7 @@
#include "SWGAMDemodSettings.h"
#include "SWGAMModSettings.h"
#include "SWGATVModSettings.h"
#include "SWGNFMDemodSettings.h"
#include "SWGNFMModSettings.h"
#include "SWGSSBModSettings.h"
@ -60,6 +61,9 @@ public:
SWGAMModSettings* getAmModSettings();
void setAmModSettings(SWGAMModSettings* am_mod_settings);
SWGATVModSettings* getAtvModSettings();
void setAtvModSettings(SWGATVModSettings* atv_mod_settings);
SWGNFMDemodSettings* getNfmDemodSettings();
void setNfmDemodSettings(SWGNFMDemodSettings* nfm_demod_settings);
@ -88,6 +92,9 @@ private:
SWGAMModSettings* am_mod_settings;
bool m_am_mod_settings_isSet;
SWGATVModSettings* atv_mod_settings;
bool m_atv_mod_settings_isSet;
SWGNFMDemodSettings* nfm_demod_settings;
bool m_nfm_demod_settings_isSet;

View File

@ -18,6 +18,8 @@
#include "SWGAMDemodSettings.h"
#include "SWGAMModReport.h"
#include "SWGAMModSettings.h"
#include "SWGATVModReport.h"
#include "SWGATVModSettings.h"
#include "SWGAirspyHFSettings.h"
#include "SWGAudioDevices.h"
#include "SWGAudioInputDevice.h"
@ -82,6 +84,12 @@ namespace SWGSDRangel {
if(QString("SWGAMModSettings").compare(type) == 0) {
return new SWGAMModSettings();
}
if(QString("SWGATVModReport").compare(type) == 0) {
return new SWGATVModReport();
}
if(QString("SWGATVModSettings").compare(type) == 0) {
return new SWGATVModSettings();
}
if(QString("SWGAirspyHFSettings").compare(type) == 0) {
return new SWGAirspyHFSettings();
}

View File

@ -24,7 +24,8 @@ def getInputOptions():
parser.add_option("-C", "--channel-id", dest="channel_id", help="channel id", metavar="ID", type="string", default="NFMDemod")
parser.add_option("-F", "--device-freq", dest="device_freq", help="device center frequency (kHz)", metavar="FREQ", type="int")
parser.add_option("-f", "--channel-freq", dest="channel_freq", help="channel center frequency (Hz)", metavar="FREQ", type="int")
parser.add_option("-s", "--sample-rate", dest="sample_rate", help="host to device sample rate (kS/s)", metavar="RATE", type="int")
parser.add_option("-s", "--sample-rate", dest="sample_rate", help="host to device sample rate (S/s)", metavar="RATE", type="int")
parser.add_option("-l", "--log2-interp", dest="log2_interp", help="log2 of interpolation factor", metavar="RATE", type="int")
parser.add_option("-A", "--antenna-path", dest="antenna_path", help="antenna path number", metavar="NUMBER", type="int")
parser.add_option("-c", "--create", dest="create", help="create a new device set", metavar="CREATE", action="store_true", default=False)
@ -46,8 +47,11 @@ def getInputOptions():
options.channel_freq = 0
if options.sample_rate == None:
options.sample_rate = 2600
options.sample_rate = 2600000
if options.log2_interp == None:
options.log2_interp = 4
if options.antenna_path == None:
options.antenna_path = 1
@ -103,19 +107,19 @@ def setupDevice(options):
if options.device_hwid == "BladeRF":
settings['bladeRFOutputSettings']['centerFrequency'] = options.device_freq*1000
settings['bladeRFOutputSettings']['devSampleRate'] = options.sample_rate*1000
settings['bladeRFOutputSettings']['devSampleRate'] = options.sample_rate
settings['bladeRFOutputSettings']['vga1'] = -20
settings['bladeRFOutputSettings']['vga2'] = 6
settings['bladeRFOutputSettings']['bandwidth'] = 1500*1000
settings['bladeRFOutputSettings']['log2Interp'] = 4
settings['bladeRFOutputSettings']['log2Interp'] = options.log2_interp
settings['bladeRFOutputSettings']['xb200'] = 1 # assume XB200 is mounted
settings['bladeRFOutputSettings']['xb200Path'] = 1 if options.device_freq < 300000 else 0
settings['bladeRFOutputSettings']['xb200Filter'] = setupBladeRFXB200(options.device_freq)
elif options.device_hwid == "LimeSDR":
settings["limeSdrOutputSettings"]["antennaPath"] = options.antenna_path
settings["limeSdrOutputSettings"]["devSampleRate"] = options.sample_rate*1000
settings["limeSdrOutputSettings"]["devSampleRate"] = options.sample_rate
settings["limeSdrOutputSettings"]["log2HardInterp"] = 4
settings["limeSdrOutputSettings"]["log2SoftInterp"] = 4
settings["limeSdrOutputSettings"]["log2SoftInterp"] = options.log2_interp
settings["limeSdrOutputSettings"]["centerFrequency"] = options.device_freq*1000 + 500000
settings["limeSdrOutputSettings"]["ncoEnable"] = 1
settings["limeSdrOutputSettings"]["ncoFrequency"] = -500000
@ -125,9 +129,9 @@ def setupDevice(options):
elif options.device_hwid == "HackRF":
settings['hackRFOutputSettings']['LOppmTenths'] = -51
settings['hackRFOutputSettings']['centerFrequency'] = options.device_freq*1000
settings['hackRFOutputSettings']['devSampleRate'] = options.sample_rate*1000
settings['hackRFOutputSettings']['devSampleRate'] = options.sample_rate
settings['hackRFOutputSettings']['lnaExt'] = 0
settings['hackRFOutputSettings']['log2Interp'] = 4
settings['hackRFOutputSettings']['log2Interp'] = options.log2_interp
settings['hackRFOutputSettings']['vgaGain'] = 24
r = callAPI(deviceset_url + "/device/settings", "PATCH", None, settings, "Patch device settings")
@ -162,6 +166,19 @@ def setupChannel(options):
settings["AMModSettings"]["toneFrequency"] = 600
settings["AMModSettings"]["modFactor"] = 0.9
settings["AMModSettings"]["rfBandwidth"] = 7500
elif options.channel_id == "ATVMod":
settings["ATVModSettings"]["title"] = "Test ATV"
settings["ATVModSettings"]["inputFrequencyOffset"] = options.channel_freq
settings["ATVModSettings"]["rfBandwidth"] = 30000
settings["ATVModSettings"]["forceDecimator"] = 1 # This is to engage filter
settings["ATVModSettings"]["atvStd"] = 5 # ATVStdHSkip
settings["ATVModSettings"]["atvModInput"] = 1 # ATVModInputHBars
settings["ATVModSettings"]["atvModulation"] = 1 # ATVModulationFM
settings["ATVModSettings"]["fps"] = 2
settings["ATVModSettings"]["nbLines"] = 90
settings["ATVModSettings"]["uniformLevel"] = 1.0 # 100% white
settings["ATVModSettings"]["fmExcursion"] = 0.2 # FM excursion is 20% of channel bandwidth
settings["ATVModSettings"]["overlayText"] = "F4EXB"
elif options.channel_id == "SSBMod":
settings["SSBModSettings"]["title"] = "Test SSB"
settings["SSBModSettings"]["inputFrequencyOffset"] = options.channel_freq