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

FCD: Decimation and Fc Pos REST API implementations

This commit is contained in:
f4exb 2019-01-05 10:07:25 +01:00
parent b68eceb635
commit 26aab263e0
12 changed files with 182 additions and 6 deletions

View File

@ -919,6 +919,12 @@ int FCDProInput::webapiSettingsPutPatch(
if (deviceSettingsKeys.contains("gain6Index")) { if (deviceSettingsKeys.contains("gain6Index")) {
settings.m_gain6Index = response.getFcdProSettings()->getGain6Index(); settings.m_gain6Index = response.getFcdProSettings()->getGain6Index();
} }
if (deviceSettingsKeys.contains("log2Decim")) {
settings.m_log2Decim = response.getFcdProSettings()->getLog2Decim();
}
if (deviceSettingsKeys.contains("fcPos")) {
settings.m_fcPos = (FCDProSettings::fcPos_t) response.getFcdProSettings()->getFcPos();
}
if (deviceSettingsKeys.contains("rcFilterIndex")) { if (deviceSettingsKeys.contains("rcFilterIndex")) {
settings.m_rcFilterIndex = response.getFcdProSettings()->getRcFilterIndex(); settings.m_rcFilterIndex = response.getFcdProSettings()->getRcFilterIndex();
} }
@ -972,6 +978,8 @@ void FCDProInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& res
response.getFcdProSettings()->setGain4Index(settings.m_gain4Index); response.getFcdProSettings()->setGain4Index(settings.m_gain4Index);
response.getFcdProSettings()->setGain5Index(settings.m_gain5Index); response.getFcdProSettings()->setGain5Index(settings.m_gain5Index);
response.getFcdProSettings()->setGain6Index(settings.m_gain6Index); response.getFcdProSettings()->setGain6Index(settings.m_gain6Index);
response.getFcdProSettings()->setLog2Decim(settings.m_log2Decim);
response.getFcdProSettings()->setFcPos((int) settings.m_fcPos);
response.getFcdProSettings()->setRcFilterIndex(settings.m_rcFilterIndex); response.getFcdProSettings()->setRcFilterIndex(settings.m_rcFilterIndex);
response.getFcdProSettings()->setIfFilterIndex(settings.m_ifFilterIndex); response.getFcdProSettings()->setIfFilterIndex(settings.m_ifFilterIndex);
response.getFcdProSettings()->setDcBlock(settings.m_dcBlock ? 1 : 0); response.getFcdProSettings()->setDcBlock(settings.m_dcBlock ? 1 : 0);
@ -1044,6 +1052,12 @@ void FCDProInput::webapiReverseSendSettings(QList<QString>& deviceSettingsKeys,
if (deviceSettingsKeys.contains("gain6Index") || force) { if (deviceSettingsKeys.contains("gain6Index") || force) {
swgFCDProSettings->setGain6Index(settings.m_gain6Index); swgFCDProSettings->setGain6Index(settings.m_gain6Index);
} }
if (deviceSettingsKeys.contains("log2Decim") || force) {
swgFCDProSettings->setLog2Decim(settings.m_log2Decim);
}
if (deviceSettingsKeys.contains("fcPos") || force) {
swgFCDProSettings->setFcPos(settings.m_fcPos);
}
if (deviceSettingsKeys.contains("rcFilterIndex") || force) { if (deviceSettingsKeys.contains("rcFilterIndex") || force) {
swgFCDProSettings->setRcFilterIndex(settings.m_rcFilterIndex); swgFCDProSettings->setRcFilterIndex(settings.m_rcFilterIndex);
} }

View File

@ -601,6 +601,12 @@ int FCDProPlusInput::webapiSettingsPutPatch(
if (deviceSettingsKeys.contains("centerFrequency")) { if (deviceSettingsKeys.contains("centerFrequency")) {
settings.m_centerFrequency = response.getFcdProPlusSettings()->getCenterFrequency(); settings.m_centerFrequency = response.getFcdProPlusSettings()->getCenterFrequency();
} }
if (deviceSettingsKeys.contains("log2Decim")) {
settings.m_log2Decim = response.getFcdProPlusSettings()->getLog2Decim();
}
if (deviceSettingsKeys.contains("fcPos")) {
settings.m_fcPos = (FCDProPlusSettings::fcPos_t) response.getFcdProPlusSettings()->getFcPos();
}
if (deviceSettingsKeys.contains("rangeLow")) { if (deviceSettingsKeys.contains("rangeLow")) {
settings.m_rangeLow = response.getFcdProPlusSettings()->getRangeLow() != 0; settings.m_rangeLow = response.getFcdProPlusSettings()->getRangeLow() != 0;
} }
@ -657,6 +663,8 @@ int FCDProPlusInput::webapiSettingsPutPatch(
void FCDProPlusInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& response, const FCDProPlusSettings& settings) void FCDProPlusInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& response, const FCDProPlusSettings& settings)
{ {
response.getFcdProPlusSettings()->setCenterFrequency(settings.m_centerFrequency); response.getFcdProPlusSettings()->setCenterFrequency(settings.m_centerFrequency);
response.getFcdProPlusSettings()->setLog2Decim(settings.m_log2Decim);
response.getFcdProPlusSettings()->setFcPos((int) settings.m_fcPos);
response.getFcdProPlusSettings()->setRangeLow(settings.m_rangeLow ? 1 : 0); response.getFcdProPlusSettings()->setRangeLow(settings.m_rangeLow ? 1 : 0);
response.getFcdProPlusSettings()->setLnaGain(settings.m_lnaGain ? 1 : 0); response.getFcdProPlusSettings()->setLnaGain(settings.m_lnaGain ? 1 : 0);
response.getFcdProPlusSettings()->setMixGain(settings.m_mixGain ? 1 : 0); response.getFcdProPlusSettings()->setMixGain(settings.m_mixGain ? 1 : 0);
@ -690,6 +698,12 @@ void FCDProPlusInput::webapiReverseSendSettings(QList<QString>& deviceSettingsKe
if (deviceSettingsKeys.contains("centerFrequency") || force) { if (deviceSettingsKeys.contains("centerFrequency") || force) {
swgFCDProPlusSettings->setCenterFrequency(settings.m_centerFrequency); swgFCDProPlusSettings->setCenterFrequency(settings.m_centerFrequency);
} }
if (deviceSettingsKeys.contains("log2Decim") || force) {
swgFCDProPlusSettings->setLog2Decim(settings.m_log2Decim);
}
if (deviceSettingsKeys.contains("fcPos") || force) {
swgFCDProPlusSettings->setFcPos((int) settings.m_fcPos);
}
if (deviceSettingsKeys.contains("rangeLow") || force) { if (deviceSettingsKeys.contains("rangeLow") || force) {
swgFCDProPlusSettings->setRangeLow(settings.m_rangeLow ? 1 : 0); swgFCDProPlusSettings->setRangeLow(settings.m_rangeLow ? 1 : 0);
} }

View File

@ -2344,6 +2344,12 @@ margin-bottom: 20px;
"type" : "integer", "type" : "integer",
"format" : "int64" "format" : "int64"
}, },
"log2Decim" : {
"type" : "integer"
},
"fcPos" : {
"type" : "integer"
},
"rangeLow" : { "rangeLow" : {
"type" : "integer", "type" : "integer",
"description" : "Range select (1 if low else 0)" "description" : "Range select (1 if low else 0)"
@ -2448,6 +2454,12 @@ margin-bottom: 20px;
"gain6Index" : { "gain6Index" : {
"type" : "integer" "type" : "integer"
}, },
"log2Decim" : {
"type" : "integer"
},
"fcPos" : {
"type" : "integer"
},
"dcBlock" : { "dcBlock" : {
"type" : "integer" "type" : "integer"
}, },
@ -24088,7 +24100,7 @@ except ApiException as e:
</div> </div>
<div id="generator"> <div id="generator">
<div class="content"> <div class="content">
Generated 2019-01-02T09:02:53.799+01:00 Generated 2019-01-05T09:23:57.596+01:00
</div> </div>
</div> </div>
</div> </div>

View File

@ -38,6 +38,10 @@ FCDProSettings:
type: integer type: integer
gain6Index: gain6Index:
type: integer type: integer
log2Decim:
type: integer
fcPos:
type: integer
dcBlock: dcBlock:
type: integer type: integer
iqCorrection: iqCorrection:
@ -46,7 +50,7 @@ FCDProSettings:
type: integer type: integer
transverterDeltaFrequency: transverterDeltaFrequency:
type: integer type: integer
format: int64 format: int64
fileRecordName: fileRecordName:
type: string type: string

View File

@ -4,6 +4,10 @@ FCDProPlusSettings:
centerFrequency: centerFrequency:
type: integer type: integer
format: int64 format: int64
log2Decim:
type: integer
fcPos:
type: integer
rangeLow: rangeLow:
description: Range select (1 if low else 0) description: Range select (1 if low else 0)
type: integer type: integer
@ -32,6 +36,6 @@ FCDProPlusSettings:
type: integer type: integer
transverterDeltaFrequency: transverterDeltaFrequency:
type: integer type: integer
format: int64 format: int64
fileRecordName: fileRecordName:
type: string type: string

View File

@ -38,6 +38,10 @@ FCDProSettings:
type: integer type: integer
gain6Index: gain6Index:
type: integer type: integer
log2Decim:
type: integer
fcPos:
type: integer
dcBlock: dcBlock:
type: integer type: integer
iqCorrection: iqCorrection:
@ -46,7 +50,7 @@ FCDProSettings:
type: integer type: integer
transverterDeltaFrequency: transverterDeltaFrequency:
type: integer type: integer
format: int64 format: int64
fileRecordName: fileRecordName:
type: string type: string

View File

@ -4,6 +4,10 @@ FCDProPlusSettings:
centerFrequency: centerFrequency:
type: integer type: integer
format: int64 format: int64
log2Decim:
type: integer
fcPos:
type: integer
rangeLow: rangeLow:
description: Range select (1 if low else 0) description: Range select (1 if low else 0)
type: integer type: integer
@ -32,6 +36,6 @@ FCDProPlusSettings:
type: integer type: integer
transverterDeltaFrequency: transverterDeltaFrequency:
type: integer type: integer
format: int64 format: int64
fileRecordName: fileRecordName:
type: string type: string

View File

@ -2344,6 +2344,12 @@ margin-bottom: 20px;
"type" : "integer", "type" : "integer",
"format" : "int64" "format" : "int64"
}, },
"log2Decim" : {
"type" : "integer"
},
"fcPos" : {
"type" : "integer"
},
"rangeLow" : { "rangeLow" : {
"type" : "integer", "type" : "integer",
"description" : "Range select (1 if low else 0)" "description" : "Range select (1 if low else 0)"
@ -2448,6 +2454,12 @@ margin-bottom: 20px;
"gain6Index" : { "gain6Index" : {
"type" : "integer" "type" : "integer"
}, },
"log2Decim" : {
"type" : "integer"
},
"fcPos" : {
"type" : "integer"
},
"dcBlock" : { "dcBlock" : {
"type" : "integer" "type" : "integer"
}, },
@ -24088,7 +24100,7 @@ except ApiException as e:
</div> </div>
<div id="generator"> <div id="generator">
<div class="content"> <div class="content">
Generated 2019-01-02T09:02:53.799+01:00 Generated 2019-01-05T09:23:57.596+01:00
</div> </div>
</div> </div>
</div> </div>

View File

@ -30,6 +30,10 @@ SWGFCDProPlusSettings::SWGFCDProPlusSettings(QString* json) {
SWGFCDProPlusSettings::SWGFCDProPlusSettings() { SWGFCDProPlusSettings::SWGFCDProPlusSettings() {
center_frequency = 0L; center_frequency = 0L;
m_center_frequency_isSet = false; m_center_frequency_isSet = false;
log2_decim = 0;
m_log2_decim_isSet = false;
fc_pos = 0;
m_fc_pos_isSet = false;
range_low = 0; range_low = 0;
m_range_low_isSet = false; m_range_low_isSet = false;
lna_gain = 0; lna_gain = 0;
@ -66,6 +70,10 @@ void
SWGFCDProPlusSettings::init() { SWGFCDProPlusSettings::init() {
center_frequency = 0L; center_frequency = 0L;
m_center_frequency_isSet = false; m_center_frequency_isSet = false;
log2_decim = 0;
m_log2_decim_isSet = false;
fc_pos = 0;
m_fc_pos_isSet = false;
range_low = 0; range_low = 0;
m_range_low_isSet = false; m_range_low_isSet = false;
lna_gain = 0; lna_gain = 0;
@ -109,6 +117,8 @@ SWGFCDProPlusSettings::cleanup() {
if(file_record_name != nullptr) { if(file_record_name != nullptr) {
delete file_record_name; delete file_record_name;
} }
@ -127,6 +137,10 @@ void
SWGFCDProPlusSettings::fromJsonObject(QJsonObject &pJson) { SWGFCDProPlusSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&center_frequency, pJson["centerFrequency"], "qint64", ""); ::SWGSDRangel::setValue(&center_frequency, pJson["centerFrequency"], "qint64", "");
::SWGSDRangel::setValue(&log2_decim, pJson["log2Decim"], "qint32", "");
::SWGSDRangel::setValue(&fc_pos, pJson["fcPos"], "qint32", "");
::SWGSDRangel::setValue(&range_low, pJson["rangeLow"], "qint32", ""); ::SWGSDRangel::setValue(&range_low, pJson["rangeLow"], "qint32", "");
::SWGSDRangel::setValue(&lna_gain, pJson["lnaGain"], "qint32", ""); ::SWGSDRangel::setValue(&lna_gain, pJson["lnaGain"], "qint32", "");
@ -172,6 +186,12 @@ SWGFCDProPlusSettings::asJsonObject() {
if(m_center_frequency_isSet){ if(m_center_frequency_isSet){
obj->insert("centerFrequency", QJsonValue(center_frequency)); obj->insert("centerFrequency", QJsonValue(center_frequency));
} }
if(m_log2_decim_isSet){
obj->insert("log2Decim", QJsonValue(log2_decim));
}
if(m_fc_pos_isSet){
obj->insert("fcPos", QJsonValue(fc_pos));
}
if(m_range_low_isSet){ if(m_range_low_isSet){
obj->insert("rangeLow", QJsonValue(range_low)); obj->insert("rangeLow", QJsonValue(range_low));
} }
@ -225,6 +245,26 @@ SWGFCDProPlusSettings::setCenterFrequency(qint64 center_frequency) {
this->m_center_frequency_isSet = true; this->m_center_frequency_isSet = true;
} }
qint32
SWGFCDProPlusSettings::getLog2Decim() {
return log2_decim;
}
void
SWGFCDProPlusSettings::setLog2Decim(qint32 log2_decim) {
this->log2_decim = log2_decim;
this->m_log2_decim_isSet = true;
}
qint32
SWGFCDProPlusSettings::getFcPos() {
return fc_pos;
}
void
SWGFCDProPlusSettings::setFcPos(qint32 fc_pos) {
this->fc_pos = fc_pos;
this->m_fc_pos_isSet = true;
}
qint32 qint32
SWGFCDProPlusSettings::getRangeLow() { SWGFCDProPlusSettings::getRangeLow() {
return range_low; return range_low;
@ -361,6 +401,8 @@ SWGFCDProPlusSettings::isSet(){
bool isObjectUpdated = false; bool isObjectUpdated = false;
do{ do{
if(m_center_frequency_isSet){ isObjectUpdated = true; break;} if(m_center_frequency_isSet){ isObjectUpdated = true; break;}
if(m_log2_decim_isSet){ isObjectUpdated = true; break;}
if(m_fc_pos_isSet){ isObjectUpdated = true; break;}
if(m_range_low_isSet){ isObjectUpdated = true; break;} if(m_range_low_isSet){ isObjectUpdated = true; break;}
if(m_lna_gain_isSet){ isObjectUpdated = true; break;} if(m_lna_gain_isSet){ isObjectUpdated = true; break;}
if(m_mix_gain_isSet){ isObjectUpdated = true; break;} if(m_mix_gain_isSet){ isObjectUpdated = true; break;}

View File

@ -45,6 +45,12 @@ public:
qint64 getCenterFrequency(); qint64 getCenterFrequency();
void setCenterFrequency(qint64 center_frequency); void setCenterFrequency(qint64 center_frequency);
qint32 getLog2Decim();
void setLog2Decim(qint32 log2_decim);
qint32 getFcPos();
void setFcPos(qint32 fc_pos);
qint32 getRangeLow(); qint32 getRangeLow();
void setRangeLow(qint32 range_low); void setRangeLow(qint32 range_low);
@ -91,6 +97,12 @@ private:
qint64 center_frequency; qint64 center_frequency;
bool m_center_frequency_isSet; bool m_center_frequency_isSet;
qint32 log2_decim;
bool m_log2_decim_isSet;
qint32 fc_pos;
bool m_fc_pos_isSet;
qint32 range_low; qint32 range_low;
bool m_range_low_isSet; bool m_range_low_isSet;

View File

@ -64,6 +64,10 @@ SWGFCDProSettings::SWGFCDProSettings() {
m_gain5_index_isSet = false; m_gain5_index_isSet = false;
gain6_index = 0; gain6_index = 0;
m_gain6_index_isSet = false; m_gain6_index_isSet = false;
log2_decim = 0;
m_log2_decim_isSet = false;
fc_pos = 0;
m_fc_pos_isSet = false;
dc_block = 0; dc_block = 0;
m_dc_block_isSet = false; m_dc_block_isSet = false;
iq_correction = 0; iq_correction = 0;
@ -118,6 +122,10 @@ SWGFCDProSettings::init() {
m_gain5_index_isSet = false; m_gain5_index_isSet = false;
gain6_index = 0; gain6_index = 0;
m_gain6_index_isSet = false; m_gain6_index_isSet = false;
log2_decim = 0;
m_log2_decim_isSet = false;
fc_pos = 0;
m_fc_pos_isSet = false;
dc_block = 0; dc_block = 0;
m_dc_block_isSet = false; m_dc_block_isSet = false;
iq_correction = 0; iq_correction = 0;
@ -151,6 +159,8 @@ SWGFCDProSettings::cleanup() {
@ -206,6 +216,10 @@ SWGFCDProSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&gain6_index, pJson["gain6Index"], "qint32", ""); ::SWGSDRangel::setValue(&gain6_index, pJson["gain6Index"], "qint32", "");
::SWGSDRangel::setValue(&log2_decim, pJson["log2Decim"], "qint32", "");
::SWGSDRangel::setValue(&fc_pos, pJson["fcPos"], "qint32", "");
::SWGSDRangel::setValue(&dc_block, pJson["dcBlock"], "qint32", ""); ::SWGSDRangel::setValue(&dc_block, pJson["dcBlock"], "qint32", "");
::SWGSDRangel::setValue(&iq_correction, pJson["iqCorrection"], "qint32", ""); ::SWGSDRangel::setValue(&iq_correction, pJson["iqCorrection"], "qint32", "");
@ -286,6 +300,12 @@ SWGFCDProSettings::asJsonObject() {
if(m_gain6_index_isSet){ if(m_gain6_index_isSet){
obj->insert("gain6Index", QJsonValue(gain6_index)); obj->insert("gain6Index", QJsonValue(gain6_index));
} }
if(m_log2_decim_isSet){
obj->insert("log2Decim", QJsonValue(log2_decim));
}
if(m_fc_pos_isSet){
obj->insert("fcPos", QJsonValue(fc_pos));
}
if(m_dc_block_isSet){ if(m_dc_block_isSet){
obj->insert("dcBlock", QJsonValue(dc_block)); obj->insert("dcBlock", QJsonValue(dc_block));
} }
@ -485,6 +505,26 @@ SWGFCDProSettings::setGain6Index(qint32 gain6_index) {
this->m_gain6_index_isSet = true; this->m_gain6_index_isSet = true;
} }
qint32
SWGFCDProSettings::getLog2Decim() {
return log2_decim;
}
void
SWGFCDProSettings::setLog2Decim(qint32 log2_decim) {
this->log2_decim = log2_decim;
this->m_log2_decim_isSet = true;
}
qint32
SWGFCDProSettings::getFcPos() {
return fc_pos;
}
void
SWGFCDProSettings::setFcPos(qint32 fc_pos) {
this->fc_pos = fc_pos;
this->m_fc_pos_isSet = true;
}
qint32 qint32
SWGFCDProSettings::getDcBlock() { SWGFCDProSettings::getDcBlock() {
return dc_block; return dc_block;
@ -558,6 +598,8 @@ SWGFCDProSettings::isSet(){
if(m_if_filter_index_isSet){ isObjectUpdated = true; break;} if(m_if_filter_index_isSet){ isObjectUpdated = true; break;}
if(m_gain5_index_isSet){ isObjectUpdated = true; break;} if(m_gain5_index_isSet){ isObjectUpdated = true; break;}
if(m_gain6_index_isSet){ isObjectUpdated = true; break;} if(m_gain6_index_isSet){ isObjectUpdated = true; break;}
if(m_log2_decim_isSet){ isObjectUpdated = true; break;}
if(m_fc_pos_isSet){ isObjectUpdated = true; break;}
if(m_dc_block_isSet){ isObjectUpdated = true; break;} if(m_dc_block_isSet){ isObjectUpdated = true; break;}
if(m_iq_correction_isSet){ isObjectUpdated = true; break;} if(m_iq_correction_isSet){ isObjectUpdated = true; break;}
if(m_transverter_mode_isSet){ isObjectUpdated = true; break;} if(m_transverter_mode_isSet){ isObjectUpdated = true; break;}

View File

@ -96,6 +96,12 @@ public:
qint32 getGain6Index(); qint32 getGain6Index();
void setGain6Index(qint32 gain6_index); void setGain6Index(qint32 gain6_index);
qint32 getLog2Decim();
void setLog2Decim(qint32 log2_decim);
qint32 getFcPos();
void setFcPos(qint32 fc_pos);
qint32 getDcBlock(); qint32 getDcBlock();
void setDcBlock(qint32 dc_block); void setDcBlock(qint32 dc_block);
@ -169,6 +175,12 @@ private:
qint32 gain6_index; qint32 gain6_index;
bool m_gain6_index_isSet; bool m_gain6_index_isSet;
qint32 log2_decim;
bool m_log2_decim_isSet;
qint32 fc_pos;
bool m_fc_pos_isSet;
qint32 dc_block; qint32 dc_block;
bool m_dc_block_isSet; bool m_dc_block_isSet;