1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-11 02:46:12 -05:00

Merge pull request #2181 from srcejon/freq_scanner

Frequency scanner: Add scan results to channel report. Add run action to API. Add HF ATC.
This commit is contained in:
Edouard Griffiths 2024-06-21 15:06:24 +02:00 committed by GitHub
commit 5070112c18
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
24 changed files with 717 additions and 7 deletions

View File

@ -31,6 +31,7 @@
#include "SWGWorkspaceInfo.h"
#include "SWGFreqScannerSettings.h"
#include "SWGChannelReport.h"
#include "SWGChannelActions.h"
#include "device/deviceset.h"
#include "dsp/dspengine.h"
@ -550,7 +551,9 @@ void FreqScanner::processScanResults(const QDateTime& fftStartTime, const QList<
setDeviceCenterFrequency(nextCenterFrequency);
}
if (complete) {
if (complete)
{
m_scanResultsForReport = m_scanResults;
m_scanResults.clear();
}
}
@ -815,6 +818,47 @@ int FreqScanner::webapiReportGet(
return 200;
}
int FreqScanner::webapiActionsPost(
const QStringList& channelActionsKeys,
SWGSDRangel::SWGChannelActions& query,
QString& errorMessage)
{
SWGSDRangel::SWGFreqScannerActions *swgFreqScannerActions = query.getFreqScannerActions();
if (swgFreqScannerActions)
{
if (channelActionsKeys.contains("run"))
{
bool run = swgFreqScannerActions->getRun() != 0;
if (run)
{
MsgStartScan *start = MsgStartScan::create();
if (getMessageQueueToGUI()) {
getMessageQueueToGUI()->push(start);
} else {
getInputMessageQueue()->push(start);
}
}
else
{
MsgStopScan *stop = MsgStopScan::create();
if (getMessageQueueToGUI()) {
getMessageQueueToGUI()->push(stop);
} else {
getInputMessageQueue()->push(stop);
}
}
}
return 202;
}
else
{
errorMessage = "Missing FreqScannerActions in query";
return 400;
}
}
void FreqScanner::webapiUpdateChannelSettings(
FreqScannerSettings& settings,
const QStringList& channelSettingsKeys,
@ -984,6 +1028,17 @@ void FreqScanner::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& r
void FreqScanner::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
{
response.getFreqScannerReport()->setChannelSampleRate(m_basebandSink->getChannelSampleRate());
response.getFreqScannerReport()->setScanState((int) m_state);
QList<SWGSDRangel::SWGFreqScannerChannelState *> *list = response.getFreqScannerReport()->getChannelState();
for (int i = 0; i < m_scanResultsForReport.size(); i++)
{
SWGSDRangel::SWGFreqScannerChannelState *channelState = new SWGSDRangel::SWGFreqScannerChannelState();
channelState->setFrequency(m_scanResultsForReport[i].m_frequency);
channelState->setPower(m_scanResultsForReport[i].m_power);
list->append(channelState);
}
}
void FreqScanner::webapiReverseSendSettings(const QStringList& channelSettingsKeys, const FreqScannerSettings& settings, bool force)

View File

@ -341,6 +341,11 @@ public:
SWGSDRangel::SWGChannelReport& response,
QString& errorMessage);
virtual int webapiActionsPost(
const QStringList& channelActionsKeys,
SWGSDRangel::SWGChannelActions& query,
QString& errorMessage);
static void webapiFormatChannelSettings(
SWGSDRangel::SWGChannelSettings& response,
const FreqScannerSettings& settings);
@ -388,6 +393,7 @@ private:
qint64 m_stepStartFrequency;
qint64 m_stepStopFrequency;
QList<MsgScanResult::ScanResult> m_scanResults;
QList<MsgScanResult::ScanResult> m_scanResultsForReport;
enum State {
IDLE,

View File

@ -91,6 +91,19 @@ void FreqScannerAddRangeDialog::accept()
};
m_frequencies.append(FRS_GMRSFreqs);
}
else if (ui->preset->currentText() == "HF ATC")
{
static const QList<qint64> hfFreqs = {
2872000, 2890000, 2899000, 2971000,
3016000, 3446000, 3476000, 3491000,
4675000, 5598000, 5616000, 5649000,
6547000, 6595000, 6622000, 6667000,
8831000, 8864000, 8879000, 8891000,
8906000, 10021000, 11336000, 13291000,
13306000, 17946000
};
m_frequencies.append(hfFreqs);
}
else
{
qint64 start = ui->start->getValue();
@ -151,6 +164,10 @@ void FreqScannerAddRangeDialog::on_preset_currentTextChanged(const QString& text
{
enableManAdjust = false;
}
else if (text == "HF ATC")
{
enableManAdjust = false;
}
ui->start->setEnabled(enableManAdjust);
ui->stop->setEnabled(enableManAdjust);
ui->step->setEnabled(enableManAdjust);

View File

@ -198,6 +198,11 @@
<string>FRS-GMRS</string>
</property>
</item>
<item>
<property name="text">
<string>HF ATC</string>
</property>
</item>
</widget>
</item>
<item row="0" column="0">
@ -232,7 +237,6 @@
</customwidgets>
<resources>
<include location="../../../sdrgui/resources/res.qrc"/>
<include location="../demodapt/icons.qrc"/>
</resources>
<connections>
<connection>

View File

@ -204,6 +204,16 @@ bool FreqScannerGUI::handleMessage(const Message& message)
return true;
}
else if (FreqScanner::MsgStartScan::match(message))
{
ui->startStop->doToggle(true);
return true;
}
else if (FreqScanner::MsgStopScan::match(message))
{
ui->startStop->doToggle(false);
return true;
}
return false;
}
@ -609,7 +619,7 @@ void FreqScannerGUI::enterEvent(EnterEventType* event)
ChannelGUI::enterEvent(event);
}
void FreqScannerGUI::on_startStop_clicked(bool checked)
void FreqScannerGUI::on_startStop_toggled(bool checked)
{
if (checked)
{
@ -1080,7 +1090,7 @@ void FreqScannerGUI::makeUIConnections()
QObject::connect(ui->priority, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &FreqScannerGUI::on_priority_currentIndexChanged);
QObject::connect(ui->measurement, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &FreqScannerGUI::on_measurement_currentIndexChanged);
QObject::connect(ui->mode, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &FreqScannerGUI::on_mode_currentIndexChanged);
QObject::connect(ui->startStop, &ButtonSwitch::clicked, this, &FreqScannerGUI::on_startStop_clicked);
QObject::connect(ui->startStop, &ButtonSwitch::toggled, this, &FreqScannerGUI::on_startStop_toggled);
QObject::connect(ui->table, &QTableWidget::cellChanged, this, &FreqScannerGUI::on_table_cellChanged);
QObject::connect(ui->addSingle, &QToolButton::clicked, this, &FreqScannerGUI::on_addSingle_clicked);
QObject::connect(ui->addRange, &QToolButton::clicked, this, &FreqScannerGUI::on_addRange_clicked);

View File

@ -140,7 +140,7 @@ private slots:
void table_sectionResized(int logicalIndex, int oldSize, int newSize);
void columnSelectMenu(QPoint pos);
void columnSelectMenuChecked(bool checked = false);
void on_startStop_clicked(bool checked = false);
void on_startStop_toggled(bool checked = false);
void on_addSingle_clicked();
void on_addRange_clicked();
void on_remove_clicked();

View File

@ -140,3 +140,15 @@ Moves the selected rows the the frequency table (14).
<h3>21: Clear Active Count</h3>
Press to reset the value in the Active Count column to 0 for all rows.
<h2>API</h2>
Full details of the API can be found in the Swagger documentation. Below are a few examples.
To run a frequency scan:
curl -X POST "http://127.0.0.1:8091/sdrangel/deviceset/0/channel/0/actions" -d '{ "channelType": "FreqScanner", "direction": 0, "originatorDeviceSetIndex": 0, "originatorChannelIndex": 0, "FreqScannerActions": { "run": 1 }}'
To get the results of the last scan:
curl -X GET "http://127.0.0.1:8091/sdrangel/deviceset/0/channel/0/report"

View File

@ -3598,6 +3598,9 @@ margin-bottom: 20px;
"FileSourceActions" : {
"$ref" : "#/definitions/FileSourceActions"
},
"FreqScannerActions" : {
"$ref" : "#/definitions/FreqScannerActions"
},
"IEEE_802_15_4_ModActions" : {
"$ref" : "#/definitions/IEEE_802_15_4_ModActions"
},
@ -7221,6 +7224,28 @@ margin-bottom: 20px;
}
},
"description" : "FreeDVMod"
};
defs.FreqScannerActions = {
"properties" : {
"run" : {
"type" : "integer",
"description" : "Set the plugin running state\n * 0 - idle\n * 1 - run\n"
}
},
"description" : "Frequency Scanner actions"
};
defs.FreqScannerChannelState = {
"properties" : {
"frequency" : {
"type" : "integer",
"description" : "Channel centre frequency in Hz"
},
"power" : {
"type" : "number",
"format" : "float",
"description" : "Channel power in dB"
}
}
};
defs.FreqScannerFrequency = {
"properties" : {
@ -7252,6 +7277,16 @@ margin-bottom: 20px;
"properties" : {
"channelSampleRate" : {
"type" : "integer"
},
"scanState" : {
"type" : "integer",
"description" : "(IDLE=0, START_SCAN=1, SCANNING=2, WAIT_FOR_END_TX=3, WAIT_FOR_RETRANSMISSION=4)"
},
"channelState" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/FreqScannerChannelState"
}
}
},
"description" : "FreqScanner"
@ -59084,7 +59119,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2024-06-18T10:11:11.522+02:00
Generated 2024-06-21T11:03:53.536+02:00
</div>
</div>
</div>

View File

@ -25,6 +25,8 @@ ChannelActions:
$ref: "/doc/swagger/include/FileSink.yaml#/FileSinkActions"
FileSourceActions:
$ref: "/doc/swagger/include/FileSource.yaml#/FileSourceActions"
FreqScannerActions:
$ref: "/doc/swagger/include/FreqScanner.yaml#/FreqScannerActions"
IEEE_802_15_4_ModActions:
$ref: "/doc/swagger/include/IEEE_802_15_4_Mod.yaml#/IEEE_802_15_4_ModActions"
PacketModActions:

View File

@ -59,6 +59,23 @@ FreqScannerReport:
properties:
channelSampleRate:
type: integer
scanState:
description: (IDLE=0, START_SCAN=1, SCANNING=2, WAIT_FOR_END_TX=3, WAIT_FOR_RETRANSMISSION=4)
type: integer
channelState:
type: array
items:
$ref: "/doc/swagger/include/FreqScanner.yaml#/FreqScannerChannelState"
FreqScannerChannelState:
properties:
frequency:
description: "Channel centre frequency in Hz"
type: integer
power:
description: "Channel power in dB"
type: number
format: float
FreqScannerFrequency:
properties:
@ -77,3 +94,13 @@ FreqScannerFrequency:
type: string
squelch:
type: string
FreqScannerActions:
description: "Frequency Scanner actions"
properties:
run:
type: integer
description: >
Set the plugin running state
* 0 - idle
* 1 - run

View File

@ -4821,6 +4821,11 @@ bool WebAPIRequestMapper::getChannelActions(
channelActions->setFileSourceActions(new SWGSDRangel::SWGFileSourceActions());
channelActions->getFileSourceActions()->fromJsonObject(actionsJsonObject);
}
else if (channelActionsKey == "FreqScannerActions")
{
channelActions->setFreqScannerActions(new SWGSDRangel::SWGFreqScannerActions());
channelActions->getFreqScannerActions()->fromJsonObject(actionsJsonObject);
}
else if (channelActionsKey == "IEEE_802_15_4_ModActions")
{
channelActions->setIeee802154ModActions(new SWGSDRangel::SWGIEEE_802_15_4_ModActions());
@ -5629,6 +5634,7 @@ void WebAPIRequestMapper::resetChannelActions(SWGSDRangel::SWGChannelActions& ch
channelActions.setAptDemodActions(nullptr);
channelActions.setChannelType(nullptr);
channelActions.setFileSourceActions(nullptr);
channelActions.setFreqScannerActions(nullptr);
channelActions.setIeee802154ModActions(nullptr);
channelActions.setPacketModActions(nullptr);
channelActions.setPsk31ModActions(nullptr);

View File

@ -216,6 +216,7 @@ const QMap<QString, QString> WebAPIUtils::m_channelTypeToActionsKey = {
{"APTDemod", "APTDemodActions"},
{"FileSink", "FileSinkActions"},
{"FileSource", "FileSourceActions"},
{"FreqScanner", "FreqScannerActions"},
{"SigMFFileSink", "SigMFFileSinkActions"},
{"IEEE_802_15_4_Mod", "IEEE_802_15_4_ModActions"},
{"RadioAstronomy", "RadioAstronomyActions"},

View File

@ -25,6 +25,8 @@ ChannelActions:
$ref: "http://swgserver:8081/api/swagger/include/FileSink.yaml#/FileSinkActions"
FileSourceActions:
$ref: "http://swgserver:8081/api/swagger/include/FileSource.yaml#/FileSourceActions"
FreqScannerActions:
$ref: "http://swgserver:8081/api/swagger/include/FreqScanner.yaml#/FreqScannerActions"
IEEE_802_15_4_ModActions:
$ref: "http://swgserver:8081/api/swagger/include/IEEE_802_15_4_Mod.yaml#/IEEE_802_15_4_ModActions"
PacketModActions:

View File

@ -59,6 +59,23 @@ FreqScannerReport:
properties:
channelSampleRate:
type: integer
scanState:
description: (IDLE=0, START_SCAN=1, SCANNING=2, WAIT_FOR_END_TX=3, WAIT_FOR_RETRANSMISSION=4)
type: integer
channelState:
type: array
items:
$ref: "http://swgserver:8081/api/swagger/include/FreqScanner.yaml#/FreqScannerChannelState"
FreqScannerChannelState:
properties:
frequency:
description: "Channel centre frequency in Hz"
type: integer
power:
description: "Channel power in dB"
type: number
format: float
FreqScannerFrequency:
properties:
@ -77,3 +94,13 @@ FreqScannerFrequency:
type: string
squelch:
type: string
FreqScannerActions:
description: "Frequency Scanner actions"
properties:
run:
type: integer
description: >
Set the plugin running state
* 0 - idle
* 1 - run

View File

@ -3598,6 +3598,9 @@ margin-bottom: 20px;
"FileSourceActions" : {
"$ref" : "#/definitions/FileSourceActions"
},
"FreqScannerActions" : {
"$ref" : "#/definitions/FreqScannerActions"
},
"IEEE_802_15_4_ModActions" : {
"$ref" : "#/definitions/IEEE_802_15_4_ModActions"
},
@ -7221,6 +7224,28 @@ margin-bottom: 20px;
}
},
"description" : "FreeDVMod"
};
defs.FreqScannerActions = {
"properties" : {
"run" : {
"type" : "integer",
"description" : "Set the plugin running state\n * 0 - idle\n * 1 - run\n"
}
},
"description" : "Frequency Scanner actions"
};
defs.FreqScannerChannelState = {
"properties" : {
"frequency" : {
"type" : "integer",
"description" : "Channel centre frequency in Hz"
},
"power" : {
"type" : "number",
"format" : "float",
"description" : "Channel power in dB"
}
}
};
defs.FreqScannerFrequency = {
"properties" : {
@ -7252,6 +7277,16 @@ margin-bottom: 20px;
"properties" : {
"channelSampleRate" : {
"type" : "integer"
},
"scanState" : {
"type" : "integer",
"description" : "(IDLE=0, START_SCAN=1, SCANNING=2, WAIT_FOR_END_TX=3, WAIT_FOR_RETRANSMISSION=4)"
},
"channelState" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/FreqScannerChannelState"
}
}
},
"description" : "FreqScanner"
@ -59084,7 +59119,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2024-06-18T10:11:11.522+02:00
Generated 2024-06-21T11:03:53.536+02:00
</div>
</div>
</div>

View File

@ -44,6 +44,8 @@ SWGChannelActions::SWGChannelActions() {
m_file_sink_actions_isSet = false;
file_source_actions = nullptr;
m_file_source_actions_isSet = false;
freq_scanner_actions = nullptr;
m_freq_scanner_actions_isSet = false;
ieee_802_15_4_mod_actions = nullptr;
m_ieee_802_15_4_mod_actions_isSet = false;
packet_mod_actions = nullptr;
@ -80,6 +82,8 @@ SWGChannelActions::init() {
m_file_sink_actions_isSet = false;
file_source_actions = new SWGFileSourceActions();
m_file_source_actions_isSet = false;
freq_scanner_actions = new SWGFreqScannerActions();
m_freq_scanner_actions_isSet = false;
ieee_802_15_4_mod_actions = new SWGIEEE_802_15_4_ModActions();
m_ieee_802_15_4_mod_actions_isSet = false;
packet_mod_actions = new SWGPacketModActions();
@ -114,6 +118,9 @@ SWGChannelActions::cleanup() {
if(file_source_actions != nullptr) {
delete file_source_actions;
}
if(freq_scanner_actions != nullptr) {
delete freq_scanner_actions;
}
if(ieee_802_15_4_mod_actions != nullptr) {
delete ieee_802_15_4_mod_actions;
}
@ -161,6 +168,8 @@ SWGChannelActions::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&file_source_actions, pJson["FileSourceActions"], "SWGFileSourceActions", "SWGFileSourceActions");
::SWGSDRangel::setValue(&freq_scanner_actions, pJson["FreqScannerActions"], "SWGFreqScannerActions", "SWGFreqScannerActions");
::SWGSDRangel::setValue(&ieee_802_15_4_mod_actions, pJson["IEEE_802_15_4_ModActions"], "SWGIEEE_802_15_4_ModActions", "SWGIEEE_802_15_4_ModActions");
::SWGSDRangel::setValue(&packet_mod_actions, pJson["PacketModActions"], "SWGPacketModActions", "SWGPacketModActions");
@ -213,6 +222,9 @@ SWGChannelActions::asJsonObject() {
if((file_source_actions != nullptr) && (file_source_actions->isSet())){
toJsonValue(QString("FileSourceActions"), file_source_actions, obj, QString("SWGFileSourceActions"));
}
if((freq_scanner_actions != nullptr) && (freq_scanner_actions->isSet())){
toJsonValue(QString("FreqScannerActions"), freq_scanner_actions, obj, QString("SWGFreqScannerActions"));
}
if((ieee_802_15_4_mod_actions != nullptr) && (ieee_802_15_4_mod_actions->isSet())){
toJsonValue(QString("IEEE_802_15_4_ModActions"), ieee_802_15_4_mod_actions, obj, QString("SWGIEEE_802_15_4_ModActions"));
}
@ -315,6 +327,16 @@ SWGChannelActions::setFileSourceActions(SWGFileSourceActions* file_source_action
this->m_file_source_actions_isSet = true;
}
SWGFreqScannerActions*
SWGChannelActions::getFreqScannerActions() {
return freq_scanner_actions;
}
void
SWGChannelActions::setFreqScannerActions(SWGFreqScannerActions* freq_scanner_actions) {
this->freq_scanner_actions = freq_scanner_actions;
this->m_freq_scanner_actions_isSet = true;
}
SWGIEEE_802_15_4_ModActions*
SWGChannelActions::getIeee802154ModActions() {
return ieee_802_15_4_mod_actions;
@ -404,6 +426,9 @@ SWGChannelActions::isSet(){
if(file_source_actions && file_source_actions->isSet()){
isObjectUpdated = true; break;
}
if(freq_scanner_actions && freq_scanner_actions->isSet()){
isObjectUpdated = true; break;
}
if(ieee_802_15_4_mod_actions && ieee_802_15_4_mod_actions->isSet()){
isObjectUpdated = true; break;
}

View File

@ -26,6 +26,7 @@
#include "SWGAPTDemodActions.h"
#include "SWGFileSinkActions.h"
#include "SWGFileSourceActions.h"
#include "SWGFreqScannerActions.h"
#include "SWGIEEE_802_15_4_ModActions.h"
#include "SWGPSK31ModActions.h"
#include "SWGPacketModActions.h"
@ -76,6 +77,9 @@ public:
SWGFileSourceActions* getFileSourceActions();
void setFileSourceActions(SWGFileSourceActions* file_source_actions);
SWGFreqScannerActions* getFreqScannerActions();
void setFreqScannerActions(SWGFreqScannerActions* freq_scanner_actions);
SWGIEEE_802_15_4_ModActions* getIeee802154ModActions();
void setIeee802154ModActions(SWGIEEE_802_15_4_ModActions* ieee_802_15_4_mod_actions);
@ -122,6 +126,9 @@ private:
SWGFileSourceActions* file_source_actions;
bool m_file_source_actions_isSet;
SWGFreqScannerActions* freq_scanner_actions;
bool m_freq_scanner_actions_isSet;
SWGIEEE_802_15_4_ModActions* ieee_802_15_4_mod_actions;
bool m_ieee_802_15_4_mod_actions_isSet;

View File

@ -0,0 +1,108 @@
/**
* 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. * 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 and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time ---
*
* OpenAPI spec version: 7.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 "SWGFreqScannerActions.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace SWGSDRangel {
SWGFreqScannerActions::SWGFreqScannerActions(QString* json) {
init();
this->fromJson(*json);
}
SWGFreqScannerActions::SWGFreqScannerActions() {
run = 0;
m_run_isSet = false;
}
SWGFreqScannerActions::~SWGFreqScannerActions() {
this->cleanup();
}
void
SWGFreqScannerActions::init() {
run = 0;
m_run_isSet = false;
}
void
SWGFreqScannerActions::cleanup() {
}
SWGFreqScannerActions*
SWGFreqScannerActions::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGFreqScannerActions::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&run, pJson["run"], "qint32", "");
}
QString
SWGFreqScannerActions::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
delete obj;
return QString(bytes);
}
QJsonObject*
SWGFreqScannerActions::asJsonObject() {
QJsonObject* obj = new QJsonObject();
if(m_run_isSet){
obj->insert("run", QJsonValue(run));
}
return obj;
}
qint32
SWGFreqScannerActions::getRun() {
return run;
}
void
SWGFreqScannerActions::setRun(qint32 run) {
this->run = run;
this->m_run_isSet = true;
}
bool
SWGFreqScannerActions::isSet(){
bool isObjectUpdated = false;
do{
if(m_run_isSet){
isObjectUpdated = true; break;
}
}while(false);
return isObjectUpdated;
}
}

View File

@ -0,0 +1,58 @@
/**
* 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. * 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 and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time ---
*
* OpenAPI spec version: 7.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.
*/
/*
* SWGFreqScannerActions.h
*
* Frequency Scanner actions
*/
#ifndef SWGFreqScannerActions_H_
#define SWGFreqScannerActions_H_
#include <QJsonObject>
#include "SWGObject.h"
#include "export.h"
namespace SWGSDRangel {
class SWG_API SWGFreqScannerActions: public SWGObject {
public:
SWGFreqScannerActions();
SWGFreqScannerActions(QString* json);
virtual ~SWGFreqScannerActions();
void init();
void cleanup();
virtual QString asJson () override;
virtual QJsonObject* asJsonObject() override;
virtual void fromJsonObject(QJsonObject &json) override;
virtual SWGFreqScannerActions* fromJson(QString &jsonString) override;
qint32 getRun();
void setRun(qint32 run);
virtual bool isSet() override;
private:
qint32 run;
bool m_run_isSet;
};
}
#endif /* SWGFreqScannerActions_H_ */

View File

@ -0,0 +1,131 @@
/**
* 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. * 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 and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time ---
*
* OpenAPI spec version: 7.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 "SWGFreqScannerChannelState.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace SWGSDRangel {
SWGFreqScannerChannelState::SWGFreqScannerChannelState(QString* json) {
init();
this->fromJson(*json);
}
SWGFreqScannerChannelState::SWGFreqScannerChannelState() {
frequency = 0;
m_frequency_isSet = false;
power = 0.0f;
m_power_isSet = false;
}
SWGFreqScannerChannelState::~SWGFreqScannerChannelState() {
this->cleanup();
}
void
SWGFreqScannerChannelState::init() {
frequency = 0;
m_frequency_isSet = false;
power = 0.0f;
m_power_isSet = false;
}
void
SWGFreqScannerChannelState::cleanup() {
}
SWGFreqScannerChannelState*
SWGFreqScannerChannelState::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGFreqScannerChannelState::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&frequency, pJson["frequency"], "qint32", "");
::SWGSDRangel::setValue(&power, pJson["power"], "float", "");
}
QString
SWGFreqScannerChannelState::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
delete obj;
return QString(bytes);
}
QJsonObject*
SWGFreqScannerChannelState::asJsonObject() {
QJsonObject* obj = new QJsonObject();
if(m_frequency_isSet){
obj->insert("frequency", QJsonValue(frequency));
}
if(m_power_isSet){
obj->insert("power", QJsonValue(power));
}
return obj;
}
qint32
SWGFreqScannerChannelState::getFrequency() {
return frequency;
}
void
SWGFreqScannerChannelState::setFrequency(qint32 frequency) {
this->frequency = frequency;
this->m_frequency_isSet = true;
}
float
SWGFreqScannerChannelState::getPower() {
return power;
}
void
SWGFreqScannerChannelState::setPower(float power) {
this->power = power;
this->m_power_isSet = true;
}
bool
SWGFreqScannerChannelState::isSet(){
bool isObjectUpdated = false;
do{
if(m_frequency_isSet){
isObjectUpdated = true; break;
}
if(m_power_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. * 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 and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time ---
*
* OpenAPI spec version: 7.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.
*/
/*
* SWGFreqScannerChannelState.h
*
*
*/
#ifndef SWGFreqScannerChannelState_H_
#define SWGFreqScannerChannelState_H_
#include <QJsonObject>
#include "SWGObject.h"
#include "export.h"
namespace SWGSDRangel {
class SWG_API SWGFreqScannerChannelState: public SWGObject {
public:
SWGFreqScannerChannelState();
SWGFreqScannerChannelState(QString* json);
virtual ~SWGFreqScannerChannelState();
void init();
void cleanup();
virtual QString asJson () override;
virtual QJsonObject* asJsonObject() override;
virtual void fromJsonObject(QJsonObject &json) override;
virtual SWGFreqScannerChannelState* fromJson(QString &jsonString) override;
qint32 getFrequency();
void setFrequency(qint32 frequency);
float getPower();
void setPower(float power);
virtual bool isSet() override;
private:
qint32 frequency;
bool m_frequency_isSet;
float power;
bool m_power_isSet;
};
}
#endif /* SWGFreqScannerChannelState_H_ */

View File

@ -30,6 +30,10 @@ SWGFreqScannerReport::SWGFreqScannerReport(QString* json) {
SWGFreqScannerReport::SWGFreqScannerReport() {
channel_sample_rate = 0;
m_channel_sample_rate_isSet = false;
scan_state = 0;
m_scan_state_isSet = false;
channel_state = nullptr;
m_channel_state_isSet = false;
}
SWGFreqScannerReport::~SWGFreqScannerReport() {
@ -40,11 +44,23 @@ void
SWGFreqScannerReport::init() {
channel_sample_rate = 0;
m_channel_sample_rate_isSet = false;
scan_state = 0;
m_scan_state_isSet = false;
channel_state = new QList<SWGFreqScannerChannelState*>();
m_channel_state_isSet = false;
}
void
SWGFreqScannerReport::cleanup() {
if(channel_state != nullptr) {
auto arr = channel_state;
for(auto o: *arr) {
delete o;
}
delete channel_state;
}
}
SWGFreqScannerReport*
@ -60,6 +76,10 @@ void
SWGFreqScannerReport::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&channel_sample_rate, pJson["channelSampleRate"], "qint32", "");
::SWGSDRangel::setValue(&scan_state, pJson["scanState"], "qint32", "");
::SWGSDRangel::setValue(&channel_state, pJson["channelState"], "QList", "SWGFreqScannerChannelState");
}
QString
@ -79,6 +99,12 @@ SWGFreqScannerReport::asJsonObject() {
if(m_channel_sample_rate_isSet){
obj->insert("channelSampleRate", QJsonValue(channel_sample_rate));
}
if(m_scan_state_isSet){
obj->insert("scanState", QJsonValue(scan_state));
}
if(channel_state && channel_state->size() > 0){
toJsonArray((QList<void*>*)channel_state, obj, "channelState", "SWGFreqScannerChannelState");
}
return obj;
}
@ -93,6 +119,26 @@ SWGFreqScannerReport::setChannelSampleRate(qint32 channel_sample_rate) {
this->m_channel_sample_rate_isSet = true;
}
qint32
SWGFreqScannerReport::getScanState() {
return scan_state;
}
void
SWGFreqScannerReport::setScanState(qint32 scan_state) {
this->scan_state = scan_state;
this->m_scan_state_isSet = true;
}
QList<SWGFreqScannerChannelState*>*
SWGFreqScannerReport::getChannelState() {
return channel_state;
}
void
SWGFreqScannerReport::setChannelState(QList<SWGFreqScannerChannelState*>* channel_state) {
this->channel_state = channel_state;
this->m_channel_state_isSet = true;
}
bool
SWGFreqScannerReport::isSet(){
@ -101,6 +147,12 @@ SWGFreqScannerReport::isSet(){
if(m_channel_sample_rate_isSet){
isObjectUpdated = true; break;
}
if(m_scan_state_isSet){
isObjectUpdated = true; break;
}
if(channel_state && (channel_state->size() > 0)){
isObjectUpdated = true; break;
}
}while(false);
return isObjectUpdated;
}

View File

@ -22,6 +22,8 @@
#include <QJsonObject>
#include "SWGFreqScannerChannelState.h"
#include <QList>
#include "SWGObject.h"
#include "export.h"
@ -44,6 +46,12 @@ public:
qint32 getChannelSampleRate();
void setChannelSampleRate(qint32 channel_sample_rate);
qint32 getScanState();
void setScanState(qint32 scan_state);
QList<SWGFreqScannerChannelState*>* getChannelState();
void setChannelState(QList<SWGFreqScannerChannelState*>* channel_state);
virtual bool isSet() override;
@ -51,6 +59,12 @@ private:
qint32 channel_sample_rate;
bool m_channel_sample_rate_isSet;
qint32 scan_state;
bool m_scan_state_isSet;
QList<SWGFreqScannerChannelState*>* channel_state;
bool m_channel_state_isSet;
};
}

View File

@ -157,6 +157,8 @@
#include "SWGFreeDVDemodSettings.h"
#include "SWGFreeDVModReport.h"
#include "SWGFreeDVModSettings.h"
#include "SWGFreqScannerActions.h"
#include "SWGFreqScannerChannelState.h"
#include "SWGFreqScannerFrequency.h"
#include "SWGFreqScannerReport.h"
#include "SWGFreqScannerSettings.h"
@ -1102,6 +1104,16 @@ namespace SWGSDRangel {
obj->init();
return obj;
}
if(QString("SWGFreqScannerActions").compare(type) == 0) {
SWGFreqScannerActions *obj = new SWGFreqScannerActions();
obj->init();
return obj;
}
if(QString("SWGFreqScannerChannelState").compare(type) == 0) {
SWGFreqScannerChannelState *obj = new SWGFreqScannerChannelState();
obj->init();
return obj;
}
if(QString("SWGFreqScannerFrequency").compare(type) == 0) {
SWGFreqScannerFrequency *obj = new SWGFreqScannerFrequency();
obj->init();