1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-17 23:28:50 -05:00

BladeRF output: force settings at startup and on deserialize

This commit is contained in:
f4exb 2017-10-14 07:10:42 +02:00
parent 9eee869ccd
commit 6b1f0cc2fd
5 changed files with 14 additions and 7 deletions

View File

@ -207,7 +207,7 @@ bool BladerfOutput::handleMessage(const Message& message)
MsgConfigureBladerf& conf = (MsgConfigureBladerf&) message; MsgConfigureBladerf& conf = (MsgConfigureBladerf&) message;
qDebug() << "BladerfInput::handleMessage: MsgConfigureBladerf"; qDebug() << "BladerfInput::handleMessage: MsgConfigureBladerf";
if (!applySettings(conf.getSettings(), false)) if (!applySettings(conf.getSettings(), conf.getForce()))
{ {
qDebug("BladeRF config error"); qDebug("BladeRF config error");
} }

View File

@ -36,18 +36,21 @@ public:
public: public:
const BladeRFOutputSettings& getSettings() const { return m_settings; } const BladeRFOutputSettings& getSettings() const { return m_settings; }
bool getForce() const { return m_force; }
static MsgConfigureBladerf* create(const BladeRFOutputSettings& settings) static MsgConfigureBladerf* create(const BladeRFOutputSettings& settings, bool force)
{ {
return new MsgConfigureBladerf(settings); return new MsgConfigureBladerf(settings, force);
} }
private: private:
BladeRFOutputSettings m_settings; BladeRFOutputSettings m_settings;
bool m_force;
MsgConfigureBladerf(const BladeRFOutputSettings& settings) : MsgConfigureBladerf(const BladeRFOutputSettings& settings, bool force) :
Message(), Message(),
m_settings(settings) m_settings(settings),
m_force(force)
{ } { }
}; };

View File

@ -32,6 +32,7 @@ BladerfOutputGui::BladerfOutputGui(DeviceSinkAPI *deviceAPI, QWidget* parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::BladerfOutputGui), ui(new Ui::BladerfOutputGui),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_forceSettings(true),
m_settings(), m_settings(),
m_deviceSampleSink(NULL), m_deviceSampleSink(NULL),
m_sampleRate(0), m_sampleRate(0),
@ -113,6 +114,7 @@ bool BladerfOutputGui::deserialize(const QByteArray& data)
{ {
if(m_settings.deserialize(data)) { if(m_settings.deserialize(data)) {
displaySettings(); displaySettings();
m_forceSettings = true;
sendSettings(); sendSettings();
return true; return true;
} else { } else {
@ -321,8 +323,9 @@ void BladerfOutputGui::on_startStop_toggled(bool checked)
void BladerfOutputGui::updateHardware() void BladerfOutputGui::updateHardware()
{ {
qDebug() << "BladerfGui::updateHardware"; qDebug() << "BladerfGui::updateHardware";
BladerfOutput::MsgConfigureBladerf* message = BladerfOutput::MsgConfigureBladerf::create( m_settings); BladerfOutput::MsgConfigureBladerf* message = BladerfOutput::MsgConfigureBladerf::create( m_settings, m_forceSettings);
m_deviceSampleSink->getInputMessageQueue()->push(message); m_deviceSampleSink->getInputMessageQueue()->push(message);
m_forceSettings = false;
m_updateTimer.stop(); m_updateTimer.stop();
} }

View File

@ -55,6 +55,7 @@ private:
Ui::BladerfOutputGui* ui; Ui::BladerfOutputGui* ui;
DeviceSinkAPI* m_deviceAPI; DeviceSinkAPI* m_deviceAPI;
bool m_forceSettings;
BladeRFOutputSettings m_settings; BladeRFOutputSettings m_settings;
QTimer m_updateTimer; QTimer m_updateTimer;
QTimer m_statusTimer; QTimer m_statusTimer;

View File

@ -26,7 +26,7 @@
const PluginDescriptor BladerfOutputPlugin::m_pluginDescriptor = { const PluginDescriptor BladerfOutputPlugin::m_pluginDescriptor = {
QString("BladerRF Output"), QString("BladerRF Output"),
QString("3.5.5"), QString("3.7.4"),
QString("(c) Edouard Griffiths, F4EXB"), QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"), QString("https://github.com/f4exb/sdrangel"),
true, true,