1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-11-12 01:00:28 -05:00

84 lines
3.4 KiB
C
Raw Normal View History

2019-08-19 02:08:41 +02:00
///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2019 Edouard Griffiths, F4EXB //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation as version 3 of the License, or //
// (at your option) any later version. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License V3 for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
///////////////////////////////////////////////////////////////////////////////////
#ifndef INCLUDE_INTERFEROMETERSINK_H
#define INCLUDE_INTERFEROMETERSINK_H
2019-09-02 00:41:41 +02:00
#include <QObject>
2019-08-19 02:08:41 +02:00
2019-09-02 00:41:41 +02:00
#include "dsp/mimosamplesink.h"
#include "dsp/samplesinkvector.h"
#include "interferometerstreamsink.h"
#include "interferometercorr.h"
2019-08-19 02:08:41 +02:00
2019-09-02 00:41:41 +02:00
class DownChannelizer;
class BasebandSampleSink;
class InterferometerSink : public QObject
2019-08-19 02:08:41 +02:00
{
2019-09-02 00:41:41 +02:00
Q_OBJECT
2019-08-19 02:08:41 +02:00
public:
2019-09-02 00:41:41 +02:00
class MsgConfigureChannelizer : public Message {
MESSAGE_CLASS_DECLARATION
public:
int getLog2Decim() const { return m_log2Decim; }
int getFilterChainHash() const { return m_filterChainHash; }
static MsgConfigureChannelizer* create(unsigned int log2Decim, unsigned int filterChainHash) {
return new MsgConfigureChannelizer(log2Decim, filterChainHash);
}
private:
unsigned int m_log2Decim;
unsigned int m_filterChainHash;
2019-08-19 02:08:41 +02:00
2019-09-02 00:41:41 +02:00
MsgConfigureChannelizer(unsigned int log2Decim, unsigned int filterChainHash) :
Message(),
m_log2Decim(log2Decim),
m_filterChainHash(filterChainHash)
{ }
};
2019-08-19 02:08:41 +02:00
2019-09-02 00:41:41 +02:00
InterferometerSink();
~InterferometerSink();
MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } //!< Get the queue for asynchronous inbound communication
void setSpectrumSink(BasebandSampleSink *spectrumSink) { m_spectrumSink = spectrumSink; }
void setScopeSink(BasebandSampleSink *scopeSink) { m_scopeSink = scopeSink; }
void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, unsigned int streamIndex);
2019-08-19 02:08:41 +02:00
private:
2019-09-02 00:41:41 +02:00
void run();
bool handleMessage(const Message& cmd);
InterferometerCorrelator m_correlator;
SampleSinkVector m_sinkBuffers[2];
InterferometerStreamSink m_sinks[2];
DownChannelizer *m_channelizers[2];
BasebandSampleSink *m_spectrumSink;
BasebandSampleSink *m_scopeSink;
MessageQueue m_inputMessageQueue; //!< Queue for asynchronous inbound communication
private slots:
void handleSinkBuffer(unsigned int sinkIndex); //!< Handle data when samples have to be processed
void handleInputMessages();
2019-08-19 02:08:41 +02:00
};
#endif // INCLUDE_INTERFEROMETERSINK_H