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:
parent
9eee869ccd
commit
6b1f0cc2fd
@ -207,7 +207,7 @@ bool BladerfOutput::handleMessage(const Message& message)
|
||||
MsgConfigureBladerf& conf = (MsgConfigureBladerf&) message;
|
||||
qDebug() << "BladerfInput::handleMessage: MsgConfigureBladerf";
|
||||
|
||||
if (!applySettings(conf.getSettings(), false))
|
||||
if (!applySettings(conf.getSettings(), conf.getForce()))
|
||||
{
|
||||
qDebug("BladeRF config error");
|
||||
}
|
||||
|
@ -36,18 +36,21 @@ public:
|
||||
|
||||
public:
|
||||
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:
|
||||
BladeRFOutputSettings m_settings;
|
||||
bool m_force;
|
||||
|
||||
MsgConfigureBladerf(const BladeRFOutputSettings& settings) :
|
||||
MsgConfigureBladerf(const BladeRFOutputSettings& settings, bool force) :
|
||||
Message(),
|
||||
m_settings(settings)
|
||||
m_settings(settings),
|
||||
m_force(force)
|
||||
{ }
|
||||
};
|
||||
|
||||
|
@ -32,6 +32,7 @@ BladerfOutputGui::BladerfOutputGui(DeviceSinkAPI *deviceAPI, QWidget* parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::BladerfOutputGui),
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_forceSettings(true),
|
||||
m_settings(),
|
||||
m_deviceSampleSink(NULL),
|
||||
m_sampleRate(0),
|
||||
@ -113,6 +114,7 @@ bool BladerfOutputGui::deserialize(const QByteArray& data)
|
||||
{
|
||||
if(m_settings.deserialize(data)) {
|
||||
displaySettings();
|
||||
m_forceSettings = true;
|
||||
sendSettings();
|
||||
return true;
|
||||
} else {
|
||||
@ -321,8 +323,9 @@ void BladerfOutputGui::on_startStop_toggled(bool checked)
|
||||
void BladerfOutputGui::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_forceSettings = false;
|
||||
m_updateTimer.stop();
|
||||
}
|
||||
|
||||
|
@ -55,6 +55,7 @@ private:
|
||||
Ui::BladerfOutputGui* ui;
|
||||
|
||||
DeviceSinkAPI* m_deviceAPI;
|
||||
bool m_forceSettings;
|
||||
BladeRFOutputSettings m_settings;
|
||||
QTimer m_updateTimer;
|
||||
QTimer m_statusTimer;
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
const PluginDescriptor BladerfOutputPlugin::m_pluginDescriptor = {
|
||||
QString("BladerRF Output"),
|
||||
QString("3.5.5"),
|
||||
QString("3.7.4"),
|
||||
QString("(c) Edouard Griffiths, F4EXB"),
|
||||
QString("https://github.com/f4exb/sdrangel"),
|
||||
true,
|
||||
|
Loading…
Reference in New Issue
Block a user