NFM Mod: API updates

pull/1281/head
f4exb 2022-06-04 09:10:31 +02:00
rodzic d4c73ce194
commit 910e69e789
7 zmienionych plików z 114 dodań i 2 usunięć

Wyświetl plik

@ -566,6 +566,12 @@ void NFMMod::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("dcsPositive")) {
settings.m_dcsPositive = response.getNfmModSettings()->getDcsPositive() != 0;
}
if (channelSettingsKeys.contains("preEmphasisOn")) {
settings.m_preEmphasisOn = response.getNfmModSettings()->getPreEmphasisOn() != 0;
}
if (channelSettingsKeys.contains("bpfOn")) {
settings.m_bpfOn = response.getNfmModSettings()->getBpfOn() != 0;
}
if (channelSettingsKeys.contains("streamIndex")) {
settings.m_streamIndex = response.getNfmModSettings()->getStreamIndex();
}
@ -638,6 +644,8 @@ void NFMMod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& respon
response.getNfmModSettings()->setDcsCode(settings.m_dcsCode);
response.getNfmModSettings()->setDcsOn(settings.m_dcsOn ? 1 : 0);
response.getNfmModSettings()->setDcsPositive(settings.m_dcsPositive ? 1 : 0);
response.getNfmModSettings()->setPreEmphasisOn(settings.m_preEmphasisOn ? 1 : 0);
response.getNfmModSettings()->setBpfOn(settings.m_bpfOn ? 1 : 0);
response.getNfmModSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
if (response.getNfmModSettings()->getReverseApiAddress()) {
@ -835,6 +843,12 @@ void NFMMod::webapiFormatChannelSettings(
if (channelSettingsKeys.contains("dcsPositive") || force) {
swgNFMModSettings->setDcsPositive(settings.m_dcsPositive ? 1 : 0);
}
if (channelSettingsKeys.contains("preEmphasisOn") || force) {
swgNFMModSettings->setPreEmphasisOn(settings.m_preEmphasisOn ? 1 : 0);
}
if (channelSettingsKeys.contains("bpfOn") || force) {
swgNFMModSettings->setBpfOn(settings.m_bpfOn ? 1 : 0);
}
if (channelSettingsKeys.contains("streamIndex") || force) {
swgNFMModSettings->setStreamIndex(settings.m_streamIndex);
}

Wyświetl plik

@ -8951,6 +8951,14 @@ margin-bottom: 20px;
"modAFInput" : {
"type" : "integer"
},
"preEmphasisOn" : {
"type" : "integer",
"description" : "Activate pre-emphasis filter: * 0 - inactive * 1 - active\n"
},
"bpfOn" : {
"type" : "integer",
"description" : "Activate audio highpass filter when no CTCSS nor DCS: * 0 - inactive * 1 - active\n"
},
"streamIndex" : {
"type" : "integer",
"description" : "MIMO channel. Not relevant when connected to SI (single Rx)."
@ -56161,7 +56169,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2022-05-31T23:33:55.570+02:00
Generated 2022-06-04T08:51:44.121+02:00
</div>
</div>
</div>

Wyświetl plik

@ -53,6 +53,18 @@ NFMModSettings:
type: string
modAFInput:
type: integer
preEmphasisOn:
type: integer
description: >
Activate pre-emphasis filter:
* 0 - inactive
* 1 - active
bpfOn:
type: integer
description: >
Activate audio highpass filter when no CTCSS nor DCS:
* 0 - inactive
* 1 - active
streamIndex:
description: MIMO channel. Not relevant when connected to SI (single Rx).
type: integer

Wyświetl plik

@ -53,6 +53,18 @@ NFMModSettings:
type: string
modAFInput:
type: integer
preEmphasisOn:
type: integer
description: >
Activate pre-emphasis filter:
* 0 - inactive
* 1 - active
bpfOn:
type: integer
description: >
Activate audio highpass filter when no CTCSS nor DCS:
* 0 - inactive
* 1 - active
streamIndex:
description: MIMO channel. Not relevant when connected to SI (single Rx).
type: integer

Wyświetl plik

@ -8951,6 +8951,14 @@ margin-bottom: 20px;
"modAFInput" : {
"type" : "integer"
},
"preEmphasisOn" : {
"type" : "integer",
"description" : "Activate pre-emphasis filter: * 0 - inactive * 1 - active\n"
},
"bpfOn" : {
"type" : "integer",
"description" : "Activate audio highpass filter when no CTCSS nor DCS: * 0 - inactive * 1 - active\n"
},
"streamIndex" : {
"type" : "integer",
"description" : "MIMO channel. Not relevant when connected to SI (single Rx)."
@ -56161,7 +56169,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2022-05-31T23:33:55.570+02:00
Generated 2022-06-04T08:51:44.121+02:00
</div>
</div>
</div>

Wyświetl plik

@ -62,6 +62,10 @@ SWGNFMModSettings::SWGNFMModSettings() {
m_audio_device_name_isSet = false;
mod_af_input = 0;
m_mod_af_input_isSet = false;
pre_emphasis_on = 0;
m_pre_emphasis_on_isSet = false;
bpf_on = 0;
m_bpf_on_isSet = false;
stream_index = 0;
m_stream_index_isSet = false;
use_reverse_api = 0;
@ -122,6 +126,10 @@ SWGNFMModSettings::init() {
m_audio_device_name_isSet = false;
mod_af_input = 0;
m_mod_af_input_isSet = false;
pre_emphasis_on = 0;
m_pre_emphasis_on_isSet = false;
bpf_on = 0;
m_bpf_on_isSet = false;
stream_index = 0;
m_stream_index_isSet = false;
use_reverse_api = 0;
@ -167,6 +175,8 @@ SWGNFMModSettings::cleanup() {
if(reverse_api_address != nullptr) {
delete reverse_api_address;
}
@ -229,6 +239,10 @@ SWGNFMModSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&mod_af_input, pJson["modAFInput"], "qint32", "");
::SWGSDRangel::setValue(&pre_emphasis_on, pJson["preEmphasisOn"], "qint32", "");
::SWGSDRangel::setValue(&bpf_on, pJson["bpfOn"], "qint32", "");
::SWGSDRangel::setValue(&stream_index, pJson["streamIndex"], "qint32", "");
::SWGSDRangel::setValue(&use_reverse_api, pJson["useReverseAPI"], "qint32", "");
@ -314,6 +328,12 @@ SWGNFMModSettings::asJsonObject() {
if(m_mod_af_input_isSet){
obj->insert("modAFInput", QJsonValue(mod_af_input));
}
if(m_pre_emphasis_on_isSet){
obj->insert("preEmphasisOn", QJsonValue(pre_emphasis_on));
}
if(m_bpf_on_isSet){
obj->insert("bpfOn", QJsonValue(bpf_on));
}
if(m_stream_index_isSet){
obj->insert("streamIndex", QJsonValue(stream_index));
}
@ -515,6 +535,26 @@ SWGNFMModSettings::setModAfInput(qint32 mod_af_input) {
this->m_mod_af_input_isSet = true;
}
qint32
SWGNFMModSettings::getPreEmphasisOn() {
return pre_emphasis_on;
}
void
SWGNFMModSettings::setPreEmphasisOn(qint32 pre_emphasis_on) {
this->pre_emphasis_on = pre_emphasis_on;
this->m_pre_emphasis_on_isSet = true;
}
qint32
SWGNFMModSettings::getBpfOn() {
return bpf_on;
}
void
SWGNFMModSettings::setBpfOn(qint32 bpf_on) {
this->bpf_on = bpf_on;
this->m_bpf_on_isSet = true;
}
qint32
SWGNFMModSettings::getStreamIndex() {
return stream_index;
@ -661,6 +701,12 @@ SWGNFMModSettings::isSet(){
if(m_mod_af_input_isSet){
isObjectUpdated = true; break;
}
if(m_pre_emphasis_on_isSet){
isObjectUpdated = true; break;
}
if(m_bpf_on_isSet){
isObjectUpdated = true; break;
}
if(m_stream_index_isSet){
isObjectUpdated = true; break;
}

Wyświetl plik

@ -96,6 +96,12 @@ public:
qint32 getModAfInput();
void setModAfInput(qint32 mod_af_input);
qint32 getPreEmphasisOn();
void setPreEmphasisOn(qint32 pre_emphasis_on);
qint32 getBpfOn();
void setBpfOn(qint32 bpf_on);
qint32 getStreamIndex();
void setStreamIndex(qint32 stream_index);
@ -178,6 +184,12 @@ private:
qint32 mod_af_input;
bool m_mod_af_input_isSet;
qint32 pre_emphasis_on;
bool m_pre_emphasis_on_isSet;
qint32 bpf_on;
bool m_bpf_on_isSet;
qint32 stream_index;
bool m_stream_index_isSet;