mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-26 17:58:43 -05:00
LimeSDR output: force settings at startup and on deserialize
This commit is contained in:
parent
402f733384
commit
ccd2e04f0b
@ -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<<settings.m_log2SoftInterp)) * DeviceLimeSDRShared::m_sampleFifoLengthInSeconds),
|
||||
DeviceLimeSDRShared::m_sampleFifoMinSize);
|
||||
qDebug("LimeSDROutput::applySettings: resize FIFO: %d", fifoSize);
|
||||
m_sampleSourceFifo.resize(fifoSize);
|
||||
}
|
||||
|
||||
|
@ -36,18 +36,21 @@ public:
|
||||
|
||||
public:
|
||||
const LimeSDROutputSettings& getSettings() const { return m_settings; }
|
||||
bool getForce() const { return m_force; }
|
||||
|
||||
static MsgConfigureLimeSDR* create(const LimeSDROutputSettings& settings)
|
||||
static MsgConfigureLimeSDR* create(const LimeSDROutputSettings& settings, bool force)
|
||||
{
|
||||
return new MsgConfigureLimeSDR(settings);
|
||||
return new MsgConfigureLimeSDR(settings, force);
|
||||
}
|
||||
|
||||
private:
|
||||
LimeSDROutputSettings m_settings;
|
||||
bool m_force;
|
||||
|
||||
MsgConfigureLimeSDR(const LimeSDROutputSettings& settings) :
|
||||
MsgConfigureLimeSDR(const LimeSDROutputSettings& settings, bool force) :
|
||||
Message(),
|
||||
m_settings(settings)
|
||||
m_settings(settings),
|
||||
m_force(force)
|
||||
{ }
|
||||
};
|
||||
|
||||
@ -215,7 +218,6 @@ private:
|
||||
QString m_deviceDescription;
|
||||
bool m_running;
|
||||
DeviceLimeSDRShared m_deviceShared;
|
||||
bool m_firstConfig;
|
||||
bool m_channelAcquired;
|
||||
|
||||
lms_stream_t m_streamId;
|
||||
|
@ -33,6 +33,7 @@ LimeSDROutputGUI::LimeSDROutputGUI(DeviceSinkAPI *deviceAPI, QWidget* parent) :
|
||||
m_sampleRate(0),
|
||||
m_lastEngineState((DSPDeviceSinkEngine::State)-1),
|
||||
m_doApplySettings(true),
|
||||
m_forceSettings(true),
|
||||
m_statusCounter(0),
|
||||
m_deviceStatusCounter(0)
|
||||
{
|
||||
@ -74,6 +75,8 @@ LimeSDROutputGUI::LimeSDROutputGUI(DeviceSinkAPI *deviceAPI, QWidget* parent) :
|
||||
sprintf(recFileNameCStr, "test_%d.sdriq", m_deviceAPI->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();
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user