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

DATV demod: fixed message handling

This commit is contained in:
f4exb 2018-03-29 10:03:52 +02:00
parent acb96acd85
commit dbc9e78077
4 changed files with 34 additions and 40 deletions

View File

@ -58,15 +58,10 @@ DATVDemod::DATVDemod(DeviceSourceAPI *deviceAPI) :
m_objRFFilter = new fftfilt(-256000.0 / 1024000.0, 256000.0 / 1024000.0, rfFilterFftLength);
//To setup correct Sample Rate
m_channelizer = new DownChannelizer(this);
channelSampleRateChanged();
m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this);
m_deviceAPI->addThreadedSink(m_threadedChannelizer);
m_deviceAPI->addChannelAPI(this);
connect(m_channelizer, SIGNAL(inputSampleRateChanged()), this, SLOT(channelSampleRateChanged()));
}
DATVDemod::~DATVDemod()
@ -98,20 +93,6 @@ DATVDemod::~DATVDemod()
delete m_channelizer;
}
void DATVDemod::channelSampleRateChanged()
{
qDebug() << "DATVDemod::channelSampleRateChanged:"
<< " sample rate: " << m_channelizer->getInputSampleRate();
if(m_objRunning.intMsps!=m_channelizer->getInputSampleRate())
{
m_objRunning.intMsps = m_channelizer->getInputSampleRate();
m_objRunning.intSampleRate = m_objRunning.intMsps;
ApplySettings();
}
}
bool DATVDemod::SetTVScreen(TVScreen *objScreen)
{
m_objRegisteredTVScreen = objScreen;
@ -904,10 +885,38 @@ void DATVDemod::stop()
bool DATVDemod::handleMessage(const Message& cmd)
{
qDebug() << "DATVDemod::handleMessage";
if (DownChannelizer::MsgChannelizerNotification::match(cmd))
{
DownChannelizer::MsgChannelizerNotification& objNotif = (DownChannelizer::MsgChannelizerNotification&) cmd;
qDebug() << "DATVDemod::handleMessage: MsgChannelizerNotification:"
<< " m_intSampleRate: " << objNotif.getSampleRate()
<< " m_intFrequencyOffset: " << objNotif.getFrequencyOffset();
if (MsgConfigureDATVDemod::match(cmd))
if (m_objRunning.intMsps != objNotif.getSampleRate())
{
m_objRunning.intMsps = objNotif.getSampleRate();
m_objRunning.intSampleRate = m_objRunning.intMsps;
ApplySettings();
}
return true;
}
else if (MsgConfigureChannelizer::match(cmd))
{
MsgConfigureChannelizer& cfg = (MsgConfigureChannelizer&) cmd;
m_channelizer->configure(m_channelizer->getInputMessageQueue(),
m_channelizer->getInputSampleRate(),
cfg.getCenterFrequency());
qDebug() << "DATVDemod::handleMessage: MsgConfigureChannelizer: sampleRate: " << m_channelizer->getInputSampleRate()
<< " centerFrequency: " << cfg.getCenterFrequency();
return true;
}
else if (MsgConfigureDATVDemod::match(cmd))
{
MsgConfigureDATVDemod& objCfg = (MsgConfigureDATVDemod&) cmd;
@ -960,8 +969,7 @@ bool DATVDemod::handleMessage(const Message& cmd)
<< " intExcursion: " << objCfg.m_objMsgConfig.intExcursion;
ApplySettings();
}
}
return true;
}
@ -973,13 +981,11 @@ bool DATVDemod::handleMessage(const Message& cmd)
void DATVDemod::ApplySettings()
{
if(m_objRunning.intMsps==0)
{
return;
}
InitDATVParameters(m_objRunning.intMsps,
m_objRunning.intRFBandwidth,
m_objRunning.intCenterFrequency,
@ -996,7 +1002,6 @@ void DATVDemod::ApplySettings()
m_objRunning.fltRollOff,
m_objRunning.blnViterbi,
m_objRunning.intExcursion);
}
int DATVDemod::GetSampleRate()

View File

@ -262,9 +262,6 @@ public:
{ }
};
private slots:
void channelSampleRateChanged();
private:
class MsgConfigureDATVDemod : public Message
{

View File

@ -27,7 +27,7 @@
const PluginDescriptor DATVDemodPlugin::m_ptrPluginDescriptor =
{
QString("DATV Demodulator"),
QString("3.2.0"),
QString("3.14.0"),
QString("(c) F4HKW for SDRAngel using LeanSDR framework (c) F4DAV"),
QString("https://github.com/f4exb/sdrangel"),
true,

View File

@ -110,8 +110,6 @@ void DownChannelizer::stop()
bool DownChannelizer::handleMessage(const Message& cmd)
{
qDebug() << "DownChannelizer::handleMessage: " << cmd.getIdentifier();
// TODO: apply changes only if input sample rate or requested output sample rate change. Change of center frequency has no impact.
if (DSPSignalNotification::match(cmd))
@ -146,19 +144,13 @@ bool DownChannelizer::handleMessage(const Message& cmd)
}
else if (BasebandSampleSink::MsgThreadedSink::match(cmd))
{
qDebug() << "DownChannelizer::handleMessage: MsgThreadedSink: forwarded to demod";
return m_sampleSink->handleMessage(cmd); // this message is passed to the demod
}
else
{
qDebug() << "DownChannelizer::handleMessage: " << cmd.getIdentifier() << " unhandled";
return false;
// if (m_sampleSink != 0)
// {
// return m_sampleSink->handleMessage(cmd);
// }
// else
// {
// return false;
// }
}
}