mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-07-01 08:25:27 -04:00
ATV Demod: pass modulation type in the RF config
This commit is contained in:
parent
822610074d
commit
24d0e6a770
@ -103,12 +103,14 @@ void ATVDemod::configureRF(
|
|||||||
MessageQueue* objMessageQueue,
|
MessageQueue* objMessageQueue,
|
||||||
ATVModulation enmModulation,
|
ATVModulation enmModulation,
|
||||||
float fltRFBandwidth,
|
float fltRFBandwidth,
|
||||||
float fltRFOppBandwidth)
|
float fltRFOppBandwidth,
|
||||||
|
bool blnFFTFiltering)
|
||||||
{
|
{
|
||||||
Message* msgCmd = MsgConfigureRFATVDemod::create(
|
Message* msgCmd = MsgConfigureRFATVDemod::create(
|
||||||
enmModulation,
|
enmModulation,
|
||||||
fltRFBandwidth,
|
fltRFBandwidth,
|
||||||
fltRFOppBandwidth);
|
fltRFOppBandwidth,
|
||||||
|
blnFFTFiltering);
|
||||||
objMessageQueue->push(msgCmd);
|
objMessageQueue->push(msgCmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -188,7 +190,7 @@ void ATVDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
|
|||||||
|
|
||||||
fltNorm = sqrt(magSq);
|
fltNorm = sqrt(magSq);
|
||||||
|
|
||||||
if ((m_objRunning.m_enmModulation == ATV_FM1) || (m_objRunning.m_enmModulation == ATV_FM2))
|
if ((m_objRFRunning.m_enmModulation == ATV_FM1) || (m_objRFRunning.m_enmModulation == ATV_FM2))
|
||||||
{
|
{
|
||||||
//Amplitude FM
|
//Amplitude FM
|
||||||
|
|
||||||
@ -198,7 +200,7 @@ void ATVDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
|
|||||||
//-2 > 2 : 0 -> 1 volt
|
//-2 > 2 : 0 -> 1 volt
|
||||||
//0->0.3 synchro 0.3->1 image
|
//0->0.3 synchro 0.3->1 image
|
||||||
|
|
||||||
if (m_objRunning.m_enmModulation == ATV_FM1)
|
if (m_objRFRunning.m_enmModulation == ATV_FM1)
|
||||||
{
|
{
|
||||||
//YDiff Cd
|
//YDiff Cd
|
||||||
fltVal = m_fltBufferI[0]*(fltNormQ - m_fltBufferQ[1]);
|
fltVal = m_fltBufferI[0]*(fltNormQ - m_fltBufferQ[1]);
|
||||||
@ -237,7 +239,7 @@ void ATVDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
|
|||||||
m_fltBufferQ[0]=fltNormQ;
|
m_fltBufferQ[0]=fltNormQ;
|
||||||
|
|
||||||
}
|
}
|
||||||
else if ((m_objRunning.m_enmModulation == ATV_AM) || (m_objRunning.m_enmModulation == ATV_VAMU) || (m_objRunning.m_enmModulation == ATV_VAML))
|
else if ((m_objRFRunning.m_enmModulation == ATV_AM) || (m_objRFRunning.m_enmModulation == ATV_VAMU) || (m_objRFRunning.m_enmModulation == ATV_VAML))
|
||||||
{
|
{
|
||||||
//Amplitude AM
|
//Amplitude AM
|
||||||
fltVal = fltNorm;
|
fltVal = fltNorm;
|
||||||
@ -423,7 +425,7 @@ void ATVDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
|
|||||||
|
|
||||||
m_intRowsLimit = m_intNumberOfLines-1;
|
m_intRowsLimit = m_intNumberOfLines-1;
|
||||||
|
|
||||||
if (m_objRunning.m_enmModulation == ATV_AM)
|
if (m_objRFRunning.m_enmModulation == ATV_AM)
|
||||||
{
|
{
|
||||||
m_fltAmpMin=m_fltEffMin;
|
m_fltAmpMin=m_fltEffMin;
|
||||||
m_fltAmpMax=m_fltEffMax;
|
m_fltAmpMax=m_fltEffMax;
|
||||||
@ -520,6 +522,22 @@ bool ATVDemod::handleMessage(const Message& cmd)
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else if (MsgConfigureRFATVDemod::match(cmd))
|
||||||
|
{
|
||||||
|
MsgConfigureRFATVDemod& objCfg = (MsgConfigureRFATVDemod&) cmd;
|
||||||
|
|
||||||
|
m_objRFConfig = objCfg.m_objMsgConfig;
|
||||||
|
|
||||||
|
qDebug() << "ATVDemod::handleMessage: MsgConfigureRFATVDemod:"
|
||||||
|
<< " m_enmModulation" << m_objRFConfig.m_enmModulation
|
||||||
|
<< " m_fltRFBandwidth" << m_objRFConfig.m_fltRFBandwidth
|
||||||
|
<< " m_fltRFOppBandwidth" << m_objRFConfig.m_fltRFOppBandwidth
|
||||||
|
<< " m_blnFFTFiltering" << m_objRFConfig.m_blnFFTFiltering;
|
||||||
|
|
||||||
|
applySettings();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
@ -567,6 +585,8 @@ void ATVDemod::applySettings()
|
|||||||
m_objRunning.m_fltRatioOfRowsToDisplay = m_objConfig.m_fltRatioOfRowsToDisplay;
|
m_objRunning.m_fltRatioOfRowsToDisplay = m_objConfig.m_fltRatioOfRowsToDisplay;
|
||||||
m_objRunning.m_blnHSync = m_objConfig.m_blnHSync;
|
m_objRunning.m_blnHSync = m_objConfig.m_blnHSync;
|
||||||
m_objRunning.m_blnVSync = m_objConfig.m_blnVSync;
|
m_objRunning.m_blnVSync = m_objConfig.m_blnVSync;
|
||||||
|
|
||||||
|
m_objRFRunning = m_objRFConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ATVDemod::getSampleRate()
|
int ATVDemod::getSampleRate()
|
||||||
|
@ -81,11 +81,13 @@ public:
|
|||||||
ATVModulation m_enmModulation;
|
ATVModulation m_enmModulation;
|
||||||
float m_fltRFBandwidth;
|
float m_fltRFBandwidth;
|
||||||
float m_fltRFOppBandwidth;
|
float m_fltRFOppBandwidth;
|
||||||
|
bool m_blnFFTFiltering;
|
||||||
|
|
||||||
ATVRFConfig() :
|
ATVRFConfig() :
|
||||||
m_enmModulation(ATV_FM1),
|
m_enmModulation(ATV_FM1),
|
||||||
m_fltRFBandwidth(0),
|
m_fltRFBandwidth(0),
|
||||||
m_fltRFOppBandwidth(0)
|
m_fltRFOppBandwidth(0),
|
||||||
|
m_blnFFTFiltering(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -107,7 +109,8 @@ public:
|
|||||||
void configureRF(MessageQueue* objMessageQueue,
|
void configureRF(MessageQueue* objMessageQueue,
|
||||||
ATVModulation enmModulation,
|
ATVModulation enmModulation,
|
||||||
float fltRFBandwidth,
|
float fltRFBandwidth,
|
||||||
float fltRFOppBandwidth);
|
float fltRFOppBandwidth,
|
||||||
|
bool blnFFTFiltering);
|
||||||
|
|
||||||
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po);
|
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po);
|
||||||
virtual void start();
|
virtual void start();
|
||||||
@ -183,12 +186,14 @@ private:
|
|||||||
static MsgConfigureRFATVDemod* create(
|
static MsgConfigureRFATVDemod* create(
|
||||||
ATVModulation enmModulation,
|
ATVModulation enmModulation,
|
||||||
float fltRFBandwidth,
|
float fltRFBandwidth,
|
||||||
float fltRFOppBandwidth)
|
float fltRFOppBandwidth,
|
||||||
|
bool blnFFTFiltering)
|
||||||
{
|
{
|
||||||
return new MsgConfigureRFATVDemod(
|
return new MsgConfigureRFATVDemod(
|
||||||
enmModulation,
|
enmModulation,
|
||||||
fltRFBandwidth,
|
fltRFBandwidth,
|
||||||
fltRFOppBandwidth);
|
fltRFOppBandwidth,
|
||||||
|
blnFFTFiltering);
|
||||||
}
|
}
|
||||||
|
|
||||||
ATVRFConfig m_objMsgConfig;
|
ATVRFConfig m_objMsgConfig;
|
||||||
@ -197,12 +202,14 @@ private:
|
|||||||
MsgConfigureRFATVDemod(
|
MsgConfigureRFATVDemod(
|
||||||
ATVModulation enmModulation,
|
ATVModulation enmModulation,
|
||||||
float fltRFBandwidth,
|
float fltRFBandwidth,
|
||||||
float fltRFOppBandwidth) :
|
float fltRFOppBandwidth,
|
||||||
|
bool blnFFTFiltering) :
|
||||||
Message()
|
Message()
|
||||||
{
|
{
|
||||||
m_objMsgConfig.m_enmModulation = enmModulation;
|
m_objMsgConfig.m_enmModulation = enmModulation;
|
||||||
m_objMsgConfig.m_fltRFBandwidth = fltRFBandwidth;
|
m_objMsgConfig.m_fltRFBandwidth = fltRFBandwidth;
|
||||||
m_objMsgConfig.m_fltRFOppBandwidth = fltRFOppBandwidth;
|
m_objMsgConfig.m_fltRFOppBandwidth = fltRFOppBandwidth;
|
||||||
|
m_objMsgConfig.m_blnFFTFiltering = blnFFTFiltering;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -249,6 +256,9 @@ private:
|
|||||||
ATVConfig m_objRunning;
|
ATVConfig m_objRunning;
|
||||||
ATVConfig m_objConfig;
|
ATVConfig m_objConfig;
|
||||||
|
|
||||||
|
ATVRFConfig m_objRFRunning;
|
||||||
|
ATVRFConfig m_objRFConfig;
|
||||||
|
|
||||||
QMutex m_objSettingsMutex;
|
QMutex m_objSettingsMutex;
|
||||||
|
|
||||||
static const float m_fltSecondToUs;
|
static const float m_fltSecondToUs;
|
||||||
|
@ -298,6 +298,18 @@ void ATVDemodGUI::applySettings()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ATVDemodGUI::applyRFSettings()
|
||||||
|
{
|
||||||
|
if (m_blnDoApplySettings)
|
||||||
|
{
|
||||||
|
m_objATVDemod->configureRF(m_objATVDemod->getInputMessageQueue(),
|
||||||
|
(ATVDemod::ATVModulation) ui->modulation->currentIndex(),
|
||||||
|
ui->rfBW->value() * 100000.0f,
|
||||||
|
ui->rfOppBW->value() * 100000.0f,
|
||||||
|
ui->rfFFTFiltering->isChecked());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ATVDemodGUI::leaveEvent(QEvent*)
|
void ATVDemodGUI::leaveEvent(QEvent*)
|
||||||
{
|
{
|
||||||
blockApplySettings(true);
|
blockApplySettings(true);
|
||||||
@ -372,11 +384,6 @@ void ATVDemodGUI::on_halfImage_clicked()
|
|||||||
applySettings();
|
applySettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ATVDemodGUI::on_modulation_currentIndexChanged(int index)
|
|
||||||
{
|
|
||||||
applySettings();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ATVDemodGUI::on_fps_currentIndexChanged(int index)
|
void ATVDemodGUI::on_fps_currentIndexChanged(int index)
|
||||||
{
|
{
|
||||||
applySettings();
|
applySettings();
|
||||||
@ -386,3 +393,25 @@ void ATVDemodGUI::on_reset_clicked(bool checked)
|
|||||||
{
|
{
|
||||||
resetToDefaults();
|
resetToDefaults();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ATVDemodGUI::on_modulation_currentIndexChanged(int index)
|
||||||
|
{
|
||||||
|
applyRFSettings();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ATVDemodGUI::on_rfBW_valueChanged(int value)
|
||||||
|
{
|
||||||
|
ui->rfBWText->setText(QString("%1 MHz").arg(value / 10.0, 0, 'f', 1));
|
||||||
|
applyRFSettings();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ATVDemodGUI::on_rfOppBW_valueChanged(int value)
|
||||||
|
{
|
||||||
|
ui->rfOppBWText->setText(QString("%1").arg(value / 10.0, 0, 'f', 1));
|
||||||
|
applyRFSettings();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ATVDemodGUI::on_rfFFTFiltering_toggled(bool checked)
|
||||||
|
{
|
||||||
|
applyRFSettings();
|
||||||
|
}
|
||||||
|
@ -72,6 +72,9 @@ private slots:
|
|||||||
void on_modulation_currentIndexChanged(int index);
|
void on_modulation_currentIndexChanged(int index);
|
||||||
void on_fps_currentIndexChanged(int index);
|
void on_fps_currentIndexChanged(int index);
|
||||||
void on_reset_clicked(bool checked);
|
void on_reset_clicked(bool checked);
|
||||||
|
void on_rfBW_valueChanged(int value);
|
||||||
|
void on_rfOppBW_valueChanged(int value);
|
||||||
|
void on_rfFFTFiltering_toggled(bool checked);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::ATVDemodGUI* ui;
|
Ui::ATVDemodGUI* ui;
|
||||||
@ -92,6 +95,7 @@ private:
|
|||||||
|
|
||||||
void blockApplySettings(bool blnBlock);
|
void blockApplySettings(bool blnBlock);
|
||||||
void applySettings();
|
void applySettings();
|
||||||
|
void applyRFSettings();
|
||||||
|
|
||||||
void leaveEvent(QEvent*);
|
void leaveEvent(QEvent*);
|
||||||
void enterEvent(QEvent*);
|
void enterEvent(QEvent*);
|
||||||
|
@ -187,7 +187,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="rfSettings2Layout">
|
<layout class="QHBoxLayout" name="rfSettings2Layout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="ButtonSwitch" name="toolButton">
|
<widget class="ButtonSwitch" name="rfFFTFiltering">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
@ -195,6 +195,9 @@
|
|||||||
<iconset resource="../../../sdrbase/resources/res.qrc">
|
<iconset resource="../../../sdrbase/resources/res.qrc">
|
||||||
<normaloff>:/filter_bandpass.png</normaloff>:/filter_bandpass.png</iconset>
|
<normaloff>:/filter_bandpass.png</normaloff>:/filter_bandpass.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
@ -238,6 +241,9 @@
|
|||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>100</number>
|
<number>100</number>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="pageStep">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
<property name="value">
|
<property name="value">
|
||||||
<number>10</number>
|
<number>10</number>
|
||||||
</property>
|
</property>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user