mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-02-03 09:44:01 -05:00
ATV Modulator: changed rf filter sliders handling and value display
This commit is contained in:
parent
63510968b5
commit
94d7170890
@ -651,7 +651,7 @@ void ATVMod::apply(bool force)
|
||||
{
|
||||
m_interpolatorDistanceRemain = 0;
|
||||
m_interpolatorDistance = (Real) m_tvSampleRate / (Real) m_config.m_outputSampleRate;
|
||||
m_interpolator.create(48,
|
||||
m_interpolator.create(32,
|
||||
m_tvSampleRate,
|
||||
m_config.m_rfBandwidth / getRFBandwidthDivisor(m_config.m_atvModulation),
|
||||
3.0);
|
||||
@ -734,7 +734,7 @@ float ATVMod::getRFBandwidthDivisor(ATVModulation modulation)
|
||||
case ATVModulationUSB:
|
||||
case ATVModulationVestigialLSB:
|
||||
case ATVModulationVestigialUSB:
|
||||
return 1.1f;
|
||||
return 1.05f;
|
||||
break;
|
||||
case ATVModulationAM:
|
||||
case ATVModulationFM:
|
||||
|
@ -21,6 +21,8 @@
|
||||
#include <QDebug>
|
||||
#include <QMessageBox>
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include "device/devicesinkapi.h"
|
||||
#include "dsp/upchannelizer.h"
|
||||
|
||||
@ -221,18 +223,21 @@ void ATVModGUI::channelizerOutputSampleRateChanged()
|
||||
|
||||
void ATVModGUI::setRFFiltersSlidersRange(int sampleRate)
|
||||
{
|
||||
int scaleFactor = (int) std::log10(sampleRate);
|
||||
m_rfSliderDivisor = std::pow(10.0, scaleFactor-1);
|
||||
|
||||
if ((ui->modulation->currentIndex() == (int) ATVMod::ATVModulationLSB) ||
|
||||
(ui->modulation->currentIndex() == (int) ATVMod::ATVModulationUSB) ||
|
||||
(ui->modulation->currentIndex() == (int) ATVMod::ATVModulationVestigialLSB) ||
|
||||
(ui->modulation->currentIndex() == (int) ATVMod::ATVModulationVestigialUSB))
|
||||
{
|
||||
ui->rfBW->setMaximum(sampleRate / 200000);
|
||||
ui->rfOppBW->setMaximum(sampleRate / 200000);
|
||||
ui->rfBW->setMaximum(sampleRate / (2*m_rfSliderDivisor));
|
||||
ui->rfOppBW->setMaximum(sampleRate / (2*m_rfSliderDivisor));
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->rfBW->setMaximum(sampleRate / 100000);
|
||||
ui->rfOppBW->setMaximum(sampleRate / 100000);
|
||||
ui->rfBW->setMaximum(sampleRate / m_rfSliderDivisor);
|
||||
ui->rfOppBW->setMaximum(sampleRate / m_rfSliderDivisor);
|
||||
}
|
||||
}
|
||||
|
||||
@ -314,7 +319,7 @@ void ATVModGUI::on_modulation_currentIndexChanged(int index)
|
||||
|
||||
void ATVModGUI::on_rfBW_valueChanged(int value)
|
||||
{
|
||||
ui->rfBWText->setText(QString("%1 MHz").arg(value / 10.0, 0, 'f', 1));
|
||||
ui->rfBWText->setText(QString("%1k").arg((value*m_rfSliderDivisor) / 1000.0, 0, 'f', 0));
|
||||
|
||||
if (ui->modulation->currentIndex() == (int) ATVMod::ATVModulationLSB)
|
||||
{
|
||||
@ -342,7 +347,7 @@ void ATVModGUI::on_rfBW_valueChanged(int value)
|
||||
|
||||
void ATVModGUI::on_rfOppBW_valueChanged(int value)
|
||||
{
|
||||
ui->rfOppBWText->setText(QString("%1").arg(value / 10.0, 0, 'f', 1));
|
||||
ui->rfOppBWText->setText(QString("%1k").arg((value*m_rfSliderDivisor) / 1000.0, 0, 'f', 0));
|
||||
|
||||
if (ui->modulation->currentIndex() == (int) ATVMod::ATVModulationVestigialLSB)
|
||||
{
|
||||
@ -498,7 +503,8 @@ ATVModGUI::ATVModGUI(PluginAPI* pluginAPI, DeviceSinkAPI *deviceAPI, QWidget* pa
|
||||
m_frameCount(0),
|
||||
m_tickCount(0),
|
||||
m_enableNavTime(false),
|
||||
m_camBusyFPSMessageBox(0)
|
||||
m_camBusyFPSMessageBox(0),
|
||||
m_rfSliderDivisor(100000)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
@ -571,8 +577,8 @@ void ATVModGUI::applySettings()
|
||||
ui->deltaMinus->setChecked(m_channelMarker.getCenterFrequency() < 0);
|
||||
|
||||
m_atvMod->configure(m_atvMod->getInputMessageQueue(),
|
||||
ui->rfBW->value() * 100000.0f,
|
||||
ui->rfOppBW->value() * 100000.0f,
|
||||
ui->rfBW->value() * m_rfSliderDivisor * 1.0f,
|
||||
ui->rfOppBW->value() * m_rfSliderDivisor * 1.0f,
|
||||
(ATVMod::ATVStd) ui->standard->currentIndex(),
|
||||
(ATVMod::ATVModInput) ui->inputSelect->currentIndex(),
|
||||
ui->uniformLevel->value() / 100.0f,
|
||||
|
@ -111,6 +111,7 @@ private:
|
||||
std::size_t m_tickCount;
|
||||
bool m_enableNavTime;
|
||||
QMessageBox *m_camBusyFPSMessageBox;
|
||||
int m_rfSliderDivisor;
|
||||
|
||||
explicit ATVModGUI(PluginAPI* pluginAPI, DeviceSinkAPI *deviceAPI, QWidget* parent = NULL);
|
||||
virtual ~ATVModGUI();
|
||||
|
@ -265,8 +265,17 @@
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="rfOppBWText">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1.0</string>
|
||||
<string>0000k</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -326,7 +335,7 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1.0 MHz</string>
|
||||
<string>0000k</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
|
Loading…
Reference in New Issue
Block a user