1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-04-04 10:38:45 -04:00

HackRF output: force settings at startup and on deserialize

This commit is contained in:
f4exb 2017-10-14 07:13:57 +02:00
parent 6b1f0cc2fd
commit 2d27235769
5 changed files with 14 additions and 7 deletions

View File

@ -183,7 +183,7 @@ bool HackRFOutput::handleMessage(const Message& message)
MsgConfigureHackRF& conf = (MsgConfigureHackRF&) message;
qDebug() << "HackRFOutput::handleMessage: MsgConfigureHackRF";
bool success = applySettings(conf.getSettings(), false);
bool success = applySettings(conf.getSettings(), conf.getForce());
if (!success)
{

View File

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

View File

@ -36,6 +36,7 @@ HackRFOutputGui::HackRFOutputGui(DeviceSinkAPI *deviceAPI, QWidget* parent) :
QWidget(parent),
ui(new Ui::HackRFOutputGui),
m_deviceAPI(deviceAPI),
m_forceSettings(true),
m_settings(),
m_deviceSampleSink(0),
m_lastEngineState((DSPDeviceSinkEngine::State)-1),
@ -110,6 +111,7 @@ bool HackRFOutputGui::deserialize(const QByteArray& data)
if(m_settings.deserialize(data))
{
displaySettings();
m_forceSettings = true;
sendSettings();
return true;
}
@ -322,8 +324,9 @@ void HackRFOutputGui::updateHardware()
if (m_doApplySettings)
{
qDebug() << "HackRFOutputGui::updateHardware";
HackRFOutput::MsgConfigureHackRF* message = HackRFOutput::MsgConfigureHackRF::create(m_settings);
HackRFOutput::MsgConfigureHackRF* message = HackRFOutput::MsgConfigureHackRF::create(m_settings, m_forceSettings);
m_deviceSampleSink->getInputMessageQueue()->push(message);
m_forceSettings = true;
m_updateTimer.stop();
}
}

View File

@ -65,6 +65,7 @@ private:
Ui::HackRFOutputGui* ui;
DeviceSinkAPI* m_deviceAPI;
bool m_forceSettings;
HackRFOutputSettings m_settings;
QTimer m_updateTimer;
QTimer m_statusTimer;

View File

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