1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-09-27 07:16:48 -04:00

API: implemented Channel Marker in MIMO channels

This commit is contained in:
f4exb 2021-12-03 23:08:48 +01:00
parent 2a3ce0e7fb
commit 71f63e3a9c
14 changed files with 137 additions and 2 deletions

View File

@ -26,6 +26,7 @@
#include "device/deviceapi.h"
#include "dsp/hbfilterchainconverter.h"
#include "dsp/dspcommands.h"
#include "settings/serializable.h"
#include "feature/feature.h"
#include "maincore.h"
@ -323,6 +324,9 @@ void BeamSteeringCWMod::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
settings.m_reverseAPIChannelIndex = response.getBeamSteeringCwModSettings()->getReverseApiChannelIndex();
}
if (settings.m_channelMarker && channelSettingsKeys.contains("channelMarker")) {
settings.m_channelMarker->updateFrom(channelSettingsKeys, response.getBeamSteeringCwModSettings()->getChannelMarker());
}
}
void BeamSteeringCWMod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const BeamSteeringCWModSettings& settings)
@ -349,6 +353,20 @@ void BeamSteeringCWMod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSetti
response.getBeamSteeringCwModSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getBeamSteeringCwModSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
response.getBeamSteeringCwModSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex);
if (settings.m_channelMarker)
{
if (response.getBeamSteeringCwModSettings()->getChannelMarker())
{
settings.m_channelMarker->formatTo(response.getBeamSteeringCwModSettings()->getChannelMarker());
}
else
{
SWGSDRangel::SWGChannelMarker *swgChannelMarker = new SWGSDRangel::SWGChannelMarker();
settings.m_channelMarker->formatTo(swgChannelMarker);
response.getBeamSteeringCwModSettings()->setChannelMarker(swgChannelMarker);
}
}
}
void BeamSteeringCWMod::webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const BeamSteeringCWModSettings& settings, bool force)
@ -429,6 +447,13 @@ void BeamSteeringCWMod::webapiFormatChannelSettings(
if (channelSettingsKeys.contains("filterChainHash") || force) {
swgBeamSteeringCWSettings->setFilterChainHash(settings.m_filterChainHash);
}
if (settings.m_channelMarker && (channelSettingsKeys.contains("channelMarker") || force))
{
SWGSDRangel::SWGChannelMarker *swgChannelMarker = new SWGSDRangel::SWGChannelMarker();
settings.m_channelMarker->formatTo(swgChannelMarker);
swgBeamSteeringCWSettings->setChannelMarker(swgChannelMarker);
}
}
void BeamSteeringCWMod::networkManagerFinished(QNetworkReply *reply)

View File

@ -76,6 +76,7 @@ bool BeamSteeringCWModGUI::handleMessage(const Message& message)
const BeamSteeringCWMod::MsgConfigureBeamSteeringCWMod& cfg = (BeamSteeringCWMod::MsgConfigureBeamSteeringCWMod&) message;
m_settings = cfg.getSettings();
blockApplySettings(true);
m_channelMarker.updateSettings(static_cast<const ChannelMarker*>(m_settings.m_channelMarker));
displaySettings();
blockApplySettings(false);
return true;

View File

@ -348,6 +348,9 @@ void Interferometer::webapiUpdateChannelSettings(
if (settings.m_scopeGUI && channelSettingsKeys.contains("scopeConfig")) {
settings.m_scopeGUI->updateFrom(channelSettingsKeys, response.getInterferometerSettings()->getScopeConfig());
}
if (settings.m_channelMarker && channelSettingsKeys.contains("channelMarker")) {
settings.m_channelMarker->updateFrom(channelSettingsKeys, response.getInterferometerSettings()->getChannelMarker());
}
}
void Interferometer::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const InterferometerSettings& settings)
@ -401,6 +404,20 @@ void Interferometer::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings
response.getInterferometerSettings()->setScopeConfig(swgGLScope);
}
}
if (settings.m_channelMarker)
{
if (response.getInterferometerSettings()->getChannelMarker())
{
settings.m_channelMarker->formatTo(response.getInterferometerSettings()->getChannelMarker());
}
else
{
SWGSDRangel::SWGChannelMarker *swgChannelMarker = new SWGSDRangel::SWGChannelMarker();
settings.m_channelMarker->formatTo(swgChannelMarker);
response.getInterferometerSettings()->setChannelMarker(swgChannelMarker);
}
}
}
void Interferometer::webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const InterferometerSettings& settings, bool force)
@ -492,6 +509,13 @@ void Interferometer::webapiFormatChannelSettings(
settings.m_scopeGUI->formatTo(swgInterferometerSettings->getScopeConfig());
}
}
if (settings.m_channelMarker && (channelSettingsKeys.contains("channelMarker") || force))
{
SWGSDRangel::SWGChannelMarker *swgChannelMarker = new SWGSDRangel::SWGChannelMarker();
settings.m_channelMarker->formatTo(swgChannelMarker);
swgInterferometerSettings->setChannelMarker(swgChannelMarker);
}
}
void Interferometer::networkManagerFinished(QNetworkReply *reply)

View File

@ -87,6 +87,7 @@ bool InterferometerGUI::handleMessage(const Message& message)
m_settings = notif.getSettings();
ui->scopeGUI->updateSettings();
ui->spectrumGUI->updateSettings();
m_channelMarker.updateSettings(static_cast<const ChannelMarker*>(m_settings.m_channelMarker));
displaySettings();
return true;
}

View File

@ -2399,6 +2399,9 @@ margin-bottom: 20px;
},
"reverseAPIChannelIndex" : {
"type" : "integer"
},
"channelMarker" : {
"$ref" : "#/definitions/ChannelMarker"
}
},
"description" : "BeamSteeringCWMod"
@ -6680,6 +6683,9 @@ margin-bottom: 20px;
},
"scopeConfig" : {
"$ref" : "#/definitions/GLScope"
},
"channelMarker" : {
"$ref" : "#/definitions/ChannelMarker"
}
},
"description" : "Interferometer"
@ -51599,7 +51605,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2021-12-03T00:35:44.973+01:00
Generated 2021-12-03T22:37:52.628+01:00
</div>
</div>
</div>

View File

@ -22,3 +22,5 @@ BeamSteeringCWModSettings:
type: integer
reverseAPIChannelIndex:
type: integer
channelMarker:
$ref: "/doc/swagger/include/ChannelMarker.yaml#/ChannelMarker"

View File

@ -27,3 +27,5 @@ InterferometerSettings:
$ref: "/doc/swagger/include/GLSpectrum.yaml#/GLSpectrum"
scopeConfig:
$ref: "/doc/swagger/include/GLScope.yaml#/GLScope"
channelMarker:
$ref: "/doc/swagger/include/ChannelMarker.yaml#/ChannelMarker"

View File

@ -22,3 +22,5 @@ BeamSteeringCWModSettings:
type: integer
reverseAPIChannelIndex:
type: integer
channelMarker:
$ref: "http://swgserver:8081/api/swagger/include/ChannelMarker.yaml#/ChannelMarker"

View File

@ -27,3 +27,5 @@ InterferometerSettings:
$ref: "http://swgserver:8081/api/swagger/include/GLSpectrum.yaml#/GLSpectrum"
scopeConfig:
$ref: "http://swgserver:8081/api/swagger/include/GLScope.yaml#/GLScope"
channelMarker:
$ref: "http://swgserver:8081/api/swagger/include/ChannelMarker.yaml#/ChannelMarker"

View File

@ -2399,6 +2399,9 @@ margin-bottom: 20px;
},
"reverseAPIChannelIndex" : {
"type" : "integer"
},
"channelMarker" : {
"$ref" : "#/definitions/ChannelMarker"
}
},
"description" : "BeamSteeringCWMod"
@ -6680,6 +6683,9 @@ margin-bottom: 20px;
},
"scopeConfig" : {
"$ref" : "#/definitions/GLScope"
},
"channelMarker" : {
"$ref" : "#/definitions/ChannelMarker"
}
},
"description" : "Interferometer"
@ -51599,7 +51605,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2021-12-03T00:35:44.973+01:00
Generated 2021-12-03T22:37:52.628+01:00
</div>
</div>
</div>

View File

@ -48,6 +48,8 @@ SWGBeamSteeringCWModSettings::SWGBeamSteeringCWModSettings() {
m_reverse_api_device_index_isSet = false;
reverse_api_channel_index = 0;
m_reverse_api_channel_index_isSet = false;
channel_marker = nullptr;
m_channel_marker_isSet = false;
}
SWGBeamSteeringCWModSettings::~SWGBeamSteeringCWModSettings() {
@ -76,6 +78,8 @@ SWGBeamSteeringCWModSettings::init() {
m_reverse_api_device_index_isSet = false;
reverse_api_channel_index = 0;
m_reverse_api_channel_index_isSet = false;
channel_marker = new SWGChannelMarker();
m_channel_marker_isSet = false;
}
void
@ -94,6 +98,9 @@ SWGBeamSteeringCWModSettings::cleanup() {
if(channel_marker != nullptr) {
delete channel_marker;
}
}
SWGBeamSteeringCWModSettings*
@ -127,6 +134,8 @@ SWGBeamSteeringCWModSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&reverse_api_channel_index, pJson["reverseAPIChannelIndex"], "qint32", "");
::SWGSDRangel::setValue(&channel_marker, pJson["channelMarker"], "SWGChannelMarker", "SWGChannelMarker");
}
QString
@ -173,6 +182,9 @@ SWGBeamSteeringCWModSettings::asJsonObject() {
if(m_reverse_api_channel_index_isSet){
obj->insert("reverseAPIChannelIndex", QJsonValue(reverse_api_channel_index));
}
if((channel_marker != nullptr) && (channel_marker->isSet())){
toJsonValue(QString("channelMarker"), channel_marker, obj, QString("SWGChannelMarker"));
}
return obj;
}
@ -277,6 +289,16 @@ SWGBeamSteeringCWModSettings::setReverseApiChannelIndex(qint32 reverse_api_chann
this->m_reverse_api_channel_index_isSet = true;
}
SWGChannelMarker*
SWGBeamSteeringCWModSettings::getChannelMarker() {
return channel_marker;
}
void
SWGBeamSteeringCWModSettings::setChannelMarker(SWGChannelMarker* channel_marker) {
this->channel_marker = channel_marker;
this->m_channel_marker_isSet = true;
}
bool
SWGBeamSteeringCWModSettings::isSet(){
@ -312,6 +334,9 @@ SWGBeamSteeringCWModSettings::isSet(){
if(m_reverse_api_channel_index_isSet){
isObjectUpdated = true; break;
}
if(channel_marker && channel_marker->isSet()){
isObjectUpdated = true; break;
}
}while(false);
return isObjectUpdated;
}

View File

@ -22,6 +22,7 @@
#include <QJsonObject>
#include "SWGChannelMarker.h"
#include <QString>
#include "SWGObject.h"
@ -72,6 +73,9 @@ public:
qint32 getReverseApiChannelIndex();
void setReverseApiChannelIndex(qint32 reverse_api_channel_index);
SWGChannelMarker* getChannelMarker();
void setChannelMarker(SWGChannelMarker* channel_marker);
virtual bool isSet() override;
@ -106,6 +110,9 @@ private:
qint32 reverse_api_channel_index;
bool m_reverse_api_channel_index_isSet;
SWGChannelMarker* channel_marker;
bool m_channel_marker_isSet;
};
}

View File

@ -52,6 +52,8 @@ SWGInterferometerSettings::SWGInterferometerSettings() {
m_spectrum_config_isSet = false;
scope_config = nullptr;
m_scope_config_isSet = false;
channel_marker = nullptr;
m_channel_marker_isSet = false;
}
SWGInterferometerSettings::~SWGInterferometerSettings() {
@ -84,6 +86,8 @@ SWGInterferometerSettings::init() {
m_spectrum_config_isSet = false;
scope_config = new SWGGLScope();
m_scope_config_isSet = false;
channel_marker = new SWGChannelMarker();
m_channel_marker_isSet = false;
}
void
@ -108,6 +112,9 @@ SWGInterferometerSettings::cleanup() {
if(scope_config != nullptr) {
delete scope_config;
}
if(channel_marker != nullptr) {
delete channel_marker;
}
}
SWGInterferometerSettings*
@ -145,6 +152,8 @@ SWGInterferometerSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&scope_config, pJson["scopeConfig"], "SWGGLScope", "SWGGLScope");
::SWGSDRangel::setValue(&channel_marker, pJson["channelMarker"], "SWGChannelMarker", "SWGChannelMarker");
}
QString
@ -197,6 +206,9 @@ SWGInterferometerSettings::asJsonObject() {
if((scope_config != nullptr) && (scope_config->isSet())){
toJsonValue(QString("scopeConfig"), scope_config, obj, QString("SWGGLScope"));
}
if((channel_marker != nullptr) && (channel_marker->isSet())){
toJsonValue(QString("channelMarker"), channel_marker, obj, QString("SWGChannelMarker"));
}
return obj;
}
@ -321,6 +333,16 @@ SWGInterferometerSettings::setScopeConfig(SWGGLScope* scope_config) {
this->m_scope_config_isSet = true;
}
SWGChannelMarker*
SWGInterferometerSettings::getChannelMarker() {
return channel_marker;
}
void
SWGInterferometerSettings::setChannelMarker(SWGChannelMarker* channel_marker) {
this->channel_marker = channel_marker;
this->m_channel_marker_isSet = true;
}
bool
SWGInterferometerSettings::isSet(){
@ -362,6 +384,9 @@ SWGInterferometerSettings::isSet(){
if(scope_config && scope_config->isSet()){
isObjectUpdated = true; break;
}
if(channel_marker && channel_marker->isSet()){
isObjectUpdated = true; break;
}
}while(false);
return isObjectUpdated;
}

View File

@ -22,6 +22,7 @@
#include <QJsonObject>
#include "SWGChannelMarker.h"
#include "SWGGLScope.h"
#include "SWGGLSpectrum.h"
#include <QString>
@ -80,6 +81,9 @@ public:
SWGGLScope* getScopeConfig();
void setScopeConfig(SWGGLScope* scope_config);
SWGChannelMarker* getChannelMarker();
void setChannelMarker(SWGChannelMarker* channel_marker);
virtual bool isSet() override;
@ -120,6 +124,9 @@ private:
SWGGLScope* scope_config;
bool m_scope_config_isSet;
SWGChannelMarker* channel_marker;
bool m_channel_marker_isSet;
};
}