mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-07-25 11:34:09 -04:00
Single DeviceAPI interface (1)
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
|
||||
#include "airspygui.h"
|
||||
|
||||
#include <device/devicesourceapi.h>
|
||||
#include "device/deviceapi.h"
|
||||
#include "device/deviceuiset.h"
|
||||
#include <dsp/filerecord.h>
|
||||
|
||||
@@ -42,9 +42,9 @@ AirspyGui::AirspyGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
m_forceSettings(true),
|
||||
m_settings(),
|
||||
m_sampleSource(0),
|
||||
m_lastEngineState(DSPDeviceSourceEngine::StNotStarted)
|
||||
m_lastEngineState(DeviceAPI::StNotStarted)
|
||||
{
|
||||
m_sampleSource = (AirspyInput*) m_deviceUISet->m_deviceSourceAPI->getSampleSource();
|
||||
m_sampleSource = (AirspyInput*) m_deviceUISet->m_deviceAPI->getSampleSource();
|
||||
|
||||
ui->setupUi(this);
|
||||
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
||||
@@ -409,24 +409,24 @@ void AirspyGui::updateHardware()
|
||||
|
||||
void AirspyGui::updateStatus()
|
||||
{
|
||||
int state = m_deviceUISet->m_deviceSourceAPI->state();
|
||||
int state = m_deviceUISet->m_deviceAPI->state();
|
||||
|
||||
if(m_lastEngineState != state)
|
||||
{
|
||||
switch(state)
|
||||
{
|
||||
case DSPDeviceSourceEngine::StNotStarted:
|
||||
case DeviceAPI::StNotStarted:
|
||||
ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StIdle:
|
||||
case DeviceAPI::StIdle:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StRunning:
|
||||
case DeviceAPI::StRunning:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StError:
|
||||
case DeviceAPI::StError:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
||||
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceSourceAPI->errorMessage());
|
||||
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include "airspyinput.h"
|
||||
#include "airspyplugin.h"
|
||||
|
||||
#include "device/devicesourceapi.h"
|
||||
#include "device/deviceapi.h"
|
||||
#include "dsp/filerecord.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/dspengine.h"
|
||||
@@ -45,7 +45,7 @@ MESSAGE_CLASS_DEFINITION(AirspyInput::MsgFileRecord, Message)
|
||||
const qint64 AirspyInput::loLowLimitFreq = 24000000L;
|
||||
const qint64 AirspyInput::loHighLimitFreq = 1900000000L;
|
||||
|
||||
AirspyInput::AirspyInput(DeviceSourceAPI *deviceAPI) :
|
||||
AirspyInput::AirspyInput(DeviceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_settings(),
|
||||
m_dev(0),
|
||||
@@ -55,7 +55,7 @@ AirspyInput::AirspyInput(DeviceSourceAPI *deviceAPI) :
|
||||
{
|
||||
openDevice();
|
||||
m_fileSink = new FileRecord(QString("test_%1.sdriq").arg(m_deviceAPI->getDeviceUID()));
|
||||
m_deviceAPI->addSink(m_fileSink);
|
||||
m_deviceAPI->addAncillarySink(m_fileSink);
|
||||
|
||||
m_networkManager = new QNetworkAccessManager();
|
||||
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
@@ -70,7 +70,7 @@ AirspyInput::~AirspyInput()
|
||||
stop();
|
||||
}
|
||||
|
||||
m_deviceAPI->removeSink(m_fileSink);
|
||||
m_deviceAPI->removeAncillarySink(m_fileSink);
|
||||
delete m_fileSink;
|
||||
closeDevice();
|
||||
}
|
||||
@@ -102,7 +102,7 @@ bool AirspyInput::openDevice()
|
||||
return false;
|
||||
}
|
||||
|
||||
int device = m_deviceAPI->getSampleSourceSequence();
|
||||
int device = m_deviceAPI->getSamplingDeviceSequence();
|
||||
|
||||
if ((m_dev = open_airspy_from_sequence(device)) == 0)
|
||||
{
|
||||
@@ -301,14 +301,14 @@ bool AirspyInput::handleMessage(const Message& message)
|
||||
|
||||
if (cmd.getStartStop())
|
||||
{
|
||||
if (m_deviceAPI->initAcquisition())
|
||||
if (m_deviceAPI->initDeviceEngine())
|
||||
{
|
||||
m_deviceAPI->startAcquisition();
|
||||
m_deviceAPI->startDeviceEngine();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_deviceAPI->stopAcquisition();
|
||||
m_deviceAPI->stopDeviceEngine();
|
||||
}
|
||||
|
||||
if (m_settings.m_useReverseAPI) {
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
class QNetworkAccessManager;
|
||||
class QNetworkReply;
|
||||
class DeviceSourceAPI;
|
||||
class DeviceAPI;
|
||||
class AirspyThread;
|
||||
class FileRecord;
|
||||
|
||||
@@ -96,7 +96,7 @@ public:
|
||||
{ }
|
||||
};
|
||||
|
||||
AirspyInput(DeviceSourceAPI *deviceAPI);
|
||||
AirspyInput(DeviceAPI *deviceAPI);
|
||||
virtual ~AirspyInput();
|
||||
virtual void destroy();
|
||||
|
||||
@@ -144,7 +144,7 @@ public:
|
||||
static const qint64 loHighLimitFreq;
|
||||
|
||||
private:
|
||||
DeviceSourceAPI *m_deviceAPI;
|
||||
DeviceAPI *m_deviceAPI;
|
||||
QMutex m_mutex;
|
||||
AirspySettings m_settings;
|
||||
struct airspy_device* m_dev;
|
||||
|
||||
@@ -156,7 +156,7 @@ PluginInstanceGUI* AirspyPlugin::createSampleSourcePluginInstanceGUI(
|
||||
}
|
||||
#endif
|
||||
|
||||
DeviceSampleSource *AirspyPlugin::createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI)
|
||||
DeviceSampleSource *AirspyPlugin::createSampleSourcePluginInstanceInput(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, DeviceSourceAPI *deviceAPI);
|
||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceAPI *deviceAPI);
|
||||
|
||||
static const QString m_hardwareID;
|
||||
static const QString m_deviceTypeID;
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#include <libairspyhf/airspyhf.h>
|
||||
|
||||
#include <device/devicesourceapi.h>
|
||||
#include <device/deviceapi.h>
|
||||
#include "device/deviceuiset.h"
|
||||
#include <dsp/filerecord.h>
|
||||
|
||||
@@ -41,9 +41,9 @@ AirspyHFGui::AirspyHFGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
m_forceSettings(true),
|
||||
m_settings(),
|
||||
m_sampleSource(0),
|
||||
m_lastEngineState(DSPDeviceSourceEngine::StNotStarted)
|
||||
m_lastEngineState(DeviceAPI::StNotStarted)
|
||||
{
|
||||
m_sampleSource = (AirspyHFInput*) m_deviceUISet->m_deviceSourceAPI->getSampleSource();
|
||||
m_sampleSource = (AirspyHFInput*) m_deviceUISet->m_deviceAPI->getSampleSource();
|
||||
|
||||
ui->setupUi(this);
|
||||
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
||||
@@ -428,24 +428,24 @@ void AirspyHFGui::updateHardware()
|
||||
|
||||
void AirspyHFGui::updateStatus()
|
||||
{
|
||||
int state = m_deviceUISet->m_deviceSourceAPI->state();
|
||||
int state = m_deviceUISet->m_deviceAPI->state();
|
||||
|
||||
if(m_lastEngineState != state)
|
||||
{
|
||||
switch(state)
|
||||
{
|
||||
case DSPDeviceSourceEngine::StNotStarted:
|
||||
case DeviceAPI::StNotStarted:
|
||||
ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StIdle:
|
||||
case DeviceAPI::StIdle:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StRunning:
|
||||
case DeviceAPI::StRunning:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StError:
|
||||
case DeviceAPI::StError:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
||||
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceSourceAPI->errorMessage());
|
||||
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
#include "SWGDeviceReport.h"
|
||||
#include "SWGAirspyHFReport.h"
|
||||
|
||||
#include <device/devicesourceapi.h>
|
||||
#include <dsp/filerecord.h>
|
||||
#include "device/deviceapi.h"
|
||||
#include "dsp/filerecord.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/dspengine.h"
|
||||
|
||||
@@ -47,7 +47,7 @@ const qint64 AirspyHFInput::loHighLimitFreqHF = 31000000L;
|
||||
const qint64 AirspyHFInput::loLowLimitFreqVHF = 60000000L;
|
||||
const qint64 AirspyHFInput::loHighLimitFreqVHF = 260000000L;
|
||||
|
||||
AirspyHFInput::AirspyHFInput(DeviceSourceAPI *deviceAPI) :
|
||||
AirspyHFInput::AirspyHFInput(DeviceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_settings(),
|
||||
m_dev(0),
|
||||
@@ -57,7 +57,7 @@ AirspyHFInput::AirspyHFInput(DeviceSourceAPI *deviceAPI) :
|
||||
{
|
||||
openDevice();
|
||||
m_fileSink = new FileRecord(QString("test_%1.sdriq").arg(m_deviceAPI->getDeviceUID()));
|
||||
m_deviceAPI->addSink(m_fileSink);
|
||||
m_deviceAPI->addAncillarySink(m_fileSink);
|
||||
m_networkManager = new QNetworkAccessManager();
|
||||
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
}
|
||||
@@ -71,7 +71,7 @@ AirspyHFInput::~AirspyHFInput()
|
||||
stop();
|
||||
}
|
||||
|
||||
m_deviceAPI->removeSink(m_fileSink);
|
||||
m_deviceAPI->removeAncillarySink(m_fileSink);
|
||||
delete m_fileSink;
|
||||
closeDevice();
|
||||
}
|
||||
@@ -96,15 +96,15 @@ bool AirspyHFInput::openDevice()
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((m_dev = open_airspyhf_from_serial(m_deviceAPI->getSampleSourceSerial())) == 0)
|
||||
if ((m_dev = open_airspyhf_from_serial(m_deviceAPI->getSamplingDeviceSerial())) == 0)
|
||||
{
|
||||
qCritical("AirspyHFInput::openDevice: could not open Airspy HF with serial %s", qPrintable(m_deviceAPI->getSampleSourceSerial()));
|
||||
qCritical("AirspyHFInput::openDevice: could not open Airspy HF with serial %s", qPrintable(m_deviceAPI->getSamplingDeviceSerial()));
|
||||
m_dev = 0;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug("AirspyHFInput::openDevice: opened Airspy HF with serial %s", qPrintable(m_deviceAPI->getSampleSourceSerial()));
|
||||
qDebug("AirspyHFInput::openDevice: opened Airspy HF with serial %s", qPrintable(m_deviceAPI->getSamplingDeviceSerial()));
|
||||
}
|
||||
|
||||
uint32_t nbSampleRates;
|
||||
@@ -311,14 +311,14 @@ bool AirspyHFInput::handleMessage(const Message& message)
|
||||
|
||||
if (cmd.getStartStop())
|
||||
{
|
||||
if (m_deviceAPI->initAcquisition())
|
||||
if (m_deviceAPI->initDeviceEngine())
|
||||
{
|
||||
m_deviceAPI->startAcquisition();
|
||||
m_deviceAPI->startDeviceEngine();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_deviceAPI->stopAcquisition();
|
||||
m_deviceAPI->stopDeviceEngine();
|
||||
}
|
||||
|
||||
if (m_settings.m_useReverseAPI) {
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
class QNetworkAccessManager;
|
||||
class QNetworkReply;
|
||||
class DeviceSourceAPI;
|
||||
class DeviceAPI;
|
||||
class AirspyHFThread;
|
||||
class FileRecord;
|
||||
|
||||
@@ -97,7 +97,7 @@ public:
|
||||
{ }
|
||||
};
|
||||
|
||||
AirspyHFInput(DeviceSourceAPI *deviceAPI);
|
||||
AirspyHFInput(DeviceAPI *deviceAPI);
|
||||
virtual ~AirspyHFInput();
|
||||
virtual void destroy();
|
||||
|
||||
@@ -147,7 +147,7 @@ public:
|
||||
static const qint64 loHighLimitFreqVHF;
|
||||
|
||||
private:
|
||||
DeviceSourceAPI *m_deviceAPI;
|
||||
DeviceAPI *m_deviceAPI;
|
||||
QMutex m_mutex;
|
||||
AirspyHFSettings m_settings;
|
||||
airspyhf_device_t* m_dev;
|
||||
|
||||
@@ -126,7 +126,7 @@ PluginInstanceGUI* AirspyHFPlugin::createSampleSourcePluginInstanceGUI(
|
||||
}
|
||||
#endif
|
||||
|
||||
DeviceSampleSource *AirspyHFPlugin::createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI)
|
||||
DeviceSampleSource *AirspyHFPlugin::createSampleSourcePluginInstanceInput(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, DeviceSourceAPI *deviceAPI);
|
||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceAPI *deviceAPI);
|
||||
|
||||
static const QString m_hardwareID;
|
||||
static const QString m_deviceTypeID;
|
||||
|
||||
@@ -27,10 +27,11 @@
|
||||
|
||||
#include "util/simpleserializer.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/dspdevicesourceengine.h"
|
||||
#include "dsp/dspdevicesinkengine.h"
|
||||
#include "dsp/dspengine.h"
|
||||
#include "dsp/filerecord.h"
|
||||
#include "device/devicesourceapi.h"
|
||||
#include "device/devicesinkapi.h"
|
||||
#include "device/deviceapi.h"
|
||||
|
||||
#include "bladerf1input.h"
|
||||
#include "bladerf1inputthread.h"
|
||||
@@ -39,7 +40,7 @@ MESSAGE_CLASS_DEFINITION(Bladerf1Input::MsgConfigureBladerf1, Message)
|
||||
MESSAGE_CLASS_DEFINITION(Bladerf1Input::MsgStartStop, Message)
|
||||
MESSAGE_CLASS_DEFINITION(Bladerf1Input::MsgFileRecord, Message)
|
||||
|
||||
Bladerf1Input::Bladerf1Input(DeviceSourceAPI *deviceAPI) :
|
||||
Bladerf1Input::Bladerf1Input(DeviceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_settings(),
|
||||
m_dev(0),
|
||||
@@ -49,7 +50,7 @@ Bladerf1Input::Bladerf1Input(DeviceSourceAPI *deviceAPI) :
|
||||
{
|
||||
openDevice();
|
||||
m_fileSink = new FileRecord(QString("test_%1.sdriq").arg(m_deviceAPI->getDeviceUID()));
|
||||
m_deviceAPI->addSink(m_fileSink);
|
||||
m_deviceAPI->addAncillarySink(m_fileSink);
|
||||
|
||||
m_deviceAPI->setBuddySharedPtr(&m_sharedParams);
|
||||
|
||||
@@ -66,7 +67,7 @@ Bladerf1Input::~Bladerf1Input()
|
||||
stop();
|
||||
}
|
||||
|
||||
m_deviceAPI->removeSink(m_fileSink);
|
||||
m_deviceAPI->removeAncillarySink(m_fileSink);
|
||||
delete m_fileSink;
|
||||
closeDevice();
|
||||
m_deviceAPI->setBuddySharedPtr(0);
|
||||
@@ -94,7 +95,7 @@ bool Bladerf1Input::openDevice()
|
||||
|
||||
if (m_deviceAPI->getSinkBuddies().size() > 0)
|
||||
{
|
||||
DeviceSinkAPI *sinkBuddy = m_deviceAPI->getSinkBuddies()[0];
|
||||
DeviceAPI *sinkBuddy = m_deviceAPI->getSinkBuddies()[0];
|
||||
DeviceBladeRF1Params *buddySharedParams = (DeviceBladeRF1Params *) sinkBuddy->getBuddySharedPtr();
|
||||
|
||||
if (buddySharedParams == 0)
|
||||
@@ -114,9 +115,9 @@ bool Bladerf1Input::openDevice()
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!DeviceBladeRF1::open_bladerf(&m_dev, qPrintable(m_deviceAPI->getSampleSourceSerial())))
|
||||
if (!DeviceBladeRF1::open_bladerf(&m_dev, qPrintable(m_deviceAPI->getSamplingDeviceSerial())))
|
||||
{
|
||||
qCritical("BladerfInput::start: could not open BladeRF %s", qPrintable(m_deviceAPI->getSampleSourceSerial()));
|
||||
qCritical("BladerfInput::start: could not open BladeRF %s", qPrintable(m_deviceAPI->getSamplingDeviceSerial()));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -313,14 +314,14 @@ bool Bladerf1Input::handleMessage(const Message& message)
|
||||
|
||||
if (cmd.getStartStop())
|
||||
{
|
||||
if (m_deviceAPI->initAcquisition())
|
||||
if (m_deviceAPI->initDeviceEngine())
|
||||
{
|
||||
m_deviceAPI->startAcquisition();
|
||||
m_deviceAPI->startDeviceEngine();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_deviceAPI->stopAcquisition();
|
||||
m_deviceAPI->stopDeviceEngine();
|
||||
}
|
||||
|
||||
if (m_settings.m_useReverseAPI) {
|
||||
@@ -408,7 +409,7 @@ bool Bladerf1Input::applySettings(const BladeRF1InputSettings& settings, bool fo
|
||||
|
||||
if (m_deviceAPI->getSinkBuddies().size() > 0)
|
||||
{
|
||||
DeviceSinkAPI *buddy = m_deviceAPI->getSinkBuddies()[0];
|
||||
DeviceAPI *buddy = m_deviceAPI->getSinkBuddies()[0];
|
||||
|
||||
if (buddy->getDeviceSinkEngine()->state() == DSPDeviceSinkEngine::StRunning) { // Tx side running
|
||||
changeSettings = false;
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
class QNetworkAccessManager;
|
||||
class QNetworkReply;
|
||||
class DeviceSourceAPI;
|
||||
class DeviceAPI;
|
||||
class Bladerf1InputThread;
|
||||
class FileRecord;
|
||||
|
||||
@@ -99,7 +99,7 @@ public:
|
||||
{ }
|
||||
};
|
||||
|
||||
Bladerf1Input(DeviceSourceAPI *deviceAPI);
|
||||
Bladerf1Input(DeviceAPI *deviceAPI);
|
||||
virtual ~Bladerf1Input();
|
||||
virtual void destroy();
|
||||
|
||||
@@ -139,7 +139,7 @@ public:
|
||||
QString& errorMessage);
|
||||
|
||||
private:
|
||||
DeviceSourceAPI *m_deviceAPI;
|
||||
DeviceAPI *m_deviceAPI;
|
||||
QMutex m_mutex;
|
||||
BladeRF1InputSettings m_settings;
|
||||
struct bladerf* m_dev;
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "gui/basicdevicesettingsdialog.h"
|
||||
#include "dsp/dspengine.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "device/devicesourceapi.h"
|
||||
#include "device/deviceapi.h"
|
||||
#include "device/deviceuiset.h"
|
||||
|
||||
#include "bladerf1inputgui.h"
|
||||
@@ -42,9 +42,9 @@ Bladerf1InputGui::Bladerf1InputGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
m_sampleRateMode(true),
|
||||
m_sampleSource(NULL),
|
||||
m_sampleRate(0),
|
||||
m_lastEngineState(DSPDeviceSourceEngine::StNotStarted)
|
||||
m_lastEngineState(DeviceAPI::StNotStarted)
|
||||
{
|
||||
m_sampleSource = (Bladerf1Input*) m_deviceUISet->m_deviceSourceAPI->getSampleSource();
|
||||
m_sampleSource = (Bladerf1Input*) m_deviceUISet->m_deviceAPI->getSampleSource();
|
||||
|
||||
ui->setupUi(this);
|
||||
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
||||
@@ -471,24 +471,24 @@ void Bladerf1InputGui::blockApplySettings(bool block)
|
||||
|
||||
void Bladerf1InputGui::updateStatus()
|
||||
{
|
||||
int state = m_deviceUISet->m_deviceSourceAPI->state();
|
||||
int state = m_deviceUISet->m_deviceAPI->state();
|
||||
|
||||
if(m_lastEngineState != state)
|
||||
{
|
||||
switch(state)
|
||||
{
|
||||
case DSPDeviceSourceEngine::StNotStarted:
|
||||
case DeviceAPI::StNotStarted:
|
||||
ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StIdle:
|
||||
case DeviceAPI::StIdle:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StRunning:
|
||||
case DeviceAPI::StRunning:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StError:
|
||||
case DeviceAPI::StError:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
||||
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceSourceAPI->errorMessage());
|
||||
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -135,7 +135,7 @@ PluginInstanceGUI* Blderf1InputPlugin::createSampleSourcePluginInstanceGUI(
|
||||
}
|
||||
#endif
|
||||
|
||||
DeviceSampleSource *Blderf1InputPlugin::createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI)
|
||||
DeviceSampleSource *Blderf1InputPlugin::createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceAPI *deviceAPI)
|
||||
{
|
||||
if (sourceId == m_deviceTypeID)
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "plugin/plugininterface.h"
|
||||
|
||||
class PluginAPI;
|
||||
class DeviceSourceAPI;
|
||||
class DeviceAPI;
|
||||
class DeviceUISet;
|
||||
|
||||
#define BLADERF1INPUT_DEVICE_TYPE_ID "sdrangel.samplesource.bladerf1input"
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
const QString& sourceId,
|
||||
QWidget **widget,
|
||||
DeviceUISet *deviceUISet);
|
||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
|
||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceAPI *deviceAPI);
|
||||
|
||||
static const QString m_hardwareID;
|
||||
static const QString m_deviceTypeID;
|
||||
|
||||
@@ -27,8 +27,7 @@
|
||||
#include "SWGDeviceReport.h"
|
||||
#include "SWGBladeRF2InputReport.h"
|
||||
|
||||
#include "device/devicesourceapi.h"
|
||||
#include "device/devicesinkapi.h"
|
||||
#include "device/deviceapi.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/filerecord.h"
|
||||
#include "dsp/dspengine.h"
|
||||
@@ -44,7 +43,7 @@ MESSAGE_CLASS_DEFINITION(BladeRF2Input::MsgFileRecord, Message)
|
||||
MESSAGE_CLASS_DEFINITION(BladeRF2Input::MsgStartStop, Message)
|
||||
MESSAGE_CLASS_DEFINITION(BladeRF2Input::MsgReportGainRange, Message)
|
||||
|
||||
BladeRF2Input::BladeRF2Input(DeviceSourceAPI *deviceAPI) :
|
||||
BladeRF2Input::BladeRF2Input(DeviceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_settings(),
|
||||
m_deviceDescription("BladeRF2Input"),
|
||||
@@ -67,7 +66,7 @@ BladeRF2Input::BladeRF2Input(DeviceSourceAPI *deviceAPI) :
|
||||
}
|
||||
|
||||
m_fileSink = new FileRecord(QString("test_%1.sdriq").arg(m_deviceAPI->getDeviceUID()));
|
||||
m_deviceAPI->addSink(m_fileSink);
|
||||
m_deviceAPI->addAncillarySink(m_fileSink);
|
||||
m_networkManager = new QNetworkAccessManager();
|
||||
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
}
|
||||
@@ -81,7 +80,7 @@ BladeRF2Input::~BladeRF2Input()
|
||||
stop();
|
||||
}
|
||||
|
||||
m_deviceAPI->removeSink(m_fileSink);
|
||||
m_deviceAPI->removeAncillarySink(m_fileSink);
|
||||
delete m_fileSink;
|
||||
closeDevice();
|
||||
}
|
||||
@@ -108,7 +107,7 @@ bool BladeRF2Input::openDevice()
|
||||
{
|
||||
qDebug("BladeRF2Input::openDevice: look in Rx buddies");
|
||||
|
||||
DeviceSourceAPI *sourceBuddy = m_deviceAPI->getSourceBuddies()[0];
|
||||
DeviceAPI *sourceBuddy = m_deviceAPI->getSourceBuddies()[0];
|
||||
DeviceBladeRF2Shared *deviceBladeRF2Shared = (DeviceBladeRF2Shared*) sourceBuddy->getBuddySharedPtr();
|
||||
|
||||
if (deviceBladeRF2Shared == 0)
|
||||
@@ -132,7 +131,7 @@ bool BladeRF2Input::openDevice()
|
||||
{
|
||||
qDebug("BladeRF2Input::openDevice: look in Tx buddies");
|
||||
|
||||
DeviceSinkAPI *sinkBuddy = m_deviceAPI->getSinkBuddies()[0];
|
||||
DeviceAPI *sinkBuddy = m_deviceAPI->getSinkBuddies()[0];
|
||||
DeviceBladeRF2Shared *deviceBladeRF2Shared = (DeviceBladeRF2Shared*) sinkBuddy->getBuddySharedPtr();
|
||||
|
||||
if (deviceBladeRF2Shared == 0)
|
||||
@@ -158,7 +157,7 @@ bool BladeRF2Input::openDevice()
|
||||
|
||||
m_deviceShared.m_dev = new DeviceBladeRF2();
|
||||
char serial[256];
|
||||
strcpy(serial, qPrintable(m_deviceAPI->getSampleSourceSerial()));
|
||||
strcpy(serial, qPrintable(m_deviceAPI->getSamplingDeviceSerial()));
|
||||
|
||||
if (!m_deviceShared.m_dev->open(serial))
|
||||
{
|
||||
@@ -212,8 +211,8 @@ BladeRF2InputThread *BladeRF2Input::findThread()
|
||||
BladeRF2InputThread *bladerf2InputThread = 0;
|
||||
|
||||
// find a buddy that has allocated the thread
|
||||
const std::vector<DeviceSourceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceSourceAPI*>::const_iterator it = sourceBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator it = sourceBuddies.begin();
|
||||
|
||||
for (; it != sourceBuddies.end(); ++it)
|
||||
{
|
||||
@@ -239,8 +238,8 @@ BladeRF2InputThread *BladeRF2Input::findThread()
|
||||
|
||||
void BladeRF2Input::moveThreadToBuddy()
|
||||
{
|
||||
const std::vector<DeviceSourceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceSourceAPI*>::const_iterator it = sourceBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator it = sourceBuddies.begin();
|
||||
|
||||
for (; it != sourceBuddies.end(); ++it)
|
||||
{
|
||||
@@ -330,8 +329,8 @@ bool BladeRF2Input::start()
|
||||
}
|
||||
|
||||
// remove old thread address from buddies (reset in all buddies). The address being held only in the owning source.
|
||||
const std::vector<DeviceSourceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceSourceAPI*>::const_iterator it = sourceBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator it = sourceBuddies.begin();
|
||||
|
||||
for (; it != sourceBuddies.end(); ++it) {
|
||||
((DeviceBladeRF2Shared*) (*it)->getBuddySharedPtr())->m_source->setThread(0);
|
||||
@@ -424,8 +423,8 @@ void BladeRF2Input::stop()
|
||||
m_thread = 0;
|
||||
|
||||
// remove old thread address from buddies (reset in all buddies)
|
||||
const std::vector<DeviceSourceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceSourceAPI*>::const_iterator it = sourceBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator it = sourceBuddies.begin();
|
||||
|
||||
for (; it != sourceBuddies.end(); ++it) {
|
||||
((DeviceBladeRF2Shared*) (*it)->getBuddySharedPtr())->m_source->setThread(0);
|
||||
@@ -471,8 +470,8 @@ void BladeRF2Input::stop()
|
||||
}
|
||||
|
||||
// remove old thread address from buddies (reset in all buddies). The address being held only in the owning source.
|
||||
const std::vector<DeviceSourceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceSourceAPI*>::const_iterator it = sourceBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator it = sourceBuddies.begin();
|
||||
|
||||
for (; it != sourceBuddies.end(); ++it) {
|
||||
((DeviceBladeRF2Shared*) (*it)->getBuddySharedPtr())->m_source->setThread(0);
|
||||
@@ -743,14 +742,14 @@ bool BladeRF2Input::handleMessage(const Message& message)
|
||||
|
||||
if (cmd.getStartStop())
|
||||
{
|
||||
if (m_deviceAPI->initAcquisition())
|
||||
if (m_deviceAPI->initDeviceEngine())
|
||||
{
|
||||
m_deviceAPI->startAcquisition();
|
||||
m_deviceAPI->startDeviceEngine();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_deviceAPI->stopAcquisition();
|
||||
m_deviceAPI->stopDeviceEngine();
|
||||
}
|
||||
|
||||
if (m_settings.m_useReverseAPI) {
|
||||
@@ -975,8 +974,8 @@ bool BladeRF2Input::applySettings(const BladeRF2InputSettings& settings, bool fo
|
||||
if (forwardChangeRxBuddies)
|
||||
{
|
||||
// send to source buddies
|
||||
const std::vector<DeviceSourceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceSourceAPI*>::const_iterator itSource = sourceBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator itSource = sourceBuddies.begin();
|
||||
|
||||
for (; itSource != sourceBuddies.end(); ++itSource)
|
||||
{
|
||||
@@ -986,15 +985,15 @@ bool BladeRF2Input::applySettings(const BladeRF2InputSettings& settings, bool fo
|
||||
(int) settings.m_fcPos,
|
||||
settings.m_devSampleRate,
|
||||
true);
|
||||
(*itSource)->getSampleSourceInputMessageQueue()->push(report);
|
||||
(*itSource)->getSamplingDeviceInputMessageQueue()->push(report);
|
||||
}
|
||||
}
|
||||
|
||||
if (forwardChangeTxBuddies)
|
||||
{
|
||||
// send to sink buddies
|
||||
const std::vector<DeviceSinkAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
|
||||
std::vector<DeviceSinkAPI*>::const_iterator itSink = sinkBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator itSink = sinkBuddies.begin();
|
||||
|
||||
for (; itSink != sinkBuddies.end(); ++itSink)
|
||||
{
|
||||
@@ -1004,7 +1003,7 @@ bool BladeRF2Input::applySettings(const BladeRF2InputSettings& settings, bool fo
|
||||
(int) settings.m_fcPos,
|
||||
settings.m_devSampleRate,
|
||||
true);
|
||||
(*itSink)->getSampleSinkInputMessageQueue()->push(report);
|
||||
(*itSink)->getSamplingDeviceInputMessageQueue()->push(report);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
class QNetworkAccessManager;
|
||||
class QNetworkReply;
|
||||
class DeviceSourceAPI;
|
||||
class DeviceAPI;
|
||||
class BladeRF2InputThread;
|
||||
class FileRecord;
|
||||
struct bladerf_gain_modes;
|
||||
@@ -131,7 +131,7 @@ public:
|
||||
int m_value;
|
||||
};
|
||||
|
||||
BladeRF2Input(DeviceSourceAPI *deviceAPI);
|
||||
BladeRF2Input(DeviceAPI *deviceAPI);
|
||||
virtual ~BladeRF2Input();
|
||||
virtual void destroy();
|
||||
|
||||
@@ -183,7 +183,7 @@ public:
|
||||
QString& errorMessage);
|
||||
|
||||
private:
|
||||
DeviceSourceAPI *m_deviceAPI;
|
||||
DeviceAPI *m_deviceAPI;
|
||||
QMutex m_mutex;
|
||||
BladeRF2InputSettings m_settings;
|
||||
QString m_deviceDescription;
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "gui/basicdevicesettingsdialog.h"
|
||||
#include "dsp/dspengine.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "device/devicesourceapi.h"
|
||||
#include "device/deviceapi.h"
|
||||
#include "device/deviceuiset.h"
|
||||
|
||||
#include "bladerf2inputgui.h"
|
||||
@@ -42,9 +42,9 @@ BladeRF2InputGui::BladeRF2InputGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
m_sampleRateMode(true),
|
||||
m_sampleSource(0),
|
||||
m_sampleRate(0),
|
||||
m_lastEngineState(DSPDeviceSourceEngine::StNotStarted)
|
||||
m_lastEngineState(DeviceAPI::StNotStarted)
|
||||
{
|
||||
m_sampleSource = (BladeRF2Input*) m_deviceUISet->m_deviceSourceAPI->getSampleSource();
|
||||
m_sampleSource = (BladeRF2Input*) m_deviceUISet->m_deviceAPI->getSampleSource();
|
||||
int max, min, step;
|
||||
uint64_t f_min, f_max;
|
||||
|
||||
@@ -504,24 +504,24 @@ void BladeRF2InputGui::blockApplySettings(bool block)
|
||||
|
||||
void BladeRF2InputGui::updateStatus()
|
||||
{
|
||||
int state = m_deviceUISet->m_deviceSourceAPI->state();
|
||||
int state = m_deviceUISet->m_deviceAPI->state();
|
||||
|
||||
if(m_lastEngineState != state)
|
||||
{
|
||||
switch(state)
|
||||
{
|
||||
case DSPDeviceSourceEngine::StNotStarted:
|
||||
case DeviceAPI::StNotStarted:
|
||||
ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StIdle:
|
||||
case DeviceAPI::StIdle:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StRunning:
|
||||
case DeviceAPI::StRunning:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StError:
|
||||
case DeviceAPI::StError:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
||||
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceSourceAPI->errorMessage());
|
||||
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -140,7 +140,7 @@ PluginInstanceGUI* Blderf2InputPlugin::createSampleSourcePluginInstanceGUI(
|
||||
}
|
||||
#endif
|
||||
|
||||
DeviceSampleSource *Blderf2InputPlugin::createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI)
|
||||
DeviceSampleSource *Blderf2InputPlugin::createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceAPI *deviceAPI)
|
||||
{
|
||||
if (sourceId == m_deviceTypeID)
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "plugin/plugininterface.h"
|
||||
|
||||
class PluginAPI;
|
||||
class DeviceSourceAPI;
|
||||
class DeviceAPI;
|
||||
class DeviceUISet;
|
||||
|
||||
#define BLADERF2INPUT_DEVICE_TYPE_ID "sdrangel.samplesource.bladerf2input"
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
const QString& sourceId,
|
||||
QWidget **widget,
|
||||
DeviceUISet *deviceUISet);
|
||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
|
||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceAPI *deviceAPI);
|
||||
|
||||
static const QString m_hardwareID;
|
||||
static const QString m_deviceTypeID;
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "fcdprogui.h"
|
||||
|
||||
#include <device/devicesourceapi.h>
|
||||
#include "device/deviceapi.h"
|
||||
#include "device/deviceuiset.h"
|
||||
#include "fcdproconst.h"
|
||||
#include "fcdtraits.h"
|
||||
@@ -38,9 +38,9 @@ FCDProGui::FCDProGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
m_forceSettings(true),
|
||||
m_settings(),
|
||||
m_sampleSource(NULL),
|
||||
m_lastEngineState(DSPDeviceSourceEngine::StNotStarted)
|
||||
m_lastEngineState(DeviceAPI::StNotStarted)
|
||||
{
|
||||
m_sampleSource = (FCDProInput*) m_deviceUISet->m_deviceSourceAPI->getSampleSource();
|
||||
m_sampleSource = (FCDProInput*) m_deviceUISet->m_deviceAPI->getSampleSource();
|
||||
|
||||
ui->setupUi(this);
|
||||
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
||||
@@ -528,24 +528,24 @@ void FCDProGui::on_transverter_clicked()
|
||||
|
||||
void FCDProGui::updateStatus()
|
||||
{
|
||||
int state = m_deviceUISet->m_deviceSourceAPI->state();
|
||||
int state = m_deviceUISet->m_deviceAPI->state();
|
||||
|
||||
if(m_lastEngineState != state)
|
||||
{
|
||||
switch(state)
|
||||
{
|
||||
case DSPDeviceSourceEngine::StNotStarted:
|
||||
case DeviceAPI::StNotStarted:
|
||||
ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StIdle:
|
||||
case DeviceAPI::StIdle:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StRunning:
|
||||
case DeviceAPI::StRunning:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StError:
|
||||
case DeviceAPI::StError:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
||||
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceSourceAPI->errorMessage());
|
||||
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/dspengine.h"
|
||||
#include "dsp/filerecord.h"
|
||||
#include "device/devicesourceapi.h"
|
||||
#include "device/deviceapi.h"
|
||||
|
||||
#include "fcdproinput.h"
|
||||
#include "fcdprothread.h"
|
||||
@@ -39,7 +39,7 @@ MESSAGE_CLASS_DEFINITION(FCDProInput::MsgConfigureFCDPro, Message)
|
||||
MESSAGE_CLASS_DEFINITION(FCDProInput::MsgStartStop, Message)
|
||||
MESSAGE_CLASS_DEFINITION(FCDProInput::MsgFileRecord, Message)
|
||||
|
||||
FCDProInput::FCDProInput(DeviceSourceAPI *deviceAPI) :
|
||||
FCDProInput::FCDProInput(DeviceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_dev(0),
|
||||
m_settings(),
|
||||
@@ -50,7 +50,7 @@ FCDProInput::FCDProInput(DeviceSourceAPI *deviceAPI) :
|
||||
m_fcdFIFO.setSize(20*fcd_traits<Pro>::convBufSize);
|
||||
openDevice();
|
||||
m_fileSink = new FileRecord(QString("test_%1.sdriq").arg(m_deviceAPI->getDeviceUID()));
|
||||
m_deviceAPI->addSink(m_fileSink);
|
||||
m_deviceAPI->addAncillarySink(m_fileSink);
|
||||
m_networkManager = new QNetworkAccessManager();
|
||||
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
}
|
||||
@@ -64,7 +64,7 @@ FCDProInput::~FCDProInput()
|
||||
stop();
|
||||
}
|
||||
|
||||
m_deviceAPI->removeSink(m_fileSink);
|
||||
m_deviceAPI->removeAncillarySink(m_fileSink);
|
||||
delete m_fileSink;
|
||||
|
||||
closeDevice();
|
||||
@@ -81,7 +81,7 @@ bool FCDProInput::openDevice()
|
||||
closeDevice();
|
||||
}
|
||||
|
||||
int device = m_deviceAPI->getSampleSourceSequence();
|
||||
int device = m_deviceAPI->getSamplingDeviceSequence();
|
||||
qDebug() << "FCDProInput::openDevice with device #" << device;
|
||||
m_dev = fcdOpen(fcd_traits<Pro>::vendorId, fcd_traits<Pro>::productId, device);
|
||||
|
||||
@@ -275,14 +275,14 @@ bool FCDProInput::handleMessage(const Message& message)
|
||||
|
||||
if (cmd.getStartStop())
|
||||
{
|
||||
if (m_deviceAPI->initAcquisition())
|
||||
if (m_deviceAPI->initDeviceEngine())
|
||||
{
|
||||
m_deviceAPI->startAcquisition();
|
||||
m_deviceAPI->startDeviceEngine();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_deviceAPI->stopAcquisition();
|
||||
m_deviceAPI->stopDeviceEngine();
|
||||
}
|
||||
|
||||
if (m_settings.m_useReverseAPI) {
|
||||
|
||||
@@ -38,7 +38,7 @@ struct fcd_buffer {
|
||||
|
||||
class QNetworkAccessManager;
|
||||
class QNetworkReply;
|
||||
class DeviceSourceAPI;
|
||||
class DeviceAPI;
|
||||
class FCDProThread;
|
||||
class FileRecord;
|
||||
|
||||
@@ -106,7 +106,7 @@ public:
|
||||
{ }
|
||||
};
|
||||
|
||||
FCDProInput(DeviceSourceAPI *deviceAPI);
|
||||
FCDProInput(DeviceAPI *deviceAPI);
|
||||
virtual ~FCDProInput();
|
||||
virtual void destroy();
|
||||
|
||||
@@ -165,7 +165,7 @@ public:
|
||||
void set_gain6(int index);
|
||||
|
||||
private:
|
||||
DeviceSourceAPI *m_deviceAPI;
|
||||
DeviceAPI *m_deviceAPI;
|
||||
hid_device *m_dev;
|
||||
AudioInput m_fcdAudioInput;
|
||||
AudioFifo m_fcdFIFO;
|
||||
|
||||
@@ -109,7 +109,7 @@ PluginInstanceGUI* FCDProPlugin::createSampleSourcePluginInstanceGUI(
|
||||
}
|
||||
#endif
|
||||
|
||||
DeviceSampleSource *FCDProPlugin::createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI)
|
||||
DeviceSampleSource *FCDProPlugin::createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceAPI *deviceAPI)
|
||||
{
|
||||
if (sourceId == fcd_traits<Pro>::interfaceIID)
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
const QString& sourceId,
|
||||
QWidget **widget,
|
||||
DeviceUISet *deviceUISet);
|
||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
|
||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceAPI *deviceAPI);
|
||||
|
||||
private:
|
||||
static const PluginDescriptor m_pluginDescriptor;
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "fcdproplusgui.h"
|
||||
|
||||
#include <device/devicesourceapi.h>
|
||||
#include "device/deviceapi.h"
|
||||
#include "device/deviceuiset.h"
|
||||
#include "fcdproplusconst.h"
|
||||
#include "fcdtraits.h"
|
||||
@@ -39,9 +39,9 @@ FCDProPlusGui::FCDProPlusGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
m_forceSettings(true),
|
||||
m_settings(),
|
||||
m_sampleSource(NULL),
|
||||
m_lastEngineState(DSPDeviceSourceEngine::StNotStarted)
|
||||
m_lastEngineState(DeviceAPI::StNotStarted)
|
||||
{
|
||||
m_sampleSource = (FCDProPlusInput*) m_deviceUISet->m_deviceSourceAPI->getSampleSource();
|
||||
m_sampleSource = (FCDProPlusInput*) m_deviceUISet->m_deviceAPI->getSampleSource();
|
||||
|
||||
ui->setupUi(this);
|
||||
|
||||
@@ -286,24 +286,24 @@ void FCDProPlusGui::updateHardware()
|
||||
|
||||
void FCDProPlusGui::updateStatus()
|
||||
{
|
||||
int state = m_deviceUISet->m_deviceSourceAPI->state();
|
||||
int state = m_deviceUISet->m_deviceAPI->state();
|
||||
|
||||
if(m_lastEngineState != state)
|
||||
{
|
||||
switch(state)
|
||||
{
|
||||
case DSPDeviceSourceEngine::StNotStarted:
|
||||
case DeviceAPI::StNotStarted:
|
||||
ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StIdle:
|
||||
case DeviceAPI::StIdle:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StRunning:
|
||||
case DeviceAPI::StRunning:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StError:
|
||||
case DeviceAPI::StError:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
||||
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceSourceAPI->errorMessage());
|
||||
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/dspengine.h"
|
||||
#include "dsp/filerecord.h"
|
||||
#include "device/devicesourceapi.h"
|
||||
#include "device/deviceapi.h"
|
||||
|
||||
#include "fcdproplusinput.h"
|
||||
#include "fcdproplusthread.h"
|
||||
@@ -39,7 +39,7 @@ MESSAGE_CLASS_DEFINITION(FCDProPlusInput::MsgConfigureFCDProPlus, Message)
|
||||
MESSAGE_CLASS_DEFINITION(FCDProPlusInput::MsgStartStop, Message)
|
||||
MESSAGE_CLASS_DEFINITION(FCDProPlusInput::MsgFileRecord, Message)
|
||||
|
||||
FCDProPlusInput::FCDProPlusInput(DeviceSourceAPI *deviceAPI) :
|
||||
FCDProPlusInput::FCDProPlusInput(DeviceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_dev(0),
|
||||
m_settings(),
|
||||
@@ -50,7 +50,7 @@ FCDProPlusInput::FCDProPlusInput(DeviceSourceAPI *deviceAPI) :
|
||||
m_fcdFIFO.setSize(20*fcd_traits<ProPlus>::convBufSize);
|
||||
openDevice();
|
||||
m_fileSink = new FileRecord(QString("test_%1.sdriq").arg(m_deviceAPI->getDeviceUID()));
|
||||
m_deviceAPI->addSink(m_fileSink);
|
||||
m_deviceAPI->addAncillarySink(m_fileSink);
|
||||
m_networkManager = new QNetworkAccessManager();
|
||||
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
}
|
||||
@@ -64,7 +64,7 @@ FCDProPlusInput::~FCDProPlusInput()
|
||||
stop();
|
||||
}
|
||||
|
||||
m_deviceAPI->removeSink(m_fileSink);
|
||||
m_deviceAPI->removeAncillarySink(m_fileSink);
|
||||
delete m_fileSink;
|
||||
|
||||
closeDevice();
|
||||
@@ -81,7 +81,7 @@ bool FCDProPlusInput::openDevice()
|
||||
closeDevice();
|
||||
}
|
||||
|
||||
int device = m_deviceAPI->getSampleSourceSequence();
|
||||
int device = m_deviceAPI->getSamplingDeviceSequence();
|
||||
qDebug() << "FCDProPlusInput::openDevice with device #" << device;
|
||||
m_dev = fcdOpen(fcd_traits<ProPlus>::vendorId, fcd_traits<ProPlus>::productId, device);
|
||||
|
||||
@@ -277,14 +277,14 @@ bool FCDProPlusInput::handleMessage(const Message& message)
|
||||
|
||||
if (cmd.getStartStop())
|
||||
{
|
||||
if (m_deviceAPI->initAcquisition())
|
||||
if (m_deviceAPI->initDeviceEngine())
|
||||
{
|
||||
m_deviceAPI->startAcquisition();
|
||||
m_deviceAPI->startDeviceEngine();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_deviceAPI->stopAcquisition();
|
||||
m_deviceAPI->stopDeviceEngine();
|
||||
}
|
||||
|
||||
if (m_settings.m_useReverseAPI) {
|
||||
|
||||
@@ -38,7 +38,7 @@ struct fcd_buffer {
|
||||
|
||||
class QNetworkAccessManager;
|
||||
class QNetworkReply;
|
||||
class DeviceSourceAPI;
|
||||
class DeviceAPI;
|
||||
class FCDProPlusThread;
|
||||
class FileRecord;
|
||||
|
||||
@@ -106,7 +106,7 @@ public:
|
||||
{ }
|
||||
};
|
||||
|
||||
FCDProPlusInput(DeviceSourceAPI *deviceAPI);
|
||||
FCDProPlusInput(DeviceAPI *deviceAPI);
|
||||
virtual ~FCDProPlusInput();
|
||||
virtual void destroy();
|
||||
|
||||
@@ -154,7 +154,7 @@ public:
|
||||
void set_if_filter(int filterIndex);
|
||||
|
||||
private:
|
||||
DeviceSourceAPI *m_deviceAPI;
|
||||
DeviceAPI *m_deviceAPI;
|
||||
hid_device *m_dev;
|
||||
AudioInput m_fcdAudioInput;
|
||||
AudioFifo m_fcdFIFO;
|
||||
|
||||
@@ -111,7 +111,7 @@ PluginInstanceGUI* FCDProPlusPlugin::createSampleSourcePluginInstanceGUI(
|
||||
}
|
||||
#endif
|
||||
|
||||
DeviceSampleSource *FCDProPlusPlugin::createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI)
|
||||
DeviceSampleSource *FCDProPlusPlugin::createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceAPI *deviceAPI)
|
||||
{
|
||||
if(sourceId == fcd_traits<ProPlus>::interfaceIID)
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
const QString& sourceId,
|
||||
QWidget **widget,
|
||||
DeviceUISet *deviceUISet);
|
||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
|
||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceAPI *deviceAPI);
|
||||
|
||||
static const QString m_deviceTypeID;
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#include "mainwindow.h"
|
||||
|
||||
#include "filesourcegui.h"
|
||||
#include <device/devicesourceapi.h>
|
||||
#include "device/deviceapi.h"
|
||||
#include "device/deviceuiset.h"
|
||||
|
||||
FileSourceGui::FileSourceGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
@@ -54,7 +54,7 @@ FileSourceGui::FileSourceGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
m_samplesCount(0),
|
||||
m_tickCount(0),
|
||||
m_enableNavTime(false),
|
||||
m_lastEngineState(DSPDeviceSourceEngine::StNotStarted)
|
||||
m_lastEngineState(DeviceAPI::StNotStarted)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
||||
@@ -62,7 +62,7 @@ FileSourceGui::FileSourceGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
ui->fileNameText->setText(m_fileName);
|
||||
ui->crcLabel->setStyleSheet("QLabel { background:rgb(79,79,79); }");
|
||||
|
||||
connect(&(m_deviceUISet->m_deviceSourceAPI->getMasterTimer()), SIGNAL(timeout()), this, SLOT(tick()));
|
||||
connect(&(m_deviceUISet->m_deviceAPI->getMasterTimer()), SIGNAL(timeout()), this, SLOT(tick()));
|
||||
connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus()));
|
||||
m_statusTimer.start(500);
|
||||
|
||||
@@ -75,7 +75,7 @@ FileSourceGui::FileSourceGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
ui->navTimeSlider->setEnabled(false);
|
||||
ui->acceleration->setEnabled(false);
|
||||
|
||||
m_sampleSource = m_deviceUISet->m_deviceSourceAPI->getSampleSource();
|
||||
m_sampleSource = m_deviceUISet->m_deviceAPI->getSampleSource();
|
||||
|
||||
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection);
|
||||
m_sampleSource->setMessageQueueToGUI(&m_inputMessageQueue);
|
||||
@@ -271,24 +271,24 @@ void FileSourceGui::on_startStop_toggled(bool checked)
|
||||
|
||||
void FileSourceGui::updateStatus()
|
||||
{
|
||||
int state = m_deviceUISet->m_deviceSourceAPI->state();
|
||||
int state = m_deviceUISet->m_deviceAPI->state();
|
||||
|
||||
if(m_lastEngineState != state)
|
||||
{
|
||||
switch(state)
|
||||
{
|
||||
case DSPDeviceSourceEngine::StNotStarted:
|
||||
case DeviceAPI::StNotStarted:
|
||||
ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StIdle:
|
||||
case DeviceAPI::StIdle:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StRunning:
|
||||
case DeviceAPI::StRunning:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StError:
|
||||
case DeviceAPI::StError:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
||||
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceSourceAPI->errorMessage());
|
||||
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -30,9 +30,10 @@
|
||||
|
||||
#include "util/simpleserializer.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/dspdevicesourceengine.h"
|
||||
#include "dsp/dspengine.h"
|
||||
#include "dsp/filerecord.h"
|
||||
#include "device/devicesourceapi.h"
|
||||
#include "device/deviceapi.h"
|
||||
|
||||
#include "filesourceinput.h"
|
||||
#include "filesourcethread.h"
|
||||
@@ -49,7 +50,7 @@ MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgReportFileSourceStreamData, Message
|
||||
MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgReportFileSourceStreamTiming, Message)
|
||||
MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgReportHeaderCRC, Message)
|
||||
|
||||
FileSourceInput::FileSourceInput(DeviceSourceAPI *deviceAPI) :
|
||||
FileSourceInput::FileSourceInput(DeviceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_settings(),
|
||||
m_fileSourceThread(NULL),
|
||||
@@ -347,14 +348,14 @@ bool FileSourceInput::handleMessage(const Message& message)
|
||||
|
||||
if (cmd.getStartStop())
|
||||
{
|
||||
if (m_deviceAPI->initAcquisition())
|
||||
if (m_deviceAPI->initDeviceEngine())
|
||||
{
|
||||
m_deviceAPI->startAcquisition();
|
||||
m_deviceAPI->startDeviceEngine();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_deviceAPI->stopAcquisition();
|
||||
m_deviceAPI->stopDeviceEngine();
|
||||
}
|
||||
|
||||
if (m_settings.m_useReverseAPI) {
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
class QNetworkAccessManager;
|
||||
class QNetworkReply;
|
||||
class FileSourceThread;
|
||||
class DeviceSourceAPI;
|
||||
class DeviceAPI;
|
||||
|
||||
class FileSourceInput : public DeviceSampleSource {
|
||||
Q_OBJECT
|
||||
@@ -275,7 +275,7 @@ public:
|
||||
{ }
|
||||
};
|
||||
|
||||
FileSourceInput(DeviceSourceAPI *deviceAPI);
|
||||
FileSourceInput(DeviceAPI *deviceAPI);
|
||||
virtual ~FileSourceInput();
|
||||
virtual void destroy();
|
||||
|
||||
@@ -320,7 +320,7 @@ public:
|
||||
QString& errorMessage);
|
||||
|
||||
private:
|
||||
DeviceSourceAPI *m_deviceAPI;
|
||||
DeviceAPI *m_deviceAPI;
|
||||
QMutex m_mutex;
|
||||
FileSourceSettings m_settings;
|
||||
std::ifstream m_ifstream;
|
||||
|
||||
@@ -100,7 +100,7 @@ PluginInstanceGUI* FileSourcePlugin::createSampleSourcePluginInstanceGUI(
|
||||
}
|
||||
#endif
|
||||
|
||||
DeviceSampleSource *FileSourcePlugin::createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI)
|
||||
DeviceSampleSource *FileSourcePlugin::createSampleSourcePluginInstanceInput(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, DeviceSourceAPI *deviceAPI);
|
||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceAPI *deviceAPI);
|
||||
|
||||
static const QString m_hardwareID;
|
||||
static const QString m_deviceTypeID;
|
||||
|
||||
@@ -29,8 +29,7 @@
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/dspengine.h"
|
||||
#include "dsp/filerecord.h"
|
||||
#include "device/devicesourceapi.h"
|
||||
#include "device/devicesinkapi.h"
|
||||
#include "device/deviceapi.h"
|
||||
#include "hackrf/devicehackrfvalues.h"
|
||||
#include "hackrf/devicehackrfshared.h"
|
||||
|
||||
@@ -42,7 +41,7 @@ MESSAGE_CLASS_DEFINITION(HackRFInput::MsgReportHackRF, Message)
|
||||
MESSAGE_CLASS_DEFINITION(HackRFInput::MsgFileRecord, Message)
|
||||
MESSAGE_CLASS_DEFINITION(HackRFInput::MsgStartStop, Message)
|
||||
|
||||
HackRFInput::HackRFInput(DeviceSourceAPI *deviceAPI) :
|
||||
HackRFInput::HackRFInput(DeviceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_settings(),
|
||||
m_dev(0),
|
||||
@@ -53,7 +52,7 @@ HackRFInput::HackRFInput(DeviceSourceAPI *deviceAPI) :
|
||||
openDevice();
|
||||
|
||||
m_fileSink = new FileRecord(QString("test_%1.sdriq").arg(m_deviceAPI->getDeviceUID()));
|
||||
m_deviceAPI->addSink(m_fileSink);
|
||||
m_deviceAPI->addAncillarySink(m_fileSink);
|
||||
|
||||
m_deviceAPI->setBuddySharedPtr(&m_sharedParams);
|
||||
|
||||
@@ -70,7 +69,7 @@ HackRFInput::~HackRFInput()
|
||||
stop();
|
||||
}
|
||||
|
||||
m_deviceAPI->removeSink(m_fileSink);
|
||||
m_deviceAPI->removeAncillarySink(m_fileSink);
|
||||
delete m_fileSink;
|
||||
closeDevice();
|
||||
m_deviceAPI->setBuddySharedPtr(0);
|
||||
@@ -96,7 +95,7 @@ bool HackRFInput::openDevice()
|
||||
|
||||
if (m_deviceAPI->getSinkBuddies().size() > 0)
|
||||
{
|
||||
DeviceSinkAPI *buddy = m_deviceAPI->getSinkBuddies()[0];
|
||||
DeviceAPI *buddy = m_deviceAPI->getSinkBuddies()[0];
|
||||
DeviceHackRFParams *buddySharedParams = (DeviceHackRFParams *) buddy->getBuddySharedPtr();
|
||||
|
||||
if (buddySharedParams == 0)
|
||||
@@ -116,9 +115,9 @@ bool HackRFInput::openDevice()
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((m_dev = DeviceHackRF::open_hackrf(qPrintable(m_deviceAPI->getSampleSourceSerial()))) == 0)
|
||||
if ((m_dev = DeviceHackRF::open_hackrf(qPrintable(m_deviceAPI->getSamplingDeviceSerial()))) == 0)
|
||||
{
|
||||
qCritical("HackRFInput::openDevice: could not open HackRF %s", qPrintable(m_deviceAPI->getSampleSourceSerial()));
|
||||
qCritical("HackRFInput::openDevice: could not open HackRF %s", qPrintable(m_deviceAPI->getSamplingDeviceSerial()));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -296,14 +295,14 @@ bool HackRFInput::handleMessage(const Message& message)
|
||||
|
||||
if (cmd.getStartStop())
|
||||
{
|
||||
if (m_deviceAPI->initAcquisition())
|
||||
if (m_deviceAPI->initDeviceEngine())
|
||||
{
|
||||
m_deviceAPI->startAcquisition();
|
||||
m_deviceAPI->startDeviceEngine();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_deviceAPI->stopAcquisition();
|
||||
m_deviceAPI->stopDeviceEngine();
|
||||
}
|
||||
|
||||
if (m_settings.m_useReverseAPI) {
|
||||
@@ -450,9 +449,9 @@ bool HackRFInput::applySettings(const HackRFInputSettings& settings, bool force)
|
||||
|
||||
if (m_deviceAPI->getSinkBuddies().size() > 0) // forward to buddy if necessary
|
||||
{
|
||||
DeviceSinkAPI *buddy = m_deviceAPI->getSinkBuddies()[0];
|
||||
DeviceAPI *buddy = m_deviceAPI->getSinkBuddies()[0];
|
||||
DeviceHackRFShared::MsgSynchronizeFrequency *freqMsg = DeviceHackRFShared::MsgSynchronizeFrequency::create(deviceCenterFrequency);
|
||||
buddy->getSampleSinkInputMessageQueue()->push(freqMsg);
|
||||
buddy->getSamplingDeviceInputMessageQueue()->push(freqMsg);
|
||||
}
|
||||
|
||||
forwardChange = true;
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
class QNetworkAccessManager;
|
||||
class QNetworkReply;
|
||||
class DeviceSourceAPI;
|
||||
class DeviceAPI;
|
||||
class HackRFInputThread;
|
||||
class FileRecord;
|
||||
|
||||
@@ -116,7 +116,7 @@ public:
|
||||
{ }
|
||||
};
|
||||
|
||||
HackRFInput(DeviceSourceAPI *deviceAPI);
|
||||
HackRFInput(DeviceAPI *deviceAPI);
|
||||
virtual ~HackRFInput();
|
||||
virtual void destroy();
|
||||
|
||||
@@ -157,7 +157,7 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
DeviceSourceAPI *m_deviceAPI;
|
||||
DeviceAPI *m_deviceAPI;
|
||||
QMutex m_mutex;
|
||||
HackRFInputSettings m_settings;
|
||||
struct hackrf_device* m_dev;
|
||||
|
||||
@@ -28,8 +28,7 @@
|
||||
#include "gui/basicdevicesettingsdialog.h"
|
||||
#include "dsp/dspengine.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "device/devicesourceapi.h"
|
||||
#include "device/devicesinkapi.h"
|
||||
#include "device/deviceapi.h"
|
||||
#include "device/deviceuiset.h"
|
||||
#include "hackrf/devicehackrfvalues.h"
|
||||
|
||||
@@ -44,9 +43,9 @@ HackRFInputGui::HackRFInputGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
m_forceSettings(true),
|
||||
m_doApplySettings(true),
|
||||
m_sampleSource(NULL),
|
||||
m_lastEngineState(DSPDeviceSourceEngine::StNotStarted)
|
||||
m_lastEngineState(DeviceAPI::StNotStarted)
|
||||
{
|
||||
m_sampleSource = (HackRFInput*) m_deviceUISet->m_deviceSourceAPI->getSampleSource();
|
||||
m_sampleSource = (HackRFInput*) m_deviceUISet->m_deviceAPI->getSampleSource();
|
||||
|
||||
ui->setupUi(this);
|
||||
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
||||
@@ -447,25 +446,25 @@ void HackRFInputGui::blockApplySettings(bool block)
|
||||
|
||||
void HackRFInputGui::updateStatus()
|
||||
{
|
||||
int state = m_deviceUISet->m_deviceSourceAPI->state();
|
||||
int state = m_deviceUISet->m_deviceAPI->state();
|
||||
|
||||
if(m_lastEngineState != state)
|
||||
{
|
||||
switch(state)
|
||||
{
|
||||
case DSPDeviceSourceEngine::StNotStarted:
|
||||
case DeviceAPI::StNotStarted:
|
||||
ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StIdle:
|
||||
case DeviceAPI::StIdle:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
|
||||
ui->startStop->setChecked(false);
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StRunning:
|
||||
case DeviceAPI::StRunning:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StError:
|
||||
case DeviceAPI::StError:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
||||
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceSourceAPI->errorMessage());
|
||||
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -152,7 +152,7 @@ PluginInstanceGUI* HackRFInputPlugin::createSampleSourcePluginInstanceGUI(
|
||||
}
|
||||
#endif
|
||||
|
||||
DeviceSampleSource *HackRFInputPlugin::createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI)
|
||||
DeviceSampleSource *HackRFInputPlugin::createSampleSourcePluginInstanceInput(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, DeviceSourceAPI *deviceAPI);
|
||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceAPI *deviceAPI);
|
||||
|
||||
static const QString m_hardwareID;
|
||||
static const QString m_deviceTypeID;
|
||||
|
||||
@@ -31,8 +31,7 @@
|
||||
#include "SWGDeviceReport.h"
|
||||
#include "SWGLimeSdrInputReport.h"
|
||||
|
||||
#include "device/devicesourceapi.h"
|
||||
#include "device/devicesinkapi.h"
|
||||
#include "device/deviceapi.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/filerecord.h"
|
||||
#include "dsp/dspengine.h"
|
||||
@@ -49,7 +48,7 @@ MESSAGE_CLASS_DEFINITION(LimeSDRInput::MsgReportStreamInfo, Message)
|
||||
MESSAGE_CLASS_DEFINITION(LimeSDRInput::MsgFileRecord, Message)
|
||||
MESSAGE_CLASS_DEFINITION(LimeSDRInput::MsgStartStop, Message)
|
||||
|
||||
LimeSDRInput::LimeSDRInput(DeviceSourceAPI *deviceAPI) :
|
||||
LimeSDRInput::LimeSDRInput(DeviceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_settings(),
|
||||
m_limeSDRInputThread(0),
|
||||
@@ -65,7 +64,7 @@ LimeSDRInput::LimeSDRInput(DeviceSourceAPI *deviceAPI) :
|
||||
resumeRxBuddies();
|
||||
|
||||
m_fileSink = new FileRecord(QString("test_%1.sdriq").arg(m_deviceAPI->getDeviceUID()));
|
||||
m_deviceAPI->addSink(m_fileSink);
|
||||
m_deviceAPI->addAncillarySink(m_fileSink);
|
||||
|
||||
m_networkManager = new QNetworkAccessManager();
|
||||
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
@@ -80,7 +79,7 @@ LimeSDRInput::~LimeSDRInput()
|
||||
stop();
|
||||
}
|
||||
|
||||
m_deviceAPI->removeSink(m_fileSink);
|
||||
m_deviceAPI->removeAncillarySink(m_fileSink);
|
||||
delete m_fileSink;
|
||||
suspendRxBuddies();
|
||||
suspendTxBuddies();
|
||||
@@ -114,7 +113,7 @@ bool LimeSDRInput::openDevice()
|
||||
{
|
||||
qDebug("LimeSDRInput::openDevice: look in Rx buddies");
|
||||
|
||||
DeviceSourceAPI *sourceBuddy = m_deviceAPI->getSourceBuddies()[0];
|
||||
DeviceAPI *sourceBuddy = m_deviceAPI->getSourceBuddies()[0];
|
||||
//m_deviceShared = *((DeviceLimeSDRShared *) sourceBuddy->getBuddySharedPtr()); // copy shared data
|
||||
DeviceLimeSDRShared *deviceLimeSDRShared = (DeviceLimeSDRShared*) sourceBuddy->getBuddySharedPtr();
|
||||
|
||||
@@ -152,7 +151,7 @@ bool LimeSDRInput::openDevice()
|
||||
|
||||
for (unsigned int i = 0; i < m_deviceAPI->getSourceBuddies().size(); i++)
|
||||
{
|
||||
DeviceSourceAPI *buddy = m_deviceAPI->getSourceBuddies()[i];
|
||||
DeviceAPI *buddy = m_deviceAPI->getSourceBuddies()[i];
|
||||
DeviceLimeSDRShared *buddyShared = (DeviceLimeSDRShared *) buddy->getBuddySharedPtr();
|
||||
|
||||
if (buddyShared->m_channel == requestedChannel)
|
||||
@@ -170,7 +169,7 @@ bool LimeSDRInput::openDevice()
|
||||
{
|
||||
qDebug("LimeSDRInput::openDevice: look in Tx buddies");
|
||||
|
||||
DeviceSinkAPI *sinkBuddy = m_deviceAPI->getSinkBuddies()[0];
|
||||
DeviceAPI *sinkBuddy = m_deviceAPI->getSinkBuddies()[0];
|
||||
//m_deviceShared = *((DeviceLimeSDRShared *) sinkBuddy->getBuddySharedPtr()); // copy parameters
|
||||
DeviceLimeSDRShared *deviceLimeSDRShared = (DeviceLimeSDRShared*) sinkBuddy->getBuddySharedPtr();
|
||||
|
||||
@@ -203,7 +202,7 @@ bool LimeSDRInput::openDevice()
|
||||
|
||||
m_deviceShared.m_deviceParams = new DeviceLimeSDRParams();
|
||||
char serial[256];
|
||||
strcpy(serial, qPrintable(m_deviceAPI->getSampleSourceSerial()));
|
||||
strcpy(serial, qPrintable(m_deviceAPI->getSamplingDeviceSerial()));
|
||||
m_deviceShared.m_deviceParams->open(serial);
|
||||
m_deviceShared.m_channel = requestedChannel; // acknowledge the requested channel
|
||||
}
|
||||
@@ -215,8 +214,8 @@ bool LimeSDRInput::openDevice()
|
||||
|
||||
void LimeSDRInput::suspendRxBuddies()
|
||||
{
|
||||
const std::vector<DeviceSourceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceSourceAPI*>::const_iterator itSource = sourceBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator itSource = sourceBuddies.begin();
|
||||
|
||||
qDebug("LimeSDRInput::suspendRxBuddies (%lu)", sourceBuddies.size());
|
||||
|
||||
@@ -238,8 +237,8 @@ void LimeSDRInput::suspendRxBuddies()
|
||||
|
||||
void LimeSDRInput::suspendTxBuddies()
|
||||
{
|
||||
const std::vector<DeviceSinkAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
|
||||
std::vector<DeviceSinkAPI*>::const_iterator itSink = sinkBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator itSink = sinkBuddies.begin();
|
||||
|
||||
qDebug("LimeSDRInput::suspendTxBuddies (%lu)", sinkBuddies.size());
|
||||
|
||||
@@ -261,8 +260,8 @@ void LimeSDRInput::suspendTxBuddies()
|
||||
|
||||
void LimeSDRInput::resumeRxBuddies()
|
||||
{
|
||||
const std::vector<DeviceSourceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceSourceAPI*>::const_iterator itSource = sourceBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator itSource = sourceBuddies.begin();
|
||||
|
||||
qDebug("LimeSDRInput::resumeRxBuddies (%lu)", sourceBuddies.size());
|
||||
|
||||
@@ -278,8 +277,8 @@ void LimeSDRInput::resumeRxBuddies()
|
||||
|
||||
void LimeSDRInput::resumeTxBuddies()
|
||||
{
|
||||
const std::vector<DeviceSinkAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
|
||||
std::vector<DeviceSinkAPI*>::const_iterator itSink = sinkBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator itSink = sinkBuddies.begin();
|
||||
|
||||
qDebug("LimeSDRInput::resumeTxBuddies (%lu)", sinkBuddies.size());
|
||||
|
||||
@@ -656,7 +655,7 @@ bool LimeSDRInput::handleMessage(const Message& message)
|
||||
|
||||
if (m_streamId.handle && (LMS_GetStreamStatus(&m_streamId, &status) == 0))
|
||||
{
|
||||
if (m_deviceAPI->getSampleSourceGUIMessageQueue())
|
||||
if (m_deviceAPI->getSamplingDeviceGUIMessageQueue())
|
||||
{
|
||||
MsgReportStreamInfo *report = MsgReportStreamInfo::create(
|
||||
true, // Success
|
||||
@@ -668,12 +667,12 @@ bool LimeSDRInput::handleMessage(const Message& message)
|
||||
status.droppedPackets,
|
||||
status.linkRate,
|
||||
status.timestamp);
|
||||
m_deviceAPI->getSampleSourceGUIMessageQueue()->push(report);
|
||||
m_deviceAPI->getSamplingDeviceGUIMessageQueue()->push(report);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_deviceAPI->getSampleSourceGUIMessageQueue())
|
||||
if (m_deviceAPI->getSamplingDeviceGUIMessageQueue())
|
||||
{
|
||||
MsgReportStreamInfo *report = MsgReportStreamInfo::create(
|
||||
false, // Success
|
||||
@@ -685,7 +684,7 @@ bool LimeSDRInput::handleMessage(const Message& message)
|
||||
0, // status.droppedPackets,
|
||||
0, // status.linkRate,
|
||||
0); // status.timestamp);
|
||||
m_deviceAPI->getSampleSourceGUIMessageQueue()->push(report);
|
||||
m_deviceAPI->getSamplingDeviceGUIMessageQueue()->push(report);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -709,35 +708,35 @@ bool LimeSDRInput::handleMessage(const Message& message)
|
||||
}
|
||||
|
||||
// send to oneself
|
||||
if (m_deviceAPI->getSampleSourceGUIMessageQueue())
|
||||
if (m_deviceAPI->getSamplingDeviceGUIMessageQueue())
|
||||
{
|
||||
DeviceLimeSDRShared::MsgReportDeviceInfo *report = DeviceLimeSDRShared::MsgReportDeviceInfo::create(temp, gpioPins);
|
||||
m_deviceAPI->getSampleSourceGUIMessageQueue()->push(report);
|
||||
m_deviceAPI->getSamplingDeviceGUIMessageQueue()->push(report);
|
||||
}
|
||||
|
||||
// send to source buddies
|
||||
const std::vector<DeviceSourceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceSourceAPI*>::const_iterator itSource = sourceBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator itSource = sourceBuddies.begin();
|
||||
|
||||
for (; itSource != sourceBuddies.end(); ++itSource)
|
||||
{
|
||||
if ((*itSource)->getSampleSourceGUIMessageQueue())
|
||||
if ((*itSource)->getSamplingDeviceGUIMessageQueue())
|
||||
{
|
||||
DeviceLimeSDRShared::MsgReportDeviceInfo *report = DeviceLimeSDRShared::MsgReportDeviceInfo::create(temp, gpioPins);
|
||||
(*itSource)->getSampleSourceGUIMessageQueue()->push(report);
|
||||
(*itSource)->getSamplingDeviceGUIMessageQueue()->push(report);
|
||||
}
|
||||
}
|
||||
|
||||
// send to sink buddies
|
||||
const std::vector<DeviceSinkAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
|
||||
std::vector<DeviceSinkAPI*>::const_iterator itSink = sinkBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator itSink = sinkBuddies.begin();
|
||||
|
||||
for (; itSink != sinkBuddies.end(); ++itSink)
|
||||
{
|
||||
if ((*itSink)->getSampleSinkGUIMessageQueue())
|
||||
if ((*itSink)->getSamplingDeviceGUIMessageQueue())
|
||||
{
|
||||
DeviceLimeSDRShared::MsgReportDeviceInfo *report = DeviceLimeSDRShared::MsgReportDeviceInfo::create(temp, gpioPins);
|
||||
(*itSink)->getSampleSinkGUIMessageQueue()->push(report);
|
||||
(*itSink)->getSamplingDeviceGUIMessageQueue()->push(report);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -772,14 +771,14 @@ bool LimeSDRInput::handleMessage(const Message& message)
|
||||
|
||||
if (cmd.getStartStop())
|
||||
{
|
||||
if (m_deviceAPI->initAcquisition())
|
||||
if (m_deviceAPI->initDeviceEngine())
|
||||
{
|
||||
m_deviceAPI->startAcquisition();
|
||||
m_deviceAPI->startDeviceEngine();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_deviceAPI->stopAcquisition();
|
||||
m_deviceAPI->stopDeviceEngine();
|
||||
}
|
||||
|
||||
if (m_settings.m_useReverseAPI) {
|
||||
@@ -1289,25 +1288,25 @@ bool LimeSDRInput::applySettings(const LimeSDRInputSettings& settings, bool forc
|
||||
m_deviceAPI->getDeviceEngineInputMessageQueue()->push(notif);
|
||||
|
||||
// send to source buddies
|
||||
const std::vector<DeviceSourceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceSourceAPI*>::const_iterator itSource = sourceBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator itSource = sourceBuddies.begin();
|
||||
|
||||
for (; itSource != sourceBuddies.end(); ++itSource)
|
||||
{
|
||||
DeviceLimeSDRShared::MsgReportBuddyChange *report = DeviceLimeSDRShared::MsgReportBuddyChange::create(
|
||||
m_settings.m_devSampleRate, m_settings.m_log2HardDecim, m_settings.m_centerFrequency, true);
|
||||
(*itSource)->getSampleSourceInputMessageQueue()->push(report);
|
||||
(*itSource)->getSamplingDeviceInputMessageQueue()->push(report);
|
||||
}
|
||||
|
||||
// send to sink buddies
|
||||
const std::vector<DeviceSinkAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
|
||||
std::vector<DeviceSinkAPI*>::const_iterator itSink = sinkBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator itSink = sinkBuddies.begin();
|
||||
|
||||
for (; itSink != sinkBuddies.end(); ++itSink)
|
||||
{
|
||||
DeviceLimeSDRShared::MsgReportBuddyChange *report = DeviceLimeSDRShared::MsgReportBuddyChange::create(
|
||||
m_settings.m_devSampleRate, m_settings.m_log2HardDecim, m_settings.m_centerFrequency, true);
|
||||
(*itSink)->getSampleSinkInputMessageQueue()->push(report);
|
||||
(*itSink)->getSamplingDeviceInputMessageQueue()->push(report);
|
||||
}
|
||||
}
|
||||
else if (forwardChangeRxDSP)
|
||||
@@ -1322,14 +1321,14 @@ bool LimeSDRInput::applySettings(const LimeSDRInputSettings& settings, bool forc
|
||||
m_deviceAPI->getDeviceEngineInputMessageQueue()->push(notif);
|
||||
|
||||
// send to source buddies
|
||||
const std::vector<DeviceSourceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceSourceAPI*>::const_iterator itSource = sourceBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator itSource = sourceBuddies.begin();
|
||||
|
||||
for (; itSource != sourceBuddies.end(); ++itSource)
|
||||
{
|
||||
DeviceLimeSDRShared::MsgReportBuddyChange *report = DeviceLimeSDRShared::MsgReportBuddyChange::create(
|
||||
m_settings.m_devSampleRate, m_settings.m_log2HardDecim, m_settings.m_centerFrequency, true);
|
||||
(*itSource)->getSampleSourceInputMessageQueue()->push(report);
|
||||
(*itSource)->getSamplingDeviceInputMessageQueue()->push(report);
|
||||
}
|
||||
}
|
||||
else if (forwardChangeOwnDSP)
|
||||
@@ -1346,50 +1345,50 @@ bool LimeSDRInput::applySettings(const LimeSDRInputSettings& settings, bool forc
|
||||
if (forwardClockSource)
|
||||
{
|
||||
// send to source buddies
|
||||
const std::vector<DeviceSourceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceSourceAPI*>::const_iterator itSource = sourceBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator itSource = sourceBuddies.begin();
|
||||
|
||||
for (; itSource != sourceBuddies.end(); ++itSource)
|
||||
{
|
||||
DeviceLimeSDRShared::MsgReportClockSourceChange *report = DeviceLimeSDRShared::MsgReportClockSourceChange::create(
|
||||
m_settings.m_extClock, m_settings.m_extClockFreq);
|
||||
(*itSource)->getSampleSourceInputMessageQueue()->push(report);
|
||||
(*itSource)->getSamplingDeviceInputMessageQueue()->push(report);
|
||||
}
|
||||
|
||||
// send to sink buddies
|
||||
const std::vector<DeviceSinkAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
|
||||
std::vector<DeviceSinkAPI*>::const_iterator itSink = sinkBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator itSink = sinkBuddies.begin();
|
||||
|
||||
for (; itSink != sinkBuddies.end(); ++itSink)
|
||||
{
|
||||
DeviceLimeSDRShared::MsgReportClockSourceChange *report = DeviceLimeSDRShared::MsgReportClockSourceChange::create(
|
||||
m_settings.m_extClock, m_settings.m_extClockFreq);
|
||||
(*itSink)->getSampleSinkInputMessageQueue()->push(report);
|
||||
(*itSink)->getSamplingDeviceInputMessageQueue()->push(report);
|
||||
}
|
||||
}
|
||||
|
||||
if (forwardGPIOChange)
|
||||
{
|
||||
// send to source buddies
|
||||
const std::vector<DeviceSourceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceSourceAPI*>::const_iterator itSource = sourceBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator itSource = sourceBuddies.begin();
|
||||
|
||||
for (; itSource != sourceBuddies.end(); ++itSource)
|
||||
{
|
||||
DeviceLimeSDRShared::MsgReportClockSourceChange *report = DeviceLimeSDRShared::MsgReportClockSourceChange::create(
|
||||
m_settings.m_extClock, m_settings.m_extClockFreq);
|
||||
(*itSource)->getSampleSourceInputMessageQueue()->push(report);
|
||||
(*itSource)->getSamplingDeviceInputMessageQueue()->push(report);
|
||||
}
|
||||
|
||||
// send to sink buddies
|
||||
const std::vector<DeviceSinkAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
|
||||
std::vector<DeviceSinkAPI*>::const_iterator itSink = sinkBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator itSink = sinkBuddies.begin();
|
||||
|
||||
for (; itSink != sinkBuddies.end(); ++itSink)
|
||||
{
|
||||
DeviceLimeSDRShared::MsgReportClockSourceChange *report = DeviceLimeSDRShared::MsgReportClockSourceChange::create(
|
||||
m_settings.m_extClock, m_settings.m_extClockFreq);
|
||||
(*itSink)->getSampleSinkInputMessageQueue()->push(report);
|
||||
(*itSink)->getSamplingDeviceInputMessageQueue()->push(report);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include "limesdr/devicelimesdrshared.h"
|
||||
#include "limesdrinputsettings.h"
|
||||
|
||||
class DeviceSourceAPI;
|
||||
class DeviceAPI;
|
||||
class LimeSDRInputThread;
|
||||
class FileRecord;
|
||||
class QNetworkAccessManager;
|
||||
@@ -204,7 +204,7 @@ public:
|
||||
{ }
|
||||
};
|
||||
|
||||
LimeSDRInput(DeviceSourceAPI *deviceAPI);
|
||||
LimeSDRInput(DeviceAPI *deviceAPI);
|
||||
virtual ~LimeSDRInput();
|
||||
virtual void destroy();
|
||||
|
||||
@@ -255,7 +255,7 @@ public:
|
||||
DeviceLimeSDRParams::LimeType getLimeType() const;
|
||||
|
||||
private:
|
||||
DeviceSourceAPI *m_deviceAPI;
|
||||
DeviceAPI *m_deviceAPI;
|
||||
QMutex m_mutex;
|
||||
LimeSDRInputSettings m_settings;
|
||||
LimeSDRInputThread* m_limeSDRInputThread;
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include "gui/basicdevicesettingsdialog.h"
|
||||
#include "dsp/dspengine.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "device/devicesourceapi.h"
|
||||
#include "device/deviceapi.h"
|
||||
#include "device/deviceuiset.h"
|
||||
|
||||
LimeSDRInputGUI::LimeSDRInputGUI(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
@@ -39,13 +39,13 @@ LimeSDRInputGUI::LimeSDRInputGUI(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
m_settings(),
|
||||
m_sampleRateMode(true),
|
||||
m_sampleRate(0),
|
||||
m_lastEngineState(DSPDeviceSourceEngine::StNotStarted),
|
||||
m_lastEngineState(DeviceAPI::StNotStarted),
|
||||
m_doApplySettings(true),
|
||||
m_forceSettings(true),
|
||||
m_statusCounter(0),
|
||||
m_deviceStatusCounter(0)
|
||||
{
|
||||
m_limeSDRInput = (LimeSDRInput*) m_deviceUISet->m_deviceSourceAPI->getSampleSource();
|
||||
m_limeSDRInput = (LimeSDRInput*) m_deviceUISet->m_deviceAPI->getSampleSource();
|
||||
|
||||
ui->setupUi(this);
|
||||
|
||||
@@ -478,24 +478,24 @@ void LimeSDRInputGUI::updateHardware()
|
||||
|
||||
void LimeSDRInputGUI::updateStatus()
|
||||
{
|
||||
int state = m_deviceUISet->m_deviceSourceAPI->state();
|
||||
int state = m_deviceUISet->m_deviceAPI->state();
|
||||
|
||||
if(m_lastEngineState != state)
|
||||
{
|
||||
switch(state)
|
||||
{
|
||||
case DSPDeviceSourceEngine::StNotStarted:
|
||||
case DeviceAPI::StNotStarted:
|
||||
ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StIdle:
|
||||
case DeviceAPI::StIdle:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StRunning:
|
||||
case DeviceAPI::StRunning:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StError:
|
||||
case DeviceAPI::StError:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
||||
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceSourceAPI->errorMessage());
|
||||
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -521,7 +521,7 @@ void LimeSDRInputGUI::updateStatus()
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_deviceUISet->m_deviceSourceAPI->isBuddyLeader())
|
||||
if (m_deviceUISet->m_deviceAPI->isBuddyLeader())
|
||||
{
|
||||
LimeSDRInput::MsgGetDeviceInfo* message = LimeSDRInput::MsgGetDeviceInfo::create();
|
||||
m_limeSDRInput->getInputMessageQueue()->push(message);
|
||||
|
||||
@@ -156,7 +156,7 @@ bool LimeSDRInputPlugin::findSerial(const char *lmsInfoStr, std::string& serial)
|
||||
}
|
||||
}
|
||||
|
||||
DeviceSampleSource *LimeSDRInputPlugin::createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI)
|
||||
DeviceSampleSource *LimeSDRInputPlugin::createSampleSourcePluginInstanceInput(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, DeviceSourceAPI *deviceAPI);
|
||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceAPI *deviceAPI);
|
||||
|
||||
static const QString m_hardwareID;
|
||||
static const QString m_deviceTypeID;
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include "util/simpleserializer.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/dspengine.h"
|
||||
#include "device/devicesourceapi.h"
|
||||
#include "device/deviceapi.h"
|
||||
#include "dsp/filerecord.h"
|
||||
|
||||
#include "localinput.h"
|
||||
@@ -40,7 +40,7 @@ MESSAGE_CLASS_DEFINITION(LocalInput::MsgFileRecord, Message)
|
||||
MESSAGE_CLASS_DEFINITION(LocalInput::MsgStartStop, Message)
|
||||
MESSAGE_CLASS_DEFINITION(LocalInput::MsgReportSampleRateAndFrequency, Message)
|
||||
|
||||
LocalInput::LocalInput(DeviceSourceAPI *deviceAPI) :
|
||||
LocalInput::LocalInput(DeviceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_settings(),
|
||||
m_deviceDescription("LocalInput"),
|
||||
@@ -49,7 +49,7 @@ LocalInput::LocalInput(DeviceSourceAPI *deviceAPI) :
|
||||
m_sampleFifo.setSize(96000 * 4);
|
||||
|
||||
m_fileSink = new FileRecord(QString("test_%1.sdriq").arg(m_deviceAPI->getDeviceUID()));
|
||||
m_deviceAPI->addSink(m_fileSink);
|
||||
m_deviceAPI->addAncillarySink(m_fileSink);
|
||||
|
||||
m_networkManager = new QNetworkAccessManager();
|
||||
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
@@ -60,7 +60,7 @@ LocalInput::~LocalInput()
|
||||
disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
delete m_networkManager;
|
||||
stop();
|
||||
m_deviceAPI->removeSink(m_fileSink);
|
||||
m_deviceAPI->removeAncillarySink(m_fileSink);
|
||||
delete m_fileSink;
|
||||
}
|
||||
|
||||
@@ -201,14 +201,14 @@ bool LocalInput::handleMessage(const Message& message)
|
||||
|
||||
if (cmd.getStartStop())
|
||||
{
|
||||
if (m_deviceAPI->initAcquisition())
|
||||
if (m_deviceAPI->initDeviceEngine())
|
||||
{
|
||||
m_deviceAPI->startAcquisition();
|
||||
m_deviceAPI->startDeviceEngine();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_deviceAPI->stopAcquisition();
|
||||
m_deviceAPI->stopDeviceEngine();
|
||||
}
|
||||
|
||||
if (m_settings.m_useReverseAPI) {
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
class QNetworkAccessManager;
|
||||
class QNetworkReply;
|
||||
class DeviceSourceAPI;
|
||||
class DeviceAPI;
|
||||
class FileRecord;
|
||||
|
||||
class LocalInput : public DeviceSampleSource {
|
||||
@@ -122,7 +122,7 @@ public:
|
||||
{ }
|
||||
};
|
||||
|
||||
LocalInput(DeviceSourceAPI *deviceAPI);
|
||||
LocalInput(DeviceAPI *deviceAPI);
|
||||
virtual ~LocalInput();
|
||||
virtual void destroy();
|
||||
|
||||
@@ -167,7 +167,7 @@ public:
|
||||
QString& errorMessage);
|
||||
|
||||
private:
|
||||
DeviceSourceAPI *m_deviceAPI;
|
||||
DeviceAPI *m_deviceAPI;
|
||||
QMutex m_mutex;
|
||||
LocalInputSettings m_settings;
|
||||
qint64 m_centerFrequency;
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "mainwindow.h"
|
||||
#include "util/simpleserializer.h"
|
||||
#include "device/devicesourceapi.h"
|
||||
#include "device/deviceapi.h"
|
||||
#include "device/deviceuiset.h"
|
||||
#include "localinputgui.h"
|
||||
|
||||
@@ -53,7 +53,7 @@ LocalInputGui::LocalInputGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
m_acquisition(false),
|
||||
m_streamSampleRate(0),
|
||||
m_streamCenterFrequency(0),
|
||||
m_lastEngineState(DSPDeviceSourceEngine::StNotStarted),
|
||||
m_lastEngineState(DeviceAPI::StNotStarted),
|
||||
m_framesDecodingStatus(0),
|
||||
m_bufferLengthInSecs(0.0),
|
||||
m_bufferGauge(-50),
|
||||
@@ -92,7 +92,7 @@ LocalInputGui::LocalInputGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
m_statusTimer.start(500);
|
||||
connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware()));
|
||||
|
||||
m_sampleSource = (LocalInput*) m_deviceUISet->m_deviceSourceAPI->getSampleSource();
|
||||
m_sampleSource = (LocalInput*) m_deviceUISet->m_deviceAPI->getSampleSource();
|
||||
|
||||
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection);
|
||||
m_sampleSource->setMessageQueueToGUI(&m_inputMessageQueue);
|
||||
@@ -324,24 +324,24 @@ void LocalInputGui::updateHardware()
|
||||
|
||||
void LocalInputGui::updateStatus()
|
||||
{
|
||||
int state = m_deviceUISet->m_deviceSourceAPI->state();
|
||||
int state = m_deviceUISet->m_deviceAPI->state();
|
||||
|
||||
if(m_lastEngineState != state)
|
||||
{
|
||||
switch(state)
|
||||
{
|
||||
case DSPDeviceSourceEngine::StNotStarted:
|
||||
case DeviceAPI::StNotStarted:
|
||||
ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StIdle:
|
||||
case DeviceAPI::StIdle:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StRunning:
|
||||
case DeviceAPI::StRunning:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StError:
|
||||
case DeviceAPI::StError:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
||||
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceSourceAPI->errorMessage());
|
||||
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -100,7 +100,7 @@ PluginInstanceGUI* LocalInputPlugin::createSampleSourcePluginInstanceGUI(
|
||||
}
|
||||
#endif
|
||||
|
||||
DeviceSampleSource *LocalInputPlugin::createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI)
|
||||
DeviceSampleSource *LocalInputPlugin::createSampleSourcePluginInstanceInput(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, DeviceSourceAPI *deviceAPI);
|
||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceAPI *deviceAPI);
|
||||
|
||||
static const QString m_hardwareID;
|
||||
static const QString m_deviceTypeID;
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
#include <QDebug>
|
||||
#include <QMessageBox>
|
||||
|
||||
#include <device/devicesourceapi.h>
|
||||
#include "device/deviceapi.h"
|
||||
#include "device/deviceuiset.h"
|
||||
#include <dsp/filerecord.h>
|
||||
#include "dsp/filerecord.h"
|
||||
|
||||
#include "ui_perseusgui.h"
|
||||
#include "gui/colormapper.h"
|
||||
@@ -39,9 +39,9 @@ PerseusGui::PerseusGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
m_forceSettings(true),
|
||||
m_settings(),
|
||||
m_sampleSource(0),
|
||||
m_lastEngineState(DSPDeviceSourceEngine::StNotStarted)
|
||||
m_lastEngineState(DeviceAPI::StNotStarted)
|
||||
{
|
||||
m_sampleSource = (PerseusInput*) m_deviceUISet->m_deviceSourceAPI->getSampleSource();
|
||||
m_sampleSource = (PerseusInput*) m_deviceUISet->m_deviceAPI->getSampleSource();
|
||||
|
||||
ui->setupUi(this);
|
||||
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
||||
@@ -352,24 +352,24 @@ void PerseusGui::updateHardware()
|
||||
|
||||
void PerseusGui::updateStatus()
|
||||
{
|
||||
int state = m_deviceUISet->m_deviceSourceAPI->state();
|
||||
int state = m_deviceUISet->m_deviceAPI->state();
|
||||
|
||||
if(m_lastEngineState != state)
|
||||
{
|
||||
switch(state)
|
||||
{
|
||||
case DSPDeviceSourceEngine::StNotStarted:
|
||||
case DeviceAPI::StNotStarted:
|
||||
ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StIdle:
|
||||
case DeviceAPI::StIdle:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StRunning:
|
||||
case DeviceAPI::StRunning:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StError:
|
||||
case DeviceAPI::StError:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
||||
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceSourceAPI->errorMessage());
|
||||
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "dsp/filerecord.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/dspengine.h"
|
||||
#include "device/devicesourceapi.h"
|
||||
#include "device/deviceapi.h"
|
||||
#include "perseus/deviceperseus.h"
|
||||
|
||||
#include "perseusinput.h"
|
||||
@@ -37,7 +37,7 @@ MESSAGE_CLASS_DEFINITION(PerseusInput::MsgConfigurePerseus, Message)
|
||||
MESSAGE_CLASS_DEFINITION(PerseusInput::MsgFileRecord, Message)
|
||||
MESSAGE_CLASS_DEFINITION(PerseusInput::MsgStartStop, Message)
|
||||
|
||||
PerseusInput::PerseusInput(DeviceSourceAPI *deviceAPI) :
|
||||
PerseusInput::PerseusInput(DeviceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_fileSink(0),
|
||||
m_deviceDescription("PerseusInput"),
|
||||
@@ -47,7 +47,7 @@ PerseusInput::PerseusInput(DeviceSourceAPI *deviceAPI) :
|
||||
{
|
||||
openDevice();
|
||||
m_fileSink = new FileRecord(QString("test_%1.sdriq").arg(m_deviceAPI->getDeviceUID()));
|
||||
m_deviceAPI->addSink(m_fileSink);
|
||||
m_deviceAPI->addAncillarySink(m_fileSink);
|
||||
|
||||
m_networkManager = new QNetworkAccessManager();
|
||||
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
@@ -57,7 +57,7 @@ PerseusInput::~PerseusInput()
|
||||
{
|
||||
disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
delete m_networkManager;
|
||||
m_deviceAPI->removeSink(m_fileSink);
|
||||
m_deviceAPI->removeAncillarySink(m_fileSink);
|
||||
delete m_fileSink;
|
||||
closeDevice();
|
||||
}
|
||||
@@ -185,14 +185,14 @@ bool PerseusInput::handleMessage(const Message& message)
|
||||
|
||||
if (cmd.getStartStop())
|
||||
{
|
||||
if (m_deviceAPI->initAcquisition())
|
||||
if (m_deviceAPI->initDeviceEngine())
|
||||
{
|
||||
m_deviceAPI->startAcquisition();
|
||||
m_deviceAPI->startDeviceEngine();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_deviceAPI->stopAcquisition();
|
||||
m_deviceAPI->stopDeviceEngine();
|
||||
}
|
||||
|
||||
if (m_settings.m_useReverseAPI) {
|
||||
@@ -241,8 +241,8 @@ bool PerseusInput::openDevice()
|
||||
return false;
|
||||
}
|
||||
|
||||
m_deviceAPI->getSampleSourceSerial();
|
||||
int deviceSequence = DevicePerseus::instance().getSequenceFromSerial(m_deviceAPI->getSampleSourceSerial().toStdString());
|
||||
m_deviceAPI->getSamplingDeviceSerial();
|
||||
int deviceSequence = DevicePerseus::instance().getSequenceFromSerial(m_deviceAPI->getSamplingDeviceSerial().toStdString());
|
||||
|
||||
if ((m_perseusDescriptor = perseus_open(deviceSequence)) == 0)
|
||||
{
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
class QNetworkAccessManager;
|
||||
class QNetworkReply;
|
||||
class DeviceSourceAPI;
|
||||
class DeviceAPI;
|
||||
class FileRecord;
|
||||
class PerseusThread;
|
||||
|
||||
@@ -97,7 +97,7 @@ public:
|
||||
{ }
|
||||
};
|
||||
|
||||
PerseusInput(DeviceSourceAPI *deviceAPI);
|
||||
PerseusInput(DeviceAPI *deviceAPI);
|
||||
~PerseusInput();
|
||||
virtual void destroy();
|
||||
|
||||
@@ -143,7 +143,7 @@ public:
|
||||
const std::vector<uint32_t>& getSampleRates() const { return m_sampleRates; }
|
||||
|
||||
private:
|
||||
DeviceSourceAPI *m_deviceAPI;
|
||||
DeviceAPI *m_deviceAPI;
|
||||
FileRecord *m_fileSink;
|
||||
QString m_deviceDescription;
|
||||
PerseusSettings m_settings;
|
||||
|
||||
@@ -115,7 +115,7 @@ PluginInstanceGUI* PerseusPlugin::createSampleSourcePluginInstanceGUI(
|
||||
}
|
||||
#endif
|
||||
|
||||
DeviceSampleSource *PerseusPlugin::createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI)
|
||||
DeviceSampleSource *PerseusPlugin::createSampleSourcePluginInstanceInput(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, DeviceSourceAPI *deviceAPI);
|
||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceAPI *deviceAPI);
|
||||
|
||||
static const QString m_hardwareID;
|
||||
static const QString m_deviceTypeID;
|
||||
|
||||
@@ -27,8 +27,7 @@
|
||||
#include "dsp/filerecord.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/dspengine.h"
|
||||
#include "device/devicesourceapi.h"
|
||||
#include "device/devicesinkapi.h"
|
||||
#include "device/deviceapi.h"
|
||||
#include "plutosdr/deviceplutosdrparams.h"
|
||||
#include "plutosdr/deviceplutosdrbox.h"
|
||||
|
||||
@@ -41,7 +40,7 @@ MESSAGE_CLASS_DEFINITION(PlutoSDRInput::MsgConfigurePlutoSDR, Message)
|
||||
MESSAGE_CLASS_DEFINITION(PlutoSDRInput::MsgFileRecord, Message)
|
||||
MESSAGE_CLASS_DEFINITION(PlutoSDRInput::MsgStartStop, Message)
|
||||
|
||||
PlutoSDRInput::PlutoSDRInput(DeviceSourceAPI *deviceAPI) :
|
||||
PlutoSDRInput::PlutoSDRInput(DeviceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_fileSink(0),
|
||||
m_deviceDescription("PlutoSDRInput"),
|
||||
@@ -61,7 +60,7 @@ PlutoSDRInput::PlutoSDRInput(DeviceSourceAPI *deviceAPI) :
|
||||
resumeBuddies();
|
||||
|
||||
m_fileSink = new FileRecord(QString("test_%1.sdriq").arg(m_deviceAPI->getDeviceUID()));
|
||||
m_deviceAPI->addSink(m_fileSink);
|
||||
m_deviceAPI->addAncillarySink(m_fileSink);
|
||||
|
||||
m_networkManager = new QNetworkAccessManager();
|
||||
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
@@ -71,7 +70,7 @@ PlutoSDRInput::~PlutoSDRInput()
|
||||
{
|
||||
disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
delete m_networkManager;
|
||||
m_deviceAPI->removeSink(m_fileSink);
|
||||
m_deviceAPI->removeAncillarySink(m_fileSink);
|
||||
delete m_fileSink;
|
||||
suspendBuddies();
|
||||
closeDevice();
|
||||
@@ -224,14 +223,14 @@ bool PlutoSDRInput::handleMessage(const Message& message)
|
||||
|
||||
if (cmd.getStartStop())
|
||||
{
|
||||
if (m_deviceAPI->initAcquisition())
|
||||
if (m_deviceAPI->initDeviceEngine())
|
||||
{
|
||||
m_deviceAPI->startAcquisition();
|
||||
m_deviceAPI->startDeviceEngine();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_deviceAPI->stopAcquisition();
|
||||
m_deviceAPI->stopDeviceEngine();
|
||||
}
|
||||
|
||||
if (m_settings.m_useReverseAPI) {
|
||||
@@ -276,7 +275,7 @@ bool PlutoSDRInput::openDevice()
|
||||
{
|
||||
qDebug("PlutoSDRInput::openDevice: look at Tx buddy");
|
||||
|
||||
DeviceSinkAPI *sinkBuddy = m_deviceAPI->getSinkBuddies()[0];
|
||||
DeviceAPI *sinkBuddy = m_deviceAPI->getSinkBuddies()[0];
|
||||
DevicePlutoSDRShared* buddySharedPtr = (DevicePlutoSDRShared*) sinkBuddy->getBuddySharedPtr();
|
||||
m_deviceShared.m_deviceParams = buddySharedPtr->m_deviceParams;
|
||||
|
||||
@@ -298,7 +297,7 @@ bool PlutoSDRInput::openDevice()
|
||||
|
||||
m_deviceShared.m_deviceParams = new DevicePlutoSDRParams();
|
||||
char serial[256];
|
||||
strcpy(serial, qPrintable(m_deviceAPI->getSampleSourceSerial()));
|
||||
strcpy(serial, qPrintable(m_deviceAPI->getSamplingDeviceSerial()));
|
||||
m_deviceShared.m_deviceParams->open(serial);
|
||||
}
|
||||
|
||||
@@ -332,7 +331,7 @@ void PlutoSDRInput::suspendBuddies()
|
||||
|
||||
for (unsigned int i = 0; i < m_deviceAPI->getSinkBuddies().size(); i++)
|
||||
{
|
||||
DeviceSinkAPI *buddy = m_deviceAPI->getSinkBuddies()[i];
|
||||
DeviceAPI *buddy = m_deviceAPI->getSinkBuddies()[i];
|
||||
DevicePlutoSDRShared *buddyShared = (DevicePlutoSDRShared *) buddy->getBuddySharedPtr();
|
||||
|
||||
if (buddyShared->m_thread) {
|
||||
@@ -347,7 +346,7 @@ void PlutoSDRInput::resumeBuddies()
|
||||
|
||||
for (unsigned int i = 0; i < m_deviceAPI->getSinkBuddies().size(); i++)
|
||||
{
|
||||
DeviceSinkAPI *buddy = m_deviceAPI->getSinkBuddies()[i];
|
||||
DeviceAPI *buddy = m_deviceAPI->getSinkBuddies()[i];
|
||||
DevicePlutoSDRShared *buddyShared = (DevicePlutoSDRShared *) buddy->getBuddySharedPtr();
|
||||
|
||||
if (buddyShared->m_thread) {
|
||||
@@ -459,8 +458,8 @@ bool PlutoSDRInput::applySettings(const PlutoSDRInputSettings& settings, bool fo
|
||||
|
||||
if (suspendAllOtherThreads)
|
||||
{
|
||||
const std::vector<DeviceSinkAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
|
||||
std::vector<DeviceSinkAPI*>::const_iterator itSink = sinkBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator itSink = sinkBuddies.begin();
|
||||
|
||||
for (; itSink != sinkBuddies.end(); ++itSink)
|
||||
{
|
||||
@@ -610,8 +609,8 @@ bool PlutoSDRInput::applySettings(const PlutoSDRInputSettings& settings, bool fo
|
||||
|
||||
if (suspendAllOtherThreads)
|
||||
{
|
||||
const std::vector<DeviceSinkAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
|
||||
std::vector<DeviceSinkAPI*>::const_iterator itSink = sinkBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator itSink = sinkBuddies.begin();
|
||||
|
||||
for (; itSink != sinkBuddies.end(); ++itSink)
|
||||
{
|
||||
@@ -633,8 +632,8 @@ bool PlutoSDRInput::applySettings(const PlutoSDRInputSettings& settings, bool fo
|
||||
|
||||
qDebug("PlutoSDRInput::applySettings: forwardChangeOtherDSP");
|
||||
|
||||
const std::vector<DeviceSinkAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
|
||||
std::vector<DeviceSinkAPI*>::const_iterator itSink = sinkBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator itSink = sinkBuddies.begin();
|
||||
|
||||
for (; itSink != sinkBuddies.end(); ++itSink)
|
||||
{
|
||||
@@ -645,13 +644,13 @@ bool PlutoSDRInput::applySettings(const PlutoSDRInputSettings& settings, bool fo
|
||||
settings.m_lpfFIRBW,
|
||||
settings.m_LOppmTenths);
|
||||
|
||||
if ((*itSink)->getSampleSinkGUIMessageQueue())
|
||||
if ((*itSink)->getSamplingDeviceGUIMessageQueue())
|
||||
{
|
||||
DevicePlutoSDRShared::MsgCrossReportToBuddy *msgToGUI = new DevicePlutoSDRShared::MsgCrossReportToBuddy(*msg);
|
||||
(*itSink)->getSampleSinkGUIMessageQueue()->push(msgToGUI);
|
||||
(*itSink)->getSamplingDeviceGUIMessageQueue()->push(msgToGUI);
|
||||
}
|
||||
|
||||
(*itSink)->getSampleSinkInputMessageQueue()->push(msg);
|
||||
(*itSink)->getSamplingDeviceInputMessageQueue()->push(msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
class QNetworkAccessManager;
|
||||
class QNetworkReply;
|
||||
class DeviceSourceAPI;
|
||||
class DeviceAPI;
|
||||
class FileRecord;
|
||||
class PlutoSDRInputThread;
|
||||
|
||||
@@ -99,7 +99,7 @@ public:
|
||||
{ }
|
||||
};
|
||||
|
||||
PlutoSDRInput(DeviceSourceAPI *deviceAPI);
|
||||
PlutoSDRInput(DeviceAPI *deviceAPI);
|
||||
~PlutoSDRInput();
|
||||
virtual void destroy();
|
||||
|
||||
@@ -152,7 +152,7 @@ public:
|
||||
float getTemperature();
|
||||
|
||||
private:
|
||||
DeviceSourceAPI *m_deviceAPI;
|
||||
DeviceAPI *m_deviceAPI;
|
||||
FileRecord *m_fileSink;
|
||||
QString m_deviceDescription;
|
||||
PlutoSDRInputSettings m_settings;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "gui/glspectrum.h"
|
||||
#include "gui/crightclickenabler.h"
|
||||
#include "gui/basicdevicesettingsdialog.h"
|
||||
#include "device/devicesourceapi.h"
|
||||
#include "device/deviceapi.h"
|
||||
#include "device/deviceuiset.h"
|
||||
#include "plutosdr/deviceplutosdr.h"
|
||||
#include "plutosdrinput.h"
|
||||
@@ -41,11 +41,11 @@ PlutoSDRInputGui::PlutoSDRInputGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
m_sampleSource(NULL),
|
||||
m_sampleRate(0),
|
||||
m_deviceCenterFrequency(0),
|
||||
m_lastEngineState(DSPDeviceSourceEngine::StNotStarted),
|
||||
m_lastEngineState(DeviceAPI::StNotStarted),
|
||||
m_doApplySettings(true),
|
||||
m_statusCounter(0)
|
||||
{
|
||||
m_sampleSource = (PlutoSDRInput*) m_deviceUISet->m_deviceSourceAPI->getSampleSource();
|
||||
m_sampleSource = (PlutoSDRInput*) m_deviceUISet->m_deviceAPI->getSampleSource();
|
||||
|
||||
ui->setupUi(this);
|
||||
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
||||
@@ -429,24 +429,24 @@ void PlutoSDRInputGui::blockApplySettings(bool block)
|
||||
|
||||
void PlutoSDRInputGui::updateStatus()
|
||||
{
|
||||
int state = m_deviceUISet->m_deviceSourceAPI->state();
|
||||
int state = m_deviceUISet->m_deviceAPI->state();
|
||||
|
||||
if(m_lastEngineState != state)
|
||||
{
|
||||
switch(state)
|
||||
{
|
||||
case DSPDeviceSourceEngine::StNotStarted:
|
||||
case DeviceAPI::StNotStarted:
|
||||
ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StIdle:
|
||||
case DeviceAPI::StIdle:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StRunning:
|
||||
case DeviceAPI::StRunning:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StError:
|
||||
case DeviceAPI::StError:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
||||
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceSourceAPI->errorMessage());
|
||||
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -478,7 +478,7 @@ void PlutoSDRInputGui::updateStatus()
|
||||
|
||||
if (m_statusCounter % 10 == 0) // 5s
|
||||
{
|
||||
if (m_deviceUISet->m_deviceSourceAPI->isBuddyLeader()) {
|
||||
if (m_deviceUISet->m_deviceAPI->isBuddyLeader()) {
|
||||
((PlutoSDRInput *) m_sampleSource)->fetchTemperature();
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#endif
|
||||
#include "plutosdrinputplugin.h"
|
||||
|
||||
class DeviceSourceAPI;
|
||||
class DeviceAPI;
|
||||
|
||||
const PluginDescriptor PlutoSDRInputPlugin::m_pluginDescriptor = {
|
||||
QString("PlutoSDR Input"),
|
||||
@@ -115,7 +115,7 @@ PluginInstanceGUI* PlutoSDRInputPlugin::createSampleSourcePluginInstanceGUI(
|
||||
}
|
||||
#endif
|
||||
|
||||
DeviceSampleSource *PlutoSDRInputPlugin::createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI)
|
||||
DeviceSampleSource *PlutoSDRInputPlugin::createSampleSourcePluginInstanceInput(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, DeviceSourceAPI *deviceAPI);
|
||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceAPI *deviceAPI);
|
||||
|
||||
static const QString m_hardwareID;
|
||||
static const QString m_deviceTypeID;
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include "util/simpleserializer.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/dspengine.h"
|
||||
#include "device/devicesourceapi.h"
|
||||
#include "device/deviceapi.h"
|
||||
#include "dsp/filerecord.h"
|
||||
|
||||
#include "remoteinput.h"
|
||||
@@ -44,7 +44,7 @@ MESSAGE_CLASS_DEFINITION(RemoteInput::MsgReportRemoteInputStreamTiming, Message)
|
||||
MESSAGE_CLASS_DEFINITION(RemoteInput::MsgFileRecord, Message)
|
||||
MESSAGE_CLASS_DEFINITION(RemoteInput::MsgStartStop, Message)
|
||||
|
||||
RemoteInput::RemoteInput(DeviceSourceAPI *deviceAPI) :
|
||||
RemoteInput::RemoteInput(DeviceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_settings(),
|
||||
m_remoteInputUDPHandler(0),
|
||||
@@ -55,7 +55,7 @@ RemoteInput::RemoteInput(DeviceSourceAPI *deviceAPI) :
|
||||
m_remoteInputUDPHandler = new RemoteInputUDPHandler(&m_sampleFifo, m_deviceAPI);
|
||||
|
||||
m_fileSink = new FileRecord(QString("test_%1.sdriq").arg(m_deviceAPI->getDeviceUID()));
|
||||
m_deviceAPI->addSink(m_fileSink);
|
||||
m_deviceAPI->addAncillarySink(m_fileSink);
|
||||
|
||||
m_networkManager = new QNetworkAccessManager();
|
||||
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
@@ -66,7 +66,7 @@ RemoteInput::~RemoteInput()
|
||||
disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
delete m_networkManager;
|
||||
stop();
|
||||
m_deviceAPI->removeSink(m_fileSink);
|
||||
m_deviceAPI->removeAncillarySink(m_fileSink);
|
||||
delete m_fileSink;
|
||||
delete m_remoteInputUDPHandler;
|
||||
}
|
||||
@@ -193,14 +193,14 @@ bool RemoteInput::handleMessage(const Message& message)
|
||||
|
||||
if (cmd.getStartStop())
|
||||
{
|
||||
if (m_deviceAPI->initAcquisition())
|
||||
if (m_deviceAPI->initDeviceEngine())
|
||||
{
|
||||
m_deviceAPI->startAcquisition();
|
||||
m_deviceAPI->startDeviceEngine();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_deviceAPI->stopAcquisition();
|
||||
m_deviceAPI->stopDeviceEngine();
|
||||
}
|
||||
|
||||
if (m_settings.m_useReverseAPI) {
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
class QNetworkAccessManager;
|
||||
class QNetworkReply;
|
||||
class DeviceSourceAPI;
|
||||
class DeviceAPI;
|
||||
class RemoteInputUDPHandler;
|
||||
class FileRecord;
|
||||
|
||||
@@ -268,7 +268,7 @@ public:
|
||||
{ }
|
||||
};
|
||||
|
||||
RemoteInput(DeviceSourceAPI *deviceAPI);
|
||||
RemoteInput(DeviceAPI *deviceAPI);
|
||||
virtual ~RemoteInput();
|
||||
virtual void destroy();
|
||||
|
||||
@@ -314,7 +314,7 @@ public:
|
||||
QString& errorMessage);
|
||||
|
||||
private:
|
||||
DeviceSourceAPI *m_deviceAPI;
|
||||
DeviceAPI *m_deviceAPI;
|
||||
QMutex m_mutex;
|
||||
RemoteInputSettings m_settings;
|
||||
RemoteInputUDPHandler* m_remoteInputUDPHandler;
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "mainwindow.h"
|
||||
#include "util/simpleserializer.h"
|
||||
#include "device/devicesourceapi.h"
|
||||
#include "device/deviceapi.h"
|
||||
#include "device/deviceuiset.h"
|
||||
#include "remoteinputgui.h"
|
||||
|
||||
@@ -53,7 +53,7 @@ RemoteInputGui::RemoteInputGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
m_acquisition(false),
|
||||
m_streamSampleRate(0),
|
||||
m_streamCenterFrequency(0),
|
||||
m_lastEngineState(DSPDeviceSourceEngine::StNotStarted),
|
||||
m_lastEngineState(DeviceAPI::StNotStarted),
|
||||
m_framesDecodingStatus(0),
|
||||
m_bufferLengthInSecs(0.0),
|
||||
m_bufferGauge(-50),
|
||||
@@ -92,7 +92,7 @@ RemoteInputGui::RemoteInputGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
m_statusTimer.start(500);
|
||||
connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware()));
|
||||
|
||||
m_sampleSource = (RemoteInput*) m_deviceUISet->m_deviceSourceAPI->getSampleSource();
|
||||
m_sampleSource = (RemoteInput*) m_deviceUISet->m_deviceAPI->getSampleSource();
|
||||
|
||||
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection);
|
||||
m_sampleSource->setMessageQueueToGUI(&m_inputMessageQueue);
|
||||
@@ -538,24 +538,24 @@ void RemoteInputGui::updateStatus()
|
||||
{
|
||||
if (m_sampleSource->isStreaming())
|
||||
{
|
||||
int state = m_deviceUISet->m_deviceSourceAPI->state();
|
||||
int state = m_deviceUISet->m_deviceAPI->state();
|
||||
|
||||
if (m_lastEngineState != state)
|
||||
{
|
||||
switch(state)
|
||||
{
|
||||
case DSPDeviceSourceEngine::StNotStarted:
|
||||
case DeviceAPI::StNotStarted:
|
||||
ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StIdle:
|
||||
case DeviceAPI::StIdle:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StRunning:
|
||||
case DeviceAPI::StRunning:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StError:
|
||||
case DeviceAPI::StError:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
||||
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceSourceAPI->errorMessage());
|
||||
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -100,7 +100,7 @@ PluginInstanceGUI* RemoteInputPlugin::createSampleSourcePluginInstanceGUI(
|
||||
}
|
||||
#endif
|
||||
|
||||
DeviceSampleSource *RemoteInputPlugin::createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI)
|
||||
DeviceSampleSource *RemoteInputPlugin::createSampleSourcePluginInstanceInput(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, DeviceSourceAPI *deviceAPI);
|
||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceAPI *deviceAPI);
|
||||
|
||||
static const QString m_hardwareID;
|
||||
static const QString m_deviceTypeID;
|
||||
|
||||
@@ -21,12 +21,12 @@
|
||||
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/dspengine.h"
|
||||
#include <device/devicesourceapi.h>
|
||||
#include "device/deviceapi.h"
|
||||
|
||||
#include "remoteinputudphandler.h"
|
||||
#include "remoteinput.h"
|
||||
|
||||
RemoteInputUDPHandler::RemoteInputUDPHandler(SampleSinkFifo *sampleFifo, DeviceSourceAPI *deviceAPI) :
|
||||
RemoteInputUDPHandler::RemoteInputUDPHandler(SampleSinkFifo *sampleFifo, DeviceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_masterTimer(deviceAPI->getMasterTimer()),
|
||||
m_masterTimerConnected(false),
|
||||
|
||||
@@ -31,13 +31,13 @@
|
||||
class SampleSinkFifo;
|
||||
class MessageQueue;
|
||||
class QTimer;
|
||||
class DeviceSourceAPI;
|
||||
class DeviceAPI;
|
||||
|
||||
class RemoteInputUDPHandler : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
RemoteInputUDPHandler(SampleSinkFifo* sampleFifo, DeviceSourceAPI *deviceAPI);
|
||||
RemoteInputUDPHandler(SampleSinkFifo* sampleFifo, DeviceAPI *deviceAPI);
|
||||
~RemoteInputUDPHandler();
|
||||
void setMessageQueueToGUI(MessageQueue *queue) { m_outputMessageQueueToGUI = queue; }
|
||||
void start();
|
||||
@@ -56,7 +56,7 @@ public slots:
|
||||
void dataReadyRead();
|
||||
|
||||
private:
|
||||
DeviceSourceAPI *m_deviceAPI;
|
||||
DeviceAPI *m_deviceAPI;
|
||||
const QTimer& m_masterTimer;
|
||||
bool m_masterTimerConnected;
|
||||
bool m_running;
|
||||
|
||||
@@ -20,9 +20,9 @@
|
||||
|
||||
#include "rtlsdrgui.h"
|
||||
|
||||
#include <device/devicesourceapi.h>
|
||||
#include "device/deviceapi.h"
|
||||
#include "device/deviceuiset.h"
|
||||
#include <dsp/filerecord.h>
|
||||
#include "dsp/filerecord.h"
|
||||
|
||||
#include "ui_rtlsdrgui.h"
|
||||
#include "gui/colormapper.h"
|
||||
@@ -42,9 +42,9 @@ RTLSDRGui::RTLSDRGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
m_settings(),
|
||||
m_sampleRateMode(true),
|
||||
m_sampleSource(0),
|
||||
m_lastEngineState(DSPDeviceSourceEngine::StNotStarted)
|
||||
m_lastEngineState(DeviceAPI::StNotStarted)
|
||||
{
|
||||
m_sampleSource = (RTLSDRInput*) m_deviceUISet->m_deviceSourceAPI->getSampleSource();
|
||||
m_sampleSource = (RTLSDRInput*) m_deviceUISet->m_deviceAPI->getSampleSource();
|
||||
|
||||
ui->setupUi(this);
|
||||
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
||||
@@ -439,24 +439,24 @@ void RTLSDRGui::updateHardware()
|
||||
|
||||
void RTLSDRGui::updateStatus()
|
||||
{
|
||||
int state = m_deviceUISet->m_deviceSourceAPI->state();
|
||||
int state = m_deviceUISet->m_deviceAPI->state();
|
||||
|
||||
if(m_lastEngineState != state)
|
||||
{
|
||||
switch(state)
|
||||
{
|
||||
case DSPDeviceSourceEngine::StNotStarted:
|
||||
case DeviceAPI::StNotStarted:
|
||||
ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StIdle:
|
||||
case DeviceAPI::StIdle:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StRunning:
|
||||
case DeviceAPI::StRunning:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StError:
|
||||
case DeviceAPI::StError:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
||||
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceSourceAPI->errorMessage());
|
||||
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include "SWGRtlSdrReport.h"
|
||||
|
||||
#include "rtlsdrinput.h"
|
||||
#include "device/devicesourceapi.h"
|
||||
#include "device/deviceapi.h"
|
||||
#include "rtlsdrthread.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/dspengine.h"
|
||||
@@ -49,7 +49,7 @@ const int RTLSDRInput::sampleRateLowRangeMax = 300000U;
|
||||
const int RTLSDRInput::sampleRateHighRangeMin = 950000U;
|
||||
const int RTLSDRInput::sampleRateHighRangeMax = 2400000U;
|
||||
|
||||
RTLSDRInput::RTLSDRInput(DeviceSourceAPI *deviceAPI) :
|
||||
RTLSDRInput::RTLSDRInput(DeviceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_settings(),
|
||||
m_dev(0),
|
||||
@@ -60,7 +60,7 @@ RTLSDRInput::RTLSDRInput(DeviceSourceAPI *deviceAPI) :
|
||||
openDevice();
|
||||
|
||||
m_fileSink = new FileRecord(QString("test_%1.sdriq").arg(m_deviceAPI->getDeviceUID()));
|
||||
m_deviceAPI->addSink(m_fileSink);
|
||||
m_deviceAPI->addAncillarySink(m_fileSink);
|
||||
|
||||
m_networkManager = new QNetworkAccessManager();
|
||||
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
@@ -75,7 +75,7 @@ RTLSDRInput::~RTLSDRInput()
|
||||
stop();
|
||||
}
|
||||
|
||||
m_deviceAPI->removeSink(m_fileSink);
|
||||
m_deviceAPI->removeAncillarySink(m_fileSink);
|
||||
delete m_fileSink;
|
||||
|
||||
closeDevice();
|
||||
@@ -107,7 +107,7 @@ bool RTLSDRInput::openDevice()
|
||||
|
||||
int device;
|
||||
|
||||
if ((device = rtlsdr_get_index_by_serial(qPrintable(m_deviceAPI->getSampleSourceSerial()))) < 0)
|
||||
if ((device = rtlsdr_get_index_by_serial(qPrintable(m_deviceAPI->getSamplingDeviceSerial()))) < 0)
|
||||
{
|
||||
qCritical("RTLSDRInput::openDevice: could not get RTLSDR serial number");
|
||||
return false;
|
||||
@@ -344,13 +344,13 @@ bool RTLSDRInput::handleMessage(const Message& message)
|
||||
|
||||
if (cmd.getStartStop())
|
||||
{
|
||||
if (m_deviceAPI->initAcquisition()) {
|
||||
m_deviceAPI->startAcquisition();
|
||||
if (m_deviceAPI->initDeviceEngine()) {
|
||||
m_deviceAPI->startDeviceEngine();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_deviceAPI->stopAcquisition();
|
||||
m_deviceAPI->stopDeviceEngine();
|
||||
}
|
||||
|
||||
if (m_settings.m_useReverseAPI) {
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "rtlsdrsettings.h"
|
||||
#include <rtl-sdr.h>
|
||||
|
||||
class DeviceSourceAPI;
|
||||
class DeviceAPI;
|
||||
class RTLSDRThread;
|
||||
class FileRecord;
|
||||
class QNetworkAccessManager;
|
||||
@@ -97,7 +97,7 @@ public:
|
||||
{ }
|
||||
};
|
||||
|
||||
RTLSDRInput(DeviceSourceAPI *deviceAPI);
|
||||
RTLSDRInput(DeviceAPI *deviceAPI);
|
||||
virtual ~RTLSDRInput();
|
||||
virtual void destroy();
|
||||
|
||||
@@ -153,7 +153,7 @@ public:
|
||||
static const int sampleRateHighRangeMax;
|
||||
|
||||
private:
|
||||
DeviceSourceAPI *m_deviceAPI;
|
||||
DeviceAPI *m_deviceAPI;
|
||||
FileRecord *m_fileSink; //!< File sink to record device I/Q output
|
||||
QMutex m_mutex;
|
||||
RTLSDRSettings m_settings;
|
||||
|
||||
@@ -93,7 +93,7 @@ PluginInstanceGUI* RTLSDRPlugin::createSampleSourcePluginInstanceGUI(
|
||||
}
|
||||
#endif
|
||||
|
||||
DeviceSampleSource *RTLSDRPlugin::createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI)
|
||||
DeviceSampleSource *RTLSDRPlugin::createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceAPI *deviceAPI)
|
||||
{
|
||||
if (sourceId == m_deviceTypeID)
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
const QString& sourceId,
|
||||
QWidget **widget,
|
||||
DeviceUISet *deviceUISet);
|
||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
|
||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceAPI *deviceAPI);
|
||||
|
||||
static const QString m_hardwareID;
|
||||
static const QString m_deviceTypeID;
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#include "sdrplaygui.h"
|
||||
|
||||
#include <device/devicesourceapi.h>
|
||||
#include "device/deviceapi.h"
|
||||
#include "device/deviceuiset.h"
|
||||
|
||||
#include "ui_sdrplaygui.h"
|
||||
@@ -39,7 +39,7 @@ SDRPlayGui::SDRPlayGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
m_doApplySettings(true),
|
||||
m_forceSettings(true)
|
||||
{
|
||||
m_sampleSource = (SDRPlayInput*) m_deviceUISet->m_deviceSourceAPI->getSampleSource();
|
||||
m_sampleSource = (SDRPlayInput*) m_deviceUISet->m_deviceAPI->getSampleSource();
|
||||
|
||||
ui->setupUi(this);
|
||||
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
||||
@@ -302,24 +302,24 @@ void SDRPlayGui::updateHardware()
|
||||
|
||||
void SDRPlayGui::updateStatus()
|
||||
{
|
||||
int state = m_deviceUISet->m_deviceSourceAPI->state();
|
||||
int state = m_deviceUISet->m_deviceAPI->state();
|
||||
|
||||
if(m_lastEngineState != state)
|
||||
{
|
||||
switch(state)
|
||||
{
|
||||
case DSPDeviceSourceEngine::StNotStarted:
|
||||
case DeviceAPI::StNotStarted:
|
||||
ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StIdle:
|
||||
case DeviceAPI::StIdle:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StRunning:
|
||||
case DeviceAPI::StRunning:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StError:
|
||||
case DeviceAPI::StError:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
||||
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceSourceAPI->errorMessage());
|
||||
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#include "sdrplayinput.h"
|
||||
#include "sdrplaysettings.h"
|
||||
|
||||
class DeviceSourceAPI;
|
||||
class DeviceUISet;
|
||||
|
||||
namespace Ui {
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include <dsp/filerecord.h>
|
||||
#include "sdrplayinput.h"
|
||||
|
||||
#include <device/devicesourceapi.h>
|
||||
#include <device/deviceapi.h>
|
||||
|
||||
#include "sdrplaythread.h"
|
||||
|
||||
@@ -42,7 +42,7 @@ MESSAGE_CLASS_DEFINITION(SDRPlayInput::MsgReportSDRPlayGains, Message)
|
||||
MESSAGE_CLASS_DEFINITION(SDRPlayInput::MsgFileRecord, Message)
|
||||
MESSAGE_CLASS_DEFINITION(SDRPlayInput::MsgStartStop, Message)
|
||||
|
||||
SDRPlayInput::SDRPlayInput(DeviceSourceAPI *deviceAPI) :
|
||||
SDRPlayInput::SDRPlayInput(DeviceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_variant(SDRPlayUndef),
|
||||
m_settings(),
|
||||
@@ -54,7 +54,7 @@ SDRPlayInput::SDRPlayInput(DeviceSourceAPI *deviceAPI) :
|
||||
{
|
||||
openDevice();
|
||||
m_fileSink = new FileRecord(QString("test_%1.sdriq").arg(m_deviceAPI->getDeviceUID()));
|
||||
m_deviceAPI->addSink(m_fileSink);
|
||||
m_deviceAPI->addAncillarySink(m_fileSink);
|
||||
|
||||
m_networkManager = new QNetworkAccessManager();
|
||||
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
@@ -69,7 +69,7 @@ SDRPlayInput::~SDRPlayInput()
|
||||
stop();
|
||||
}
|
||||
|
||||
m_deviceAPI->removeSink(m_fileSink);
|
||||
m_deviceAPI->removeAncillarySink(m_fileSink);
|
||||
delete m_fileSink;
|
||||
closeDevice();
|
||||
}
|
||||
@@ -81,7 +81,7 @@ void SDRPlayInput::destroy()
|
||||
|
||||
bool SDRPlayInput::openDevice()
|
||||
{
|
||||
m_devNumber = m_deviceAPI->getSampleSourceSequence();
|
||||
m_devNumber = m_deviceAPI->getSamplingDeviceSequence();
|
||||
|
||||
if (m_dev != 0)
|
||||
{
|
||||
@@ -337,14 +337,14 @@ bool SDRPlayInput::handleMessage(const Message& message)
|
||||
|
||||
if (cmd.getStartStop())
|
||||
{
|
||||
if (m_deviceAPI->initAcquisition())
|
||||
if (m_deviceAPI->initDeviceEngine())
|
||||
{
|
||||
m_deviceAPI->startAcquisition();
|
||||
m_deviceAPI->startDeviceEngine();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_deviceAPI->stopAcquisition();
|
||||
m_deviceAPI->stopDeviceEngine();
|
||||
}
|
||||
|
||||
if (m_settings.m_useReverseAPI) {
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
class QNetworkAccessManager;
|
||||
class QNetworkReply;
|
||||
class DeviceSourceAPI;
|
||||
class DeviceAPI;
|
||||
class SDRPlayThread;
|
||||
class FileRecord;
|
||||
|
||||
@@ -135,7 +135,7 @@ public:
|
||||
{ }
|
||||
};
|
||||
|
||||
SDRPlayInput(DeviceSourceAPI *deviceAPI);
|
||||
SDRPlayInput(DeviceAPI *deviceAPI);
|
||||
virtual ~SDRPlayInput();
|
||||
virtual void destroy();
|
||||
|
||||
@@ -181,7 +181,7 @@ public:
|
||||
SDRPlayVariant getVariant() const { return m_variant; }
|
||||
|
||||
private:
|
||||
DeviceSourceAPI *m_deviceAPI;
|
||||
DeviceAPI *m_deviceAPI;
|
||||
QMutex m_mutex;
|
||||
SDRPlayVariant m_variant;
|
||||
SDRPlaySettings m_settings;
|
||||
|
||||
@@ -118,7 +118,7 @@ PluginInstanceGUI* SDRPlayPlugin::createSampleSourcePluginInstanceGUI(
|
||||
}
|
||||
#endif
|
||||
|
||||
DeviceSampleSource *SDRPlayPlugin::createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI)
|
||||
DeviceSampleSource *SDRPlayPlugin::createSampleSourcePluginInstanceInput(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, DeviceSourceAPI *deviceAPI);
|
||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceAPI *deviceAPI);
|
||||
|
||||
static const QString m_hardwareID;
|
||||
static const QString m_deviceTypeID;
|
||||
|
||||
@@ -27,8 +27,7 @@
|
||||
#include "SWGDeviceReport.h"
|
||||
#include "SWGSoapySDRReport.h"
|
||||
|
||||
#include "device/devicesourceapi.h"
|
||||
#include "device/devicesinkapi.h"
|
||||
#include "device/deviceapi.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/filerecord.h"
|
||||
#include "dsp/dspengine.h"
|
||||
@@ -42,7 +41,7 @@ MESSAGE_CLASS_DEFINITION(SoapySDRInput::MsgFileRecord, Message)
|
||||
MESSAGE_CLASS_DEFINITION(SoapySDRInput::MsgStartStop, Message)
|
||||
MESSAGE_CLASS_DEFINITION(SoapySDRInput::MsgReportGainChange, Message)
|
||||
|
||||
SoapySDRInput::SoapySDRInput(DeviceSourceAPI *deviceAPI) :
|
||||
SoapySDRInput::SoapySDRInput(DeviceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_settings(),
|
||||
m_deviceDescription("SoapySDRInput"),
|
||||
@@ -56,7 +55,7 @@ SoapySDRInput::SoapySDRInput(DeviceSourceAPI *deviceAPI) :
|
||||
initDeviceArgSettings(m_settings);
|
||||
|
||||
m_fileSink = new FileRecord(QString("test_%1.sdriq").arg(m_deviceAPI->getDeviceUID()));
|
||||
m_deviceAPI->addSink(m_fileSink);
|
||||
m_deviceAPI->addAncillarySink(m_fileSink);
|
||||
|
||||
m_networkManager = new QNetworkAccessManager();
|
||||
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
@@ -71,7 +70,7 @@ SoapySDRInput::~SoapySDRInput()
|
||||
stop();
|
||||
}
|
||||
|
||||
m_deviceAPI->removeSink(m_fileSink);
|
||||
m_deviceAPI->removeAncillarySink(m_fileSink);
|
||||
delete m_fileSink;
|
||||
|
||||
closeDevice();
|
||||
@@ -99,7 +98,7 @@ bool SoapySDRInput::openDevice()
|
||||
{
|
||||
qDebug("SoapySDRInput::openDevice: look in Rx buddies");
|
||||
|
||||
DeviceSourceAPI *sourceBuddy = m_deviceAPI->getSourceBuddies()[0];
|
||||
DeviceAPI *sourceBuddy = m_deviceAPI->getSourceBuddies()[0];
|
||||
DeviceSoapySDRShared *deviceSoapySDRShared = (DeviceSoapySDRShared*) sourceBuddy->getBuddySharedPtr();
|
||||
|
||||
if (deviceSoapySDRShared == 0)
|
||||
@@ -124,7 +123,7 @@ bool SoapySDRInput::openDevice()
|
||||
{
|
||||
qDebug("SoapySDRInput::openDevice: look in Tx buddies");
|
||||
|
||||
DeviceSinkAPI *sinkBuddy = m_deviceAPI->getSinkBuddies()[0];
|
||||
DeviceAPI *sinkBuddy = m_deviceAPI->getSinkBuddies()[0];
|
||||
DeviceSoapySDRShared *deviceSoapySDRShared = (DeviceSoapySDRShared*) sinkBuddy->getBuddySharedPtr();
|
||||
|
||||
if (deviceSoapySDRShared == 0)
|
||||
@@ -149,7 +148,7 @@ bool SoapySDRInput::openDevice()
|
||||
{
|
||||
qDebug("SoapySDRInput::openDevice: open device here");
|
||||
DeviceSoapySDR& deviceSoapySDR = DeviceSoapySDR::instance();
|
||||
m_deviceShared.m_device = deviceSoapySDR.openSoapySDR(m_deviceAPI->getSampleSourceSequence());
|
||||
m_deviceShared.m_device = deviceSoapySDR.openSoapySDR(m_deviceAPI->getSamplingDeviceSequence());
|
||||
|
||||
if (!m_deviceShared.m_device)
|
||||
{
|
||||
@@ -398,8 +397,8 @@ SoapySDRInputThread *SoapySDRInput::findThread()
|
||||
SoapySDRInputThread *soapySDRInputThread = 0;
|
||||
|
||||
// find a buddy that has allocated the thread
|
||||
const std::vector<DeviceSourceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceSourceAPI*>::const_iterator it = sourceBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator it = sourceBuddies.begin();
|
||||
|
||||
for (; it != sourceBuddies.end(); ++it)
|
||||
{
|
||||
@@ -425,8 +424,8 @@ SoapySDRInputThread *SoapySDRInput::findThread()
|
||||
|
||||
void SoapySDRInput::moveThreadToBuddy()
|
||||
{
|
||||
const std::vector<DeviceSourceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceSourceAPI*>::const_iterator it = sourceBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator it = sourceBuddies.begin();
|
||||
|
||||
for (; it != sourceBuddies.end(); ++it)
|
||||
{
|
||||
@@ -520,8 +519,8 @@ bool SoapySDRInput::start()
|
||||
}
|
||||
|
||||
// remove old thread address from buddies (reset in all buddies). The address being held only in the owning source.
|
||||
const std::vector<DeviceSourceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceSourceAPI*>::const_iterator it = sourceBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator it = sourceBuddies.begin();
|
||||
|
||||
for (; it != sourceBuddies.end(); ++it) {
|
||||
((DeviceSoapySDRShared*) (*it)->getBuddySharedPtr())->m_source->setThread(0);
|
||||
@@ -605,8 +604,8 @@ void SoapySDRInput::stop()
|
||||
m_thread = 0;
|
||||
|
||||
// remove old thread address from buddies (reset in all buddies)
|
||||
const std::vector<DeviceSourceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceSourceAPI*>::const_iterator it = sourceBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator it = sourceBuddies.begin();
|
||||
|
||||
for (; it != sourceBuddies.end(); ++it) {
|
||||
((DeviceSoapySDRShared*) (*it)->getBuddySharedPtr())->m_source->setThread(0);
|
||||
@@ -654,8 +653,8 @@ void SoapySDRInput::stop()
|
||||
}
|
||||
|
||||
// remove old thread address from buddies (reset in all buddies). The address being held only in the owning source.
|
||||
const std::vector<DeviceSourceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceSourceAPI*>::const_iterator it = sourceBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator it = sourceBuddies.begin();
|
||||
|
||||
for (; it != sourceBuddies.end(); ++it) {
|
||||
((DeviceSoapySDRShared*) (*it)->getBuddySharedPtr())->m_source->setThread(0);
|
||||
@@ -824,14 +823,14 @@ bool SoapySDRInput::handleMessage(const Message& message)
|
||||
|
||||
if (cmd.getStartStop())
|
||||
{
|
||||
if (m_deviceAPI->initAcquisition())
|
||||
if (m_deviceAPI->initDeviceEngine())
|
||||
{
|
||||
m_deviceAPI->startAcquisition();
|
||||
m_deviceAPI->startDeviceEngine();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_deviceAPI->stopAcquisition();
|
||||
m_deviceAPI->stopDeviceEngine();
|
||||
}
|
||||
|
||||
if (m_settings.m_useReverseAPI) {
|
||||
@@ -1275,8 +1274,8 @@ bool SoapySDRInput::applySettings(const SoapySDRInputSettings& settings, bool fo
|
||||
if (forwardChangeToBuddies)
|
||||
{
|
||||
// send to buddies
|
||||
const std::vector<DeviceSourceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
const std::vector<DeviceSinkAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
|
||||
const std::vector<DeviceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
const std::vector<DeviceAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
|
||||
|
||||
for (const auto &itSource : sourceBuddies)
|
||||
{
|
||||
@@ -1286,7 +1285,7 @@ bool SoapySDRInput::applySettings(const SoapySDRInputSettings& settings, bool fo
|
||||
(int) settings.m_fcPos,
|
||||
settings.m_devSampleRate,
|
||||
true);
|
||||
itSource->getSampleSourceInputMessageQueue()->push(report);
|
||||
itSource->getSamplingDeviceInputMessageQueue()->push(report);
|
||||
}
|
||||
|
||||
for (const auto &itSink : sinkBuddies)
|
||||
@@ -1297,28 +1296,28 @@ bool SoapySDRInput::applySettings(const SoapySDRInputSettings& settings, bool fo
|
||||
(int) settings.m_fcPos,
|
||||
settings.m_devSampleRate,
|
||||
true);
|
||||
itSink->getSampleSinkInputMessageQueue()->push(report);
|
||||
itSink->getSamplingDeviceInputMessageQueue()->push(report);
|
||||
}
|
||||
}
|
||||
|
||||
if (deviceArgsChanged)
|
||||
{
|
||||
// send to buddies
|
||||
const std::vector<DeviceSourceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
const std::vector<DeviceSinkAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
|
||||
const std::vector<DeviceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
const std::vector<DeviceAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
|
||||
|
||||
for (const auto &itSource : sourceBuddies)
|
||||
{
|
||||
DeviceSoapySDRShared::MsgReportDeviceArgsChange *report = DeviceSoapySDRShared::MsgReportDeviceArgsChange::create(
|
||||
settings.m_deviceArgSettings);
|
||||
itSource->getSampleSourceInputMessageQueue()->push(report);
|
||||
itSource->getSamplingDeviceInputMessageQueue()->push(report);
|
||||
}
|
||||
|
||||
for (const auto &itSink : sinkBuddies)
|
||||
{
|
||||
DeviceSoapySDRShared::MsgReportDeviceArgsChange *report = DeviceSoapySDRShared::MsgReportDeviceArgsChange::create(
|
||||
settings.m_deviceArgSettings);
|
||||
itSink->getSampleSinkInputMessageQueue()->push(report);
|
||||
itSink->getSamplingDeviceInputMessageQueue()->push(report);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
class QNetworkAccessManager;
|
||||
class QNetworkReply;
|
||||
class DeviceSourceAPI;
|
||||
class DeviceAPI;
|
||||
class SoapySDRInputThread;
|
||||
class FileRecord;
|
||||
|
||||
@@ -138,7 +138,7 @@ public:
|
||||
{ }
|
||||
};
|
||||
|
||||
SoapySDRInput(DeviceSourceAPI *deviceAPI);
|
||||
SoapySDRInput(DeviceAPI *deviceAPI);
|
||||
virtual ~SoapySDRInput();
|
||||
virtual void destroy();
|
||||
|
||||
@@ -204,7 +204,7 @@ public:
|
||||
QString& errorMessage);
|
||||
|
||||
private:
|
||||
DeviceSourceAPI *m_deviceAPI;
|
||||
DeviceAPI *m_deviceAPI;
|
||||
QMutex m_mutex;
|
||||
SoapySDRInputSettings m_settings;
|
||||
QString m_deviceDescription;
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#include "dsp/dspengine.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "device/devicesourceapi.h"
|
||||
#include "device/deviceapi.h"
|
||||
#include "device/deviceuiset.h"
|
||||
#include "util/simpleserializer.h"
|
||||
#include "gui/glspectrum.h"
|
||||
@@ -47,7 +47,7 @@ SoapySDRInputGui::SoapySDRInputGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
m_sampleSource(0),
|
||||
m_sampleRate(0),
|
||||
m_deviceCenterFrequency(0),
|
||||
m_lastEngineState(DSPDeviceSourceEngine::StNotStarted),
|
||||
m_lastEngineState(DeviceAPI::StNotStarted),
|
||||
m_antennas(0),
|
||||
m_sampleRateGUI(0),
|
||||
m_bandwidthGUI(0),
|
||||
@@ -58,7 +58,7 @@ SoapySDRInputGui::SoapySDRInputGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
m_autoDCCorrection(0),
|
||||
m_autoIQCorrection(0)
|
||||
{
|
||||
m_sampleSource = (SoapySDRInput*) m_deviceUISet->m_deviceSourceAPI->getSampleSource();
|
||||
m_sampleSource = (SoapySDRInput*) m_deviceUISet->m_deviceAPI->getSampleSource();
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
||||
@@ -905,24 +905,24 @@ void SoapySDRInputGui::updateHardware()
|
||||
|
||||
void SoapySDRInputGui::updateStatus()
|
||||
{
|
||||
int state = m_deviceUISet->m_deviceSourceAPI->state();
|
||||
int state = m_deviceUISet->m_deviceAPI->state();
|
||||
|
||||
if(m_lastEngineState != state)
|
||||
{
|
||||
switch(state)
|
||||
{
|
||||
case DSPDeviceSourceEngine::StNotStarted:
|
||||
case DeviceAPI::StNotStarted:
|
||||
ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StIdle:
|
||||
case DeviceAPI::StIdle:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StRunning:
|
||||
case DeviceAPI::StRunning:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StError:
|
||||
case DeviceAPI::StError:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
||||
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceSourceAPI->errorMessage());
|
||||
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -116,7 +116,7 @@ PluginInstanceGUI* SoapySDRInputPlugin::createSampleSourcePluginInstanceGUI(
|
||||
}
|
||||
#endif
|
||||
|
||||
DeviceSampleSource *SoapySDRInputPlugin::createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI)
|
||||
DeviceSampleSource *SoapySDRInputPlugin::createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceAPI *deviceAPI)
|
||||
{
|
||||
if (sourceId == m_deviceTypeID)
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "plugin/plugininterface.h"
|
||||
|
||||
class PluginAPI;
|
||||
class DeviceSourceAPI;
|
||||
class DeviceAPI;
|
||||
class DeviceUISet;
|
||||
|
||||
#define SOAPYSDRINPUT_DEVICE_TYPE_ID "sdrangel.samplesource.soapysdrinput"
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
const QString& sourceId,
|
||||
QWidget **widget,
|
||||
DeviceUISet *deviceUISet);
|
||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
|
||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceAPI *deviceAPI);
|
||||
|
||||
static const QString m_hardwareID;
|
||||
static const QString m_deviceTypeID;
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#include "mainwindow.h"
|
||||
|
||||
#include "testsourcegui.h"
|
||||
#include <device/devicesourceapi.h>
|
||||
#include "device/deviceapi.h"
|
||||
#include "device/deviceuiset.h"
|
||||
|
||||
TestSourceGui::TestSourceGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
@@ -47,10 +47,10 @@ TestSourceGui::TestSourceGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
m_forceSettings(true),
|
||||
m_sampleSource(0),
|
||||
m_tickCount(0),
|
||||
m_lastEngineState(DSPDeviceSourceEngine::StNotStarted)
|
||||
m_lastEngineState(DeviceAPI::StNotStarted)
|
||||
{
|
||||
qDebug("TestSourceGui::TestSourceGui");
|
||||
m_sampleSource = m_deviceUISet->m_deviceSourceAPI->getSampleSource();
|
||||
m_sampleSource = m_deviceUISet->m_deviceAPI->getSampleSource();
|
||||
|
||||
ui->setupUi(this);
|
||||
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
||||
@@ -430,24 +430,24 @@ void TestSourceGui::updateHardware()
|
||||
|
||||
void TestSourceGui::updateStatus()
|
||||
{
|
||||
int state = m_deviceUISet->m_deviceSourceAPI->state();
|
||||
int state = m_deviceUISet->m_deviceAPI->state();
|
||||
|
||||
if(m_lastEngineState != state)
|
||||
{
|
||||
switch(state)
|
||||
{
|
||||
case DSPDeviceSourceEngine::StNotStarted:
|
||||
case DeviceAPI::StNotStarted:
|
||||
ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StIdle:
|
||||
case DeviceAPI::StIdle:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StRunning:
|
||||
case DeviceAPI::StRunning:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StError:
|
||||
case DeviceAPI::StError:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
||||
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceSourceAPI->errorMessage());
|
||||
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "SWGDeviceState.h"
|
||||
|
||||
#include "testsourceinput.h"
|
||||
#include "device/devicesourceapi.h"
|
||||
#include "device/deviceapi.h"
|
||||
#include "testsourcethread.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/dspengine.h"
|
||||
@@ -38,7 +38,7 @@ MESSAGE_CLASS_DEFINITION(TestSourceInput::MsgFileRecord, Message)
|
||||
MESSAGE_CLASS_DEFINITION(TestSourceInput::MsgStartStop, Message)
|
||||
|
||||
|
||||
TestSourceInput::TestSourceInput(DeviceSourceAPI *deviceAPI) :
|
||||
TestSourceInput::TestSourceInput(DeviceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_settings(),
|
||||
m_testSourceThread(0),
|
||||
@@ -47,7 +47,7 @@ TestSourceInput::TestSourceInput(DeviceSourceAPI *deviceAPI) :
|
||||
m_masterTimer(deviceAPI->getMasterTimer())
|
||||
{
|
||||
m_fileSink = new FileRecord(QString("test_%1.sdriq").arg(m_deviceAPI->getDeviceUID()));
|
||||
m_deviceAPI->addSink(m_fileSink);
|
||||
m_deviceAPI->addAncillarySink(m_fileSink);
|
||||
|
||||
if (!m_sampleFifo.setSize(96000 * 4)) {
|
||||
qCritical("TestSourceInput::TestSourceInput: Could not allocate SampleFifo");
|
||||
@@ -66,7 +66,7 @@ TestSourceInput::~TestSourceInput()
|
||||
stop();
|
||||
}
|
||||
|
||||
m_deviceAPI->removeSink(m_fileSink);
|
||||
m_deviceAPI->removeAncillarySink(m_fileSink);
|
||||
delete m_fileSink;
|
||||
}
|
||||
|
||||
@@ -214,14 +214,14 @@ bool TestSourceInput::handleMessage(const Message& message)
|
||||
|
||||
if (cmd.getStartStop())
|
||||
{
|
||||
if (m_deviceAPI->initAcquisition())
|
||||
if (m_deviceAPI->initDeviceEngine())
|
||||
{
|
||||
m_deviceAPI->startAcquisition();
|
||||
m_deviceAPI->startDeviceEngine();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_deviceAPI->stopAcquisition();
|
||||
m_deviceAPI->stopDeviceEngine();
|
||||
}
|
||||
|
||||
if (m_settings.m_useReverseAPI) {
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include <dsp/devicesamplesource.h>
|
||||
#include "testsourcesettings.h"
|
||||
|
||||
class DeviceSourceAPI;
|
||||
class DeviceAPI;
|
||||
class TestSourceThread;
|
||||
class FileRecord;
|
||||
class QNetworkAccessManager;
|
||||
@@ -96,7 +96,7 @@ public:
|
||||
{ }
|
||||
};
|
||||
|
||||
TestSourceInput(DeviceSourceAPI *deviceAPI);
|
||||
TestSourceInput(DeviceAPI *deviceAPI);
|
||||
virtual ~TestSourceInput();
|
||||
virtual void destroy();
|
||||
|
||||
@@ -136,7 +136,7 @@ public:
|
||||
QString& errorMessage);
|
||||
|
||||
private:
|
||||
DeviceSourceAPI *m_deviceAPI;
|
||||
DeviceAPI *m_deviceAPI;
|
||||
FileRecord *m_fileSink; //!< File sink to record device I/Q output
|
||||
QMutex m_mutex;
|
||||
TestSourceSettings m_settings;
|
||||
|
||||
@@ -97,7 +97,7 @@ PluginInstanceGUI* TestSourcePlugin::createSampleSourcePluginInstanceGUI(
|
||||
}
|
||||
#endif
|
||||
|
||||
DeviceSampleSource *TestSourcePlugin::createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI)
|
||||
DeviceSampleSource *TestSourcePlugin::createSampleSourcePluginInstanceInput(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, DeviceSourceAPI *deviceAPI);
|
||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceAPI *deviceAPI);
|
||||
|
||||
static const QString m_hardwareID;
|
||||
static const QString m_deviceTypeID;
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
#include "SWGDeviceReport.h"
|
||||
#include "SWGXtrxInputReport.h"
|
||||
|
||||
#include "device/devicesourceapi.h"
|
||||
#include "device/devicesinkapi.h"
|
||||
#include "device/deviceapi.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/filerecord.h"
|
||||
#include "xtrxinput.h"
|
||||
@@ -48,7 +47,7 @@ MESSAGE_CLASS_DEFINITION(XTRXInput::MsgReportStreamInfo, Message)
|
||||
MESSAGE_CLASS_DEFINITION(XTRXInput::MsgFileRecord, Message)
|
||||
MESSAGE_CLASS_DEFINITION(XTRXInput::MsgStartStop, Message)
|
||||
|
||||
XTRXInput::XTRXInput(DeviceSourceAPI *deviceAPI) :
|
||||
XTRXInput::XTRXInput(DeviceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_settings(),
|
||||
m_XTRXInputThread(0),
|
||||
@@ -58,7 +57,7 @@ XTRXInput::XTRXInput(DeviceSourceAPI *deviceAPI) :
|
||||
openDevice();
|
||||
|
||||
m_fileSink = new FileRecord(QString("test_%1.sdriq").arg(m_deviceAPI->getDeviceUID()));
|
||||
m_deviceAPI->addSink(m_fileSink);
|
||||
m_deviceAPI->addAncillarySink(m_fileSink);
|
||||
|
||||
m_networkManager = new QNetworkAccessManager();
|
||||
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
@@ -73,7 +72,7 @@ XTRXInput::~XTRXInput()
|
||||
stop();
|
||||
}
|
||||
|
||||
m_deviceAPI->removeSink(m_fileSink);
|
||||
m_deviceAPI->removeAncillarySink(m_fileSink);
|
||||
delete m_fileSink;
|
||||
closeDevice();
|
||||
}
|
||||
@@ -100,7 +99,7 @@ bool XTRXInput::openDevice()
|
||||
{
|
||||
qDebug("XTRXInput::openDevice: look in Rx buddies");
|
||||
|
||||
DeviceSourceAPI *sourceBuddy = m_deviceAPI->getSourceBuddies()[0];
|
||||
DeviceAPI *sourceBuddy = m_deviceAPI->getSourceBuddies()[0];
|
||||
DeviceXTRXShared *deviceXTRXShared = (DeviceXTRXShared*) sourceBuddy->getBuddySharedPtr();
|
||||
|
||||
if (deviceXTRXShared == 0)
|
||||
@@ -124,7 +123,7 @@ bool XTRXInput::openDevice()
|
||||
{
|
||||
qDebug("XTRXInput::openDevice: look in Tx buddies");
|
||||
|
||||
DeviceSinkAPI *sinkBuddy = m_deviceAPI->getSinkBuddies()[0];
|
||||
DeviceAPI *sinkBuddy = m_deviceAPI->getSinkBuddies()[0];
|
||||
DeviceXTRXShared *deviceXTRXShared = (DeviceXTRXShared*) sinkBuddy->getBuddySharedPtr();
|
||||
|
||||
if (deviceXTRXShared == 0)
|
||||
@@ -150,7 +149,7 @@ bool XTRXInput::openDevice()
|
||||
|
||||
m_deviceShared.m_dev = new DeviceXTRX();
|
||||
char serial[256];
|
||||
strcpy(serial, qPrintable(m_deviceAPI->getSampleSourceSerial()));
|
||||
strcpy(serial, qPrintable(m_deviceAPI->getSamplingDeviceSerial()));
|
||||
|
||||
if (!m_deviceShared.m_dev->open(serial))
|
||||
{
|
||||
@@ -204,8 +203,8 @@ XTRXInputThread *XTRXInput::findThread()
|
||||
XTRXInputThread *xtrxInputThread = 0;
|
||||
|
||||
// find a buddy that has allocated the thread
|
||||
const std::vector<DeviceSourceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceSourceAPI*>::const_iterator it = sourceBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator it = sourceBuddies.begin();
|
||||
|
||||
for (; it != sourceBuddies.end(); ++it)
|
||||
{
|
||||
@@ -231,8 +230,8 @@ XTRXInputThread *XTRXInput::findThread()
|
||||
|
||||
void XTRXInput::moveThreadToBuddy()
|
||||
{
|
||||
const std::vector<DeviceSourceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceSourceAPI*>::const_iterator it = sourceBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator it = sourceBuddies.begin();
|
||||
|
||||
for (; it != sourceBuddies.end(); ++it)
|
||||
{
|
||||
@@ -316,8 +315,8 @@ bool XTRXInput::start()
|
||||
}
|
||||
|
||||
// remove old thread address from buddies (reset in all buddies). The address being held only in the owning source.
|
||||
const std::vector<DeviceSourceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceSourceAPI*>::const_iterator it = sourceBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator it = sourceBuddies.begin();
|
||||
|
||||
for (; it != sourceBuddies.end(); ++it)
|
||||
{
|
||||
@@ -396,8 +395,8 @@ void XTRXInput::stop()
|
||||
m_deviceShared.m_thread = 0;
|
||||
|
||||
// remove old thread address from buddies (reset in all buddies)
|
||||
const std::vector<DeviceSourceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceSourceAPI*>::const_iterator it = sourceBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator it = sourceBuddies.begin();
|
||||
|
||||
for (; it != sourceBuddies.end(); ++it)
|
||||
{
|
||||
@@ -418,8 +417,8 @@ void XTRXInput::stop()
|
||||
xtrxInputThread->setLog2Decimation(requestedChannel, m_settings.m_log2SoftDecim);
|
||||
|
||||
// remove old thread address from buddies (reset in all buddies). The address being held only in the owning source.
|
||||
const std::vector<DeviceSourceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceSourceAPI*>::const_iterator it = sourceBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator it = sourceBuddies.begin();
|
||||
|
||||
for (; it != sourceBuddies.end(); ++it)
|
||||
{
|
||||
@@ -436,8 +435,8 @@ void XTRXInput::stop()
|
||||
|
||||
void XTRXInput::suspendTxThread()
|
||||
{
|
||||
const std::vector<DeviceSinkAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
|
||||
std::vector<DeviceSinkAPI*>::const_iterator itSink = sinkBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator itSink = sinkBuddies.begin();
|
||||
|
||||
qDebug("XTRXInput::suspendTxThread (%lu)", sinkBuddies.size());
|
||||
|
||||
@@ -459,8 +458,8 @@ void XTRXInput::suspendTxThread()
|
||||
|
||||
void XTRXInput::resumeTxThread()
|
||||
{
|
||||
const std::vector<DeviceSinkAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
|
||||
std::vector<DeviceSinkAPI*>::const_iterator itSink = sinkBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator itSink = sinkBuddies.begin();
|
||||
|
||||
qDebug("XTRXInput::resumeTxThread (%lu)", sinkBuddies.size());
|
||||
|
||||
@@ -674,7 +673,7 @@ bool XTRXInput::handleMessage(const Message& message)
|
||||
}
|
||||
else if (MsgGetStreamInfo::match(message))
|
||||
{
|
||||
if (m_deviceAPI->getSampleSourceGUIMessageQueue())
|
||||
if (m_deviceAPI->getSamplingDeviceGUIMessageQueue())
|
||||
{
|
||||
uint64_t fifolevel = 0;
|
||||
|
||||
@@ -688,8 +687,8 @@ bool XTRXInput::handleMessage(const Message& message)
|
||||
fifolevel,
|
||||
65536);
|
||||
|
||||
if (m_deviceAPI->getSampleSourceGUIMessageQueue()) {
|
||||
m_deviceAPI->getSampleSourceGUIMessageQueue()->push(report);
|
||||
if (m_deviceAPI->getSamplingDeviceGUIMessageQueue()) {
|
||||
m_deviceAPI->getSamplingDeviceGUIMessageQueue()->push(report);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -711,35 +710,35 @@ bool XTRXInput::handleMessage(const Message& message)
|
||||
}
|
||||
|
||||
// send to oneself
|
||||
if (m_deviceAPI->getSampleSourceGUIMessageQueue())
|
||||
if (m_deviceAPI->getSamplingDeviceGUIMessageQueue())
|
||||
{
|
||||
DeviceXTRXShared::MsgReportDeviceInfo *report = DeviceXTRXShared::MsgReportDeviceInfo::create(board_temp, gps_locked);
|
||||
m_deviceAPI->getSampleSourceGUIMessageQueue()->push(report);
|
||||
m_deviceAPI->getSamplingDeviceGUIMessageQueue()->push(report);
|
||||
}
|
||||
|
||||
// send to source buddies
|
||||
const std::vector<DeviceSourceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceSourceAPI*>::const_iterator itSource = sourceBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator itSource = sourceBuddies.begin();
|
||||
|
||||
for (; itSource != sourceBuddies.end(); ++itSource)
|
||||
{
|
||||
if ((*itSource)->getSampleSourceGUIMessageQueue())
|
||||
if ((*itSource)->getSamplingDeviceGUIMessageQueue())
|
||||
{
|
||||
DeviceXTRXShared::MsgReportDeviceInfo *report = DeviceXTRXShared::MsgReportDeviceInfo::create(board_temp, gps_locked);
|
||||
(*itSource)->getSampleSourceGUIMessageQueue()->push(report);
|
||||
(*itSource)->getSamplingDeviceGUIMessageQueue()->push(report);
|
||||
}
|
||||
}
|
||||
|
||||
// send to sink buddies
|
||||
const std::vector<DeviceSinkAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
|
||||
std::vector<DeviceSinkAPI*>::const_iterator itSink = sinkBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator itSink = sinkBuddies.begin();
|
||||
|
||||
for (; itSink != sinkBuddies.end(); ++itSink)
|
||||
{
|
||||
if ((*itSink)->getSampleSinkGUIMessageQueue())
|
||||
if ((*itSink)->getSamplingDeviceGUIMessageQueue())
|
||||
{
|
||||
DeviceXTRXShared::MsgReportDeviceInfo *report = DeviceXTRXShared::MsgReportDeviceInfo::create(board_temp, gps_locked);
|
||||
(*itSink)->getSampleSinkGUIMessageQueue()->push(report);
|
||||
(*itSink)->getSamplingDeviceGUIMessageQueue()->push(report);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -765,14 +764,14 @@ bool XTRXInput::handleMessage(const Message& message)
|
||||
|
||||
if (cmd.getStartStop())
|
||||
{
|
||||
if (m_deviceAPI->initAcquisition())
|
||||
if (m_deviceAPI->initDeviceEngine())
|
||||
{
|
||||
m_deviceAPI->startAcquisition();
|
||||
m_deviceAPI->startDeviceEngine();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_deviceAPI->stopAcquisition();
|
||||
m_deviceAPI->stopDeviceEngine();
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -1230,25 +1229,25 @@ bool XTRXInput::applySettings(const XTRXInputSettings& settings, bool force, boo
|
||||
}
|
||||
|
||||
// send to source buddies
|
||||
const std::vector<DeviceSourceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceSourceAPI*>::const_iterator itSource = sourceBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator itSource = sourceBuddies.begin();
|
||||
|
||||
for (; itSource != sourceBuddies.end(); ++itSource)
|
||||
{
|
||||
DeviceXTRXShared::MsgReportBuddyChange *report = DeviceXTRXShared::MsgReportBuddyChange::create(
|
||||
getDevSampleRate(), getLog2HardDecim(), m_settings.m_centerFrequency, true);
|
||||
(*itSource)->getSampleSourceInputMessageQueue()->push(report);
|
||||
(*itSource)->getSamplingDeviceInputMessageQueue()->push(report);
|
||||
}
|
||||
|
||||
// send to sink buddies
|
||||
const std::vector<DeviceSinkAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
|
||||
std::vector<DeviceSinkAPI*>::const_iterator itSink = sinkBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator itSink = sinkBuddies.begin();
|
||||
|
||||
for (; itSink != sinkBuddies.end(); ++itSink)
|
||||
{
|
||||
DeviceXTRXShared::MsgReportBuddyChange *report = DeviceXTRXShared::MsgReportBuddyChange::create(
|
||||
getDevSampleRate(), getLog2HardDecim(), m_settings.m_centerFrequency, true);
|
||||
(*itSink)->getSampleSinkInputMessageQueue()->push(report);
|
||||
(*itSink)->getSamplingDeviceInputMessageQueue()->push(report);
|
||||
}
|
||||
}
|
||||
else if (forwardChangeRxDSP)
|
||||
@@ -1268,14 +1267,14 @@ bool XTRXInput::applySettings(const XTRXInputSettings& settings, bool force, boo
|
||||
}
|
||||
|
||||
// send to source buddies
|
||||
const std::vector<DeviceSourceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceSourceAPI*>::const_iterator itSource = sourceBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator itSource = sourceBuddies.begin();
|
||||
|
||||
for (; itSource != sourceBuddies.end(); ++itSource)
|
||||
{
|
||||
DeviceXTRXShared::MsgReportBuddyChange *report = DeviceXTRXShared::MsgReportBuddyChange::create(
|
||||
getDevSampleRate(), getLog2HardDecim(), m_settings.m_centerFrequency, true);
|
||||
(*itSource)->getSampleSourceInputMessageQueue()->push(report);
|
||||
(*itSource)->getSamplingDeviceInputMessageQueue()->push(report);
|
||||
}
|
||||
}
|
||||
else if (forwardChangeOwnDSP)
|
||||
@@ -1298,25 +1297,25 @@ bool XTRXInput::applySettings(const XTRXInputSettings& settings, bool force, boo
|
||||
if (forwardClockSource)
|
||||
{
|
||||
// send to source buddies
|
||||
const std::vector<DeviceSourceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceSourceAPI*>::const_iterator itSource = sourceBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator itSource = sourceBuddies.begin();
|
||||
|
||||
for (; itSource != sourceBuddies.end(); ++itSource)
|
||||
{
|
||||
DeviceXTRXShared::MsgReportClockSourceChange *report = DeviceXTRXShared::MsgReportClockSourceChange::create(
|
||||
m_settings.m_extClock, m_settings.m_extClockFreq);
|
||||
(*itSource)->getSampleSourceInputMessageQueue()->push(report);
|
||||
(*itSource)->getSamplingDeviceInputMessageQueue()->push(report);
|
||||
}
|
||||
|
||||
// send to sink buddies
|
||||
const std::vector<DeviceSinkAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
|
||||
std::vector<DeviceSinkAPI*>::const_iterator itSink = sinkBuddies.begin();
|
||||
const std::vector<DeviceAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
|
||||
std::vector<DeviceAPI*>::const_iterator itSink = sinkBuddies.begin();
|
||||
|
||||
for (; itSink != sinkBuddies.end(); ++itSink)
|
||||
{
|
||||
DeviceXTRXShared::MsgReportClockSourceChange *report = DeviceXTRXShared::MsgReportClockSourceChange::create(
|
||||
m_settings.m_extClock, m_settings.m_extClockFreq);
|
||||
(*itSink)->getSampleSinkInputMessageQueue()->push(report);
|
||||
(*itSink)->getSamplingDeviceInputMessageQueue()->push(report);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
class QNetworkAccessManager;
|
||||
class QNetworkReply;
|
||||
class DeviceSourceAPI;
|
||||
class DeviceAPI;
|
||||
class XTRXInputThread;
|
||||
struct DeviceXTRXParams;
|
||||
class FileRecord;
|
||||
@@ -190,7 +190,7 @@ public:
|
||||
{ }
|
||||
};
|
||||
|
||||
XTRXInput(DeviceSourceAPI *deviceAPI);
|
||||
XTRXInput(DeviceAPI *deviceAPI);
|
||||
virtual ~XTRXInput();
|
||||
virtual void destroy();
|
||||
|
||||
@@ -249,7 +249,7 @@ public:
|
||||
void apply_gain_pga(double gain);
|
||||
|
||||
private:
|
||||
DeviceSourceAPI *m_deviceAPI;
|
||||
DeviceAPI *m_deviceAPI;
|
||||
QMutex m_mutex;
|
||||
XTRXInputSettings m_settings;
|
||||
XTRXInputThread* m_XTRXInputThread;
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include "gui/basicdevicesettingsdialog.h"
|
||||
#include "dsp/dspengine.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "device/devicesourceapi.h"
|
||||
#include "device/deviceapi.h"
|
||||
#include "device/deviceuiset.h"
|
||||
|
||||
XTRXInputGUI::XTRXInputGUI(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
@@ -40,13 +40,13 @@ XTRXInputGUI::XTRXInputGUI(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
m_settings(),
|
||||
m_sampleRateMode(true),
|
||||
m_sampleRate(0),
|
||||
m_lastEngineState((DSPDeviceSourceEngine::State)-1),
|
||||
m_lastEngineState(DeviceAPI::StNotStarted),
|
||||
m_doApplySettings(true),
|
||||
m_forceSettings(true),
|
||||
m_statusCounter(0),
|
||||
m_deviceStatusCounter(0)
|
||||
{
|
||||
m_XTRXInput = (XTRXInput*) m_deviceUISet->m_deviceSourceAPI->getSampleSource();
|
||||
m_XTRXInput = (XTRXInput*) m_deviceUISet->m_deviceAPI->getSampleSource();
|
||||
|
||||
ui->setupUi(this);
|
||||
|
||||
@@ -424,24 +424,24 @@ void XTRXInputGUI::updateHardware()
|
||||
|
||||
void XTRXInputGUI::updateStatus()
|
||||
{
|
||||
int state = m_deviceUISet->m_deviceSourceAPI->state();
|
||||
int state = m_deviceUISet->m_deviceAPI->state();
|
||||
|
||||
if(m_lastEngineState != state)
|
||||
{
|
||||
switch(state)
|
||||
{
|
||||
case DSPDeviceSourceEngine::StNotStarted:
|
||||
case DeviceAPI::StNotStarted:
|
||||
ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StIdle:
|
||||
case DeviceAPI::StIdle:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StRunning:
|
||||
case DeviceAPI::StRunning:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StError:
|
||||
case DeviceAPI::StError:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
||||
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceSourceAPI->errorMessage());
|
||||
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -467,7 +467,7 @@ void XTRXInputGUI::updateStatus()
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_deviceUISet->m_deviceSourceAPI->isBuddyLeader())
|
||||
if (m_deviceUISet->m_deviceAPI->isBuddyLeader())
|
||||
{
|
||||
XTRXInput::MsgGetDeviceInfo* message = XTRXInput::MsgGetDeviceInfo::create();
|
||||
m_XTRXInput->getInputMessageQueue()->push(message);
|
||||
|
||||
@@ -114,7 +114,7 @@ PluginInstanceGUI* XTRXInputPlugin::createSampleSourcePluginInstanceGUI(
|
||||
}
|
||||
#endif
|
||||
|
||||
DeviceSampleSource *XTRXInputPlugin::createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI)
|
||||
DeviceSampleSource *XTRXInputPlugin::createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceAPI *deviceAPI)
|
||||
{
|
||||
if (sourceId == m_deviceTypeID)
|
||||
{
|
||||
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
const QString& sourceId,
|
||||
QWidget **widget,
|
||||
DeviceUISet *deviceUISet);
|
||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
|
||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceAPI *deviceAPI);
|
||||
|
||||
static const QString m_hardwareID;
|
||||
static const QString m_deviceTypeID;
|
||||
|
||||
Reference in New Issue
Block a user