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:
commit
5070112c18
@ -31,6 +31,7 @@
|
|||||||
#include "SWGWorkspaceInfo.h"
|
#include "SWGWorkspaceInfo.h"
|
||||||
#include "SWGFreqScannerSettings.h"
|
#include "SWGFreqScannerSettings.h"
|
||||||
#include "SWGChannelReport.h"
|
#include "SWGChannelReport.h"
|
||||||
|
#include "SWGChannelActions.h"
|
||||||
|
|
||||||
#include "device/deviceset.h"
|
#include "device/deviceset.h"
|
||||||
#include "dsp/dspengine.h"
|
#include "dsp/dspengine.h"
|
||||||
@ -550,7 +551,9 @@ void FreqScanner::processScanResults(const QDateTime& fftStartTime, const QList<
|
|||||||
setDeviceCenterFrequency(nextCenterFrequency);
|
setDeviceCenterFrequency(nextCenterFrequency);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (complete) {
|
if (complete)
|
||||||
|
{
|
||||||
|
m_scanResultsForReport = m_scanResults;
|
||||||
m_scanResults.clear();
|
m_scanResults.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -815,6 +818,47 @@ int FreqScanner::webapiReportGet(
|
|||||||
return 200;
|
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(
|
void FreqScanner::webapiUpdateChannelSettings(
|
||||||
FreqScannerSettings& settings,
|
FreqScannerSettings& settings,
|
||||||
const QStringList& channelSettingsKeys,
|
const QStringList& channelSettingsKeys,
|
||||||
@ -984,6 +1028,17 @@ void FreqScanner::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& r
|
|||||||
void FreqScanner::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
|
void FreqScanner::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
|
||||||
{
|
{
|
||||||
response.getFreqScannerReport()->setChannelSampleRate(m_basebandSink->getChannelSampleRate());
|
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)
|
void FreqScanner::webapiReverseSendSettings(const QStringList& channelSettingsKeys, const FreqScannerSettings& settings, bool force)
|
||||||
|
@ -341,6 +341,11 @@ public:
|
|||||||
SWGSDRangel::SWGChannelReport& response,
|
SWGSDRangel::SWGChannelReport& response,
|
||||||
QString& errorMessage);
|
QString& errorMessage);
|
||||||
|
|
||||||
|
virtual int webapiActionsPost(
|
||||||
|
const QStringList& channelActionsKeys,
|
||||||
|
SWGSDRangel::SWGChannelActions& query,
|
||||||
|
QString& errorMessage);
|
||||||
|
|
||||||
static void webapiFormatChannelSettings(
|
static void webapiFormatChannelSettings(
|
||||||
SWGSDRangel::SWGChannelSettings& response,
|
SWGSDRangel::SWGChannelSettings& response,
|
||||||
const FreqScannerSettings& settings);
|
const FreqScannerSettings& settings);
|
||||||
@ -388,6 +393,7 @@ private:
|
|||||||
qint64 m_stepStartFrequency;
|
qint64 m_stepStartFrequency;
|
||||||
qint64 m_stepStopFrequency;
|
qint64 m_stepStopFrequency;
|
||||||
QList<MsgScanResult::ScanResult> m_scanResults;
|
QList<MsgScanResult::ScanResult> m_scanResults;
|
||||||
|
QList<MsgScanResult::ScanResult> m_scanResultsForReport;
|
||||||
|
|
||||||
enum State {
|
enum State {
|
||||||
IDLE,
|
IDLE,
|
||||||
|
@ -91,6 +91,19 @@ void FreqScannerAddRangeDialog::accept()
|
|||||||
};
|
};
|
||||||
m_frequencies.append(FRS_GMRSFreqs);
|
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
|
else
|
||||||
{
|
{
|
||||||
qint64 start = ui->start->getValue();
|
qint64 start = ui->start->getValue();
|
||||||
@ -151,6 +164,10 @@ void FreqScannerAddRangeDialog::on_preset_currentTextChanged(const QString& text
|
|||||||
{
|
{
|
||||||
enableManAdjust = false;
|
enableManAdjust = false;
|
||||||
}
|
}
|
||||||
|
else if (text == "HF ATC")
|
||||||
|
{
|
||||||
|
enableManAdjust = false;
|
||||||
|
}
|
||||||
ui->start->setEnabled(enableManAdjust);
|
ui->start->setEnabled(enableManAdjust);
|
||||||
ui->stop->setEnabled(enableManAdjust);
|
ui->stop->setEnabled(enableManAdjust);
|
||||||
ui->step->setEnabled(enableManAdjust);
|
ui->step->setEnabled(enableManAdjust);
|
||||||
|
@ -198,6 +198,11 @@
|
|||||||
<string>FRS-GMRS</string>
|
<string>FRS-GMRS</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>HF ATC</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
@ -232,7 +237,6 @@
|
|||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../../../sdrgui/resources/res.qrc"/>
|
<include location="../../../sdrgui/resources/res.qrc"/>
|
||||||
<include location="../demodapt/icons.qrc"/>
|
|
||||||
</resources>
|
</resources>
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
|
@ -204,6 +204,16 @@ bool FreqScannerGUI::handleMessage(const Message& message)
|
|||||||
|
|
||||||
return true;
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -609,7 +619,7 @@ void FreqScannerGUI::enterEvent(EnterEventType* event)
|
|||||||
ChannelGUI::enterEvent(event);
|
ChannelGUI::enterEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FreqScannerGUI::on_startStop_clicked(bool checked)
|
void FreqScannerGUI::on_startStop_toggled(bool checked)
|
||||||
{
|
{
|
||||||
if (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->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->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->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->table, &QTableWidget::cellChanged, this, &FreqScannerGUI::on_table_cellChanged);
|
||||||
QObject::connect(ui->addSingle, &QToolButton::clicked, this, &FreqScannerGUI::on_addSingle_clicked);
|
QObject::connect(ui->addSingle, &QToolButton::clicked, this, &FreqScannerGUI::on_addSingle_clicked);
|
||||||
QObject::connect(ui->addRange, &QToolButton::clicked, this, &FreqScannerGUI::on_addRange_clicked);
|
QObject::connect(ui->addRange, &QToolButton::clicked, this, &FreqScannerGUI::on_addRange_clicked);
|
||||||
|
@ -140,7 +140,7 @@ private slots:
|
|||||||
void table_sectionResized(int logicalIndex, int oldSize, int newSize);
|
void table_sectionResized(int logicalIndex, int oldSize, int newSize);
|
||||||
void columnSelectMenu(QPoint pos);
|
void columnSelectMenu(QPoint pos);
|
||||||
void columnSelectMenuChecked(bool checked = false);
|
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_addSingle_clicked();
|
||||||
void on_addRange_clicked();
|
void on_addRange_clicked();
|
||||||
void on_remove_clicked();
|
void on_remove_clicked();
|
||||||
|
@ -140,3 +140,15 @@ Moves the selected rows the the frequency table (14).
|
|||||||
<h3>21: Clear Active Count</h3>
|
<h3>21: Clear Active Count</h3>
|
||||||
|
|
||||||
Press to reset the value in the Active Count column to 0 for all rows.
|
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"
|
||||||
|
@ -3598,6 +3598,9 @@ margin-bottom: 20px;
|
|||||||
"FileSourceActions" : {
|
"FileSourceActions" : {
|
||||||
"$ref" : "#/definitions/FileSourceActions"
|
"$ref" : "#/definitions/FileSourceActions"
|
||||||
},
|
},
|
||||||
|
"FreqScannerActions" : {
|
||||||
|
"$ref" : "#/definitions/FreqScannerActions"
|
||||||
|
},
|
||||||
"IEEE_802_15_4_ModActions" : {
|
"IEEE_802_15_4_ModActions" : {
|
||||||
"$ref" : "#/definitions/IEEE_802_15_4_ModActions"
|
"$ref" : "#/definitions/IEEE_802_15_4_ModActions"
|
||||||
},
|
},
|
||||||
@ -7221,6 +7224,28 @@ margin-bottom: 20px;
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"description" : "FreeDVMod"
|
"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 = {
|
defs.FreqScannerFrequency = {
|
||||||
"properties" : {
|
"properties" : {
|
||||||
@ -7252,6 +7277,16 @@ margin-bottom: 20px;
|
|||||||
"properties" : {
|
"properties" : {
|
||||||
"channelSampleRate" : {
|
"channelSampleRate" : {
|
||||||
"type" : "integer"
|
"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"
|
"description" : "FreqScanner"
|
||||||
@ -59084,7 +59119,7 @@ except ApiException as e:
|
|||||||
</div>
|
</div>
|
||||||
<div id="generator">
|
<div id="generator">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
Generated 2024-06-18T10:11:11.522+02:00
|
Generated 2024-06-21T11:03:53.536+02:00
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -25,6 +25,8 @@ ChannelActions:
|
|||||||
$ref: "/doc/swagger/include/FileSink.yaml#/FileSinkActions"
|
$ref: "/doc/swagger/include/FileSink.yaml#/FileSinkActions"
|
||||||
FileSourceActions:
|
FileSourceActions:
|
||||||
$ref: "/doc/swagger/include/FileSource.yaml#/FileSourceActions"
|
$ref: "/doc/swagger/include/FileSource.yaml#/FileSourceActions"
|
||||||
|
FreqScannerActions:
|
||||||
|
$ref: "/doc/swagger/include/FreqScanner.yaml#/FreqScannerActions"
|
||||||
IEEE_802_15_4_ModActions:
|
IEEE_802_15_4_ModActions:
|
||||||
$ref: "/doc/swagger/include/IEEE_802_15_4_Mod.yaml#/IEEE_802_15_4_ModActions"
|
$ref: "/doc/swagger/include/IEEE_802_15_4_Mod.yaml#/IEEE_802_15_4_ModActions"
|
||||||
PacketModActions:
|
PacketModActions:
|
||||||
|
@ -59,6 +59,23 @@ FreqScannerReport:
|
|||||||
properties:
|
properties:
|
||||||
channelSampleRate:
|
channelSampleRate:
|
||||||
type: integer
|
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:
|
FreqScannerFrequency:
|
||||||
properties:
|
properties:
|
||||||
@ -77,3 +94,13 @@ FreqScannerFrequency:
|
|||||||
type: string
|
type: string
|
||||||
squelch:
|
squelch:
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
|
FreqScannerActions:
|
||||||
|
description: "Frequency Scanner actions"
|
||||||
|
properties:
|
||||||
|
run:
|
||||||
|
type: integer
|
||||||
|
description: >
|
||||||
|
Set the plugin running state
|
||||||
|
* 0 - idle
|
||||||
|
* 1 - run
|
||||||
|
@ -4821,6 +4821,11 @@ bool WebAPIRequestMapper::getChannelActions(
|
|||||||
channelActions->setFileSourceActions(new SWGSDRangel::SWGFileSourceActions());
|
channelActions->setFileSourceActions(new SWGSDRangel::SWGFileSourceActions());
|
||||||
channelActions->getFileSourceActions()->fromJsonObject(actionsJsonObject);
|
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")
|
else if (channelActionsKey == "IEEE_802_15_4_ModActions")
|
||||||
{
|
{
|
||||||
channelActions->setIeee802154ModActions(new SWGSDRangel::SWGIEEE_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.setAptDemodActions(nullptr);
|
||||||
channelActions.setChannelType(nullptr);
|
channelActions.setChannelType(nullptr);
|
||||||
channelActions.setFileSourceActions(nullptr);
|
channelActions.setFileSourceActions(nullptr);
|
||||||
|
channelActions.setFreqScannerActions(nullptr);
|
||||||
channelActions.setIeee802154ModActions(nullptr);
|
channelActions.setIeee802154ModActions(nullptr);
|
||||||
channelActions.setPacketModActions(nullptr);
|
channelActions.setPacketModActions(nullptr);
|
||||||
channelActions.setPsk31ModActions(nullptr);
|
channelActions.setPsk31ModActions(nullptr);
|
||||||
|
@ -216,6 +216,7 @@ const QMap<QString, QString> WebAPIUtils::m_channelTypeToActionsKey = {
|
|||||||
{"APTDemod", "APTDemodActions"},
|
{"APTDemod", "APTDemodActions"},
|
||||||
{"FileSink", "FileSinkActions"},
|
{"FileSink", "FileSinkActions"},
|
||||||
{"FileSource", "FileSourceActions"},
|
{"FileSource", "FileSourceActions"},
|
||||||
|
{"FreqScanner", "FreqScannerActions"},
|
||||||
{"SigMFFileSink", "SigMFFileSinkActions"},
|
{"SigMFFileSink", "SigMFFileSinkActions"},
|
||||||
{"IEEE_802_15_4_Mod", "IEEE_802_15_4_ModActions"},
|
{"IEEE_802_15_4_Mod", "IEEE_802_15_4_ModActions"},
|
||||||
{"RadioAstronomy", "RadioAstronomyActions"},
|
{"RadioAstronomy", "RadioAstronomyActions"},
|
||||||
|
@ -25,6 +25,8 @@ ChannelActions:
|
|||||||
$ref: "http://swgserver:8081/api/swagger/include/FileSink.yaml#/FileSinkActions"
|
$ref: "http://swgserver:8081/api/swagger/include/FileSink.yaml#/FileSinkActions"
|
||||||
FileSourceActions:
|
FileSourceActions:
|
||||||
$ref: "http://swgserver:8081/api/swagger/include/FileSource.yaml#/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:
|
IEEE_802_15_4_ModActions:
|
||||||
$ref: "http://swgserver:8081/api/swagger/include/IEEE_802_15_4_Mod.yaml#/IEEE_802_15_4_ModActions"
|
$ref: "http://swgserver:8081/api/swagger/include/IEEE_802_15_4_Mod.yaml#/IEEE_802_15_4_ModActions"
|
||||||
PacketModActions:
|
PacketModActions:
|
||||||
|
@ -59,6 +59,23 @@ FreqScannerReport:
|
|||||||
properties:
|
properties:
|
||||||
channelSampleRate:
|
channelSampleRate:
|
||||||
type: integer
|
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:
|
FreqScannerFrequency:
|
||||||
properties:
|
properties:
|
||||||
@ -77,3 +94,13 @@ FreqScannerFrequency:
|
|||||||
type: string
|
type: string
|
||||||
squelch:
|
squelch:
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
|
FreqScannerActions:
|
||||||
|
description: "Frequency Scanner actions"
|
||||||
|
properties:
|
||||||
|
run:
|
||||||
|
type: integer
|
||||||
|
description: >
|
||||||
|
Set the plugin running state
|
||||||
|
* 0 - idle
|
||||||
|
* 1 - run
|
||||||
|
@ -3598,6 +3598,9 @@ margin-bottom: 20px;
|
|||||||
"FileSourceActions" : {
|
"FileSourceActions" : {
|
||||||
"$ref" : "#/definitions/FileSourceActions"
|
"$ref" : "#/definitions/FileSourceActions"
|
||||||
},
|
},
|
||||||
|
"FreqScannerActions" : {
|
||||||
|
"$ref" : "#/definitions/FreqScannerActions"
|
||||||
|
},
|
||||||
"IEEE_802_15_4_ModActions" : {
|
"IEEE_802_15_4_ModActions" : {
|
||||||
"$ref" : "#/definitions/IEEE_802_15_4_ModActions"
|
"$ref" : "#/definitions/IEEE_802_15_4_ModActions"
|
||||||
},
|
},
|
||||||
@ -7221,6 +7224,28 @@ margin-bottom: 20px;
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"description" : "FreeDVMod"
|
"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 = {
|
defs.FreqScannerFrequency = {
|
||||||
"properties" : {
|
"properties" : {
|
||||||
@ -7252,6 +7277,16 @@ margin-bottom: 20px;
|
|||||||
"properties" : {
|
"properties" : {
|
||||||
"channelSampleRate" : {
|
"channelSampleRate" : {
|
||||||
"type" : "integer"
|
"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"
|
"description" : "FreqScanner"
|
||||||
@ -59084,7 +59119,7 @@ except ApiException as e:
|
|||||||
</div>
|
</div>
|
||||||
<div id="generator">
|
<div id="generator">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
Generated 2024-06-18T10:11:11.522+02:00
|
Generated 2024-06-21T11:03:53.536+02:00
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -44,6 +44,8 @@ SWGChannelActions::SWGChannelActions() {
|
|||||||
m_file_sink_actions_isSet = false;
|
m_file_sink_actions_isSet = false;
|
||||||
file_source_actions = nullptr;
|
file_source_actions = nullptr;
|
||||||
m_file_source_actions_isSet = false;
|
m_file_source_actions_isSet = false;
|
||||||
|
freq_scanner_actions = nullptr;
|
||||||
|
m_freq_scanner_actions_isSet = false;
|
||||||
ieee_802_15_4_mod_actions = nullptr;
|
ieee_802_15_4_mod_actions = nullptr;
|
||||||
m_ieee_802_15_4_mod_actions_isSet = false;
|
m_ieee_802_15_4_mod_actions_isSet = false;
|
||||||
packet_mod_actions = nullptr;
|
packet_mod_actions = nullptr;
|
||||||
@ -80,6 +82,8 @@ SWGChannelActions::init() {
|
|||||||
m_file_sink_actions_isSet = false;
|
m_file_sink_actions_isSet = false;
|
||||||
file_source_actions = new SWGFileSourceActions();
|
file_source_actions = new SWGFileSourceActions();
|
||||||
m_file_source_actions_isSet = false;
|
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();
|
ieee_802_15_4_mod_actions = new SWGIEEE_802_15_4_ModActions();
|
||||||
m_ieee_802_15_4_mod_actions_isSet = false;
|
m_ieee_802_15_4_mod_actions_isSet = false;
|
||||||
packet_mod_actions = new SWGPacketModActions();
|
packet_mod_actions = new SWGPacketModActions();
|
||||||
@ -114,6 +118,9 @@ SWGChannelActions::cleanup() {
|
|||||||
if(file_source_actions != nullptr) {
|
if(file_source_actions != nullptr) {
|
||||||
delete file_source_actions;
|
delete file_source_actions;
|
||||||
}
|
}
|
||||||
|
if(freq_scanner_actions != nullptr) {
|
||||||
|
delete freq_scanner_actions;
|
||||||
|
}
|
||||||
if(ieee_802_15_4_mod_actions != nullptr) {
|
if(ieee_802_15_4_mod_actions != nullptr) {
|
||||||
delete ieee_802_15_4_mod_actions;
|
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(&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(&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");
|
::SWGSDRangel::setValue(&packet_mod_actions, pJson["PacketModActions"], "SWGPacketModActions", "SWGPacketModActions");
|
||||||
@ -213,6 +222,9 @@ SWGChannelActions::asJsonObject() {
|
|||||||
if((file_source_actions != nullptr) && (file_source_actions->isSet())){
|
if((file_source_actions != nullptr) && (file_source_actions->isSet())){
|
||||||
toJsonValue(QString("FileSourceActions"), file_source_actions, obj, QString("SWGFileSourceActions"));
|
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())){
|
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"));
|
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;
|
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*
|
SWGIEEE_802_15_4_ModActions*
|
||||||
SWGChannelActions::getIeee802154ModActions() {
|
SWGChannelActions::getIeee802154ModActions() {
|
||||||
return ieee_802_15_4_mod_actions;
|
return ieee_802_15_4_mod_actions;
|
||||||
@ -404,6 +426,9 @@ SWGChannelActions::isSet(){
|
|||||||
if(file_source_actions && file_source_actions->isSet()){
|
if(file_source_actions && file_source_actions->isSet()){
|
||||||
isObjectUpdated = true; break;
|
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()){
|
if(ieee_802_15_4_mod_actions && ieee_802_15_4_mod_actions->isSet()){
|
||||||
isObjectUpdated = true; break;
|
isObjectUpdated = true; break;
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include "SWGAPTDemodActions.h"
|
#include "SWGAPTDemodActions.h"
|
||||||
#include "SWGFileSinkActions.h"
|
#include "SWGFileSinkActions.h"
|
||||||
#include "SWGFileSourceActions.h"
|
#include "SWGFileSourceActions.h"
|
||||||
|
#include "SWGFreqScannerActions.h"
|
||||||
#include "SWGIEEE_802_15_4_ModActions.h"
|
#include "SWGIEEE_802_15_4_ModActions.h"
|
||||||
#include "SWGPSK31ModActions.h"
|
#include "SWGPSK31ModActions.h"
|
||||||
#include "SWGPacketModActions.h"
|
#include "SWGPacketModActions.h"
|
||||||
@ -76,6 +77,9 @@ public:
|
|||||||
SWGFileSourceActions* getFileSourceActions();
|
SWGFileSourceActions* getFileSourceActions();
|
||||||
void setFileSourceActions(SWGFileSourceActions* file_source_actions);
|
void setFileSourceActions(SWGFileSourceActions* file_source_actions);
|
||||||
|
|
||||||
|
SWGFreqScannerActions* getFreqScannerActions();
|
||||||
|
void setFreqScannerActions(SWGFreqScannerActions* freq_scanner_actions);
|
||||||
|
|
||||||
SWGIEEE_802_15_4_ModActions* getIeee802154ModActions();
|
SWGIEEE_802_15_4_ModActions* getIeee802154ModActions();
|
||||||
void setIeee802154ModActions(SWGIEEE_802_15_4_ModActions* ieee_802_15_4_mod_actions);
|
void setIeee802154ModActions(SWGIEEE_802_15_4_ModActions* ieee_802_15_4_mod_actions);
|
||||||
|
|
||||||
@ -122,6 +126,9 @@ private:
|
|||||||
SWGFileSourceActions* file_source_actions;
|
SWGFileSourceActions* file_source_actions;
|
||||||
bool m_file_source_actions_isSet;
|
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;
|
SWGIEEE_802_15_4_ModActions* ieee_802_15_4_mod_actions;
|
||||||
bool m_ieee_802_15_4_mod_actions_isSet;
|
bool m_ieee_802_15_4_mod_actions_isSet;
|
||||||
|
|
||||||
|
108
swagger/sdrangel/code/qt5/client/SWGFreqScannerActions.cpp
Normal file
108
swagger/sdrangel/code/qt5/client/SWGFreqScannerActions.cpp
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
58
swagger/sdrangel/code/qt5/client/SWGFreqScannerActions.h
Normal file
58
swagger/sdrangel/code/qt5/client/SWGFreqScannerActions.h
Normal 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_ */
|
131
swagger/sdrangel/code/qt5/client/SWGFreqScannerChannelState.cpp
Normal file
131
swagger/sdrangel/code/qt5/client/SWGFreqScannerChannelState.cpp
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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_ */
|
@ -30,6 +30,10 @@ SWGFreqScannerReport::SWGFreqScannerReport(QString* json) {
|
|||||||
SWGFreqScannerReport::SWGFreqScannerReport() {
|
SWGFreqScannerReport::SWGFreqScannerReport() {
|
||||||
channel_sample_rate = 0;
|
channel_sample_rate = 0;
|
||||||
m_channel_sample_rate_isSet = false;
|
m_channel_sample_rate_isSet = false;
|
||||||
|
scan_state = 0;
|
||||||
|
m_scan_state_isSet = false;
|
||||||
|
channel_state = nullptr;
|
||||||
|
m_channel_state_isSet = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
SWGFreqScannerReport::~SWGFreqScannerReport() {
|
SWGFreqScannerReport::~SWGFreqScannerReport() {
|
||||||
@ -40,11 +44,23 @@ void
|
|||||||
SWGFreqScannerReport::init() {
|
SWGFreqScannerReport::init() {
|
||||||
channel_sample_rate = 0;
|
channel_sample_rate = 0;
|
||||||
m_channel_sample_rate_isSet = false;
|
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
|
void
|
||||||
SWGFreqScannerReport::cleanup() {
|
SWGFreqScannerReport::cleanup() {
|
||||||
|
|
||||||
|
|
||||||
|
if(channel_state != nullptr) {
|
||||||
|
auto arr = channel_state;
|
||||||
|
for(auto o: *arr) {
|
||||||
|
delete o;
|
||||||
|
}
|
||||||
|
delete channel_state;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SWGFreqScannerReport*
|
SWGFreqScannerReport*
|
||||||
@ -60,6 +76,10 @@ void
|
|||||||
SWGFreqScannerReport::fromJsonObject(QJsonObject &pJson) {
|
SWGFreqScannerReport::fromJsonObject(QJsonObject &pJson) {
|
||||||
::SWGSDRangel::setValue(&channel_sample_rate, pJson["channelSampleRate"], "qint32", "");
|
::SWGSDRangel::setValue(&channel_sample_rate, pJson["channelSampleRate"], "qint32", "");
|
||||||
|
|
||||||
|
::SWGSDRangel::setValue(&scan_state, pJson["scanState"], "qint32", "");
|
||||||
|
|
||||||
|
|
||||||
|
::SWGSDRangel::setValue(&channel_state, pJson["channelState"], "QList", "SWGFreqScannerChannelState");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString
|
QString
|
||||||
@ -79,6 +99,12 @@ SWGFreqScannerReport::asJsonObject() {
|
|||||||
if(m_channel_sample_rate_isSet){
|
if(m_channel_sample_rate_isSet){
|
||||||
obj->insert("channelSampleRate", QJsonValue(channel_sample_rate));
|
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;
|
return obj;
|
||||||
}
|
}
|
||||||
@ -93,6 +119,26 @@ SWGFreqScannerReport::setChannelSampleRate(qint32 channel_sample_rate) {
|
|||||||
this->m_channel_sample_rate_isSet = true;
|
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
|
bool
|
||||||
SWGFreqScannerReport::isSet(){
|
SWGFreqScannerReport::isSet(){
|
||||||
@ -101,6 +147,12 @@ SWGFreqScannerReport::isSet(){
|
|||||||
if(m_channel_sample_rate_isSet){
|
if(m_channel_sample_rate_isSet){
|
||||||
isObjectUpdated = true; break;
|
isObjectUpdated = true; break;
|
||||||
}
|
}
|
||||||
|
if(m_scan_state_isSet){
|
||||||
|
isObjectUpdated = true; break;
|
||||||
|
}
|
||||||
|
if(channel_state && (channel_state->size() > 0)){
|
||||||
|
isObjectUpdated = true; break;
|
||||||
|
}
|
||||||
}while(false);
|
}while(false);
|
||||||
return isObjectUpdated;
|
return isObjectUpdated;
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,8 @@
|
|||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
|
|
||||||
|
|
||||||
|
#include "SWGFreqScannerChannelState.h"
|
||||||
|
#include <QList>
|
||||||
|
|
||||||
#include "SWGObject.h"
|
#include "SWGObject.h"
|
||||||
#include "export.h"
|
#include "export.h"
|
||||||
@ -44,6 +46,12 @@ public:
|
|||||||
qint32 getChannelSampleRate();
|
qint32 getChannelSampleRate();
|
||||||
void setChannelSampleRate(qint32 channel_sample_rate);
|
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;
|
virtual bool isSet() override;
|
||||||
|
|
||||||
@ -51,6 +59,12 @@ private:
|
|||||||
qint32 channel_sample_rate;
|
qint32 channel_sample_rate;
|
||||||
bool m_channel_sample_rate_isSet;
|
bool m_channel_sample_rate_isSet;
|
||||||
|
|
||||||
|
qint32 scan_state;
|
||||||
|
bool m_scan_state_isSet;
|
||||||
|
|
||||||
|
QList<SWGFreqScannerChannelState*>* channel_state;
|
||||||
|
bool m_channel_state_isSet;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -157,6 +157,8 @@
|
|||||||
#include "SWGFreeDVDemodSettings.h"
|
#include "SWGFreeDVDemodSettings.h"
|
||||||
#include "SWGFreeDVModReport.h"
|
#include "SWGFreeDVModReport.h"
|
||||||
#include "SWGFreeDVModSettings.h"
|
#include "SWGFreeDVModSettings.h"
|
||||||
|
#include "SWGFreqScannerActions.h"
|
||||||
|
#include "SWGFreqScannerChannelState.h"
|
||||||
#include "SWGFreqScannerFrequency.h"
|
#include "SWGFreqScannerFrequency.h"
|
||||||
#include "SWGFreqScannerReport.h"
|
#include "SWGFreqScannerReport.h"
|
||||||
#include "SWGFreqScannerSettings.h"
|
#include "SWGFreqScannerSettings.h"
|
||||||
@ -1102,6 +1104,16 @@ namespace SWGSDRangel {
|
|||||||
obj->init();
|
obj->init();
|
||||||
return obj;
|
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) {
|
if(QString("SWGFreqScannerFrequency").compare(type) == 0) {
|
||||||
SWGFreqScannerFrequency *obj = new SWGFreqScannerFrequency();
|
SWGFreqScannerFrequency *obj = new SWGFreqScannerFrequency();
|
||||||
obj->init();
|
obj->init();
|
||||||
|
Loading…
Reference in New Issue
Block a user