mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-09-05 22:57:47 -04:00
DATV demod: fixed message handling
This commit is contained in:
parent
acb96acd85
commit
dbc9e78077
@ -58,15 +58,10 @@ DATVDemod::DATVDemod(DeviceSourceAPI *deviceAPI) :
|
|||||||
|
|
||||||
m_objRFFilter = new fftfilt(-256000.0 / 1024000.0, 256000.0 / 1024000.0, rfFilterFftLength);
|
m_objRFFilter = new fftfilt(-256000.0 / 1024000.0, 256000.0 / 1024000.0, rfFilterFftLength);
|
||||||
|
|
||||||
//To setup correct Sample Rate
|
|
||||||
m_channelizer = new DownChannelizer(this);
|
m_channelizer = new DownChannelizer(this);
|
||||||
channelSampleRateChanged();
|
|
||||||
|
|
||||||
m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this);
|
m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this);
|
||||||
m_deviceAPI->addThreadedSink(m_threadedChannelizer);
|
m_deviceAPI->addThreadedSink(m_threadedChannelizer);
|
||||||
m_deviceAPI->addChannelAPI(this);
|
m_deviceAPI->addChannelAPI(this);
|
||||||
|
|
||||||
connect(m_channelizer, SIGNAL(inputSampleRateChanged()), this, SLOT(channelSampleRateChanged()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DATVDemod::~DATVDemod()
|
DATVDemod::~DATVDemod()
|
||||||
@ -98,20 +93,6 @@ DATVDemod::~DATVDemod()
|
|||||||
delete m_channelizer;
|
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)
|
bool DATVDemod::SetTVScreen(TVScreen *objScreen)
|
||||||
{
|
{
|
||||||
m_objRegisteredTVScreen = objScreen;
|
m_objRegisteredTVScreen = objScreen;
|
||||||
@ -904,10 +885,38 @@ void DATVDemod::stop()
|
|||||||
|
|
||||||
bool DATVDemod::handleMessage(const Message& cmd)
|
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;
|
MsgConfigureDATVDemod& objCfg = (MsgConfigureDATVDemod&) cmd;
|
||||||
|
|
||||||
@ -962,7 +971,6 @@ bool DATVDemod::handleMessage(const Message& cmd)
|
|||||||
ApplySettings();
|
ApplySettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -973,13 +981,11 @@ bool DATVDemod::handleMessage(const Message& cmd)
|
|||||||
|
|
||||||
void DATVDemod::ApplySettings()
|
void DATVDemod::ApplySettings()
|
||||||
{
|
{
|
||||||
|
|
||||||
if(m_objRunning.intMsps==0)
|
if(m_objRunning.intMsps==0)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
InitDATVParameters(m_objRunning.intMsps,
|
InitDATVParameters(m_objRunning.intMsps,
|
||||||
m_objRunning.intRFBandwidth,
|
m_objRunning.intRFBandwidth,
|
||||||
m_objRunning.intCenterFrequency,
|
m_objRunning.intCenterFrequency,
|
||||||
@ -996,7 +1002,6 @@ void DATVDemod::ApplySettings()
|
|||||||
m_objRunning.fltRollOff,
|
m_objRunning.fltRollOff,
|
||||||
m_objRunning.blnViterbi,
|
m_objRunning.blnViterbi,
|
||||||
m_objRunning.intExcursion);
|
m_objRunning.intExcursion);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int DATVDemod::GetSampleRate()
|
int DATVDemod::GetSampleRate()
|
||||||
|
@ -262,9 +262,6 @@ public:
|
|||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
private slots:
|
|
||||||
void channelSampleRateChanged();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class MsgConfigureDATVDemod : public Message
|
class MsgConfigureDATVDemod : public Message
|
||||||
{
|
{
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
const PluginDescriptor DATVDemodPlugin::m_ptrPluginDescriptor =
|
const PluginDescriptor DATVDemodPlugin::m_ptrPluginDescriptor =
|
||||||
{
|
{
|
||||||
QString("DATV Demodulator"),
|
QString("DATV Demodulator"),
|
||||||
QString("3.2.0"),
|
QString("3.14.0"),
|
||||||
QString("(c) F4HKW for SDRAngel using LeanSDR framework (c) F4DAV"),
|
QString("(c) F4HKW for SDRAngel using LeanSDR framework (c) F4DAV"),
|
||||||
QString("https://github.com/f4exb/sdrangel"),
|
QString("https://github.com/f4exb/sdrangel"),
|
||||||
true,
|
true,
|
||||||
|
@ -110,8 +110,6 @@ void DownChannelizer::stop()
|
|||||||
|
|
||||||
bool DownChannelizer::handleMessage(const Message& cmd)
|
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.
|
// 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))
|
if (DSPSignalNotification::match(cmd))
|
||||||
@ -146,19 +144,13 @@ bool DownChannelizer::handleMessage(const Message& cmd)
|
|||||||
}
|
}
|
||||||
else if (BasebandSampleSink::MsgThreadedSink::match(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
|
return m_sampleSink->handleMessage(cmd); // this message is passed to the demod
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
qDebug() << "DownChannelizer::handleMessage: " << cmd.getIdentifier() << " unhandled";
|
||||||
return false;
|
return false;
|
||||||
// if (m_sampleSink != 0)
|
|
||||||
// {
|
|
||||||
// return m_sampleSink->handleMessage(cmd);
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user