1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 09:48:45 -05:00

Airspy: cosmetic changes

This commit is contained in:
f4exb 2018-01-11 00:17:06 +01:00
parent 7dfa9cb907
commit dd12338635
5 changed files with 17 additions and 18 deletions

View File

@ -24,8 +24,6 @@
#include "util/messagequeue.h"
#include "airspyinput.h"
#define AIRSPY_MAX_DEVICE (32)
class DeviceUISet;
namespace Ui {

View File

@ -23,6 +23,7 @@
#include "airspygui.h"
#include "airspyinput.h"
#include "airspyplugin.h"
#include <device/devicesourceapi.h>
#include <dsp/filerecord.h>
@ -282,7 +283,7 @@ bool AirspyInput::handleMessage(const Message& message)
if (!success)
{
qDebug("Airspy config error");
qDebug("AirspyInput::handleMessage: Airspy config error");
}
return true;
@ -340,7 +341,7 @@ void AirspyInput::setDeviceCenterFrequency(quint64 freq_hz)
}
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";
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_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_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;
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);
if (rc == AIRSPY_SUCCESS)
{
if (i == sequence)
{
if (i == sequence) {
return devinfo;
} else {
airspy_close(devinfo);
}
}
else

View File

@ -25,6 +25,8 @@
#include "plugin/pluginapi.h"
#include "util/simpleserializer.h"
const int AirspyPlugin::m_maxDevices = 32;
const PluginDescriptor AirspyPlugin::m_pluginDescriptor = {
QString("Airspy Input"),
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));
}
for (i=0; i < AIRSPY_MAX_DEVICE; i++)
for (i=0; i < m_maxDevices; i++)
{
rc = (airspy_error) airspy_open(&devinfo);

View File

@ -44,6 +44,7 @@ public:
static const QString m_hardwareID;
static const QString m_deviceTypeID;
static const int m_maxDevices;
private:
static const PluginDescriptor m_pluginDescriptor;

View File

@ -84,7 +84,7 @@ void AirspyThread::run()
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
{
@ -98,11 +98,11 @@ void AirspyThread::run()
if (rc == AIRSPY_SUCCESS)
{
qDebug("AirspyInput::run: stopped Airspy Rx");
qDebug("AirspyThread::run: stopped Airspy Rx");
}
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;