1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-09-28 15:56:33 -04:00

ATV Demod: arbitrary sample rate: GUI changes

This commit is contained in:
f4exb 2020-08-18 23:40:55 +02:00
parent 2c2ec0327c
commit a2a584440c
3 changed files with 13 additions and 11 deletions

View File

@ -139,7 +139,7 @@ void ATVDemodGUI::displaySettings()
ui->amScaleOffset->setValue(m_settings.m_amOffsetFactor); ui->amScaleOffset->setValue(m_settings.m_amOffsetFactor);
ui->amScaleOffsetText->setText(QString("%1").arg(m_settings.m_amOffsetFactor)); ui->amScaleOffsetText->setText(QString("%1").arg(m_settings.m_amOffsetFactor));
applyTVSampleRate(); applySampleRate();
m_doApplySettings = true; m_doApplySettings = true;
} }
@ -165,18 +165,20 @@ void ATVDemodGUI::displayRFBandwidths()
ui->rfOppBWText->setText(QString("%1k").arg((sliderPosition * m_rfSliderDivisor) / 1000.0, 0, 'f', 0)); ui->rfOppBWText->setText(QString("%1k").arg((sliderPosition * m_rfSliderDivisor) / 1000.0, 0, 'f', 0));
} }
void ATVDemodGUI::applyTVSampleRate() void ATVDemodGUI::applySampleRate()
{ {
qDebug("TVDemodGUI::applyTVSampleRate"); qDebug("ATVDemodGUI::applySampleRate");
unsigned int nbPointsPerLine; unsigned int nbPointsPerLine;
ATVDemodSettings::getBaseValues(m_basebandSampleRate, m_settings.m_fps*m_settings.m_nbLines, nbPointsPerLine); ATVDemodSettings::getBaseValues(m_basebandSampleRate, m_settings.m_fps*m_settings.m_nbLines, nbPointsPerLine);
float samplesPerLineFrac = (float) m_basebandSampleRate / (m_settings.m_nbLines * m_settings.m_fps) - nbPointsPerLine;
ui->tvSampleRateText->setText(tr("%1k").arg(m_basebandSampleRate/1000.0f, 0, 'f', 2)); ui->tvSampleRateText->setText(tr("%1k").arg(m_basebandSampleRate/1000.0f, 0, 'f', 2));
ui->nbPointsPerLineText->setText(tr("%1p").arg(nbPointsPerLine)); ui->nbPointsPerLineText->setText(tr("%1p+%2").arg(nbPointsPerLine).arg(samplesPerLineFrac, 0, 'f', 2));
m_scopeVis->setLiveRate(m_basebandSampleRate); m_scopeVis->setLiveRate(m_basebandSampleRate);
setRFFiltersSlidersRange(m_basebandSampleRate); setRFFiltersSlidersRange(m_basebandSampleRate);
displayRFBandwidths(); displayRFBandwidths();
lineTimeUpdate(); lineTimeUpdate();
topTimeUpdate(); topTimeUpdate();
setChannelMarkerBandwidth();
} }
bool ATVDemodGUI::handleMessage(const Message& message) bool ATVDemodGUI::handleMessage(const Message& message)
@ -185,7 +187,7 @@ bool ATVDemodGUI::handleMessage(const Message& message)
{ {
DSPSignalNotification& notif = (DSPSignalNotification&) message; DSPSignalNotification& notif = (DSPSignalNotification&) message;
m_basebandSampleRate = notif.getSampleRate(); m_basebandSampleRate = notif.getSampleRate();
applyTVSampleRate(); applySampleRate();
return true; return true;
} }
@ -453,14 +455,14 @@ void ATVDemodGUI::on_halfImage_clicked()
void ATVDemodGUI::on_nbLines_currentIndexChanged(int index) void ATVDemodGUI::on_nbLines_currentIndexChanged(int index)
{ {
m_settings.m_nbLines = ATVDemodSettings::getNumberOfLines(index); m_settings.m_nbLines = ATVDemodSettings::getNumberOfLines(index);
applyTVSampleRate(); applySampleRate();
applySettings(); applySettings();
} }
void ATVDemodGUI::on_fps_currentIndexChanged(int index) void ATVDemodGUI::on_fps_currentIndexChanged(int index)
{ {
m_settings.m_fps = ATVDemodSettings::getFps(index); m_settings.m_fps = ATVDemodSettings::getFps(index);
applyTVSampleRate(); applySampleRate();
applySettings(); applySettings();
} }

View File

@ -87,7 +87,7 @@ private:
void displaySettings(); void displaySettings();
void displayStreamIndex(); void displayStreamIndex();
void displayRFBandwidths(); void displayRFBandwidths();
void applyTVSampleRate(); void applySampleRate();
void setChannelMarkerBandwidth(); void setChannelMarkerBandwidth();
void setRFFiltersSlidersRange(int sampleRate); void setRFFiltersSlidersRange(int sampleRate);
void lineTimeUpdate(); void lineTimeUpdate();

View File

@ -137,15 +137,15 @@
<widget class="QLabel" name="nbPointsPerLineText"> <widget class="QLabel" name="nbPointsPerLineText">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>40</width> <width>80</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Number of points (samples) per line</string> <string>Number of integer points (samples) per line plus fractional part</string>
</property> </property>
<property name="text"> <property name="text">
<string>000p</string> <string>0000p+0.00</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>