1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 17:58:43 -05:00

SDRdaemonFEC support: debug (1)

This commit is contained in:
f4exb 2016-06-20 09:07:37 +02:00
parent b73330c663
commit 46e85fa643
5 changed files with 44 additions and 21 deletions

View File

@ -272,12 +272,12 @@ bool SDRdaemonFECGui::handleMessage(const Message& message)
updateWithAcquisition();
return true;
}
else if (SDRdaemonFECInput::MsgReportSDRdaemonStreamData::match(message))
else if (SDRdaemonFECInput::MsgReportSDRdaemonFECStreamData::match(message))
{
m_sampleRate = ((SDRdaemonFECInput::MsgReportSDRdaemonStreamData&)message).getSampleRate();
m_centerFrequency = ((SDRdaemonFECInput::MsgReportSDRdaemonStreamData&)message).getCenterFrequency();
m_startingTimeStamp.tv_sec = ((SDRdaemonFECInput::MsgReportSDRdaemonStreamData&)message).get_tv_sec();
m_startingTimeStamp.tv_usec = ((SDRdaemonFECInput::MsgReportSDRdaemonStreamData&)message).get_tv_usec();
m_sampleRate = ((SDRdaemonFECInput::MsgReportSDRdaemonFECStreamData&)message).getSampleRate();
m_centerFrequency = ((SDRdaemonFECInput::MsgReportSDRdaemonFECStreamData&)message).getCenterFrequency();
m_startingTimeStamp.tv_sec = ((SDRdaemonFECInput::MsgReportSDRdaemonFECStreamData&)message).get_tv_sec();
m_startingTimeStamp.tv_usec = ((SDRdaemonFECInput::MsgReportSDRdaemonFECStreamData&)message).get_tv_usec();
updateWithStreamData();
return true;
}

View File

@ -34,7 +34,7 @@ MESSAGE_CLASS_DEFINITION(SDRdaemonFECInput::MsgConfigureSDRdaemonAutoCorr, Messa
MESSAGE_CLASS_DEFINITION(SDRdaemonFECInput::MsgConfigureSDRdaemonWork, Message)
MESSAGE_CLASS_DEFINITION(SDRdaemonFECInput::MsgConfigureSDRdaemonStreamTiming, Message)
MESSAGE_CLASS_DEFINITION(SDRdaemonFECInput::MsgReportSDRdaemonAcquisition, Message)
MESSAGE_CLASS_DEFINITION(SDRdaemonFECInput::MsgReportSDRdaemonStreamData, Message)
MESSAGE_CLASS_DEFINITION(SDRdaemonFECInput::MsgReportSDRdaemonFECStreamData, Message)
MESSAGE_CLASS_DEFINITION(SDRdaemonFECInput::MsgReportSDRdaemonFECStreamTiming, Message)
SDRdaemonFECInput::SDRdaemonFECInput(const QTimer& masterTimer, DeviceAPI *deviceAPI) :

View File

@ -131,31 +131,28 @@ public:
{ }
};
class MsgReportSDRdaemonStreamData : public Message {
class MsgReportSDRdaemonFECStreamData : public Message {
MESSAGE_CLASS_DECLARATION
public:
int getSampleRateStream() const { return m_sampleRateStream; }
int getSampleRate() const { return m_sampleRate; }
quint64 getCenterFrequency() const { return m_centerFrequency; }
uint32_t get_tv_sec() const { return m_tv_sec; }
uint32_t get_tv_usec() const { return m_tv_usec; }
static MsgReportSDRdaemonStreamData* create(int sampleRateStream, int sampleRate, quint64 centerFrequency, uint32_t tv_sec, uint32_t tv_usec)
static MsgReportSDRdaemonFECStreamData* create(int sampleRate, quint64 centerFrequency, uint32_t tv_sec, uint32_t tv_usec)
{
return new MsgReportSDRdaemonStreamData(sampleRateStream, sampleRate, centerFrequency, tv_sec, tv_usec);
return new MsgReportSDRdaemonFECStreamData(sampleRate, centerFrequency, tv_sec, tv_usec);
}
protected:
int m_sampleRateStream;
int m_sampleRate;
quint64 m_centerFrequency;
uint32_t m_tv_sec;
uint32_t m_tv_usec;
MsgReportSDRdaemonStreamData(int sampleRateStream, int sampleRate, quint64 centerFrequency, uint32_t tv_sec, uint32_t tv_usec) :
MsgReportSDRdaemonFECStreamData(int sampleRate, quint64 centerFrequency, uint32_t tv_sec, uint32_t tv_usec) :
Message(),
m_sampleRateStream(sampleRateStream),
m_sampleRate(sampleRate),
m_centerFrequency(centerFrequency),
m_tv_sec(tv_sec),

View File

@ -134,6 +134,9 @@ void SDRdaemonFECUDPHandler::dataReadyRead()
qint64 pendingDataSize = m_dataSocket->pendingDatagramSize();
m_udpReadBytes = m_dataSocket->readDatagram(m_udpBuf, pendingDataSize, &m_remoteAddress, 0);
qDebug() << "SDRdaemonUDPHandler::dataReadyRead:"
<< " m_udpReadBytes: " << m_udpReadBytes;
if (m_udpReadBytes == SDRdaemonFECBuffer::m_udpPayloadSize) {
processData();
}
@ -143,15 +146,39 @@ void SDRdaemonFECUDPHandler::dataReadyRead()
void SDRdaemonFECUDPHandler::processData()
{
m_sdrDaemonBuffer.writeData(m_udpBuf, m_udpReadBytes);
}
const SDRdaemonFECBuffer::MetaDataFEC& metaData = m_sdrDaemonBuffer.getOutputMeta();
void SDRdaemonFECUDPHandler::setSamplerate(uint32_t samplerate)
{
qDebug() << "SDRdaemonUDPHandler::setSamplerate:"
<< " new:" << samplerate
<< " old:" << m_samplerate;
bool change = false;
m_tv_sec = metaData.m_tv_sec;
m_tv_usec = metaData.m_tv_usec;
m_samplerate = samplerate;
qDebug() << "SDRdaemonUDPHandler::processData:"
<< " m_samplerate: " << metaData.m_sampleRate
<< " m_centerFrequency: " << metaData.m_centerFrequency;
if (m_centerFrequency != metaData.m_centerFrequency)
{
m_centerFrequency = metaData.m_centerFrequency;
change = true;
}
if (m_samplerate != metaData.m_sampleRate)
{
m_samplerate = metaData.m_sampleRate;
change = true;
}
if (change)
{
DSPSignalNotification *notif = new DSPSignalNotification(m_samplerate, m_centerFrequency * 1000); // Frequency in Hz for the DSP engine
m_deviceAPI->getDeviceInputMessageQueue()->push(notif);
SDRdaemonFECInput::MsgReportSDRdaemonFECStreamData *report = SDRdaemonFECInput::MsgReportSDRdaemonFECStreamData::create(
m_samplerate,
m_centerFrequency * 1000, // Frequency in Hz for the GUI
m_tv_sec,
m_tv_usec);
m_outputMessageQueueToGUI->push(report);
}
}
void SDRdaemonFECUDPHandler::connectTimer(const QTimer* timer)

View File

@ -75,7 +75,6 @@ private:
int m_rateDivider;
bool m_autoCorrBuffer;
void setSamplerate(uint32_t samplerate);
void processData();
private slots: