diff --git a/sdrbase/CMakeLists.txt b/sdrbase/CMakeLists.txt index ae5d534f0..47833c800 100644 --- a/sdrbase/CMakeLists.txt +++ b/sdrbase/CMakeLists.txt @@ -36,6 +36,7 @@ set(sdrbase_SOURCES dsp/dspengine.cpp dsp/dspdevicesourceengine.cpp dsp/dspdevicesinkengine.cpp + dsp/dspdevicemimoengine.cpp dsp/fftcorr.cpp dsp/fftengine.cpp dsp/fftfilt.cpp @@ -65,6 +66,7 @@ set(sdrbase_SOURCES dsp/wfir.cpp dsp/devicesamplesource.cpp dsp/devicesamplesink.cpp + dsp/devicesamplemimo.cpp device/deviceapi.cpp device/deviceenumerator.cpp @@ -135,6 +137,7 @@ set(sdrbase_HEADERS dsp/dspengine.h dsp/dspdevicesourceengine.h dsp/dspdevicesinkengine.h + dsp/dspdevicemimoengine.h dsp/dsptypes.h dsp/fftcorr.h dsp/fftengine.h @@ -184,6 +187,7 @@ set(sdrbase_HEADERS dsp/wfir.h dsp/devicesamplesource.h dsp/devicesamplesink.h + dsp/devicesamplemimo.h device/deviceapi.h device/deviceenumerator.h diff --git a/sdrbase/dsp/dspdevicemimoengine.cpp b/sdrbase/dsp/dspdevicemimoengine.cpp index 97ef23ff5..478fe3d60 100644 --- a/sdrbase/dsp/dspdevicemimoengine.cpp +++ b/sdrbase/dsp/dspdevicemimoengine.cpp @@ -210,6 +210,7 @@ QString DSPDeviceMIMOEngine::deviceDescription() */ void DSPDeviceMIMOEngine::work(int nbWriteSamples) { + (void) nbWriteSamples; // Sources for (unsigned int isource = 0; isource < m_deviceSampleMIMO->getNbSourceFifos(); isource++) { @@ -547,7 +548,7 @@ void DSPDeviceMIMOEngine::handleSynchronousMessages() { const AddBasebandSampleSink *msg = (AddBasebandSampleSink *) message; BasebandSampleSink* sink = msg->getSampleSink(); - int isource = msg->getIndex(); + unsigned int isource = msg->getIndex(); if ((isource < m_basebandSampleSinks.size()) && (isource < m_sourceStreamSampleRates.size()) && (isource < m_sourceCenterFrequencies.size())) { @@ -565,7 +566,7 @@ void DSPDeviceMIMOEngine::handleSynchronousMessages() { const RemoveBasebandSampleSink *msg = (RemoveBasebandSampleSink *) message; BasebandSampleSink* sink = ((DSPRemoveBasebandSampleSink*) message)->getSampleSink(); - int isource = msg->getIndex(); + unsigned int isource = msg->getIndex(); if (isource < m_basebandSampleSinks.size()) { @@ -580,7 +581,7 @@ void DSPDeviceMIMOEngine::handleSynchronousMessages() { const AddThreadedBasebandSampleSink *msg = (AddThreadedBasebandSampleSink *) message; ThreadedBasebandSampleSink *threadedSink = msg->getThreadedSampleSink(); - int isource = msg->getIndex(); + unsigned int isource = msg->getIndex(); if ((isource < m_threadedBasebandSampleSinks.size()) && (isource < m_sourceStreamSampleRates.size()) && (isource < m_sourceCenterFrequencies.size())) { @@ -598,7 +599,7 @@ void DSPDeviceMIMOEngine::handleSynchronousMessages() { const RemoveThreadedBasebandSampleSink *msg = (RemoveThreadedBasebandSampleSink *) message; ThreadedBasebandSampleSink* threadedSink = msg->getThreadedSampleSink(); - int isource = msg->getIndex(); + unsigned int isource = msg->getIndex(); if (isource < m_threadedBasebandSampleSinks.size()) { @@ -610,7 +611,7 @@ void DSPDeviceMIMOEngine::handleSynchronousMessages() { const AddThreadedBasebandSampleSource *msg = (AddThreadedBasebandSampleSource *) message; ThreadedBasebandSampleSource *threadedSource = msg->getThreadedSampleSource(); - int isink = msg->getIndex(); + unsigned int isink = msg->getIndex(); if ((isink < m_threadedBasebandSampleSources.size()) && (isink < m_sinkStreamSampleRates.size()) && (isink < m_sinkCenterFrequencies.size())) { @@ -628,7 +629,7 @@ void DSPDeviceMIMOEngine::handleSynchronousMessages() { const RemoveThreadedBasebandSampleSource *msg = (RemoveThreadedBasebandSampleSource *) message; ThreadedBasebandSampleSource* threadedSource = msg->getThreadedSampleSource(); - int isink = msg->getIndex(); + unsigned int isink = msg->getIndex(); if (isink < m_threadedBasebandSampleSources.size()) { @@ -651,7 +652,7 @@ void DSPDeviceMIMOEngine::handleInputMessages() if (ConfigureCorrection::match(*message)) { ConfigureCorrection* conf = (ConfigureCorrection*) message; - int isource = conf->getIndex(); + unsigned int isource = conf->getIndex(); if (isource < m_sourcesCorrections.size()) { @@ -691,7 +692,7 @@ void DSPDeviceMIMOEngine::handleInputMessages() // update DSP values bool sourceOrSink = notif->getSourceOrSink(); - int istream = notif->getIndex(); + unsigned int istream = notif->getIndex(); int sampleRate = notif->getSampleRate(); qint64 centerFrequency = notif->getCenterFrequency(); diff --git a/sdrbase/dsp/dspdevicemimoengine.h b/sdrbase/dsp/dspdevicemimoengine.h index 714153cc8..a05ad8d78 100644 --- a/sdrbase/dsp/dspdevicemimoengine.h +++ b/sdrbase/dsp/dspdevicemimoengine.h @@ -47,92 +47,92 @@ public: class AddThreadedBasebandSampleSource : public Message { MESSAGE_CLASS_DECLARATION public: - AddThreadedBasebandSampleSource(ThreadedBasebandSampleSource* threadedSampleSource, int index) : + AddThreadedBasebandSampleSource(ThreadedBasebandSampleSource* threadedSampleSource, unsigned int index) : Message(), m_threadedSampleSource(threadedSampleSource), m_index(index) { } ThreadedBasebandSampleSource* getThreadedSampleSource() const { return m_threadedSampleSource; } - int getIndex() const { return m_index; } + unsigned int getIndex() const { return m_index; } private: ThreadedBasebandSampleSource* m_threadedSampleSource; - int m_index; + unsigned int m_index; }; class RemoveThreadedBasebandSampleSource : public Message { MESSAGE_CLASS_DECLARATION public: - RemoveThreadedBasebandSampleSource(ThreadedBasebandSampleSource* threadedSampleSource, int index) : + RemoveThreadedBasebandSampleSource(ThreadedBasebandSampleSource* threadedSampleSource, unsigned int index) : Message(), m_threadedSampleSource(threadedSampleSource), m_index(index) { } ThreadedBasebandSampleSource* getThreadedSampleSource() const { return m_threadedSampleSource; } - int getIndex() const { return m_index; } + unsigned int getIndex() const { return m_index; } private: ThreadedBasebandSampleSource* m_threadedSampleSource; - int m_index; + unsigned int m_index; }; class AddThreadedBasebandSampleSink : public Message { MESSAGE_CLASS_DECLARATION public: - AddThreadedBasebandSampleSink(ThreadedBasebandSampleSink* threadedSampleSink, int index) : + AddThreadedBasebandSampleSink(ThreadedBasebandSampleSink* threadedSampleSink, unsigned int index) : Message(), m_threadedSampleSink(threadedSampleSink), m_index(index) { } ThreadedBasebandSampleSink* getThreadedSampleSink() const { return m_threadedSampleSink; } - int getIndex() const { return m_index; } + unsigned int getIndex() const { return m_index; } private: ThreadedBasebandSampleSink* m_threadedSampleSink; - int m_index; + unsigned int m_index; }; class RemoveThreadedBasebandSampleSink : public Message { MESSAGE_CLASS_DECLARATION public: - RemoveThreadedBasebandSampleSink(ThreadedBasebandSampleSink* threadedSampleSink, int index) : + RemoveThreadedBasebandSampleSink(ThreadedBasebandSampleSink* threadedSampleSink, unsigned int index) : Message(), m_threadedSampleSink(threadedSampleSink), m_index(index) { } ThreadedBasebandSampleSink* getThreadedSampleSink() const { return m_threadedSampleSink; } - int getIndex() const { return m_index; } + unsigned int getIndex() const { return m_index; } private: ThreadedBasebandSampleSink* m_threadedSampleSink; - int m_index; + unsigned int m_index; }; class AddBasebandSampleSink : public Message { MESSAGE_CLASS_DECLARATION public: - AddBasebandSampleSink(BasebandSampleSink* sampleSink, int index) : + AddBasebandSampleSink(BasebandSampleSink* sampleSink, unsigned int index) : Message(), m_sampleSink(sampleSink), m_index(index) { } BasebandSampleSink* getSampleSink() const { return m_sampleSink; } - int getIndex() const { return m_index; } + unsigned int getIndex() const { return m_index; } private: BasebandSampleSink* m_sampleSink; - int m_index; + unsigned int m_index; }; class RemoveBasebandSampleSink : public Message { MESSAGE_CLASS_DECLARATION public: - RemoveBasebandSampleSink(BasebandSampleSink* sampleSink, int index) : + RemoveBasebandSampleSink(BasebandSampleSink* sampleSink, unsigned int index) : Message(), m_sampleSink(sampleSink), m_index(index) { } BasebandSampleSink* getSampleSink() const { return m_sampleSink; } - int getIndex() const { return m_index; } + unsigned int getIndex() const { return m_index; } private: BasebandSampleSink* m_sampleSink; - int m_index; + unsigned int m_index; }; class AddSpectrumSink : public Message { @@ -174,7 +174,7 @@ public: class ConfigureCorrection : public Message { MESSAGE_CLASS_DECLARATION public: - ConfigureCorrection(bool dcOffsetCorrection, bool iqImbalanceCorrection, int index) : + ConfigureCorrection(bool dcOffsetCorrection, bool iqImbalanceCorrection, unsigned int index) : Message(), m_dcOffsetCorrection(dcOffsetCorrection), m_iqImbalanceCorrection(iqImbalanceCorrection), @@ -182,17 +182,17 @@ public: { } bool getDCOffsetCorrection() const { return m_dcOffsetCorrection; } bool getIQImbalanceCorrection() const { return m_iqImbalanceCorrection; } - int getIndex() const { return m_index; } + unsigned int getIndex() const { return m_index; } private: bool m_dcOffsetCorrection; bool m_iqImbalanceCorrection; - int m_index; + unsigned int m_index; }; class SignalNotification : public Message { MESSAGE_CLASS_DECLARATION public: - SignalNotification(int samplerate, qint64 centerFrequency, bool sourceOrSink, int index) : + SignalNotification(int samplerate, qint64 centerFrequency, bool sourceOrSink, unsigned int index) : Message(), m_sampleRate(samplerate), m_centerFrequency(centerFrequency), @@ -202,12 +202,12 @@ public: int getSampleRate() const { return m_sampleRate; } qint64 getCenterFrequency() const { return m_centerFrequency; } bool getSourceOrSink() const { return m_sourceOrSink; } - int getIndex() const { return m_index; } + unsigned int getIndex() const { return m_index; } private: int m_sampleRate; qint64 m_centerFrequency; bool m_sourceOrSink; - int m_index; + unsigned int m_index; }; enum State { @@ -324,7 +324,7 @@ private slots: void handleData(); //!< Handle data when samples have to be processed void handleSynchronousMessages(); //!< Handle synchronous messages with the thread void handleInputMessages(); //!< Handle input message queue - void handleForwardToSpectrumSink(int nbSamples); + //TODO: void handleForwardToSpectrumSink(int nbSamples); }; #endif // SDRBASE_DSP_DSPDEVICEMIMOENGINE_H_ \ No newline at end of file