mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-03-21 19:58:39 -04:00
ATV Demodulator: specify nominal number of lines and fps in the GUI to calculate line length
This commit is contained in:
parent
a9a59b7c23
commit
9c44e9a34d
5
debian/changelog
vendored
5
debian/changelog
vendored
@ -1,14 +1,15 @@
|
||||
sdrangel (3.3.2-1) unstable; urgency=medium
|
||||
|
||||
* ATV plugins: 405 lines mode
|
||||
* ATV demodulator: added a scope panel in a tab combo with the TV screen
|
||||
|
||||
-- Edouard Griffiths, F4EXB <f4exb06@gmail.com> Thu, 16 Mar 2017 23:14:18 +0100
|
||||
-- Edouard Griffiths, F4EXB <f4exb06@gmail.com> Wed, 22 Mar 2017 23:14:18 +0100
|
||||
|
||||
sdrangel (3.3.1-1) unstable; urgency=medium
|
||||
|
||||
* ATV plugins: SSB and vestigiial sideband support
|
||||
|
||||
-- Edouard Griffiths, F4EXB <f4exb06@gmail.com> Thu, 16 Mar 2017 23:14:18 +0100
|
||||
-- Edouard Griffiths, F4EXB <f4exb06@gmail.com> Sun, 19 Mar 2017 23:14:18 +0100
|
||||
|
||||
sdrangel (3.3.0-1) unstable; urgency=medium
|
||||
|
||||
|
@ -618,7 +618,7 @@ bool ATVDemod::handleMessage(const Message& cmd)
|
||||
<< " m_fltVoltLevelSynchroBlack:" << m_objConfig.m_fltVoltLevelSynchroBlack
|
||||
<< " m_fltVoltLevelSynchroTop:" << m_objConfig.m_fltVoltLevelSynchroTop
|
||||
<< " m_fltFramePerS:" << m_objConfig.m_fltFramePerS
|
||||
<< " m_fltLineDurationUs:" << m_objConfig.m_fltLineDurationUs
|
||||
<< " m_fltLineDurationUs:" << m_objConfig.m_fltLineDuration
|
||||
<< " m_fltRatioOfRowsToDisplay:" << m_objConfig.m_fltRatioOfRowsToDisplay
|
||||
<< " m_fltTopDurationUs:" << m_objConfig.m_fltTopDurationUs
|
||||
<< " m_blnHSync:" << m_objConfig.m_blnHSync
|
||||
@ -700,18 +700,19 @@ void ATVDemod::applySettings()
|
||||
}
|
||||
|
||||
if((m_objConfig.m_fltFramePerS != m_objRunning.m_fltFramePerS)
|
||||
|| (m_objConfig.m_fltLineDurationUs != m_objRunning.m_fltLineDurationUs)
|
||||
|| (m_objConfig.m_fltLineDuration != m_objRunning.m_fltLineDuration)
|
||||
|| (m_objConfig.m_intSampleRate != m_objRunning.m_intSampleRate)
|
||||
|| (m_objConfig.m_fltTopDurationUs != m_objRunning.m_fltTopDurationUs)
|
||||
|| (m_objConfig.m_fltRatioOfRowsToDisplay != m_objRunning.m_fltRatioOfRowsToDisplay))
|
||||
{
|
||||
m_objSettingsMutex.lock();
|
||||
|
||||
m_intNumberSamplePerLine = (int) ((m_objConfig.m_fltLineDurationUs * m_objConfig.m_intSampleRate) / m_fltSecondToUs);
|
||||
m_intNumberOfLines = (int) ((m_fltSecondToUs / m_objConfig.m_fltFramePerS) /round(m_objConfig.m_fltLineDurationUs));
|
||||
m_objRegisteredATVScreen->resizeATVScreen(m_intNumberSamplePerLine, m_intNumberOfLines);
|
||||
m_intNumberOfLines = (int) (1.0f / (m_objConfig.m_fltLineDuration * m_objConfig.m_fltFramePerS));
|
||||
m_intNumberSamplePerLine = (int) (m_objConfig.m_fltLineDuration * m_objConfig.m_intSampleRate);
|
||||
m_intNumberOfRowsToDisplay = (int) (m_objConfig.m_fltRatioOfRowsToDisplay * m_objConfig.m_fltLineDuration * m_objConfig.m_intSampleRate);
|
||||
|
||||
m_intNumberSamplePerTop = (int) ((m_objConfig.m_fltTopDurationUs * m_objConfig.m_intSampleRate) / m_fltSecondToUs);
|
||||
m_intNumberOfRowsToDisplay = (int) ((m_objConfig.m_fltRatioOfRowsToDisplay * m_objConfig.m_fltLineDurationUs * m_objConfig.m_intSampleRate) / m_fltSecondToUs);
|
||||
m_objRegisteredATVScreen->resizeATVScreen(m_intNumberSamplePerLine, m_intNumberOfLines);
|
||||
|
||||
m_intRowsLimit = m_intNumberOfLines-1;
|
||||
m_intImageIndex = 0;
|
||||
|
@ -55,7 +55,7 @@ public:
|
||||
struct ATVConfig
|
||||
{
|
||||
int m_intSampleRate;
|
||||
float m_fltLineDurationUs;
|
||||
float m_fltLineDuration;
|
||||
float m_fltTopDurationUs;
|
||||
float m_fltFramePerS;
|
||||
float m_fltRatioOfRowsToDisplay;
|
||||
@ -67,7 +67,7 @@ public:
|
||||
|
||||
ATVConfig() :
|
||||
m_intSampleRate(0),
|
||||
m_fltLineDurationUs(0.0f),
|
||||
m_fltLineDuration(0.0f),
|
||||
m_fltTopDurationUs(0.0f),
|
||||
m_fltFramePerS(0.0f),
|
||||
m_fltRatioOfRowsToDisplay(0.0f),
|
||||
@ -212,7 +212,7 @@ private:
|
||||
m_objMsgConfig.m_fltVoltLevelSynchroBlack = fltVoltLevelSynchroBlack;
|
||||
m_objMsgConfig.m_fltVoltLevelSynchroTop = fltVoltLevelSynchroTop;
|
||||
m_objMsgConfig.m_fltFramePerS = fltFramePerS;
|
||||
m_objMsgConfig.m_fltLineDurationUs = fltLineDurationUs;
|
||||
m_objMsgConfig.m_fltLineDuration = fltLineDurationUs;
|
||||
m_objMsgConfig.m_fltTopDurationUs = fltTopDurationUs;
|
||||
m_objMsgConfig.m_fltRatioOfRowsToDisplay = flatRatioOfRowsToDisplay;
|
||||
m_objMsgConfig.m_blnHSync = blnHSync;
|
||||
|
@ -94,6 +94,7 @@ void ATVDemodGUI::resetToDefaults()
|
||||
ui->bfo->setValue(0);
|
||||
|
||||
blockApplySettings(false);
|
||||
lineTimeUpdate();
|
||||
applySettings();
|
||||
}
|
||||
|
||||
@ -116,6 +117,7 @@ QByteArray ATVDemodGUI::serialize() const
|
||||
s.writeS32(13, ui->rfOppBW->value());
|
||||
s.writeS32(14, ui->bfo->value());
|
||||
s.writeBool(15, ui->invertVideo->isChecked());
|
||||
s.writeS32(16, ui->nbLines->currentIndex());
|
||||
|
||||
return s.final();
|
||||
}
|
||||
@ -175,10 +177,13 @@ bool ATVDemodGUI::deserialize(const QByteArray& arrData)
|
||||
ui->bfo->setValue(tmp);
|
||||
d.readBool(15, &booltmp, true);
|
||||
ui->invertVideo->setChecked(booltmp);
|
||||
d.readS32(16, &tmp, 0);
|
||||
ui->nbLines->setCurrentIndex(tmp);
|
||||
|
||||
blockApplySettings(false);
|
||||
m_objChannelMarker.blockSignals(false);
|
||||
|
||||
lineTimeUpdate();
|
||||
applySettings();
|
||||
return true;
|
||||
}
|
||||
@ -332,7 +337,7 @@ void ATVDemodGUI::applySettings()
|
||||
m_objChannelMarker.getCenterFrequency());
|
||||
|
||||
m_objATVDemod->configure(m_objATVDemod->getInputMessageQueue(),
|
||||
ui->lineTime->value() / 10.0f,
|
||||
getNominalLineTime(ui->nbLines->currentIndex(), ui->fps->currentIndex()) + ui->lineTime->value() * m_fltLineTimeMultiplier,
|
||||
ui->topTime->value() * 1.0f,
|
||||
(ui->fps->currentIndex() == 0) ? 25.0f : 30.0f,
|
||||
(ui->halfImage->checkState() == Qt::Checked) ? 0.5f : 1.0f,
|
||||
@ -463,9 +468,8 @@ void ATVDemodGUI::on_blackLevel_valueChanged(int value)
|
||||
|
||||
void ATVDemodGUI::on_lineTime_valueChanged(int value)
|
||||
{
|
||||
ui->lineTimeText->setText(QString("%1 uS").arg(((float) value) / 10.0f));
|
||||
lineTimeUpdate();
|
||||
applySettings();
|
||||
|
||||
}
|
||||
|
||||
void ATVDemodGUI::on_topTime_valueChanged(int value)
|
||||
@ -494,8 +498,15 @@ void ATVDemodGUI::on_halfImage_clicked()
|
||||
applySettings();
|
||||
}
|
||||
|
||||
void ATVDemodGUI::on_nbLines_currentIndexChanged(int index)
|
||||
{
|
||||
lineTimeUpdate();
|
||||
applySettings();
|
||||
}
|
||||
|
||||
void ATVDemodGUI::on_fps_currentIndexChanged(int index)
|
||||
{
|
||||
lineTimeUpdate();
|
||||
applySettings();
|
||||
}
|
||||
|
||||
@ -564,3 +575,54 @@ void ATVDemodGUI::on_bfo_valueChanged(int value)
|
||||
applyRFSettings();
|
||||
}
|
||||
|
||||
void ATVDemodGUI::lineTimeUpdate()
|
||||
{
|
||||
float nominalLineTime = getNominalLineTime(ui->nbLines->currentIndex(), ui->fps->currentIndex());
|
||||
int lineTimeScaleFactor = (int) std::log10(nominalLineTime);
|
||||
m_fltLineTimeMultiplier = std::pow(10.0, lineTimeScaleFactor-3);
|
||||
|
||||
float lineTime = nominalLineTime + m_fltLineTimeMultiplier * ui->lineTime->value();
|
||||
|
||||
if(lineTime < 0.000001)
|
||||
ui->lineTimeText->setText(tr("%1 ns").arg(lineTime * 1000000000.0, 0, 'f', 1));
|
||||
else if(lineTime < 0.001)
|
||||
ui->lineTimeText->setText(tr("%1 µs").arg(lineTime * 1000000.0, 0, 'f', 1));
|
||||
else if(lineTime < 1.0)
|
||||
ui->lineTimeText->setText(tr("%1 ms").arg(lineTime * 1000.0, 0, 'f', 1));
|
||||
else
|
||||
ui->lineTimeText->setText(tr("%1 s").arg(lineTime * 1.0, 0, 'f', 1));
|
||||
}
|
||||
|
||||
float ATVDemodGUI::getFps(int fpsIndex)
|
||||
{
|
||||
switch(fpsIndex)
|
||||
{
|
||||
case 1:
|
||||
return 30.0f;
|
||||
break;
|
||||
case 0:
|
||||
default:
|
||||
return 25.0f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
float ATVDemodGUI::getNominalLineTime(int nbLinesIndex, int fpsIndex)
|
||||
{
|
||||
float fps = getFps(fpsIndex);
|
||||
|
||||
switch(nbLinesIndex)
|
||||
{
|
||||
case 1:
|
||||
return 1.0f / (525 * fps);
|
||||
break;
|
||||
case 2:
|
||||
return 1.0f / (405 * fps);
|
||||
break;
|
||||
case 0:
|
||||
default:
|
||||
return 1.0f / (625 * fps);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -73,6 +73,7 @@ private slots:
|
||||
void on_invertVideo_clicked();
|
||||
void on_halfImage_clicked();
|
||||
void on_modulation_currentIndexChanged(int index);
|
||||
void on_nbLines_currentIndexChanged(int index);
|
||||
void on_fps_currentIndexChanged(int index);
|
||||
void on_reset_clicked(bool checked);
|
||||
void on_rfBW_valueChanged(int value);
|
||||
@ -100,6 +101,8 @@ private:
|
||||
|
||||
ScopeVisNG* m_objScopeVis;
|
||||
|
||||
float m_fltLineTimeMultiplier;
|
||||
|
||||
explicit ATVDemodGUI(PluginAPI* objPluginAPI, DeviceSourceAPI *objDeviceAPI, QWidget* objParent = NULL);
|
||||
virtual ~ATVDemodGUI();
|
||||
|
||||
@ -108,6 +111,9 @@ private:
|
||||
void applyRFSettings();
|
||||
void setChannelMarkerBandwidth();
|
||||
void setRFFiltersSlidersRange(int sampleRate);
|
||||
void lineTimeUpdate();
|
||||
static float getFps(int fpsIndex);
|
||||
static float getNominalLineTime(int nbLinesIndex, int fpsIndex);
|
||||
|
||||
void leaveEvent(QEvent*);
|
||||
void enterEvent(QEvent*);
|
||||
|
@ -414,6 +414,28 @@
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="buttonsLayout">
|
||||
<item>
|
||||
<widget class="QComboBox" name="nbLines">
|
||||
<property name="toolTip">
|
||||
<string>Nominal number of lines per frame</string>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>625 L</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>525 L</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>405 L</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="fps">
|
||||
<property name="toolTip">
|
||||
@ -528,6 +550,9 @@
|
||||
</item>
|
||||
<item row="0" column="6">
|
||||
<widget class="QLabel" name="blackLevelText">
|
||||
<property name="toolTip">
|
||||
<string>Black level value</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p align="right">mV</p></body></html></string>
|
||||
</property>
|
||||
@ -538,6 +563,9 @@
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="synchLevelText">
|
||||
<property name="toolTip">
|
||||
<string>Horizontal synchronization level value</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p align="right">mV</p></body></html></string>
|
||||
</property>
|
||||
@ -592,13 +620,13 @@
|
||||
<item row="1" column="1">
|
||||
<widget class="QSlider" name="lineTime">
|
||||
<property name="toolTip">
|
||||
<string>Line length in time units</string>
|
||||
<string>Line length adjustment</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
<number>-100</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>1000</number>
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>1</number>
|
||||
@ -607,7 +635,10 @@
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>1</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="sliderPosition">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
@ -616,8 +647,17 @@
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QLabel" name="lineTimeText">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>55</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Effective line length value</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p align="right">uS</p></body></html></string>
|
||||
<string>us</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
@ -634,7 +674,7 @@
|
||||
<item row="1" column="5">
|
||||
<widget class="QSlider" name="topTime">
|
||||
<property name="toolTip">
|
||||
<string>Horizontal top length in time units</string>
|
||||
<string>Horizontal top length adjustment</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
@ -658,8 +698,17 @@
|
||||
</item>
|
||||
<item row="1" column="6">
|
||||
<widget class="QLabel" name="topTimeText">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>55</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Horizontal top length value</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p align="right">uS</p></body></html></string>
|
||||
<string><html><head/><body><p align="right">&mu;S</p></body></html></string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
|
Loading…
Reference in New Issue
Block a user