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 "device/deviceapi.h"
#include "dsp/hbfilterchainconverter.h" #include "dsp/hbfilterchainconverter.h"
#include "dsp/dspcommands.h" #include "dsp/dspcommands.h"
#include "settings/serializable.h"
#include "feature/feature.h" #include "feature/feature.h"
#include "maincore.h" #include "maincore.h"
@ -323,6 +324,9 @@ void BeamSteeringCWMod::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("reverseAPIChannelIndex")) { if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
settings.m_reverseAPIChannelIndex = response.getBeamSteeringCwModSettings()->getReverseApiChannelIndex(); 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) 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()->setReverseApiPort(settings.m_reverseAPIPort);
response.getBeamSteeringCwModSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex); response.getBeamSteeringCwModSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
response.getBeamSteeringCwModSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex); 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) void BeamSteeringCWMod::webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const BeamSteeringCWModSettings& settings, bool force)
@ -429,6 +447,13 @@ void BeamSteeringCWMod::webapiFormatChannelSettings(
if (channelSettingsKeys.contains("filterChainHash") || force) { if (channelSettingsKeys.contains("filterChainHash") || force) {
swgBeamSteeringCWSettings->setFilterChainHash(settings.m_filterChainHash); 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) void BeamSteeringCWMod::networkManagerFinished(QNetworkReply *reply)

View File

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

View File

@ -348,6 +348,9 @@ void Interferometer::webapiUpdateChannelSettings(
if (settings.m_scopeGUI && channelSettingsKeys.contains("scopeConfig")) { if (settings.m_scopeGUI && channelSettingsKeys.contains("scopeConfig")) {
settings.m_scopeGUI->updateFrom(channelSettingsKeys, response.getInterferometerSettings()->getScopeConfig()); 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) void Interferometer::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const InterferometerSettings& settings)
@ -401,6 +404,20 @@ void Interferometer::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings
response.getInterferometerSettings()->setScopeConfig(swgGLScope); 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) void Interferometer::webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const InterferometerSettings& settings, bool force)
@ -492,6 +509,13 @@ void Interferometer::webapiFormatChannelSettings(
settings.m_scopeGUI->formatTo(swgInterferometerSettings->getScopeConfig()); 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) void Interferometer::networkManagerFinished(QNetworkReply *reply)

View File

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

View File

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

View File

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

View File

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

View File

@ -22,3 +22,5 @@ BeamSteeringCWModSettings:
type: integer type: integer
reverseAPIChannelIndex: reverseAPIChannelIndex:
type: integer 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" $ref: "http://swgserver:8081/api/swagger/include/GLSpectrum.yaml#/GLSpectrum"
scopeConfig: scopeConfig:
$ref: "http://swgserver:8081/api/swagger/include/GLScope.yaml#/GLScope" $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" : { "reverseAPIChannelIndex" : {
"type" : "integer" "type" : "integer"
},
"channelMarker" : {
"$ref" : "#/definitions/ChannelMarker"
} }
}, },
"description" : "BeamSteeringCWMod" "description" : "BeamSteeringCWMod"
@ -6680,6 +6683,9 @@ margin-bottom: 20px;
}, },
"scopeConfig" : { "scopeConfig" : {
"$ref" : "#/definitions/GLScope" "$ref" : "#/definitions/GLScope"
},
"channelMarker" : {
"$ref" : "#/definitions/ChannelMarker"
} }
}, },
"description" : "Interferometer" "description" : "Interferometer"
@ -51599,7 +51605,7 @@ except ApiException as e:
</div> </div>
<div id="generator"> <div id="generator">
<div class="content"> <div class="content">
Generated 2021-12-03T00:35:44.973+01:00 Generated 2021-12-03T22:37:52.628+01:00
</div> </div>
</div> </div>
</div> </div>

View File

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

View File

@ -22,6 +22,7 @@
#include <QJsonObject> #include <QJsonObject>
#include "SWGChannelMarker.h"
#include <QString> #include <QString>
#include "SWGObject.h" #include "SWGObject.h"
@ -72,6 +73,9 @@ public:
qint32 getReverseApiChannelIndex(); qint32 getReverseApiChannelIndex();
void setReverseApiChannelIndex(qint32 reverse_api_channel_index); void setReverseApiChannelIndex(qint32 reverse_api_channel_index);
SWGChannelMarker* getChannelMarker();
void setChannelMarker(SWGChannelMarker* channel_marker);
virtual bool isSet() override; virtual bool isSet() override;
@ -106,6 +110,9 @@ private:
qint32 reverse_api_channel_index; qint32 reverse_api_channel_index;
bool m_reverse_api_channel_index_isSet; 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; m_spectrum_config_isSet = false;
scope_config = nullptr; scope_config = nullptr;
m_scope_config_isSet = false; m_scope_config_isSet = false;
channel_marker = nullptr;
m_channel_marker_isSet = false;
} }
SWGInterferometerSettings::~SWGInterferometerSettings() { SWGInterferometerSettings::~SWGInterferometerSettings() {
@ -84,6 +86,8 @@ SWGInterferometerSettings::init() {
m_spectrum_config_isSet = false; m_spectrum_config_isSet = false;
scope_config = new SWGGLScope(); scope_config = new SWGGLScope();
m_scope_config_isSet = false; m_scope_config_isSet = false;
channel_marker = new SWGChannelMarker();
m_channel_marker_isSet = false;
} }
void void
@ -108,6 +112,9 @@ SWGInterferometerSettings::cleanup() {
if(scope_config != nullptr) { if(scope_config != nullptr) {
delete scope_config; delete scope_config;
} }
if(channel_marker != nullptr) {
delete channel_marker;
}
} }
SWGInterferometerSettings* SWGInterferometerSettings*
@ -145,6 +152,8 @@ SWGInterferometerSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&scope_config, pJson["scopeConfig"], "SWGGLScope", "SWGGLScope"); ::SWGSDRangel::setValue(&scope_config, pJson["scopeConfig"], "SWGGLScope", "SWGGLScope");
::SWGSDRangel::setValue(&channel_marker, pJson["channelMarker"], "SWGChannelMarker", "SWGChannelMarker");
} }
QString QString
@ -197,6 +206,9 @@ SWGInterferometerSettings::asJsonObject() {
if((scope_config != nullptr) && (scope_config->isSet())){ if((scope_config != nullptr) && (scope_config->isSet())){
toJsonValue(QString("scopeConfig"), scope_config, obj, QString("SWGGLScope")); 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; return obj;
} }
@ -321,6 +333,16 @@ SWGInterferometerSettings::setScopeConfig(SWGGLScope* scope_config) {
this->m_scope_config_isSet = true; 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 bool
SWGInterferometerSettings::isSet(){ SWGInterferometerSettings::isSet(){
@ -362,6 +384,9 @@ SWGInterferometerSettings::isSet(){
if(scope_config && scope_config->isSet()){ if(scope_config && scope_config->isSet()){
isObjectUpdated = true; break; isObjectUpdated = true; break;
} }
if(channel_marker && channel_marker->isSet()){
isObjectUpdated = true; break;
}
}while(false); }while(false);
return isObjectUpdated; return isObjectUpdated;
} }

View File

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