No-Mod Direct Sampling.

This commit is contained in:
John Greb 2014-11-09 12:56:53 +00:00
parent 812d0f4d15
commit f793f635af
4 changed files with 13 additions and 52 deletions

View File

@ -10,7 +10,7 @@ RTLSDRGui::RTLSDRGui(PluginAPI* pluginAPI, QWidget* parent) :
m_sampleSource(NULL)
{
ui->setupUi(this);
ui->centerFrequency->setValueRange(7, 28900U, 1700000U);
ui->centerFrequency->setValueRange(7, 28500U, 1700000U);
connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware()));
displaySettings();
@ -157,28 +157,21 @@ void RTLSDRGui::updateHardware()
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);
// Direct Modes: 0: off, 1: I, 2: Q, 3: NoMod.
((RTLSDRInput*)m_sampleSource)->set_ds_mode(3);
ui->gain->setEnabled(false);
ui->centerFrequency->setValueRange(7, 1000U, 28700U);
ui->centerFrequency->setValue(27000);
ui->centerFrequency->setValueRange(7, 1000U, 275000U);
ui->centerFrequency->setValue(7000);
m_generalSettings.m_centerFrequency = 7000 * 1000;
}
else {
((RTLSDRInput*)m_sampleSource)->set_ds_mode(0);
ui->radioButton->setEnabled(false);
ui->radioButton_2->setEnabled(false);
ui->gain->setEnabled(true);
ui->centerFrequency->setValueRange(7, 28900U, 1700000U);
ui->centerFrequency->setValue(29000);
ui->centerFrequency->setValueRange(7, 28500U, 1700000U);
ui->centerFrequency->setValue(434000);
ui->gain->setValue(0);
m_generalSettings.m_centerFrequency = 434000 * 1000;
}
sendSettings();
}
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);
}

View File

@ -47,9 +47,6 @@ private slots:
void on_gain_valueChanged(int value);
void on_samplerate_valueChanged(int value);
void on_checkBox_stateChanged(int state);
void on_radioButton_toggled(bool checked);
void on_radioButton_2_toggled(bool checked);
void updateHardware();
};

View File

@ -226,33 +226,7 @@
<item>
<widget class="QCheckBox" name="checkBox">
<property name="text">
<string>Direct Sampling: </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>
<string>No-mod Direct Sampling</string>
</property>
</widget>
</item>

View File

@ -23,7 +23,6 @@
#include <QWaitCondition>
#include <rtl-sdr.h>
#include "dsp/samplefifo.h"
#include "dsp/inthalfbandfilter.h"
class RTLSDRThread : public QThread {
Q_OBJECT
@ -34,8 +33,7 @@ public:
void startWork();
void stopWork();
void setSamplerate(int sanplerate);
void setSamplerate(int samplerate);
private:
QMutex m_startWaitMutex;
@ -49,7 +47,6 @@ private:
int m_samplerate;
void run();
void decimate2(SampleVector::iterator* it, const quint8* buf, qint32 len);
void decimate4(SampleVector::iterator* it, const quint8* buf, qint32 len);
void decimate8(SampleVector::iterator* it, const quint8* buf, qint32 len);