1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-27 02:09:14 -05:00

Merge pull request #1638 from srcejon/heat_map_sample_rate

Heat map sample rate
This commit is contained in:
Edouard Griffiths 2023-03-28 16:36:03 +02:00 committed by GitHub
commit bb3b2fd0ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 24 deletions

View File

@ -109,7 +109,6 @@ bool HeatMapGUI::handleMessage(const Message& message)
DSPSignalNotification& notif = (DSPSignalNotification&) message; DSPSignalNotification& notif = (DSPSignalNotification&) message;
m_deviceCenterFrequency = notif.getCenterFrequency(); m_deviceCenterFrequency = notif.getCenterFrequency();
m_basebandSampleRate = notif.getSampleRate(); m_basebandSampleRate = notif.getSampleRate();
ui->rfBW->setMaximum(m_basebandSampleRate/100);
ui->deltaFrequency->setValueRange(false, 7, -m_basebandSampleRate/2, m_basebandSampleRate/2); ui->deltaFrequency->setValueRange(false, 7, -m_basebandSampleRate/2, m_basebandSampleRate/2);
ui->deltaFrequencyLabel->setToolTip(tr("Range %1 %L2 Hz").arg(QChar(0xB1)).arg(m_basebandSampleRate/2)); ui->deltaFrequencyLabel->setToolTip(tr("Range %1 %L2 Hz").arg(QChar(0xB1)).arg(m_basebandSampleRate/2));
updateAbsoluteCenterFrequency(); updateAbsoluteCenterFrequency();
@ -211,14 +210,15 @@ void HeatMapGUI::on_averagePeriod_valueChanged(int value)
} }
const QStringList HeatMapGUI::m_sampleRateTexts = { const QStringList HeatMapGUI::m_sampleRateTexts = {
"10", "100", "1k", "10k", "100k", "1M" "100", "1k", "10k", "100k", "1M", "10M"
}; };
void HeatMapGUI::on_sampleRate_valueChanged(int value) void HeatMapGUI::on_sampleRate_valueChanged(int value)
{ {
m_settings.m_sampleRate = (int)std::pow(10.0f, (float)value); m_settings.m_sampleRate = (int)std::pow(10.0f, (float)value);
ui->sampleRateText->setText(m_sampleRateTexts[value-1]); ui->sampleRateText->setText(m_sampleRateTexts[value-2]); // value range is [2,7]
ui->averagePeriod->setMinimum(std::max(1, static_cast<int> ( m_averagePeriodTexts.size()) - value)); ui->averagePeriod->setMinimum(std::max(1, static_cast<int> (m_averagePeriodTexts.size()) - value));
ui->rfBW->setMaximum(m_settings.m_sampleRate/100);
m_scopeVis->setLiveRate(m_settings.m_sampleRate); m_scopeVis->setLiveRate(m_settings.m_sampleRate);
applySettings(); applySettings();
} }
@ -695,7 +695,8 @@ void HeatMapGUI::displaySettings()
value = (int)std::log10(m_settings.m_sampleRate); value = (int)std::log10(m_settings.m_sampleRate);
ui->sampleRate->setValue(value); ui->sampleRate->setValue(value);
ui->sampleRateText->setText(m_sampleRateTexts[value-1]); int idx = std::min(std::max(0, value-2), m_sampleRateTexts.size() - 1);
ui->sampleRateText->setText(m_sampleRateTexts[idx]);
ui->averagePeriod->setMinimum(std::max(1, static_cast<int> (m_averagePeriodTexts.size()) - value)); ui->averagePeriod->setMinimum(std::max(1, static_cast<int> (m_averagePeriodTexts.size()) - value));
ui->txPosition->setChecked(m_settings.m_txPosValid); ui->txPosition->setChecked(m_settings.m_txPosValid);

View File

@ -334,14 +334,17 @@
<string>Sample rate</string> <string>Sample rate</string>
</property> </property>
<property name="minimum"> <property name="minimum">
<number>1</number> <number>2</number>
</property> </property>
<property name="maximum"> <property name="maximum">
<number>6</number> <number>7</number>
</property> </property>
<property name="pageStep"> <property name="pageStep">
<number>1</number> <number>1</number>
</property> </property>
<property name="value">
<number>5</number>
</property>
</widget> </widget>
</item> </item>
<item> <item>
@ -1542,6 +1545,11 @@
</widget> </widget>
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget>
<class>ButtonSwitch</class>
<extends>QToolButton</extends>
<header>gui/buttonswitch.h</header>
</customwidget>
<customwidget> <customwidget>
<class>RollupContents</class> <class>RollupContents</class>
<extends>QWidget</extends> <extends>QWidget</extends>
@ -1549,10 +1557,9 @@
<container>1</container> <container>1</container>
</customwidget> </customwidget>
<customwidget> <customwidget>
<class>LevelMeterSignalDB</class> <class>QChartView</class>
<extends>QWidget</extends> <extends>QGraphicsView</extends>
<header>gui/levelmeter.h</header> <header>QtCharts</header>
<container>1</container>
</customwidget> </customwidget>
<customwidget> <customwidget>
<class>ValueDialZ</class> <class>ValueDialZ</class>
@ -1560,6 +1567,12 @@
<header>gui/valuedialz.h</header> <header>gui/valuedialz.h</header>
<container>1</container> <container>1</container>
</customwidget> </customwidget>
<customwidget>
<class>LevelMeterSignalDB</class>
<extends>QWidget</extends>
<header>gui/levelmeter.h</header>
<container>1</container>
</customwidget>
<customwidget> <customwidget>
<class>GLScope</class> <class>GLScope</class>
<extends>QWidget</extends> <extends>QWidget</extends>
@ -1572,16 +1585,6 @@
<header>gui/glscopegui.h</header> <header>gui/glscopegui.h</header>
<container>1</container> <container>1</container>
</customwidget> </customwidget>
<customwidget>
<class>ButtonSwitch</class>
<extends>QToolButton</extends>
<header>gui/buttonswitch.h</header>
</customwidget>
<customwidget>
<class>QChartView</class>
<extends>QGraphicsView</extends>
<header>QtCharts</header>
</customwidget>
</customwidgets> </customwidgets>
<tabstops> <tabstops>
<tabstop>deltaFrequency</tabstop> <tabstop>deltaFrequency</tabstop>

View File

@ -40,7 +40,7 @@ void HeatMapSettings::resetToDefaults()
m_mode = Average; m_mode = Average;
m_pulseThreshold= -50.0f; m_pulseThreshold= -50.0f;
m_averagePeriodUS = 100000; m_averagePeriodUS = 100000;
m_sampleRate = 100; m_sampleRate = 100000;
m_txPosValid = false; m_txPosValid = false;
m_txLatitude = 0.0f; m_txLatitude = 0.0f;
m_txLongitude = 0.0f; m_txLongitude = 0.0f;
@ -138,7 +138,7 @@ bool HeatMapSettings::deserialize(const QByteArray& data)
d.readS32(6, (int*)&m_mode, (int)Average); d.readS32(6, (int*)&m_mode, (int)Average);
d.readFloat(7, &m_pulseThreshold, 50.0f); d.readFloat(7, &m_pulseThreshold, 50.0f);
d.readS32(8, &m_averagePeriodUS, 100000); d.readS32(8, &m_averagePeriodUS, 100000);
d.readS32(9, &m_sampleRate, 100); d.readS32(9, &m_sampleRate, 100000);
d.readBool(10, &m_txPosValid, false); d.readBool(10, &m_txPosValid, false);
d.readFloat(11, &m_txLatitude); d.readFloat(11, &m_txLatitude);
d.readFloat(12, &m_txLongitude); d.readFloat(12, &m_txLongitude);

View File

@ -49,7 +49,7 @@ Displays the heat map resolution in metres per pixel. Currently this is fixed at
<h3>6: SR - Sample Rate</h3> <h3>6: SR - Sample Rate</h3>
Sets the sample rate at which channel power is sampled and measured. Values range from 1MS/s to 100S/s in powers of 10. Sets the sample rate at which channel power is sampled and measured. Values range from 100S/s to 10MS/s in powers of 10.
<h3>7: Tavg - Average Time</h3> <h3>7: Tavg - Average Time</h3>