mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-26 09:48:45 -05:00
AirSpy: force settings at startup and on deserialize
This commit is contained in:
parent
ccd2e04f0b
commit
4af7c40641
@ -34,6 +34,7 @@ AirspyGui::AirspyGui(DeviceSourceAPI *deviceAPI, QWidget* parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::AirspyGui),
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_forceSettings(true),
|
||||
m_settings(),
|
||||
m_sampleSource(0),
|
||||
m_lastEngineState((DSPDeviceSourceEngine::State)-1)
|
||||
@ -53,6 +54,8 @@ AirspyGui::AirspyGui(DeviceSourceAPI *deviceAPI, QWidget* parent) :
|
||||
m_rates = ((AirspyInput*) m_sampleSource)->getSampleRates();
|
||||
displaySampleRates();
|
||||
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection);
|
||||
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
AirspyGui::~AirspyGui()
|
||||
@ -103,6 +106,7 @@ bool AirspyGui::deserialize(const QByteArray& data)
|
||||
{
|
||||
if(m_settings.deserialize(data)) {
|
||||
displaySettings();
|
||||
m_forceSettings = true;
|
||||
sendSettings();
|
||||
return true;
|
||||
} else {
|
||||
@ -375,8 +379,9 @@ void AirspyGui::on_transverter_clicked()
|
||||
void AirspyGui::updateHardware()
|
||||
{
|
||||
qDebug() << "AirspyGui::updateHardware";
|
||||
AirspyInput::MsgConfigureAirspy* message = AirspyInput::MsgConfigureAirspy::create( m_settings);
|
||||
AirspyInput::MsgConfigureAirspy* message = AirspyInput::MsgConfigureAirspy::create(m_settings, m_forceSettings);
|
||||
m_sampleSource->getInputMessageQueue()->push(message);
|
||||
m_forceSettings = false;
|
||||
m_updateTimer.stop();
|
||||
}
|
||||
|
||||
|
@ -58,6 +58,7 @@ private:
|
||||
Ui::AirspyGui* ui;
|
||||
|
||||
DeviceSourceAPI* m_deviceAPI;
|
||||
bool m_forceSettings;
|
||||
AirspySettings m_settings;
|
||||
QTimer m_updateTimer;
|
||||
QTimer m_statusTimer;
|
||||
|
@ -227,7 +227,7 @@ bool AirspyInput::handleMessage(const Message& message)
|
||||
MsgConfigureAirspy& conf = (MsgConfigureAirspy&) message;
|
||||
qDebug() << "AirspyInput::handleMessage: MsgConfigureAirspy";
|
||||
|
||||
bool success = applySettings(conf.getSettings(), false);
|
||||
bool success = applySettings(conf.getSettings(), conf.getForce());
|
||||
|
||||
if (!success)
|
||||
{
|
||||
|
@ -34,18 +34,21 @@ public:
|
||||
|
||||
public:
|
||||
const AirspySettings& getSettings() const { return m_settings; }
|
||||
bool getForce() const { return m_force; }
|
||||
|
||||
static MsgConfigureAirspy* create(const AirspySettings& settings)
|
||||
static MsgConfigureAirspy* create(const AirspySettings& settings, bool force)
|
||||
{
|
||||
return new MsgConfigureAirspy(settings);
|
||||
return new MsgConfigureAirspy(settings, force);
|
||||
}
|
||||
|
||||
private:
|
||||
AirspySettings m_settings;
|
||||
bool m_force;
|
||||
|
||||
MsgConfigureAirspy(const AirspySettings& settings) :
|
||||
MsgConfigureAirspy(const AirspySettings& settings, bool force) :
|
||||
Message(),
|
||||
m_settings(settings)
|
||||
m_settings(settings),
|
||||
m_force(force)
|
||||
{ }
|
||||
};
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
||||
|
||||
const PluginDescriptor AirspyPlugin::m_pluginDescriptor = {
|
||||
QString("Airspy Input"),
|
||||
QString("3.7.3"),
|
||||
QString("3.7.4"),
|
||||
QString("(c) Edouard Griffiths, F4EXB"),
|
||||
QString("https://github.com/f4exb/sdrangel"),
|
||||
true,
|
||||
|
Loading…
Reference in New Issue
Block a user