Compare commits
3 Commits
master
...
direct_sam
Author | SHA1 | Date |
---|---|---|
Hoernchen | 7117971eed | |
Hoernchen | f43c4f6ea2 | |
Hoernchen | 372a35e229 |
|
@ -152,3 +152,34 @@ void RTLSDRGui::updateHardware()
|
|||
message->submit(m_pluginAPI->getDSPEngineMessageQueue());
|
||||
m_updateTimer.stop();
|
||||
}
|
||||
|
||||
void RTLSDRGui::on_checkBox_stateChanged(int state) {
|
||||
if (state == Qt::Checked){
|
||||
((RTLSDRInput*)m_sampleSource)->set_ds_mode((ui->radioButton->isChecked()) ? true : false);
|
||||
ui->radioButton->setEnabled(true);
|
||||
ui->radioButton_2->setEnabled(true);
|
||||
ui->gain->setEnabled(false);
|
||||
//ui->decimation->setMaximum(6);
|
||||
|
||||
ui->centerFrequency->setValueRange(5, 0U, 30000U);
|
||||
ui->centerFrequency->setValue(0);
|
||||
}
|
||||
else {
|
||||
((RTLSDRInput*)m_sampleSource)->set_ds_mode(0);
|
||||
ui->radioButton->setEnabled(false);
|
||||
ui->radioButton_2->setEnabled(false);
|
||||
ui->gain->setEnabled(true);
|
||||
//ui->decimation->setMaximum(4);
|
||||
|
||||
ui->centerFrequency->setValueRange(7, 20000U, 2200000U);
|
||||
}
|
||||
}
|
||||
|
||||
void RTLSDRGui::on_radioButton_toggled(bool checked){
|
||||
if (checked)
|
||||
((RTLSDRInput*)m_sampleSource)->set_ds_mode(1);
|
||||
}
|
||||
void RTLSDRGui::on_radioButton_2_toggled(bool checked){
|
||||
if (checked)
|
||||
((RTLSDRInput*)m_sampleSource)->set_ds_mode(2);
|
||||
}
|
|
@ -46,6 +46,9 @@ private slots:
|
|||
void on_centerFrequency_changed(quint64 value);
|
||||
void on_gain_valueChanged(int value);
|
||||
void on_decimation_valueChanged(int value);
|
||||
void on_checkBox_stateChanged(int state);
|
||||
void on_radioButton_toggled(bool checked);
|
||||
void on_radioButton_2_toggled(bool checked);
|
||||
|
||||
void updateHardware();
|
||||
};
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>132</width>
|
||||
<height>82</height>
|
||||
<height>119</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
|
@ -214,6 +214,63 @@
|
|||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox">
|
||||
<property name="text">
|
||||
<string>ds</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>i</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton_2">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>q</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
|
|
|
@ -228,3 +228,8 @@ bool RTLSDRInput::applySettings(const GeneralSettings& generalSettings, const Se
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void RTLSDRInput::set_ds_mode(int on){
|
||||
rtlsdr_set_direct_sampling(m_dev, on);
|
||||
}
|
|
@ -91,6 +91,9 @@ public:
|
|||
|
||||
bool handleMessage(Message* message);
|
||||
|
||||
|
||||
void set_ds_mode(int on);
|
||||
|
||||
private:
|
||||
QMutex m_mutex;
|
||||
Settings m_settings;
|
||||
|
|
|
@ -5,6 +5,13 @@ FFTWEngine::FFTWEngine() :
|
|||
m_plans(),
|
||||
m_currentPlan(NULL)
|
||||
{
|
||||
configure(128, false);
|
||||
configure(256, false);
|
||||
configure(512, false);
|
||||
configure(1024, false);
|
||||
configure(2048, false);
|
||||
configure(4096, false);
|
||||
configure(8192, false);
|
||||
}
|
||||
|
||||
FFTWEngine::~FFTWEngine()
|
||||
|
|
|
@ -69,8 +69,6 @@ bool SampleFifo::setSize(int size)
|
|||
|
||||
uint SampleFifo::write(const quint8* data, uint count)
|
||||
{
|
||||
return write(SampleVector::const_iterator((Sample*)data), SampleVector::const_iterator((Sample*)(data + count)));
|
||||
#if 0
|
||||
QMutexLocker mutexLocker(&m_mutex);
|
||||
uint total;
|
||||
uint remaining;
|
||||
|
@ -78,8 +76,6 @@ uint SampleFifo::write(const quint8* data, uint count)
|
|||
const Sample* begin = (const Sample*)data;
|
||||
count /= sizeof(Sample);
|
||||
|
||||
//qDebug("write pre count %d %u", count, m_fill);
|
||||
|
||||
total = MIN(count, m_size - m_fill);
|
||||
if(total < count) {
|
||||
if(m_suppressed < 0) {
|
||||
|
@ -100,22 +96,17 @@ uint SampleFifo::write(const quint8* data, uint count)
|
|||
remaining = total;
|
||||
while(remaining > 0) {
|
||||
len = MIN(remaining, m_size - m_tail);
|
||||
//qDebug("write remaining %u, len %u", remaining, len);
|
||||
std::copy(begin, begin + len, m_data.begin() + m_tail);
|
||||
m_tail += len;
|
||||
m_tail %= m_size;
|
||||
m_tail = (m_tail + len) % m_size;
|
||||
m_fill += len;
|
||||
begin += len;
|
||||
remaining -= len;
|
||||
}
|
||||
|
||||
//qDebug("write post count %d %u [%u;%u]", count, m_fill, m_head, m_tail);
|
||||
|
||||
if(m_fill > 0)
|
||||
emit dataReady();
|
||||
|
||||
return total;
|
||||
#endif
|
||||
}
|
||||
|
||||
uint SampleFifo::write(SampleVector::const_iterator begin, SampleVector::const_iterator end)
|
||||
|
|
Loading…
Reference in New Issue