mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-16 05:11:49 -05:00
LimeSDR input: force settings at startup and on deserialize
This commit is contained in:
parent
f31032426a
commit
44d4acc3e6
@ -42,8 +42,7 @@ LimeSDRInput::LimeSDRInput(DeviceSourceAPI *deviceAPI) :
|
||||
m_settings(),
|
||||
m_limeSDRInputThread(0),
|
||||
m_deviceDescription("LimeSDRInput"),
|
||||
m_running(false),
|
||||
m_firstConfig(true)
|
||||
m_running(false)
|
||||
{
|
||||
m_streamId.handle = 0;
|
||||
suspendRxBuddies();
|
||||
@ -421,14 +420,10 @@ bool LimeSDRInput::handleMessage(const Message& message)
|
||||
MsgConfigureLimeSDR& conf = (MsgConfigureLimeSDR&) message;
|
||||
qDebug() << "LimeSDRInput::handleMessage: MsgConfigureLimeSDR";
|
||||
|
||||
if (!applySettings(conf.getSettings(), m_firstConfig))
|
||||
if (!applySettings(conf.getSettings(), conf.getForce()))
|
||||
{
|
||||
qDebug("LimeSDRInput::handleMessage config error");
|
||||
}
|
||||
else
|
||||
{
|
||||
m_firstConfig = false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -37,18 +37,21 @@ public:
|
||||
|
||||
public:
|
||||
const LimeSDRInputSettings& getSettings() const { return m_settings; }
|
||||
bool getForce() const { return m_force; }
|
||||
|
||||
static MsgConfigureLimeSDR* create(const LimeSDRInputSettings& settings)
|
||||
static MsgConfigureLimeSDR* create(const LimeSDRInputSettings& settings, bool force)
|
||||
{
|
||||
return new MsgConfigureLimeSDR(settings);
|
||||
return new MsgConfigureLimeSDR(settings, force);
|
||||
}
|
||||
|
||||
private:
|
||||
LimeSDRInputSettings m_settings;
|
||||
bool m_force;
|
||||
|
||||
MsgConfigureLimeSDR(const LimeSDRInputSettings& settings) :
|
||||
MsgConfigureLimeSDR(const LimeSDRInputSettings& settings, bool force) :
|
||||
Message(),
|
||||
m_settings(settings)
|
||||
m_settings(settings),
|
||||
m_force(force)
|
||||
{ }
|
||||
};
|
||||
|
||||
@ -235,7 +238,6 @@ private:
|
||||
QString m_deviceDescription;
|
||||
bool m_running;
|
||||
DeviceLimeSDRShared m_deviceShared;
|
||||
bool m_firstConfig;
|
||||
lms_stream_t m_streamId;
|
||||
FileRecord *m_fileSink; //!< File sink to record device I/Q output
|
||||
|
||||
|
@ -36,6 +36,7 @@ LimeSDRInputGUI::LimeSDRInputGUI(DeviceSourceAPI *deviceAPI, QWidget* parent) :
|
||||
m_sampleRate(0),
|
||||
m_lastEngineState((DSPDeviceSourceEngine::State)-1),
|
||||
m_doApplySettings(true),
|
||||
m_forceSettings(true),
|
||||
m_statusCounter(0),
|
||||
m_deviceStatusCounter(0)
|
||||
{
|
||||
@ -125,6 +126,7 @@ bool LimeSDRInputGUI::deserialize(const QByteArray& data)
|
||||
if (m_settings.deserialize(data))
|
||||
{
|
||||
displaySettings();
|
||||
m_forceSettings = true;
|
||||
sendSettings();
|
||||
return true;
|
||||
}
|
||||
@ -324,8 +326,9 @@ void LimeSDRInputGUI::updateHardware()
|
||||
if (m_doApplySettings)
|
||||
{
|
||||
qDebug() << "LimeSDRInputGUI::updateHardware";
|
||||
LimeSDRInput::MsgConfigureLimeSDR* message = LimeSDRInput::MsgConfigureLimeSDR::create(m_settings);
|
||||
LimeSDRInput::MsgConfigureLimeSDR* message = LimeSDRInput::MsgConfigureLimeSDR::create(m_settings, m_forceSettings);
|
||||
m_limeSDRInput->getInputMessageQueue()->push(message);
|
||||
m_forceSettings = false;
|
||||
m_updateTimer.stop();
|
||||
}
|
||||
}
|
||||
|
@ -62,6 +62,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;
|
||||
|
@ -31,7 +31,7 @@
|
||||
|
||||
const PluginDescriptor LimeSDRInputPlugin::m_pluginDescriptor = {
|
||||
QString("LimeSDR Input"),
|
||||
QString("3.5.4"),
|
||||
QString("3.7.4"),
|
||||
QString("(c) Edouard Griffiths, F4EXB"),
|
||||
QString("https://github.com/f4exb/sdrangel"),
|
||||
true,
|
||||
|
Loading…
Reference in New Issue
Block a user