RTL-SDR: force settings at startup and on deserialize

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

Wyświetl plik

@ -33,6 +33,7 @@ RTLSDRGui::RTLSDRGui(DeviceSourceAPI *deviceAPI, QWidget* parent) :
QWidget(parent),
ui(new Ui::RTLSDRGui),
m_deviceAPI(deviceAPI),
m_forceSettings(true),
m_settings(),
m_sampleSource(0),
m_lastEngineState((DSPDeviceSourceEngine::State)-1)
@ -117,6 +118,7 @@ bool RTLSDRGui::deserialize(const QByteArray& data)
{
displayGains();
displaySettings();
m_forceSettings = true;
sendSettings();
return true;
}
@ -345,8 +347,9 @@ void RTLSDRGui::on_transverter_clicked()
void RTLSDRGui::updateHardware()
{
RTLSDRInput::MsgConfigureRTLSDR* message = RTLSDRInput::MsgConfigureRTLSDR::create(m_settings);
RTLSDRInput::MsgConfigureRTLSDR* message = RTLSDRInput::MsgConfigureRTLSDR::create(m_settings, m_forceSettings);
m_sampleSource->getInputMessageQueue()->push(message);
m_forceSettings = false;
m_updateTimer.stop();
}

Wyświetl plik

@ -55,6 +55,7 @@ private:
Ui::RTLSDRGui* ui;
DeviceSourceAPI* m_deviceAPI;
bool m_forceSettings;
RTLSDRSettings m_settings;
QTimer m_updateTimer;
QTimer m_statusTimer;

Wyświetl plik

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

Wyświetl plik

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

Wyświetl plik

@ -11,7 +11,7 @@
const PluginDescriptor RTLSDRPlugin::m_pluginDescriptor = {
QString("RTL-SDR Input"),
QString("3.7.3"),
QString("3.7.4"),
QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"),
true,