mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-26 09:48:45 -05:00
Use Qt precise timer for test and file sources
This commit is contained in:
parent
319c988ef9
commit
3f4c0a2e70
@ -75,6 +75,7 @@ TestMIThread::~TestMIThread()
|
|||||||
|
|
||||||
void TestMIThread::startWork()
|
void TestMIThread::startWork()
|
||||||
{
|
{
|
||||||
|
m_timer.setTimerType(Qt::PreciseTimer);
|
||||||
connect(&m_timer, SIGNAL(timeout()), this, SLOT(tick()));
|
connect(&m_timer, SIGNAL(timeout()), this, SLOT(tick()));
|
||||||
m_timer.start(50);
|
m_timer.start(50);
|
||||||
m_startWaitMutex.lock();
|
m_startWaitMutex.lock();
|
||||||
|
@ -60,8 +60,7 @@ FileSourceInput::FileSourceInput(DeviceAPI *deviceAPI) :
|
|||||||
m_sampleSize(0),
|
m_sampleSize(0),
|
||||||
m_centerFrequency(0),
|
m_centerFrequency(0),
|
||||||
m_recordLength(0),
|
m_recordLength(0),
|
||||||
m_startingTimeStamp(0),
|
m_startingTimeStamp(0)
|
||||||
m_masterTimer(deviceAPI->getMasterTimer())
|
|
||||||
{
|
{
|
||||||
m_deviceAPI->setNbSourceStreams(1);
|
m_deviceAPI->setNbSourceStreams(1);
|
||||||
qDebug("FileSourceInput::FileSourceInput: device source engine: %p", m_deviceAPI->getDeviceSourceEngine());
|
qDebug("FileSourceInput::FileSourceInput: device source engine: %p", m_deviceAPI->getDeviceSourceEngine());
|
||||||
@ -69,10 +68,13 @@ FileSourceInput::FileSourceInput(DeviceAPI *deviceAPI) :
|
|||||||
qDebug("FileSourceInput::FileSourceInput: device source: %p", m_deviceAPI->getDeviceSourceEngine()->getSource());
|
qDebug("FileSourceInput::FileSourceInput: device source: %p", m_deviceAPI->getDeviceSourceEngine()->getSource());
|
||||||
m_networkManager = new QNetworkAccessManager();
|
m_networkManager = new QNetworkAccessManager();
|
||||||
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||||
|
m_masterTimer.setTimerType(Qt::PreciseTimer);
|
||||||
|
m_masterTimer.start(50);
|
||||||
}
|
}
|
||||||
|
|
||||||
FileSourceInput::~FileSourceInput()
|
FileSourceInput::~FileSourceInput()
|
||||||
{
|
{
|
||||||
|
m_masterTimer.stop();
|
||||||
disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||||
delete m_networkManager;
|
delete m_networkManager;
|
||||||
|
|
||||||
|
@ -332,7 +332,7 @@ public:
|
|||||||
quint64 m_centerFrequency;
|
quint64 m_centerFrequency;
|
||||||
quint64 m_recordLength; //!< record length in seconds computed from file size
|
quint64 m_recordLength; //!< record length in seconds computed from file size
|
||||||
quint64 m_startingTimeStamp;
|
quint64 m_startingTimeStamp;
|
||||||
const QTimer& m_masterTimer;
|
QTimer m_masterTimer;
|
||||||
QNetworkAccessManager *m_networkManager;
|
QNetworkAccessManager *m_networkManager;
|
||||||
QNetworkRequest m_networkRequest;
|
QNetworkRequest m_networkRequest;
|
||||||
|
|
||||||
|
@ -74,6 +74,7 @@ TestSourceThread::~TestSourceThread()
|
|||||||
|
|
||||||
void TestSourceThread::startWork()
|
void TestSourceThread::startWork()
|
||||||
{
|
{
|
||||||
|
m_timer.setTimerType(Qt::PreciseTimer);
|
||||||
connect(&m_timer, SIGNAL(timeout()), this, SLOT(tick()));
|
connect(&m_timer, SIGNAL(timeout()), this, SLOT(tick()));
|
||||||
m_timer.start(50);
|
m_timer.start(50);
|
||||||
m_startWaitMutex.lock();
|
m_startWaitMutex.lock();
|
||||||
|
Loading…
Reference in New Issue
Block a user