1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-16 05:11:49 -05:00

ATV Modulator: added display of points per line

This commit is contained in:
f4exb 2017-03-22 11:48:39 +01:00
parent 0ea39c217c
commit 2a08949245
5 changed files with 32 additions and 6 deletions

View File

@ -16,9 +16,10 @@
#include "devicehackrfvalues.h" #include "devicehackrfvalues.h"
const unsigned int HackRFSampleRates::m_nb_rates = 21; const unsigned int HackRFSampleRates::m_nb_rates = 22;
const unsigned int HackRFSampleRates::m_rates[HackRFSampleRates::m_nb_rates] = { const unsigned int HackRFSampleRates::m_rates[HackRFSampleRates::m_nb_rates] = {
2400000, 2400000,
2600000,
3000000, 3000000,
3150000, // for PAL-M 3150000, // for PAL-M
3200000, 3200000,

View File

@ -665,6 +665,7 @@ void ATVMod::apply(bool force)
int rateUnits, nbPointsPerRateUnit; int rateUnits, nbPointsPerRateUnit;
getBaseValues(m_config.m_nbLines * m_config.m_fps, rateUnits, nbPointsPerRateUnit); getBaseValues(m_config.m_nbLines * m_config.m_fps, rateUnits, nbPointsPerRateUnit);
m_tvSampleRate = (m_config.m_outputSampleRate / rateUnits) * rateUnits; // make sure working sample rate is a multiple of rate units m_tvSampleRate = (m_config.m_outputSampleRate / rateUnits) * rateUnits; // make sure working sample rate is a multiple of rate units
m_pointsPerLine = (m_tvSampleRate / rateUnits) * nbPointsPerRateUnit;
m_settingsMutex.lock(); m_settingsMutex.lock();
@ -690,7 +691,7 @@ void ATVMod::apply(bool force)
m_settingsMutex.unlock(); m_settingsMutex.unlock();
MsgReportEffectiveSampleRate *report; MsgReportEffectiveSampleRate *report;
report = MsgReportEffectiveSampleRate::create(m_tvSampleRate); report = MsgReportEffectiveSampleRate::create(m_tvSampleRate, m_pointsPerLine);
getOutputMessageQueue()->push(report); getOutputMessageQueue()->push(report);
} }

View File

@ -311,18 +311,23 @@ public:
public: public:
int getSampleRate() const { return m_sampleRate; } int getSampleRate() const { return m_sampleRate; }
uint32_t gatNbPointsPerLine() const { return m_nbPointsPerLine; }
static MsgReportEffectiveSampleRate* create(int sampleRate) static MsgReportEffectiveSampleRate* create(int sampleRate, uint32_t nbPointsPerLine)
{ {
return new MsgReportEffectiveSampleRate(sampleRate); return new MsgReportEffectiveSampleRate(sampleRate, nbPointsPerLine);
} }
protected: protected:
int m_sampleRate; int m_sampleRate;
uint32_t m_nbPointsPerLine;
MsgReportEffectiveSampleRate(int sampleRate) : MsgReportEffectiveSampleRate(
int sampleRate,
uint32_t nbPointsPerLine) :
Message(), Message(),
m_sampleRate(sampleRate) m_sampleRate(sampleRate),
m_nbPointsPerLine(nbPointsPerLine)
{ } { }
}; };
@ -556,6 +561,7 @@ private:
Real m_interpolatorDistance; Real m_interpolatorDistance;
Real m_interpolatorDistanceRemain; Real m_interpolatorDistanceRemain;
int m_tvSampleRate; //!< sample rate for generating signal int m_tvSampleRate; //!< sample rate for generating signal
uint32_t m_pointsPerLine; //!< Number of points per full line
uint32_t m_pointsPerSync; //!< number of line points for the horizontal sync uint32_t m_pointsPerSync; //!< number of line points for the horizontal sync
uint32_t m_pointsPerBP; //!< number of line points for the back porch uint32_t m_pointsPerBP; //!< number of line points for the back porch
uint32_t m_pointsPerImgLine; //!< number of line points for the image line uint32_t m_pointsPerImgLine; //!< number of line points for the image line

View File

@ -214,7 +214,9 @@ bool ATVModGUI::handleMessage(const Message& message)
else if (ATVMod::MsgReportEffectiveSampleRate::match(message)) else if (ATVMod::MsgReportEffectiveSampleRate::match(message))
{ {
int sampleRate = ((ATVMod::MsgReportEffectiveSampleRate&)message).getSampleRate(); int sampleRate = ((ATVMod::MsgReportEffectiveSampleRate&)message).getSampleRate();
uint32_t nbPointsPerLine = ((ATVMod::MsgReportEffectiveSampleRate&)message).gatNbPointsPerLine();
ui->channelSampleRateText->setText(tr("%1k").arg(sampleRate/1000.0f, 0, 'f', 0)); ui->channelSampleRateText->setText(tr("%1k").arg(sampleRate/1000.0f, 0, 'f', 0));
ui->nbPointsPerLineText->setText(tr("%1p").arg(nbPointsPerLine));
setRFFiltersSlidersRange(sampleRate); setRFFiltersSlidersRange(sampleRate);
return true; return true;
} }

View File

@ -146,6 +146,22 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QLabel" name="nbPointsPerLineText">
<property name="minimumSize">
<size>
<width>40</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>0000p</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item> <item>
<spacer name="horizontalSpacer"> <spacer name="horizontalSpacer">
<property name="orientation"> <property name="orientation">