1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 09:48:45 -05:00

FCD Pro+: force settings at startup and on deserialize

This commit is contained in:
f4exb 2017-10-14 09:37:55 +02:00
parent a4ea78f037
commit 5c99a8310f
4 changed files with 13 additions and 6 deletions

View File

@ -32,6 +32,7 @@ FCDProPlusGui::FCDProPlusGui(DeviceSourceAPI *deviceAPI, QWidget* parent) :
QWidget(parent),
ui(new Ui::FCDProPlusGui),
m_deviceAPI(deviceAPI),
m_forceSettings(true),
m_settings(),
m_sampleSource(NULL),
m_lastEngineState((DSPDeviceSourceEngine::State)-1)
@ -113,6 +114,7 @@ bool FCDProPlusGui::deserialize(const QByteArray& data)
if(m_settings.deserialize(data))
{
displaySettings();
m_forceSettings = true;
sendSettings();
return true;
}
@ -216,8 +218,9 @@ void FCDProPlusGui::on_iqImbalance_toggled(bool checked)
void FCDProPlusGui::updateHardware()
{
FCDProPlusInput::MsgConfigureFCD* message = FCDProPlusInput::MsgConfigureFCD::create(m_settings);
FCDProPlusInput::MsgConfigureFCD* message = FCDProPlusInput::MsgConfigureFCD::create(m_settings, m_forceSettings);
m_sampleSource->getInputMessageQueue()->push(message);
m_forceSettings = false;
m_updateTimer.stop();
}

View File

@ -54,6 +54,7 @@ private:
Ui::FCDProPlusGui* ui;
DeviceSourceAPI* m_deviceAPI;
bool m_forceSettings;
FCDProPlusSettings m_settings;
QTimer m_updateTimer;
QTimer m_statusTimer;

View File

@ -169,7 +169,7 @@ bool FCDProPlusInput::handleMessage(const Message& message)
{
qDebug() << "FCDProPlusInput::handleMessage: MsgConfigureFCD";
MsgConfigureFCD& conf = (MsgConfigureFCD&) message;
applySettings(conf.getSettings(), false);
applySettings(conf.getSettings(), conf.getForce());
return true;
}
else if (MsgFileRecord::match(message))

View File

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