mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-07-03 17:35:23 -04:00
Airspy: cosmetic changes
This commit is contained in:
parent
7dfa9cb907
commit
dd12338635
@ -24,8 +24,6 @@
|
|||||||
#include "util/messagequeue.h"
|
#include "util/messagequeue.h"
|
||||||
#include "airspyinput.h"
|
#include "airspyinput.h"
|
||||||
|
|
||||||
#define AIRSPY_MAX_DEVICE (32)
|
|
||||||
|
|
||||||
class DeviceUISet;
|
class DeviceUISet;
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
#include "airspygui.h"
|
#include "airspygui.h"
|
||||||
#include "airspyinput.h"
|
#include "airspyinput.h"
|
||||||
|
#include "airspyplugin.h"
|
||||||
|
|
||||||
#include <device/devicesourceapi.h>
|
#include <device/devicesourceapi.h>
|
||||||
#include <dsp/filerecord.h>
|
#include <dsp/filerecord.h>
|
||||||
@ -282,7 +283,7 @@ bool AirspyInput::handleMessage(const Message& message)
|
|||||||
|
|
||||||
if (!success)
|
if (!success)
|
||||||
{
|
{
|
||||||
qDebug("Airspy config error");
|
qDebug("AirspyInput::handleMessage: Airspy config error");
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -340,7 +341,7 @@ void AirspyInput::setDeviceCenterFrequency(quint64 freq_hz)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
qWarning("AirspyInput::setDeviceCenterFrequency: frequency set to %llu Hz", freq_hz);
|
qDebug("AirspyInput::setDeviceCenterFrequency: frequency set to %llu Hz", freq_hz);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -353,14 +354,10 @@ bool AirspyInput::applySettings(const AirspySettings& settings, bool force)
|
|||||||
|
|
||||||
qDebug() << "AirspyInput::applySettings";
|
qDebug() << "AirspyInput::applySettings";
|
||||||
|
|
||||||
if (m_settings.m_dcBlock != settings.m_dcBlock)
|
if ((m_settings.m_dcBlock != settings.m_dcBlock) ||
|
||||||
{
|
(m_settings.m_iqCorrection != settings.m_iqCorrection) || force)
|
||||||
|
{
|
||||||
m_settings.m_dcBlock = settings.m_dcBlock;
|
m_settings.m_dcBlock = settings.m_dcBlock;
|
||||||
m_deviceAPI->configureCorrections(m_settings.m_dcBlock, m_settings.m_iqCorrection);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_settings.m_iqCorrection != settings.m_iqCorrection)
|
|
||||||
{
|
|
||||||
m_settings.m_iqCorrection = settings.m_iqCorrection;
|
m_settings.m_iqCorrection = settings.m_iqCorrection;
|
||||||
m_deviceAPI->configureCorrections(m_settings.m_dcBlock, m_settings.m_iqCorrection);
|
m_deviceAPI->configureCorrections(m_settings.m_dcBlock, m_settings.m_iqCorrection);
|
||||||
}
|
}
|
||||||
@ -596,15 +593,16 @@ struct airspy_device *AirspyInput::open_airspy_from_sequence(int sequence)
|
|||||||
struct airspy_device *devinfo;
|
struct airspy_device *devinfo;
|
||||||
airspy_error rc = AIRSPY_ERROR_OTHER;
|
airspy_error rc = AIRSPY_ERROR_OTHER;
|
||||||
|
|
||||||
for (int i = 0; i < AIRSPY_MAX_DEVICE; i++)
|
for (int i = 0; i < AirspyPlugin::m_maxDevices; i++)
|
||||||
{
|
{
|
||||||
rc = (airspy_error) airspy_open(&devinfo);
|
rc = (airspy_error) airspy_open(&devinfo);
|
||||||
|
|
||||||
if (rc == AIRSPY_SUCCESS)
|
if (rc == AIRSPY_SUCCESS)
|
||||||
{
|
{
|
||||||
if (i == sequence)
|
if (i == sequence) {
|
||||||
{
|
|
||||||
return devinfo;
|
return devinfo;
|
||||||
|
} else {
|
||||||
|
airspy_close(devinfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -25,6 +25,8 @@
|
|||||||
#include "plugin/pluginapi.h"
|
#include "plugin/pluginapi.h"
|
||||||
#include "util/simpleserializer.h"
|
#include "util/simpleserializer.h"
|
||||||
|
|
||||||
|
const int AirspyPlugin::m_maxDevices = 32;
|
||||||
|
|
||||||
const PluginDescriptor AirspyPlugin::m_pluginDescriptor = {
|
const PluginDescriptor AirspyPlugin::m_pluginDescriptor = {
|
||||||
QString("Airspy Input"),
|
QString("Airspy Input"),
|
||||||
QString("3.9.0"),
|
QString("3.9.0"),
|
||||||
@ -69,7 +71,7 @@ PluginInterface::SamplingDevices AirspyPlugin::enumSampleSources()
|
|||||||
qCritical("AirspyPlugin::enumSampleSources: failed to initiate Airspy library: %s", airspy_error_name(rc));
|
qCritical("AirspyPlugin::enumSampleSources: failed to initiate Airspy library: %s", airspy_error_name(rc));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i=0; i < AIRSPY_MAX_DEVICE; i++)
|
for (i=0; i < m_maxDevices; i++)
|
||||||
{
|
{
|
||||||
rc = (airspy_error) airspy_open(&devinfo);
|
rc = (airspy_error) airspy_open(&devinfo);
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ public:
|
|||||||
|
|
||||||
static const QString m_hardwareID;
|
static const QString m_hardwareID;
|
||||||
static const QString m_deviceTypeID;
|
static const QString m_deviceTypeID;
|
||||||
|
static const int m_maxDevices;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const PluginDescriptor m_pluginDescriptor;
|
static const PluginDescriptor m_pluginDescriptor;
|
||||||
|
@ -84,7 +84,7 @@ void AirspyThread::run()
|
|||||||
|
|
||||||
if (rc != AIRSPY_SUCCESS)
|
if (rc != AIRSPY_SUCCESS)
|
||||||
{
|
{
|
||||||
qCritical("AirspyInput::run: failed to start Airspy Rx: %s", airspy_error_name(rc));
|
qCritical("AirspyThread::run: failed to start Airspy Rx: %s", airspy_error_name(rc));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -98,11 +98,11 @@ void AirspyThread::run()
|
|||||||
|
|
||||||
if (rc == AIRSPY_SUCCESS)
|
if (rc == AIRSPY_SUCCESS)
|
||||||
{
|
{
|
||||||
qDebug("AirspyInput::run: stopped Airspy Rx");
|
qDebug("AirspyThread::run: stopped Airspy Rx");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
qDebug("AirspyInput::run: failed to stop Airspy Rx: %s", airspy_error_name(rc));
|
qDebug("AirspyThread::run: failed to stop Airspy Rx: %s", airspy_error_name(rc));
|
||||||
}
|
}
|
||||||
|
|
||||||
m_running = false;
|
m_running = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user