Fixed setting of source of same kind with different sequence number

pull/6/head
f4exb 2015-10-03 23:59:02 +02:00
rodzic f9913c7875
commit 1ac49ce8ce
5 zmienionych plików z 17 dodań i 10 usunięć

Wyświetl plik

@ -33,8 +33,8 @@ ENDIF()
##############################################################################
#include(${QT_USE_FILE})
#set( QT_DEFINITIONS "${QT_DEFINITIONS} -DQT_NO_DEBUG_OUTPUT" )
set( QT_DEFINITIONS "${QT_DEFINITIONS}" )
set( QT_DEFINITIONS "${QT_DEFINITIONS} -DQT_NO_DEBUG_OUTPUT" )
#set( QT_DEFINITIONS "${QT_DEFINITIONS}" )
add_definitions(${QT_DEFINITIONS})
if(MSVC)

Wyświetl plik

@ -65,7 +65,8 @@ public:
bool startAcquisition(); //!< Start acquisition sequence
void stopAcquistion(); //!< Stop acquisition sequence
void setSource(SampleSource* source); //!< Set the unique sample source
void setSource(SampleSource* source); //!< Set the sample source type
void setSourceSequence(int sequence); //!< Set the sample source sequence in type
void addSink(SampleSink* sink); //!< Add a sample sink
void removeSink(SampleSink* sink); //!< Remove a sample sink
@ -94,6 +95,7 @@ private:
QString m_deviceDescription;
SampleSource* m_sampleSource;
int m_sampleSourceSequence;
typedef std::list<SampleSink*> SampleSinks;
SampleSinks m_sampleSinks; //!< sample sinks within main thread (usually spectrum, file output)

Wyświetl plik

@ -23,7 +23,6 @@
#include "rtlsdrgui.h"
#include "dsp/dspcommands.h"
#include "dsp/dspengine.h"
#include "util/prettyprint.h"
MESSAGE_CLASS_DEFINITION(RTLSDRInput::MsgConfigureRTLSDR, Message)
MESSAGE_CLASS_DEFINITION(RTLSDRInput::MsgReportRTLSDR, Message)
@ -48,8 +47,6 @@ bool RTLSDRInput::init(const Message& message)
bool RTLSDRInput::start(int device)
{
qDebug("%sRTLSDRInput::start: device: %d%s", qPrintable(EscapeColors::red), device, qPrintable(EscapeColors::terminator));
QMutexLocker mutexLocker(&m_mutex);
if (m_dev != 0)

Wyświetl plik

@ -29,6 +29,7 @@ DSPEngine::DSPEngine(QObject* parent) :
QThread(parent),
m_state(StNotStarted),
m_sampleSource(0),
m_sampleSourceSequence(0),
m_sampleSinks(),
m_sampleRate(0),
m_centerFrequency(0),
@ -120,6 +121,12 @@ void DSPEngine::setSource(SampleSource* source)
m_syncMessenger.sendWait(cmd);
}
void DSPEngine::setSourceSequence(int sequence)
{
qDebug("DSPEngine::setSourceSequence: seq: %d", sequence);
m_sampleSourceSequence = sequence;
}
void DSPEngine::addSink(SampleSink* sink)
{
qDebug() << "DSPEngine::addSink: " << sink->objectName().toStdString().c_str();
@ -460,7 +467,7 @@ DSPEngine::State DSPEngine::gotoRunning()
// Start everything
if(!m_sampleSource->start(0))
if(!m_sampleSource->start(m_sampleSourceSequence))
{
return gotoError("Could not start sample source");
}
@ -508,12 +515,12 @@ void DSPEngine::handleSetSource(SampleSource* source)
if(m_sampleSource != 0)
{
qDebug() << "DSPEngine::handleSetSource: set " << source->getDeviceDescription().toStdString().c_str();
qDebug("DSPEngine::handleSetSource: set %s", qPrintable(source->getDeviceDescription()));
connect(m_sampleSource->getSampleFifo(), SIGNAL(dataReady()), this, SLOT(handleData()), Qt::QueuedConnection);
}
else
{
qDebug() << "DSPEngine::handleSetSource: set none";
qDebug("DSPEngine::handleSetSource: set none");
}
}

Wyświetl plik

@ -308,12 +308,13 @@ int PluginManager::selectSampleSourceByIndex(int index)
m_sampleSourceSerial = m_sampleSourceDevices[index].m_sourceSerial;
m_sampleSourceSequence = m_sampleSourceDevices[index].m_sourceSequence;
qDebug() << "PluginManager::selectSampleSource by index: m_sampleSource at index " << index
qDebug() << "PluginManager::selectSampleSourceByIndex: m_sampleSource at index " << index
<< " id: " << m_sampleSourceId.toStdString().c_str()
<< " ser: " << m_sampleSourceSerial.toStdString().c_str()
<< " seq: " << m_sampleSourceSequence;
m_sampleSourcePluginGUI = m_sampleSourceDevices[index].m_plugin->createSampleSourcePluginGUI(m_sampleSourceId);
m_dspEngine->setSourceSequence(m_sampleSourceSequence);
return index;
}