1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-10 10:33:29 -05:00

ATV Modulator: changed rf filter sliders handling and value display

This commit is contained in:
f4exb 2017-03-20 04:31:57 +01:00
parent 63510968b5
commit 94d7170890
4 changed files with 29 additions and 13 deletions

View File

@ -651,7 +651,7 @@ void ATVMod::apply(bool force)
{ {
m_interpolatorDistanceRemain = 0; m_interpolatorDistanceRemain = 0;
m_interpolatorDistance = (Real) m_tvSampleRate / (Real) m_config.m_outputSampleRate; m_interpolatorDistance = (Real) m_tvSampleRate / (Real) m_config.m_outputSampleRate;
m_interpolator.create(48, m_interpolator.create(32,
m_tvSampleRate, m_tvSampleRate,
m_config.m_rfBandwidth / getRFBandwidthDivisor(m_config.m_atvModulation), m_config.m_rfBandwidth / getRFBandwidthDivisor(m_config.m_atvModulation),
3.0); 3.0);
@ -734,7 +734,7 @@ float ATVMod::getRFBandwidthDivisor(ATVModulation modulation)
case ATVModulationUSB: case ATVModulationUSB:
case ATVModulationVestigialLSB: case ATVModulationVestigialLSB:
case ATVModulationVestigialUSB: case ATVModulationVestigialUSB:
return 1.1f; return 1.05f;
break; break;
case ATVModulationAM: case ATVModulationAM:
case ATVModulationFM: case ATVModulationFM:

View File

@ -21,6 +21,8 @@
#include <QDebug> #include <QDebug>
#include <QMessageBox> #include <QMessageBox>
#include <cmath>
#include "device/devicesinkapi.h" #include "device/devicesinkapi.h"
#include "dsp/upchannelizer.h" #include "dsp/upchannelizer.h"
@ -221,18 +223,21 @@ void ATVModGUI::channelizerOutputSampleRateChanged()
void ATVModGUI::setRFFiltersSlidersRange(int sampleRate) 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) || if ((ui->modulation->currentIndex() == (int) ATVMod::ATVModulationLSB) ||
(ui->modulation->currentIndex() == (int) ATVMod::ATVModulationUSB) || (ui->modulation->currentIndex() == (int) ATVMod::ATVModulationUSB) ||
(ui->modulation->currentIndex() == (int) ATVMod::ATVModulationVestigialLSB) || (ui->modulation->currentIndex() == (int) ATVMod::ATVModulationVestigialLSB) ||
(ui->modulation->currentIndex() == (int) ATVMod::ATVModulationVestigialUSB)) (ui->modulation->currentIndex() == (int) ATVMod::ATVModulationVestigialUSB))
{ {
ui->rfBW->setMaximum(sampleRate / 200000); ui->rfBW->setMaximum(sampleRate / (2*m_rfSliderDivisor));
ui->rfOppBW->setMaximum(sampleRate / 200000); ui->rfOppBW->setMaximum(sampleRate / (2*m_rfSliderDivisor));
} }
else else
{ {
ui->rfBW->setMaximum(sampleRate / 100000); ui->rfBW->setMaximum(sampleRate / m_rfSliderDivisor);
ui->rfOppBW->setMaximum(sampleRate / 100000); ui->rfOppBW->setMaximum(sampleRate / m_rfSliderDivisor);
} }
} }
@ -314,7 +319,7 @@ void ATVModGUI::on_modulation_currentIndexChanged(int index)
void ATVModGUI::on_rfBW_valueChanged(int value) 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) 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) 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) if (ui->modulation->currentIndex() == (int) ATVMod::ATVModulationVestigialLSB)
{ {
@ -498,7 +503,8 @@ ATVModGUI::ATVModGUI(PluginAPI* pluginAPI, DeviceSinkAPI *deviceAPI, QWidget* pa
m_frameCount(0), m_frameCount(0),
m_tickCount(0), m_tickCount(0),
m_enableNavTime(false), m_enableNavTime(false),
m_camBusyFPSMessageBox(0) m_camBusyFPSMessageBox(0),
m_rfSliderDivisor(100000)
{ {
ui->setupUi(this); ui->setupUi(this);
setAttribute(Qt::WA_DeleteOnClose, true); setAttribute(Qt::WA_DeleteOnClose, true);
@ -571,8 +577,8 @@ void ATVModGUI::applySettings()
ui->deltaMinus->setChecked(m_channelMarker.getCenterFrequency() < 0); ui->deltaMinus->setChecked(m_channelMarker.getCenterFrequency() < 0);
m_atvMod->configure(m_atvMod->getInputMessageQueue(), m_atvMod->configure(m_atvMod->getInputMessageQueue(),
ui->rfBW->value() * 100000.0f, ui->rfBW->value() * m_rfSliderDivisor * 1.0f,
ui->rfOppBW->value() * 100000.0f, ui->rfOppBW->value() * m_rfSliderDivisor * 1.0f,
(ATVMod::ATVStd) ui->standard->currentIndex(), (ATVMod::ATVStd) ui->standard->currentIndex(),
(ATVMod::ATVModInput) ui->inputSelect->currentIndex(), (ATVMod::ATVModInput) ui->inputSelect->currentIndex(),
ui->uniformLevel->value() / 100.0f, ui->uniformLevel->value() / 100.0f,

View File

@ -111,6 +111,7 @@ private:
std::size_t m_tickCount; std::size_t m_tickCount;
bool m_enableNavTime; bool m_enableNavTime;
QMessageBox *m_camBusyFPSMessageBox; QMessageBox *m_camBusyFPSMessageBox;
int m_rfSliderDivisor;
explicit ATVModGUI(PluginAPI* pluginAPI, DeviceSinkAPI *deviceAPI, QWidget* parent = NULL); explicit ATVModGUI(PluginAPI* pluginAPI, DeviceSinkAPI *deviceAPI, QWidget* parent = NULL);
virtual ~ATVModGUI(); virtual ~ATVModGUI();

View File

@ -265,8 +265,17 @@
</item> </item>
<item> <item>
<widget class="QLabel" name="rfOppBWText"> <widget class="QLabel" name="rfOppBWText">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="text"> <property name="text">
<string>1.0</string> <string>0000k</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
@ -326,7 +335,7 @@
</size> </size>
</property> </property>
<property name="text"> <property name="text">
<string>1.0 MHz</string> <string>0000k</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>