mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-02 06:04:39 -04:00
Merged latest developments on dev branch (4.8.1 and 4.8.2)
This commit is contained in:
@@ -47,6 +47,7 @@ TestSourceInput::TestSourceInput(DeviceAPI *deviceAPI) :
|
||||
m_masterTimer(deviceAPI->getMasterTimer())
|
||||
{
|
||||
m_fileSink = new FileRecord(QString("test_%1.sdriq").arg(m_deviceAPI->getDeviceUID()));
|
||||
m_deviceAPI->setNbSourceStreams(1);
|
||||
m_deviceAPI->addAncillarySink(m_fileSink);
|
||||
|
||||
if (!m_sampleFifo.setSize(96000 * 4)) {
|
||||
|
||||
@@ -96,7 +96,7 @@ PluginInstanceGUI* TestSourcePlugin::createSampleSourcePluginInstanceGUI(
|
||||
}
|
||||
#endif
|
||||
|
||||
DeviceSampleSource *TestSourcePlugin::createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceAPI *deviceAPI)
|
||||
DeviceSampleSource *TestSourcePlugin::createSampleSourcePluginInstance(const QString& sourceId, DeviceAPI *deviceAPI)
|
||||
{
|
||||
if (sourceId == m_deviceTypeID)
|
||||
{
|
||||
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
const QString& sourceId,
|
||||
QWidget **widget,
|
||||
DeviceUISet *deviceUISet);
|
||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceAPI *deviceAPI);
|
||||
virtual DeviceSampleSource* createSampleSourcePluginInstance(const QString& sourceId, DeviceAPI *deviceAPI);
|
||||
|
||||
static const QString m_hardwareID;
|
||||
static const QString m_deviceTypeID;
|
||||
|
||||
@@ -63,7 +63,8 @@ TestSourceThread::TestSourceThread(SampleSinkFifo* sampleFifo, QObject* parent)
|
||||
m_fcPosShift(0),
|
||||
m_throttlems(TESTSOURCE_THROTTLE_MS),
|
||||
m_throttleToggle(false),
|
||||
m_mutex(QMutex::Recursive)
|
||||
m_mutex(QMutex::Recursive),
|
||||
m_histoCounter(0)
|
||||
{
|
||||
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection);
|
||||
}
|
||||
@@ -74,6 +75,7 @@ TestSourceThread::~TestSourceThread()
|
||||
|
||||
void TestSourceThread::startWork()
|
||||
{
|
||||
m_timer.setTimerType(Qt::PreciseTimer);
|
||||
connect(&m_timer, SIGNAL(timeout()), this, SLOT(tick()));
|
||||
m_timer.start(50);
|
||||
m_startWaitMutex.lock();
|
||||
@@ -392,6 +394,25 @@ void TestSourceThread::tick()
|
||||
{
|
||||
qint64 throttlems = m_elapsedTimer.restart();
|
||||
|
||||
std::map<int,int>::iterator it;
|
||||
it = m_timerHistogram.find(throttlems);
|
||||
|
||||
if (it == m_timerHistogram.end()) {
|
||||
m_timerHistogram[throttlems] = 1;
|
||||
} else {
|
||||
it->second++;
|
||||
}
|
||||
|
||||
if (m_histoCounter < 49) {
|
||||
m_histoCounter++;
|
||||
} else {
|
||||
qDebug("TestSourceThread::tick: -----------");
|
||||
for (std::map<int,int>::iterator it = m_timerHistogram.begin(); it != m_timerHistogram.end(); ++it) {
|
||||
qDebug("TestSourceThread::tick: %d: %d", it->first, it->second);
|
||||
}
|
||||
m_histoCounter = 0;
|
||||
}
|
||||
|
||||
if ((throttlems > 45) && (throttlems < 55) && (throttlems != m_throttlems))
|
||||
{
|
||||
QMutexLocker mutexLocker(&m_mutex);
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
#ifndef _TESTSOURCE_TESTSOURCETHREAD_H_
|
||||
#define _TESTSOURCE_TESTSOURCETHREAD_H_
|
||||
|
||||
#include <map>
|
||||
|
||||
#include <QThread>
|
||||
#include <QMutex>
|
||||
#include <QWaitCondition>
|
||||
@@ -133,6 +135,9 @@ private:
|
||||
Decimators<qint32, qint16, SDR_RX_SAMP_SZ, 12> m_decimators_12;
|
||||
Decimators<qint32, qint16, SDR_RX_SAMP_SZ, 16> m_decimators_16;
|
||||
|
||||
std::map<int, int> m_timerHistogram;
|
||||
uint32_t m_histoCounter;
|
||||
|
||||
void startWork();
|
||||
void stopWork();
|
||||
void run();
|
||||
|
||||
Reference in New Issue
Block a user