From ccd2e04f0bceefdeebcad1a34eb222f7856d76f2 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sat, 14 Oct 2017 06:30:31 +0200 Subject: [PATCH] LimeSDR output: force settings at startup and on deserialize --- plugins/samplesink/limesdroutput/limesdroutput.cpp | 8 ++------ plugins/samplesink/limesdroutput/limesdroutput.h | 12 +++++++----- .../samplesink/limesdroutput/limesdroutputgui.cpp | 7 ++++++- plugins/samplesink/limesdroutput/limesdroutputgui.h | 1 + .../samplesink/limesdroutput/limesdroutputplugin.cpp | 2 +- 5 files changed, 17 insertions(+), 13 deletions(-) diff --git a/plugins/samplesink/limesdroutput/limesdroutput.cpp b/plugins/samplesink/limesdroutput/limesdroutput.cpp index 39eabcf5d..94d2a8b7d 100644 --- a/plugins/samplesink/limesdroutput/limesdroutput.cpp +++ b/plugins/samplesink/limesdroutput/limesdroutput.cpp @@ -41,7 +41,6 @@ LimeSDROutput::LimeSDROutput(DeviceSinkAPI *deviceAPI) : m_limeSDROutputThread(0), m_deviceDescription("LimeSDROutput"), m_running(false), - m_firstConfig(true), m_channelAcquired(false) { m_streamId.handle = 0; @@ -435,14 +434,10 @@ bool LimeSDROutput::handleMessage(const Message& message) MsgConfigureLimeSDR& conf = (MsgConfigureLimeSDR&) message; qDebug() << "LimeSDROutput::handleMessage: MsgConfigureLimeSDR"; - if (!applySettings(conf.getSettings(), m_firstConfig)) + if (!applySettings(conf.getSettings(), conf.getForce())) { qDebug("LimeSDROutput::handleMessage config error"); } - else - { - m_firstConfig = false; - } return true; } @@ -693,6 +688,7 @@ bool LimeSDROutput::applySettings(const LimeSDROutputSettings& settings, bool fo int fifoSize = std::max( (int) ((settings.m_devSampleRate/(1<getDeviceUID()); connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection); + + sendSettings(); } LimeSDROutputGUI::~LimeSDROutputGUI() @@ -125,6 +128,7 @@ bool LimeSDROutputGUI::deserialize(const QByteArray& data) if (m_settings.deserialize(data)) { displaySettings(); + m_forceSettings = true; sendSettings(); return true; } @@ -302,8 +306,9 @@ void LimeSDROutputGUI::updateHardware() if (m_doApplySettings) { qDebug() << "LimeSDROutputGUI::updateHardware"; - LimeSDROutput::MsgConfigureLimeSDR* message = LimeSDROutput::MsgConfigureLimeSDR::create(m_settings); + LimeSDROutput::MsgConfigureLimeSDR* message = LimeSDROutput::MsgConfigureLimeSDR::create(m_settings, m_forceSettings); m_limeSDROutput->getInputMessageQueue()->push(message); + m_forceSettings = false; m_updateTimer.stop(); } } diff --git a/plugins/samplesink/limesdroutput/limesdroutputgui.h b/plugins/samplesink/limesdroutput/limesdroutputgui.h index 55ebd4d91..2e34a76de 100644 --- a/plugins/samplesink/limesdroutput/limesdroutputgui.h +++ b/plugins/samplesink/limesdroutput/limesdroutputgui.h @@ -63,6 +63,7 @@ private: quint64 m_deviceCenterFrequency; //!< Center frequency in device int m_lastEngineState; bool m_doApplySettings; + bool m_forceSettings; int m_statusCounter; int m_deviceStatusCounter; MessageQueue m_inputMessageQueue; diff --git a/plugins/samplesink/limesdroutput/limesdroutputplugin.cpp b/plugins/samplesink/limesdroutput/limesdroutputplugin.cpp index 14cbff296..1f5bc466e 100644 --- a/plugins/samplesink/limesdroutput/limesdroutputplugin.cpp +++ b/plugins/samplesink/limesdroutput/limesdroutputplugin.cpp @@ -30,7 +30,7 @@ const PluginDescriptor LimeSDROutputPlugin::m_pluginDescriptor = { QString("LimeSDR Output"), - QString("3.6.0"), + QString("3.7.4"), QString("(c) Edouard Griffiths, F4EXB"), QString("https://github.com/f4exb/sdrangel"), true,