BladeRF output: force settings at startup and on deserialize

pull/85/head
f4exb 2017-10-14 07:10:42 +02:00
rodzic 9eee869ccd
commit 6b1f0cc2fd
5 zmienionych plików z 14 dodań i 7 usunięć

Wyświetl plik

@ -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");
}

Wyświetl plik

@ -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)
{ }
};

Wyświetl plik

@ -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();
}

Wyświetl plik

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

Wyświetl plik

@ -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,