mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-12-22 17:45:48 -05:00
Initial settings.
This commit is contained in:
parent
c364378824
commit
3ec45e00ad
@ -93,6 +93,9 @@ bool FCDInput::startInput(int device)
|
||||
|
||||
m_deviceDescription = QString("Funcube Dongle");
|
||||
|
||||
if (!applySettings(m_generalSettings, m_settings, true))
|
||||
qCritical("FCD: Unable to set config at start");
|
||||
|
||||
qDebug("FCDInput: start");
|
||||
return true;
|
||||
}
|
||||
@ -141,18 +144,25 @@ bool FCDInput::handleMessage(Message* message)
|
||||
bool FCDInput::applySettings(const GeneralSettings& generalSettings, const Settings& settings, bool force)
|
||||
{
|
||||
QMutexLocker mutexLocker(&m_mutex);
|
||||
bool freqChange;
|
||||
|
||||
if(!m_FCDThread)
|
||||
return false;
|
||||
|
||||
// TODO: Only call when changed
|
||||
m_FCDThread->set_lna_gain(settings.gain);
|
||||
m_FCDThread->set_bias_t(settings.bias);
|
||||
if((m_generalSettings.m_centerFrequency != generalSettings.m_centerFrequency))
|
||||
freqChange = true;
|
||||
else
|
||||
freqChange = false;
|
||||
|
||||
if((m_generalSettings.m_centerFrequency != generalSettings.m_centerFrequency) || force) {
|
||||
if(freqChange || force) {
|
||||
m_generalSettings.m_centerFrequency = generalSettings.m_centerFrequency;
|
||||
m_FCDThread->set_center_freq( (double)(generalSettings.m_centerFrequency) );
|
||||
}
|
||||
|
||||
if(!freqChange || force) {
|
||||
m_FCDThread->set_lna_gain(settings.gain);
|
||||
m_FCDThread->set_bias_t(settings.bias);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -41,11 +41,11 @@ void FCDThread::stopWork()
|
||||
|
||||
void FCDThread::run()
|
||||
{
|
||||
m_running = true;
|
||||
if ( !OpenSource("hw:CARD=V20") )
|
||||
return;
|
||||
// TODO: fallback to original fcd
|
||||
|
||||
m_running = true;
|
||||
while(m_running) {
|
||||
if ( work(BLOCKSIZE) < 0)
|
||||
break;
|
||||
|
@ -96,6 +96,7 @@ bool V4LInput::startInput(int device)
|
||||
|
||||
qDebug("V4LInput: start");
|
||||
MsgReportV4L::create(m_gains)->submit(m_guiMessageQueue);
|
||||
applySettings(m_generalSettings, m_settings, true);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user