mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-15 21:01:45 -05:00
RTLSDR: fixed gains retrieval in the GUI
This commit is contained in:
parent
cad5f92dd6
commit
30fa25c67b
3
debian/changelog
vendored
3
debian/changelog
vendored
@ -1,8 +1,9 @@
|
|||||||
sdrangel (3.7.2-1) unstable; urgency=medium
|
sdrangel (3.7.2-1) unstable; urgency=medium
|
||||||
|
|
||||||
* PlutoSDR: Remove from device enumeration if device is not accessible
|
* PlutoSDR: Remove from device enumeration if device is not accessible
|
||||||
|
* RTLSDR: Fixed gains retrieval in the GUI
|
||||||
|
|
||||||
-- Edouard Griffiths, F4EXB <f4exb06@gmail.com> Sun, 01 Oct 2017 21:14:18 +0200
|
-- Edouard Griffiths, F4EXB <f4exb06@gmail.com> Sat, 23 Sep 2017 05:14:18 +0200
|
||||||
|
|
||||||
sdrangel (3.7.1-1) unstable; urgency=medium
|
sdrangel (3.7.1-1) unstable; urgency=medium
|
||||||
|
|
||||||
|
@ -52,8 +52,6 @@ RTLSDRGui::RTLSDRGui(DeviceSourceAPI *deviceAPI, QWidget* parent) :
|
|||||||
displaySettings();
|
displaySettings();
|
||||||
|
|
||||||
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection);
|
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection);
|
||||||
|
|
||||||
queryDeviceReport(); // will reply with MsgReportRTLSDR to report gain list
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RTLSDRGui::~RTLSDRGui()
|
RTLSDRGui::~RTLSDRGui()
|
||||||
@ -132,7 +130,6 @@ bool RTLSDRGui::handleMessage(const Message& message)
|
|||||||
{
|
{
|
||||||
if (RTLSDRInput::MsgReportRTLSDR::match(message))
|
if (RTLSDRInput::MsgReportRTLSDR::match(message))
|
||||||
{
|
{
|
||||||
qDebug() << "RTLSDRGui::handleMessage: MsgReportRTLSDR";
|
|
||||||
m_gains = ((RTLSDRInput::MsgReportRTLSDR&) message).getGains();
|
m_gains = ((RTLSDRInput::MsgReportRTLSDR&) message).getGains();
|
||||||
displayGains();
|
displayGains();
|
||||||
return true;
|
return true;
|
||||||
@ -319,12 +316,6 @@ void RTLSDRGui::on_record_toggled(bool checked)
|
|||||||
m_sampleSource->getInputMessageQueue()->push(message);
|
m_sampleSource->getInputMessageQueue()->push(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RTLSDRGui::queryDeviceReport()
|
|
||||||
{
|
|
||||||
RTLSDRInput::MsgQueryRTLSDR* message = RTLSDRInput::MsgQueryRTLSDR::create();
|
|
||||||
m_sampleSource->getInputMessageQueue()->push(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
void RTLSDRGui::updateHardware()
|
void RTLSDRGui::updateHardware()
|
||||||
{
|
{
|
||||||
RTLSDRInput::MsgConfigureRTLSDR* message = RTLSDRInput::MsgConfigureRTLSDR::create(m_settings);
|
RTLSDRInput::MsgConfigureRTLSDR* message = RTLSDRInput::MsgConfigureRTLSDR::create(m_settings);
|
||||||
|
@ -65,7 +65,6 @@ private:
|
|||||||
int m_lastEngineState;
|
int m_lastEngineState;
|
||||||
MessageQueue m_inputMessageQueue;
|
MessageQueue m_inputMessageQueue;
|
||||||
|
|
||||||
void queryDeviceReport();
|
|
||||||
void displayGains();
|
void displayGains();
|
||||||
void displaySettings();
|
void displaySettings();
|
||||||
void sendSettings();
|
void sendSettings();
|
||||||
|
@ -29,7 +29,6 @@
|
|||||||
#include "dsp/filerecord.h"
|
#include "dsp/filerecord.h"
|
||||||
|
|
||||||
MESSAGE_CLASS_DEFINITION(RTLSDRInput::MsgConfigureRTLSDR, Message)
|
MESSAGE_CLASS_DEFINITION(RTLSDRInput::MsgConfigureRTLSDR, Message)
|
||||||
MESSAGE_CLASS_DEFINITION(RTLSDRInput::MsgQueryRTLSDR, Message)
|
|
||||||
MESSAGE_CLASS_DEFINITION(RTLSDRInput::MsgReportRTLSDR, Message)
|
MESSAGE_CLASS_DEFINITION(RTLSDRInput::MsgReportRTLSDR, Message)
|
||||||
MESSAGE_CLASS_DEFINITION(RTLSDRInput::MsgFileRecord, Message)
|
MESSAGE_CLASS_DEFINITION(RTLSDRInput::MsgFileRecord, Message)
|
||||||
|
|
||||||
@ -250,19 +249,6 @@ bool RTLSDRInput::handleMessage(const Message& message)
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (MsgQueryRTLSDR::match(message))
|
|
||||||
{
|
|
||||||
//MsgQueryRTLSDR& conf = (MsgQueryRTLSDR&) message;
|
|
||||||
qDebug() << "RTLSDRInput::handleMessage: MsgQueryRTLSDR";
|
|
||||||
|
|
||||||
MsgReportRTLSDR *message = MsgReportRTLSDR::create(m_gains);
|
|
||||||
|
|
||||||
if (getMessageQueueToGUI()) {
|
|
||||||
getMessageQueueToGUI()->push(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else if (MsgFileRecord::match(message))
|
else if (MsgFileRecord::match(message))
|
||||||
{
|
{
|
||||||
MsgFileRecord& conf = (MsgFileRecord&) message;
|
MsgFileRecord& conf = (MsgFileRecord&) message;
|
||||||
@ -436,6 +422,17 @@ bool RTLSDRInput::applySettings(const RTLSDRSettings& settings, bool force)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RTLSDRInput::setMessageQueueToGUI(MessageQueue *queue)
|
||||||
|
{
|
||||||
|
qDebug("RTLSDRInput::setMessageQueueToGUI: %p", queue);
|
||||||
|
DeviceSampleSource::setMessageQueueToGUI(queue);
|
||||||
|
|
||||||
|
if (queue) {
|
||||||
|
MsgReportRTLSDR *message = MsgReportRTLSDR::create(m_gains);
|
||||||
|
queue->push(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void RTLSDRInput::set_ds_mode(int on)
|
void RTLSDRInput::set_ds_mode(int on)
|
||||||
{
|
{
|
||||||
rtlsdr_set_direct_sampling(m_dev, on);
|
rtlsdr_set_direct_sampling(m_dev, on);
|
||||||
|
@ -50,21 +50,6 @@ public:
|
|||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
class MsgQueryRTLSDR : public Message {
|
|
||||||
MESSAGE_CLASS_DECLARATION
|
|
||||||
|
|
||||||
public:
|
|
||||||
static MsgQueryRTLSDR* create()
|
|
||||||
{
|
|
||||||
return new MsgQueryRTLSDR();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
|
||||||
MsgQueryRTLSDR() :
|
|
||||||
Message()
|
|
||||||
{ }
|
|
||||||
};
|
|
||||||
|
|
||||||
class MsgReportRTLSDR : public Message {
|
class MsgReportRTLSDR : public Message {
|
||||||
MESSAGE_CLASS_DECLARATION
|
MESSAGE_CLASS_DECLARATION
|
||||||
|
|
||||||
@ -116,6 +101,7 @@ public:
|
|||||||
virtual quint64 getCenterFrequency() const;
|
virtual quint64 getCenterFrequency() const;
|
||||||
|
|
||||||
virtual bool handleMessage(const Message& message);
|
virtual bool handleMessage(const Message& message);
|
||||||
|
virtual void setMessageQueueToGUI(MessageQueue *queue);
|
||||||
|
|
||||||
const std::vector<int>& getGains() const { return m_gains; }
|
const std::vector<int>& getGains() const { return m_gains; }
|
||||||
void set_ds_mode(int on);
|
void set_ds_mode(int on);
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
const PluginDescriptor RTLSDRPlugin::m_pluginDescriptor = {
|
const PluginDescriptor RTLSDRPlugin::m_pluginDescriptor = {
|
||||||
QString("RTL-SDR Input"),
|
QString("RTL-SDR Input"),
|
||||||
QString("3.5.2"),
|
QString("3.7.2"),
|
||||||
QString("(c) Edouard Griffiths, F4EXB"),
|
QString("(c) Edouard Griffiths, F4EXB"),
|
||||||
QString("https://github.com/f4exb/sdrangel"),
|
QString("https://github.com/f4exb/sdrangel"),
|
||||||
true,
|
true,
|
||||||
|
@ -318,7 +318,7 @@ public:
|
|||||||
|
|
||||||
virtual bool handleMessage(const Message& message);
|
virtual bool handleMessage(const Message& message);
|
||||||
|
|
||||||
void setMessageQueueToGUI(MessageQueue *queue);
|
virtual void setMessageQueueToGUI(MessageQueue *queue);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DeviceSourceAPI *m_deviceAPI;
|
DeviceSourceAPI *m_deviceAPI;
|
||||||
|
@ -42,7 +42,7 @@ public:
|
|||||||
virtual bool handleMessage(const Message& message) = 0;
|
virtual bool handleMessage(const Message& message) = 0;
|
||||||
|
|
||||||
MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
|
MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
|
||||||
void setMessageQueueToGUI(MessageQueue *queue) { m_guiMessageQueue = queue; }
|
virtual void setMessageQueueToGUI(MessageQueue *queue) { m_guiMessageQueue = queue; }
|
||||||
MessageQueue *getMessageQueueToGUI() { return m_guiMessageQueue; }
|
MessageQueue *getMessageQueueToGUI() { return m_guiMessageQueue; }
|
||||||
SampleSinkFifo* getSampleFifo() { return &m_sampleFifo; }
|
SampleSinkFifo* getSampleFifo() { return &m_sampleFifo; }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user