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

Add loOffset to API

This commit is contained in:
Jon Beniston 2020-10-26 09:03:23 +00:00
parent 35380d4f36
commit 636c014427
9 changed files with 90 additions and 2 deletions

View File

@ -951,6 +951,9 @@ void USRPOutput::webapiUpdateDeviceSettings(
if (deviceSettingsKeys.contains("devSampleRate")) {
settings.m_devSampleRate = response.getUsrpOutputSettings()->getDevSampleRate();
}
if (deviceSettingsKeys.contains("loOffset")) {
settings.m_loOffset = response.getUsrpOutputSettings()->getLoOffset();
}
if (deviceSettingsKeys.contains("clockSource")) {
settings.m_clockSource = *response.getUsrpOutputSettings()->getClockSource();
}
@ -998,6 +1001,7 @@ void USRPOutput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& resp
response.getUsrpOutputSettings()->setAntennaPath(new QString(settings.m_antennaPath));
response.getUsrpOutputSettings()->setCenterFrequency(settings.m_centerFrequency);
response.getUsrpOutputSettings()->setDevSampleRate(settings.m_devSampleRate);
response.getUsrpOutputSettings()->setLoOffset(settings.m_loOffset);
response.getUsrpOutputSettings()->setClockSource(new QString(settings.m_clockSource));
response.getUsrpOutputSettings()->setGain(settings.m_gain);
response.getUsrpOutputSettings()->setLog2SoftInterp(settings.m_log2SoftInterp);
@ -1083,6 +1087,9 @@ void USRPOutput::webapiReverseSendSettings(QList<QString>& deviceSettingsKeys, c
if (deviceSettingsKeys.contains("devSampleRate") || force) {
swgUsrpOutputSettings->setDevSampleRate(settings.m_devSampleRate);
}
if (deviceSettingsKeys.contains("loOffset") || force) {
swgUsrpOutputSettings->setLoOffset(settings.m_loOffset);
}
if (deviceSettingsKeys.contains("clockSource") || force) {
swgUsrpOutputSettings->setClockSource(new QString(settings.m_clockSource));
}

View File

@ -1025,6 +1025,9 @@ void USRPInput::webapiUpdateDeviceSettings(
if (deviceSettingsKeys.contains("centerFrequency")) {
settings.m_centerFrequency = response.getUsrpInputSettings()->getCenterFrequency();
}
if (deviceSettingsKeys.contains("loOffset")) {
settings.m_loOffset = response.getUsrpInputSettings()->getLoOffset();
}
if (deviceSettingsKeys.contains("dcBlock")) {
settings.m_dcBlock = response.getUsrpInputSettings()->getDcBlock() != 0;
}
@ -1075,6 +1078,7 @@ void USRPInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& respo
response.getUsrpInputSettings()->setCenterFrequency(settings.m_centerFrequency);
response.getUsrpInputSettings()->setDcBlock(settings.m_dcBlock ? 1 : 0);
response.getUsrpInputSettings()->setDevSampleRate(settings.m_devSampleRate);
response.getUsrpInputSettings()->setLoOffset(settings.m_loOffset);
response.getUsrpInputSettings()->setClockSource(new QString(settings.m_clockSource));
response.getUsrpInputSettings()->setGain(settings.m_gain);
response.getUsrpInputSettings()->setGainMode((int) settings.m_gainMode);
@ -1171,6 +1175,9 @@ void USRPInput::webapiReverseSendSettings(QList<QString>& deviceSettingsKeys, co
if (deviceSettingsKeys.contains("centerFrequency") || force) {
swgUsrpInputSettings->setCenterFrequency(settings.m_centerFrequency);
}
if (deviceSettingsKeys.contains("loOffset") || force) {
swgUsrpInputSettings->setLoOffset(settings.m_loOffset);
}
if (deviceSettingsKeys.contains("dcBlock") || force) {
swgUsrpInputSettings->setDcBlock(settings.m_dcBlock ? 1 : 0);
}

View File

@ -7583,6 +7583,9 @@ margin-bottom: 20px;
"devSampleRate" : {
"type" : "integer"
},
"loOffset" : {
"type" : "integer"
},
"dcBlock" : {
"type" : "integer"
},
@ -7659,6 +7662,9 @@ margin-bottom: 20px;
"devSampleRate" : {
"type" : "integer"
},
"loOffset" : {
"type" : "integer"
},
"log2SoftInterp" : {
"type" : "integer"
},
@ -39969,7 +39975,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2020-10-11T08:49:12.690+02:00
Generated 2020-10-25T21:28:04.207+01:00
</div>
</div>
</div>

View File

@ -6,6 +6,8 @@ USRPInputSettings:
format: int64
devSampleRate:
type: integer
loOffset:
type: integer
dcBlock:
type: integer
iqCorrection:
@ -46,6 +48,8 @@ USRPOutputSettings:
format: int64
devSampleRate:
type: integer
loOffset:
type: integer
log2SoftInterp:
type: integer
lpfBW:

View File

@ -7583,6 +7583,9 @@ margin-bottom: 20px;
"devSampleRate" : {
"type" : "integer"
},
"loOffset" : {
"type" : "integer"
},
"dcBlock" : {
"type" : "integer"
},
@ -7659,6 +7662,9 @@ margin-bottom: 20px;
"devSampleRate" : {
"type" : "integer"
},
"loOffset" : {
"type" : "integer"
},
"log2SoftInterp" : {
"type" : "integer"
},
@ -39969,7 +39975,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2020-10-11T08:49:12.690+02:00
Generated 2020-10-25T21:28:04.207+01:00
</div>
</div>
</div>

View File

@ -32,6 +32,8 @@ SWGUSRPInputSettings::SWGUSRPInputSettings() {
m_center_frequency_isSet = false;
dev_sample_rate = 0;
m_dev_sample_rate_isSet = false;
lo_offset = 0;
m_lo_offset_isSet = false;
dc_block = 0;
m_dc_block_isSet = false;
iq_correction = 0;
@ -72,6 +74,8 @@ SWGUSRPInputSettings::init() {
m_center_frequency_isSet = false;
dev_sample_rate = 0;
m_dev_sample_rate_isSet = false;
lo_offset = 0;
m_lo_offset_isSet = false;
dc_block = 0;
m_dc_block_isSet = false;
iq_correction = 0;
@ -110,6 +114,7 @@ SWGUSRPInputSettings::cleanup() {
if(antenna_path != nullptr) {
delete antenna_path;
}
@ -143,6 +148,8 @@ SWGUSRPInputSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&dev_sample_rate, pJson["devSampleRate"], "qint32", "");
::SWGSDRangel::setValue(&lo_offset, pJson["loOffset"], "qint32", "");
::SWGSDRangel::setValue(&dc_block, pJson["dcBlock"], "qint32", "");
::SWGSDRangel::setValue(&iq_correction, pJson["iqCorrection"], "qint32", "");
@ -193,6 +200,9 @@ SWGUSRPInputSettings::asJsonObject() {
if(m_dev_sample_rate_isSet){
obj->insert("devSampleRate", QJsonValue(dev_sample_rate));
}
if(m_lo_offset_isSet){
obj->insert("loOffset", QJsonValue(lo_offset));
}
if(m_dc_block_isSet){
obj->insert("dcBlock", QJsonValue(dc_block));
}
@ -259,6 +269,16 @@ SWGUSRPInputSettings::setDevSampleRate(qint32 dev_sample_rate) {
this->m_dev_sample_rate_isSet = true;
}
qint32
SWGUSRPInputSettings::getLoOffset() {
return lo_offset;
}
void
SWGUSRPInputSettings::setLoOffset(qint32 lo_offset) {
this->lo_offset = lo_offset;
this->m_lo_offset_isSet = true;
}
qint32
SWGUSRPInputSettings::getDcBlock() {
return dc_block;
@ -410,6 +430,9 @@ SWGUSRPInputSettings::isSet(){
if(m_dev_sample_rate_isSet){
isObjectUpdated = true; break;
}
if(m_lo_offset_isSet){
isObjectUpdated = true; break;
}
if(m_dc_block_isSet){
isObjectUpdated = true; break;
}

View File

@ -48,6 +48,9 @@ public:
qint32 getDevSampleRate();
void setDevSampleRate(qint32 dev_sample_rate);
qint32 getLoOffset();
void setLoOffset(qint32 lo_offset);
qint32 getDcBlock();
void setDcBlock(qint32 dc_block);
@ -100,6 +103,9 @@ private:
qint32 dev_sample_rate;
bool m_dev_sample_rate_isSet;
qint32 lo_offset;
bool m_lo_offset_isSet;
qint32 dc_block;
bool m_dc_block_isSet;

View File

@ -32,6 +32,8 @@ SWGUSRPOutputSettings::SWGUSRPOutputSettings() {
m_center_frequency_isSet = false;
dev_sample_rate = 0;
m_dev_sample_rate_isSet = false;
lo_offset = 0;
m_lo_offset_isSet = false;
log2_soft_interp = 0;
m_log2_soft_interp_isSet = false;
lpf_bw = 0;
@ -66,6 +68,8 @@ SWGUSRPOutputSettings::init() {
m_center_frequency_isSet = false;
dev_sample_rate = 0;
m_dev_sample_rate_isSet = false;
lo_offset = 0;
m_lo_offset_isSet = false;
log2_soft_interp = 0;
m_log2_soft_interp_isSet = false;
lpf_bw = 0;
@ -97,6 +101,7 @@ SWGUSRPOutputSettings::cleanup() {
if(antenna_path != nullptr) {
delete antenna_path;
}
@ -128,6 +133,8 @@ SWGUSRPOutputSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&dev_sample_rate, pJson["devSampleRate"], "qint32", "");
::SWGSDRangel::setValue(&lo_offset, pJson["loOffset"], "qint32", "");
::SWGSDRangel::setValue(&log2_soft_interp, pJson["log2SoftInterp"], "qint32", "");
::SWGSDRangel::setValue(&lpf_bw, pJson["lpfBW"], "qint32", "");
@ -172,6 +179,9 @@ SWGUSRPOutputSettings::asJsonObject() {
if(m_dev_sample_rate_isSet){
obj->insert("devSampleRate", QJsonValue(dev_sample_rate));
}
if(m_lo_offset_isSet){
obj->insert("loOffset", QJsonValue(lo_offset));
}
if(m_log2_soft_interp_isSet){
obj->insert("log2SoftInterp", QJsonValue(log2_soft_interp));
}
@ -229,6 +239,16 @@ SWGUSRPOutputSettings::setDevSampleRate(qint32 dev_sample_rate) {
this->m_dev_sample_rate_isSet = true;
}
qint32
SWGUSRPOutputSettings::getLoOffset() {
return lo_offset;
}
void
SWGUSRPOutputSettings::setLoOffset(qint32 lo_offset) {
this->lo_offset = lo_offset;
this->m_lo_offset_isSet = true;
}
qint32
SWGUSRPOutputSettings::getLog2SoftInterp() {
return log2_soft_interp;
@ -350,6 +370,9 @@ SWGUSRPOutputSettings::isSet(){
if(m_dev_sample_rate_isSet){
isObjectUpdated = true; break;
}
if(m_lo_offset_isSet){
isObjectUpdated = true; break;
}
if(m_log2_soft_interp_isSet){
isObjectUpdated = true; break;
}

View File

@ -48,6 +48,9 @@ public:
qint32 getDevSampleRate();
void setDevSampleRate(qint32 dev_sample_rate);
qint32 getLoOffset();
void setLoOffset(qint32 lo_offset);
qint32 getLog2SoftInterp();
void setLog2SoftInterp(qint32 log2_soft_interp);
@ -91,6 +94,9 @@ private:
qint32 dev_sample_rate;
bool m_dev_sample_rate_isSet;
qint32 lo_offset;
bool m_lo_offset_isSet;
qint32 log2_soft_interp;
bool m_log2_soft_interp_isSet;