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

BladeRF2: implemented transverter mode

This commit is contained in:
f4exb 2018-10-03 06:14:26 +02:00
parent 3f7cfb4dd8
commit c579d66b59
21 changed files with 348 additions and 22 deletions

View File

@ -686,6 +686,9 @@ bool BladeRF2Output::applySettings(const BladeRF2OutputSettings& settings, bool
struct bladerf *dev = m_deviceShared.m_dev->getDev();
int requestedChannel = m_deviceAPI->getItemIndex();
int nbChannels = getNbChannels();
qint64 deviceCenterFrequency = settings.m_centerFrequency;
deviceCenterFrequency -= settings.m_transverterMode ? settings.m_transverterDeltaFrequency : 0;
deviceCenterFrequency = deviceCenterFrequency < 0 ? 0 : deviceCenterFrequency;
if ((m_settings.m_devSampleRate != settings.m_devSampleRate) || (m_settings.m_log2Interp != settings.m_log2Interp) || force)
{
@ -778,6 +781,8 @@ bool BladeRF2Output::applySettings(const BladeRF2OutputSettings& settings, bool
}
if ((m_settings.m_centerFrequency != settings.m_centerFrequency)
|| (m_settings.m_transverterMode != settings.m_transverterMode)
|| (m_settings.m_transverterDeltaFrequency != settings.m_transverterDeltaFrequency)
|| (m_settings.m_LOppmTenths != settings.m_LOppmTenths)
|| (m_settings.m_devSampleRate != settings.m_devSampleRate) || force)
{
@ -786,7 +791,7 @@ bool BladeRF2Output::applySettings(const BladeRF2OutputSettings& settings, bool
if (dev != 0)
{
if (setDeviceCenterFrequency(dev, requestedChannel, settings.m_centerFrequency))
if (setDeviceCenterFrequency(dev, requestedChannel, deviceCenterFrequency))
{
if (getMessageQueueToGUI())
{
@ -869,6 +874,9 @@ bool BladeRF2Output::applySettings(const BladeRF2OutputSettings& settings, bool
m_settings = settings;
qDebug() << "BladeRF2Output::applySettings: "
<< " m_transverterMode: " << m_settings.m_transverterMode
<< " m_transverterDeltaFrequency: " << m_settings.m_transverterDeltaFrequency
<< " deviceCenterFrequency: " << deviceCenterFrequency
<< " m_centerFrequency: " << m_settings.m_centerFrequency << " Hz"
<< " m_LOppmTenths: " << m_settings.m_LOppmTenths
<< " m_bandwidth: " << m_settings.m_bandwidth
@ -931,6 +939,12 @@ int BladeRF2Output::webapiSettingsPutPatch(
if (deviceSettingsKeys.contains("globalGain")) {
settings.m_globalGain = response.getBladeRf2OutputSettings()->getGlobalGain();
}
if (deviceSettingsKeys.contains("transverterDeltaFrequency")) {
settings.m_transverterDeltaFrequency = response.getBladeRf2OutputSettings()->getTransverterDeltaFrequency();
}
if (deviceSettingsKeys.contains("transverterMode")) {
settings.m_transverterMode = response.getBladeRf2OutputSettings()->getTransverterMode() != 0;
}
MsgConfigureBladeRF2 *msg = MsgConfigureBladeRF2::create(settings, force);
m_inputMessageQueue.push(msg);
@ -962,6 +976,8 @@ void BladeRF2Output::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings&
response.getBladeRf2OutputSettings()->setLog2Interp(settings.m_log2Interp);
response.getBladeRf2OutputSettings()->setBiasTee(settings.m_biasTee ? 1 : 0);
response.getBladeRf2OutputSettings()->setGlobalGain(settings.m_globalGain);
response.getBladeRf2OutputSettings()->setTransverterDeltaFrequency(settings.m_transverterDeltaFrequency);
response.getBladeRf2OutputSettings()->setTransverterMode(settings.m_transverterMode ? 1 : 0);
}
void BladeRF2Output::webapiFormatDeviceReport(SWGSDRangel::SWGDeviceReport& response)

View File

@ -134,6 +134,32 @@ bool BladeRF2OutputGui::deserialize(const QByteArray& data)
}
}
void BladeRF2OutputGui::updateFrequencyLimits()
{
// values in kHz
uint64_t f_min, f_max;
int step;
qint64 deltaFrequency = m_settings.m_transverterMode ? m_settings.m_transverterDeltaFrequency/1000 : 0;
m_sampleSink->getFrequencyRange(f_min, f_max, step);
qint64 minLimit = f_min/1000 + deltaFrequency;
qint64 maxLimit = f_max/1000 + deltaFrequency;
minLimit = minLimit < 0 ? 0 : minLimit > 9999999 ? 9999999 : minLimit;
maxLimit = maxLimit < 0 ? 0 : maxLimit > 9999999 ? 9999999 : maxLimit;
qDebug("BladeRF2OutputGui::updateFrequencyLimits: delta: %lld min: %lld max: %lld", deltaFrequency, minLimit, maxLimit);
ui->centerFrequency->setValueRange(7, minLimit, maxLimit);
}
void BladeRF2OutputGui::setCenterFrequencySetting(uint64_t kHzValue)
{
int64_t centerFrequency = kHzValue*1000;
m_settings.m_centerFrequency = centerFrequency < 0 ? 0 : (uint64_t) centerFrequency;
ui->centerFrequency->setToolTip(QString("Main center frequency in kHz (LO: %1 kHz)").arg(centerFrequency/1000));
}
bool BladeRF2OutputGui::handleMessage(const Message& message)
{
if (BladeRF2Output::MsgConfigureBladeRF2::match(message))
@ -282,6 +308,16 @@ void BladeRF2OutputGui::on_gain_valueChanged(int value)
sendSettings();
}
void BladeRF2OutputGui::on_transverter_clicked()
{
m_settings.m_transverterMode = ui->transverter->getDeltaFrequencyAcive();
m_settings.m_transverterDeltaFrequency = ui->transverter->getDeltaFrequency();
qDebug("LimeSDRInputGUI::on_transverter_clicked: %lld Hz %s", m_settings.m_transverterDeltaFrequency, m_settings.m_transverterMode ? "on" : "off");
updateFrequencyLimits();
setCenterFrequencySetting(ui->centerFrequency->getValueNew());
sendSettings();
}
void BladeRF2OutputGui::on_startStop_toggled(bool checked)
{
if (m_doApplySettings)

View File

@ -70,6 +70,8 @@ private:
void displaySettings();
void sendSettings();
void updateSampleRateAndFrequency();
void updateFrequencyLimits();
void setCenterFrequencySetting(uint64_t kHzValue);
private slots:
void handleInputMessages();
@ -81,6 +83,7 @@ private slots:
void on_interp_currentIndexChanged(int index);
void on_gain_valueChanged(int value);
void on_startStop_toggled(bool checked);
void on_transverter_clicked();
void updateHardware();
void updateStatus();
};

View File

@ -261,16 +261,6 @@
</property>
</widget>
</item>
<item row="0" column="5">
<widget class="ButtonSwitch" name="biasTee">
<property name="toolTip">
<string>Bias Tee</string>
</property>
<property name="text">
<string>BT</string>
</property>
</widget>
</item>
<item row="0" column="4">
<spacer name="horizontalSpacer_2">
<property name="orientation">
@ -284,6 +274,22 @@
</property>
</spacer>
</item>
<item row="0" column="5">
<widget class="TransverterButton" name="transverter">
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolTip">
<string>Transverter frequency translation dialog</string>
</property>
<property name="text">
<string>X</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
@ -411,7 +417,7 @@
</layout>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_gain" columnstretch="0,0,0">
<layout class="QGridLayout" name="gridLayout_gain" columnstretch="0,0,0,0">
<property name="spacing">
<number>3</number>
</property>
@ -448,6 +454,16 @@
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="ButtonSwitch" name="biasTee">
<property name="toolTip">
<string>Bias Tee</string>
</property>
<property name="text">
<string>BT</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
@ -488,6 +504,11 @@
<extends>QToolButton</extends>
<header>gui/buttonswitch.h</header>
</customwidget>
<customwidget>
<class>TransverterButton</class>
<extends>QPushButton</extends>
<header>gui/transverterbutton.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="../../../sdrgui/resources/res.qrc"/>

View File

@ -34,6 +34,8 @@ void BladeRF2OutputSettings::resetToDefaults()
m_globalGain = -3;
m_biasTee = false;
m_log2Interp = 0;
m_transverterMode = false;
m_transverterDeltaFrequency = 0;
}
QByteArray BladeRF2OutputSettings::serialize() const
@ -46,6 +48,8 @@ QByteArray BladeRF2OutputSettings::serialize() const
s.writeS32(4, m_globalGain);
s.writeBool(5, m_biasTee);
s.writeU32(6, m_log2Interp);
s.writeBool(7, m_transverterMode);
s.writeS64(8, m_transverterDeltaFrequency);
return s.final();
}
@ -68,6 +72,8 @@ bool BladeRF2OutputSettings::deserialize(const QByteArray& data)
d.readS32(4, &m_globalGain);
d.readBool(5, &m_biasTee);
d.readU32(6, &m_log2Interp);
d.readBool(7, &m_transverterMode, false);
d.readS64(8, &m_transverterDeltaFrequency, 0);
return true;
}

View File

@ -28,6 +28,8 @@ struct BladeRF2OutputSettings {
int m_globalGain;
bool m_biasTee;
quint32 m_log2Interp;
bool m_transverterMode;
qint64 m_transverterDeltaFrequency;
BladeRF2OutputSettings();
void resetToDefaults();

View File

@ -590,9 +590,12 @@ bool LimeSDROutput::handleMessage(const Message& message)
m_settings.m_extClock = report.getExtClock();
m_settings.m_extClockFreq = report.getExtClockFeq();
DeviceLimeSDRShared::MsgReportClockSourceChange *reportToGUI = DeviceLimeSDRShared::MsgReportClockSourceChange::create(
m_settings.m_extClock, m_settings.m_extClockFreq);
getMessageQueueToGUI()->push(reportToGUI);
if (getMessageQueueToGUI())
{
DeviceLimeSDRShared::MsgReportClockSourceChange *reportToGUI = DeviceLimeSDRShared::MsgReportClockSourceChange::create(
m_settings.m_extClock, m_settings.m_extClockFreq);
getMessageQueueToGUI()->push(reportToGUI);
}
return true;
}

View File

@ -749,6 +749,9 @@ bool BladeRF2Input::applySettings(const BladeRF2InputSettings& settings, bool fo
struct bladerf *dev = m_deviceShared.m_dev->getDev();
int requestedChannel = m_deviceAPI->getItemIndex();
qint64 xlatedDeviceCenterFrequency = settings.m_centerFrequency;
xlatedDeviceCenterFrequency -= settings.m_transverterMode ? settings.m_transverterDeltaFrequency : 0;
xlatedDeviceCenterFrequency = xlatedDeviceCenterFrequency < 0 ? 0 : xlatedDeviceCenterFrequency;
if ((m_settings.m_dcBlock != settings.m_dcBlock) ||
(m_settings.m_iqCorrection != settings.m_iqCorrection) || force)
@ -824,13 +827,15 @@ bool BladeRF2Input::applySettings(const BladeRF2InputSettings& settings, bool fo
}
if ((m_settings.m_centerFrequency != settings.m_centerFrequency)
|| (m_settings.m_transverterMode != settings.m_transverterMode)
|| (m_settings.m_transverterDeltaFrequency != settings.m_transverterDeltaFrequency)
|| (m_settings.m_LOppmTenths != settings.m_LOppmTenths)
|| (m_settings.m_devSampleRate != settings.m_devSampleRate)
|| (m_settings.m_fcPos != settings.m_fcPos)
|| (m_settings.m_log2Decim != settings.m_log2Decim) || force)
{
qint64 deviceCenterFrequency = DeviceSampleSource::calculateDeviceCenterFrequency(
settings.m_centerFrequency,
xlatedDeviceCenterFrequency,
0,
settings.m_log2Decim,
(DeviceSampleSource::fcPos_t) settings.m_fcPos,
@ -943,6 +948,8 @@ bool BladeRF2Input::applySettings(const BladeRF2InputSettings& settings, bool fo
m_settings = settings;
qDebug() << "BladeRF2Input::applySettings: "
<< " m_transverterMode: " << m_settings.m_transverterMode
<< " m_transverterDeltaFrequency: " << m_settings.m_transverterDeltaFrequency
<< " m_centerFrequency: " << m_settings.m_centerFrequency << " Hz"
<< " m_LOppmTenths: " << m_settings.m_LOppmTenths
<< " m_bandwidth: " << m_settings.m_bandwidth
@ -1009,6 +1016,12 @@ int BladeRF2Input::webapiSettingsPutPatch(
if (deviceSettingsKeys.contains("globalGain")) {
settings.m_globalGain = response.getBladeRf2InputSettings()->getGlobalGain();
}
if (deviceSettingsKeys.contains("transverterDeltaFrequency")) {
settings.m_transverterDeltaFrequency = response.getBladeRf2InputSettings()->getTransverterDeltaFrequency();
}
if (deviceSettingsKeys.contains("transverterMode")) {
settings.m_transverterMode = response.getBladeRf2InputSettings()->getTransverterMode() != 0;
}
if (deviceSettingsKeys.contains("fileRecordName")) {
settings.m_fileRecordName = *response.getBladeRf1InputSettings()->getFileRecordName();
}
@ -1047,6 +1060,8 @@ void BladeRF2Input::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& r
response.getBladeRf2InputSettings()->setBiasTee(settings.m_biasTee ? 1 : 0);
response.getBladeRf2InputSettings()->setGainMode(settings.m_gainMode);
response.getBladeRf2InputSettings()->setGlobalGain(settings.m_globalGain);
response.getBladeRf2InputSettings()->setTransverterDeltaFrequency(settings.m_transverterDeltaFrequency);
response.getBladeRf2InputSettings()->setTransverterMode(settings.m_transverterMode ? 1 : 0);
if (response.getBladeRf2InputSettings()->getFileRecordName()) {
*response.getBladeRf2InputSettings()->getFileRecordName() = settings.m_fileRecordName;

View File

@ -146,6 +146,32 @@ bool BladeRF2InputGui::deserialize(const QByteArray& data)
}
}
void BladeRF2InputGui::updateFrequencyLimits()
{
// values in kHz
uint64_t f_min, f_max;
int step;
qint64 deltaFrequency = m_settings.m_transverterMode ? m_settings.m_transverterDeltaFrequency/1000 : 0;
m_sampleSource->getFrequencyRange(f_min, f_max, step);
qint64 minLimit = f_min/1000 + deltaFrequency;
qint64 maxLimit = f_max/1000 + deltaFrequency;
minLimit = minLimit < 0 ? 0 : minLimit > 9999999 ? 9999999 : minLimit;
maxLimit = maxLimit < 0 ? 0 : maxLimit > 9999999 ? 9999999 : maxLimit;
qDebug("BladeRF2OutputGui::updateFrequencyLimits: delta: %lld min: %lld max: %lld", deltaFrequency, minLimit, maxLimit);
ui->centerFrequency->setValueRange(7, minLimit, maxLimit);
}
void BladeRF2InputGui::setCenterFrequencySetting(uint64_t kHzValue)
{
int64_t centerFrequency = kHzValue*1000;
m_settings.m_centerFrequency = centerFrequency < 0 ? 0 : (uint64_t) centerFrequency;
ui->centerFrequency->setToolTip(QString("Main center frequency in kHz (LO: %1 kHz)").arg(centerFrequency/1000));
}
bool BladeRF2InputGui::handleMessage(const Message& message)
{
if (BladeRF2Input::MsgConfigureBladeRF2::match(message))
@ -355,6 +381,16 @@ void BladeRF2InputGui::on_gain_valueChanged(int value)
sendSettings();
}
void BladeRF2InputGui::on_transverter_clicked()
{
m_settings.m_transverterMode = ui->transverter->getDeltaFrequencyAcive();
m_settings.m_transverterDeltaFrequency = ui->transverter->getDeltaFrequency();
qDebug("LimeSDRInputGUI::on_transverter_clicked: %lld Hz %s", m_settings.m_transverterDeltaFrequency, m_settings.m_transverterMode ? "on" : "off");
updateFrequencyLimits();
setCenterFrequencySetting(ui->centerFrequency->getValueNew());
sendSettings();
}
void BladeRF2InputGui::on_startStop_toggled(bool checked)
{
if (m_doApplySettings)

View File

@ -69,6 +69,8 @@ private:
void displaySettings();
void sendSettings();
void updateSampleRateAndFrequency();
void updateFrequencyLimits();
void setCenterFrequencySetting(uint64_t kHzValue);
void blockApplySettings(bool block);
private slots:
@ -84,6 +86,7 @@ private slots:
void on_fcPos_currentIndexChanged(int index);
void on_gainMode_currentIndexChanged(int index);
void on_gain_valueChanged(int value);
void on_transverter_clicked();
void on_startStop_toggled(bool checked);
void on_record_toggled(bool checked);
void updateHardware();

View File

@ -310,12 +310,18 @@
</widget>
</item>
<item row="0" column="7">
<widget class="ButtonSwitch" name="biasTee">
<widget class="TransverterButton" name="transverter">
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolTip">
<string>Bias Tee</string>
<string>Transverter frequency translation dialog</string>
</property>
<property name="text">
<string>BT</string>
<string>X</string>
</property>
</widget>
</item>
@ -487,7 +493,7 @@
</layout>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_decim" columnstretch="0,0,0,0">
<layout class="QGridLayout" name="gridLayout_decim" columnstretch="0,0,0,0,0">
<property name="spacing">
<number>3</number>
</property>
@ -531,6 +537,16 @@
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="ButtonSwitch" name="biasTee">
<property name="toolTip">
<string>Bias Tee</string>
</property>
<property name="text">
<string>BT</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
@ -571,6 +587,11 @@
<extends>QToolButton</extends>
<header>gui/buttonswitch.h</header>
</customwidget>
<customwidget>
<class>TransverterButton</class>
<extends>QPushButton</extends>
<header>gui/transverterbutton.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="../../../sdrgui/resources/res.qrc"/>

View File

@ -36,6 +36,8 @@ void BladeRF2InputSettings::resetToDefaults()
m_fcPos = FC_POS_INFRA;
m_dcBlock = false;
m_iqCorrection = false;
m_transverterMode = false;
m_transverterDeltaFrequency = 0;
m_fileRecordName = "";
}
@ -53,6 +55,8 @@ QByteArray BladeRF2InputSettings::serialize() const
s.writeBool(8, m_dcBlock);
s.writeBool(9, m_iqCorrection);
s.writeS32(10, m_LOppmTenths);
s.writeBool(11, m_transverterMode);
s.writeS64(12, m_transverterDeltaFrequency);
return s.final();
}
@ -82,6 +86,8 @@ bool BladeRF2InputSettings::deserialize(const QByteArray& data)
d.readBool(8, &m_dcBlock);
d.readBool(9, &m_iqCorrection);
d.readS32(10, &m_LOppmTenths);
d.readBool(11, &m_transverterMode, false);
d.readS64(12, &m_transverterDeltaFrequency, 0);
return true;
}

View File

@ -39,6 +39,8 @@ struct BladeRF2InputSettings {
fcPos_t m_fcPos;
bool m_dcBlock;
bool m_iqCorrection;
bool m_transverterMode;
qint64 m_transverterDeltaFrequency;
QString m_fileRecordName;
BladeRF2InputSettings();

View File

@ -1361,6 +1361,13 @@ margin-bottom: 20px;
"iqCorrection" : {
"type" : "integer"
},
"transverterMode" : {
"type" : "integer"
},
"transverterDeltaFrequency" : {
"type" : "integer",
"format" : "int64"
},
"fileRecordName" : {
"type" : "string"
}
@ -1407,6 +1414,13 @@ margin-bottom: 20px;
},
"log2Interp" : {
"type" : "integer"
},
"transverterMode" : {
"type" : "integer"
},
"transverterDeltaFrequency" : {
"type" : "integer",
"format" : "int64"
}
},
"description" : "BladeRF2"
@ -23228,7 +23242,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2018-09-30T11:01:56.666+02:00
Generated 2018-10-03T06:02:12.961+02:00
</div>
</div>
</div>

View File

@ -24,6 +24,11 @@ BladeRF2InputSettings:
type: integer
iqCorrection:
type: integer
transverterMode:
type: integer
transverterDeltaFrequency:
type: integer
format: int64
fileRecordName:
type: string
@ -61,6 +66,11 @@ BladeRF2OutputSettings:
type: integer
log2Interp:
type: integer
transverterMode:
type: integer
transverterDeltaFrequency:
type: integer
format: int64
BladeRF2OutputReport:
description: BladeRF2

View File

@ -24,6 +24,11 @@ BladeRF2InputSettings:
type: integer
iqCorrection:
type: integer
transverterMode:
type: integer
transverterDeltaFrequency:
type: integer
format: int64
fileRecordName:
type: string
@ -61,6 +66,11 @@ BladeRF2OutputSettings:
type: integer
log2Interp:
type: integer
transverterMode:
type: integer
transverterDeltaFrequency:
type: integer
format: int64
BladeRF2OutputReport:
description: BladeRF2

View File

@ -1361,6 +1361,13 @@ margin-bottom: 20px;
"iqCorrection" : {
"type" : "integer"
},
"transverterMode" : {
"type" : "integer"
},
"transverterDeltaFrequency" : {
"type" : "integer",
"format" : "int64"
},
"fileRecordName" : {
"type" : "string"
}
@ -1407,6 +1414,13 @@ margin-bottom: 20px;
},
"log2Interp" : {
"type" : "integer"
},
"transverterMode" : {
"type" : "integer"
},
"transverterDeltaFrequency" : {
"type" : "integer",
"format" : "int64"
}
},
"description" : "BladeRF2"
@ -23228,7 +23242,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2018-09-30T11:01:56.666+02:00
Generated 2018-10-03T06:02:12.961+02:00
</div>
</div>
</div>

View File

@ -50,6 +50,10 @@ SWGBladeRF2InputSettings::SWGBladeRF2InputSettings() {
m_dc_block_isSet = false;
iq_correction = 0;
m_iq_correction_isSet = false;
transverter_mode = 0;
m_transverter_mode_isSet = false;
transverter_delta_frequency = 0L;
m_transverter_delta_frequency_isSet = false;
file_record_name = nullptr;
m_file_record_name_isSet = false;
}
@ -82,6 +86,10 @@ SWGBladeRF2InputSettings::init() {
m_dc_block_isSet = false;
iq_correction = 0;
m_iq_correction_isSet = false;
transverter_mode = 0;
m_transverter_mode_isSet = false;
transverter_delta_frequency = 0L;
m_transverter_delta_frequency_isSet = false;
file_record_name = new QString("");
m_file_record_name_isSet = false;
}
@ -99,6 +107,8 @@ SWGBladeRF2InputSettings::cleanup() {
if(file_record_name != nullptr) {
delete file_record_name;
}
@ -137,6 +147,10 @@ SWGBladeRF2InputSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&iq_correction, pJson["iqCorrection"], "qint32", "");
::SWGSDRangel::setValue(&transverter_mode, pJson["transverterMode"], "qint32", "");
::SWGSDRangel::setValue(&transverter_delta_frequency, pJson["transverterDeltaFrequency"], "qint64", "");
::SWGSDRangel::setValue(&file_record_name, pJson["fileRecordName"], "QString", "QString");
}
@ -188,6 +202,12 @@ SWGBladeRF2InputSettings::asJsonObject() {
if(m_iq_correction_isSet){
obj->insert("iqCorrection", QJsonValue(iq_correction));
}
if(m_transverter_mode_isSet){
obj->insert("transverterMode", QJsonValue(transverter_mode));
}
if(m_transverter_delta_frequency_isSet){
obj->insert("transverterDeltaFrequency", QJsonValue(transverter_delta_frequency));
}
if(file_record_name != nullptr && *file_record_name != QString("")){
toJsonValue(QString("fileRecordName"), file_record_name, obj, QString("QString"));
}
@ -305,6 +325,26 @@ SWGBladeRF2InputSettings::setIqCorrection(qint32 iq_correction) {
this->m_iq_correction_isSet = true;
}
qint32
SWGBladeRF2InputSettings::getTransverterMode() {
return transverter_mode;
}
void
SWGBladeRF2InputSettings::setTransverterMode(qint32 transverter_mode) {
this->transverter_mode = transverter_mode;
this->m_transverter_mode_isSet = true;
}
qint64
SWGBladeRF2InputSettings::getTransverterDeltaFrequency() {
return transverter_delta_frequency;
}
void
SWGBladeRF2InputSettings::setTransverterDeltaFrequency(qint64 transverter_delta_frequency) {
this->transverter_delta_frequency = transverter_delta_frequency;
this->m_transverter_delta_frequency_isSet = true;
}
QString*
SWGBladeRF2InputSettings::getFileRecordName() {
return file_record_name;
@ -331,6 +371,8 @@ SWGBladeRF2InputSettings::isSet(){
if(m_fc_pos_isSet){ isObjectUpdated = true; break;}
if(m_dc_block_isSet){ isObjectUpdated = true; break;}
if(m_iq_correction_isSet){ isObjectUpdated = true; break;}
if(m_transverter_mode_isSet){ isObjectUpdated = true; break;}
if(m_transverter_delta_frequency_isSet){ isObjectUpdated = true; break;}
if(file_record_name != nullptr && *file_record_name != QString("")){ isObjectUpdated = true; break;}
}while(false);
return isObjectUpdated;

View File

@ -75,6 +75,12 @@ public:
qint32 getIqCorrection();
void setIqCorrection(qint32 iq_correction);
qint32 getTransverterMode();
void setTransverterMode(qint32 transverter_mode);
qint64 getTransverterDeltaFrequency();
void setTransverterDeltaFrequency(qint64 transverter_delta_frequency);
QString* getFileRecordName();
void setFileRecordName(QString* file_record_name);
@ -115,6 +121,12 @@ private:
qint32 iq_correction;
bool m_iq_correction_isSet;
qint32 transverter_mode;
bool m_transverter_mode_isSet;
qint64 transverter_delta_frequency;
bool m_transverter_delta_frequency_isSet;
QString* file_record_name;
bool m_file_record_name_isSet;

View File

@ -42,6 +42,10 @@ SWGBladeRF2OutputSettings::SWGBladeRF2OutputSettings() {
m_bias_tee_isSet = false;
log2_interp = 0;
m_log2_interp_isSet = false;
transverter_mode = 0;
m_transverter_mode_isSet = false;
transverter_delta_frequency = 0L;
m_transverter_delta_frequency_isSet = false;
}
SWGBladeRF2OutputSettings::~SWGBladeRF2OutputSettings() {
@ -64,6 +68,10 @@ SWGBladeRF2OutputSettings::init() {
m_bias_tee_isSet = false;
log2_interp = 0;
m_log2_interp_isSet = false;
transverter_mode = 0;
m_transverter_mode_isSet = false;
transverter_delta_frequency = 0L;
m_transverter_delta_frequency_isSet = false;
}
void
@ -75,6 +83,8 @@ SWGBladeRF2OutputSettings::cleanup() {
}
SWGBladeRF2OutputSettings*
@ -102,6 +112,10 @@ SWGBladeRF2OutputSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&log2_interp, pJson["log2Interp"], "qint32", "");
::SWGSDRangel::setValue(&transverter_mode, pJson["transverterMode"], "qint32", "");
::SWGSDRangel::setValue(&transverter_delta_frequency, pJson["transverterDeltaFrequency"], "qint64", "");
}
QString
@ -139,6 +153,12 @@ SWGBladeRF2OutputSettings::asJsonObject() {
if(m_log2_interp_isSet){
obj->insert("log2Interp", QJsonValue(log2_interp));
}
if(m_transverter_mode_isSet){
obj->insert("transverterMode", QJsonValue(transverter_mode));
}
if(m_transverter_delta_frequency_isSet){
obj->insert("transverterDeltaFrequency", QJsonValue(transverter_delta_frequency));
}
return obj;
}
@ -213,6 +233,26 @@ SWGBladeRF2OutputSettings::setLog2Interp(qint32 log2_interp) {
this->m_log2_interp_isSet = true;
}
qint32
SWGBladeRF2OutputSettings::getTransverterMode() {
return transverter_mode;
}
void
SWGBladeRF2OutputSettings::setTransverterMode(qint32 transverter_mode) {
this->transverter_mode = transverter_mode;
this->m_transverter_mode_isSet = true;
}
qint64
SWGBladeRF2OutputSettings::getTransverterDeltaFrequency() {
return transverter_delta_frequency;
}
void
SWGBladeRF2OutputSettings::setTransverterDeltaFrequency(qint64 transverter_delta_frequency) {
this->transverter_delta_frequency = transverter_delta_frequency;
this->m_transverter_delta_frequency_isSet = true;
}
bool
SWGBladeRF2OutputSettings::isSet(){
@ -225,6 +265,8 @@ SWGBladeRF2OutputSettings::isSet(){
if(m_global_gain_isSet){ isObjectUpdated = true; break;}
if(m_bias_tee_isSet){ isObjectUpdated = true; break;}
if(m_log2_interp_isSet){ isObjectUpdated = true; break;}
if(m_transverter_mode_isSet){ isObjectUpdated = true; break;}
if(m_transverter_delta_frequency_isSet){ isObjectUpdated = true; break;}
}while(false);
return isObjectUpdated;
}

View File

@ -62,6 +62,12 @@ public:
qint32 getLog2Interp();
void setLog2Interp(qint32 log2_interp);
qint32 getTransverterMode();
void setTransverterMode(qint32 transverter_mode);
qint64 getTransverterDeltaFrequency();
void setTransverterDeltaFrequency(qint64 transverter_delta_frequency);
virtual bool isSet() override;
@ -87,6 +93,12 @@ private:
qint32 log2_interp;
bool m_log2_interp_isSet;
qint32 transverter_mode;
bool m_transverter_mode_isSet;
qint64 transverter_delta_frequency;
bool m_transverter_delta_frequency_isSet;
};
}