mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-07-09 20:35:29 -04:00
HackRF output: continuous sample rate setting
This commit is contained in:
parent
813d79a115
commit
f91eba5b10
@ -269,13 +269,13 @@ bool HackRFOutput::applySettings(const HackRFOutputSettings& settings, bool forc
|
|||||||
|
|
||||||
if (rc != HACKRF_SUCCESS)
|
if (rc != HACKRF_SUCCESS)
|
||||||
{
|
{
|
||||||
qCritical("HackRFOutput::applySettings: could not set sample rate to %d S/s: %s",
|
qCritical("HackRFOutput::applySettings: could not set sample rate to %llu S/s: %s",
|
||||||
settings.m_devSampleRate,
|
settings.m_devSampleRate,
|
||||||
hackrf_error_name(rc));
|
hackrf_error_name(rc));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
qDebug("HackRFOutput::applySettings: sample rate set to %d S/s",
|
qDebug("HackRFOutput::applySettings: sample rate set to %llu S/s",
|
||||||
settings.m_devSampleRate);
|
settings.m_devSampleRate);
|
||||||
m_hackRFThread->setSamplerate(settings.m_devSampleRate);
|
m_hackRFThread->setSamplerate(settings.m_devSampleRate);
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,9 @@ HackRFOutputGui::HackRFOutputGui(DeviceSinkAPI *deviceAPI, QWidget* parent) :
|
|||||||
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::ReverseGold));
|
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::ReverseGold));
|
||||||
ui->centerFrequency->setValueRange(7, 0U, 7250000U);
|
ui->centerFrequency->setValueRange(7, 0U, 7250000U);
|
||||||
|
|
||||||
|
ui->sampleRate->setColorMapper(ColorMapper(ColorMapper::ReverseGreenYellow));
|
||||||
|
ui->sampleRate->setValueRange(8, 2400000U, 20000000U);
|
||||||
|
|
||||||
connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware()));
|
connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware()));
|
||||||
connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus()));
|
connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus()));
|
||||||
m_statusTimer.start(500);
|
m_statusTimer.start(500);
|
||||||
@ -50,7 +53,6 @@ HackRFOutputGui::HackRFOutputGui(DeviceSinkAPI *deviceAPI, QWidget* parent) :
|
|||||||
|
|
||||||
m_deviceSampleSink = new HackRFOutput(m_deviceAPI);
|
m_deviceSampleSink = new HackRFOutput(m_deviceAPI);
|
||||||
|
|
||||||
displaySampleRates();
|
|
||||||
displayBandwidths();
|
displayBandwidths();
|
||||||
|
|
||||||
m_deviceAPI->setSink(m_deviceSampleSink);
|
m_deviceAPI->setSink(m_deviceSampleSink);
|
||||||
@ -156,7 +158,7 @@ void HackRFOutputGui::updateSampleRateAndFrequency()
|
|||||||
{
|
{
|
||||||
m_deviceAPI->getSpectrum()->setSampleRate(m_sampleRate);
|
m_deviceAPI->getSpectrum()->setSampleRate(m_sampleRate);
|
||||||
m_deviceAPI->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency);
|
m_deviceAPI->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency);
|
||||||
ui->deviceRateText->setText(tr("%1k").arg((float)m_sampleRate / 1000));
|
ui->deviceRateText->setText(QString("%1k").arg(QString::number(m_sampleRate/1000.0, 'f', 0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void HackRFOutputGui::displaySettings()
|
void HackRFOutputGui::displaySettings()
|
||||||
@ -166,11 +168,10 @@ void HackRFOutputGui::displaySettings()
|
|||||||
ui->LOppm->setValue(m_settings.m_LOppmTenths);
|
ui->LOppm->setValue(m_settings.m_LOppmTenths);
|
||||||
ui->LOppmText->setText(QString("%1").arg(QString::number(m_settings.m_LOppmTenths/10.0, 'f', 1)));
|
ui->LOppmText->setText(QString("%1").arg(QString::number(m_settings.m_LOppmTenths/10.0, 'f', 1)));
|
||||||
|
|
||||||
unsigned int sampleRateIndex = HackRFSampleRates::getRateIndex(m_settings.m_devSampleRate);
|
|
||||||
ui->sampleRate->setCurrentIndex(sampleRateIndex);
|
|
||||||
|
|
||||||
ui->biasT->setChecked(m_settings.m_biasT);
|
ui->biasT->setChecked(m_settings.m_biasT);
|
||||||
|
|
||||||
|
ui->sampleRate->setValue(m_settings.m_devSampleRate);
|
||||||
|
|
||||||
ui->interp->setCurrentIndex(m_settings.m_log2Interp);
|
ui->interp->setCurrentIndex(m_settings.m_log2Interp);
|
||||||
|
|
||||||
ui->lnaExt->setChecked(m_settings.m_lnaExt);
|
ui->lnaExt->setChecked(m_settings.m_lnaExt);
|
||||||
@ -181,29 +182,6 @@ void HackRFOutputGui::displaySettings()
|
|||||||
ui->bbFilter->setCurrentIndex(bandwidthIndex);
|
ui->bbFilter->setCurrentIndex(bandwidthIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HackRFOutputGui::displaySampleRates()
|
|
||||||
{
|
|
||||||
int savedIndex = HackRFSampleRates::getRateIndex(m_settings.m_devSampleRate);
|
|
||||||
ui->sampleRate->blockSignals(true);
|
|
||||||
ui->sampleRate->clear();
|
|
||||||
|
|
||||||
for (int i = 0; i < HackRFSampleRates::m_nb_rates; i++)
|
|
||||||
{
|
|
||||||
ui->sampleRate->addItem(QString("%1").arg(QString::number(HackRFSampleRates::m_rates[i] / 1000.0f, 'f', 0)));
|
|
||||||
}
|
|
||||||
|
|
||||||
ui->sampleRate->blockSignals(false);
|
|
||||||
|
|
||||||
if (savedIndex < HackRFSampleRates::m_nb_rates)
|
|
||||||
{
|
|
||||||
ui->sampleRate->setCurrentIndex(savedIndex);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ui->sampleRate->setCurrentIndex((int) HackRFSampleRates::m_nb_rates-1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void HackRFOutputGui::displayBandwidths()
|
void HackRFOutputGui::displayBandwidths()
|
||||||
{
|
{
|
||||||
int savedIndex = HackRFBandwidths::getBandwidthIndex(m_settings.m_bandwidth/1000);
|
int savedIndex = HackRFBandwidths::getBandwidthIndex(m_settings.m_bandwidth/1000);
|
||||||
@ -239,6 +217,12 @@ void HackRFOutputGui::on_centerFrequency_changed(quint64 value)
|
|||||||
sendSettings();
|
sendSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HackRFOutputGui::on_sampleRate_changed(quint64 value)
|
||||||
|
{
|
||||||
|
m_settings.m_devSampleRate = value;
|
||||||
|
sendSettings();
|
||||||
|
}
|
||||||
|
|
||||||
void HackRFOutputGui::on_LOppm_valueChanged(int value)
|
void HackRFOutputGui::on_LOppm_valueChanged(int value)
|
||||||
{
|
{
|
||||||
m_settings.m_LOppmTenths = value;
|
m_settings.m_LOppmTenths = value;
|
||||||
@ -246,13 +230,6 @@ void HackRFOutputGui::on_LOppm_valueChanged(int value)
|
|||||||
sendSettings();
|
sendSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
void HackRFOutputGui::on_sampleRate_currentIndexChanged(int index)
|
|
||||||
{
|
|
||||||
int newrate = HackRFSampleRates::getRate(index);
|
|
||||||
m_settings.m_devSampleRate = newrate;
|
|
||||||
sendSettings();
|
|
||||||
}
|
|
||||||
|
|
||||||
void HackRFOutputGui::on_bbFilter_currentIndexChanged(int index)
|
void HackRFOutputGui::on_bbFilter_currentIndexChanged(int index)
|
||||||
{
|
{
|
||||||
int newBandwidth = HackRFBandwidths::getBandwidth(index);
|
int newBandwidth = HackRFBandwidths::getBandwidth(index);
|
||||||
|
@ -70,7 +70,6 @@ private:
|
|||||||
int m_lastEngineState;
|
int m_lastEngineState;
|
||||||
|
|
||||||
void displaySettings();
|
void displaySettings();
|
||||||
void displaySampleRates();
|
|
||||||
void displayBandwidths();
|
void displayBandwidths();
|
||||||
void sendSettings();
|
void sendSettings();
|
||||||
void updateSampleRateAndFrequency();
|
void updateSampleRateAndFrequency();
|
||||||
@ -78,8 +77,8 @@ private:
|
|||||||
private slots:
|
private slots:
|
||||||
void handleDSPMessages();
|
void handleDSPMessages();
|
||||||
void on_centerFrequency_changed(quint64 value);
|
void on_centerFrequency_changed(quint64 value);
|
||||||
|
void on_sampleRate_changed(quint64 value);
|
||||||
void on_LOppm_valueChanged(int value);
|
void on_LOppm_valueChanged(int value);
|
||||||
void on_sampleRate_currentIndexChanged(int index);
|
|
||||||
void on_biasT_stateChanged(int state);
|
void on_biasT_stateChanged(int state);
|
||||||
void on_interp_currentIndexChanged(int index);
|
void on_interp_currentIndexChanged(int index);
|
||||||
void on_lnaExt_stateChanged(int state);
|
void on_lnaExt_stateChanged(int state);
|
||||||
|
@ -6,20 +6,20 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>260</width>
|
<width>320</width>
|
||||||
<height>210</height>
|
<height>300</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>260</width>
|
<width>320</width>
|
||||||
<height>210</height>
|
<height>300</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="font">
|
<property name="font">
|
||||||
@ -49,6 +49,9 @@
|
|||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_freq">
|
<layout class="QHBoxLayout" name="horizontalLayout_freq">
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="deviceUILayout">
|
<layout class="QVBoxLayout" name="deviceUILayout">
|
||||||
<item>
|
<item>
|
||||||
@ -163,6 +166,12 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QGridLayout" name="gridLayout_LOppm">
|
<layout class="QGridLayout" name="gridLayout_LOppm">
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>3</number>
|
<number>3</number>
|
||||||
</property>
|
</property>
|
||||||
@ -204,23 +213,22 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="Line" name="line_freq">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<layout class="QGridLayout" name="gridLayout_corr">
|
<layout class="QGridLayout" name="gridLayout_corr">
|
||||||
<item row="0" column="0">
|
<property name="topMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="label_interp">
|
<widget class="QLabel" name="label_interp">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Int</string>
|
<string>Int</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="3">
|
<item row="1" column="3">
|
||||||
<widget class="QCheckBox" name="biasT">
|
<widget class="QCheckBox" name="biasT">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Activate antenna bias tee</string>
|
<string>Activate antenna bias tee</string>
|
||||||
@ -233,7 +241,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="4">
|
<item row="1" column="4">
|
||||||
<widget class="QCheckBox" name="lnaExt">
|
<widget class="QCheckBox" name="lnaExt">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Extra LNA +14dB</string>
|
<string>Extra LNA +14dB</string>
|
||||||
@ -246,7 +254,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="2">
|
<item row="1" column="2">
|
||||||
<spacer name="horizontalSpacer_2">
|
<spacer name="horizontalSpacer_2">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
@ -259,7 +267,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QComboBox" name="interp">
|
<widget class="QComboBox" name="interp">
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
@ -308,11 +316,27 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QGridLayout" name="gridLayout_samplerate">
|
<widget class="Line" name="line_freq">
|
||||||
<property name="spacing">
|
<property name="orientation">
|
||||||
<number>3</number>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<item row="0" column="0">
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
<widget class="QLabel" name="sampleRateLabel">
|
<widget class="QLabel" name="sampleRateLabel">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||||
@ -321,39 +345,41 @@
|
|||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Rate</string>
|
<string>SR</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item>
|
||||||
<widget class="QComboBox" name="sampleRate">
|
<widget class="ValueDial" name="sampleRate" native="true">
|
||||||
<property name="maximumSize">
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>70</width>
|
<width>32</width>
|
||||||
<height>16777215</height>
|
<height>16</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip">
|
<property name="font">
|
||||||
<string>Device sample rate</string>
|
<font>
|
||||||
|
<family>Monospace</family>
|
||||||
|
<pointsize>12</pointsize>
|
||||||
|
</font>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="4">
|
<item>
|
||||||
<widget class="QLabel" name="bbFiltLabel">
|
<widget class="QLabel" name="sampleRateUnits_2">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>BBF</string>
|
<string>S/s</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="5">
|
<item>
|
||||||
<widget class="QComboBox" name="bbFilter">
|
<spacer name="horizontalSpacer_3">
|
||||||
<property name="toolTip">
|
|
||||||
<string>RF bandpas filter</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="3">
|
|
||||||
<spacer name="horizontalSpacer">
|
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
@ -365,10 +391,17 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="2">
|
<item>
|
||||||
<widget class="QLabel" name="sampleRateUnits">
|
<widget class="QLabel" name="bbFiltLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>kS/s</string>
|
<string>BBF</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="bbFilter">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>RF bandpas filter</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -383,6 +416,9 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QGridLayout" name="gridLayout_txvga" columnstretch="0,0,0">
|
<layout class="QGridLayout" name="gridLayout_txvga" columnstretch="0,0,0">
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>3</number>
|
<number>3</number>
|
||||||
</property>
|
</property>
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
const PluginDescriptor HackRFOutputPlugin::m_pluginDescriptor = {
|
const PluginDescriptor HackRFOutputPlugin::m_pluginDescriptor = {
|
||||||
QString("HackRF Output"),
|
QString("HackRF Output"),
|
||||||
QString("3.3.0"),
|
QString("3.3.3"),
|
||||||
QString("(c) Edouard Griffiths, F4EXB"),
|
QString("(c) Edouard Griffiths, F4EXB"),
|
||||||
QString("https://github.com/f4exb/sdrangel"),
|
QString("https://github.com/f4exb/sdrangel"),
|
||||||
true,
|
true,
|
||||||
|
@ -29,12 +29,12 @@ void HackRFOutputSettings::resetToDefaults()
|
|||||||
{
|
{
|
||||||
m_centerFrequency = 435000 * 1000;
|
m_centerFrequency = 435000 * 1000;
|
||||||
m_LOppmTenths = 0;
|
m_LOppmTenths = 0;
|
||||||
m_devSampleRate = 2400000;
|
|
||||||
m_biasT = false;
|
m_biasT = false;
|
||||||
m_log2Interp = 0;
|
m_log2Interp = 0;
|
||||||
m_lnaExt = false;
|
m_lnaExt = false;
|
||||||
m_vgaGain = 22;
|
m_vgaGain = 22;
|
||||||
m_bandwidth = 1750000;
|
m_bandwidth = 1750000;
|
||||||
|
m_devSampleRate = 2400000;
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray HackRFOutputSettings::serialize() const
|
QByteArray HackRFOutputSettings::serialize() const
|
||||||
@ -42,12 +42,12 @@ QByteArray HackRFOutputSettings::serialize() const
|
|||||||
SimpleSerializer s(1);
|
SimpleSerializer s(1);
|
||||||
|
|
||||||
s.writeS32(1, m_LOppmTenths);
|
s.writeS32(1, m_LOppmTenths);
|
||||||
s.writeU32(2, m_devSampleRate);
|
|
||||||
s.writeBool(3, m_biasT);
|
s.writeBool(3, m_biasT);
|
||||||
s.writeU32(4, m_log2Interp);
|
s.writeU32(4, m_log2Interp);
|
||||||
s.writeBool(5, m_lnaExt);
|
s.writeBool(5, m_lnaExt);
|
||||||
s.writeU32(6, m_vgaGain);
|
s.writeU32(6, m_vgaGain);
|
||||||
s.writeU32(7, m_bandwidth);
|
s.writeU32(7, m_bandwidth);
|
||||||
|
s.writeU64(8, m_devSampleRate);
|
||||||
|
|
||||||
return s.final();
|
return s.final();
|
||||||
}
|
}
|
||||||
@ -67,12 +67,12 @@ bool HackRFOutputSettings::deserialize(const QByteArray& data)
|
|||||||
int intval;
|
int intval;
|
||||||
|
|
||||||
d.readS32(1, &m_LOppmTenths, 0);
|
d.readS32(1, &m_LOppmTenths, 0);
|
||||||
d.readU32(2, &m_devSampleRate, 2400000);
|
|
||||||
d.readBool(3, &m_biasT, false);
|
d.readBool(3, &m_biasT, false);
|
||||||
d.readU32(4, &m_log2Interp, 0);
|
d.readU32(4, &m_log2Interp, 0);
|
||||||
d.readBool(5, &m_lnaExt, false);
|
d.readBool(5, &m_lnaExt, false);
|
||||||
d.readU32(6, &m_vgaGain, 30);
|
d.readU32(6, &m_vgaGain, 30);
|
||||||
d.readU32(7, &m_bandwidth, 1750000);
|
d.readU32(7, &m_bandwidth, 1750000);
|
||||||
|
d.readU64(8, &m_devSampleRate, 2400000);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -22,10 +22,10 @@
|
|||||||
struct HackRFOutputSettings {
|
struct HackRFOutputSettings {
|
||||||
quint64 m_centerFrequency;
|
quint64 m_centerFrequency;
|
||||||
qint32 m_LOppmTenths;
|
qint32 m_LOppmTenths;
|
||||||
quint32 m_devSampleRate;
|
|
||||||
quint32 m_bandwidth;
|
quint32 m_bandwidth;
|
||||||
quint32 m_vgaGain;
|
quint32 m_vgaGain;
|
||||||
quint32 m_log2Interp;
|
quint32 m_log2Interp;
|
||||||
|
quint64 m_devSampleRate;
|
||||||
bool m_biasT;
|
bool m_biasT;
|
||||||
bool m_lnaExt;
|
bool m_lnaExt;
|
||||||
|
|
||||||
|
@ -247,13 +247,6 @@ void HackRFInputGui::on_iqImbalance_toggled(bool checked)
|
|||||||
sendSettings();
|
sendSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
void HackRFInputGui::on_sampleRate_currentIndexChanged(int index)
|
|
||||||
{
|
|
||||||
// int newrate = HackRFSampleRates::getRate(index);
|
|
||||||
// m_settings.m_devOldSampleRate = newrate;
|
|
||||||
// sendSettings();
|
|
||||||
}
|
|
||||||
|
|
||||||
void HackRFInputGui::on_bbFilter_currentIndexChanged(int index)
|
void HackRFInputGui::on_bbFilter_currentIndexChanged(int index)
|
||||||
{
|
{
|
||||||
int newBandwidth = HackRFBandwidths::getBandwidth(index);
|
int newBandwidth = HackRFBandwidths::getBandwidth(index);
|
||||||
@ -279,7 +272,7 @@ void HackRFInputGui::on_centerFrequency_changed(quint64 value)
|
|||||||
sendSettings();
|
sendSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
void HackRFInputGui::on_newSampleRate_changed(quint64 value)
|
void HackRFInputGui::on_sampleRate_changed(quint64 value)
|
||||||
{
|
{
|
||||||
m_settings.m_devSampleRate = value;
|
m_settings.m_devSampleRate = value;
|
||||||
sendSettings();
|
sendSettings();
|
||||||
|
@ -78,11 +78,10 @@ private:
|
|||||||
private slots:
|
private slots:
|
||||||
void handleDSPMessages();
|
void handleDSPMessages();
|
||||||
void on_centerFrequency_changed(quint64 value);
|
void on_centerFrequency_changed(quint64 value);
|
||||||
void on_newSampleRate_changed(quint64 value);
|
void on_sampleRate_changed(quint64 value);
|
||||||
void on_LOppm_valueChanged(int value);
|
void on_LOppm_valueChanged(int value);
|
||||||
void on_dcOffset_toggled(bool checked);
|
void on_dcOffset_toggled(bool checked);
|
||||||
void on_iqImbalance_toggled(bool checked);
|
void on_iqImbalance_toggled(bool checked);
|
||||||
void on_sampleRate_currentIndexChanged(int index);
|
|
||||||
void on_biasT_stateChanged(int state);
|
void on_biasT_stateChanged(int state);
|
||||||
void on_decim_currentIndexChanged(int index);
|
void on_decim_currentIndexChanged(int index);
|
||||||
void on_fcPos_currentIndexChanged(int index);
|
void on_fcPos_currentIndexChanged(int index);
|
||||||
|
@ -29,7 +29,6 @@ void HackRFInputSettings::resetToDefaults()
|
|||||||
{
|
{
|
||||||
m_centerFrequency = 435000 * 1000;
|
m_centerFrequency = 435000 * 1000;
|
||||||
m_LOppmTenths = 0;
|
m_LOppmTenths = 0;
|
||||||
m_devOldSampleRate = 2400000;
|
|
||||||
m_biasT = false;
|
m_biasT = false;
|
||||||
m_log2Decim = 0;
|
m_log2Decim = 0;
|
||||||
m_fcPos = FC_POS_CENTER;
|
m_fcPos = FC_POS_CENTER;
|
||||||
@ -39,6 +38,7 @@ void HackRFInputSettings::resetToDefaults()
|
|||||||
m_vgaGain = 16;
|
m_vgaGain = 16;
|
||||||
m_dcBlock = false;
|
m_dcBlock = false;
|
||||||
m_iqCorrection = false;
|
m_iqCorrection = false;
|
||||||
|
m_devSampleRate = 2400000;
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray HackRFInputSettings::serialize() const
|
QByteArray HackRFInputSettings::serialize() const
|
||||||
@ -46,7 +46,6 @@ QByteArray HackRFInputSettings::serialize() const
|
|||||||
SimpleSerializer s(1);
|
SimpleSerializer s(1);
|
||||||
|
|
||||||
s.writeS32(1, m_LOppmTenths);
|
s.writeS32(1, m_LOppmTenths);
|
||||||
s.writeU32(2, m_devOldSampleRate);
|
|
||||||
s.writeBool(3, m_biasT);
|
s.writeBool(3, m_biasT);
|
||||||
s.writeU32(4, m_log2Decim);
|
s.writeU32(4, m_log2Decim);
|
||||||
s.writeS32(5, m_fcPos);
|
s.writeS32(5, m_fcPos);
|
||||||
@ -76,7 +75,6 @@ bool HackRFInputSettings::deserialize(const QByteArray& data)
|
|||||||
int intval;
|
int intval;
|
||||||
|
|
||||||
d.readS32(1, &m_LOppmTenths, 0);
|
d.readS32(1, &m_LOppmTenths, 0);
|
||||||
d.readU32(2, &m_devOldSampleRate, 2400000);
|
|
||||||
d.readBool(3, &m_biasT, false);
|
d.readBool(3, &m_biasT, false);
|
||||||
d.readU32(4, &m_log2Decim, 0);
|
d.readU32(4, &m_log2Decim, 0);
|
||||||
d.readS32(5, &intval, 0);
|
d.readS32(5, &intval, 0);
|
||||||
|
@ -28,7 +28,6 @@ struct HackRFInputSettings {
|
|||||||
|
|
||||||
quint64 m_centerFrequency;
|
quint64 m_centerFrequency;
|
||||||
qint32 m_LOppmTenths;
|
qint32 m_LOppmTenths;
|
||||||
quint32 m_devOldSampleRate;
|
|
||||||
quint32 m_bandwidth;
|
quint32 m_bandwidth;
|
||||||
quint32 m_lnaGain;
|
quint32 m_lnaGain;
|
||||||
quint32 m_vgaGain;
|
quint32 m_vgaGain;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user