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

AMBE feature: changes to DSD demod API

This commit is contained in:
f4exb 2022-05-24 17:14:22 +02:00
parent 713e0299ab
commit 6d18d6358a
7 changed files with 108 additions and 4 deletions

View File

@ -566,6 +566,12 @@ void DSDDemod::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("reverseAPIChannelIndex")) { if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
settings.m_reverseAPIChannelIndex = response.getDsdDemodSettings()->getReverseApiChannelIndex(); settings.m_reverseAPIChannelIndex = response.getDsdDemodSettings()->getReverseApiChannelIndex();
} }
if (channelSettingsKeys.contains("ambeFeatureIndex")) {
settings.m_ambeFeatureIndex = response.getDsdDemodSettings()->getAmbeFeatureIndex();
}
if (channelSettingsKeys.contains("connectAMBE")) {
settings.m_connectAMBE = response.getDsdDemodSettings()->getConnectAmbe() != 0;
}
if (settings.m_channelMarker && channelSettingsKeys.contains("channelMarker")) { if (settings.m_channelMarker && channelSettingsKeys.contains("channelMarker")) {
settings.m_channelMarker->updateFrom(channelSettingsKeys, response.getDsdDemodSettings()->getChannelMarker()); settings.m_channelMarker->updateFrom(channelSettingsKeys, response.getDsdDemodSettings()->getChannelMarker());
} }
@ -632,6 +638,8 @@ void DSDDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp
response.getDsdDemodSettings()->setReverseApiPort(settings.m_reverseAPIPort); response.getDsdDemodSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getDsdDemodSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex); response.getDsdDemodSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
response.getDsdDemodSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex); response.getDsdDemodSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex);
response.getDsdDemodSettings()->setAmbeFeatureIndex(settings.m_ambeFeatureIndex);
response.getDsdDemodSettings()->setConnectAmbe(settings.m_connectAMBE ? 1 : 0);
if (settings.m_channelMarker) if (settings.m_channelMarker)
{ {
@ -818,6 +826,12 @@ void DSDDemod::webapiFormatChannelSettings(
if (channelSettingsKeys.contains("streamIndex") || force) { if (channelSettingsKeys.contains("streamIndex") || force) {
swgDSDDemodSettings->setStreamIndex(settings.m_streamIndex); swgDSDDemodSettings->setStreamIndex(settings.m_streamIndex);
} }
if (channelSettingsKeys.contains("ambeFeatureIndex") || force) {
swgDSDDemodSettings->setAmbeFeatureIndex(settings.m_ambeFeatureIndex);
}
if (channelSettingsKeys.contains("connectAMBE") || force) {
swgDSDDemodSettings->setConnectAmbe(settings.m_connectAMBE ? 1 : 0);
}
if (settings.m_channelMarker && (channelSettingsKeys.contains("channelMarker") || force)) if (settings.m_channelMarker && (channelSettingsKeys.contains("channelMarker") || force))
{ {

View File

@ -4605,6 +4605,14 @@ margin-bottom: 20px;
}, },
"rollupState" : { "rollupState" : {
"$ref" : "#/definitions/RollupState" "$ref" : "#/definitions/RollupState"
},
"ambeFeatureIndex" : {
"type" : "integer",
"description" : "index of AMBE controller feature to be used for AMBE frames decoding"
},
"connectAMBE" : {
"type" : "integer",
"description" : "Decode frames with AMBE feature\n * 0 - Do not decode frames with AMBE feature\n * 1 - Decode frames with AMBE feature\n"
} }
}, },
"description" : "DSDDemod" "description" : "DSDDemod"
@ -57761,7 +57769,7 @@ except ApiException as e:
</div> </div>
<div id="generator"> <div id="generator">
<div class="content"> <div class="content">
Generated 2022-05-22T20:12:13.506+02:00 Generated 2022-05-24T15:35:23.001+02:00
</div> </div>
</div> </div>
</div> </div>

View File

@ -72,7 +72,15 @@ DSDDemodSettings:
$ref: "/doc/swagger/include/ChannelMarker.yaml#/ChannelMarker" $ref: "/doc/swagger/include/ChannelMarker.yaml#/ChannelMarker"
rollupState: rollupState:
$ref: "/doc/swagger/include/RollupState.yaml#/RollupState" $ref: "/doc/swagger/include/RollupState.yaml#/RollupState"
ambeFeatureIndex:
type: integer
description: index of AMBE controller feature to be used for AMBE frames decoding
connectAMBE:
type: integer
description: >
Decode frames with AMBE feature
* 0 - Do not decode frames with AMBE feature
* 1 - Decode frames with AMBE feature
DSDDemodReport: DSDDemodReport:
description: DSDDemod description: DSDDemod
properties: properties:

View File

@ -72,7 +72,15 @@ DSDDemodSettings:
$ref: "http://swgserver:8081/api/swagger/include/ChannelMarker.yaml#/ChannelMarker" $ref: "http://swgserver:8081/api/swagger/include/ChannelMarker.yaml#/ChannelMarker"
rollupState: rollupState:
$ref: "http://swgserver:8081/api/swagger/include/RollupState.yaml#/RollupState" $ref: "http://swgserver:8081/api/swagger/include/RollupState.yaml#/RollupState"
ambeFeatureIndex:
type: integer
description: index of AMBE controller feature to be used for AMBE frames decoding
connectAMBE:
type: integer
description: >
Decode frames with AMBE feature
* 0 - Do not decode frames with AMBE feature
* 1 - Decode frames with AMBE feature
DSDDemodReport: DSDDemodReport:
description: DSDDemod description: DSDDemod
properties: properties:

View File

@ -4605,6 +4605,14 @@ margin-bottom: 20px;
}, },
"rollupState" : { "rollupState" : {
"$ref" : "#/definitions/RollupState" "$ref" : "#/definitions/RollupState"
},
"ambeFeatureIndex" : {
"type" : "integer",
"description" : "index of AMBE controller feature to be used for AMBE frames decoding"
},
"connectAMBE" : {
"type" : "integer",
"description" : "Decode frames with AMBE feature\n * 0 - Do not decode frames with AMBE feature\n * 1 - Decode frames with AMBE feature\n"
} }
}, },
"description" : "DSDDemod" "description" : "DSDDemod"
@ -57761,7 +57769,7 @@ except ApiException as e:
</div> </div>
<div id="generator"> <div id="generator">
<div class="content"> <div class="content">
Generated 2022-05-22T20:12:13.506+02:00 Generated 2022-05-24T15:35:23.001+02:00
</div> </div>
</div> </div>
</div> </div>

View File

@ -88,6 +88,10 @@ SWGDSDDemodSettings::SWGDSDDemodSettings() {
m_channel_marker_isSet = false; m_channel_marker_isSet = false;
rollup_state = nullptr; rollup_state = nullptr;
m_rollup_state_isSet = false; m_rollup_state_isSet = false;
ambe_feature_index = 0;
m_ambe_feature_index_isSet = false;
connect_ambe = 0;
m_connect_ambe_isSet = false;
} }
SWGDSDDemodSettings::~SWGDSDDemodSettings() { SWGDSDDemodSettings::~SWGDSDDemodSettings() {
@ -156,6 +160,10 @@ SWGDSDDemodSettings::init() {
m_channel_marker_isSet = false; m_channel_marker_isSet = false;
rollup_state = new SWGRollupState(); rollup_state = new SWGRollupState();
m_rollup_state_isSet = false; m_rollup_state_isSet = false;
ambe_feature_index = 0;
m_ambe_feature_index_isSet = false;
connect_ambe = 0;
m_connect_ambe_isSet = false;
} }
void void
@ -200,6 +208,8 @@ SWGDSDDemodSettings::cleanup() {
if(rollup_state != nullptr) { if(rollup_state != nullptr) {
delete rollup_state; delete rollup_state;
} }
} }
SWGDSDDemodSettings* SWGDSDDemodSettings*
@ -273,6 +283,10 @@ SWGDSDDemodSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&rollup_state, pJson["rollupState"], "SWGRollupState", "SWGRollupState"); ::SWGSDRangel::setValue(&rollup_state, pJson["rollupState"], "SWGRollupState", "SWGRollupState");
::SWGSDRangel::setValue(&ambe_feature_index, pJson["ambeFeatureIndex"], "qint32", "");
::SWGSDRangel::setValue(&connect_ambe, pJson["connectAMBE"], "qint32", "");
} }
QString QString
@ -379,6 +393,12 @@ SWGDSDDemodSettings::asJsonObject() {
if((rollup_state != nullptr) && (rollup_state->isSet())){ if((rollup_state != nullptr) && (rollup_state->isSet())){
toJsonValue(QString("rollupState"), rollup_state, obj, QString("SWGRollupState")); toJsonValue(QString("rollupState"), rollup_state, obj, QString("SWGRollupState"));
} }
if(m_ambe_feature_index_isSet){
obj->insert("ambeFeatureIndex", QJsonValue(ambe_feature_index));
}
if(m_connect_ambe_isSet){
obj->insert("connectAMBE", QJsonValue(connect_ambe));
}
return obj; return obj;
} }
@ -683,6 +703,26 @@ SWGDSDDemodSettings::setRollupState(SWGRollupState* rollup_state) {
this->m_rollup_state_isSet = true; this->m_rollup_state_isSet = true;
} }
qint32
SWGDSDDemodSettings::getAmbeFeatureIndex() {
return ambe_feature_index;
}
void
SWGDSDDemodSettings::setAmbeFeatureIndex(qint32 ambe_feature_index) {
this->ambe_feature_index = ambe_feature_index;
this->m_ambe_feature_index_isSet = true;
}
qint32
SWGDSDDemodSettings::getConnectAmbe() {
return connect_ambe;
}
void
SWGDSDDemodSettings::setConnectAmbe(qint32 connect_ambe) {
this->connect_ambe = connect_ambe;
this->m_connect_ambe_isSet = true;
}
bool bool
SWGDSDDemodSettings::isSet(){ SWGDSDDemodSettings::isSet(){
@ -778,6 +818,12 @@ SWGDSDDemodSettings::isSet(){
if(rollup_state && rollup_state->isSet()){ if(rollup_state && rollup_state->isSet()){
isObjectUpdated = true; break; isObjectUpdated = true; break;
} }
if(m_ambe_feature_index_isSet){
isObjectUpdated = true; break;
}
if(m_connect_ambe_isSet){
isObjectUpdated = true; break;
}
}while(false); }while(false);
return isObjectUpdated; return isObjectUpdated;
} }

View File

@ -134,6 +134,12 @@ public:
SWGRollupState* getRollupState(); SWGRollupState* getRollupState();
void setRollupState(SWGRollupState* rollup_state); void setRollupState(SWGRollupState* rollup_state);
qint32 getAmbeFeatureIndex();
void setAmbeFeatureIndex(qint32 ambe_feature_index);
qint32 getConnectAmbe();
void setConnectAmbe(qint32 connect_ambe);
virtual bool isSet() override; virtual bool isSet() override;
@ -228,6 +234,12 @@ private:
SWGRollupState* rollup_state; SWGRollupState* rollup_state;
bool m_rollup_state_isSet; bool m_rollup_state_isSet;
qint32 ambe_feature_index;
bool m_ambe_feature_index_isSet;
qint32 connect_ambe;
bool m_connect_ambe_isSet;
}; };
} }