-
Notifications
You must be signed in to change notification settings - Fork 453
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1956 from anton-kotenko/master
Demod Analyzer plugin: channel selection via api
- Loading branch information
Showing
15 changed files
with
339 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
131 changes: 131 additions & 0 deletions
131
swagger/sdrangel/code/qt5/client/SWGDemodAnalyzerActions.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: [email protected] | ||
* | ||
* 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 "SWGDemodAnalyzerActions.h" | ||
|
||
#include "SWGHelpers.h" | ||
|
||
#include <QJsonDocument> | ||
#include <QJsonArray> | ||
#include <QObject> | ||
#include <QDebug> | ||
|
||
namespace SWGSDRangel { | ||
|
||
SWGDemodAnalyzerActions::SWGDemodAnalyzerActions(QString* json) { | ||
init(); | ||
this->fromJson(*json); | ||
} | ||
|
||
SWGDemodAnalyzerActions::SWGDemodAnalyzerActions() { | ||
device_id = 0; | ||
m_device_id_isSet = false; | ||
channel_id = 0; | ||
m_channel_id_isSet = false; | ||
} | ||
|
||
SWGDemodAnalyzerActions::~SWGDemodAnalyzerActions() { | ||
this->cleanup(); | ||
} | ||
|
||
void | ||
SWGDemodAnalyzerActions::init() { | ||
device_id = 0; | ||
m_device_id_isSet = false; | ||
channel_id = 0; | ||
m_channel_id_isSet = false; | ||
} | ||
|
||
void | ||
SWGDemodAnalyzerActions::cleanup() { | ||
|
||
|
||
} | ||
|
||
SWGDemodAnalyzerActions* | ||
SWGDemodAnalyzerActions::fromJson(QString &json) { | ||
QByteArray array (json.toStdString().c_str()); | ||
QJsonDocument doc = QJsonDocument::fromJson(array); | ||
QJsonObject jsonObject = doc.object(); | ||
this->fromJsonObject(jsonObject); | ||
return this; | ||
} | ||
|
||
void | ||
SWGDemodAnalyzerActions::fromJsonObject(QJsonObject &pJson) { | ||
::SWGSDRangel::setValue(&device_id, pJson["deviceId"], "qint32", ""); | ||
|
||
::SWGSDRangel::setValue(&channel_id, pJson["channelId"], "qint32", ""); | ||
|
||
} | ||
|
||
QString | ||
SWGDemodAnalyzerActions::asJson () | ||
{ | ||
QJsonObject* obj = this->asJsonObject(); | ||
|
||
QJsonDocument doc(*obj); | ||
QByteArray bytes = doc.toJson(); | ||
delete obj; | ||
return QString(bytes); | ||
} | ||
|
||
QJsonObject* | ||
SWGDemodAnalyzerActions::asJsonObject() { | ||
QJsonObject* obj = new QJsonObject(); | ||
if(m_device_id_isSet){ | ||
obj->insert("deviceId", QJsonValue(device_id)); | ||
} | ||
if(m_channel_id_isSet){ | ||
obj->insert("channelId", QJsonValue(channel_id)); | ||
} | ||
|
||
return obj; | ||
} | ||
|
||
qint32 | ||
SWGDemodAnalyzerActions::getDeviceId() { | ||
return device_id; | ||
} | ||
void | ||
SWGDemodAnalyzerActions::setDeviceId(qint32 device_id) { | ||
this->device_id = device_id; | ||
this->m_device_id_isSet = true; | ||
} | ||
|
||
qint32 | ||
SWGDemodAnalyzerActions::getChannelId() { | ||
return channel_id; | ||
} | ||
void | ||
SWGDemodAnalyzerActions::setChannelId(qint32 channel_id) { | ||
this->channel_id = channel_id; | ||
this->m_channel_id_isSet = true; | ||
} | ||
|
||
|
||
bool | ||
SWGDemodAnalyzerActions::isSet(){ | ||
bool isObjectUpdated = false; | ||
do{ | ||
if(m_device_id_isSet){ | ||
isObjectUpdated = true; break; | ||
} | ||
if(m_channel_id_isSet){ | ||
isObjectUpdated = true; break; | ||
} | ||
}while(false); | ||
return isObjectUpdated; | ||
} | ||
} | ||
|
64 changes: 64 additions & 0 deletions
64
swagger/sdrangel/code/qt5/client/SWGDemodAnalyzerActions.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: [email protected] | ||
* | ||
* 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. | ||
*/ | ||
|
||
/* | ||
* SWGDemodAnalyzerActions.h | ||
* | ||
* Demod Analyzer actions | ||
*/ | ||
|
||
#ifndef SWGDemodAnalyzerActions_H_ | ||
#define SWGDemodAnalyzerActions_H_ | ||
|
||
#include <QJsonObject> | ||
|
||
|
||
|
||
#include "SWGObject.h" | ||
#include "export.h" | ||
|
||
namespace SWGSDRangel { | ||
|
||
class SWG_API SWGDemodAnalyzerActions: public SWGObject { | ||
public: | ||
SWGDemodAnalyzerActions(); | ||
SWGDemodAnalyzerActions(QString* json); | ||
virtual ~SWGDemodAnalyzerActions(); | ||
void init(); | ||
void cleanup(); | ||
|
||
virtual QString asJson () override; | ||
virtual QJsonObject* asJsonObject() override; | ||
virtual void fromJsonObject(QJsonObject &json) override; | ||
virtual SWGDemodAnalyzerActions* fromJson(QString &jsonString) override; | ||
|
||
qint32 getDeviceId(); | ||
void setDeviceId(qint32 device_id); | ||
|
||
qint32 getChannelId(); | ||
void setChannelId(qint32 channel_id); | ||
|
||
|
||
virtual bool isSet() override; | ||
|
||
private: | ||
qint32 device_id; | ||
bool m_device_id_isSet; | ||
|
||
qint32 channel_id; | ||
bool m_channel_id_isSet; | ||
|
||
}; | ||
|
||
} | ||
|
||
#endif /* SWGDemodAnalyzerActions_H_ */ |
Oops, something went wrong.