1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-22 08:04:49 -05:00

BladeRF2: REST API: implemented LO soft correction setting

This commit is contained in:
f4exb 2018-09-30 11:10:07 +02:00
parent e754dee625
commit 98a87bb860
10 changed files with 83 additions and 36 deletions

View File

@ -876,6 +876,9 @@ int BladeRF2Output::webapiSettingsPutPatch(
if (deviceSettingsKeys.contains("centerFrequency")) {
settings.m_centerFrequency = response.getBladeRf2OutputSettings()->getCenterFrequency();
}
if (deviceSettingsKeys.contains("LOppmTenths")) {
settings.m_LOppmTenths = response.getBladeRf2OutputSettings()->getLOppmTenths();
}
if (deviceSettingsKeys.contains("devSampleRate")) {
settings.m_devSampleRate = response.getBladeRf2OutputSettings()->getDevSampleRate();
}
@ -916,6 +919,7 @@ int BladeRF2Output::webapiReportGet(SWGSDRangel::SWGDeviceReport& response, QStr
void BladeRF2Output::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& response, const BladeRF2OutputSettings& settings)
{
response.getBladeRf2OutputSettings()->setCenterFrequency(settings.m_centerFrequency);
response.getBladeRf2OutputSettings()->setLOppmTenths(settings.m_LOppmTenths);
response.getBladeRf2OutputSettings()->setDevSampleRate(settings.m_devSampleRate);
response.getBladeRf2OutputSettings()->setBandwidth(settings.m_bandwidth);
response.getBladeRf2OutputSettings()->setLog2Interp(settings.m_log2Interp);

View File

@ -960,6 +960,9 @@ int BladeRF2Input::webapiSettingsPutPatch(
if (deviceSettingsKeys.contains("centerFrequency")) {
settings.m_centerFrequency = response.getBladeRf2InputSettings()->getCenterFrequency();
}
if (deviceSettingsKeys.contains("LOppmTenths")) {
settings.m_LOppmTenths = response.getBladeRf2InputSettings()->getLOppmTenths();
}
if (deviceSettingsKeys.contains("devSampleRate")) {
settings.m_devSampleRate = response.getBladeRf2InputSettings()->getDevSampleRate();
}
@ -1015,6 +1018,7 @@ int BladeRF2Input::webapiReportGet(SWGSDRangel::SWGDeviceReport& response, QStri
void BladeRF2Input::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& response, const BladeRF2InputSettings& settings)
{
response.getBladeRf2InputSettings()->setCenterFrequency(settings.m_centerFrequency);
response.getBladeRf2InputSettings()->setLOppmTenths(settings.m_LOppmTenths);
response.getBladeRf2InputSettings()->setDevSampleRate(settings.m_devSampleRate);
response.getBladeRf2InputSettings()->setBandwidth(settings.m_bandwidth);
response.getBladeRf2InputSettings()->setLog2Decim(settings.m_log2Decim);

View File

@ -1331,6 +1331,9 @@ margin-bottom: 20px;
"type" : "integer",
"format" : "int64"
},
"LOppmTenths" : {
"type" : "integer"
},
"devSampleRate" : {
"type" : "integer"
},
@ -1387,15 +1390,15 @@ margin-bottom: 20px;
"type" : "integer",
"format" : "int64"
},
"LOppmTenths" : {
"type" : "integer"
},
"devSampleRate" : {
"type" : "integer"
},
"bandwidth" : {
"type" : "integer"
},
"gainMode" : {
"type" : "integer"
},
"globalGain" : {
"type" : "integer"
},
@ -23225,7 +23228,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2018-09-29T10:10:59.386+02:00
Generated 2018-09-30T11:01:56.666+02:00
</div>
</div>
</div>

View File

@ -4,6 +4,8 @@ BladeRF2InputSettings:
centerFrequency:
type: integer
format: int64
LOppmTenths:
type: integer
devSampleRate:
type: integer
bandwidth:
@ -47,12 +49,12 @@ BladeRF2OutputSettings:
centerFrequency:
type: integer
format: int64
LOppmTenths:
type: integer
devSampleRate:
type: integer
bandwidth:
type: integer
gainMode:
type: integer
globalGain:
type: integer
biasTee:

View File

@ -4,6 +4,8 @@ BladeRF2InputSettings:
centerFrequency:
type: integer
format: int64
LOppmTenths:
type: integer
devSampleRate:
type: integer
bandwidth:
@ -47,6 +49,8 @@ BladeRF2OutputSettings:
centerFrequency:
type: integer
format: int64
LOppmTenths:
type: integer
devSampleRate:
type: integer
bandwidth:

View File

@ -1331,6 +1331,9 @@ margin-bottom: 20px;
"type" : "integer",
"format" : "int64"
},
"LOppmTenths" : {
"type" : "integer"
},
"devSampleRate" : {
"type" : "integer"
},
@ -1387,15 +1390,15 @@ margin-bottom: 20px;
"type" : "integer",
"format" : "int64"
},
"LOppmTenths" : {
"type" : "integer"
},
"devSampleRate" : {
"type" : "integer"
},
"bandwidth" : {
"type" : "integer"
},
"gainMode" : {
"type" : "integer"
},
"globalGain" : {
"type" : "integer"
},
@ -23225,7 +23228,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2018-09-29T10:10:59.386+02:00
Generated 2018-09-30T11:01:56.666+02:00
</div>
</div>
</div>

View File

@ -30,6 +30,8 @@ SWGBladeRF2InputSettings::SWGBladeRF2InputSettings(QString* json) {
SWGBladeRF2InputSettings::SWGBladeRF2InputSettings() {
center_frequency = 0L;
m_center_frequency_isSet = false;
l_oppm_tenths = 0;
m_l_oppm_tenths_isSet = false;
dev_sample_rate = 0;
m_dev_sample_rate_isSet = false;
bandwidth = 0;
@ -60,6 +62,8 @@ void
SWGBladeRF2InputSettings::init() {
center_frequency = 0L;
m_center_frequency_isSet = false;
l_oppm_tenths = 0;
m_l_oppm_tenths_isSet = false;
dev_sample_rate = 0;
m_dev_sample_rate_isSet = false;
bandwidth = 0;
@ -94,6 +98,7 @@ SWGBladeRF2InputSettings::cleanup() {
if(file_record_name != nullptr) {
delete file_record_name;
}
@ -112,6 +117,8 @@ void
SWGBladeRF2InputSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&center_frequency, pJson["centerFrequency"], "qint64", "");
::SWGSDRangel::setValue(&l_oppm_tenths, pJson["LOppmTenths"], "qint32", "");
::SWGSDRangel::setValue(&dev_sample_rate, pJson["devSampleRate"], "qint32", "");
::SWGSDRangel::setValue(&bandwidth, pJson["bandwidth"], "qint32", "");
@ -151,6 +158,9 @@ SWGBladeRF2InputSettings::asJsonObject() {
if(m_center_frequency_isSet){
obj->insert("centerFrequency", QJsonValue(center_frequency));
}
if(m_l_oppm_tenths_isSet){
obj->insert("LOppmTenths", QJsonValue(l_oppm_tenths));
}
if(m_dev_sample_rate_isSet){
obj->insert("devSampleRate", QJsonValue(dev_sample_rate));
}
@ -195,6 +205,16 @@ SWGBladeRF2InputSettings::setCenterFrequency(qint64 center_frequency) {
this->m_center_frequency_isSet = true;
}
qint32
SWGBladeRF2InputSettings::getLOppmTenths() {
return l_oppm_tenths;
}
void
SWGBladeRF2InputSettings::setLOppmTenths(qint32 l_oppm_tenths) {
this->l_oppm_tenths = l_oppm_tenths;
this->m_l_oppm_tenths_isSet = true;
}
qint32
SWGBladeRF2InputSettings::getDevSampleRate() {
return dev_sample_rate;
@ -301,6 +321,7 @@ SWGBladeRF2InputSettings::isSet(){
bool isObjectUpdated = false;
do{
if(m_center_frequency_isSet){ isObjectUpdated = true; break;}
if(m_l_oppm_tenths_isSet){ isObjectUpdated = true; break;}
if(m_dev_sample_rate_isSet){ isObjectUpdated = true; break;}
if(m_bandwidth_isSet){ isObjectUpdated = true; break;}
if(m_gain_mode_isSet){ isObjectUpdated = true; break;}

View File

@ -45,6 +45,9 @@ public:
qint64 getCenterFrequency();
void setCenterFrequency(qint64 center_frequency);
qint32 getLOppmTenths();
void setLOppmTenths(qint32 l_oppm_tenths);
qint32 getDevSampleRate();
void setDevSampleRate(qint32 dev_sample_rate);
@ -82,6 +85,9 @@ private:
qint64 center_frequency;
bool m_center_frequency_isSet;
qint32 l_oppm_tenths;
bool m_l_oppm_tenths_isSet;
qint32 dev_sample_rate;
bool m_dev_sample_rate_isSet;

View File

@ -30,12 +30,12 @@ SWGBladeRF2OutputSettings::SWGBladeRF2OutputSettings(QString* json) {
SWGBladeRF2OutputSettings::SWGBladeRF2OutputSettings() {
center_frequency = 0L;
m_center_frequency_isSet = false;
l_oppm_tenths = 0;
m_l_oppm_tenths_isSet = false;
dev_sample_rate = 0;
m_dev_sample_rate_isSet = false;
bandwidth = 0;
m_bandwidth_isSet = false;
gain_mode = 0;
m_gain_mode_isSet = false;
global_gain = 0;
m_global_gain_isSet = false;
bias_tee = 0;
@ -52,12 +52,12 @@ void
SWGBladeRF2OutputSettings::init() {
center_frequency = 0L;
m_center_frequency_isSet = false;
l_oppm_tenths = 0;
m_l_oppm_tenths_isSet = false;
dev_sample_rate = 0;
m_dev_sample_rate_isSet = false;
bandwidth = 0;
m_bandwidth_isSet = false;
gain_mode = 0;
m_gain_mode_isSet = false;
global_gain = 0;
m_global_gain_isSet = false;
bias_tee = 0;
@ -90,12 +90,12 @@ void
SWGBladeRF2OutputSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&center_frequency, pJson["centerFrequency"], "qint64", "");
::SWGSDRangel::setValue(&l_oppm_tenths, pJson["LOppmTenths"], "qint32", "");
::SWGSDRangel::setValue(&dev_sample_rate, pJson["devSampleRate"], "qint32", "");
::SWGSDRangel::setValue(&bandwidth, pJson["bandwidth"], "qint32", "");
::SWGSDRangel::setValue(&gain_mode, pJson["gainMode"], "qint32", "");
::SWGSDRangel::setValue(&global_gain, pJson["globalGain"], "qint32", "");
::SWGSDRangel::setValue(&bias_tee, pJson["biasTee"], "qint32", "");
@ -121,15 +121,15 @@ SWGBladeRF2OutputSettings::asJsonObject() {
if(m_center_frequency_isSet){
obj->insert("centerFrequency", QJsonValue(center_frequency));
}
if(m_l_oppm_tenths_isSet){
obj->insert("LOppmTenths", QJsonValue(l_oppm_tenths));
}
if(m_dev_sample_rate_isSet){
obj->insert("devSampleRate", QJsonValue(dev_sample_rate));
}
if(m_bandwidth_isSet){
obj->insert("bandwidth", QJsonValue(bandwidth));
}
if(m_gain_mode_isSet){
obj->insert("gainMode", QJsonValue(gain_mode));
}
if(m_global_gain_isSet){
obj->insert("globalGain", QJsonValue(global_gain));
}
@ -153,6 +153,16 @@ SWGBladeRF2OutputSettings::setCenterFrequency(qint64 center_frequency) {
this->m_center_frequency_isSet = true;
}
qint32
SWGBladeRF2OutputSettings::getLOppmTenths() {
return l_oppm_tenths;
}
void
SWGBladeRF2OutputSettings::setLOppmTenths(qint32 l_oppm_tenths) {
this->l_oppm_tenths = l_oppm_tenths;
this->m_l_oppm_tenths_isSet = true;
}
qint32
SWGBladeRF2OutputSettings::getDevSampleRate() {
return dev_sample_rate;
@ -173,16 +183,6 @@ SWGBladeRF2OutputSettings::setBandwidth(qint32 bandwidth) {
this->m_bandwidth_isSet = true;
}
qint32
SWGBladeRF2OutputSettings::getGainMode() {
return gain_mode;
}
void
SWGBladeRF2OutputSettings::setGainMode(qint32 gain_mode) {
this->gain_mode = gain_mode;
this->m_gain_mode_isSet = true;
}
qint32
SWGBladeRF2OutputSettings::getGlobalGain() {
return global_gain;
@ -219,9 +219,9 @@ SWGBladeRF2OutputSettings::isSet(){
bool isObjectUpdated = false;
do{
if(m_center_frequency_isSet){ isObjectUpdated = true; break;}
if(m_l_oppm_tenths_isSet){ isObjectUpdated = true; break;}
if(m_dev_sample_rate_isSet){ isObjectUpdated = true; break;}
if(m_bandwidth_isSet){ isObjectUpdated = true; break;}
if(m_gain_mode_isSet){ isObjectUpdated = true; break;}
if(m_global_gain_isSet){ isObjectUpdated = true; break;}
if(m_bias_tee_isSet){ isObjectUpdated = true; break;}
if(m_log2_interp_isSet){ isObjectUpdated = true; break;}

View File

@ -44,15 +44,15 @@ public:
qint64 getCenterFrequency();
void setCenterFrequency(qint64 center_frequency);
qint32 getLOppmTenths();
void setLOppmTenths(qint32 l_oppm_tenths);
qint32 getDevSampleRate();
void setDevSampleRate(qint32 dev_sample_rate);
qint32 getBandwidth();
void setBandwidth(qint32 bandwidth);
qint32 getGainMode();
void setGainMode(qint32 gain_mode);
qint32 getGlobalGain();
void setGlobalGain(qint32 global_gain);
@ -69,15 +69,15 @@ private:
qint64 center_frequency;
bool m_center_frequency_isSet;
qint32 l_oppm_tenths;
bool m_l_oppm_tenths_isSet;
qint32 dev_sample_rate;
bool m_dev_sample_rate_isSet;
qint32 bandwidth;
bool m_bandwidth_isSet;
qint32 gain_mode;
bool m_gain_mode_isSet;
qint32 global_gain;
bool m_global_gain_isSet;